将调度内核标识从 SimpleLite 全面重命名为 Simple3。
配置段/环境变量、Launcher、健康检查 API、OpenAPI 与前后端文案同步;兼容探测旧 SimpleLite 进程名。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+116
-116
@@ -1,10 +1,10 @@
|
||||
# SimpleLite 三端系统架构设计
|
||||
# Simple3 三端系统架构设计
|
||||
|
||||
> **Migu2.0 仓库说明**:平台后端已拆至本仓库,工程名为 **`MiGu.Server`**(原 `Platform.Server`)。SimpleLite 与前端源码仍在兄弟仓库 `Simple`。下文中的 `MiGu.Server` 即指本仓库 `MiGu.Server/` 目录。
|
||||
> **Migu2.0 仓库说明**:平台后端已拆至本仓库,工程名为 **`MiGu.Server`**(原 `Platform.Server`)。Simple3 与前端源码仍在兄弟仓库 `Simple`。下文中的 `MiGu.Server` 即指本仓库 `MiGu.Server/` 目录。
|
||||
|
||||
> 文档版本:v1.7.0
|
||||
> 更新日期:2026-05-20
|
||||
> 范围:SimpleLite(主程序 / 设计端 / 调度引擎宿主 / 进程编排器)+ Platform(业务平台 · 同时承载管理员前端 platform-vue 与运营前端 rcsmonitor-vue · 共用一套 WebAPI · **主入口为 MiGu.Server,登录后拉起 SimpleLite**)
|
||||
> 范围:Simple3(主程序 / 设计端 / 调度引擎宿主 / 进程编排器)+ Platform(业务平台 · 同时承载管理员前端 platform-vue 与运营前端 rcsmonitor-vue · 共用一套 WebAPI · **主入口为 MiGu.Server,登录后拉起 Simple3**)
|
||||
|
||||
> v1.7.0 变更(多主题色板 · 工业紫默认):
|
||||
> - **6 套可切换主题**:`themes.ts` 定义色板(工业紫、深邃蓝、翡翠绿、熔铁赤、石墨钢、琥珀金);默认 **工业紫色** `#6a1b9a`(比 v1.6.2 的 `#641393` 更深更饱和,解决登录后内容区配色过淡)。
|
||||
@@ -37,13 +37,13 @@
|
||||
> - 新增 §7.4–§7.7 四类 DB 部署形态详述、选型矩阵、连接串与配置示例、迁移注意事项。
|
||||
|
||||
> v1.4 变更(保留):
|
||||
> - **明确进程编排归属**:Platform 后端进程 `MiGu.Server.exe` 不再被视为"独立的业务平台服务",而是 SimpleLite 内置 `SystemMission`(`StartPlatformMission`)拉起、被 SimpleLite Bootstrapper 守护的**受控子进程**;RCSMonitor 不存在独立后端进程,复用 MiGu.Server。
|
||||
> - **明确进程编排归属**:Platform 后端进程 `MiGu.Server.exe` 不再被视为"独立的业务平台服务",而是 Simple3 内置 `SystemMission`(`StartPlatformMission`)拉起、被 Simple3 Bootstrapper 守护的**受控子进程**;RCSMonitor 不存在独立后端进程,复用 MiGu.Server。
|
||||
> - **整体定位章节重写**:明确"两类后端可执行文件 + 一个进程编排者"的关系,避免读者误以为 Platform 是用 Windows Service / systemd 独立部署的服务。
|
||||
|
||||
> v1.3 变更(保留):
|
||||
> 1. **取消 RCSMonitor.Server**:`rcsmonitor-vue` 不再有独立后端进程,直接连 MiGu.Server;由 JWT 中的 `scope=RCSMonitor` + 角色权限码 + `WidgetGrant` 三层限制可见控件与可调用 API。
|
||||
> 2. **3D 渲染基座定为 webVRender**:复用 SimpleLite WebTerminal 已经提供的 webVRender,以 Web Component / iframe 嵌入到 platform-vue 与 rcsmonitor-vue,两端共享同一份 Workspace 协议(PutModel / PutPointCloud / SetCamera 等 DTO)。
|
||||
> 3. **反向代理选定 YARP**:MiGu.Server 内置 [YARP](https://microsoft.github.io/reverse-proxy/) 做 `/api/sl/*` → SimpleLite WebAPI 的反代;带鉴权与审计中间件。
|
||||
> 2. **3D 渲染基座定为 webVRender**:复用 Simple3 WebTerminal 已经提供的 webVRender,以 Web Component / iframe 嵌入到 platform-vue 与 rcsmonitor-vue,两端共享同一份 Workspace 协议(PutModel / PutPointCloud / SetCamera 等 DTO)。
|
||||
> 3. **反向代理选定 YARP**:MiGu.Server 内置 [YARP](https://microsoft.github.io/reverse-proxy/) 做 `/api/sl/*` → Simple3 WebAPI 的反代;带鉴权与审计中间件。
|
||||
> 4. **运行模式持久化到 `simple.json`**:登录窗"记住模式"勾选后写入 `simple.json.runMode`;下次启动直接进入。
|
||||
> 5. **Web-Enabled 下严禁同时本地操作**:CycleGUI 主窗只剩"服务状态窗",所有业务面板硬性隐藏;不提供"临时启用本地 UI"开关。
|
||||
> 6. **共享前端组件库**:使用 pnpm workspace + `frontends/packages/sl-controls`,封装 Workspace3D / 地图 / 任务 / CAD 等可复用 Vue 组件。
|
||||
@@ -79,43 +79,43 @@
|
||||
|
||||
一套为 AGV/AMR 现场打造的「**设计 → 调度 → 运营监控**」三端协同系统。
|
||||
|
||||
**三个"端"对应三套用户体验,但只有两类后端可执行文件,且都由 SimpleLite 统一编排:**
|
||||
**三个"端"对应三套用户体验,但只有两类后端可执行文件,且都由 Simple3 统一编排:**
|
||||
|
||||
| 端 | 前端载体 | 后端可执行文件 | **启动者** | 角色 | 写权限 |
|
||||
|----|----------|----------------|------------|------|--------|
|
||||
| **SimpleLite 桌面端** | CycleGUI 客户端 | `SimpleLite.exe` 自身 | 用户双击 / 服务管理器 | 主程序 + 调度引擎宿主 + 全功能 WebAPI 提供者 + **进程编排器(Bootstrapper + SystemMission)** | **全功能** |
|
||||
| **Platform 管理端** | `platform-vue` (Vue 3 SPA) | `MiGu.Server.exe` | **SimpleLite 内置 `SystemMission.StartPlatformMission` 拉起**(Web-Enabled 时自动 spawn;崩溃由 SimpleLite Watchdog 重启) | **SimpleLite 全能力套壳**:管理员侧 Vue 前端复刻所有设计/调度控件 + 业务平台特有能力(配置中心 / 外部对接 / 库位 / 账号) | **全功能**(等价 SimpleLite) |
|
||||
| **RCSMonitor 运营端** | `rcsmonitor-vue` (Vue 3 SPA) | **共用 `MiGu.Server.exe`**(无独立后端进程) | 随 MiGu.Server 一起被 SimpleLite 拉起 | 运营监控前端:按 `scope=RCSMonitor` + 角色权限 + WidgetGrant 三层裁剪 UI;可对任务/车辆执行白名单运维动作 | **受限**(仅运维白名单) |
|
||||
| **Simple3 桌面端** | CycleGUI 客户端 | `Simple3.exe` 自身 | 用户双击 / 服务管理器 | 主程序 + 调度引擎宿主 + 全功能 WebAPI 提供者 + **进程编排器(Bootstrapper + SystemMission)** | **全功能** |
|
||||
| **Platform 管理端** | `platform-vue` (Vue 3 SPA) | `MiGu.Server.exe` | **Simple3 内置 `SystemMission.StartPlatformMission` 拉起**(Web-Enabled 时自动 spawn;崩溃由 Simple3 Watchdog 重启) | **Simple3 全能力套壳**:管理员侧 Vue 前端复刻所有设计/调度控件 + 业务平台特有能力(配置中心 / 外部对接 / 库位 / 账号) | **全功能**(等价 Simple3) |
|
||||
| **RCSMonitor 运营端** | `rcsmonitor-vue` (Vue 3 SPA) | **共用 `MiGu.Server.exe`**(无独立后端进程) | 随 MiGu.Server 一起被 Simple3 拉起 | 运营监控前端:按 `scope=RCSMonitor` + 角色权限 + WidgetGrant 三层裁剪 UI;可对任务/车辆执行白名单运维动作 | **受限**(仅运维白名单) |
|
||||
|
||||
**关键澄清(v1.4 重点):**
|
||||
|
||||
- **后端可执行文件只有 2 个**:`SimpleLite.exe`、`MiGu.Server.exe`。
|
||||
- **进程启动只有 1 个真正的入口**:用户/服务管理器只启动 `SimpleLite.exe`,MiGu.Server 由 SimpleLite 自己拉起,**不需要也不允许独立安装为 Windows Service**。
|
||||
- **进程编排归属 SimpleLite**:`SystemMission` 是 SimpleLite 自带的 Mission 体系扩展(与业务 Mission 区分开),专门负责拉起/守护/优雅停止 MiGu.Server。Bootstrapper 监听心跳、按指数退避重启、统一记录 OpsAuditLog。
|
||||
- **后端可执行文件只有 2 个**:`Simple3.exe`、`MiGu.Server.exe`。
|
||||
- **进程启动只有 1 个真正的入口**:用户/服务管理器只启动 `Simple3.exe`,MiGu.Server 由 Simple3 自己拉起,**不需要也不允许独立安装为 Windows Service**。
|
||||
- **进程编排归属 Simple3**:`SystemMission` 是 Simple3 自带的 Mission 体系扩展(与业务 Mission 区分开),专门负责拉起/守护/优雅停止 MiGu.Server。Bootstrapper 监听心跳、按指数退避重启、统一记录 OpsAuditLog。
|
||||
- **Vue 两份产物,同一进程托管**:MiGu.Server 在 `/admin/*` 路径下托管 `platform-vue`,在 `/monitor/*` 路径下托管 `rcsmonitor-vue`。
|
||||
- **鉴权与限权完全在 MiGu.Server 完成**:RCSMonitor 不持有任何独立后端代码(没有 `RCSMonitor.Server.exe`、没有独立库)。
|
||||
- **Desktop-Only 模式下,SystemMission 不触发**:MiGu.Server 根本不会启动,Vue 端无法访问。
|
||||
|
||||
> 一句话:**用户点 SimpleLite.exe,由 SimpleLite 通过 Mission 把 Platform 后端拉起来;Platform 后端再把两套 Vue 端服好。**
|
||||
> 一句话:**用户点 Simple3.exe,由 Simple3 通过 Mission 把 Platform 后端拉起来;Platform 后端再把两套 Vue 端服好。**
|
||||
|
||||
### 1.2 核心拆分原则
|
||||
|
||||
1. **Crash-Isolation(搞不崩主服务)**
|
||||
Platform / RCSMonitor 对**地图/任务/车辆等写操作**都通过 SimpleLite 的 `/api/*` 网关;主服务侧做白名单 + 幂等校验 + 频次限流 + 审计。Platform-Vue 走完整 API 集,RCSMonitor-Vue 仅限运维白名单 `/api/ops/*`。
|
||||
Platform / RCSMonitor 对**地图/任务/车辆等写操作**都通过 Simple3 的 `/api/*` 网关;主服务侧做白名单 + 幂等校验 + 频次限流 + 审计。Platform-Vue 走完整 API 集,RCSMonitor-Vue 仅限运维白名单 `/api/ops/*`。
|
||||
|
||||
2. **共享数据模型,独立运行时**
|
||||
地图、车辆、任务三端共用 `SimpleCore` 的 DTO;调度引擎只在 SimpleLite 里跑,Platform 只持有"投影"。
|
||||
地图、车辆、任务三端共用 `SimpleCore` 的 DTO;调度引擎只在 Simple3 里跑,Platform 只持有"投影"。
|
||||
|
||||
3. **库分离 + Provider 抽象**(详见 §7)
|
||||
- `simple_main` 由 SimpleLite 持有;`platform` 由 Platform 持有(含 RCSMonitor 审计/标注);不再有独立的 `rcsmonitor_local`。
|
||||
- `simple_main` 由 Simple3 持有;`platform` 由 Platform 持有(含 RCSMonitor 审计/标注);不再有独立的 `rcsmonitor_local`。
|
||||
- 持久层基于 **EF Core**,**通过 Provider 切换底层数据库**:默认 **SQLite**(边缘单机,配 ROSE HA);可选 **MySQL / PostgreSQL / SQL Server**,匹配现场已有 IT 基础设施与企业级 HA 能力(详见 §7.4–§7.7)。
|
||||
- 高可用方案随 Provider 不同:SQLite 用 ROSE HA;MySQL 用 InnoDB Cluster;PostgreSQL 用 Patroni;SQL Server 用 Always On AG。
|
||||
|
||||
4. **统一协议层**
|
||||
所有进程间调用统一 **WebAPI(REST/JSON)+ WebSocket 事件流**;Vue 端直接对接 Platform 后端的 REST + WS;Platform 后端用 **YARP** 反代 SimpleLite 的设计/调度 API。
|
||||
所有进程间调用统一 **WebAPI(REST/JSON)+ WebSocket 事件流**;Vue 端直接对接 Platform 后端的 REST + WS;Platform 后端用 **YARP** 反代 Simple3 的设计/调度 API。
|
||||
|
||||
5. **统一身份**
|
||||
`SimpleShared.Auth` 提供 JWT + RBAC;Platform 是主权限源(在线时),SimpleLite 在 Desktop-Only 下用本地用户表降级。
|
||||
`SimpleShared.Auth` 提供 JWT + RBAC;Platform 是主权限源(在线时),Simple3 在 Desktop-Only 下用本地用户表降级。
|
||||
|
||||
6. **运行模式互斥(强约束)**
|
||||
- **Desktop-Only**:CycleGUI 客户端独占;WebAPI / Platform **不启动**。
|
||||
@@ -139,7 +139,7 @@ flowchart TB
|
||||
end
|
||||
|
||||
subgraph Host["主控宿主机 / 边缘服务器"]
|
||||
subgraph SL["SimpleLite 主进程 (CycleGUI + ASP.NET Core 8)"]
|
||||
subgraph SL["Simple3 主进程 (CycleGUI + ASP.NET Core 8)"]
|
||||
direction TB
|
||||
SL_Login["启动登录窗<br/>(模式选择 Desktop / Web)"]
|
||||
SL_UI["CycleGUI 客户端<br/>(Desktop-Only: 全功能<br/>Web-Enabled: 仅状态窗)"]
|
||||
@@ -155,7 +155,7 @@ flowchart TB
|
||||
direction TB
|
||||
PL_Static["静态资源<br/>/admin/* → platform-vue dist<br/>/monitor/* → rcsmonitor-vue dist"]
|
||||
PL_API["Platform WebAPI<br/>(配置中心 / 外部对接 / 库位 / 账号)"]
|
||||
PL_YARP["YARP 反代<br/>/api/sl/* → SimpleLite WebAPI<br/>+ Auth/审计中间件"]
|
||||
PL_YARP["YARP 反代<br/>/api/sl/* → Simple3 WebAPI<br/>+ Auth/审计中间件"]
|
||||
PL_Auth["SimpleAuth<br/>(JWT 签发 + Scope 校验)"]
|
||||
PL_Adp["外部系统适配器<br/>(MES / WMS / RCS)"]
|
||||
PL_DB[("SQLite: platform.db<br/>WAL")]
|
||||
@@ -203,11 +203,11 @@ flowchart TB
|
||||
|
||||
**要点:**
|
||||
|
||||
- **只有两个后端可执行文件**:`SimpleLite.exe` 与 `MiGu.Server.exe`;RCSMonitor 不再有独立后端。
|
||||
- **`MiGu.Server.exe` 由 SimpleLite 的 SystemMission 拉起**:用户只启动 SimpleLite;Web-Enabled 时 `StartPlatformMission` 自动 spawn MiGu.Server,子进程心跳异常由 Bootstrapper 重启。
|
||||
- **只有两个后端可执行文件**:`Simple3.exe` 与 `MiGu.Server.exe`;RCSMonitor 不再有独立后端。
|
||||
- **`MiGu.Server.exe` 由 Simple3 的 SystemMission 拉起**:用户只启动 Simple3;Web-Enabled 时 `StartPlatformMission` 自动 spawn MiGu.Server,子进程心跳异常由 Bootstrapper 重启。
|
||||
- **`PL_Static` 同一进程双 SPA 托管**:浏览器访问路径决定加载哪份 dist,登录时也按路径决定 `scope` 参数。
|
||||
- **`PL_YARP` 把 `/api/sl/*` 反代到 SimpleLite**:YARP 在请求转发前后挂中间件做 JWT 校验、权限码二次确认、写操作审计、`Idempotency-Key` 透传、Scope 检查(RCSMonitor 的请求仅允许命中 `/api/ops/*` 这一前缀)。
|
||||
- **3D 由 SimpleLite 的 webVRender 提供**:Vue 端通过 iframe 或 Web Component 嵌入 webVRender 的页面,业务交互(选择、点击坐标等)通过 `postMessage` 与 Vue 桥接。
|
||||
- **`PL_YARP` 把 `/api/sl/*` 反代到 Simple3**:YARP 在请求转发前后挂中间件做 JWT 校验、权限码二次确认、写操作审计、`Idempotency-Key` 透传、Scope 检查(RCSMonitor 的请求仅允许命中 `/api/ops/*` 这一前缀)。
|
||||
- **3D 由 Simple3 的 webVRender 提供**:Vue 端通过 iframe 或 Web Component 嵌入 webVRender 的页面,业务交互(选择、点击坐标等)通过 `postMessage` 与 Vue 桥接。
|
||||
- **Desktop-Only 模式**:`SL_API`、`PL` 都不启动;Vue 无法访问;CycleGUI 是唯一入口。
|
||||
- **Web-Enabled 模式**:CycleGUI 退化为状态窗;所有业务操作通过 Vue 完成;硬性不允许同时本地操作。
|
||||
|
||||
@@ -219,8 +219,8 @@ flowchart TB
|
||||
|
||||
```mermaid
|
||||
flowchart TB
|
||||
Start([SimpleLite.exe 启动]) --> CheckPrev{simple.json 中<br/>runMode 已记忆?}
|
||||
CheckPrev -- 否 --> Login[弹出登录窗<br/>SimpleLite Boot Login]
|
||||
Start([Simple3.exe 启动]) --> CheckPrev{simple.json 中<br/>runMode 已记忆?}
|
||||
CheckPrev -- 否 --> Login[弹出登录窗<br/>Simple3 Boot Login]
|
||||
CheckPrev -- 是 --> AutoLogin[自动按记忆模式登录<br/>仍需鉴权身份]
|
||||
Login --> Form
|
||||
AutoLogin --> ModeSwitch
|
||||
@@ -269,7 +269,7 @@ flowchart TB
|
||||
|
||||
| 元素 | 控件 | 说明 |
|
||||
|------|------|------|
|
||||
| 标题 | Label | "SimpleLite · 启动登录" |
|
||||
| 标题 | Label | "Simple3 · 启动登录" |
|
||||
| 用户名 | TextInput | 默认上次登录用户 |
|
||||
| 密码 | TextInput (password) | — |
|
||||
| 运行模式 | RadioButtons | `Desktop-Only` / `Web-Enabled` |
|
||||
@@ -281,7 +281,7 @@ flowchart TB
|
||||
| 登录按钮 | Button | 通过后销毁登录窗,进入选定模式 |
|
||||
| 退出按钮 | Button | 不进入主程序,退出进程 |
|
||||
|
||||
> 实现位置:新增 `SimpleLite/UI/BootLoginPanel.cs`,由 `Program.Main` 在 `Enssentials.Load` 之后、`Startup.EntryPoint` 之前调用 `GUI.PromptAndWaitPanel(BootLoginPanel.Build())`(阻塞式模态)。
|
||||
> 实现位置:新增 `Simple3/UI/BootLoginPanel.cs`,由 `Program.Main` 在 `Enssentials.Load` 之后、`Startup.EntryPoint` 之前调用 `GUI.PromptAndWaitPanel(BootLoginPanel.Build())`(阻塞式模态)。
|
||||
|
||||
#### simple.json 增量字段
|
||||
|
||||
@@ -310,18 +310,18 @@ flowchart TB
|
||||
| 场景 | 行为 |
|
||||
|------|------|
|
||||
| Desktop-Only 运行中 | Kestrel 不监听任何端口;MiGu.Server 不 spawn;尝试连接 7001/8080 直接 ECONNREFUSED |
|
||||
| Desktop-Only → Web-Enabled | **必须退出 SimpleLite 重新登录**;不支持热切(避免半启动状态) |
|
||||
| Desktop-Only → Web-Enabled | **必须退出 Simple3 重新登录**;不支持热切(避免半启动状态) |
|
||||
| Web-Enabled 运行中 | CycleGUI 主窗只显示状态窗(运行时长 / 在线用户 / 端口 / 主备状态)+「停止」按钮 |
|
||||
| Web-Enabled 下用户尝试本地控件 | **所有业务面板硬性不渲染**;Workspace 视口也不显示;用户无法通过任何方式重新启用 |
|
||||
| Web-Enabled 异常退出 | Watchdog 重新拉起,恢复到 Web-Enabled;不强迫用户重选 |
|
||||
| 想取消"记住模式" | 启动时按住 `Shift` 或运行 `SimpleLite.exe --re-login` 强制弹出登录窗 |
|
||||
| 想取消"记住模式" | 启动时按住 `Shift` 或运行 `Simple3.exe --re-login` 强制弹出登录窗 |
|
||||
| 远程开关模式 | Platform 管理员可以发 `POST /api/sl/runmode/reset` 把 `rememberRunMode` 置为 `false`,**仅在下次重启时生效** |
|
||||
|
||||
### 3.4 服务状态窗(Web-Enabled 唯一可见的 CycleGUI 面板)
|
||||
|
||||
```text
|
||||
┌──────────────────────────────────────────┐
|
||||
│ SimpleLite Service Status │
|
||||
│ Simple3 Service Status │
|
||||
├──────────────────────────────────────────┤
|
||||
│ 模式: Web-Enabled │
|
||||
│ 启动时间: 2026-05-18 09:00:00 │
|
||||
@@ -348,7 +348,7 @@ flowchart TB
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
A["SimpleLite.exe<br/>启动 + 登录"] --> Mode{运行模式}
|
||||
A["Simple3.exe<br/>启动 + 登录"] --> Mode{运行模式}
|
||||
|
||||
Mode -- Desktop-Only --> D[CycleGUI 全功能 UI]
|
||||
D --> SchedD[调度引擎]
|
||||
@@ -360,7 +360,7 @@ flowchart LR
|
||||
WHost --> WV[WebTerminal :8223<br/>webVRender]
|
||||
WHost --> StatusPanel[CycleGUI 状态窗]
|
||||
|
||||
subgraph SysMis["SimpleLite SystemMission 体系"]
|
||||
subgraph SysMis["Simple3 SystemMission 体系"]
|
||||
E["StartPlatformMission<br/>(SystemMission 子类)"]
|
||||
SM_Reg["SystemMissionRegistry"]
|
||||
SM_Hb["HeartbeatChannel<br/>(named pipe)"]
|
||||
@@ -380,24 +380,24 @@ flowchart LR
|
||||
|
||||
### 4.2 SystemMission 体系(v1.4 新增章节)
|
||||
|
||||
SimpleLite 现有 `Mission` 是业务任务(运送/搬运),新增 **`SystemMission`** 作为同一基类的"系统级 Mission",用于拉起并守护进程级服务。它**不参与调度引擎的 DispatchLoop**,由 Bootstrapper 直接驱动。
|
||||
Simple3 现有 `Mission` 是业务任务(运送/搬运),新增 **`SystemMission`** 作为同一基类的"系统级 Mission",用于拉起并守护进程级服务。它**不参与调度引擎的 DispatchLoop**,由 Bootstrapper 直接驱动。
|
||||
|
||||
**关键类:**
|
||||
|
||||
| 类型 | 类型 / 命名空间 | 职责 |
|
||||
|------|------------------|------|
|
||||
| `SystemMission`(抽象) | `SimpleLite.RCS.SystemMissions` | 继承自现有 `Mission`,新增 `Spawn() / Stop() / Heartbeat()` 等抽象方法 |
|
||||
| `StartPlatformMission` | `SimpleLite.RCS.SystemMissions` | 拉起 `MiGu.Server.exe`;通过命名管道 `\\.\pipe\simple-bootstrap` 接收心跳 |
|
||||
| `SystemMissionRegistry` | `SimpleLite.Bootstrap` | 单例,注册所有 SystemMission;Web-Enabled 启动时遍历 `Spawn()`;进程退出时遍历 `Stop()` |
|
||||
| `ProcessHost` | `SimpleLite.Bootstrap` | 封装 `System.Diagnostics.Process` + 重定向标准输出到日志 + 退出码捕获 |
|
||||
| `HeartbeatChannel` | `SimpleLite.Bootstrap` | 命名管道服务端;JSON 协议 `{ "ts", "rss", "queueDepth", "status" }`;3 个周期未达 → 标记不健康 |
|
||||
| `ProcessWatchdog` | `SimpleLite.Bootstrap` | 不健康时 `Stop() + Spawn()`;指数退避 1s → 2s → 4s → 8s → 30s(上限) |
|
||||
| `RunMode`(枚举) | `SimpleLite.Bootstrap` | `DesktopOnly` / `WebEnabled` |
|
||||
| `SystemMission`(抽象) | `Simple3.RCS.SystemMissions` | 继承自现有 `Mission`,新增 `Spawn() / Stop() / Heartbeat()` 等抽象方法 |
|
||||
| `StartPlatformMission` | `Simple3.RCS.SystemMissions` | 拉起 `MiGu.Server.exe`;通过命名管道 `\\.\pipe\simple-bootstrap` 接收心跳 |
|
||||
| `SystemMissionRegistry` | `Simple3.Bootstrap` | 单例,注册所有 SystemMission;Web-Enabled 启动时遍历 `Spawn()`;进程退出时遍历 `Stop()` |
|
||||
| `ProcessHost` | `Simple3.Bootstrap` | 封装 `System.Diagnostics.Process` + 重定向标准输出到日志 + 退出码捕获 |
|
||||
| `HeartbeatChannel` | `Simple3.Bootstrap` | 命名管道服务端;JSON 协议 `{ "ts", "rss", "queueDepth", "status" }`;3 个周期未达 → 标记不健康 |
|
||||
| `ProcessWatchdog` | `Simple3.Bootstrap` | 不健康时 `Stop() + Spawn()`;指数退避 1s → 2s → 4s → 8s → 30s(上限) |
|
||||
| `RunMode`(枚举) | `Simple3.Bootstrap` | `DesktopOnly` / `WebEnabled` |
|
||||
|
||||
**生命周期:**
|
||||
|
||||
```text
|
||||
SimpleLite 启动 (Web-Enabled)
|
||||
Simple3 启动 (Web-Enabled)
|
||||
├─ Kestrel Up :7001/7002
|
||||
├─ WebTerminal Up :8223
|
||||
├─ SchedulerRuntime.Start()
|
||||
@@ -414,7 +414,7 @@ SimpleLite 启动 (Web-Enabled)
|
||||
Watchdog 触发 → ProcessHost.Kill() → 退避等待 → Spawn() 重试
|
||||
连续 5 次失败 → 状态窗高亮 "Platform Down",停止重试,需人工介入
|
||||
|
||||
SimpleLite 优雅停机:
|
||||
Simple3 优雅停机:
|
||||
SystemMissionRegistry.StopAll()
|
||||
└─ StartPlatformMission.Stop()
|
||||
├─ 发送 SIGTERM 等价(命名管道 "shutdown" 消息)
|
||||
@@ -424,26 +424,26 @@ SimpleLite 优雅停机:
|
||||
|
||||
**实现要点:**
|
||||
|
||||
- **位置**:新建 `SimpleLite/Bootstrap/` 与 `SimpleLite/RCS/SystemMissions/`。
|
||||
- **位置**:新建 `Simple3/Bootstrap/` 与 `Simple3/RCS/SystemMissions/`。
|
||||
- **不写入主库 Missions 表**:SystemMission 是进程级配置,不参与项目序列化;存储在 `simple_main.db.SystemMissionConfig`(或直接读 `simple.json`)。
|
||||
- **崩溃隔离**:Platform 异常不影响 SimpleLite 调度循环;MiGu.Server 也实现 `IHostedService.StopAsync` 做 WAL Checkpoint + WS 排空 → 给 ROSE 释放磁盘。
|
||||
- **多实例预防**:通过命名互斥体 + `simple.json.allowMultiple=false`(已有)确保 SimpleLite 唯一;MiGu.Server 启动时校验"父进程是否为 SimpleLite",否则拒绝启动(防止有人手动双击 `MiGu.Server.exe`)。
|
||||
- **崩溃隔离**:Platform 异常不影响 Simple3 调度循环;MiGu.Server 也实现 `IHostedService.StopAsync` 做 WAL Checkpoint + WS 排空 → 给 ROSE 释放磁盘。
|
||||
- **多实例预防**:通过命名互斥体 + `simple.json.allowMultiple=false`(已有)确保 Simple3 唯一;MiGu.Server 启动时校验"父进程是否为 Simple3",否则拒绝启动(防止有人手动双击 `MiGu.Server.exe`)。
|
||||
- **静态资源**:MiGu.Server 用 `MapWhen + UseStaticFiles + UseSpa` 各挂一份 `index.html`。
|
||||
|
||||
---
|
||||
|
||||
## 5. 三端职责矩阵
|
||||
|
||||
| 维度 | SimpleLite 桌面端 | **Platform 管理端(platform-vue)** | **RCSMonitor 运营端(rcsmonitor-vue)** |
|
||||
| 维度 | Simple3 桌面端 | **Platform 管理端(platform-vue)** | **RCSMonitor 运营端(rcsmonitor-vue)** |
|
||||
|------|---------------------|------------------------------------------|------------------------------------------|
|
||||
| 地图(站点/轨道/区域)编辑 | **读写**(Desktop-Only) | **全功能读写**(Vue 地图控件内嵌SimpleLite地图) | 只读投影,不可编辑 |
|
||||
| 地图(站点/轨道/区域)编辑 | **读写**(Desktop-Only) | **全功能读写**(Vue 地图控件内嵌Simple3地图) | 只读投影,不可编辑 |
|
||||
| 任务编排(Mission/Recipe) | **读写** | **全功能读写**(含 Demand / Recipe) | 基础动作:暂停/取消/重派/优先级 |
|
||||
| 车辆配置(参数 / 维护策略) | **读写** | **全功能读写** | 基础动作:暂停/继续/结束任务/上线/离线/手动充电等 |
|
||||
| CAD 工具 | **可用** | **可用**(Vue 调用 `/api/sl/cad/*`) | 不可用 |
|
||||
| 自定义字段 / 图层 | **可用** | **可用** | 只读 |
|
||||
| 调度引擎(DispatchLoop) | 进程内拥有 | 远程订阅状态 + 全 API 操作 | 远程订阅状态 + 受限 API |
|
||||
| 车端通信 | 拥有 | 不直连,只看投影 | 不直连,只看投影 |
|
||||
| 3D 视口 | 本地 OpenGL(CycleGUI 原生) | **嵌入 SimpleLite webVRender**(全功能交互) | **嵌入 SimpleLite webVRender**(只读 + 圈选) |
|
||||
| 3D 视口 | 本地 OpenGL(CycleGUI 原生) | **嵌入 Simple3 webVRender**(全功能交互) | **嵌入 Simple3 webVRender**(只读 + 圈选) |
|
||||
| 系统级配置 | 局部(Desktop-Only) | **全局编辑 + 下发** | 不可编辑 |
|
||||
| 外部对接(MES/WMS/RCS) | 不涉及 | **唯一入口** | 不涉及 |
|
||||
| 路径规划/交通/充电策略 | 算法 + 调试 | **可视化编辑 + 下发** | 只读 |
|
||||
@@ -549,7 +549,7 @@ Platform 将典型业务场景抽象为标准模板,支持开箱即用和后
|
||||
```mermaid
|
||||
flowchart TB
|
||||
subgraph 顶层["顶层(按端隔离)"]
|
||||
L1A["SimpleLite (CycleGUI + WebAPI Host)"]
|
||||
L1A["Simple3 (CycleGUI + WebAPI Host)"]
|
||||
L1B["MiGu.Server (ASP.NET Core + YARP)"]
|
||||
L1B2["platform-vue (SPA, 管理员)"]
|
||||
L1B3["rcsmonitor-vue (SPA, 运营)"]
|
||||
@@ -608,17 +608,17 @@ flowchart TB
|
||||
| `SimpleShared.Persistence` | net8.0 | EF Core 8 多 Provider 抽象(**SQLite / MySQL / PostgreSQL / SQL Server**)+ 迁移 + `DbProviderOptions` + 连接串构建器 + `WalSqliteOptions`(仅 SQLite) |
|
||||
| `SimpleShared.OpsCommand` | net8.0 | 运维白名单命令、审计、幂等键、频次限流 |
|
||||
| `SimpleShared.WebApiHost` | net8.0 | Kestrel 公共启动器:JWT 中间件 / Swagger / CORS / 健康检查 / 请求审计 |
|
||||
| `MiGu.Server` | net8.0 ASP.NET Core | 业务 BFF + **YARP 反代 SimpleLite** + 静态托管两份 Vue dist;**启动时校验父进程为 SimpleLite,否则拒绝运行**(防误用) |
|
||||
| `platform-vue` | Vue 3 + Vite + Pinia | 全功能套壳:复刻 SimpleLite 所有控件 |
|
||||
| `MiGu.Server` | net8.0 ASP.NET Core | 业务 BFF + **YARP 反代 Simple3** + 静态托管两份 Vue dist;**启动时校验父进程为 Simple3,否则拒绝运行**(防误用) |
|
||||
| `platform-vue` | Vue 3 + Vite + Pinia | 全功能套壳:复刻 Simple3 所有控件 |
|
||||
| `rcsmonitor-vue` | Vue 3 + Vite + Pinia | 运营监控:按权限渲染,运维动作面板 |
|
||||
| `packages/sl-controls`(pnpm workspace) | Vue 3 组件库 | Workspace3D(嵌 webVRender)/ 地图列表 / 任务表 / CAD 工具栏等共享组件 |
|
||||
|
||||
### 6.1 Platform Vue 控件复刻清单(与 SimpleLite CycleGUI 对照)
|
||||
### 6.1 Platform Vue 控件复刻清单(与 Simple3 CycleGUI 对照)
|
||||
|
||||
| SimpleLite CycleGUI 面板 | Vue 组件(位于 `sl-controls`) | 备注 |
|
||||
| Simple3 CycleGUI 面板 | Vue 组件(位于 `sl-controls`) | 备注 |
|
||||
|--------------------------|--------------------------------|------|
|
||||
| 主菜单栏 / 工具栏 | `<AppShell>` 顶栏 + 侧栏 | platform-vue 全功能;rcsmonitor-vue 仅显示运营菜单 |
|
||||
| Workspace 3D 视口 | `<Workspace3D>` | **iframe / Web Component 嵌入 SimpleLite webVRender**;交互事件用 `postMessage` 桥接 |
|
||||
| Workspace 3D 视口 | `<Workspace3D>` | **iframe / Web Component 嵌入 Simple3 webVRender**;交互事件用 `postMessage` 桥接 |
|
||||
| 地图面板(Sites / Tracks) | `<MapEditor>` + `<TrackTable>` | 表格 + 拓扑视图 |
|
||||
| Car 面板 | `<CarPanel>` | 表格 + 表单 |
|
||||
| Mission 面板 | `<MissionEditor>` | 任务流图 + 表单 |
|
||||
@@ -674,7 +674,7 @@ function onReady() {
|
||||
</script>
|
||||
```
|
||||
|
||||
`SimpleLite/Rendering/SimpleSceneRenderer.cs` 端按 `scope` 和 `ro` 控制:
|
||||
`Simple3/Rendering/SimpleSceneRenderer.cs` 端按 `scope` 和 `ro` 控制:
|
||||
- `scope=RCSMonitor` 或 `ro=1` → 禁用编辑工具(不响应 `SelectObject`/`GetPosition` 中的拖动)
|
||||
- 通过 `postMessage` 向 iframe 父页面回传选择/点击事件
|
||||
|
||||
@@ -690,7 +690,7 @@ builder.Services.AddReverseProxy()
|
||||
.LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"))
|
||||
.AddTransforms(ctx =>
|
||||
{
|
||||
// 透传当前 JWT 的 userId / scope 给 SimpleLite
|
||||
// 透传当前 JWT 的 userId / scope 给 Simple3
|
||||
ctx.AddRequestTransform(async tc =>
|
||||
{
|
||||
var ident = tc.HttpContext.User;
|
||||
@@ -767,7 +767,7 @@ app.Run();
|
||||
|
||||
```mermaid
|
||||
flowchart TB
|
||||
subgraph App["应用代码 (SimpleLite / MiGu.Server)"]
|
||||
subgraph App["应用代码 (Simple3 / MiGu.Server)"]
|
||||
DOM["领域服务 / Repository"]
|
||||
EFC["EF Core 8 DbContext"]
|
||||
OPT["DbProviderOptions<br/>{ provider, conn, ha }"]
|
||||
@@ -813,7 +813,7 @@ flowchart TB
|
||||
|
||||
| 逻辑库 | 拥有进程 | 主要表/数据 |
|
||||
|--------|----------|-------------|
|
||||
| **simple_main** | SimpleLite | Maps, Sites, Tracks, SpecialProps, Missions, Cars, Plugins, DesignAuditLog, OpsAuditLog, LocalUsers, RunModeHistory |
|
||||
| **simple_main** | Simple3 | Maps, Sites, Tracks, SpecialProps, Missions, Cars, Plugins, DesignAuditLog, OpsAuditLog, LocalUsers, RunModeHistory |
|
||||
| **platform** | Platform | Users, Roles, RolePermissions, WidgetGrants, SystemConfig, ExternalAdapters, RoutingPolicies, VehicleMaintenancePolicies, ChargePolicies, TaskAllocationPolicies, TrafficRules, Locations, Inventory, OpsLogs(含 RCSMonitor 来源), Annotations, Snapshots, Versions, CustomWidgets |
|
||||
|
||||
> 原 v1.2 中的 `rcsmonitor_local` 取消;其表(OpsLogs / Annotations / Snapshots / WidgetLayoutCache)合并到 `platform`,加 `source='RCSMonitor'` 字段区分。
|
||||
@@ -824,12 +824,12 @@ flowchart TB
|
||||
```mermaid
|
||||
flowchart TB
|
||||
subgraph A["主节点 NODE-A (Active)"]
|
||||
SL_A["SimpleLite.exe"]
|
||||
SL_A["Simple3.exe"]
|
||||
PL_A["MiGu.Server.exe"]
|
||||
D_A[("受 ROSE 保护盘 R:\<br/>simple_main.db<br/>platform.db<br/>(WAL)")]
|
||||
end
|
||||
subgraph B["备节点 NODE-B (Standby)"]
|
||||
SL_B["SimpleLite.exe (suspended)"]
|
||||
SL_B["Simple3.exe (suspended)"]
|
||||
PL_B["MiGu.Server.exe (suspended)"]
|
||||
D_B[("ROSE 镜像盘 R:\")]
|
||||
end
|
||||
@@ -860,7 +860,7 @@ flowchart TB
|
||||
|------|------|------|
|
||||
| `RES_DISK_R` | Mirror Disk | — |
|
||||
| `RES_VIP_LAN` | Virtual IP | RES_DISK_R |
|
||||
| `RES_SVC_SL` | Service: SimpleLite (Web-Enabled) | RES_DISK_R, RES_VIP_LAN |
|
||||
| `RES_SVC_SL` | Service: Simple3 (Web-Enabled) | RES_DISK_R, RES_VIP_LAN |
|
||||
| `RES_SVC_PL` | Service: MiGu.Server | RES_DISK_R, RES_VIP_LAN, RES_SVC_SL |
|
||||
| `RES_SCRIPT_CHK` | 数据库健康检查脚本 | RES_DISK_R |
|
||||
|
||||
@@ -871,7 +871,7 @@ flowchart TB
|
||||
```mermaid
|
||||
flowchart TB
|
||||
subgraph App["应用层 (VIP + 重试)"]
|
||||
SL["SimpleLite.exe"]
|
||||
SL["Simple3.exe"]
|
||||
PL["MiGu.Server.exe"]
|
||||
end
|
||||
subgraph Router["MySQL Router (或 ProxySQL)"]
|
||||
@@ -911,7 +911,7 @@ flowchart TB
|
||||
```mermaid
|
||||
flowchart TB
|
||||
subgraph App["应用层"]
|
||||
SL["SimpleLite.exe"]
|
||||
SL["Simple3.exe"]
|
||||
PL["MiGu.Server.exe"]
|
||||
end
|
||||
subgraph LB["HAProxy / PgBouncer"]
|
||||
@@ -953,7 +953,7 @@ flowchart TB
|
||||
```mermaid
|
||||
flowchart TB
|
||||
subgraph App["应用层"]
|
||||
SL["SimpleLite.exe"]
|
||||
SL["Simple3.exe"]
|
||||
PL["MiGu.Server.exe"]
|
||||
end
|
||||
subgraph Listener["AG Listener (DNS + VIP)"]
|
||||
@@ -983,7 +983,7 @@ flowchart TB
|
||||
- **EF Core Provider**:`Microsoft.EntityFrameworkCore.SqlServer`;支持 SQL Server 2019+(建议 Enterprise 版以启用同步提交副本数 ≥3 + Read-Only Routing)。Standard 版可降级为 2 副本基本可用性组。
|
||||
- **HA 形态**:**WSFC(Windows Server Failover Cluster)+ Always On Availability Groups**;通过 **AG Listener** 暴露统一虚拟名/VIP,客户端连 Listener 名即可。
|
||||
- **同步策略**:核心库(`platform` / `simple_main`)配 1 个同步提交副本(RPO=0),1–N 个异步副本(可读分析)。
|
||||
- **认证**:建议混合身份认证;MiGu.Server 用 SQL Login,SimpleLite 桌面端可走 Windows 集成认证。
|
||||
- **认证**:建议混合身份认证;MiGu.Server 用 SQL Login,Simple3 桌面端可走 Windows 集成认证。
|
||||
- **TempDB**:每节点分摊;MultipleActiveResultSets(MARS)建议关闭,EF Core 已能避免。
|
||||
- **备份**:`BACKUP DATABASE ... WITH COMPRESSION` + 事务日志备份每 15min;保留策略与公司 IT 一致。
|
||||
- **RTO / RPO**:RTO ≈ 10–30s(AG 自动 failover);RPO ≈ 0(同步提交副本)。
|
||||
@@ -1091,7 +1091,7 @@ flowchart TB
|
||||
"database": "simple_main",
|
||||
"user": "simple_app",
|
||||
"password": "${SECRET_MSSQL_PWD}",
|
||||
"extra": "Encrypt=True;TrustServerCertificate=False;MultiSubnetFailover=True;Application Name=SimpleLite"
|
||||
"extra": "Encrypt=True;TrustServerCertificate=False;MultiSubnetFailover=True;Application Name=Simple3"
|
||||
},
|
||||
"platform": {
|
||||
"server": "tcp:rcs-ag.lan,1433",
|
||||
@@ -1158,7 +1158,7 @@ classDiagram
|
||||
|
||||
**落地四件套:**
|
||||
|
||||
1. **认证**:`SimpleShared.Auth` 提供 `JwtIssuer`;Web-Enabled 时 MiGu.Server 签发;Desktop-Only 时 SimpleLite 本地签发短期 Token(24h)。
|
||||
1. **认证**:`SimpleShared.Auth` 提供 `JwtIssuer`;Web-Enabled 时 MiGu.Server 签发;Desktop-Only 时 Simple3 本地签发短期 Token(24h)。
|
||||
2. **授权**:所有 WebAPI + WS 调用走 `IPermissionEvaluator`;权限码 `<area>.<action>`。
|
||||
3. **范围(Scope)**:`Lite` / `Platform` / `RCSMonitor` / `*`;同一用户在不同端可用集合不同。Vue 端登录时由前端代码根据访问路径自动带入 `scope`(`/admin/*` → `Platform`,`/monitor/*` → `RCSMonitor`)。
|
||||
4. **控件级权限**:除 `Permission` 外,角色还可关联 `WidgetGrant`,每个 `WidgetId` 三档可见性:
|
||||
@@ -1173,7 +1173,7 @@ sequenceDiagram
|
||||
participant U as 运营用户
|
||||
participant RV as rcsmonitor-vue
|
||||
participant P as MiGu.Server
|
||||
participant L as SimpleLite (YARP 后侧)
|
||||
participant L as Simple3 (YARP 后侧)
|
||||
participant DBp as platform.db
|
||||
|
||||
U->>RV: 访问 https://host:8080/monitor
|
||||
@@ -1255,7 +1255,7 @@ flowchart LR
|
||||
UI11 --> Sch
|
||||
Sch --> Val --> Ver --> Pub
|
||||
|
||||
Pub -- "REST PUT /api/sl/config/{section} (via YARP)" --> SL["SimpleLite (主服务)"]
|
||||
Pub -- "REST PUT /api/sl/config/{section} (via YARP)" --> SL["Simple3 (主服务)"]
|
||||
Pub -- "WS broadcast: config.updated" --> RMVue["rcsmonitor-vue"]
|
||||
Pub -- "WS broadcast: config.updated" --> AdminVue["其他在线 platform-vue"]
|
||||
```
|
||||
@@ -1316,7 +1316,7 @@ public record EffectivePermissions(
|
||||
List<WidgetGrantDto> VisibleWidgets);
|
||||
```
|
||||
|
||||
**发布机制:** Schema → 校验 → 版本 → 灰度 → 全量;MiGu.Server 通过 YARP `PUT /api/sl/config/{section}` 推到 SimpleLite,主服务原子切换 + ack;失败自动回滚,WS `config.rollback` 广播。
|
||||
**发布机制:** Schema → 校验 → 版本 → 灰度 → 全量;MiGu.Server 通过 YARP `PUT /api/sl/config/{section}` 推到 Simple3,主服务原子切换 + ack;失败自动回滚,WS `config.rollback` 广播。
|
||||
|
||||
---
|
||||
|
||||
@@ -1327,14 +1327,14 @@ public record EffectivePermissions(
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant U as 用户
|
||||
participant L as SimpleLite (CycleGUI)
|
||||
participant L as Simple3 (CycleGUI)
|
||||
participant BL as BootLoginPanel
|
||||
participant K as Kestrel (WebAPI)
|
||||
participant P as MiGu.Server (YARP)
|
||||
participant V as platform-vue
|
||||
participant RV as rcsmonitor-vue
|
||||
|
||||
U->>L: 启动 SimpleLite.exe
|
||||
U->>L: 启动 Simple3.exe
|
||||
L->>L: 读取 simple.json
|
||||
alt rememberRunMode = true
|
||||
L->>L: 直接采用 runMode (仍鉴权)
|
||||
@@ -1373,10 +1373,10 @@ sequenceDiagram
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant U as 用户
|
||||
participant L as SimpleLite
|
||||
participant L as Simple3
|
||||
participant BL as BootLoginPanel
|
||||
|
||||
U->>L: 启动 SimpleLite.exe
|
||||
U->>L: 启动 Simple3.exe
|
||||
L->>L: 读 simple.json (无记忆 或 选项=DesktopOnly)
|
||||
L->>BL: 必要时弹出登录窗
|
||||
U->>BL: 输入凭据 + 选 Desktop-Only
|
||||
@@ -1387,13 +1387,13 @@ sequenceDiagram
|
||||
L-->>U: 进入设计端主界面
|
||||
```
|
||||
|
||||
### 10.3 platform-vue 编辑地图站点 → SimpleLite 落库
|
||||
### 10.3 platform-vue 编辑地图站点 → Simple3 落库
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant V as platform-vue
|
||||
participant P as MiGu.Server (YARP)
|
||||
participant L as SimpleLite (WebAPI)
|
||||
participant L as Simple3 (WebAPI)
|
||||
participant DBl as simple_main.db
|
||||
participant RV as rcsmonitor-vue (订阅)
|
||||
|
||||
@@ -1406,7 +1406,7 @@ sequenceDiagram
|
||||
P-->>V: 201 + siteId
|
||||
L->>L: WS broadcast { type: "map.site.created", payload }
|
||||
L-->>P: WS event
|
||||
P-->>V: WS event (前端 Workspace3D iframe 收到 SimpleLite 推送的 PutModelObject 同步)
|
||||
P-->>V: WS event (前端 Workspace3D iframe 收到 Simple3 推送的 PutModelObject 同步)
|
||||
P-->>RV: WS event (RCSMonitor 接收并按权限展示)
|
||||
```
|
||||
|
||||
@@ -1416,7 +1416,7 @@ sequenceDiagram
|
||||
sequenceDiagram
|
||||
participant V as platform-vue
|
||||
participant P as Platform
|
||||
participant L as SimpleLite
|
||||
participant L as Simple3
|
||||
participant E as DispatchLoop
|
||||
participant RV as rcsmonitor-vue
|
||||
|
||||
@@ -1440,7 +1440,7 @@ sequenceDiagram
|
||||
participant U as 运营人员
|
||||
participant RV as rcsmonitor-vue
|
||||
participant P as MiGu.Server (YARP)
|
||||
participant L as SimpleLite (Ops 网关)
|
||||
participant L as Simple3 (Ops 网关)
|
||||
participant E as DispatchLoop
|
||||
participant DBp as platform.db
|
||||
participant DBl as simple_main.db
|
||||
@@ -1476,10 +1476,10 @@ sequenceDiagram
|
||||
VIP->>NA: 路由到 Active
|
||||
Note over NA: 节点故障
|
||||
ROSE->>NA: 心跳超时 → 触发切换
|
||||
ROSE->>NA: 强制停止 SimpleLite / Platform
|
||||
ROSE->>NA: 强制停止 Simple3 / Platform
|
||||
ROSE->>NA: 卸载 R: 卷
|
||||
ROSE->>NB: 挂载 R: 卷
|
||||
ROSE->>NB: 启动 SimpleLite (WAL 重放 + 主库自检)
|
||||
ROSE->>NB: 启动 Simple3 (WAL 重放 + 主库自检)
|
||||
ROSE->>NB: 启动 MiGu.Server
|
||||
ROSE->>VIP: 浮动 IP 漂移到 NODE-B
|
||||
CLI--xVIP: 短暂中断
|
||||
@@ -1495,12 +1495,12 @@ sequenceDiagram
|
||||
|
||||
| 通道 | 协议 | 编码 | 端点 | 用途 |
|
||||
|------|------|------|------|------|
|
||||
| MiGu.Server (YARP) ↔ SimpleLite | REST / WebSocket | JSON | `:7001` / `:7002` | 全功能 API 反代 + 事件订阅 |
|
||||
| MiGu.Server (YARP) ↔ Simple3 | REST / WebSocket | JSON | `:7001` / `:7002` | 全功能 API 反代 + 事件订阅 |
|
||||
| platform-vue ↔ MiGu.Server | REST / WebSocket | JSON | `:8080` / `:8081` (路径前缀 `/admin`) | UI 操作、事件推送 |
|
||||
| rcsmonitor-vue ↔ MiGu.Server | REST / WebSocket | JSON | `:8080` / `:8081` (路径前缀 `/monitor`,`scope=RCSMonitor`) | UI 操作、事件推送(受限) |
|
||||
| Vue Workspace3D ↔ SimpleLite WebTerminal | WSS(webVRender 协议) | webVRender 自有 | `:8223` | 3D 视口同步(嵌入 iframe) |
|
||||
| Vue Workspace3D ↔ Simple3 WebTerminal | WSS(webVRender 协议) | webVRender 自有 | `:8223` | 3D 视口同步(嵌入 iframe) |
|
||||
| 子进程心跳 | Named Pipe | JSON | `\\.\pipe\simple-bootstrap` | 守护 / 重启 |
|
||||
| Vehicle ↔ SimpleLite | TCP / WS / OPC-UA | 业务私有 | `:8222` | 车端协议 |
|
||||
| Vehicle ↔ Simple3 | TCP / WS / OPC-UA | 业务私有 | `:8222` | 车端协议 |
|
||||
| ROSE 心跳 | 专用网卡 + 串口 | ROSE 私有 | — | 节点健康监测 |
|
||||
| ROSE 镜像复制 | 专用网卡 | ROSE 私有 | — | 块级实时数据同步 |
|
||||
|
||||
@@ -1510,7 +1510,7 @@ sequenceDiagram
|
||||
- 鉴权:`Authorization: Bearer <JWT>`;服务间互调附 `X-Svc-Token` + `X-On-Behalf-Of: <userId>` + `X-Scope: <scope>`
|
||||
- 幂等:写操作支持 `Idempotency-Key` 请求头
|
||||
- 版本化:配置类资源使用 `ETag` / `If-Match` 做乐观锁
|
||||
- Swagger:Platform / SimpleLite 都暴露 `/swagger`(生产可关)
|
||||
- Swagger:Platform / Simple3 都暴露 `/swagger`(生产可关)
|
||||
- **YARP Scope 白名单**:`scope=RCSMonitor` 时仅允许 `/api/sl/ops/*` 与 `/api/sl/projection/*` 命中;其他路径直接 403
|
||||
|
||||
---
|
||||
@@ -1521,12 +1521,12 @@ sequenceDiagram
|
||||
flowchart TB
|
||||
subgraph Cluster["双机 ROSE HA 集群 (Web-Enabled)"]
|
||||
subgraph NA["NODE-A (Active)"]
|
||||
SL_A["SimpleLite.exe<br/>Kestrel :7001/7002<br/>WebTerminal :8223"]
|
||||
SL_A["Simple3.exe<br/>Kestrel :7001/7002<br/>WebTerminal :8223"]
|
||||
PL_A["MiGu.Server.exe<br/>:8080/8081<br/>(YARP + 双 Vue dist)"]
|
||||
R_A["ROSE 受保护盘 R:\<br/>两库 (WAL)"]
|
||||
end
|
||||
subgraph NB["NODE-B (Standby)"]
|
||||
SL_B["SimpleLite.exe (suspended)"]
|
||||
SL_B["Simple3.exe (suspended)"]
|
||||
PL_B["MiGu.Server.exe (suspended)"]
|
||||
R_B["ROSE 镜像盘 R:\<br/>(实时同步)"]
|
||||
end
|
||||
@@ -1556,12 +1556,12 @@ flowchart TB
|
||||
|
||||
| 端口 | 服务 | 启用条件 |
|
||||
|------|------|----------|
|
||||
| 7001 | SimpleLite WebAPI | Web-Enabled |
|
||||
| 7002 | SimpleLite WebSocket | Web-Enabled |
|
||||
| 7001 | Simple3 WebAPI | Web-Enabled |
|
||||
| 7002 | Simple3 WebSocket | Web-Enabled |
|
||||
| 8080 | Platform WebAPI + platform-vue 静态(/admin)+ rcsmonitor-vue 静态(/monitor) | Web-Enabled |
|
||||
| 8081 | Platform WebSocket | Web-Enabled |
|
||||
| 8222 | SimpleLite 车端 / API(现有) | 所有模式 |
|
||||
| 8223 | SimpleLite WebTerminal(webVRender,Vue 嵌入用) | Web-Enabled |
|
||||
| 8222 | Simple3 车端 / API(现有) | 所有模式 |
|
||||
| 8223 | Simple3 WebTerminal(webVRender,Vue 嵌入用) | Web-Enabled |
|
||||
|
||||
> Desktop-Only 模式下:7001 / 7002 / 8080 / 8081 / 8223 全部**不监听**。
|
||||
|
||||
@@ -1588,7 +1588,7 @@ flowchart LR
|
||||
SHH["SimpleShared.WebApiHost"]
|
||||
end
|
||||
subgraph apps["两端后端"]
|
||||
SL["SimpleLite (CycleGUI + WebAPI)"]
|
||||
SL["Simple3 (CycleGUI + WebAPI)"]
|
||||
PSrv["MiGu.Server (WebAPI + YARP)"]
|
||||
end
|
||||
subgraph frontends["前端 (pnpm workspace)"]
|
||||
@@ -1709,7 +1709,7 @@ pnpm --filter rcsmonitor-vue build # 产出 apps/rcsmonitor-vue/dist
|
||||
|--------|----------|----------|
|
||||
| **M0 - 内核下沉** | 1 周 | 新建 SimpleShared.* 6 个工程;Configuration → IConfigSnapshotProvider;EF Core + SQLite + 迁移 |
|
||||
| **M1 - 启动登录 + 运行模式** | 1 周 | `BootLoginPanel`;`RunMode` 枚举;CycleGUI 状态窗;`simple.json.runMode` 持久化;Web-Enabled 业务面板硬隐藏 |
|
||||
| **M2 - WebAPI 协议层** | 1.5 周 | SimpleLite 集成 Kestrel;定义 `/api/projection/*`、`/api/ops/*`、`/api/config/*`、`/api/map/*` 等;WS Hub;JWT |
|
||||
| **M2 - WebAPI 协议层** | 1.5 周 | Simple3 集成 Kestrel;定义 `/api/projection/*`、`/api/ops/*`、`/api/config/*`、`/api/map/*` 等;WS Hub;JWT |
|
||||
| **M3 - 共享前端组件库** | 1.5 周 | `frontends/packages/sl-controls`:Workspace3D(嵌入 webVRender)+ 地图列表 + 任务表 + CAD 工具栏 + OpsActionPanel 等 |
|
||||
| **M4 - Platform 后端 + YARP** | 2 周 | MiGu.Server(WebAPI + Swagger + YARP `/api/sl/*` + Scope 中间件 + 静态托管双 Vue dist)+ 配置中心 11 个 schema + 用户/角色/控件权限 |
|
||||
| **M5 - platform-vue (管理员)** | 2.5 周 | 全功能套壳:登录、地图设计、车辆/任务、CAD、字段/图层、配置中心、库位、自定义控件、回放、设备管理、车队生命周期、场景模板 |
|
||||
@@ -1726,14 +1726,14 @@ pnpm --filter rcsmonitor-vue build # 产出 apps/rcsmonitor-vue/dist
|
||||
|---|------|------|
|
||||
| 1 | 运行模式持久化 | **写入 `simple.json.runMode` / `rememberRunMode`**(不使用 %APPDATA%) |
|
||||
| 2 | Web-Enabled 下是否允许同时本地操作 | **不允许**;CycleGUI 仅状态窗;不提供"临时启用本地 UI"开关 |
|
||||
| 3 | 3D 引擎 | **复用 SimpleLite WebTerminal 的 webVRender**,Vue 通过 iframe / Web Component 嵌入 |
|
||||
| 3 | 3D 引擎 | **复用 Simple3 WebTerminal 的 webVRender**,Vue 通过 iframe / Web Component 嵌入 |
|
||||
| 4 | 反向代理 | **YARP**(MiGu.Server 用 YARP 反代 `/api/sl/*`) |
|
||||
| 5 | RCSMonitor 是否需要独立后端 | **否**,完全依赖 MiGu.Server;通过 `scope=RCSMonitor` + 角色 + WidgetGrant 限权 |
|
||||
| 6 | 共享前端组件库 | **pnpm workspace + `frontends/packages/sl-controls`** |
|
||||
| 7 | 运营白名单 | 采纳 §5.1 列表(10 条,后续可扩) |
|
||||
| 8 | ROSE 复制粒度 | 块级镜像盘(RPO≈0)首选;视现场版本兜底文件级 |
|
||||
| 9 | 车端连接策略 | 走 VIP,统一切换;车端实现 WS 自动重连 |
|
||||
| 10 | **Platform / RCSMonitor 启动归属(v1.4)** | **由 SimpleLite 内置 `SystemMission.StartPlatformMission` 拉起并守护**;不允许独立安装 MiGu.Server.exe 为 Windows Service;MiGu.Server 启动时校验父进程必须是 SimpleLite |
|
||||
| 10 | **Platform / RCSMonitor 启动归属(v1.4)** | **由 Simple3 内置 `SystemMission.StartPlatformMission` 拉起并守护**;不允许独立安装 MiGu.Server.exe 为 Windows Service;MiGu.Server 启动时校验父进程必须是 Simple3 |
|
||||
| 11 | **持久层多 Provider(v1.5)** | EF Core 抽象,**默认 SQLite + ROSE HA**;可选 **MySQL InnoDB Cluster / PostgreSQL Patroni / SQL Server Always On AG**;每 Provider 一套 EF Migrations,CI 全矩阵跑通;运行期由 `simple.json.database.provider` 决定 |
|
||||
| 12 | **跨 Provider 切换策略** | 不支持热切;切换走停服窗口 + `tools/db/migrate.ps1`;旧文件作为回退包保留 |
|
||||
|
||||
@@ -1743,22 +1743,22 @@ pnpm --filter rcsmonitor-vue build # 产出 apps/rcsmonitor-vue/dist
|
||||
|
||||
| 现有文件 | 改动方向 |
|
||||
|----------|----------|
|
||||
| `SimpleLite/Program.cs` | 在 `Enssentials.Load` 之后插入 `BootLoginPanel.RunModal()`;根据返回的 `RunMode` 决定后续路径 |
|
||||
| `SimpleLite/Configuration.cs` | 拆为 `LocalBootConfig`(启动期,含 `runMode`、`rememberRunMode`、监听地址、各端口)+ `IConfigSnapshotProvider`(运行期);数据库路径走 `%SIMPLE_DATA_ROOT%` |
|
||||
| `SimpleLite/Startup.cs` | 按 `RunMode` 分支:Desktop-Only 走原有 CycleGUI;Web-Enabled 启动 Kestrel + WebAPI + WebTerminal + Spawn Platform + 切换 CycleGUI 到状态窗 |
|
||||
| `SimpleLite/UI/SimpleUI.cs` | 增加 `RunMode.WebEnabled` 时**所有业务面板硬性不创建**;新增"服务状态窗"面板(唯一允许) |
|
||||
| `SimpleLite/UI/BootLoginPanel.cs`(新增) | 启动登录窗实现 + 模式持久化 |
|
||||
| `SimpleLite/UI/ServiceStatusPanel.cs`(新增) | Web-Enabled 状态窗实现 |
|
||||
| `SimpleLite/RCS/Mission.cs` | 抽出 `SystemMission` 抽象基类(与业务 Mission 同一基类但走独立 Registry,**不进入 DispatchLoop**) |
|
||||
| `SimpleLite/RCS/SystemMissions/StartPlatformMission.cs`(新增) | 拉起 `MiGu.Server.exe`、绑定命名管道、上报心跳与状态到 ServiceStatusPanel |
|
||||
| `SimpleLite/Bootstrap/ProcessHost.cs`(新增) | 封装 `System.Diagnostics.Process` + 日志重定向 + 优雅停止 |
|
||||
| `SimpleLite/Bootstrap/HeartbeatChannel.cs`(新增) | 命名管道服务端 + JSON 心跳协议 |
|
||||
| `SimpleLite/Bootstrap/SystemMissionRegistry.cs`(新增) | 注册/批量 Spawn/Stop SystemMission |
|
||||
| `SimpleLite/Bootstrap/ProcessWatchdog.cs`(新增) | 指数退避重启 + 多次失败后熔断并通知状态窗 |
|
||||
| `SimpleLite/Bootstrap/RunMode.cs`(新增) | `DesktopOnly` / `WebEnabled` 枚举 + 启动期校验 |
|
||||
| `SimpleLite/Rendering/SimpleSceneRenderer.cs` | 按 webVRender 的 `?scope=` / `?ro=` 参数禁用编辑工具 |
|
||||
| `Simple3/Program.cs` | 在 `Enssentials.Load` 之后插入 `BootLoginPanel.RunModal()`;根据返回的 `RunMode` 决定后续路径 |
|
||||
| `Simple3/Configuration.cs` | 拆为 `LocalBootConfig`(启动期,含 `runMode`、`rememberRunMode`、监听地址、各端口)+ `IConfigSnapshotProvider`(运行期);数据库路径走 `%SIMPLE_DATA_ROOT%` |
|
||||
| `Simple3/Startup.cs` | 按 `RunMode` 分支:Desktop-Only 走原有 CycleGUI;Web-Enabled 启动 Kestrel + WebAPI + WebTerminal + Spawn Platform + 切换 CycleGUI 到状态窗 |
|
||||
| `Simple3/UI/SimpleUI.cs` | 增加 `RunMode.WebEnabled` 时**所有业务面板硬性不创建**;新增"服务状态窗"面板(唯一允许) |
|
||||
| `Simple3/UI/BootLoginPanel.cs`(新增) | 启动登录窗实现 + 模式持久化 |
|
||||
| `Simple3/UI/ServiceStatusPanel.cs`(新增) | Web-Enabled 状态窗实现 |
|
||||
| `Simple3/RCS/Mission.cs` | 抽出 `SystemMission` 抽象基类(与业务 Mission 同一基类但走独立 Registry,**不进入 DispatchLoop**) |
|
||||
| `Simple3/RCS/SystemMissions/StartPlatformMission.cs`(新增) | 拉起 `MiGu.Server.exe`、绑定命名管道、上报心跳与状态到 ServiceStatusPanel |
|
||||
| `Simple3/Bootstrap/ProcessHost.cs`(新增) | 封装 `System.Diagnostics.Process` + 日志重定向 + 优雅停止 |
|
||||
| `Simple3/Bootstrap/HeartbeatChannel.cs`(新增) | 命名管道服务端 + JSON 心跳协议 |
|
||||
| `Simple3/Bootstrap/SystemMissionRegistry.cs`(新增) | 注册/批量 Spawn/Stop SystemMission |
|
||||
| `Simple3/Bootstrap/ProcessWatchdog.cs`(新增) | 指数退避重启 + 多次失败后熔断并通知状态窗 |
|
||||
| `Simple3/Bootstrap/RunMode.cs`(新增) | `DesktopOnly` / `WebEnabled` 枚举 + 启动期校验 |
|
||||
| `Simple3/Rendering/SimpleSceneRenderer.cs` | 按 webVRender 的 `?scope=` / `?ro=` 参数禁用编辑工具 |
|
||||
| `SimpleScheduler/WebApi.cs` | 调用方从 Nancy 切到 ASP.NET Core Controller;保持 `SchedulerRuntime` 外观稳定 |
|
||||
| `SimpleLite/SimpleProject.cs` | 持久化双写:JSON(兼容)+ SQLite(新主存,受 ROSE 保护盘) |
|
||||
| `Simple3/SimpleProject.cs` | 持久化双写:JSON(兼容)+ SQLite(新主存,受 ROSE 保护盘) |
|
||||
| `Plugins/Sample` | 示例插件读取 `IConfigSnapshotProvider`;不再读 `Configuration.conf` |
|
||||
| 新增 `tools/ha/*` | ROSE 资源启停脚本、健康检查脚本、切换演练脚本 |
|
||||
| 新增 `tools/db/*` | 跨 Provider 迁移脚本(`migrate.ps1` / `dump.ps1` / `restore.ps1`);按目标 DB 校验 schema 与索引 |
|
||||
@@ -1909,12 +1909,12 @@ pnpm --filter rcsmonitor-vue build # 产出 apps/rcsmonitor-vue/dist
|
||||
|---|-----|------|------|
|
||||
| B1 | Kestrel + Swagger + CORS | ✅ | `Program.cs` |
|
||||
| B2 | Auth / Health / Config / Ops / Projection 控制器 | ✅ 骨架 | Mock/内存存储 |
|
||||
| B3 | YARP `/api/sl/*` → :8222 | ✅ 配置 | 依赖 SimpleLite 实际监听 |
|
||||
| B3 | YARP `/api/sl/*` → :8222 | ✅ 配置 | 依赖 Simple3 实际监听 |
|
||||
| B4 | 静态托管 + SPA fallback | ✅ | 单一 `wwwroot/index.html` |
|
||||
| B5 | JWT 真签发 + 库持久化 | ☐ | 仍为 Mock |
|
||||
| B6 | 父进程 SimpleLite 校验 | ☐ | §4、§15 #10 |
|
||||
| B6 | 父进程 Simple3 校验 | ☐ | §4、§15 #10 |
|
||||
|
||||
### 18.3 SimpleLite / 共享内核(ARCHITECTURE 主体)
|
||||
### 18.3 Simple3 / 共享内核(ARCHITECTURE 主体)
|
||||
|
||||
| # | 项 | 状态 | 备注 |
|
||||
|---|-----|------|------|
|
||||
@@ -1942,5 +1942,5 @@ pnpm --filter rcsmonitor-vue build # 产出 apps/rcsmonitor-vue/dist
|
||||
|
||||
## 关联文档
|
||||
|
||||
- [SIMPLELITE_DEVELOPMENT_PLAN.md](./SIMPLELITE_DEVELOPMENT_PLAN.md) — SimpleLite 功能对齐执行计划
|
||||
- [SIMPLELITE_DEVELOPMENT_PLAN.md](./SIMPLELITE_DEVELOPMENT_PLAN.md) — Simple3 功能对齐执行计划
|
||||
- [SIMPLELITE_COMPOSER_PARITY_PLAN.md](./SIMPLELITE_COMPOSER_PARITY_PLAN.md) — 与 SimpleComposer 差距分析
|
||||
|
||||
Reference in New Issue
Block a user