docs(prediction): 说明 AI 预测服务配置
This commit is contained in:
@@ -33,6 +33,14 @@ Environment variable:
|
||||
DATABASE_URL=mysql://user:password@host:3306/database
|
||||
```
|
||||
|
||||
Optional AI prediction service:
|
||||
|
||||
```bash
|
||||
SOH_PREDICTION_API_BASE_URL=http://127.0.0.1:8000
|
||||
SOH_PREDICTION_CACHE_TTL_SECONDS=86400
|
||||
SOH_PREDICTION_TIMEOUT_MS=10000
|
||||
```
|
||||
|
||||
Customer table: `ls_battery_info`.
|
||||
|
||||
| Column | Type | Meaning |
|
||||
@@ -56,6 +64,7 @@ Rules:
|
||||
- `power_status` is normalized to `0 | 1 | 2`.
|
||||
- Without `mac`, battery list queries return the latest record per `mac`.
|
||||
- With `mac`, battery list queries return history ordered by `create_time DESC, id DESC`, limited to 500 rows.
|
||||
- Dashboard may call the external prediction API when `SOH_PREDICTION_API_BASE_URL` is configured. Prediction results are cached in memory by `mac` and latest history record.
|
||||
|
||||
## Layout
|
||||
|
||||
@@ -67,7 +76,8 @@ src/
|
||||
│ └── api/ # ORPC handlers
|
||||
├── server/
|
||||
│ ├── api/ # contracts / routers / interceptors
|
||||
│ └── battery/mysql.ts
|
||||
│ ├── battery/mysql.ts
|
||||
│ └── prediction/client.ts
|
||||
├── domain/battery.ts
|
||||
├── client/orpc.ts
|
||||
└── styles.css
|
||||
|
||||
Reference in New Issue
Block a user