docs: 重写标签衍生流程说明

This commit is contained in:
2026-02-05 19:04:40 +08:00
parent 9305076825
commit 48644c662f

View File

@@ -13,14 +13,30 @@
## 标签衍生流程
![标签衍生流程图](docs/tag_derive_flow.png)
```
1. 查询数据库
└─ SELECT * FROM ai_image_tags WHERE status='tag_extension'
**流程说明:**
1. 遍历 `ai_image_tags` 表中每一条图片记录
2.`tag_id` 查询 `ai_tags` 表,检查该标签是否为衍生标签
3. 如果不是衍生标签,调用千问大模型生成衍生标签
4. 将新标签插入 `ai_tags` 表(标记为衍生标签)
5. 更新 `ai_image_tags` 表中的 `tag_id``tag_name`
2. 拼接图片URL
└─ 完整URL = CDN基础URL + image_url
3. 按10张分组并发发送请求
├─ Prompt图片1: ID=123, 原始标签「高血压」, 关键字「心血管」
├─ Prompt图片2: ID=124, 原始标签「糖尿病」, 关键字「内分泌」
└─ + 10张原图URL
4. 大模型返回衍生标签
└─ {"results": [{"id": 123, "derived_tags": ["衍生1", "衍生2"]}]}
5. 更新数据库
├─ ai_tags表INSERT 衍生标签
├─ ai_image_tags表UPDATE tag_id, tag_name
└─ status: tag_extension → manual_review
6. 审核失败处理DataInspectionFailed
├─ status → automated_review_failed
└─ 记录失败原因到 automated_review_failed_reason
```
## 项目结构