refactor(go): keep realtime cache vin scoped
This commit is contained in:
@@ -578,28 +578,28 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Redis</strong></td>
|
||||
<td><code>vehicle:latest:{vehicle_key}</code></td>
|
||||
<td><code>vehicle:latest:{vin}</code></td>
|
||||
<td>realtime-api Kafka consumer</td>
|
||||
<td>跨协议合并后的实时字段快照</td>
|
||||
<td>查 VIN 是否在线、查 VIN 实时数据</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Redis</strong></td>
|
||||
<td><code>vehicle:latest:{vehicle_key}:{protocol}</code></td>
|
||||
<td><code>vehicle:latest:{vin}:{protocol}</code></td>
|
||||
<td>realtime-api Kafka consumer</td>
|
||||
<td>单协议实时轻量快照</td>
|
||||
<td>区分 32960/808/MQTT 的实时状态</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Redis</strong></td>
|
||||
<td><code>vehicle:realtime-raw:{protocol}:{vehicle_key}</code></td>
|
||||
<td><code>vehicle:realtime-raw:{protocol}:{vin}</code></td>
|
||||
<td>realtime-api Kafka consumer</td>
|
||||
<td>单协议最新 parsed 全量字段</td>
|
||||
<td>实时 RAW 字段查看,不走 TDengine 历史扫描</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Redis</strong></td>
|
||||
<td><code>vehicle:online:{vehicle_key}</code>、<code>vehicle:last_seen</code></td>
|
||||
<td><code>vehicle:online:{vin}</code>、<code>vehicle:last_seen</code></td>
|
||||
<td>realtime-api Kafka consumer</td>
|
||||
<td>在线状态、最后接收时间、协议列表</td>
|
||||
<td>在线判断和近期车辆列表</td>
|
||||
@@ -639,7 +639,7 @@
|
||||
<tbody>
|
||||
<tr><td>VIN 是否在线</td><td>Redis online key</td><td>TTL 内有数据即在线,默认 TTL 600 秒。</td></tr>
|
||||
<tr><td>VIN 实时数据</td><td>Redis latest snapshot</td><td>跨协议合并核心 fields;完整协议字段通过 realtime-raw 查询。</td></tr>
|
||||
<tr><td>单协议实时 RAW</td><td>Redis realtime-raw</td><td>查看某 VIN/phone 在某协议下最新 parsed 全量字段。</td></tr>
|
||||
<tr><td>单协议实时 RAW</td><td>Redis realtime-raw</td><td>查看某 VIN 在某协议下最新 parsed 全量字段。</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -724,8 +724,8 @@
|
||||
Redis latest snapshot 只保留统一实时核心字段;完整协议 parsed 只放 realtime-raw,避免重复缓存大 JSON。
|
||||
</div>
|
||||
<div class="ok">
|
||||
<strong>身份解析降级</strong><br>
|
||||
VIN 优先,其次 phone、vehicle_key_hint、device_id,保证无 VIN 时仍可临时归档和查询。
|
||||
<strong>身份解析边界</strong><br>
|
||||
实时缓存只写 VIN 非空车辆;无 VIN 帧保留在 RAW 和注册/绑定排查链路,补齐绑定后通过新帧或回放进入实时态。
|
||||
</div>
|
||||
<div class="ok">
|
||||
<strong>数据分层查询</strong><br>
|
||||
|
||||
Reference in New Issue
Block a user