当前位置: 首页 > news >正文

ElasticsearchJavaClient工具类分析

最近升级了Elasticsearch版本,从7.X升级到8.X的变化还是比较大的,原来7版本用的是RestHighLevelClient,8.X弃用RestHighLevelClient转而支持ElasticsearchClient,并且api调用方式经过建造者模式的改造,变成了链式调用。

因此为了更好地使用ElasticsearchClient的api操作Elasticsearch,封装了一个工具类,包含了常用的一些数据操作的方法。废话不多说直接上代码。。。

1、pom依赖

        <dependency><groupId>co.elastic.clients</groupId><artifactId>elasticsearch-java</artifactId><version>8.15.2</version></dependency><dependency><artifactId>elasticsearch-rest-client</artifactId><groupId>org.elasticsearch.client</groupId><version>8.15.2</version></dependency><dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>2.0.30</version></dependency>

2、工具类代码

import co.elastic.clients.elasticsearch.ElasticsearchClient;
import co.elastic.clients.elasticsearch._types.Result;
import co.elastic.clients.elasticsearch._types.SortOrder;
import co.elastic.clients.elasticsearch._types.Time;
import co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery;
import co.elastic.clients.elasticsearch.core.*;
import co.elastic.clients.elasticsearch.core.bulk.BulkOperation;
import co.elastic.clients.elasticsearch.indices.AnalyzeRequest;
import co.elastic.clients.elasticsearch.indices.AnalyzeResponse;
import co.elastic.clients.elasticsearch.indices.CreateIndexResponse;
import co.elastic.clients.elasticsearch.indices.analyze.AnalyzeToken;
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
import co.elastic.clients.transport.rest_client.RestClientTransport;
import com.alibaba.fastjson.JSONObject;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import java.io.IOException;
import java.io.StringReader;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;/*** Elasticsearch工具类* Elasticsearch版本:8.15.3*/
public class ElasticsearchJavaClient {private ElasticsearchClient client;/*** 构造方法,获取客户端(未开启认证)* @param httpUrls*/public ElasticsearchJavaClient(String[] httpUrls){HttpHost[] httpHosts = Arrays.stream(httpUrls).map(HttpHost::create).toArray(HttpHost[]::new);this.client = new ElasticsearchClient(new RestClientTransport(RestClient.builder(httpHosts).build(),new JacksonJsonpMapper()));}/*** 构造方法,获取客户端(开启认证,通过用户名密码进行认证并获取客户端)* @param httpUrls* @param username* @param password*/public ElasticsearchJavaClient(String[] httpUrls, String username, String password){HttpHost[] httpHosts = Arrays.stream(httpUrls).map(HttpHost::create).toArray(HttpHost[]::new);final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));RestClientBuilder builder = RestClient.builder(httpHosts);builder.setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {@Overridepublic HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpAsyncClientBuilder) {return httpAsyncClientBuilder.setDefaultCredentialsProvider(credentialsProvider);}});this.client = new ElasticsearchClient(new RestClientTransport(builder.build(), new JacksonJsonpMapper()));}/*** 创建索引* @param indexName  索引名* @param numberOfShards  分片数* @param numberOfReplicas  副本数* @param mapping  mapping设计json字符串* @return*/public boolean createIndex(String indexName, Integer numberOfShards,Integer numberOfReplicas, String mapping) {CreateIndexResponse response = null;try {response = client.indices().create(builder -> builder.index(indexName).settings(b -> b.numberOfReplicas(numberOfReplicas.toString()).numberOfShards(numberOfShards.toString())).mappings(a -> a.withJson(new StringReader(mapping))));} catch (IOException e) {e.printStackTrace();} finally {client.shutdown();}return response.acknowledged();}/*** 删除索引* @param indexName  索引名* @return*/public boolean deleteIndex(String indexName) {try {return client.indices().delete(a -> a.index(indexName)).acknowledged();} catch (IOException e) {e.printStackTrace();} finally {client.shutdown();}return false;}/*** 判断索引是否已存在* @param indexName 索引名* @return*/public boolean indexExisit(String indexName) {try {return client.indices().exists(req -> req.index(indexName)).value();} catch (IOException e) {e.printStackTrace();} finally {client.shutdown();}return false;}/*** 由于数据落盘有默认的1秒延迟,刷新后使数据能被检索到* @param indexString*/public void refresh(String indexString){try {client.indices().refresh(req -> req.index(indexString));} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}}/*** 插入数据* @param indexName* @param data* @return*/public String insertData(String indexName, JSONObject data){try {IndexResponse response = client.index(a -> a.index(indexName).document(data));return response.id();} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return null;}/*** 根据索引和_id查询数据* @param indexName* @param id* @return*/public Map<String, Object> getDocById(String indexName, String id) {GetRequest request = GetRequest.of(g -> g.index(indexName).id(id));try {GetResponse<Map> response = client.get(request, Map.class);if(response.found()){return response.source();}} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return null;}/*** 根据索引和_id查询数据* @param indexName* @param id* @return*/public JSONObject getDocInfoById(String indexName, String id) {GetRequest request = GetRequest.of(g -> g.index(indexName).id(id));try {GetResponse<JSONObject> response = client.get(request, JSONObject.class);if(response.found()){return response.source();}} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return null;}/*** 根据索引和_id查询数据,并过滤掉无需返回的字段* @param indexName* @param id* @param excludes* @return*/public JSONObject getDocInfoById(String indexName, String id, String [] excludes) {GetRequest request = GetRequest.of(g -> g.index(indexName).id(id).sourceExcludes(Arrays.asList(excludes)));try {GetResponse<JSONObject> response = client.get(request, JSONObject.class);if(response.found()){return response.source();}} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return null;}/*** 根据索引和_id查询数据,并过指定要返回的字段* @param indexName* @param id* @param includes* @return*/public JSONObject getDocInfoByIdWithIncludes(String indexName, String id, String [] includes) {GetRequest request = GetRequest.of(g -> g.index(indexName).id(id).sourceIncludes(Arrays.asList(includes)));try {GetResponse<JSONObject> response = client.get(request, JSONObject.class);if(response.found()){return response.source();}} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return null;}/*** 判断数据是否存在* @param indexName* @param id* @return*/public boolean exists(String indexName, String id) {GetRequest request = GetRequest.of(g -> g.index(indexName).id(id));try {GetResponse<JSONObject> response = client.get(request, JSONObject.class);return response.found();} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return false;}/*** 根据索引和_id删除数据* @param indexName* @param id* @return*/public boolean deleteDocById(String indexName, String id) {DeleteRequest request = DeleteRequest.of(a -> a.index(indexName).id(id));try {DeleteResponse response = client.delete(request);if(response != null && response.result() != null){return Result.Deleted.jsonValue().equals(response.result().jsonValue());}} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return false;}/*** 更新数据* @param indexName* @param id* @param newDoc* @return*/public boolean updateDocById(String indexName, String id, JSONObject newDoc) {UpdateRequest request = UpdateRequest.of(r -> r.id(id).index(indexName).doc(newDoc));request.refresh();try {UpdateResponse response = client.update(request, JSONObject.class);if(response != null && response.result() != null){return Result.Updated.jsonValue().equals(response.result().jsonValue());}} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return false;}/*** 对输入的text使用analyzerName进行分词,返回分词后的词项* @param analyzerName* @param text* @return*/public List<AnalyzeToken> analyze(String analyzerName, String text){AnalyzeRequest analyzeRequest = new AnalyzeRequest.Builder().analyzer(analyzerName).text(text).build();AnalyzeResponse response = null;try {response = client.indices().analyze(analyzeRequest);} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return response.tokens();}/*** 批量删除* @param requestList* @return*/public boolean bulkDelete(List<DeleteRequest> requestList){List<BulkOperation> ops = requestList.stream().map(req -> BulkOperation.of(op -> op.delete(d -> d.id(req.id()).index(req.index())))).collect(Collectors.toList());try {BulkResponse response = client.bulk(r -> r.operations(ops));if(response != null ){return true;}} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return false;}/*** 批量更新* @param requestList* @return*/public boolean bulkUpdate(List<UpdateRequest> requestList){List<BulkOperation> ops = requestList.stream().map(req -> BulkOperation.of(op -> op.update(d -> d.id(req.id()).index(req.index()).action(a -> a.doc(req.doc()))))).collect(Collectors.toList());try {BulkResponse response = client.bulk(r -> r.operations(ops));if(response != null ){return true;}} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return false;}/*** 批量插入数据* @param requestList* @return*/public boolean bulkInsert(List<IndexRequest> requestList){List<BulkOperation> ops = requestList.stream().map(req -> BulkOperation.of(op -> op.index(i -> i.document(req.document()).index(req.index())))).collect(Collectors.toList());try {BulkResponse response = client.bulk(r -> r.operations(ops));if(response != null ){return true;}} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return false;}/*** 通过脚本批量更新* @param index* @param query* @param script* @return*/public boolean updateByquery(String index, BoolQuery query, String script){try {UpdateByQueryResponse response = client.updateByQuery(q -> q.index(index).query(query._toQuery()).script(s -> s.source(script)));if(response != null ){return true;}} catch (IOException e) {e.printStackTrace();}finally {client.shutdown();}return false;}/*** 检索* @param indexName* @param pageNo* @param pageSize* @param sortField* @param sortOrder* @param boolQuery* @return*/public SearchResponse search(String indexName, Integer pageNo, Integer pageSize,String sortField, SortOrder sortOrder, BoolQuery boolQuery) {SearchRequest request = new SearchRequest.Builder().index(indexName).query(q -> q.bool(boolQuery)).from((pageNo - 1) * pageSize).size(pageSize).sort(s -> s.field(f -> f.field(sortField).order(sortOrder))).build();SearchResponse response = null;try {response = client.search(request, JSONObject.class);} catch (IOException e) {e.printStackTrace();}return response;}public SearchResponse search(String indexName, Integer pageNo, Integer pageSize,String sortField, SortOrder sortOrder, BoolQuery boolQuery, String[] excludes) {SearchRequest request = new SearchRequest.Builder().index(indexName).query(q -> q.bool(boolQuery)).source(a -> a.filter(f -> f.excludes(Arrays.asList(excludes)))).from((pageNo - 1) * pageSize).size(pageSize).sort(s -> s.field(f -> f.field(sortField).order(sortOrder))).build();SearchResponse response = null;try {response = client.search(request, JSONObject.class);} catch (IOException e) {e.printStackTrace();}return response;}public SearchResponse search(String indexName, Integer pageNo, Integer pageSize, BoolQuery boolQuery,String sortField, SortOrder sortOrder, String sortField2, SortOrder sortOrder2) {SearchRequest request = new SearchRequest.Builder().index(indexName).query(q -> q.bool(boolQuery)).from((pageNo - 1) * pageSize).size(pageSize).sort(s -> s.field(f -> f.field(sortField).order(sortOrder).field(sortField2).order(sortOrder2))).build();SearchResponse response = null;try {response = client.search(request, JSONObject.class);} catch (IOException e) {e.printStackTrace();}return response;}public SearchResponse search(String indexName, Integer pageNo, Integer pageSize, BoolQuery boolQuery,String sortField, SortOrder sortOrder, String sortField2, SortOrder sortOrder2,String[] excludes) {SearchRequest request = new SearchRequest.Builder().index(indexName).query(q -> q.bool(boolQuery)).source(a -> a.filter(f -> f.excludes(Arrays.asList(excludes)))).from((pageNo - 1) * pageSize).size(pageSize).sort(s -> s.field(f -> f.field(sortField).order(sortOrder).field(sortField2).order(sortOrder2))).build();SearchResponse response = null;try {response = client.search(request, JSONObject.class);} catch (IOException e) {e.printStackTrace();}return response;}public SearchResponse search(String indexName, Integer pageNo, Integer pageSize, BoolQuery boolQuery,String sortField, SortOrder sortOrder, String[] includes, String[] excludes) {SearchRequest request = new SearchRequest.Builder().index(indexName).query(q -> q.bool(boolQuery)).source(a -> a.filter(f -> f.excludes(Arrays.asList(excludes)).includes(Arrays.asList(includes)))).from((pageNo - 1) * pageSize).size(pageSize).sort(s -> s.field(f -> f.field(sortField).order(sortOrder))).build();SearchResponse response = null;try {response = client.search(request, JSONObject.class);} catch (IOException e) {e.printStackTrace();}return response;}public SearchResponse search(String indexName, Integer pageNo, Integer pageSize,  BoolQuery boolQuery,String sortField, SortOrder sortOrder, String time) {SearchRequest request = new SearchRequest.Builder().index(indexName).query(q -> q.bool(boolQuery)).from((pageNo - 1) * pageSize).size(pageSize).scroll(new Time.Builder().time(time).build()).sort(s -> s.field(f -> f.field(sortField).order(sortOrder))).build();SearchResponse response = null;try {response = client.search(request, JSONObject.class);} catch (IOException e) {e.printStackTrace();}return response;}/*** 查询符合条件的数据条数* @param indexName* @param boolQuery* @return*/public CountResponse count(String indexName, BoolQuery boolQuery) {try {return client.count(c -> c.index(indexName).query(q -> q.bool(boolQuery)));} catch (IOException e) {e.printStackTrace();}return null;}public SearchResponse search(String indexName, BoolQuery boolQuery) {SearchRequest request = new SearchRequest.Builder().index(indexName).query(q -> q.bool(boolQuery)).build();SearchResponse response = null;try {response = client.search(request, JSONObject.class);} catch (IOException e) {e.printStackTrace();}return response;}public SearchResponse search(String indexName, BoolQuery boolQuery, int size) {SearchRequest request = new SearchRequest.Builder().index(indexName).query(q -> q.bool(boolQuery)).size(size).build();SearchResponse response = null;try {response = client.search(request, JSONObject.class);} catch (IOException e) {e.printStackTrace();}return response;}
}

