Files
opc-backup/figures/06-deployment.svg
T

121 lines
8.6 KiB
XML
Raw Normal View History

2026-08-23 21:35:45 +08:00
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1040 830" width="1040" height="830" font-family="'PingFang SC','Microsoft YaHei','Noto Sans SC',system-ui,sans-serif">
<defs>
<marker id="ah" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#64748b"/>
</marker>
<marker id="ah-blue" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#2563eb"/>
</marker>
<marker id="ah-purple" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#8b5cf6"/>
</marker>
<marker id="ah-green" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#16a34a"/>
</marker>
<filter id="shadow" x="-8%" y="-8%" width="120%" height="130%">
<feDropShadow dx="0" dy="2" stdDeviation="3" flood-color="#0f172a" flood-opacity="0.10"/>
</filter>
</defs>
<rect x="0" y="0" width="1040" height="830" fill="#fbfcfe"/>
<text x="520" y="34" text-anchor="middle" font-size="21" font-weight="700" fill="#0f172a">后端服务群 · 部署拓扑</text>
<text x="520" y="58" text-anchor="middle" font-size="12.5" fill="#64748b">随部署 · 不做本地推理 · 全部代理云厂商(单机 Docker Compose 编排)</text>
<!-- ===== 外部接入 ===== -->
<text x="50" y="92" font-size="12" font-weight="700" fill="#94a3b8" letter-spacing="1">外部接入</text>
<g filter="url(#shadow)">
<rect x="60" y="100" width="360" height="70" rx="10" fill="#ffffff" stroke="#16a34a" stroke-width="2"/>
<text x="82" y="128" font-size="14" font-weight="700" fill="#15803d">小程序 / web业务 / web官网 / admin管理平台</text>
<text x="82" y="150" font-size="11" fill="#64748b">浏览器 / 微信小程序 · 公网 HTTPS</text>
</g>
<g filter="url(#shadow)">
<rect x="460" y="100" width="260" height="70" rx="10" fill="#ffffff" stroke="#0d9488" stroke-width="2"/>
<text x="482" y="128" font-size="14" font-weight="700" fill="#0f766e">智能体桌面应用</text>
<text x="482" y="150" font-size="11" fill="#64748b">用户机器 · 经公网/内网</text>
</g>
<g filter="url(#shadow)">
<rect x="760" y="100" width="220" height="70" rx="10" fill="#ffffff" stroke="#ea580c" stroke-width="2"/>
<text x="782" y="128" font-size="14" font-weight="700" fill="#c2410c">大屏桌面应用</text>
<text x="782" y="150" font-size="11" fill="#64748b">园区内网 · 园区账号登录</text>
</g>
<!-- 外部 → 网关 -->
<line x1="240" y1="170" x2="240" y2="260" stroke="#2563eb" stroke-width="2" marker-end="url(#ah-blue)"/>
<line x1="590" y1="170" x2="590" y2="260" stroke="#2563eb" stroke-width="2" marker-end="url(#ah-blue)"/>
<line x1="870" y1="170" x2="870" y2="260" stroke="#2563eb" stroke-width="2" marker-end="url(#ah-blue)"/>
<text x="252" y="220" font-size="10.5" fill="#2563eb" font-weight="600" paint-order="stroke" stroke="#fff" stroke-width="3">HTTPS/WSS</text>
<!-- ===== 服务群容器 ===== -->
<g filter="url(#shadow)">
<rect x="60" y="260" width="920" height="420" rx="14" fill="#eff6ff" stroke="#2563eb" stroke-width="2"/>
<text x="82" y="286" font-size="16" font-weight="700" fill="#1d4ed8">云服务器 · 服务群(Docker Compose 编排)</text>
<text x="520" y="286" font-size="11.5" fill="#3b82f6">共享内网 · 服务间 loopback 互通</text>
<!-- 网关 -->
<rect x="80" y="298" width="880" height="44" rx="9" fill="#eef2ff" stroke="#6366f1" stroke-width="1.5"/>
<text x="100" y="325" font-size="13.5" font-weight="700" fill="#4338ca">gateway 网关 · :443</text>
<text x="340" y="325" font-size="11" fill="#4f46e5">统一入口 · TLS 终结 · 鉴权 · 路由 · 限流</text>
<!-- 核心服务 -->
<rect x="80" y="360" width="380" height="140" rx="10" fill="#ffffff" stroke="#2563eb" stroke-width="1.5"/>
<text x="100" y="388" font-size="14" font-weight="700" fill="#1d4ed8">核心服务 · :8090</text>
<text x="100" y="410" font-size="10.5" fill="#475569">auth · business · agent · task</text>
<text x="100" y="428" font-size="10.5" fill="#475569">gov · park · notify · file(模块内聚)</text>
<text x="100" y="452" font-size="9.5" fill="#94a3b8">身份 + 业务域 + 园区聚合</text>
<text x="100" y="470" font-size="9.5" fill="#94a3b8">SQLite(单体)/ 分库(微服务)</text>
<!-- 算力服务 -->
<rect x="490" y="360" width="200" height="140" rx="10" fill="#f5f3ff" stroke="#8b5cf6" stroke-width="1.5"/>
<text x="510" y="388" font-size="14" font-weight="700" fill="#6d28d9">算力服务 · :8092</text>
<text x="510" y="412" font-size="10.5" fill="#475569">额度/令牌/流水聚合</text>
<text x="510" y="432" font-size="10.5" fill="#475569">管理·页面自研</text>
<text x="510" y="470" font-size="9.5" fill="#8b5cf6">封装 new-api 引擎</text>
<!-- 算力引擎 -->
<rect x="720" y="360" width="240" height="140" rx="10" fill="#ffffff" stroke="#7c3aed" stroke-width="1.5" stroke-dasharray="6,4"/>
<text x="740" y="388" font-size="14" font-weight="700" fill="#6d28d9">算力引擎 new-api · :3000</text>
<text x="740" y="412" font-size="10.5" fill="#475569">仅服务(relay /v1 · 管理 API</text>
<text x="740" y="432" font-size="10.5" fill="#475569">无页面暴露 · 内部访问</text>
<text x="740" y="470" font-size="9.5" fill="#94a3b8">不做本地推理 · 全云渠道</text>
<!-- 基础设施 -->
<rect x="80" y="520" width="240" height="56" rx="9" fill="#f8fafc" stroke="#94a3b8" stroke-width="1.5"/>
<text x="100" y="546" font-size="13" font-weight="700" fill="#475569">MQTT 消息服务</text>
<text x="100" y="566" font-size="10.5" fill="#64748b">EMQX · :1883 / :8083(WS)</text>
<rect x="350" y="520" width="240" height="56" rx="9" fill="#f8fafc" stroke="#94a3b8" stroke-width="1.5"/>
<text x="370" y="546" font-size="13" font-weight="700" fill="#475569">缓存服务</text>
<text x="370" y="566" font-size="10.5" fill="#64748b">Redis · :6379</text>
<rect x="620" y="520" width="340" height="56" rx="9" fill="#f8fafc" stroke="#94a3b8" stroke-width="1.5"/>
<text x="640" y="546" font-size="13" font-weight="700" fill="#475569">数据库服务</text>
<text x="640" y="566" font-size="10.5" fill="#64748b">SQLite(单体)→ MySQL/PostgreSQL · :3306(微服务分库)</text>
</g>
<!-- 服务间连接 -->
<!-- 网关 → 核心 -->
<line x1="240" y1="342" x2="240" y2="360" stroke="#2563eb" stroke-width="2" marker-end="url(#ah-blue)"/>
<text x="252" y="354" font-size="9.5" fill="#2563eb" font-weight="600" paint-order="stroke" stroke="#fff" stroke-width="3">路由</text>
<!-- 核心 → 算力服务 -->
<line x1="460" y1="430" x2="490" y2="430" stroke="#8b5cf6" stroke-width="2" marker-end="url(#ah-purple)"/>
<text x="475" y="420" text-anchor="middle" font-size="9.5" fill="#6d28d9" font-weight="600" paint-order="stroke" stroke="#fff" stroke-width="3">额度/聚合</text>
<!-- 算力服务 → 引擎 -->
<line x1="690" y1="430" x2="720" y2="430" stroke="#8b5cf6" stroke-width="2" marker-end="url(#ah-purple)"/>
<text x="705" y="420" text-anchor="middle" font-size="9.5" fill="#6d28d9" font-weight="600" paint-order="stroke" stroke="#fff" stroke-width="3">relay /v1</text>
<!-- 核心 → 基础设施 -->
<path d="M 120 500 L 120 520" fill="none" stroke="#94a3b8" stroke-width="2" marker-end="url(#ah)"/>
<path d="M 250 500 L 470 520" fill="none" stroke="#94a3b8" stroke-width="2" marker-end="url(#ah)"/>
<path d="M 420 500 L 790 520" fill="none" stroke="#94a3b8" stroke-width="2" marker-end="url(#ah)"/>
<!-- ===== 云厂商渠道 ===== -->
<g filter="url(#shadow)">
<rect x="60" y="730" width="920" height="62" rx="12" fill="#f0fdf4" stroke="#16a34a" stroke-width="2"/>
<text x="82" y="758" font-size="14" font-weight="700" fill="#15803d">云厂商渠道(HTTPS 出站)</text>
<text x="320" y="758" font-size="12" fill="#334155">OpenAI · DeepSeek · 通义千问 · Claude · Gemini · …</text>
<text x="82" y="780" font-size="10.5" fill="#64748b">算力引擎统一代理 · 额度/计费/日志在此汇聚</text>
</g>
<!-- 引擎 → 云厂商 -->
<line x1="840" y1="500" x2="840" y2="730" stroke="#16a34a" stroke-width="2" marker-end="url(#ah-green)"/>
<text x="852" y="620" font-size="10.5" fill="#15803d" font-weight="600" paint-order="stroke" stroke="#fff" stroke-width="3">出站代理</text>
</svg>