Files
zk-data-agent/skills/elk-fetch/business/micar-onetrack.md
T
2026-05-08 10:54:27 +08:00

128 lines
7.0 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.
# 小米汽车 OneTrack 端侧埋点
> 小米汽车小爱端侧上报的全量埋点(端到端可用性、ASR 状态、全离线日志、性能指标等)。与 NLP 服务端日志正交:从车端上报的客户端事件流。
>
> 索引 `onetrack_xiaoai_micar*`**c3log 独立集群**),单日 ~300GB——**必须传 `--date YYYYMMDD`**。
## tip 体系
一个 request_id 对应多条记录,每条对应一个 `tip` 埋点点位。先 `--fields tip,tip_name` 看一眼有哪些 tip
```bash
python elk_query.py <rid> --preset micar --date 20260424 \
--fields request_id,tip,tip_name,tip_module_name,event_name
```
主要点位:
| tip | tip_name | tip_module_name | event_name | 含义 |
| --- | -------- | --------------- | ---------- | ---- |
| `1024.1.1.1.23177` | 小爱端到端可用性 | 性能类 | execute | 全链路时序埋点(wakeup → asr → nlp → exec |
| `1024.1.2.1.23176` | 小爱全离线日志 | 日志类 | execute | **离线模型相关日志** |
| `1024.1.2.1.34496` | 离线NLP结果 | — | state | 离线 NLP 出参 |
| `1024.4.1.1.25631` | ASR识别状态 | ASR识别 | state | ASR 中间状态 |
| `1024.1.1.1.33610` | 第三方接口调用 | — | execute | — |
| `1024.1.3.1.23520` / `23521` | 小爱指令开始 / 结束 | — | start / — | — |
⚠️ **不同 tip 的负载 schema 不统一**
- 23177 → 负载在顶层 `key_value`
- 23176 → 负载在顶层 `request_infos[]` / `response_infos[]` / `other_infos`**不在 `key_value`**
- 34496 → 负载在 `key_value.instructions`
- 25631 → `key_value` 为 null,看 `event_name` / `other_infos`
---
## 23177 — 端到端可用性
负载在顶层 `key_value`(脚本自动解析)。常用字段:
**唤醒**`wakeup_received_event` / `wakeup_ball_appear`
**ASR 时序**`asr_first_partial` / `asr_first_text` / `asr_first_same_final` / `asr_final` / `asr_first_pack_sent`
**NLP 时序**`nlp_start_answer` / `nlp_finish_answer`
**结果**`state_result_type``success` / .../ `state_exec_result` / `state_cancel_msg`
**指令统计**`state_exec_ins_total` / `state_exec_ins_success` / `state_exec_ins_failed` / `state_exec_ins_filtered`
**异常**`state_nlp_unknown_instructions` (list) / `state_nlp_exceptions` / `state_vad_end_type`
**链路**`state_duplex` / `state_request_id` / `state_asr_final_size`
```bash
python elk_query.py <rid> --preset micar --date 20260424 \
--fields request_id,tip,key_value.state_result_type,key_value.state_exec_result,key_value.wakeup_received_event,key_value.asr_final,key_value.nlp_finish_answer
```
---
## 23176 — 全离线日志 ⭐ 离线模型核心
⚠️ schema 与其他 tip 不同:负载在顶层 `request_infos[]` / `response_infos[]` / `other_infos`(list,长度通常为 1,但每个 list 都有大量信息),**不在 `key_value`**。
### `request_infos[0]` — 送给离线引擎的入参
- 引擎/模型版本:`engine_id` / `engine_model`(如 `3.2.30-claw`/ `offline_model_ver`(如 `2026012201`/ `miai_ver` / `app_version`
- 请求形态:`request_type` / `request_state_type` / `is_wakeup_req` / `is_llm` / `duplex` / `origin`
- 链路环境:`srv_env` / `network` / `network_nlp` / `network_type` / `off_asr_avail`
- 设备:`device_id` / `car_type` / `car_config` / `is_driving` / `zone_info` / `is_login` / `has_token` / `isInternal`
- **`context_offline`** (list) — 离线引擎拿到的全部 context payload(含 `Nlp.OfflineSession` / `Map.MapState` / `UIController.InteractionInfoList` 等 namespace)。**研究模型行为时务必看这一段**
- 其他:`ua` / `transaction_id` / `request_id` / `timeout_reason`
### `response_infos[0]` — 引擎返回的产物
⚠️ 不止 `nlp_debug_info`,三块都要看:
**`instructions[]`** — 引擎下发的全部指令序列。每条 `header.namespace.name` + `header.is_offline`true/false 标识离/在线判决)+ `header.dialog_id` / `id` / `transaction_id` + `payload`。常见 namespace.name
- `System.Heartbeat` / `System.Abort`
- `Offline.CloudStop``current_round_used_audio_duration` / `next_round_rid` / `stop_audio_duration`
- `SpeechRecognizer.RecognizeResult``is_final` / `results[].text` / `confidence` / `is_nlp_request` / `is_key_word_free_request`
- `Nlp.StartAnswer` / `Nlp.FinishAnswer` / `Nlp.IntentsWithRelation``payload.intent`
- `Template.Query``text`
- `Dialog.Reject``query` / `reject_type``NON_HUMAN` / `Dialog.Finish`
**`nlp_debug_info`** ⭐ 离线 NLP 模型自身的调试输出(模型日志打点)。研究模型决策为什么这样做的核心:
- **`Arbitrate`** — 仲裁器决策:`query` / **`logits`** (list[float], 各类目原始打分) / `label_id` / `category`(如 `Info`/ `predict` / `label`(如 `baike#person`/ `domains`(候选 domain/ `time`
- 各阶段耗时:`Rewrite.time` / `PreTrain.time``bertAvailable`/ `EdgeIntentExecutor.time` / `GeneralParse.time` / `lookAndTalk.time`
- 候选 domain`domain_confidence` (list) / `domain_parsers` (list)
- 各 domain parser 子模块(如 `music` / `phonecall` / `mapApp`):每个 parser 块下含 `time` / `score` / `parser_version` + 子模块耗时(如 `music.MusicKvParserCost` / `MusicJsgfParserCost` / `MusicIcsfModelParserCost` / `MusicGlobalCost`
- **`nlp_model_version`** (dict) — 各模型 checkpoint 版本(如 `arbitrator-l1: 20241205_offline` / `phonecall-icsf: 240205_offline` / `mapapp-icsf-single: 241224_offline`
- `nlp_edge_version` — 边端 NLP 引擎整体版本
- `edge_track` — 上下文/能力 capability 追踪:`capabilitiesVersion` / `contexts`(用到的 context namespace list/ `arbitrator_priority`
- `llm_wait` — 是否等待 LLM
**`other_infos`** — 其他辅助信息(list
### 命令模板
```bash
# 整条全离线日志(含 request_infos[0]、response_infos[0]、other_infos
python elk_query.py <rid> --preset micar --date 20260424 \
--fields request_id,tip,tip_name,request_infos,response_infos,other_infos
# 只看模型自身打的 debug 日志
python elk_query.py <rid> --preset micar --date 20260424 \
--json-path response_infos.0.nlp_debug_info
# 模型版本 + 仲裁结果速览
python elk_query.py <rid> --preset micar --date 20260424 \
--fields request_id,tip,response_infos.0.nlp_debug_info.Arbitrate,response_infos.0.nlp_debug_info.nlp_model_version,response_infos.0.nlp_debug_info.nlp_edge_version,request_infos.0.engine_model,request_infos.0.offline_model_ver
# 引擎全部指令(看 is_offline 区分离/在线)
python elk_query.py <rid> --preset micar --date 20260424 \
--json-path response_infos.0.instructions
```
---
## 34496 — 离线NLP结果
`key_value` 顶层就是 `{instructions: [...]}`,结构和 23176 的 `response_infos[0].instructions` 一致,但**只是 NLP 部分的指令子集**(不含 SpeechRecognizer / System / Offline 等)。没有 `nlp_debug_info`、没有 `request_infos`——想看模型决策细节去 23176。
---
## 字段 schema
完整 schema 见 [`../INDEX_CATALOG.md`](../INDEX_CATALOG.md) 中 `onetrack_xiaoai_micar*` 一节。