feat(history): align fields quality and exports

This commit is contained in:
lingniu
2026-07-16 16:46:10 +08:00
parent 17c4591040
commit a2722e4afd
13 changed files with 273 additions and 66 deletions

View File

@@ -66,6 +66,15 @@ PREVIOUS_WEB=/opt/lingniu-vehicle-platform/releases/$PREVIOUS_RELEASE/web
"$PREVIOUS_WEB/.release-assets"
```
`deploy/install-web-release.sh` also accepts an optional third argument containing a newly built `platform-api`. When provided, it atomically publishes the new API and Web together. The installer inherits every runtime binary that exists in the previous release (`alert-evaluator`, `alert-stream-evaluator`, `platform-migrate`, `oneos-scope-sync` and the optional benchmark) before switching the symlink, so a later systemd restart cannot fail because a Web-oriented release omitted an unchanged binary:
```bash
deploy/install-web-release.sh \
"$PLATFORM_RELEASE" \
"/tmp/$PLATFORM_RELEASE-web.tar.gz" \
"/tmp/$PLATFORM_RELEASE-platform-api"
```
## Environment
```text
@@ -235,6 +244,8 @@ When `alertStream.lastInvalidCode` reports a recent `missing_vin_jt808`, query `
The history-series gate must use an active production VIN and a current local-time window. Verify that `rawPointCount > 0`, every returned series remains within the requested point budget, `dateFrom`/`dateTo` and point timestamps describe the same absolute window, and the browser renders `Asia/Shanghai` labels. TDengine timestamp literals for this endpoint include an explicit RFC3339 offset; bare UTC-looking strings are unsafe because the server session may interpret them again in its local timezone.
The history-query gate must also request both `location` and `raw` through `/api/v2/history/query`. Every returned row must contain a non-empty `qualityReason`; RAW columns must include fields discovered from the bounded fetched scope rather than only the visible page. In the browser, verify field-name/key search, multi-select, the single visual time-range control, selected-field consistency across table/trend/export, and absence of a RAW-evidence placeholder when `evidenceId` is unavailable. Keep the existing maximum of five vehicles, 200 rows per page and 1,000 fetched rows for interactive field discovery.
Track smoke must also select the final playback event and verify synchronized SOC/direction/alarm availability plus a resolved current address. For high-frequency sources, confirm positive subsecond samples do not become alternating zero-second `数据间隔` segments; only non-increasing timestamps or intervals over ten minutes are gaps. Access smoke should exercise `model`/`provider` and one paired first/latest receive-time range, then confirm the filter survives a shareable URL and every returned row remains in scope.
Global-monitor smoke must verify `zoom=5` returns clusters, a city `bounds` at `zoom=13` returns at most 2,000 lightweight points, and invalid/reversed bounds return HTTP 400. In the browser, the rail renders at most 200 vehicle rows while the legend reports the independent map mode. Selecting `driving` or `idle` must constrain both the server-side count and every loaded row. A unique keyword result must discard the previous viewport and focus at point zoom. The synthetic release gate is `go test ./internal/platform -run TestMonitorMapTenThousandVehicles -count=1` plus `go test ./internal/platform -run '^$' -bench BenchmarkMonitorMapTenThousandVehicles -benchtime=30x -benchmem`.

View File

@@ -159,7 +159,18 @@
### P0-04 历史数据可配置字段与质量原因
状态:`进行中`
状态:`已完成`
已上线结果release `history-fields-quality-20260716164356`
- 位置、RAW 解析字段和日里程统一返回平台计算的质量等级与中文“质量原因”;坐标、速度、里程关系、解析状态、解析错误、设备/接收时间延迟和里程异常均有明确说明。
- RAW 字段目录从本次受控查询范围内已读取的数据发现,不再只扫描当前分页;生产 GB32960 实车查询可选择 123 个实际字段。
- 字段设置支持按中文名称、字段 key 和单位搜索、多选、全选及恢复默认;面板同时最多挂载 200 个选项,字段很多时通过搜索缩小范围,避免一次渲染造成卡顿。
- 当前字段选择统一驱动表格、详情、导出以及可绘图指标;隐藏速度或总里程后,趋势接口不再继续请求已隐藏指标。
- 起止时间合并为一个连续时间范围组件车牌主显、VIN 辅显;无独立 RAW 帧的数据不再显示空“证据”占位。
- 查询仍限制最多 5 台车辆、单页 200 行、服务端本次字段发现最多 1,000 行;异步导出继续限制 31 天、32 指标和 100 万行。
- ECS 实车验证:位置历史 5 行均返回质量原因GB32960 RAW 5 行发现 123 个字段并返回解析质量原因。各 20 次、每次 50 行请求中,位置历史中位约 6ms/P95 约 7msRAW 中位约 25ms/P95 约 30ms。
- 安装器同步支持在原子 Web 切换时替换新 API并完整继承告警评估器、迁移和 OneOS 同步等现有运行文件,避免未来服务器重启后 release 缺少二进制。
目标: