perf(go): cache identity binding lookups

This commit is contained in:
lingniu
2026-07-03 08:07:32 +08:00
parent 0b9e803139
commit 400047e08c
5 changed files with 83 additions and 4 deletions

View File

@@ -71,6 +71,7 @@
- `jt808_registration`808 注册、鉴权、最新活跃和 VIN 匹配状态。
- 状态:`vehicle_identity_binding` 使用 VIN 主键;`jt808_registration` 使用 phone 主键;两张表都不保留代理自增主键和 `created_at`
- 查询:`vehicle_identity_binding` 的 phone/device_id/plate 都是唯一键,接入侧按唯一键直查 VIN不做无意义排序。
- 写入链路gateway 对 binding 查 VIN 使用短 TTL 内存缓存,包含未命中缓存,避免无 VIN 高频位置帧每条都打 MySQL。
- 生产RDS 已在上线前删除旧 `vehicle_identity_binding_registration``vehicle_identity_bindings`gateway 启动会自动创建最小 schema。
## 字段提升规则