如果本文对你有帮助,请点赞、收藏 + 关注,谢谢!!(本文将持续更新)

相关文章:

ElasticsearchJavaClient工具类分析

最近升级了Elasticsearch版本&#xff0c;从7.X升级到8.X的变化还是比较大的&#xff0c;原来7版本用的是RestHighLevelClient&#xff0c;8.X弃用RestHighLevelClient转而支持ElasticsearchClient&#xff0c;并且api调用方式经过建造者模式的改造&#xff0c;变成了链式调用。…...

Docker-文章目录

为什么互联网公司离不开Docker容器化&#xff0c;它到底解决了什么问题&#xff1f; VMware下Centos7安装步骤 Windows安装Docker Linux安装Docker Docker快速安装Tomcat 在docker中对MySQL快速部署与初始数据 利用Dockerfile构建自定义镜像 Dockerfile基础指令 Docker…...

docker安装codeserver 运行vite项目(linux)

估计很多人遇到了codeserver安装后执行vite项目 有proxy路径的问题 我这边去掉了路径代理直接端口访问 防火墙记得打开 8089 和 5173端口 code-server路径 服务器ip:8089 项目路径 服务器ip:5173 docker安装codeserver&#xff08;linux&#xff09; mkdir -p ~/.config dock…...

Electron快速入门——跨平台桌面端应用开发框架

