java解析json复杂数据的两种思路

文章目录

  • 一、原始需求
  • 二、简单分析
  • 三、具体实现一
    • 1. api接口
    • 2. 接口返回
    • 3. json 数据解析
      • 1.)引入Jackson库
      • 2.)定义实体
      • 3.)解析json字符串
      • 4.)运行结果
    • 4. 过程分析
  • 四、具体实现二
    • 1. 核心代码
    • 2.运行结果
  • 五、方案比较
  • 六、源码传送

一、原始需求

萌新小明最近新开了CSDN博客,蠢蠢欲动,迫不及待的发表了几篇工作中积累下来的解决问题的涂鸦之作,看着访问量慢慢涨起来,心中暗暗窃喜。现在小明想每天23点记录一下每篇文章的访问量

二、简单分析

对照需求,可以简单分解为如下步骤:

  1. 每天23点自动运行任务,实现方式:@Scheduled、cron表达式
  2. 获取每篇文章的访问量,实现方式:api接口、数据解析
  3. 记录每篇文章的访问量,实现方式:javaBean、JDBC、ORM框架

三、具体实现一

步骤1、3代码实现比较常见,不再详细描述具体实现。
下面我们详细描述步骤2的具体实现

1. api接口

接口地址: https://blog.csdn.net/community/home-api/v1/get-business-list?page={页号}&size={当前页数据条数}&businessType=blog&username={用户名}

2. 接口返回

以下面的接口为例:
https://blog.csdn.net/community/home-api/v1/get-business-list?page=1&size=5&businessType=blog&username=qq_16127313

返回数据如下:

{"code": 200,"message": "success","traceId": "5a64396a-caf3-49ad-a6db-022c55660b75","data": {"list": [{"articleId": 135244727,"title": "java lambda表达式训练题一","description": "Lambda 表达式,也可称为闭包,它是推动 Java 8 发布的最重要新特性。Lambda 允许把函数作为一个方法的参数(函数作为参数传递进方法中)。使用 Lambda 表达式可以使代码变的更加简洁紧凑。","url": "https://blog.csdn.net/qq_16127313/article/details/135244727","type": 1,"top": false,"forcePlan": false,"viewCount": 1019,"commentCount": 0,"editUrl": "https://editor.csdn.net/md?articleId=135244727","postTime": "2023-12-27 18:07:30","diggCount": 7,"formatTime": "2023.12.27","picList": ["https://img-blog.csdnimg.cn/direct/d59c68b950754e879914b5319cd1b53f.png"],"collectCount": 8},{"articleId": 135173565,"title": "二维码初体验 com.google.zxing 实现续 - web api封装","description": "在 二维码初体验 com.google.zxing 实现 我们实现了二维码的生成,但是大部分情况下,二维码的相关功能是作为API接口来提供服务的。我们下面便演示在springboot、Knife4j下封装api接口来实现二维码生成功能。如何使用下面的备份文件恢复成原始的项目代码,请移步查阅:神奇代码恢复工具-over-","url": "https://blog.csdn.net/qq_16127313/article/details/135173565","type": 1,"top": false,"forcePlan": false,"viewCount": 1693,"commentCount": 0,"editUrl": "https://editor.csdn.net/md?articleId=135173565","postTime": "2023-12-23 20:17:11","diggCount": 23,"formatTime": "2023.12.23","picList": ["https://img-blog.csdnimg.cn/direct/f0c994ca789a495a8c8c03d86d626f24.jpeg"],"collectCount": 23},{"articleId": 135167613,"title": "二维码初体验 com.google.zxing 实现","description": "Java 操作二维码的开源项目很多,如 SwetakeQRCode、BarCode4j、Zxing 等,这边以Zxing 为例进行介绍。选择需要生成QR原始文件,支持 “清除空白行及空格” 以减少二维码图片大小。支持输入文本内容,直接生成二维码代码结构QrCodeUI: 完整版本代码SimpleQrCodeUI:简化版本代码如何使用下面的备份文件恢复成原始的项目代码,请移步查阅:神奇代码恢复工具-over-","url": "https://blog.csdn.net/qq_16127313/article/details/135167613","type": 1,"top": false,"forcePlan": false,"viewCount": 1081,"commentCount": 0,"editUrl": "https://editor.csdn.net/md?articleId=135167613","postTime": "2023-12-23 13:52:23","diggCount": 6,"formatTime": "2023.12.23","picList": ["https://img-blog.csdnimg.cn/direct/d3eeac85857543869dce8967c570bdc4.jpeg"],"collectCount": 11},{"articleId": 135135799,"title": "【随笔】MD5加密字符串、文件apache、springframework实现","description": "【代码】【随笔】MD5加密字符串、文件commons-codec、springframework实现。","url": "https://blog.csdn.net/qq_16127313/article/details/135135799","type": 1,"top": false,"forcePlan": false,"viewCount": 1507,"commentCount": 0,"editUrl": "https://editor.csdn.net/md?articleId=135135799","postTime": "2023-12-21 17:29:54","diggCount": 9,"formatTime": "2023.12.21","picList": ["https://img-blog.csdnimg.cn/direct/dc26b7f1c731494f80c8c3b3badfa95d.jpeg"],"collectCount": 9},{"articleId": 135087188,"title": "【随笔】java工程中JSON 字符串格式化输出","description": "json字符串格式化输出fastjson、gson、jackson实现。","url": "https://blog.csdn.net/qq_16127313/article/details/135087188","type": 1,"top": false,"forcePlan": false,"viewCount": 1198,"commentCount": 0,"editUrl": "https://editor.csdn.net/md?articleId=135087188","postTime": "2023-12-19 17:07:40","diggCount": 8,"formatTime": "2023.12.19","picList": ["https://img-blog.csdnimg.cn/direct/058249a1749e4ff5b62e1fcabf516c37.png"],"collectCount": 6}],"total": 71}
} 

