本文档用于指导 JHM 服务在生产环境中部署、配置和联调。
当前服务支持:
EE 55 固定帧协议AA 55 变长协议执行:
npm run build
生成目录:
dist/
win-x64/
jhm-service.exe
runtime/
config.json
alModel.json
linux-x64/
jhm-service
runtime/
config.json
alModel.json
部署前确认:
devices[].ip 与现场实际来源 IP 一致主要修改文件:
runtime/config.json
当前推荐结构:
{
"send": {
"channels": ["aliyun"]
},
"logging": {
"enabled": true,
"console": true,
"dir": "./logs",
"filePrefix": "jhm-service",
"level": "info"
},
"tcp": {
"host": "0.0.0.0",
"port": 9000,
"maxConnections": 100,
"socketTimeoutMs": 120000,
"keepAlive": true,
"keepAliveDelayMs": 10000,
"noDelay": true,
"backlog": 128,
"maxBufferBytes": 8192
},
"mqtt": {
"protocol": "mqtt",
"host": "mqtt.ihemodialysis.com",
"port": 62283,
"username": "data",
"password": "data#2018",
"defaultTopicPrefix": "touxiji"
},
"aliyun": {
"enabled": true,
"tupleApiBaseUrl": "https://things.icoldchain.cn",
"tupleApiPath": "/device/info/getAliyunDeviceSecret",
"autoRegister": true,
"registerRetryMs": 60000,
"connectTimeoutMs": 15000
},
"protocol": {
"alModelPath": "./alModel.json",
"bloodPressure": {
"publishTime": true
}
},
"devices": [
{
"deviceId": "JHM-001",
"ip": "192.168.33.1",
"name": "1号透析机"
}
]
}
sendchannels:可选 mqtt、aliyun["mqtt"]["aliyun"]["mqtt", "aliyun"]loggingenabled:是否写本地日志console:是否输出控制台dir:日志目录filePrefix:日志文件前缀level:debug/info/warn/errortcphost:监听地址,生产建议 0.0.0.0port:TCP 监听端口maxConnections:最大连接数socketTimeoutMs:连接超时时间keepAlive:是否启用 KeepAlivekeepAliveDelayMs:KeepAlive 延迟noDelay:是否关闭 Naglebacklog:监听队列长度maxBufferBytes:解码缓冲区上限mqttprotocol:通常为 mqtthost:Broker 地址port:Broker 端口username:用户名password:密码defaultTopicPrefix:topic 前缀topic 规则:
{defaultTopicPrefix}/{deviceId}
aliyunenabled:是否启用阿里云tupleApiBaseUrl:三元组接口基础地址tupleApiPath:三元组接口路径autoRegister:是否允许自动注册registerRetryMs:失败重试冷却时间connectTimeoutMs:连接超时时间protocolalModelPath:模型文件路径bloodPressure.publishTime:是否发布血压监测时间 M规则:
true:发布 N/O/P/Mfalse:只发布 N/O/Ptrue如果现场平台未接血压时间字段,建议配置:
"protocol": {
"alModelPath": "./alModel.json",
"bloodPressure": {
"publishTime": false
}
}
devices每台设备至少配置:
deviceIdipname注意:
ip 必须与服务端实际看到的客户端 IP 一致血压计示例报文:
AA 55 0E BA 00 78 50 59 08 08 08 08 08 10
解析含义:
00 78:收缩压 N50:舒张压 O59:脉搏 PM发布时间开启时:
{
"N": 120,
"O": 80,
"P": 89,
"M": "2026-04-15 09:30"
}
发布时间关闭时:
{
"N": 120,
"O": 80,
"P": 89
}
建议目录:
C:\services\jhm\win-x64
试运行:
cd C:\services\jhm\win-x64
.\jhm-service.exe --config .\runtime\config.json
建议目录:
/opt/jhm/linux-x64
试运行:
cd /opt/jhm/linux-x64
chmod +x ./jhm-service
./jhm-service --config ./runtime/config.json
部署完成后建议执行:
npm test
npm run verify:commands
重点确认:
AA 55 报文解析正常M 字段是否符合现场需求