个人简介 &#x1f440;个人主页&#xff1a; 前端杂货铺 &#x1f64b;‍♂️学习方向&#xff1a; 主攻前端方向&#xff0c;正逐渐往全干发展 &#x1f4c3;个人状态&#xff1a; 研发工程师&#xff0c;现效力于中国工业软件事业 &#x1f680;人生格言&#xff1a; 积跬步…...

Delphi+SQL Server实现的(GUI)户籍管理系统

1.项目简介 本项目是一个户籍管理系统&#xff0c;用于记录住户身份信息&#xff0c;提供新户登记&#xff08;增加&#xff09;、户籍变更&#xff08;修改&#xff09;、户籍注销&#xff08;删除&#xff09;、户籍查询、曾用名查询、迁户记录查询以及创建备份、删除备份共8…...

【JavaEE进阶】获取Cookie/Session

&#x1f340;Cookie简介 HTTP协议自身是属于 "⽆状态"协议. "⽆状态"的含义指的是: 默认情况下 HTTP 协议的客⼾端和服务器之间的这次通信,和下次通信之间没有直接的联系.但是实际开发中,我们很多时候是需要知道请求之间的关联关系的. 例如登陆⽹站成…...

在macOS上安装Flutter和环境配置

操作系统 Flutter 支持在 macOS 11 (Big Sur) 或更高版本上开发。本指南假定你的 Mac 默认运行 zsh shell。 如果你的 Mac 是 Apple silicon 处理器&#xff0c;那么有些 Flutter 组件就需要通过 Rosetta 2 来转换适配&#xff08;详情&#xff09;。要在 Apple silicon 处理器…...

