This platform uses MySQL as the core relational database and performs persistence operations through the MyBatis framework.The database not only undertakes the task of persistent storage of data, but also serves as the core carrier of the business logic of the entire charging station management system.

The following is an introduction to the main businesses used in the database in the project:
Asset management module
Related core tables: stations, charging stations, charging guns, models, regional cities.
Business function
Manage information related to charging stations. For example: geographical location (latitude and longitude), operator ownership, and operational status.
Manage information related to charging stations. For example, hardware parameters, communication protocol (such as OCPP), serial number, and charging gun status.
The benefits of using:
- Structured management: Clearly define the hierarchical relationship of “operator site station gun” through tree or association structure, facilitating permission control.
- Accurate positioning: Supports spatial queries based on latitude and longitude, providing users with a search function for “nearby charging stations”.
User and Membership System
Related core tables: Account Master Table, WeChat Users, Electronic Wallet, User Vehicles.
Business function
Store basic user information, authentication information (OpenID/UnionID), and bound vehicles.
Multi wallet mechanism: supports a user to have independent electronic wallet balances under different operators.
The benefits of using:
- Independent calculation: Implement independent calculation of member wallet related data between different operators.
Trading and Financial Settlement
Related core tables: charging orders, payment records, management fee configuration, and financial statements.
Business function
Order Full Record: Record all data of the payment process from start-up to charging (real-time power/amount) to completion.
The benefits of using:
- Historical traceability: Provide detailed transaction records for resolving user issues and searching.
- Complex report support: By utilizing the basic data of orders, real-time big data analysis such as operational overview can be generated.
Operation and maintenance monitoring and logging
Related core tables:alarms, message logs, and fault records.
Business function
Real time recording of hardware faults reported by charging stations (such as overvoltage, undervoltage, emergency stop).
Store the original communication messages of protocols such as OCPP for technical troubleshooting.
The benefits of using:
- Quick response: Trigger notification system through data changes in the alarm table to improve operation and maintenance efficiency.
- Fault analysis: Evaluate the stability of different types of charging piles through historical fault data analysis.
Marketing and promotional strategies
Related core tables: activities, coupons, user coupon records, and points.
Business function
Manage various marketing activities (recharge rewards, consumption rebates) and the distribution and verification of coupons.
Record the user’s point acquisition and gift redemption.
The benefits of using:
- Flexible Promotion: Supports dynamic adjustment of promotional strategies (such as time of use electricity prices, holiday discounts), and can be launched without modifying the code.
- Enhance stickiness: By using a points and coupon system, effectively increase user retention and recharge rates.
System permissions and configuration
Related core tables: operator, menu, roles, permissions.
Business function
Manage operator accounts and organizational structure under a multi tenant architecture.
Control the functional permissions of the backend management system (RBAC model).
The benefits of using:
- High scalability: Supports the creation of unlimited levels of sub operators to meet complex business franchise models.
- Safe and controllable: Ensure that administrators at different levels can only view and operate data within their authorized scope.

Summary: Advantages of databases
- Data persistence: Ensure that core business data such as charging and money are not lost after server restart or failure.
- Strong transaction consistency: Ensure absolute accuracy of data when handling operations involving amount deductions and balance changes.
- Multidimensional analysis capability: Database indexing and SQL engine make it possible to extract financial summaries from millions of orders in seconds.
- Business logic decoupling: By defining database table structures, complex business rules (such as price templates and distribution ratios) are transformed from hard coded to configurable data.