sequenceDiagram
participant Cloud as 云端MQTT仿真
participant TBox as T-Box
participant CAN as CAN总线
participant Body as 车身执行器
Cloud->>TBox: MQTT指令(T0)
TBox->>TBox: 4G模组接收(UART)
TBox->>TBox: 协议转换(MQTT→CAN)
TBox->>CAN: CAN报文(T3)
CAN->>Body: 解析并输出PWM
Body-->>Cloud: GPIO/PWM变化(T4)
Note over Cloud: 端到端延迟≤90ms
sequenceDiagram
participant Tester as 天工测试平台
participant TBox as T-Box
participant CAN as CAN总线
Tester->>TBox: MQTT: {"cmd":"ac_ctrl","temp":24,"fan_speed":3}
TBox->>TBox: 协议转换
TBox->>CAN: CAN ID 0x18FF60xx, Byte2=24, Byte3=3
Tester->>CAN: 捕获并比对
Note over Tester: 映射匹配率100%
场景3:弱网与断网重传测试
模拟4G信号弱、网络抖动、断网等场景,验证T-Box的缓存、重试和状态上报机制。
sequenceDiagram
participant Tester as 天工测试平台
participant TBox as T-Box
Tester->>Tester: 模拟丢包率10%
Tester->>TBox: MQTT指令
TBox->>TBox: 重传请求(最多3次)
TBox-->>Tester: 最终执行成功
Note over Tester: 重传≤3次,功能正常
sequenceDiagram
participant Tester as 天工测试平台
participant TBox as T-Box
participant CAN as CAN总线
Tester->>TBox: 5条并发MQTT指令
TBox->>TBox: 指令排队
TBox->>CAN: 按优先级依次发送
Note over CAN: 总线负载30%,无丢失
四、 自动化测试交互流程
sequenceDiagram
participant Tester as 天工测试平台
participant TBox as T-Box
participant CAN as CAN总线
participant MES as MES/报告系统
Tester->>Tester: 配置MQTT服务器,加载用例集
Tester->>TBox: 发布MQTT指令(记录T0)
TBox->>TBox: UART日志输出“指令接收”(T1)
TBox->>CAN: 发送CAN报文(T2)
CAN->>CAN: 车身控制器解析
CAN-->>Tester: GPIO/PWM变化(T3)
Tester->>Tester: 计算各段延迟,比对映射
Tester->>MES: 生成全链路延迟分解报告
Note over Tester: 一键执行,自动判定PASS/FAIL