3. json 数据解析

在Java中,可以使用多种库来解析JSON数据。其中最常用的是fastjson、gson和jackson。
这边我们以jackson为例来说明。

1.)引入Jackson库

<dependency>  <groupId>com.fasterxml.jackson.core</groupId>  <artifactId>jackson-databind</artifactId>  <version>2.13.0</version>  
</dependency>

2.)定义实体

注意这边实体属性一定要跟json数据字段key对应,否则会解析报错

@Data
class BlogData
{private Integer code;private String message;private String traceId;private Record data;
}@Data
class Record
{private List<SubList> list;private Long total;
}@Data
class SubList
{String articleId;String title;String description;String url;Integer type;String top;String forcePlan;Long viewCount;Long commentCount;String editUrl;String postTime;Long diggCount;String formatTime;Object picList;Long collectCount;
}

3.)解析json字符串

        ObjectMapper mapper = new ObjectMapper();String url = "https://blog.csdn.net/community/home-api/v1/get-business-list?page=1&size=5&businessType=blog&username=qq_16127313";String resp = webClient.get().uri(url).acceptCharset(StandardCharsets.UTF_8).accept(MediaType.APPLICATION_JSON).retrieve().bodyToMono(String.class).block();BlogData blogData = mapper.readValue(resp, BlogData.class);log.info("blogData: {} ", blogData);

4.)运行结果

在这里插入图片描述

4. 过程分析

