A dynamic load balancing control system and method for a battery swap cabinet based on digital twinning
By constructing a digital twin and an improved LSTM network, the load of the battery swapping cabinet can be predicted in real time, solving the problems of uneven load and scheduling lag in the existing system, realizing load balancing control, and improving resource utilization and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU DINENG ELECTRONICS CO LTD
- Filing Date
- 2025-10-14
- Publication Date
- 2026-04-17
AI Technical Summary
Existing battery swapping cabinet systems suffer from uneven load distribution, delayed scheduling, extensive operation and maintenance, and isolated decision-making, making it impossible to respond to sudden demands in real time, resulting in poor user experience and low resource utilization.
By using a digital twin-based approach, a high-fidelity digital twin is constructed to collect real-time data on the status and environment of the battery swapping cabinet. An improved LSTM neural network is used for demand forecasting, and combined with dynamic load weight calculation and strategy generation, load balancing control is achieved.
It enables accurate prediction and dynamic scheduling of the load on the battery swapping cabinet, improving resource utilization and user satisfaction, reducing operating costs, and increasing system efficiency.
Smart Images

Figure CN121180041B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of load balancing control technology, and specifically relates to a dynamic load balancing control system and method for battery swapping cabinets based on digital twins. Background Technology
[0002] With the rapid development of the new energy industry, the demand for battery swapping services for shared electric vehicles, drones, and other devices has increased dramatically. As the core infrastructure for providing battery replacement services, battery swapping stations are typically distributed in a network.
[0003] However, existing battery swapping systems have the following significant problems: batteries in swapping cabinets in popular areas are quickly emptied, while batteries in swapping cabinets in less popular areas remain fully charged and idle for extended periods, resulting in a poor user experience (users cannot find charged batteries) and low resource utilization; current scheduling strategies are mostly based on static rules or historical data, which cannot respond to sudden demands in real time (such as morning and evening rush hours or specific events), and scheduling instructions are delayed and inefficient; there is a lack of refined management of battery and cabinet status, making it impossible to predict battery wear and failure, resulting in high maintenance costs; the scheduling strategy only considers the simple status at the current moment (such as battery level) and fails to comprehensively consider multi-dimensional factors such as user behavior prediction, traffic conditions, and battery health.
[0004] Existing technologies suffer from problems such as uneven load distribution, delayed scheduling, extensive operation and maintenance, and isolated decision-making. Summary of the Invention
[0005] (a) Technical problems to be solved
[0006] To address the problems in related technologies, this invention provides a dynamic load balancing control method for battery swapping cabinets based on digital twins, thereby overcoming the aforementioned technical problems existing in the prior art.
[0007] (II) Technical Solution
[0008] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution:
[0009] S1. Based on the full-element data of the battery swapping cabinet and the full-element data of the environment, the digital twin engine is mapped and updated to obtain the mapped and updated digital twin engine;
[0010] S2. Extract historical and real-time battery swapping cabinet feature data from the updated digital twin engine.
[0011] S3. Based on the characteristics of the battery swapping cabinet data, the LSTM neural network is improved to obtain the initial battery swapping prediction network; the initial battery swapping prediction network is trained using historical battery swapping cabinet feature data to obtain the final battery swapping prediction network.
[0012] The real-time battery swapping cabinet feature data is input into the final battery swapping prediction network to obtain the predicted battery swapping data;
[0013] S4. Based on real-time battery swapping cabinet data and predicted battery swapping data, perform load assessment on each battery swapping cabinet to obtain a dynamic load weight set for the battery swapping cabinet.
[0014] S5. Construct a policy space that includes user guidance policies and operation and maintenance scheduling policies; based on the dynamic load weight set of the battery swapping cabinet and the policy space, obtain the initial scheme set;
[0015] S6. Use the updated digital twin engine to simulate and verify the schemes in the initial scheme set to obtain the optimal control strategy.
[0016] This invention constructs a high-fidelity digital twin by collecting real-time data on the status and environment of the battery swapping cabinet and extracting multi-dimensional feature data. It employs an improved attention mechanism LSTM network to fuse spatiotemporal features for demand prediction. Based on the prediction results and real-time data, it calculates dynamic load weights and generates a set of user guidance and operation and maintenance scheduling strategies. Finally, it verifies the output of the optimal control strategy through digital twin simulation. This achieves the effects of accurately predicting demand fluctuations and intelligently generating balancing strategies, while realizing the transformation from passive response to proactive intervention, significantly improving resource utilization, user satisfaction, and system operation efficiency.
[0017] Preferably, step S1 includes the following steps:
[0018] S11. Through IoT gateways and sensors, the status of each battery compartment in various physical battery swapping cabinets throughout the city, the real-time battery charge, battery health, temperature, and the time and location data of user rental / return behavior are collected in real time to obtain full-element data of the battery swapping cabinet.
[0019] S12. Obtain real-time traffic conditions, weather information, and whether there are any large-scale events scheduled at the location of the battery swapping station to obtain comprehensive environmental data.
[0020] S13. Receive all-element data of the battery swapping cabinet and all-element data of the environment, perform buffering and decoupling to obtain decoupled data; clean, filter and fuse the decoupled data to obtain processed battery swapping cabinet data.
[0021] The processed battery swapping cabinet data is sent to the digital twin engine. Based on the cabinet ID and compartment ID in the processed battery swapping cabinet data, the digital twin engine finds the corresponding virtual battery swapping cabinet and virtual battery compartment objects in the virtual space, updates the attribute values of the virtual battery swapping cabinet and virtual battery compartment objects and the relationship between the virtual objects, and obtains the mapped and updated digital twin engine.
[0022] This invention collects real-time data on the physical status of the battery swapping cabinet and its surrounding environment. After being cleaned and fused by a stream processing engine, the data drives a digital twin engine to perform high-fidelity synchronous mapping and updates. This enables real-time interaction and status synchronization between the physical world and the virtual model, providing a real, complete, and timely data foundation for subsequent accurate prediction and decision-making, and effectively supporting the intelligent decision-making closed loop of the entire system.
[0023] Preferably, step S2 includes the following steps:
[0024] S21. Extract historical battery swapping cabinet data and real-time battery swapping cabinet data from the database in the updated digital twin engine. Using a specific geographical area as an analysis unit, align and aggregate all data in the historical battery swapping cabinet data according to the timestamp and region ID to obtain aggregated historical battery swapping cabinet data and aggregated real-time battery swapping cabinet data.
[0025] S22. Process the missing values and outliers in the aggregated historical battery swapping cabinet data and the aggregated real-time battery swapping cabinet data, and perform one-hot encoding on the categorical variables to obtain the processed historical battery swapping cabinet data and the processed real-time battery swapping cabinet data.
[0026] S23. Extract features from the processed historical battery swapping cabinet data and the processed real-time battery swapping cabinet data to obtain historical battery swapping cabinet feature data and real-time battery swapping cabinet feature data.
[0027] This invention extracts high-quality feature data with spatiotemporal attributes by performing regional aggregation, outlier processing, and feature encoding on spatiotemporal data in a digital twin database. This effectively improves the availability and consistency of the data, provides accurate and reliable input for subsequent prediction models, and significantly enhances the accuracy and timeliness of demand forecasting.
[0028] Preferably, step S3 includes the following steps:
[0029] S31. Construct an LSTM neural network; replace the single time prediction sequence of the LSTM neural network with a multi-dimensional feature tensor, add an attention mechanism to the output layer of the LSTM neural network, and obtain the initial battery swapping prediction network.
[0030] S32. Use historical battery swapping cabinet feature data to train the initial battery swapping prediction network. During the training process, combine the optimization algorithm to find the learning rate of the initial battery swapping prediction network and obtain the optimal solution. Use the optimal solution as the learning rate of the initial battery swapping prediction network to obtain the final battery swapping prediction network.
[0031] S33. Input the real-time battery swapping cabinet feature data into the final battery swapping prediction network to obtain the predicted battery swapping data;
[0032] This invention constructs an improved LSTM network that integrates multidimensional feature tensors and attention mechanisms, and trains it by combining intelligent optimization algorithms to determine the optimal learning rate, thereby forming a high-precision prediction model. It significantly improves the model's ability to learn complex spatiotemporal features and its accuracy in predicting sudden demands, achieving a leap from traditional time-series prediction to multi-factor collaborative intelligent prediction, and providing reliable data support for subsequent load balancing.
[0033] Preferably, the step S32, which involves using an optimization algorithm to find the learning rate of the initial battery swapping prediction network during training to obtain the optimal solution, includes the following steps:
[0034] S321. Set the learning rate search space and maximum number of iterations for the initial battery swapping prediction network;
[0035] S322. Construct a particle set and set the size of the particle set; based on the learning rate search space of the initial battery swapping prediction network and the particle set, construct an initial particle position set, and use the position of each particle in the initial particle position set as the learning rate of each different initial battery swapping prediction network.
[0036] S323. Set the prediction accuracy and prediction speed of the initial battery swapping prediction network, and set a fitness function for calculating the fitness of the position of each particle in the particle set according to the prediction accuracy and prediction speed.
[0037] S324. Perform iterative update operations on the particles in the particle set; during each iteration, update the positions of the particles in the initial position set, and calculate the fitness value of the position of each particle in the particle set according to the fitness function. Update the fitness of each particle in the particle set according to the fitness value from high to low, and obtain the best individual particle and the global best particle in the particle set during each iteration.
[0038] S325. Repeat S324. When the maximum number of iterations is reached, stop the iteration and take the global best particle as the optimal solution.
[0039] This invention employs a particle swarm optimization algorithm to adaptively optimize the learning rate of the prediction network. By defining a fitness function that integrates prediction accuracy and speed, it dynamically seeks the global optimal solution in multiple iterations. This breaks through the limitations of traditional manual parameter tuning, achieving a high degree of automation and optimization in the model training process. It significantly improves the convergence speed and generalization ability of the prediction model, providing a key guarantee for obtaining high-precision prediction results.
[0040] Preferably, step S4 includes the following steps:
[0041] S41. Associate the battery swapping cabinet with the area data of the battery swapping cabinet in the predicted battery swapping data to obtain the predicted demand data of the battery swapping cabinet; normalize the predicted demand data of the battery swapping cabinet to obtain the normalized battery swapping cabinet data.
[0042] S42. Based on the operational goals of the battery swapping station, set the weights for battery inventory, predicted demand, battery health and traffic congestion index respectively, and construct a dynamic load weight calculation formula for the battery swapping station.
[0043] Each battery swapping cabinet data in the normalized battery swapping data is input into the battery swapping cabinet dynamic load weight calculation formula to obtain the battery swapping cabinet dynamic load weight set.
[0044] This invention constructs a multi-factor weighted dynamic load assessment model by correlating predicted data with real-time data and performing normalization processing; it realizes a refined and quantitative assessment of the load status of the battery swapping cabinet, providing a scientific basis for accurately identifying high-load and low-load cabinets, and effectively supporting the formulation of subsequent intelligent scheduling strategies.
[0045] Preferably, step S5 includes the following steps:
[0046] S51. Set weight thresholds; designate the weights of the battery swapping cabinets whose dynamic load weights are greater than or equal to the weight threshold as high weights, and designate the weights of the battery swapping cabinets whose dynamic load weights are less than the weight threshold as low weights.
[0047] Based on the weight threshold, the dynamic load weight of the battery swapping cabinets is identified, and the cabinet clusters with high weight and low weight are concentrated to obtain the set of high-weight battery swapping cabinets and the set of low-weight battery swapping cabinets.
[0048] S52. Construct a strategy space that includes user guidance strategies and operation and maintenance scheduling strategies; generate an initial solution set based on the high-weight battery swapping cabinet set, the low-weight battery swapping cabinet set, and the strategy space;
[0049] This invention intelligently identifies high / low load cabinet clusters by setting weight thresholds and constructs an initial scheme set by building a dual strategy space that includes user guidance and operation and maintenance scheduling. It realizes intelligent connection from load assessment to strategy generation, provides rich strategy options for subsequent simulation optimization, and effectively improves the system's response capability and decision-making efficiency in the face of uneven load.
[0050] Preferably, step S52 includes the following steps:
[0051] S521. Construct a user guidance strategy formula based on the dynamic load weight difference of the battery swapping cabinet, distance, and historical user price sensitivity.
[0052] For each pair of source and target cabinets, based on the weight difference, distance, and historical user price sensitivity of each pair of source and target cabinets, an initial user strategy scheme set is obtained through the user guidance strategy formula;
[0053] S522. Treat high-weight cabinets as points that need replenishment and low-weight cabinets as points that need to be picked up. Combine real-time traffic data to plan different pick-up, delivery and driving route schemes for maintenance vehicles and obtain an initial maintenance scheduling strategy scheme set.
[0054] The initial user policy scheme and the initial operation and maintenance scheduling policy scheme set together constitute the initial scheme set;
[0055] This invention generates a comprehensive solution that includes economic incentives and physical scheduling by constructing a user guidance strategy based on multi-factor dynamic pricing and an intelligent route planning strategy based on real-time traffic. It achieves the synergistic cooperation between "soft guidance" and "hard scheduling", effectively expands the means and scope of load balancing, and provides a diversified strategy selection basis for subsequent simulation optimization.
[0056] Preferably, step S6 includes the following steps:
[0057] S61. In the updated digital twin engine, through user behavior simulation and maintenance vehicle simulation, each strategy in the initial solution set is simulated and deduced to obtain a simulation result record set.
[0058] S62. Set evaluation indicators and obtain the optimal control strategy based on the evaluation indicators and the simulation result record set;
[0059] This invention performs multi-dimensional simulation and deduction of various strategies in a digital twin engine, and intelligently selects the optimal control strategy based on comprehensive evaluation indicators; it realizes full-process virtual verification before decision-making, which significantly reduces the cost of trial and error while ensuring the scientificity and reliability of the final execution strategy.
[0060] A dynamic load balancing control system for battery swapping cabinets based on digital twins is used to implement the aforementioned dynamic load balancing control method for battery swapping cabinets based on digital twins. The system includes a data acquisition and digital twin update module, a feature extraction and processing module, a demand prediction module, a load assessment module, a strategy generation module, and a simulation verification and decision-making module.
[0061] The data acquisition and digital twin update module collects detailed status data and user behavior data of the physical battery swapping cabinet in real time through IoT gateways and sensors, and obtains environmental data through third-party API interfaces. After the collected data is cleaned, filtered and fused by message queue buffer and stream processing engine, it is used to update the virtual objects in the digital twin engine to ensure that the state, attributes and relationships of the virtual model are highly consistent with the physical world, providing an accurate digital twin foundation for subsequent analysis.
[0062] The feature extraction and processing module is used to extract historical and real-time battery swapping cabinet data from the updated digital twin engine, aggregate the data by geographical region, process missing and outlier values in the data, and encode categorical variables; it derives key features from the processed data, including historical order volume, time features, environmental factors, and event markers, forming historical battery swapping cabinet feature data and real-time battery swapping cabinet feature data, providing standardized and structured input for the demand forecasting module;
[0063] The demand forecasting module is based on an improved LSTM neural network. By introducing multi-dimensional feature tensors and attention mechanisms, it enhances the model's ability to perceive historical patterns and sudden events. The network is trained using historical feature data, and an optimization algorithm is used to find the optimal learning rate to obtain the final prediction network. Real-time feature data is input into the network to predict future battery swapping demand, and a prediction data matrix covering the entire city's grid is output to provide forward-looking input for load assessment.
[0064] The load assessment module associates real-time battery swapping cabinet data with predicted data, normalizes battery inventory, predicted demand, battery health, and traffic congestion index, and sets weights for each indicator based on operational goals. Through a dynamic load weight calculation formula, it assesses the load of each battery swapping cabinet, generates a dynamic load weight set for the battery swapping cabinet, identifies high-weight and low-weight battery swapping cabinet clusters, and provides data support for strategy generation.
[0065] The strategy generation module constructs a strategy space containing user guidance strategies and operation and maintenance scheduling strategies based on the load weight set. The user guidance strategy generates a price scheme through an incentive formula, and the operation and maintenance scheduling strategy generates a path scheme through a genetic algorithm. These strategies together form an initial scheme set, including a variety of user guidance and operation and maintenance scheduling options, providing a basis for simulation verification.
[0066] The simulation verification and decision-making module uses a digital twin engine to simulate and extrapolate the strategies in the initial scheme set, simulating user behavior and the movement of maintenance vehicles, and calculating indicators such as global load balancing, scheduling cost, user satisfaction rate, and battery turnover rate. The simulation results of each scheme are evaluated through weighted scoring, and the strategy with the highest comprehensive score is selected as the optimal control strategy. The operation and maintenance scheduling part is then distributed to the operation and maintenance personnel for execution, achieving efficient and cost-optimized load balancing.
[0067] (III) Beneficial Effects
[0068] The present invention has the following beneficial effects:
[0069] This invention achieves comprehensive, accurate, and three-dimensional perception of the status of the entire battery swapping cabinet and the external environment by constructing a digital twin engine that is synchronized with the physical world in real time. It overcomes the defects of fragmented status perception and isolated information in existing systems, and provides a high-quality data foundation for subsequent accurate prediction and decision-making, realizing a leap from "invisible and intangible" to "full-element and full-link" visualization.
[0070] This invention incorporates multi-source external features and introduces an attention mechanism into the LSTM prediction model, enabling it not only to learn historical demand patterns but also to keenly perceive and predict demand fluctuations caused by sudden events. This forward-looking predictive capability transforms load balancing decisions from a passive "post-event response" to an active "pre-event intervention," fundamentally solving the problem of scheduling lag.
[0071] The dynamic load weight calculation model proposed in this invention integrates multiple factors such as real-time inventory, predicted demand, battery health, and traffic accessibility, and allows for flexible adjustment of weights according to operational objectives. This enables a refined and quantitative assessment of the load status of each battery swapping station, avoiding the one-sidedness of single-indicator decision-making. It allows the system to accurately identify the real "hot spots" and "cold spots," providing a scientific basis for formulating efficient load balancing strategies.
[0072] This invention constructs a dual strategy space that includes user pricing guidance and maintenance vehicle scheduling. The user guidance strategy incentivizes users to participate in shared regulation through intelligent pricing, achieving "invisible scheduling" of batteries at extremely low marginal costs. The maintenance scheduling strategy utilizes optimization algorithms to generate cost-optimized path planning. This combination of "soft guidance" and "hard scheduling" expands the solution space and achieves the best balance between cost and benefit.
[0073] This invention uses a digital twin engine for simulation and deduction, which verifies the combined effect of all possible strategies in a virtual space at low cost and high efficiency, and selects the optimal solution for execution. This reduces the cost of trial and error, ensures the scientific nature and reliability of each scheduling decision, and ultimately achieves the core objectives of improving user experience, reducing operating costs, and optimizing resource utilization.
[0074] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0075] To more clearly illustrate the technical solutions of the embodiments of the invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For those skilled in the art, the drawings can be obtained from these drawings without creative effort.
[0076] Figure 1 This is a flowchart illustrating a dynamic load balancing control method for a battery swapping cabinet based on digital twins according to the present invention.
[0077] Figure 2 This is a schematic diagram of a module of a dynamic load balancing control system for a battery swapping cabinet based on digital twins according to the present invention. Detailed Implementation
[0078] The technical solutions of the embodiments of the invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the invention, and not all embodiments. Based on the embodiments of the invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the invention.
[0079] In the description of this invention, it should be understood that the terms "opening", "upper", "lower", "top", "middle", "inner", etc., which indicate orientation or positional relationship, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on the invention.
[0080] Example 1:
[0081] Please see Figure 1 This invention discloses a dynamic load balancing control method for battery swapping cabinets based on digital twins, comprising the following steps:
[0082] S1. Based on the full-element data of the battery swapping cabinet and the full-element data of the environment, the digital twin engine is mapped and updated to obtain the mapped and updated digital twin engine;
[0083] S1 includes the following steps:
[0084] S11. Through IoT gateways and sensors, the status (empty / full), real-time battery charge (SOC), battery health (SOH), temperature, and time and location data of user rental / return behavior of each battery compartment in various physical battery swapping cabinets throughout the city are collected in real time to obtain full-element data of the battery swapping cabinet.
[0085] The comprehensive data of the battery swapping cabinet includes a basic cabinet status data list, a compartment-level detailed data list, and user behavior log data. The basic cabinet status data list is an array containing the latest status of all online battery swapping cabinets, including cabinet ID, communication status (online / offline), timestamp, and geographical location (GPS coordinates). The compartment-level detailed data list provides detailed status of all battery compartments corresponding to each cabinet ID, including compartment ID, compartment status (empty / full / faulty), battery ID, battery charge (SOC) value (%), battery health (SOH) value (%), and battery temperature (°C). The user behavior log data consists of real-time user operation records, including order ID, user ID, operation type (rental / return), operation time, cabinet ID, compartment ID, battery ID, and operation result (success / failure).
[0086] S12. Obtain real-time traffic conditions, weather information, and whether there are any large-scale events (such as sports events or concerts) at the location of the battery swapping station through third-party API interfaces to obtain comprehensive environmental data. The scheduler uses the comprehensive environmental data to plan which third-party service APIs need to be called based on the geographical location information of the battery swapping station. The data acquisition microservice concurrently sends requests to APIs such as Gaode Map / Baidu Map, Meteorological Bureau, and event ticketing platform, with the request parameters carrying the GPS coordinates or area code of the target battery swapping station. Receive JSON / XML format data returned by the third parties, parse and extract key information, and convert it into a standard data format defined internally by the system.
[0087] The comprehensive environmental data includes lists of traffic status data, meteorological data, and surrounding event data. The traffic status data list provides real-time road conditions around each battery swapping station, including the station ID, road name, congestion index (0-10), estimated travel speed (km / h), and update time. The meteorological data list includes the current weather conditions for each battery swapping station, including the station ID, weather condition (sunny / rainy / ...), temperature (°C), precipitation (mm), wind speed (m / s), and update time. The surrounding event data list lists large-scale events planned for the area around the battery swapping stations in the near future, including event ID, event name (e.g., XX Concert), event location, event start time, event end time, estimated number of people affected, and multiple associated station IDs.
[0088] S13. Receive full-element data of the battery swapping cabinet and full-element data of the environment through message queues (such as Kafka, RabbitMQ), buffer and decouple them to obtain decoupled data; use stream processing engines (such as Flink, Spark Streaming) to clean (remove outliers, fill missing values), filter and fuse the decoupled data to obtain processed battery swapping cabinet data; for example, associate a user return behavior data with the corresponding warehouse ID status update data;
[0089] The processed battery swapping cabinet data is sent to the digital twin engine. Based on the cabinet ID and compartment ID in the processed battery swapping cabinet data, the digital twin engine finds the corresponding virtual battery swapping cabinet and virtual battery compartment objects in the virtual space, updates the attribute values of the virtual battery swapping cabinet and virtual battery compartment objects and the relationship between the virtual objects, and obtains the mapped and updated digital twin engine. For example, updating the attribute values of the virtual battery swapping cabinet and virtual battery compartment objects can be done by updating the SOC attribute of the virtual battery from 70% to 65% (simulating self-discharge), or immediately updating the compartment status from "empty" to "full" after the user returns the battery.
[0090] For example, when a battery is borrowed by a user from cabinet A, the system will remove the "belonging" relationship between the virtual battery and the virtual storage space of cabinet A, and establish the "belonging" relationship with cabinet B when the battery is returned to cabinet B.
[0091] The digital twin engine is a cluster of virtual models stored in a digital twin platform that corresponds one-to-one with the physical world. The status (location, power, health, temperature) of each virtual battery swapping station and each virtual battery in this virtual world, as well as their relationship with the external environment (traffic, weather), are highly consistent with the physical world. The digital twin engine is not a simple database record, but a complex collection of objects containing geometric models (3D appearance), physical models (battery degradation laws), and behavioral rules (rental process), which can be used for subsequent in-depth analysis, simulation, and extrapolation.
[0092] S2. Extract historical and real-time battery swapping cabinet feature data from the updated digital twin engine.
[0093] S2 includes the following steps:
[0094] S21. Extract historical and real-time battery swapping cabinet data from the database in the updated digital twin engine. Using a specific geographical area (such as a 1km×1km grid) as an analysis unit, align and aggregate all data in the historical battery swapping cabinet data according to timestamp and region ID to obtain aggregated historical and real-time battery swapping cabinet data. The battery swapping cabinet data includes historical battery swapping cabinet full-element data and historical environmental full-element data.
[0095] S22. Process missing values and outliers (such as SOC values exceeding 100%) in the aggregated historical battery swapping cabinet data and aggregated real-time battery swapping cabinet data, and perform one-hot encoding on categorical variables (such as weather conditions) to obtain the processed historical battery swapping cabinet data and processed real-time battery swapping cabinet data.
[0096] S23. Extract features from the processed historical battery swapping cabinet data and the processed real-time battery swapping cabinet data to obtain historical battery swapping cabinet feature data and real-time battery swapping cabinet feature data. The battery swapping cabinet feature data includes the order volume of the previous hour, the order volume of the same period yesterday, and the order volume of the same period last week derived from historical order data; extract whether it is a weekend, the time period (hour) of the day, and whether it is a holiday from the timestamp; extract whether it is a rainy day and the traffic congestion level from the environmental data; and create a Boolean flag for N hours before / after the start of the activity from the event data.
[0097] S3. Based on the characteristics of the battery swapping cabinet data, the LSTM neural network is improved to obtain the initial battery swapping prediction network; the initial battery swapping prediction network is trained using historical battery swapping cabinet feature data to obtain the final battery swapping prediction network.
[0098] The real-time battery swapping cabinet feature data is input into the final battery swapping prediction network to obtain the predicted battery swapping data;
[0099] S3 includes the following steps:
[0100] S31. Construct an LSTM neural network; replace the single-time prediction sequence of the LSTM neural network with a multi-dimensional feature tensor. This multi-dimensional feature tensor not only contains the time series of historical demand but also simultaneously embeds encoded real-time environmental information (such as weather conditions and traffic congestion index) and future event labels (such as whether there are large-scale events). This allows the model to not only learn historical patterns but also directly perceive external factors that will affect demand during inference, achieving the ability to predict unexpected events.
[0101] An attention mechanism is added to the output layer of an LSTM neural network to obtain the initial battery swapping prediction network. This attention mechanism allows the model to dynamically assign different weights to different historical time steps and different input features when making predictions. For example, when predicting demand on weekend nights, the model automatically pays more attention to historical weekend data from the same period, while weakening the influence of weekday data; when predicting rainy days, it places greater emphasis on the feature of "precipitation." This improvement greatly enhances the model's feature utilization efficiency and prediction accuracy, enabling it to move beyond mechanically learning time series data and instead "think" about the importance of different factors like a human expert, thus making more accurate and reliable predictions.
[0102] The structure of the initial battery swapping prediction network can be seen in Table 1 below:
[0103] Table 1
[0104] Model Name Model type Model Structure Initial battery swapping prediction network Multilayer LSTM Network with Enhanced Attention Mechanism 1. Input Embedding and Multi-Source Data Fusion Layer: Historical Demand Sequence Embedding: The historical order volume of the region over the past N time steps is normalized and input into the fully connected layer to generate a 128-dimensional vector; Time Feature Embedding: Timestamp-derived features (hour, day of the week, whether it is a holiday) are mapped to a 32-dimensional space using Learning Embedding; External Feature Concatenation: Real-time external multi-source data (traffic congestion index, weather conditions (One-hot encoding), large-scale event indicators) are directly concatenated into a fixed-dimensional vector; Fusion Fully Connected Layer: After concatenating all the above feature vectors, a fully connected layer is used for dimensionality reduction and fusion, outputting a 256-dimensional fused feature vector, which serves as the final input to the LSTM. 2. Core Prediction Module (Multi-layer LSTM + Attention): Stacked LSTM Encoder: A 3-layer stacked LSTM structure, with each layer having a hidden state dimension of 256, used to deeply capture complex long-term and short-term time dependencies (such as daily and weekly cycles) in the demand sequence; Multi-head Spatiotemporal Attention Mechanism: A multi-head attention mechanism (8 attention heads) is introduced into the output sequence of the final LSTM layer, enabling the model to dynamically and selectively focus on the importance of different historical time steps (such as "same period last week" or "the start time of sudden demand") for future prediction, and quantify the influence weights of different external features (such as "traffic" or "weather"), greatly improving the ability to interpret and predict sudden fluctuations. 3. Feature Decoding and Output Layer: Attention Context Vector: The output of the multi-head attention is aggregated into a comprehensive context vector, representing the most critical historical information used for prediction; Fully Connected Output Layer: The context vector is decoded through a fully connected network (128-dimensional, ReLU activation function), and finally a linear output layer is used to generate the regional demand prediction value for the next time step. 4. Key parameters and training configuration: Optimizer: Adam (initial learning rate 1e-3, dynamically adjusted using ReduceLROnPlateau); Regularization: inter-layer Dropout (ratio 0.2) to suppress overfitting; Batch processing: batch size 64;
[0105] This model represents a substantial improvement over the standard LSTM. Through a multimodal data fusion architecture and an integrated attention mechanism, it upgrades the model from a simple time series forecasting model into a decision-making tool capable of understanding complex spatiotemporal relationships. It effectively integrates multidimensional features such as demand time series, time attributes, traffic, weather, and events, achieving a three-dimensional description of the forecast target. The model not only makes predictions but also uses attention weights to show which historical moments and external factors dominated the forecast results, enhancing the model's interpretability. It excels at capturing spatiotemporal demand diffusion patterns triggered by urban activities (such as morning and evening rush hours and the end of large events), providing high-precision forward-looking input for subsequent load balancing calculations.
[0106] S32. Use historical battery swapping cabinet feature data to train the initial battery swapping prediction network. During the training process, combine the optimization algorithm to find the learning rate of the initial battery swapping prediction network and obtain the optimal solution. Use the optimal solution as the learning rate of the initial battery swapping prediction network to obtain the final battery swapping prediction network.
[0107] The training process in S32, which combines optimization algorithms to find the learning rate of the initial battery swapping prediction network and obtain the optimal solution, includes the following steps:
[0108] S321. Set the learning rate search space and maximum number of iterations for the initial battery swapping prediction network;
[0109] S322. Construct a particle set, and set the size of the particle set to... m The particle set is then represented as: in, q i Represents the first in the set of particles One particle; based on the learning rate search space and particle set of the initial battery swapping prediction network, an initial particle position set is constructed. ,in, j i Represents the first particle in the set of particles i The initial position of each particle is used as the learning rate of each different initial battery swapping prediction network.
[0110] S323. Set the prediction accuracy of the initial battery swapping prediction network to . p Prediction speed is q Based on prediction accuracy p and prediction speed q Define a fitness function for calculating the fitness of the position of each particle in the particle ensemble. f The calculation formula is as follows:
[0111] ;
[0112] S324. Perform iterative update operations on the particles in the particle set; in each iteration, update the positions of the particles in the initial position set, each iteration update is obtained by random movement of the particles, and each movement update is within the learning rate search space of the initial battery swapping prediction network; and calculate the fitness value of the position of each particle in the particle set according to the fitness function, update the fitness of each particle in the particle set according to the fitness value from high to low, and obtain the best individual particle and the global best particle in the particle set in each iteration; the best individual particle is the particle with the highest position fitness value in each iteration, and the global best particle is the particle with the highest position fitness value in all iterations.
[0113] S325. Repeat S324. When the maximum number of iterations is reached, stop the iteration and take the global best particle as the optimal solution.
[0114] S33. Input the real-time battery swapping cabinet feature data into the final battery swapping prediction network to obtain predicted battery swapping data; the predicted battery swapping data is a matrix covering the entire city's grid with predicted values; the matrix with predicted values is in the following format: [prediction timestamp, (region 1 ID, predicted demand value), (region 2 ID, predicted demand value), ...];
[0115] S4. Based on real-time battery swapping cabinet data and predicted battery swapping data, perform load assessment on each battery swapping cabinet to obtain a dynamic load weight set for the battery swapping cabinet.
[0116] S4 includes the following steps:
[0117] S41. Associate the battery swapping cabinet with the area data of the battery swapping cabinet in the predicted battery swapping data to obtain the predicted demand data of the battery swapping cabinet; normalize the predicted demand data of the battery swapping cabinet to obtain the normalized battery swapping cabinet data; current battery inventory = (current number of fully charged batteries) / (total number of cabinet compartments) -> normalized to [0,1]; the predicted demand uses the maximum and minimum value method to normalize the predicted value; the average battery health directly uses the percentage value (0-1); the traffic congestion index is directly normalized to [0,1];
[0118] S42. Based on the operational goals of the battery swapping station, the weights for battery inventory, predicted demand, battery health, and traffic congestion index are respectively set as follows: α , β , γ , δ ( α , β , γ , δ These are adjustable weighting coefficients, the magnitude of which represents the company's emphasis on different operational objectives (e.g., the coefficient for β (forecasted demand) is usually the largest because it is the most forward-looking), and a dynamic load weighting calculation formula for the battery swapping cabinet is constructed; the dynamic load weighting calculation formula for the battery swapping cabinet is as follows.
[0119] ;
[0120] in, WL This indicates the dynamic load weight of the battery swapping cabinet. b 1. b 2. b 3 and b 4 represent the battery inventory, predicted demand, battery health, and traffic congestion index data in the normalized battery swapping cabinet data; (1 - b 1) and (1 - b 3) is used because the fewer the battery swapping cabinets there are and the worse the battery health, the higher the load weight should be.
[0121] Each battery swapping cabinet data in the normalized battery swapping data is input into the battery swapping cabinet dynamic load weight calculation formula to obtain the battery swapping cabinet dynamic load weight set; the battery swapping cabinet dynamic load weight set is as follows: [timestamp, (cabinet AID, weight value 0.87), (cabinet BID, weight value 0.45), (cabinet CID, weight value 0.92), ...];
[0122] S5. Construct a policy space that includes user guidance policies and operation and maintenance scheduling policies; based on the dynamic load weight set of the battery swapping cabinet and the policy space, obtain the initial scheme set;
[0123] S5 includes the following steps:
[0124] S51. Set weight thresholds; designate the weights of the battery swapping cabinets whose dynamic load weights are greater than or equal to the weight threshold as high weights, and designate the weights of the battery swapping cabinets whose dynamic load weights are less than the weight threshold as low weights.
[0125] Based on the weight threshold, the dynamic load weight of the battery swapping cabinets is identified into high-weight (batteries urgently needed) and low-weight (batteries surplus) cabinet clusters, thus obtaining the high-weight battery swapping cabinet set and the low-weight battery swapping cabinet set.
[0126] S52. Construct a strategy space that includes user guidance strategies and operation and maintenance scheduling strategies; generate an initial solution set based on the high-weight battery swapping cabinet set, the low-weight battery swapping cabinet set, and the strategy space;
[0127] S52 includes the following steps:
[0128] S521. Construct a user guidance strategy formula based on the dynamic load weight difference of the battery swapping cabinet, distance, and historical user price sensitivity; the user guidance strategy formula is as follows.
[0129] ;
[0130] in, Y Indicates the amount of the incentive; k This represents the global adjustment coefficient, a constant set by the operator to control the strength and cost of the entire incentive strategy; it can be increased during peak periods. k The value can be adjusted to increase incentives and quickly balance the load; it can be lowered during off-peak periods or when the budget is tight. k Value to reduce spending; C WL This represents the difference in dynamic load weight between two battery swapping cabinets. d Indicates distance; v This represents the historical price sensitivity coefficient, a value learned or estimated from historical data. It reflects the average responsiveness of users in a given area to price incentives. For example, if historical data shows that users in a certain commercial area have a high response rate to a 5 yuan reward, then the average price sensitivity coefficient for that area is likely to be high. v The value can be set to >1 to amplify the incentive effect; conversely, for regions that are not price-sensitive, v The value can be set to <1; it can be set to 1 in the initial stage, and then iterated as data accumulates.
[0131] For each pair of source cabinets (low weight, many batteries) and target cabinets (high weight, few batteries), based on the weight difference, distance, and historical user price sensitivity of each pair of source and target cabinets, an initial user strategy set is obtained through a user guidance strategy formula; for example, strategy A: return reward of +8 yuan for target cabinet, rental discount of -3 yuan for source cabinet; strategy B: return reward of +5 yuan for target cabinet, rental discount of -5 yuan for source cabinet.
[0132] S522. Treat high-weight cabinets as points requiring replenishment and low-weight cabinets as points requiring pickup. Combine real-time traffic data to plan different pickup, delivery, and driving route schemes for maintenance vehicles, resulting in an initial set of maintenance scheduling strategy schemes. For example, strategy P instructs the maintenance vehicle to pick up 10 batteries from cabinets 1 and 2 and deliver them to cabinets 11 and 12, with the path being Path1; strategy Q instructs the maintenance vehicle to pick up 10 batteries from cabinets 1 and 3 and deliver them to cabinets 11 and 13, with the path being Path2.
[0133] The S522 can obtain an initial set of operation and maintenance scheduling strategies through a genetic algorithm. Specifically, the operation and maintenance path planning problem is transformed into a form that can be handled by a genetic algorithm. Real number encoding is used, and each chromosome (individual) represents a complete path sequence. The gene represents the battery swapping cabinet number (positive numbers indicate picking up goods from the cabinet, and negative numbers indicate delivering goods to the cabinet). An initial chromosome population containing a large number of individuals is randomly generated, and each individual represents a randomly generated path scheme.
[0134] The merits of different path solutions are comprehensively evaluated using a second fitness function, which is constructed based on total travel distance (converted to time cost using real-time traffic data), task completion rate (whether all pickup and delivery needs are met), and load balancing efficiency (prioritizing high-weight cabinets). A roulette wheel selection algorithm is used, where individuals with higher fitness have a greater probability of being selected and passed on to the next generation. Selected individuals undergo sequential crossover, exchanging some path segments to generate new solutions. Subsequently, individuals undergo mutation with a certain probability, such as randomly swapping two gene positions or reversing a path sequence, introducing randomness to avoid the algorithm getting trapped in local optima. The selection, crossover, and mutation operations are repeated until a preset number of iterations is reached or the fitness converges. After the algorithm ends, the individual with the highest fitness is selected from the last generation of the population. K Each individual, after decoding, yields... K There are several different optimization path schemes;
[0135] The initial user policy scheme and the initial operation and maintenance scheduling policy scheme set together constitute the initial scheme set;
[0136] S6. Use the updated digital twin engine to simulate and verify the schemes in the initial scheme set to obtain the optimal control strategy.
[0137] S6 includes the following steps:
[0138] S61. In the updated digital twin engine, through user behavior simulation and maintenance vehicle simulation, each strategy in the initial solution set is simulated and deduced, and the state change of the entire network in the future period after the execution of the strategy is quickly calculated to obtain the simulation result record set.
[0139] User behavior simulation uses a user behavior model fitted based on historical data to simulate user appearance, rental, and return decisions. User decisions are influenced by pricing strategies in the simulation environment (e.g., higher return rewards increase the probability of users returning batteries to the locker). Maintenance vehicle simulation simulates the time spent by vehicles moving along designated paths and loading / unloading batteries in a simulation environment based on maintenance scheduling strategies (affected by simulated traffic flow). The simulation result record set shows how all simulated behaviors change the status of the virtual battery swapping lockers in the simulation environment in real time (number of batteries, number of orders, etc.), as well as global load balancing, total scheduling cost, user demand satisfaction rate, and battery turnover rate.
[0140] S62. Set evaluation indicators (global load balancing, total scheduling cost, user demand satisfaction rate, battery turnover rate), and obtain the optimal control strategy based on the evaluation indicators and simulation result record set;
[0141] Specifically, S62 assigns weights to global load balancing, total scheduling cost, user demand satisfaction rate, and battery turnover rate, and performs a weighted summation of global load balancing, the reciprocal of total scheduling cost, user demand satisfaction rate, and battery turnover rate to obtain a comprehensive score for each simulation in the result record set; the strategy corresponding to the simulation result with the highest comprehensive score is taken as the optimal control strategy.
[0142] S63. Distribute the part of the optimal control strategy related to operation and maintenance scheduling (including the counters that need to be replenished, the list of recycled batteries, and the optimal route planning) to the mobile terminals (such as mobile phones or vehicle systems) of operation and maintenance personnel to guide them to carry out efficient offline physical scheduling.
[0143] Taking the battery swapping cabinet network of a certain city as an example,
[0144] A locker F near the stadium is expected to see a surge in demand for returns after the concert (based on event information), while nearby lockers H and G have sufficient power.
[0145] The digital twin predicted through a forecasting engine that cabinet F would soon be filled with fully charged batteries, while the batteries in cabinets H and G would be borrowed, resulting in a severe imbalance in regional load.
[0146] The simulation engine began calculations: Option 1, dispatch a maintenance vehicle to retrieve batteries from cabinet F and deliver them to cabinets H and G; Option 2, incentivize some users to return batteries directly to cabinets H and G through price incentives. The simulation found that Option 2 was lower in cost and faster.
[0147] Fifteen minutes before the concert ended, a message was pushed to the app of users who were about to return batteries to cabinet F: "Hello, we have detected that you can receive an extra 5 yuan reward for returning batteries to cabinet H on XX Road near your current location. Please navigate there."
[0148] Some users were successfully redirected to cabinets H and G, effectively avoiding congestion in cabinet F and resource idleness in cabinets H / G, thus achieving early load balancing.
[0149] Example 2:
[0150] Please see Figure 2 A dynamic load balancing control system for battery swapping cabinets based on digital twins is used to implement the aforementioned dynamic load balancing control method for battery swapping cabinets based on digital twins. The system includes a data acquisition and digital twin update module, a feature extraction and processing module, a demand prediction module, a load assessment module, a strategy generation module, and a simulation verification and decision-making module.
[0151] The data acquisition and digital twin update module collects detailed status data and user behavior data of the physical battery swapping cabinet in real time through IoT gateways and sensors, and obtains environmental data through third-party API interfaces. After the collected data is cleaned, filtered and fused by message queue buffer and stream processing engine, it is used to update the virtual objects in the digital twin engine to ensure that the state, attributes and relationships of the virtual model are highly consistent with the physical world, providing an accurate digital twin foundation for subsequent analysis.
[0152] The feature extraction and processing module is used to extract historical and real-time battery swapping cabinet data from the updated digital twin engine, aggregate the data by geographical region, process missing and outlier values in the data, and encode categorical variables; it derives key features from the processed data, including historical order volume, time features, environmental factors, and event markers, forming historical battery swapping cabinet feature data and real-time battery swapping cabinet feature data, providing standardized and structured input for the demand forecasting module;
[0153] The demand forecasting module is based on an improved LSTM neural network. By introducing multi-dimensional feature tensors and attention mechanisms, it enhances the model's ability to perceive historical patterns and sudden events. The network is trained using historical feature data, and an optimization algorithm is used to find the optimal learning rate to obtain the final prediction network. Real-time feature data is input into the network to predict future battery swapping demand, and a prediction data matrix covering the entire city's grid is output to provide forward-looking input for load assessment.
[0154] The load assessment module associates real-time battery swapping cabinet data with predicted data, normalizes battery inventory, predicted demand, battery health, and traffic congestion index, and sets weights for each indicator based on operational goals. Through a dynamic load weight calculation formula, it assesses the load of each battery swapping cabinet, generates a dynamic load weight set for the battery swapping cabinet, identifies high-weight and low-weight battery swapping cabinet clusters, and provides data support for strategy generation.
[0155] The strategy generation module constructs a strategy space containing user guidance strategies and operation and maintenance scheduling strategies based on the load weight set. The user guidance strategy generates a price scheme through an incentive formula, and the operation and maintenance scheduling strategy generates a path scheme through a genetic algorithm. These strategies together form an initial scheme set, including a variety of user guidance and operation and maintenance scheduling options, providing a basis for simulation verification.
[0156] The simulation verification and decision-making module uses a digital twin engine to simulate and extrapolate the strategies in the initial scheme set, simulating user behavior and the movement of maintenance vehicles, and calculating indicators such as global load balancing, scheduling cost, user satisfaction rate, and battery turnover rate. The simulation results of each scheme are evaluated through weighted scoring, and the strategy with the highest comprehensive score is selected as the optimal control strategy. The operation and maintenance scheduling part is then distributed to the operation and maintenance personnel for execution, achieving efficient and cost-optimized load balancing.
[0157] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0158] The preferred embodiments of the invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention.
Claims
1. A digital twin-based dynamic load balancing control method for a battery swap cabinet, characterized by, Includes the following steps: S1. Based on the full-element data of the battery swapping cabinet and the full-element data of the environment, the digital twin engine is mapped and updated to obtain the mapped and updated digital twin engine; S2. Extract historical and real-time battery swapping cabinet feature data from the updated digital twin engine. S3. Based on the characteristics of the battery swapping cabinet data, the LSTM neural network is improved to obtain the initial battery swapping prediction network; the initial battery swapping prediction network is trained using historical battery swapping cabinet feature data to obtain the final battery swapping prediction network. The real-time battery swapping cabinet feature data is input into the final battery swapping prediction network to obtain the predicted battery swapping data; S4. Based on real-time battery swapping cabinet data and predicted battery swapping data, perform load assessment on each battery swapping cabinet to obtain a dynamic load weight set for the battery swapping cabinet. S4 includes the following steps: S41. Associate the battery swapping cabinet with the area data of the battery swapping cabinet in the predicted battery swapping data to obtain the predicted demand data of the battery swapping cabinet; normalize the predicted demand data of the battery swapping cabinet to obtain the normalized battery swapping cabinet data. S42. Based on the operational goals of the battery swapping station, set the weights for battery inventory, predicted demand, battery health and traffic congestion index respectively, and construct a dynamic load weight calculation formula for the battery swapping station. Each battery swapping cabinet data in the normalized battery swapping data is input into the battery swapping cabinet dynamic load weight calculation formula to obtain the battery swapping cabinet dynamic load weight set. S5. Construct a policy space that includes user guidance policies and operation and maintenance scheduling policies; based on the dynamic load weight set of the battery swapping cabinet and the policy space, obtain the initial scheme set; S5 includes the following steps: S51. Set weight thresholds; designate the weights of the battery swapping cabinets whose dynamic load weights are greater than or equal to the weight threshold as high weights, and designate the weights of the battery swapping cabinets whose dynamic load weights are less than the weight threshold as low weights. Based on the weight threshold, the dynamic load weight of the battery swapping cabinets is identified, and the cabinet clusters with high weight and low weight are concentrated to obtain the set of high-weight battery swapping cabinets and the set of low-weight battery swapping cabinets. S52. Construct a strategy space that includes user guidance strategies and operation and maintenance scheduling strategies; generate an initial solution set based on the high-weight battery swapping cabinet set, the low-weight battery swapping cabinet set, and the strategy space; S52 includes the following steps: S521. Construct a user guidance strategy formula based on the dynamic load weight difference of the battery swapping cabinet, distance, and historical user price sensitivity. For each pair of source and target cabinets, based on the weight difference, distance, and historical user price sensitivity of each pair of source and target cabinets, an initial user strategy scheme set is obtained through the user guidance strategy formula; S522. Treat high-weight cabinets as points that need replenishment and low-weight cabinets as points that need to be picked up. Combine real-time traffic data to plan different pick-up, delivery and driving route schemes for maintenance vehicles and obtain an initial maintenance scheduling strategy scheme set. The initial user policy scheme and the initial operation and maintenance scheduling policy scheme set together constitute the initial scheme set; S6. Use the updated digital twin engine to simulate and verify the schemes in the initial scheme set to obtain the optimal control strategy.
2. The dynamic load balancing control method for a battery swapping cabinet based on digital twins according to claim 1, characterized in that, S1 includes the following steps: S11. Through IoT gateways and sensors, the status of each battery compartment in various physical battery swapping cabinets throughout the city, the real-time battery charge, battery health, temperature, and the time and location data of user rental / return behavior are collected in real time to obtain full-element data of the battery swapping cabinet. S12. Obtain real-time traffic conditions, weather information, and whether there are any large-scale events scheduled at the location of the battery swapping station to obtain comprehensive environmental data. S13. Receive all-element data of the battery swapping cabinet and all-element data of the environment, perform buffering and decoupling to obtain decoupled data; clean, filter and fuse the decoupled data to obtain processed battery swapping cabinet data. The processed battery swapping cabinet data is sent to the digital twin engine. Based on the cabinet ID and compartment ID in the processed battery swapping cabinet data, the digital twin engine finds the corresponding virtual battery swapping cabinet and virtual battery compartment objects in the virtual space, updates the attribute values of the virtual battery swapping cabinet and virtual battery compartment objects and the relationship between the virtual objects, and obtains the mapped and updated digital twin engine.
3. The dynamic load balancing control method for a battery swapping cabinet based on digital twins according to claim 2, characterized in that, S2 includes the following steps: S21. Extract historical battery swapping cabinet data and real-time battery swapping cabinet data from the database in the updated digital twin engine. Using a specific geographical area as an analysis unit, align and aggregate all data in the historical battery swapping cabinet data according to the timestamp and region ID to obtain aggregated historical battery swapping cabinet data and aggregated real-time battery swapping cabinet data. S22. Process the missing values and outliers in the aggregated historical battery swapping cabinet data and the aggregated real-time battery swapping cabinet data, and perform one-hot encoding on the categorical variables to obtain the processed historical battery swapping cabinet data and the processed real-time battery swapping cabinet data. S23. Extract features from the processed historical battery swapping cabinet data and the processed real-time battery swapping cabinet data to obtain historical battery swapping cabinet feature data and real-time battery swapping cabinet feature data.
4. The dynamic load balancing control method for a battery swapping cabinet based on digital twins according to claim 3, characterized in that, S3 includes the following steps: S31. Construct an LSTM neural network; replace the single time prediction sequence of the LSTM neural network with a multi-dimensional feature tensor, add an attention mechanism to the output layer of the LSTM neural network, and obtain the initial battery swapping prediction network. S32. Use historical battery swapping cabinet feature data to train the initial battery swapping prediction network. During the training process, combine the optimization algorithm to find the learning rate of the initial battery swapping prediction network and obtain the optimal solution. Use the optimal solution as the learning rate of the initial battery swapping prediction network to obtain the final battery swapping prediction network. S33. Input the real-time battery swapping cabinet feature data into the final battery swapping prediction network to obtain predicted battery swapping data.
5. The dynamic load balancing control method for a battery swapping cabinet based on digital twins according to claim 4, characterized in that, The training process in S32, which combines optimization algorithms to find the learning rate of the initial battery swapping prediction network and obtain the optimal solution, includes the following steps: S321. Set the learning rate search space and maximum number of iterations for the initial battery swapping prediction network; S322. Construct a particle set and set the size of the particle set; based on the learning rate search space of the initial battery swapping prediction network and the particle set, construct an initial particle position set, and use the position of each particle in the initial particle position set as the learning rate of each different initial battery swapping prediction network. S323. Set the prediction accuracy and prediction speed of the initial battery swapping prediction network, and set a fitness function for calculating the fitness of the position of each particle in the particle set according to the prediction accuracy and prediction speed. S324. Perform iterative update operations on the particles in the particle set; during each iteration, update the positions of the particles in the initial position set, and calculate the fitness value of the position of each particle in the particle set according to the fitness function. Update the fitness of each particle in the particle set according to the fitness value from high to low, and obtain the best individual particle and the global best particle in the particle set during each iteration. S325. Repeat S324. When the maximum number of iterations is reached, stop iterating and take the globally best particle as the optimal solution.
6. The dynamic load balancing control method for a battery swapping cabinet based on digital twins according to claim 1, characterized in that, S6 includes the following steps: S61. In the updated digital twin engine, through user behavior simulation and maintenance vehicle simulation, each strategy in the initial solution set is simulated and deduced to obtain a simulation result record set. S62. Set evaluation indicators, and obtain the optimal control strategy based on the evaluation indicators and the simulation result record set.
7. A dynamic load balancing control system for a battery swapping cabinet based on digital twins, characterized in that, The system implements a dynamic load balancing control method for battery swapping cabinets based on digital twins as described in any one of claims 1-6. The system includes a data acquisition and digital twin update module, a feature extraction and processing module, a demand prediction module, a load assessment module, a strategy generation module, and a simulation verification and decision-making module.
Citation Information
Patent Citations
Battery replacement cabinet battery allocation method based on deep learning
CN119692735A
Intelligent charging station monitoring method and system based on digital twinning
CN120396750A