【电子通识】PWM驱动让有刷直流电机恒流工作

电机的典型驱动方法包括电压驱动、电流驱动以及PWM驱动。本文将介绍采用PWM驱动方式的恒流工作。 首先介绍的是什么是PWM驱动的电机恒流工作&#xff0c;其次是PWM驱动电机恒流工作时电路的工作原理。 PWM驱动 当以恒定的电流驱动电机时&#xff0c;电机会怎样工作呢&#xff1…...

Maven在不同操作系统上如何安装?

大家好&#xff0c;我是袁庭新。Maven是一个重要的工具&#xff0c;还有很多初学者竟然不知道如何安装Maven&#xff1f;这篇文章将系统介绍如何在Windows、macOS、Linux操作系统上安装Maven。 Maven是一个基于Java的项目管理工具。因此&#xff0c;最基本的要求是在计算机上安…...

maven如何从外部导包

1.找到你项目的文件位置&#xff0c;将外部要导入的包复制粘贴进你当前要导入的项目下。 2.从你的项目目录下选中要导入的包的pom文件即可导包成功 注意一定是选中对应的pom文件 导入成功之后对应的pom.xml文件就会被点亮...

如何在 Hive SQL 中处理复杂的数据类型?

目录 一、复杂数据类型简介 二、创建表时使用复杂数据类型 三、插入数据到复杂数据类型的表 四、查询复杂数据类型...

