修改层次

This commit is contained in:
zhangsan 2025-03-18 17:35:22 +08:00
parent d547543098
commit 64cdd008d1
92 changed files with 144 additions and 158 deletions

View File

@ -296,23 +296,25 @@ A依赖BB依赖C如果A不想将C依赖进来可以同时排除C
| 状态码 | 英文描述 | 解释 |
| ------- | -------------------------------------- | ------------------------------------------------------------ |
| ==200== | **`OK`** | 客户端请求成功,即**处理成功**,这是我们最想看到的状态码 |
| 302 | **`Found`** | 指示所请求的资源已移动到由`Location`响应头给定的 URL浏览器会自动重新访问到这个页面 |
| 304 | **`Not Modified`** | 告诉客户端,你请求的资源至上次取得后,服务端并未更改,你直接用你本地缓存吧。隐式重定向 |
| 400 | **`Bad Request`** | 客户端请求有**语法错误**,不能被服务器所理解 |
| 403 | **`Forbidden`** | 服务器收到请求,但是**拒绝提供服务**,比如:没有权限访问相关资源 |
| ==404== | **`Not Found`** | **请求资源不存在**一般是URL输入有误或者网站资源被删除了 |
| 405 | **`Method Not Allowed`** | 请求方式有误比如应该用GET请求方式的资源用了POST |
| 428 | **`Precondition Required`** | **服务器要求有条件的请求**,告诉客户端要想访问该资源,必须携带特定的请求头 |
| 429 | **`Too Many Requests`** | 指示用户在给定时间内发送了**太多请求**(“限速”),配合 Retry-After(多长时间后可以请求)响应头一起使用 |
| 431 | **` Request Header Fields Too Large`** | **请求头太大**,服务器不愿意处理请求,因为它的头部字段太大。请求可以在减少请求头域的大小后重新提交。 |
| ==500== | **`Internal Server Error`** | **服务器发生不可预期的错误**。服务器出异常了,赶紧看日志去吧 |
| 503 | **`Service Unavailable`** | **服务器尚未准备好处理请求**,服务器刚刚启动,还未初始化好 |
| 状态码 | 英文描述 | 解释 |
| ------- | --------------------------- | ------------------------------------------------------------ |
| ==200== | **`OK`** | 客户端请求成功,即**处理成功**,这是我们最想看到的状态码 |
| 302 | **`Found`** | 指示所请求的资源已移动到由`Location`响应头给定的 URL浏览器会自动重新访问到这个页面 |
| 304 | **`Not Modified`** | 告诉客户端,你请求的资源至上次取得后,服务端并未更改,你直接用你本地缓存吧。隐式重定向 |
| 400 | **`Bad Request`** | 客户端请求有**语法错误**,不能被服务器所理解 |
| 403 | **`Forbidden`** | 服务器收到请求,但是**拒绝提供服务**,比如:没有权限访问相关资源 |
| ==404== | **`Not Found`** | **请求资源不存在**一般是URL输入有误或者网站资源被删除了 |
| 405 | **`Method Not Allowed`** | 请求方式有误比如应该用GET请求方式的资源用了POST |
| 429 | **`Too Many Requests`** | 指示用户在给定时间内发送了**太多请求**(“限速”),配合 Retry-After(多长时间后可以请求)响应头一起使用 |
| ==500== | **`Internal Server Error`** | **服务器发生不可预期的错误**。服务器出异常了,赶紧看日志去吧 |
| 503 | **`Service Unavailable`** | **服务器尚未准备好处理请求**,服务器刚刚启动,还未初始化好 |
## SpringBoot
**SpringBoot的WEB默认内嵌了tomcat服务器非常方便**
浏览器与 Tomcat 之间通过 HTTP 协议进行通信,而 Tomcat 则充当了中间的桥梁,将请求路由到你的 Java 代码,并最终将处理结果返回给浏览器。
![image-20240304101816184](D:/folder/test/output/09141a0c-1482-4200-b808-6dd22abe75d2.png)
### 快速启动
@ -361,10 +363,6 @@ public class SprintbootQuickstartApplication {
**SpringBoot的WEB默认内嵌了tomcat服务器非常方便**
**而外部的Tomcat需要把项目放在webapps文件夹下才可访问。**
### SpringBoot请求
#### 简单参数
@ -429,78 +427,25 @@ public class RequestController {
```
```
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {
private String name;
private Integer age;
private Address address;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Address getAddress() {
return address;
}
public void setAddress(Address address) {
this.address = address;
}
@Override
public String toString() {
return "User{" +
"name='" + name + '\'' +
", age=" + age +
", address=" + address +
'}';
}
}
```
```
package edu.whut.pojo;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Address {
private String province;
private String city;
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
@Override
public String toString() {
return "Address{" +
"province='" + province + '\'' +
", city='" + city + '\'' +
'}';
}
}
```
#### 数组参数
@ -762,42 +707,42 @@ Component衍生注解
3. `@RestController`这是一个类级别的注解它告诉Spring框架这个类是一个控制器Controller并且处理HTTP请求并返回响应数据。与 `@Controller` 注解相比,`@RestController` 注解还会自动将控制器方法返回的数据转换为 JSON 格式并写入到HTTP响应中得益于**@ResponseBody** 。因此,`@RestController` 注解通常用于编写 RESTful Web 服务。
@RestController = @Controller + @ResponseBody
2. `@RestController`这是一个类级别的注解它告诉Spring框架这个类是一个控制器Controller并且处理HTTP请求并返回响应数据。与 `@Controller` 注解相比,`@RestController` 注解还会自动将控制器方法返回的数据转换为 JSON 格式并写入到HTTP响应中得益于**@ResponseBody** 。因此,`@RestController` 注解通常用于编写 RESTful Web 服务。
`@RestController = @Controller + @ResponseBody`
3. `@RequestBody`这是一个方法参数级别的注解用于告诉Spring框架将请求体的内容解析为指定的Java对象。在这个例子中`@RequestBody` 注解告诉Spring框架将HTTP请求的主体即请求体中的**JSON数据解析**为一个 `User` 对象,并传递给方法的参数 `user`。这样,在方法体内就可以直接使用这个 `User` 对象来处理请求中的数据了。
4. `@PathVariable` 注解用于将路径变量 `{id}` 的值绑定到方法的参数 `id` 上。当请求的路径是 "/path/123" 时,`@PathVariable` 会将路径中的 "123" 值绑定到方法的参数 `id` 上,使得方法能够获取到这个值。在这个例子中,方法的参数 `id` 的值将会是整数值 123。
```
public String pathParam(@PathVariable Integer id) {
System.out.println(id);
return "OK";
}
参数名与路径名不同
@GetMapping("/{id}")
public ResponseEntity<User> getUserById(@PathVariable("id") Long userId) {
```
public String pathParam(@PathVariable Integer id) {
System.out.println(id);
return "OK";
}
```
参数名与路径名不同
@GetMapping("/{id}")
public ResponseEntity<User> getUserById(@PathVariable("id") Long userId) {
}
```
5. `@RequestParam`,如果方法的参数名与请求参数名不同,需要在 `@RequestParam` 注解中指定请求参数的名字。
```
@RequestParam(defaultValue = "1" Integer page) //若page为null可以设置page的默认值为1
```
```
@RequestParam(defaultValue = "1" Integer page) //若page为null可以设置page的默认值为1
```
```
@RequestMapping("/example")
public String exampleMethod(@RequestParam String name, @RequestParam("age") int userAge) {
// 在方法内部使用获取到的参数值进行处理
System.out.println("Name: " + name);
System.out.println("Age: " + userAge);
return "OK";
}
```
@RequestMapping("/example")
public String exampleMethod(@RequestParam String name, @RequestParam("age") int userAge) {
// 在方法内部使用获取到的参数值进行处理
System.out.println("Name: " + name);
System.out.println("Age: " + userAge);
return "OK";
}
```
```
5. 控制反转与依赖注入:
@ -813,17 +758,25 @@ public String exampleMethod(@RequestParam String name, @RequestParam("age") int
7. @SpringBootTest:它会启动 Spring 应用程序上下文,并在测试期间模拟运行整个 Spring Boot 应用程序。这意味着你可以在集成测试中使用 Spring 的各种功能,例如**自动装配、依赖注入、配置加载**等。
8. lombok的相关注解。非常实用的工具库。****
8. lombok的相关注解。非常实用的工具库。
| **注解** | **作用** |
| ------------------- | ------------------------------------------------------------ |
| @Getter/@Setter | 为所有的属性提供get/set方法 |
| @ToString | 会给类自动生成易阅读的 toString 方法 |
| @EqualsAndHashCode | 根据类所拥有的非静态字段自动重写 equals 方法和 hashCode 方法 |
| **@Data** | **提供了更综合的生成代码功能(@Getter + @Setter + @ToString + @EqualsAndHashCode** |
| @NoArgsConstructor | 为实体类生成无参的构造器方法 |
| @AllArgsConstructor | 为实体类生成除了static修饰的字段之外带有各参数的构造器方法。 |
| **@Slf4j** | 可以log.info("输出日志信息"); |
| **注解** | **作用** |
| ------------------- | ------------------------------------------------------------ |
| @Getter/@Setter | 为所有的属性提供get/set方法 |
| @ToString | 会给类自动生成易阅读的 toString 方法 |
| @EqualsAndHashCode | 根据类所拥有的非静态字段自动重写 equals 方法和 hashCode 方法 |
| **@Data** | **提供了更综合的生成代码功能(@Getter + @Setter + @ToString + @EqualsAndHashCode** |
| @NoArgsConstructor | 为实体类生成无参的构造器方法 |
| @AllArgsConstructor | 为实体类生成除了static修饰的字段之外带有各参数的构造器方法。 |
| **@Slf4j** | 可以log.info("输出日志信息"); |
```
//equals 方法用于比较两个对象的内容是否相同
Address addr1 = new Address("SomeProvince", "SomeCity");
Address addr2 = new Address("SomeProvince", "SomeCity");
System.out.println(addr1.equals(addr2)); // 输出 true
```
9. @TestJunit测试单元可在测试类中定义测试函数一次性执行所有@Test注解下的函数不用写main方法
10. @Override,当一个方法在子类中覆盖(重写)了父类中的同名方法时,为了确保正确性,可以使用 `@Override` 注解来标记这个方法,这样编译器就能够帮助检查是否正确地重写了父类的方法。

View File

@ -15,6 +15,8 @@ net stop mysql // 停止mysql服务
mysqladmin -u root password 123456
```
本地windows下的账号:root 密码: 123456
### 登录
```

View File

@ -1,29 +1,58 @@
## anaconda基础命令
## Anaconda基础命令
cuda版本 12.3.1 驱动版本 546.26
打开anaconda prompt普通命令行cmd也可以
**查看版本和环境**
conda -V 查看版本
conda env list 查看已安装的环境 *代表当前环境
conda list 列出当前环境所安装的包
conda updata
**环境管理**
conda create -n 新环境名字 python=3.7 若只有python则下载最新版python
conda activate 新环境名字 可以切换环境
conda deactivate 退出环境到base
conda search numpy 可以查看numpy有哪些版本
conda install numpy 可以指定版本,默认最新版
也可以pip install -r requirements.txt (激活环境后)
conda remove numpy 删除numpy以及所有依赖关系的包
conda remove -n 新环境名字 --all 删除创建的环境先deactivate退出
结合pycharm可以先在conda中创建好虚拟环境然后在pycharm中使用exsiting conda环境。
project interpretershow all可以看到pycharm记住的所有解释器也可以右边加号添加
查看激活的环境的python版本 python --version
**包管理**
*注:包管理操作前请先激活目标环境。*
conda list 列出当前环境所安装的包
conda search numpy 可以查看numpy有哪些版本
conda install numpy 可以指定版本,默认最新版
pip install -r requirements.txt (使用 pip 安装依赖包列表)
conda remove numpy 删除numpy以及所有依赖关系的包
**查看激活的环境的python版本**
python --version
**结合 PyCharm 使用 conda 环境**
在 conda 中创建好虚拟环境
如上文所示,使用 `conda create -n 新环境名字 python=版本` 创建。
在 PyCharm 中使用已有的 conda 环境
- 打开 PyCharm进入 **File > Settings > Project: YourProject > Python Interpreter**
- 点击右侧的 **Show All**,可以看到 PyCharm 已经检测到的所有解释器。
- 若没有显示目标 conda 环境,可以点击右侧的加号(+)添加现有 conda 环境作为解释器。

Binary file not shown.

Before

Width:  |  Height:  |  Size: 634 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 720 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 695 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 695 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

View File

@ -965,6 +965,8 @@ rm -rf /root/data/docker_data/typecho # 完全删除映射到本地的数据
主题https://github.com/HaoOuBa/Joe
markdown编辑器https://xiamp.net/archives/aaeditor-is-another-typecho-editor-plugin.html
## qBittorrent

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 421 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -18,7 +18,7 @@ git clone地址http://47.98.59.178:3000/zy123/zbparse.git
## 项目启动与维护:
![1](http://124.71.159.195:1000/i/2025/03/06/tz5tks-2.png)
![1](D:/folder/test/output/b2f11094-8ca3-4eb4-a4a0-dcaf813a5eaa.png)
.env存放一些密钥大模型、textin等它是gitignore忽略了因此在服务器上git pull项目的时候这个文件不会更新因为密钥比较重要需要手动维护服务器相应位置的.env。
@ -28,7 +28,7 @@ git clone地址http://47.98.59.178:3000/zy123/zbparse.git
1. 进入项目文件夹
![1](http://124.71.159.195:1000/i/2025/03/06/tz5rfk-2.png)
![1](D:/folder/test/output/b769a6c3-a59b-433a-8abf-af5662448b2f.png)
**注意:**需要确认.env是否存在在服务器默认是隐藏的
输入cat .env
@ -54,7 +54,7 @@ requirements.txt一般无需变动除非代码中使用了新的库也要
**docker-compose:**
![1](http://124.71.159.195:1000/i/2025/03/06/tz5n10-2.png)
![1](D:/folder/test/output/4d9b7458-698b-4a28-a246-c533ccaea1b9.png)
本项目为**单服务项目**只有flask_app(服务名)
@ -67,7 +67,7 @@ build context`context: .`
**dockerfile:**
![1](http://124.71.159.195:1000/i/2025/03/06/tz69oi-2.png)
![1](D:/folder/test/output/98b18a05-96d7-46df-915a-544b3200aa31.png)
COPY . .(在 Dockerfile 中):
这条指令会将构建上下文中的所有内容复制到镜像中的当前工作目录(这里是 `/flask_project`)。
@ -138,9 +138,9 @@ docker image prune
2. .env环境配好 一般不需要在电脑环境变量中额外配置了但是要在Pycharm中**安装插件**,使得项目在**启动时**能将env中的环境变量**自动配置**到系统环境变量中!!!)
3. 点击下拉框Edit configurations
![1](http://124.71.159.195:1000/i/2025/03/06/tz691k-2.png)
![1](D:/folder/test/output/5477fdc6-d0fc-4931-bb54-0d62e3585b53.png)
设置run_serve.py为启动脚本![1](http://124.71.159.195:1000/i/2025/03/06/tz5wy8-2.png)
设置run_serve.py为启动脚本![1](D:/folder/test/output/0acc9c9c-8a6e-45db-8acc-a7da5d9b0294.png)
注意这里的working directory要设置到最外层文件夹而不是flask_app
@ -408,7 +408,7 @@ mem_after = memory_usage()[0]
memory_usage()[0] 可以获取当前程序所占内存的**快照**
![1](http://124.71.159.195:1000/i/2025/03/06/tz5feb-2.png)
![1](D:/folder/test/output/13c5773e-ff71-4126-9e75-8f73697ad835.png)
产生的数据都存到result变量-》内存中这是正常的因此my_function没有内存泄漏问题。
**但是**
@ -427,7 +427,7 @@ def extract_text_by_page(file_path):
return ""
```
![1](http://124.71.159.195:1000/i/2025/03/06/tz5mah-2.png)
![1](D:/folder/test/output/4b038601-04da-4364-b64e-d6d7df3b8b36.png)
可以发现尽管我返回""内存仍然没有释放因为就是读取pdf这块发生了内存泄漏
@ -465,7 +465,7 @@ for stat in stats[:10]:
tracemalloc.stop()
```
![1](http://124.71.159.195:1000/i/2025/03/06/tz5rty-2.png)
![1](D:/folder/test/output/c85c3bb4-0182-4b44-b5e9-5a6ceabc04ee.png)
tracemalloc能更深入的分析不仅是自己写的代码**调用的库函数**产生的内存也能分析出来。在这个例子中就是PyPDF2中的各个函数占用了大部分内存。
@ -566,7 +566,7 @@ def judge_zbfile_exec_sub(file_path):
但是存在一个问题:**第一次发送请求执行时间较慢!**
![1](http://124.71.159.195:1000/i/2025/03/06/tz5abr-2.png)
![1](D:/folder/test/output/9ba10499-2706-4a4b-8ba2-be22239c6645.png)
可以发现实际执行只需7.7s但是接口实际耗时10.23秒,主要是因**懒加载或按需初始化**:有些模块或资源在子进程启动时并不会马上加载,而是在子进程首次真正执行任务时才进行初始化。
@ -597,7 +597,7 @@ threading.Thread(target=warmup_request, daemon=True).start()
## flask_app结构介绍
<img src="http://124.71.159.195:1000/i/2025/03/06/tz5xej-2.png" alt="1" style="zoom:67%;" />
<img src="D:/folder/test/output/0ea4dbb3-3b0d-41e0-8f69-630112cbb439.png" alt="1" style="zoom:67%;" />
@ -697,7 +697,7 @@ app.connection_limiters['upload'] = ConnectionLimiter(max_connections=100)
是公共函数存放的文件夹llm下是各类大模型读取文件下是docx pdf文件的读取以及文档清理clean_pdf去页眉页脚页码
![1](http://124.71.159.195:1000/i/2025/03/06/tz5ftd-2.png)
![1](D:/folder/test/output/5a633993-ccde-4d22-8831-bcf0cd124bf7.png)
general下的llm下的清除file_id.py 需要**每周运行至少一次**防止file_id数量超出我这边对每次请求结束都有file_id记录并清理向应该还没加
@ -725,7 +725,7 @@ post_processing中的**process_functions_in_parallel**提取
资格审查、技术偏离、 商务偏离、 所需提交的证明材料
![1](http://124.71.159.195:1000/i/2025/03/06/tz5y6o-2.png)
![1](D:/folder/test/output/1c93e6fd-196f-467c-9b77-066fde2d483f.png)
大解析upload用了post_processing完整版
@ -755,9 +755,9 @@ get_deviation.py、偏离表数据解析main.py用了process_functions_in_parall
若开头没截准就改begin_pattern末尾没截准就改end_pattern
![1](http://124.71.159.195:1000/i/2025/03/06/tz5pcy-2.png)
![1](D:/folder/test/output/c005a7ac-90fa-4636-8a3b-42d02d73e61c.png)
![1](http://124.71.159.195:1000/i/2025/03/06/tz5mkp-2.png)
![1](D:/folder/test/output/b1873dcc-1718-4b3a-bae9-9da3d17ee4e4.png)
另外:在*截取pdf货物标版*.py中还有extract_pages_twice函数即第一次没有切分到之后会运行该函数这边又有一套begin_pattern和end_pattern即二次提取
@ -765,7 +765,7 @@ get_deviation.py、偏离表数据解析main.py用了process_functions_in_parall
**如何测试?**
![1](http://124.71.159.195:1000/i/2025/03/06/tz5ivt-2.png)
![1](D:/folder/test/output/63fc0d3c-7656-4686-b37e-2af83e6a62eb.png)
输入pdf_path和你要切分的序号selection=1代表切公告依次类推可以看切出来的效果如何。
@ -778,7 +778,7 @@ get_deviation.py、偏离表数据解析main.py用了process_functions_in_parall
这里如果段落中既被正则匹配又被follow_up_keywords中的任意一个匹配那么不会添加到temp中即不会被大模型筛选它会**直接添加**到最后的返回中!
![1](http://124.71.159.195:1000/i/2025/03/06/tz5jhb-2.png)
![1](D:/folder/test/output/de90c69a-2f9d-4586-8b8a-062c6441ed45.png)
@ -796,7 +796,7 @@ get_deviation.py、偏离表数据解析main.py用了process_functions_in_parall
都是废弃文件代码,未在正式、测试环境中使用的,不用管
![1](http://124.71.159.195:1000/i/2025/03/06/tz5r69-2.png)
![1](D:/folder/test/output/24273e6d-ed92-4b11-b56a-4f83ec3470a3.png)
@ -804,7 +804,7 @@ get_deviation.py、偏离表数据解析main.py用了process_functions_in_parall
是接口以及主要实现部分,一一对应
![1](http://124.71.159.195:1000/i/2025/03/06/tz5zb7-2.png)
![1](D:/folder/test/output/00332c01-e1d1-4ed1-8493-e831382eb77c.png)
get_deviation对应偏离表数据解析main获得偏离表数据
@ -824,7 +824,7 @@ upload对应工程标解析和货物标解析即大解析
utils是接口这块的公共功能函数。其中validate_and_setup_logger函数对不同的接口请求对应到不同的output文件夹如upload->output1。后续增加接口也可直接在这里写映射关系。
![1](http://124.71.159.195:1000/i/2025/03/06/tz5syz-2.png)
![1](D:/folder/test/output/a4e62d90-d754-44ff-9262-2fa65f650edf.png)
重点关注大解析:**upload.py**和**货物标解析main.py**
@ -838,7 +838,7 @@ utils是接口这块的公共功能函数。其中validate_and_setup_logger函
各个文件夹(output1 output2..)对应不同的接口请求
![1](http://124.71.159.195:1000/i/2025/03/06/tz5k57-2.png)
![1](D:/folder/test/output/021342c3-8801-4017-b220-89a7142802e3.png)
@ -850,7 +850,7 @@ testdir是平时写代码的测试的地方
它们都不影响正式和测试环境的解析
![1](http://124.71.159.195:1000/i/2025/03/06/tz5hz1-2.png)
![1](D:/folder/test/output/58065802-845f-4f52-b4b6-fc87cb873d3a.png)
@ -858,7 +858,7 @@ testdir是平时写代码的测试的地方
是两个解析流程中不一样的地方(一样的都写在**general**中了)
![1](http://124.71.159.195:1000/i/2025/03/06/tz5pu6-2.png)
![1](D:/folder/test/output/6f5017cc-f053-41f5-922c-1846d15f1d4d.png)
主要是货物标额外解析了采购要求提取采购需求main+技术参数要求提取+商务服务其他要求提取)
@ -868,7 +868,7 @@ testdir是平时写代码的测试的地方
ConnectionLimiter.py定义了接口超时时间->超时后断开与后端的连接
![1](http://124.71.159.195:1000/i/2025/03/06/tz5br8-2.png)
![1](D:/folder/test/output/387b0950-fb02-49da-81e6-fc7d4a7c542e.png)
logger_setup.py 为每个请求创建单独的log每个log对应一个log.txt
@ -894,13 +894,13 @@ start_up.py是启动脚本run_serve也是启动脚本是对start_up.py的
2. 大解析中返回了技术评分,后端接收后不仅显示给前端,还会返给向,用于生成技术偏离表
3. 小解析时get_deviation.py其实也可以返回技术评分但是没有返回因为没人和我对接暂时注释了。
![1](http://124.71.159.195:1000/i/2025/03/06/tz5zfw-2.png)
![1](D:/folder/test/output/2a05112b-6496-46ca-8145-e603d06fa950.png)
4.商务评议和技术评议偏离表,即评分细则的偏离表,暂时没做,但是**商务评分、技术评分**无论大解析还是小解析都解析了,稍微对该数据处理一下返回给后端就行。
![1](http://124.71.159.195:1000/i/2025/03/06/tz5y2n-2.png)
![1](D:/folder/test/output/49c6b5e3-9f25-42ca-be31-6d132d75fa30.png)
这个是解析得来的结果,适合给前端展示,但是要生成商务技术评议偏离表的话,需要再调一次大模型,对该数据进行重新归纳,以字符串列表为佳。再传给后端。(未做)
@ -1212,22 +1212,22 @@ if __name__ == '__main__':
### 项目贡献
![1](http://124.71.159.195:1000/i/2025/03/06/tz5fvu-2.png)
![1](D:/folder/test/output/176301b3-b473-4a85-9a4e-a1d71710c655.png)
![1](http://124.71.159.195:1000/i/2025/03/06/tz5km4-2.png)
![1](D:/folder/test/output/cf28a67b-5572-489e-aa50-4d822898f582.png)
![1](http://124.71.159.195:1000/i/2025/03/06/tz5kxd-2.png)
![1](D:/folder/test/output/2c1dbe1f-4893-423c-9cfd-8f06967de7d4.png)
![1](http://124.71.159.195:1000/i/2025/03/06/tz5crv-2.png)
![1](D:/folder/test/output/e6138a99-eae9-4aff-8402-bc09d183f45f.png)
### 效果图
![1](http://124.71.159.195:1000/i/2025/03/06/tz5trn-2.png)
![1](D:/folder/test/output/d66814f9-5858-4075-9439-b3b7768b3f9a.png)
![](http://124.71.159.195:1000/i/2025/03/06/tz5z4v-2.gif)
![](D:/folder/test/output/8177b69c-1686-42ad-a15b-24a04c41ab55.gif)
![1](http://124.71.159.195:1000/i/2025/03/06/tz5ymp-2.png)
![1](D:/folder/test/output/7f80dae7-3145-4732-a9d3-ca1e9502777b.png)
![1](http://124.71.159.195:1000/i/2025/03/06/tz5uwp-2.png)
![1](D:/folder/test/output/1b1b4658-90aa-42de-9842-b2974b108810.png)
![1](http://124.71.159.195:1000/i/2025/03/06/tz68dy-2.png)
![1](D:/folder/test/output/f358f6e4-8f0e-49e7-8587-661c04f87da9.png)