eis/src/zudp/zudp_readme.md
Huamonarch 09b48b07e5 Add READMEs for all infrastructure services and overall project
- EIS_README.md: Overall project architecture, data flow, service inventory
- zmqp/zmqc_readme: ActiveMQ producer/consumer bridging ICE
- zcache_readme: Data cache hub with address mapping and type conversion
- zhd_readme: Real-time snapshot persistence to iHyperDB
- zinit_readme: DB2-to-shared-memory initialization service
- zsub/zudp/zdsf/rcv_readme: Data receiver layer for different on-site protocols
2026-05-09 12:13:00 +08:00

82 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# zudp — UDP 数据接收器
## 概述
zudp 是 EIS 系统中的 **UDP 协议数据接收器**。它通过 UDP 接收原始二进制数据包,缓存到共享内存,并通过 ICE 代理转发给下游服务。与 zsub 不同zudp **不解析数据内容**,仅做透明转发。
## 进程架构
```
UDP 数据源
│ UDP 数据包
┌──────────────────────────────────────┐
│ zudp │
│ │
│ UdpConnection 接收线程 │
│ │ │
│ ├→ 从 config/udpconfig.json 读取│
│ │ 服务器 IP/端口配置 │
│ ├→ 接收 UDP 数据报 │
│ └→ 推入 gb_qtcache_udp 队列 │
│ │
│ HandleMessage 处理线程 │
│ │ │
│ ├→ 从 gb_qtcache_udp 取消息 │
│ ├→ 构造 Ice::ByteSeq │
│ ├→ CMemFix<PLC_DATA> 共享内存缓存│
│ ├→ ICE Proxy() 转发 │
│ │ └→ 目标由 udpconfig.json 配置 │
│ └→ eventNo=1004: │
│ 额外转发到 zprx │
│ │
└──────────────────────────────────────┘
```
## 与 zsub 的区别
| 方面 | zsub | zudp |
|------|------|------|
| 传输协议 | TCP (流式) | UDP (数据报) |
| 数据源 | FDA 服务器 (订阅) | 任意 UDP 源 |
| 数据处理 | 解析信号名/值,映射到遥测项 | 不解析,透明转发 |
| 配置方式 | INI 属性文件 | JSON 配置文件 |
| 适用场景 | 标准 FDA 数据采集 | 低延迟/广播式数据中继 |
## 配置
`$CRGS/config/udpconfig.json` 读取,按服务名索引:
```json
{
"zudp": {
"ip": "192.168.1.x",
"port": 1234,
"proxy": "baosight/zcache"
}
}
```
## ICE 接口
| 方法 | 说明 |
|------|------|
| `SendDataShort` | 空操作 |
| `SendDataLong` | 空操作 |
| `TimeNotify` | 空操作 |
zudp 是纯客户端 — 接收 UDP 数据后通过 ICE 代理转发。
## 现场适用场景
zudp 适用于需要低延迟、无需建立 TCP 连接的数据接收场景,通常用于**对实时性要求极高的 DSC 控制信号或广播式数据源**。
## 源文件
```
src/zudp/
├── zudp.cpp # PACE 组件入口
├── zudpICEI.cpp # ICE servant + UDP 连接 + 消息处理器创建
└── HandleMessage.cpp # 数据转发逻辑
```