feat: 完成 issue #3 边缘采集网关模板化封装
- 点位字典 CSV schema/加载/自动校验(缺失字段/量纲/重复点号,PRD 5.1) - 协议可插拔只读驱动:OPC UA(S7-1200 适配)/S7/Modbus/称重/能源/模拟 - 周期采集引擎:只读+背压保护+健康度指标(丢失率/P99/可用性) - Kafka 流式上行 + 本地 spool 断点续传(丢失率≤0.02% 保障) - 模板配置外置(gateway.yaml + 点位字典 CSV),换行业零改码 - 18 个单元测试全绿;端到端运行 SLA 达标
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
# iAOP 边缘采集网关 —— 模板配置示例(Template-Ti 一期:氯化车间/海绵钛)
|
||||
# 换行业模板时只需修改本文件 + 点位字典 CSV,网关代码零改动。
|
||||
collector:
|
||||
# 采集周期(毫秒):600 点位 1Hz 即 1000
|
||||
interval_ms: 1000
|
||||
# 背压保护:spool 待上行记录上限,超过则丢弃新样本并计入丢失率
|
||||
max_pending: 100000
|
||||
# 本地缓存目录(断点续传落盘位置)
|
||||
spool_dir: "./spool"
|
||||
cache_limit_bytes: 536870912 # 512MB
|
||||
# 协议可插拔驱动插槽(protocol 注册表见 drivers/__init__.py)
|
||||
drivers:
|
||||
# 和利时 DCS —— OPC UA 只读
|
||||
- protocol: opcua
|
||||
device_prefixes: ["CLF"] # 设备编号前缀路由(CLF-01, CLF-02, ...)
|
||||
config:
|
||||
endpoint: "opc.tcp://10.20.1.10:4840"
|
||||
security: "None"
|
||||
timeout: 10
|
||||
# 西门子 S7-1200 —— PLC 只读(点位 opcNode 列写 DB 地址,如 DB100.0.0)
|
||||
- protocol: s7
|
||||
device_prefixes: ["S7"]
|
||||
config:
|
||||
ip: "10.20.1.20"
|
||||
rack: 0
|
||||
slot: 1
|
||||
# 称重仪表(Modbus RTU)
|
||||
- protocol: weighing
|
||||
device_prefixes: ["W"]
|
||||
config:
|
||||
mode: modbus
|
||||
mode_tcp: false
|
||||
port: "COM3"
|
||||
baudrate: 9600
|
||||
slave_id: 1
|
||||
# 能源表(Modbus TCP)
|
||||
- protocol: energy
|
||||
device_prefixes: ["E"]
|
||||
config:
|
||||
mode: modbus
|
||||
host: "10.20.1.30"
|
||||
port: 502
|
||||
slave_id: 1
|
||||
# 兜底:未匹配任何前缀的点位(本地联调用 simulator;现场部署删除此项)
|
||||
- protocol: simulator
|
||||
device_prefixes: []
|
||||
config:
|
||||
seed: 2026
|
||||
|
||||
kafka:
|
||||
bootstrap_servers: "10.20.0.10:9092"
|
||||
topic_prefix: "iaop.ti-cl4" # 模板化 topic:{prefix}.{device_id}.points
|
||||
batch_size: 500
|
||||
Reference in New Issue
Block a user