Files
WCTDataMiner/docs/data-model/概览.md
Scottxjw 2b031995e1 docs: 更新项目架构与数据模型文档
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-13 15:01:32 +08:00

87 lines
2.6 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.
# Data Model: Gpulse.WCT.DataAnalyzer
> 双数据库数据模型:本地解析库 + 正式发布库,相互独立。
---
## 文档索引
### 本地库local.db
| 文档 | 说明 |
|------|------|
| [TX面板维度](./entities/TxPanel维度.md) | TX面板类型维度 |
| [TX硬件版本维度](./entities/TxHardware维度.md) | TX硬件版本维度 |
| [TX软件版本维度](./entities/TxSoftware维度.md) | TX软件版本维度 |
| [RX类型维度](./entities/RxType维度.md) | RX类型维度 |
| [测试场景实体](./entities/测试场景.md) | 测试场景(外键组合) |
| [Qfod 记录实体](./entities/Qfod记录.md) | Qfod 检测数据 |
| [Ploss 记录实体](./entities/Ploss记录.md) | Ploss FOD 数据 |
| [关系说明](./关系说明.md) | 本地库实体间关系 |
### 发布库release.db
| 实体 | 表 | 说明 |
|------|----|------|
| ChargingParameterRecord | charging_parameter | 正式充电参数记录 |
---
## 架构概览
```mermaid
erDiagram
%% 本地库
tx_panel ||--o{ test_scenario : "引用"
tx_hardware ||--o{ test_scenario : "引用"
tx_software ||--o{ test_scenario : "引用"
rx_type ||--o{ test_scenario : "引用"
test_scenario ||--o{ qfod_record : "包含"
test_scenario ||--o{ ploss_record : "包含"
%% 发布库(独立)
charging_parameter {
uuid id PK
varchar car_factory UK
varchar car_model UK
varchar phone_brand UK
varchar phone_model UK
double power_350mw
double power_500mw
double power_750mw
double power_1000mw
double power_1250mw
double power_1500mw
double power_1750mw
double power_2000mw
double power_2250mw
double q_value
double q_base_value
double pq_coefficient
double resonance_frequency
}
```
框外是本地库,框内是发布库——两库之间没有外键或导航属性。
## 设计说明
### 本地库:星型模型
- 维度表TxPanel, TxHardware, TxSoftware, RxType
- 事实表TestScenario, QfodRecord, PlossRecord
- 所有表支持软删除is_deleted + query filter
### 发布库:独立扁平表
- 一个业务多维表,无外键依赖
- 唯一键:(car_factory, car_model, phone_brand, phone_model)
- 无 is_deleted、无软删除、无审计字段
- 更新时间 updated_at 记录发布记录的最后变更时间
### 隔离原则
- 代码中两个实体的命名空间不同Domain.Models
- 两个 DbContext 不共享 DbSet
- 发布库不从本地库继承实体配置
- aggregate 通过纯值映射,不依赖导航属性