cache_data_structure.json
8.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
{
// ==================== 地图缓存数据结构 (IMapCacheService) ====================
"MapCacheData": {
// 地图唯一标识符
"MapId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// 地图编码
"MapCode": "MAP001",
// 地图名称
"MapName": "一号仓库地图",
// 地图类型 (0=未知, 1=2D平面, 2=3D立体)
"MapType": 1,
// 地图版本号
"Version": "1.0.0",
// 是否启用
"Active": true,
// 节点列表
"Nodes": [
{
// 节点唯一标识符
"NodeId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
// 节点编码
"NodeCode": "N001",
// X坐标 (米)
"X": 10.5,
// Y坐标 (米)
"Y": 20.3,
// 角度 (弧度, 可选)
"Theta": 1.57,
// 节点类型 (0=普通点, 1=充电点, 2=停靠点, 3=工作点)
"Type": 0,
// 是否启用
"Active": true,
// 是否倒车进入
"IsReverseParking": false,
// 是否允许旋转
"AllowRotate": true
},
{
"NodeId": "8d7f5680-8536-51ef-c4gd-f18gd2g01bf8",
"NodeCode": "N002",
"X": 15.8,
"Y": 25.6,
"Theta": null,
"Type": 1,
"Active": true,
"IsReverseParking": true,
"AllowRotate": false
}
],
// 边列表
"Edges": [
{
// 边唯一标识符
"EdgeId": "9e8f7791-9647-62fg-d5he-g29he3h12cg9",
// 边编码
"EdgeCode": "E001",
// 起始节点ID
"FromNode": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
// 目标节点ID
"ToNode": "8d7f5680-8536-51ef-c4gd-f18gd2g01bf8",
// 边长度 (米)
"Length": 7.5,
// 代价权重 (可选, 用于路径规划)
"Cost": 1.2,
// 是否启用
"Active": true,
// 允许的行驶夹角角度列表 (度, 可选)
"OrientationAngles": [0, 90, 180, 270],
// 最大速度 (米/秒, 可选)
"MaxSpeed": 2.5,
// 最大角度偏差 (度, 可选)
"MaxAngleDeviation": 5.0,
// 是否为曲线
"IsCurve": false,
// NURBS控制点 (曲线时使用, 可选)
"ControlPoints": null
},
{
"EdgeId": "af9g8802-a758-73gh-e6if-h3aif4i23dha",
"EdgeCode": "E002",
"FromNode": "8d7f5680-8536-51ef-c4gd-f18gd2g01bf8",
"ToNode": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"Length": 7.5,
"Cost": 1.0,
"Active": true,
"OrientationAngles": [45, 135, 225, 315],
"MaxSpeed": 3.0,
"MaxAngleDeviation": 10.0,
"IsCurve": true,
"ControlPoints": [
{
"X": 12.0,
"Y": 22.0
},
{
"X": 13.5,
"Y": 24.0
}
]
}
],
// 资源区域列表
"Resources": [
{
// 资源唯一标识符
"ResourceId": "bga0991-b869-84hi-f7jg-i4bjg5j34eib",
// 资源编码
"ResourceCode": "RES001",
// 资源类型 (0=未知, 1=充电区, 2=等待区, 3=作业区)
"Type": 1,
// 容量 (可同时容纳的机器人数量, 可选)
"Capacity": 2,
// 最大速度 (米/秒)
"MaxSpeed": 1.0,
// 能否旋转
"CanRotate": true
}
]
},
// ==================== 机器人缓存数据结构 (IRobotCacheService) ====================
// 机器人基础信息缓存
"RobotBasicCache": {
// 机器人ID (数据库主键)
"RobotId": "12345",
// 机器人编码
"RobotCode": "AGV001",
// 机器人名称
"RobotName": "一号AGV",
// 机器人版本
"RobotVersion": "2.1.0",
// 协议名称
"ProtocolName": "VDA5050",
// 协议版本
"ProtocolVersion": "2.0.0",
// 协议类型 (0=未知, 1=VDA5050, 2=自定义)
"ProtocolType": 1,
// 机器人制造商
"RobotManufacturer": "HuaHang",
// 机器人序列号
"RobotSerialNumber": "HH-AGV-20240101-001",
// 机器人类型 (0=未知, 1=AGV, 2=AMR, 3=叉车)
"RobotType": 1,
// IP地址 (可选)
"IpAddress": "192.168.1.100",
// 坐标缩放比例
"CoordinateScale": 1000.0,
// 是否启用
"Active": true
},
// 机器人状态缓存
"RobotStatusCache": {
// 机器人状态 (0=空闲, 1=执行中, 2=错误, 3=充电中, 4=维护中)
"Status": 1,
// 在线状态 (0=离线, 1=在线, 2=未知)
"Online": 1,
// 电池电量 (百分比, 0-100, 可选)
"BatteryLevel": 85,
// 是否正在行驶
"Driving": true,
// 是否暂停
"Paused": false,
// 是否正在充电
"Charging": false,
// 运行模式 (0=自动, 1=半自动, 2=手动, 3=服务, 4=教学)
"OperatingMode": 0,
// 错误列表 (可选)
"Errors": [
{
// 错误类型
"ErrorType": "warning",
// 错误引用 (错误代码)
"ErrorReferences": [
{
"referenceKey": "ERROR_CODE",
"referenceValue": "E001"
}
],
// 错误描述
"ErrorDescription": "电池电量低于20%",
// 错误级别 (0=提示, 1=警告, 2=错误, 3=致命)
"ErrorLevel": 1
}
],
// 最后更新时间 (ISO 8601格式)
"UpdatedAt": "2026-01-19T15:23:45.1234567+08:00"
},
// 机器人位置缓存
"RobotLocationCache": {
// 当前所在地图ID (可选)
"MapId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// 当前所在节点ID (可选)
"NodeId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
// X坐标 (米, 可选)
"X": 10.5,
// Y坐标 (米, 可选)
"Y": 20.3,
// 角度 (弧度, 可选)
"Theta": 1.57,
// 规划路径 (坐标点列表, 可选)
"Path": [
[10.5, 20.3],
[12.0, 22.0],
[15.8, 25.6]
],
// 最后更新时间 (ISO 8601格式)
"UpdatedAt": "2026-01-19T15:23:45.1234567+08:00"
},
// ==================== Redis存储键名规范 ====================
"RedisKeys": {
// 地图数据Hash键: rcs:map:{mapId}
"MapDataKey": "rcs:map:3fa85f64-5717-4562-b3fc-2c963f66afa6",
// 地图ID集合键: rcs:maps
"MapSetKey": "rcs:maps",
// 节点编码索引Hash键: rcs:map:{mapId}:node:index
"NodeIndexKey": "rcs:map:3fa85f64-5717-4562-b3fc-2c963f66afa6:node:index",
// 机器人状态Hash键: rcs:robot:{manufacturer}:{serialNumber}:status
"RobotStatusKey": "rcs:robot:HuaHang:HH-AGV-20240101-001:status",
// 机器人位置Hash键: rcs:robot:{manufacturer}:{serialNumber}:location
"RobotLocationKey": "rcs:robot:HuaHang:HH-AGV-20240101-001:location",
// 机器人基础信息Hash键: rcs:robot:{manufacturer}:{serialNumber}:basic
"RobotBasicKey": "rcs:robot:HuaHang:HH-AGV-20240101-001:basic",
// 所有机器人集合键: rcs:robots
"RobotsSetKey": "rcs:robots",
// 在线机器人集合键: rcs:robots:online
"OnlineRobotsSetKey": "rcs:robots:online",
// 空闲机器人集合键: rcs:robots:idle
"IdleRobotsSetKey": "rcs:robots:idle"
},
// ==================== 完整示例:机器人完整缓存数据 ====================
"CompleteRobotCache": {
"Basic": {
"RobotId": "12345",
"RobotCode": "AGV001",
"RobotName": "一号AGV",
"RobotVersion": "2.1.0",
"ProtocolName": "VDA5050",
"ProtocolVersion": "2.0.0",
"ProtocolType": 1,
"RobotManufacturer": "HuaHang",
"RobotSerialNumber": "HH-AGV-20240101-001",
"RobotType": 1,
"IpAddress": "192.168.1.100",
"CoordinateScale": 1000.0,
"Active": true
},
"Status": {
"Status": 1,
"Online": 1,
"BatteryLevel": 85,
"Driving": true,
"Paused": false,
"Charging": false,
"OperatingMode": 0,
"Errors": null,
"UpdatedAt": "2026-01-19T15:23:45.1234567+08:00"
},
"Location": {
"MapId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"NodeId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"X": 10.5,
"Y": 20.3,
"Theta": 1.57,
"Path": [[10.5, 20.3], [12.0, 22.0], [15.8, 25.6]],
"UpdatedAt": "2026-01-19T15:23:45.1234567+08:00"
}
}
}