数据结构:DisjointSet

Disjoint Sets意思是一系列没有重复元素的集合。一种常见的实现叫做&#xff0c;Disjoint-set Forest可以以接近常数的时间复杂度查询元素所属集合&#xff0c;用来确定两个元素是否同属一个集合等&#xff0c;是效率最高的常见数据结构之一。 Wiki链接&#xff1a;https://en…...

中国省级产业结构高级化及合理化数据测算(2000-2023年)

一、数据介绍 数据名称&#xff1a;中国省级产业结构高级化、泰尔指数 数据年份&#xff1a;2000-2023年 数据范围&#xff1a;31个省份 数据来源&#xff1a;中国统计年鉴、国家统计局 数据整理&#xff1a;内含原始版本、线性插值版本、ARIMA填补版本 数据说明&#xf…...

Nginx不使用域名如何配置证书

如果你不打算使用域名而是使用 IP 地址来配置 Nginx 的 SSL 证书&#xff0c;你会遇到一个问题&#xff0c;因为 SSL/TLS 证书通常是为特定的域名颁发的&#xff0c;而不是 IP 地址。虽然可以为 IP 地址生成证书&#xff0c;但大多数证书颁发机构&#xff08;CA&#xff09;不支…...

Perturbed-Attention Guidance(PAG) 笔记

Self-Rectifying Diffusion Sampling with Perturbed-Attention Guidance Github 摘要 近期研究表明&#xff0c;扩散模型能够生成高质量样本&#xff0c;但其质量在很大程度上依赖于采样引导技术&#xff0c;如分类器引导&#xff08;CG&#xff09;和无分类器引导&#xff…...

自动驾驶控制与规划——Project 6: A* Route Planning

目录 零、任务介绍一、算法原理1.1 A* Algorithm1.2 启发函数 二、代码实现三、结果分析四、效果展示4.1 Dijkstra距离4.2 Manhatten距离4.3 欧几里德距离4.4 对角距离 五、后记 零、任务介绍 carla-ros-bridge/src/ros-bridge/carla_shenlan_projects/carla_shenlan_a_star_p…...

通俗易懂之线性回归时序预测PyTorch实践

线性回归&#xff08;Linear Regression&#xff09;是机器学习中最基本且广泛应用的算法之一。它不仅作为入门学习的经典案例&#xff0c;也是许多复杂模型的基础。本文将全面介绍线性回归的原理、应用&#xff0c;并通过一段PyTorch代码进行实践演示&#xff0c;帮助读者深入…...

[离线数仓] 总结二、Hive数仓分层开发

接 [离线数仓] 总结一、数据采集 5.8 数仓开发之ODS层 ODS层的设计要点如下: (1)ODS层的表结构设计依托于从业务系统同步过来的数据结构。 (2)ODS层要保存全部历史数据,故其压缩格式应选择压缩比率,较高的,此处选择gzip。 CompressedStorage - Apache Hive - Apac…...

页面顶部导航栏(Navbar)的功能(Navbar/index.vue)

这段代码是一个 Vue.js 组件&#xff0c;实现了页面顶部导航栏&#xff08;Navbar&#xff09;的功能。我将分块分析它的各个部分&#xff1a; 模板 (Template): <!-- spid-admin/src/layout/components/Navbar/index.vue --> <template><div class"navb…...

thinnkphp5.1和 thinkphp6以及nginx,apache 解决跨域问题

ThinkPHP 5.1 使用中间件设置响应头 ThinkPHP 5.1 及以上版本支持中间件&#xff0c;可以通过中间件统一设置跨域响应头。 步骤&#xff1a; 创建一个中间件文件&#xff0c;例如 CorsMiddleware.php&#xff1a; namespace app\middleware;class CorsMiddleware {public fu…...

