fix: 新增数据模块

This commit is contained in:
Daniel
2026-04-07 01:34:49 +08:00
parent e606b3dcd6
commit f529aa3279
11 changed files with 319 additions and 10 deletions

View File

@@ -210,6 +210,8 @@ video_worker/
- 对外 HTTP 入口,触发 WS 下发给边缘设备
- `GET /dispatch/{dispatch_id}`edge_dispatch_service
- 查询调度任务状态和结果
- `POST /dispatch/{dispatch_id}/artifacts`edge_dispatch_service
- 边缘上传产物到中心,由中心服务直传 OSS返回 OSS URL
- `GET /devices`edge_dispatch_service
- 查看在线边缘设备
- `WS /ws/edge/{device_id}`edge_dispatch_service
@@ -339,6 +341,25 @@ curl -X POST http://<dispatch-host>:8020/dispatch/generate \
curl http://<dispatch-host>:8020/dispatch/<dispatch_id>
```
### OSS 直传链路(防止中心堆积)
1. 边缘执行完成后将 `video.mp4/first_frame.jpg/metadata.json/run.log` 提交到:
- `POST /dispatch/{dispatch_id}/artifacts`
2. 中心服务不落地文件,直接流式上传到 OSS。
3. 中心仅保存 `artifact_urls`OSS URL外部系统通过 `GET /dispatch/{dispatch_id}` 获取结果。
需要在 `.env` 配置 OSS
```env
OSS_ENABLED=true
OSS_ENDPOINT=https://oss-cn-hangzhou.aliyuncs.com
OSS_BUCKET=your-bucket
OSS_ACCESS_KEY_ID=your-ak
OSS_ACCESS_KEY_SECRET=your-sk
OSS_PUBLIC_BASE_URL=https://your-bucket.oss-cn-hangzhou.aliyuncs.com
OSS_PREFIX=video-worker
```
## 9. 常见问题
- `ffmpeg not found`