50 lines
3.5 KiB
JSON
50 lines
3.5 KiB
JSON
{
|
||||
|
|
"schema_version": 1,
|
|||
|
|
"diagram_type": "sequence",
|
|||
|
|
"meta": {
|
|||
|
|
"title": "设备从注册到聊天结束的完整流程",
|
|||
|
|
"locale": "zh-CN",
|
|||
|
|
"output": "docs/diagrams/device-conversation-lifecycle.html",
|
|||
|
|
"viewBox": [1080, 590],
|
|||
|
|
"quality_profile": "showcase",
|
|||
|
|
"column_fit": "spread"
|
|||
|
|
},
|
|||
|
|
"participants": [
|
|||
|
|
{ "id": "ops", "type": "frontend", "label": "运维平台", "sublabel": "登记 / 放行" },
|
|||
|
|
{ "id": "app", "type": "frontend", "label": "用户 App", "sublabel": "扫码绑定" },
|
|||
|
|
{ "id": "device", "type": "external", "label": "EchoEar", "sublabel": "ESP32-S3" },
|
|||
|
|
{ "id": "saas", "type": "backend", "label": "自有 SaaS", "sublabel": "设备控制面" },
|
|||
|
|
{ "id": "volcIot", "type": "cloud", "label": "火山 IoT", "sublabel": "DynamicRegister" },
|
|||
|
|
{ "id": "volcAgent", "type": "cloud", "label": "火山智能体", "sublabel": "实时对话" }
|
|||
|
|
],
|
|||
|
|
"segments": [
|
|||
|
|
{ "from": 150, "to": 226, "label": "一、平台注册与绑定" },
|
|||
|
|
{ "from": 232, "to": 310, "label": "二、首次预配(仅一次)" },
|
|||
|
|
{ "from": 316, "to": 424, "label": "三、每次开始聊天" },
|
|||
|
|
{ "from": 430, "to": 520, "label": "四、聊天与结束" }
|
|||
|
|
],
|
|||
|
|
"messages": [
|
|||
|
|
{ "id": "register", "from": "ops", "to": "saas", "y": 166, "label": "登记设备,生成平台 Device Secret", "variant": "emphasis" },
|
|||
|
|
{ "id": "inject", "from": "saas", "to": "device", "y": 194, "label": "安全注入平台身份(无 Product Secret)", "variant": "security" },
|
|||
|
|
{ "id": "claim", "from": "app", "to": "saas", "y": 222, "label": "消费绑定码:CLAIMABLE → BOUND", "variant": "emphasis" },
|
|||
|
|
{ "id": "provision", "from": "device", "to": "saas", "y": 250, "label": "请求 hardware-agent-credentials:provision", "variant": "emphasis" },
|
|||
|
|
{ "id": "dynamicRegister", "from": "saas", "to": "volcIot", "y": 278, "label": "DynamicRegister:新设备消耗 1 个 License", "variant": "security" },
|
|||
|
|
{ "id": "active", "from": "saas", "to": "device", "y": 306, "label": "加密保存并下发一机一密 → ACTIVE", "variant": "return" },
|
|||
|
|
{ "id": "start", "from": "device", "to": "saas", "y": 334, "label": "POST /device/v3/agent-sessions", "variant": "emphasis" },
|
|||
|
|
{ "id": "config", "from": "saas", "to": "device", "y": 362, "label": "返回 Bot、人设、授权上下文与 nonce", "variant": "return" },
|
|||
|
|
{ "id": "connect", "from": "device", "to": "volcAgent", "y": 390, "label": "一机一密建连并注入 session.update", "variant": "security" },
|
|||
|
|
{ "id": "started", "from": "device", "to": "saas", "y": 418, "label": "配置确认后上报 session_started", "variant": "emphasis" },
|
|||
|
|
{ "id": "audio", "from": "device", "to": "volcAgent", "y": 446, "label": "双向音频 / 打断 / 工具调用", "variant": "default" },
|
|||
|
|
{ "id": "sync", "from": "device", "to": "saas", "y": 474, "label": "session_updated + 最终字幕回流", "variant": "dashed" },
|
|||
|
|
{ "id": "ended", "from": "device", "to": "saas", "y": 506, "label": "断开火山并上报 ended / failed → 摘要记忆", "variant": "emphasis" }
|
|||
|
|
],
|
|||
|
|
"activations": [
|
|||
|
|
{ "participant": "saas", "from": 160, "to": 228, "type": "backend" },
|
|||
|
|
{ "participant": "saas", "from": 240, "to": 312, "type": "backend" },
|
|||
|
|
{ "participant": "volcIot", "from": 268, "to": 286, "type": "cloud" },
|
|||
|
|
{ "participant": "saas", "from": 324, "to": 424, "type": "backend" },
|
|||
|
|
{ "participant": "volcAgent", "from": 380, "to": 512, "type": "cloud" },
|
|||
|
|
{ "participant": "saas", "from": 468, "to": 514, "type": "backend" }
|
|||
|
|
]
|
|||
|
|
}
|