Appium+python自动化(十六)- ADB命令

简介 Android 调试桥(adb)是多种用途的工具&#xff0c;该工具可以帮助你你管理设备或模拟器 的状态。 adb ( Android Debug Bridge)是一个通用命令行工具&#xff0c;其允许您与模拟器实例或连接的 Android 设备进行通信。它可为各种设备操作提供便利&#xff0c;如安装和调试…...

postgresql|数据库|只读用户的创建和删除(备忘)

CREATE USER read_only WITH PASSWORD 密码 -- 连接到xxx数据库 \c xxx -- 授予对xxx数据库的只读权限 GRANT CONNECT ON DATABASE xxx TO read_only; GRANT USAGE ON SCHEMA public TO read_only; GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_only; GRANT EXECUTE O…...

屋顶变身“发电站” ,中天合创屋面分布式光伏发电项目顺利并网!

5月28日&#xff0c;中天合创屋面分布式光伏发电项目顺利并网发电&#xff0c;该项目位于内蒙古自治区鄂尔多斯市乌审旗&#xff0c;项目利用中天合创聚乙烯、聚丙烯仓库屋面作为场地建设光伏电站&#xff0c;总装机容量为9.96MWp。 项目投运后&#xff0c;每年可节约标煤3670…...

2025盘古石杯决赛【手机取证】

前言 第三届盘古石杯国际电子数据取证大赛决赛 最后一题没有解出来&#xff0c;实在找不到&#xff0c;希望有大佬教一下我。 还有就会议时间&#xff0c;我感觉不是图片时间&#xff0c;因为在电脑看到是其他时间用老会议系统开的会。 手机取证 1、分析鸿蒙手机检材&#x…...

智能仓储的未来:自动化、AI与数据分析如何重塑物流中心

当仓库学会“思考”&#xff0c;物流的终极形态正在诞生 想象这样的场景&#xff1a; 凌晨3点&#xff0c;某物流中心灯火通明却空无一人。AGV机器人集群根据实时订单动态规划路径&#xff1b;AI视觉系统在0.1秒内扫描包裹信息&#xff1b;数字孪生平台正模拟次日峰值流量压力…...

聊一聊接口测试的意义有哪些?

目录 一、隔离性 & 早期测试 二、保障系统集成质量 三、验证业务逻辑的核心层 四、提升测试效率与覆盖度 五、系统稳定性的守护者 六、驱动团队协作与契约管理 七、性能与扩展性的前置评估 八、持续交付的核心支撑 接口测试的意义可以从四个维度展开&#xff0c;首…...

Spring Cloud Gateway 中自定义验证码接口返回 404 的排查与解决

Spring Cloud Gateway 中自定义验证码接口返回 404 的排查与解决 问题背景 在一个基于 Spring Cloud Gateway WebFlux 构建的微服务项目中&#xff0c;新增了一个本地验证码接口 /code&#xff0c;使用函数式路由&#xff08;RouterFunction&#xff09;和 Hutool 的 Circle…...

佰力博科技与您探讨热释电测量的几种方法

热释电的测量主要涉及热释电系数的测定&#xff0c;这是表征热释电材料性能的重要参数。热释电系数的测量方法主要包括静态法、动态法和积分电荷法。其中&#xff0c;积分电荷法最为常用&#xff0c;其原理是通过测量在电容器上积累的热释电电荷&#xff0c;从而确定热释电系数…...

Chromium 136 编译指南 Windows篇:depot_tools 配置与源码获取(二)

引言 工欲善其事&#xff0c;必先利其器。在完成了 Visual Studio 2022 和 Windows SDK 的安装后&#xff0c;我们即将接触到 Chromium 开发生态中最核心的工具——depot_tools。这个由 Google 精心打造的工具集&#xff0c;就像是连接开发者与 Chromium 庞大代码库的智能桥梁…...

小木的算法日记-多叉树的递归/层序遍历

&#x1f332; 从二叉树到森林&#xff1a;一文彻底搞懂多叉树遍历的艺术 &#x1f680; 引言 你好&#xff0c;未来的算法大神&#xff01; 在数据结构的世界里&#xff0c;“树”无疑是最核心、最迷人的概念之一。我们中的大多数人都是从 二叉树 开始入门的&#xff0c;它…...