How duyu09/powerload-classification-and-prediction-system works
This repository implements a non-intrusive power-load monitoring system: a client requests current measurements, appliance classifications, and short-term forecasts through backend services. The documented runtime combines a C++ HTTP server and SQLite storage with Python AI services; the README also describes a WeChat client, power-meter inputs, and classification/prediction stages. Source evidence is strongest for the C++ server, its database access, and Python prediction entry points. Some documented integrations and unsampled service wiring are therefore shown only as dashed, unverified links.
Main entry points: webserver.cpp Web server · httpconnect.cpp HTTP connection · prediction.py Load prediction · Classification_Test_v6.3.py Load classification
Components 22
C++ HTTP backend
- Server entry
CPP_backend/main.cpp - Web server
CPP_backend/src/server/webserver.cpp - HTTP connection
CPP_backend/src/http/httpconnect.cpp - Request parser
CPP_backend/src/http/httprequest.cpp - API responses
CPP_backend/src/http/httpresponse.h - I/O buffers
CPP_backend/src/buffer/buffer.cpp - I/O multiplexer
CPP_backend/src/server/epoller.cpp - Worker pool
CPP_backend/src/pool/threadpool.cpp - Connection timers
CPP_backend/src/timer/timer.h - Async logging
CPP_backend/src/log/log.cpp
Power data storage
- SQLite access
CPP_backend/src/database/database.cpp - Power-load database
Python_backend/powerload.db
AI processing
- Load classification
Python_backend/classify/Classification_Test_v6.3.py - Load prediction
Python_backend/prediction/prediction.py - ARIMA comparison
Python_backend/compare/arima.py
Python services
- Python API services
Python_backend/app.py - Backend service
Python_backend/app-backend.py - MQ backend service
Python_backend/app-backend-mq.py - AI API services
Python_backend/app-ai.py - MQ AI service
Python_backend/app-ai-mq.py
Other components
- WeChat client
- Power meter
Connections 20
- WeChat client → Server entry: requests data
README.md - Power meter → Load classification: supplies readings
README.md - Server entry → Web server: starts
CPP_backend/main.cpp - Web server → HTTP connection: manages connections
- Web server → I/O multiplexer: dispatches I/O
- Web server → Worker pool: uses workers
- Web server → Connection timers: manages timeouts
- HTTP connection → Request parser: parses requests
- HTTP connection → API responses: builds responses
- HTTP connection → I/O buffers: buffers I/O
- API responses → SQLite access: queries and registers
CPP_backend/src/http/httpresponse.h - SQLite access → Async logging: logs operations
- AI API services → Load prediction: uses forecaster
Python_backend/app-ai.py - MQ AI service → Load prediction: uses forecaster
Python_backend/app-ai-mq.py - AI API services → Load classification: runs classification
- Backend service → Power-load database: persists readings
- MQ backend service → Power-load database: persists readings
- MQ backend service → MQ AI service: coordinates AI jobs
- Load classification → Load prediction: provides appliance labels
README.md - ARIMA comparison → Load prediction: compares forecasts
README.md