№ 61
EVBattery AI: dự báo sức khỏe pin xe điện dựa trên dữ liệu lịch sử sạc, giúp nắm bắt tình trạng sức khỏe pin xe điện, quản lý đội xe cũng như hỗ trợ đưa ra các giải pháp xử lý các vấn đề liên quan đến sức khỏe pin kịp thời.
Hệ thống AI dự báo sức khỏe pin xe điện (State of Health) theo thời gian thực — tự động phát hiện pin suy giảm, cảnh báo sớm và dự báo km còn lại trước khi cần thay pin, không cần phần cứng thêm.
Kỹ sư chất lượng tại nhà sản xuất xe điện phải phân tích thủ công từng file log cảm biến — mỗi xe tốn 2–3 giờ và không có công cụ cảnh báo sớm trước khi sự cố xảy ra. Dự án này tự động hóa toàn bộ pipeline: nhận dữ liệu sạc → trích xuất đặc trưng → LightGBM ước lượng SoH → phân tích xu hướng → dự báo km còn lại → sinh tóm tắt bằng AI (tiếng Việt).
Chang'an EV telemetry — 300 xe điện, sampling 0.1Hz (1 record/10s). Mỗi xe là 1 file CSV ~1.2M rows × 13 cột (timestamp, SOC, speed, odometer, chargestatus, pack voltage/current, min/max cell voltage, min/max temperature).
Pipeline xử lý offline (5 bước): clean → tách charging sessions (gap >30 phút = session mới) → tính SoH bằng Coulomb counting (chỉ session có SOC_end ≥ 95%) → filter voltage window [374.4–388.8V] (đoạn constant-current ổn định) → extract 15 Health Indicators (cumulative charge, cell voltage spread, temperature, current stats).
Kết quả: 161,125 charging events × 18 cột → changan_features.csv (40MB thay vì ~558GB raw). Chi tiết: DATA.md.
CSV / PKL Upload (fleet manager)
│
▼
FeatureExtractor — 15 HI từ voltage window
(q_ave, q_std, dv_ave, dv_ran, c_max, v_end, ...)
│
▼
LightGBM v5 SoHEstimator ──► SoH % (RMSE ±3.17%)
│
linregress → slope → km_to_eol
│
OpenAI LLM → llm_summary (tiếng Việt)
│
FastAPI Backend ◄┘
│
┌────────────┼────────────┐
PostgreSQL Alerts auto AnalysisResult
(Supabase) khi SoH < 85% lưu DB
│
React Frontend (Railway)
| Layer | Công nghệ |
|---|---|
| ML — SoH | LightGBM v5 + scipy.stats.linregress |
| AI Summary | OpenAI API (gpt-4o-mini mặc định) qua langchain_openai |
| Backend | FastAPI + Python 3.11 + SQLAlchemy async |
| Database | SQLite (dev) / PostgreSQL via Supabase (prod) |
| Auth | JWT HS256 — access token 1 ngày + refresh token 7 ngày |
| Rate limiting | slowapi — 10 req/min trên endpoint login |
| Frontend | React 18 + TypeScript + Vite + Recharts + react-resizable-panels |
| Deploy — Backend | Railway hoặc EC2 (systemd) |
| Deploy — Frontend | Railway (root directory: frontend/) |
users → id, email, password (bcrypt), full_name, role, is_active, created_at
fleets → id, name, manager_id (FK users), created_at
cars → id, owner_id (FK users), fleet_id (FK fleets), created_at
vehicle_sessions → id, car_id, mileage, soh_pct, analyzed_at
analysis_results → id, car_id, soh, soh_status, km_to_eol, slope_soh_per_km,
soh_history_json, llm_summary, note, processing_time_ms, analyzed_at
alerts → id, car_id, soh_at_alert, message, is_resolved (timestamp)
SoH thresholds: normal ≥ 85% · warning 80–85% · critical < 80%
| Role | Quyền |
|---|---|
admin | Toàn quyền: tạo/xóa/đổi role user, đăng ký xe, quản lý fleet |
fleet_manager | Xem danh sách xe trong fleet, upload file cảm biến, xem và resolve alerts |
end_user | Xem thông tin xe được gán, xem alerts |