From b115b1a898052f6e86e8c6da7917eaf7736604da Mon Sep 17 00:00:00 2001 From: charles Date: Tue, 10 Feb 2026 20:51:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 448e4b1..a974590 100644 --- a/README.md +++ b/README.md @@ -56,21 +56,31 @@ graph TD SQLite -.->|"17. 检测 completed"| Gateway Gateway -->|"18. 返回最终结果"| User - %% 样式美化 - style Gateway fill:#bbdefb,stroke:#1565c0,stroke-width:3px - style TaskQueue fill:#fff9c4,stroke:#f57f17,stroke-width:2px - style SQLite fill:#e1bee7,stroke:#7b1fa2,stroke-width:2px - style MattingAPI fill:#e1f5fe,stroke:#01579b,stroke-width:2px - style ComparisonAPI fill:#fff3e0,stroke:#e65100,stroke-width:2px - style MattingCluster fill:#e3f2fd,stroke:#0277bd - style ComparisonCluster fill:#fff8e1,stroke:#f57c00 - style Folder1 fill:#f5f5f5,stroke:#616161 - style Folder2 fill:#f5f5f5,stroke:#616161 - style Folder3 fill:#f5f5f5,stroke:#616161 - style Storage fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px + %% 样式美化 - 黑色背景优化 + style Gateway fill:#1e88e5,stroke:#64b5f6,stroke-width:3px,color:#fff + style TaskQueue fill:#ffa726,stroke:#ffb74d,stroke-width:2px,color:#000 + style SQLite fill:#ab47bc,stroke:#ce93d8,stroke-width:2px,color:#fff + style MattingAPI fill:#26c6da,stroke:#4dd0e1,stroke-width:2px,color:#000 + style ComparisonAPI fill:#ff7043,stroke:#ff8a65,stroke-width:2px,color:#fff + style MattingCluster fill:#0277bd,stroke:#0288d1,color:#fff + style ComparisonCluster fill:#d84315,stroke:#e64a19,color:#fff + style M1 fill:#0288d1,stroke:#4fc3f7,color:#fff + style M2 fill:#0288d1,stroke:#4fc3f7,color:#fff + style M3 fill:#0288d1,stroke:#4fc3f7,color:#fff + style C1 fill:#e64a19,stroke:#ff7043,color:#fff + style C2 fill:#e64a19,stroke:#ff7043,color:#fff + style C3 fill:#e64a19,stroke:#ff7043,color:#fff + style Folder1 fill:#424242,stroke:#9e9e9e,stroke-width:2px,color:#e0e0e0 + style Folder2 fill:#424242,stroke:#9e9e9e,stroke-width:2px,color:#e0e0e0 + style Folder3 fill:#424242,stroke:#9e9e9e,stroke-width:2px,color:#e0e0e0 + style Storage fill:#1b5e20,stroke:#4caf50,stroke-width:2px,color:#fff + style User fill:#5e35b1,stroke:#9575cd,stroke-width:2px,color:#fff ``` -结构图(如有误请纠正) + +序列图(如有误请纠正) + ```mermaid +%%{init: {'theme':'dark'}}%% sequenceDiagram autonumber participant User as 用户 @@ -83,7 +93,7 @@ sequenceDiagram participant CW as Comparison Worker %% 上传阶段 - rect rgb(220, 240, 255) + rect rgb(30, 60, 90) Note over User,GW: 阶段1: 数据上传与任务创建 User->>+GW: POST /upload (100GB 原始数据) GW->>FS: 保存到 /input/raw_data.zip @@ -96,7 +106,7 @@ sequenceDiagram end %% Gateway 主动调度 Matting - rect rgb(225, 245, 254) + rect rgb(0, 60, 80) Note over GW,MW: 阶段2: Gateway 调度 Matting 任务 loop 遍历所有待处理任务 GW->>DB: SELECT task WHERE status='pending' LIMIT 1 @@ -121,7 +131,7 @@ sequenceDiagram end %% Gateway 主动调度 Comparison - rect rgb(255, 243, 224) + rect rgb(80, 40, 0) Note over GW,CW: 阶段3: Gateway 调度 Comparison 任务 GW->>DB: SELECT task WHERE status='matting_done' DB-->>GW: 返回 task_id='chunk_001' @@ -142,7 +152,7 @@ sequenceDiagram end %% 并发处理多个任务 - rect rgb(245, 245, 245) + rect rgb(40, 40, 40) Note over GW,CW: 并发处理 (Gateway 继续调度其他任务) par Gateway 同时调度多个任务 GW->>MAPI: POST /matting {task_id: 'chunk_002'} @@ -157,7 +167,7 @@ sequenceDiagram end %% 进度查询 - rect rgb(232, 245, 233) + rect rgb(20, 60, 40) Note over User,GW: 阶段4: 进度查询与结果下载 User->>+GW: GET /status/{job_id} GW->>DB: SELECT COUNT(*) FROM tasks WHERE job_id=? GROUP BY status @@ -173,7 +183,7 @@ sequenceDiagram end %% 错误处理 - rect rgb(255, 235, 238) + rect rgb(80, 20, 20) Note over MW,GW: 异常处理与重试 MW->>MW: 处理失败 (OOM 或其他错误) MW->>DB: UPDATE status='failed', error='CUDA out of memory'