分析整个json数据解析过程,我们发现在实体定义步骤上,花费了我们太多精力和时间,而且一旦json数据key命名有变化或属性名命名不对应,便会打印类似下面的错误信息:

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "collectCount" (class com.fly.test.restful.json.SubList), not marked as ignorable (15 known properties: "formatTime", "editUrl", "picList", "viewCount", "collectCount1", "postTime", "url", "commentCount", "articleId", "forcePlan", "top", "title", "type", "description", "diggCount"])at [Source: (String)"{"code":200,"message":"success","traceId":"ce6fbb2f-72da-4a9c-9cf4-4e532a942210","data":{"list":[{"articleId":135244727,"title":"java lambda表达式训练题一","description":"Lambda 表达式,也可称为闭包,它是推动 Java 8 发布的最重要新特性。Lambda 允许把函数作为一个方法的参数(函数作为参数传递进方法中)。使用 Lambda 表达式可以使代码变的更加简洁紧凑。","url":"https://blog.csdn.net/qq_16127313/article/details/135244727","type":1,"top":false,"forcePlan":false,"viewCount":1081,"commentCount":0,"editUrl":"https://editor.csdn.net/md?articleId=135244727","postTime":"2023-12-27 18:07:30"[truncated 2457 chars]; line: 1, column: 645] (through reference chain: com.fly.test.restful.json.BlogData["data"]->com.fly.test.restful.json.Record["list"]->java.util.ArrayList[0]->com.fly.test.restful.json.SubList["collectCount"])at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61)at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:840)at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1206)at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1592)at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1570)at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:294)at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4202)at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3205)at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3173)at com.fly.test.restful.json.ParseJson.test2(ParseJson.java:57)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:675)at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:125)at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:132)at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:124)at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:74)at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:104)at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:62)at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:43)at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:35)at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:202)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:198)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)at java.util.ArrayList.forEach(ArrayList.java:1257)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)at java.util.ArrayList.forEach(ArrayList.java:1257)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229)at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197)at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:137)at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98)at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

四、具体实现二

在上面的实现中,通过分析得知,我们关注的信息只有url、viewCount这2个字段值,并不关心其他字段信息。
在【随笔】java工程中JSON 字符串格式化输出 中我们已经实现了将json字符串格式化后输出,仔细观察输出信息,会发现简单数据对象(如key、value均为字符串、数字等类型数据)均在同一行,这样我们通过解析输出的行字符串信息,便能得到对应信息。

1. 核心代码

// 调用接口String url = "https://blog.csdn.net/community/home-api/v1/get-business-list?page=1&size=5&businessType=blog&username=qq_16127313";String resp = webClient.get().uri(url).acceptCharset(StandardCharsets.UTF_8).accept(MediaType.APPLICATION_JSON).retrieve().bodyToMono(String.class).block();// 数据格式化-jackson格式化后会在:前后添加空格String pretty = mapper.readTree(resp).toPrettyString();List<String> lines = IOUtils.readLines(new StringReader(pretty));// 获取urlList<String> urls = lines.stream().filter(line -> StringUtils.contains(line, "\"url\"")).map(n -> StringUtils.substringBetween(n, " : \"", "\",")).collect(Collectors.toList());urls.stream().forEach(log::info);// 获取viewCountList<String> viewCounts = lines.stream().filter(line -> StringUtils.contains(line, "\"viewCount\"")).map(n -> StringUtils.substringBetween(n, " : ", ",")).collect(Collectors.toList());viewCounts.stream().forEach(log::info);

2.运行结果

在这里插入图片描述

五、方案比较

目标方案一方案二
复杂度复杂简单
健壮性稍不足,需保证实体属性与json key全部严格对应健壮,只需保证获取数据key正确

六、源码传送

https://gitee.com/00fly/effict-side/blob/master/springboot-cache/src/test/java/com/fly/test/restful/json/ParseJson.java


大家可以根据需要选择方案,有任何问题和建议,都可以向我提问讨论,大家一起进步,谢谢!

-over-

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/608843.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

c++学习:STL库(框架)+字符串模板类string+vector容器+list链表

目录 stl库 常用组件包括 字符串库 字符串模板类string 头文件 最常用的字符串模板类 字符串类型 模板原型 模板的成员数据类型 模板成员函数 有些函数会有重载&#xff0c;可以去下面网址查看std::basic_string - cppreference.comhttps://zh.cppreference.com/w/cp…

1.8 day6 IO进程线程

使用有名管道实现两个进程之间的通信 进程A #include <myhead.h> int main(int argc, const char *argv[]) {//创建两个文件描述符用于打开两个管道int fd1-1;int fd2-1;//创建一个子进程int pid-1;if((fd1open("./mkfifo1",O_RDWR))-1){perror("open er…

STM32-04-STM32时钟树

STM32时钟树 什么是时钟&#xff1f; 时钟是具有周期性的脉冲信号&#xff0c;最常用的是占空比50%的方波。&#xff08;时钟是单片机的脉搏&#xff0c;搞懂时钟走向及关系&#xff0c;对单片机使用至关重要&#xff09;。 时钟树 时钟源 2个外部时钟源 高速外部振荡器(HSE…

教你如何将本地虚拟机变成服务器,供其它电脑访问

场景&#xff1a;最近在做数据仓库的作业&#xff0c;需要团队协作&#xff0c;买不起阿里云服务器&#xff0c;所以想到能不能将我本地机上的虚拟机变成服务器&#xff0c;供其它同学的电脑访问。在虚拟机上安装hadoop和hive&#xff0c;然后同学机子上安装kettle进行连接。最…

离线安装jenkins:使用rpm安装包

目录 一、安装jdk1.8二、安装yum软件包三、下载rmp安装包四、安装jenkins的rpm安装包五、创建jenkins文件目录六、设置环境变量七、配置jdk位置八、配置Jenkins配置文件九、启动Jenkins十、访问Jenkins十一、安装Jenkins插件 一、安装jdk1.8 根据博客Linux操作系统安装jdk1.8并…

实战经验分享,Python 连接 Oracle 踩坑实录

最近的一个测试任务需要测试 oracle 同步 hive 数据库的性能&#xff0c;那就需要对 oracle 数据库灌注测试数据。我就又打开了我的IDE&#xff0c;准备把我之前一下可以灌50w数据到 MySQL 的代码&#xff0c;改一改&#xff0c;直接用。 因为我在网上看到&#xff0c;语法上也…

网络安全复习--简答整理

-----------------------------------------------------教材如上图------------------------------------------------------------ 1.对称加密和非对称加密各有什么特点&#xff1f;加密解密过程中有什么区别&#xff1f;优点P38【考】 对称加密的特点&#xff1a;在针对同一…

MVC设计模式和与三层架构的关系

MVC设计模式和与三层架构的关系 MVC是一种设计模式&#xff0c;将软件按照模型、视图、控制器来划分&#xff1a; M&#xff1a;Model&#xff0c;模型层&#xff0c;指工程中的JavaBean&#xff0c;作用是处理数据 JavaBean分为两类&#xff1a; 一类称为数据承载Bean&#x…

用C语言实现动态数组Vector

代码仓库地址 1. 动态数组原理 定义一个结构体类型&#xff0c;在结构体中用指针指向一个在堆空间开辟的一块内存。 2. 编写头文件 在头文件里定义Vector的数据结构和相关操作&#xff0c;可以通过修改 “typedef char* Element;” 来修改存储的数据的类型&#xff1b; #ifn…

歌手荆涛演唱的春节回家:传统与现代的交织,歌声里的乡愁与期盼

随着冬日渐寒&#xff0c;春节的脚步愈发临近。这是一个充满温馨与期待的时刻&#xff0c;一个穿越时空、凝聚亿万华夏儿女情感的盛大节日。春节&#xff0c;它不仅仅是一个传统习俗的展现&#xff0c;更是一种心灵的归宿&#xff0c;一种文化的传承。 在悠久的历史长河中&…

Selenium 学习(0.18)——软件测试之基本路径测试

1、基本路径法测试的概念 是一种白盒测试方法&#xff0c;它在程序控制流图的基础上&#xff0c;通过分析控制构造的环行复杂性&#xff0c;导出基本可执行路径集合&#xff0c;从而设计测试用例的方法。 要保证在测试中程序的每一个可执行语句至少执行一次 【这和语句…

很有用!小企业如何从零开始制作产品手册?

对于初创公司和小企业来说&#xff0c;创造一份高效、吸引人的产品手册可能不是特别简单&#xff0c;特别是当资源和预算有限的时候。然而&#xff0c;一份良好的产品手册可以帮助你传达你的品牌故事&#xff0c;展示你的产品&#xff0c;甚至可以帮助你提高销售额&#xff0c;…

Transformers 2023年度回顾 :从BERT到GPT4

人工智能已成为近年来最受关注的话题之一&#xff0c;由于神经网络的发展&#xff0c;曾经被认为纯粹是科幻小说中的服务现在正在成为现实。从对话代理到媒体内容生成&#xff0c;人工智能正在改变我们与技术互动的方式。特别是机器学习 (ML) 模型在自然语言处理 (NLP) 领域取得…

【仙丹秘法】如何炼制一颗稳定的仙丹

提示词始终保持不变 1&#xff1a;收集素材 制作lora_v1 2: 制作lora_v1 产生 1个人物 含 你想要的服装 导入 pose_1 到 control 1 生成人物 (white_background:1.1),front view,1boy,blue sleeveless t-shirt,blue shorts,detailed eyes,best quality,masterpiece,high res…

第三站:C/C++基础-二维数组

二维数组的概念 一维数组本身是多个大小相同的内存块,从0开始逐渐递增所组成的在横向上的有序"组合", 二维数组就是很多个一维数组在纵向上的组合,每一个一维数组就是二维数组在纵向上的从0开始的逐渐递增的一个单位,(所以一维数组在二维数组的基础上,每一个内存块…

Spring 基于注解的AOP见解4

5.基于注解的AOP配置 5.1创建工程 5.1.1.pom.xml <?xml version"1.0" encoding"UTF-8"?> <project xmlns"http://maven.apache.org/POM/4.0.0"xmlns:xsi"http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation&…

SUDA-计算机网路-期末复习提纲

写在前面 帮苏大的同学整理的计网复习材料&#xff0c;用的是他们老师划定的范围。 1.负责互联网协议开发、标准制定、地址分配的国际组织名称及其主要职责 (1) 地址支持组织&#xff08;ASO&#xff09;负责IP地址系统的管理。 (2) 域名支持组织&#xff08;DNSO&#xff09;…

LeetCode(242)有效的字母异位词⭐

给定两个字符串 s 和 t &#xff0c;编写一个函数来判断 t 是否是 s 的字母异位词。 注意&#xff1a;若 s 和 t 中每个字符出现的次数都相同&#xff0c;则称 s 和 t 互为字母异位词。 示例 1: 输入: s "anagram", t "nagaram" 输出: true示例 2: 输…

【2023 CSIG垂直领域大模型】大模型时代,如何完成IDP智能文档处理领域的OCR大一统?

目录 一、像素级OCR统一模型&#xff1a;UPOCR1.1、为什么提出UPOCR&#xff1f;1.2、UPOCR是什么?1.2.1、Unified Paradigm 统一范式1.2.2、Unified Architecture统一架构1.2.3、Unified Training Strategy 统一训练策略 1.3、UPOCR效果如何&#xff1f; 二、OCR大一统模型前…

kdump安装及调试策略

本文基于redhat系的操作系统&#xff0c;debian系不太一样&#xff0c;仅提供参考 1.kdump的部署 注&#xff1a;一般很多操作系统在安装时可默认启动kdump。 &#xff08;1&#xff09;需要的包 yum install kexec-tools crash kernel-debuginfo &#xff08;2&#xff0…