Files
Web_BLS_Upgrade_Server/docs/project.md
XuJiacheng a954db752f feat: 实现RCU升级后端服务初始版本
- 添加Kafka消费者组件用于消费升级事件数据
- 实现数据处理器进行数据验证和转换
- 添加数据库写入组件支持批量写入G5数据库
- 配置环境变量管理连接参数
- 添加日志记录和错误处理机制
- 实现优雅关闭和流控功能
2026-03-17 19:23:51 +08:00

53 lines
1.9 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.
# 0x68命令
## 模式
- rcu_upgrade
### 数据表
- rcu_upgrade_events_g5
#### 基础字段
| 字段名 | 类型 | 备注 |
| --- | --- | --- |
| guid | int8 | 8位整数由数据库自己生成 |
| ts_ms | int8 | 事件发生的时间戳(毫秒级 Unix 时间),作为分区键和主键的一部分。 |
| hotel_id | int2 | 酒店Codesmallint 类型,范围 [0, 32767],标识所属酒店。 |
| room_id | varchar(50) | 房间号,字符串类型,长度 150标识具体房间。 |
| device_id | varchar(64) | 设备唯一标识符最长64字符以CRICS拼接字段为准。 |
| write_ts_ms | int8 | 写入数据库的时间戳(毫秒级 Unix 时间) |
#### 信息字段
| 字段名 | 类型 | 备注 |
| --- | --- | --- |
| is_send | int2 | 1:下发0:上报 默认0 |
| udp_raw | text | UDP原始数据(使用Base64编码) |
| extra | jsonb | 扩展字段(JSON格式) |
#### 数据字段
| 字段名 | 类型 | 备注 |
| --- | --- | --- |
| ip | varchar(21) | 升级IP+port |
| md5 | varchar(255) | 升级MD5校验值 |
| partition | int4 | 升级总块数 |
| file_type | int2 | 升级文件类型 |
| file_path | varchar(255) | 升级路径 |
| upgrade_state | int2 | 升级状态 |
| app_version | varchar(255) | 固件版本 |
#### 生产服务器的推送的数据用于kafka的C#类:
public struct Upgrade_Log
{
public string hotel_id { get; set; }
public string device_id { get; set; }
public string room_id { get; set; }
public string ts_ms { get; set; }
public int is_send { get; set; }
public byte[] udp_raw { get; set; }
public object extra { get; set; }
public string remote_endpoint { get; set; }
public string md5 { get; set; }
public int partition { get; set; }
public int file_type { get; set; }
public string file_path { get; set; }
public int upgrade_state { get; set; }
public string app_version { get; set; }
}