A method for predicting battery swapping demand at battery swapping stations based on deep learning
Through the deep learning model TCN-BiGRU-Attention, combined with time series and external influencing factors, it solves the problem of insufficient prediction accuracy of a single model, achieves high-precision prediction of electric vehicle battery swapping needs, and supports the operational decisions of electric vehicle battery swapping stations.
Patent Information
- Application Number
- CN202411188461.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-28
AI Technical Summary
In the current technology, in the prediction of electric vehicle battery replacement demand, the prediction accuracy of a single model is limited, and it is difficult to capture the relationship between the deep characteristics of the time series and external influencing factors, resulting in insufficient prediction accuracy.
The TCN-BiGRU-Attention hybrid model based on deep learning is used, combined with the temporal convolutional network (TCN), the bidirectional gated recurrent unit network (BiGRU) and the self-attention mechanism, to integrate the historical data of the battery swap station, weather data and holiday data. Temporal feature analysis and feature extraction improve prediction accuracy and model robustness.
It achieves high-precision prediction of electric vehicle battery swap demand, can more accurately support the operation decisions of electric vehicle battery swap stations, improves the accuracy and real-time nature of the forecast, and is suitable for short-term, mid-term and long-term battery swap demand forecasts.
Smart Images

Figure CN118690929B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of battery replacement demand prediction for electric vehicles; specifically, to a method for predicting battery replacement demand at a battery replacement station based on deep learning. Background Art
[0002] With the deepening of the process of automobile electrification, the scale of electric vehicles is increasing day by day. The advantages of automobile electrification such as environmental protection and emission reduction, and lower operating costs have a significant impact on reducing carbon emissions in urban transportation and alleviating the energy crisis, and are in line with the trend of sustainable development in the future. Charging and battery swapping are two ways to replenish energy for electric vehicles. The slow charging method takes a long time to replenish energy, which squeezes out the effective operating time; the fast charging method can improve the efficiency of replenishment to a certain extent, but it damages the battery life. The advantages of the battery swap mode such as fast replenishment speed and strong battery controllability can save the charging time of electric vehicle users and reduce the user's mileage anxiety. Therefore, whether the service of the battery swap station can meet the needs of electric vehicle users, its operating efficiency and service quality are directly related to the process of electric vehicle popularization and the user's experience. Whether it is for customers to search and book battery swap stations, the real-time operation of station operators (such as price adjustment), or for battery dispatching, transportation, and recharging, it is very important to study the forecast of battery swap demand at battery swap stations.
[0003] At present, there are few studies on demand forecasting based on historical data of battery swap stations. Traditional mathematical statistics methods mainly include trend extrapolation, exponential smoothing, time series forecasting, Kalman filtering and grey model. Modern forecasting methods include machine learning and deep learning. At present, more and more researchers use deep learning to extract information from time series. Recurrent neural network (RNN) is a commonly used deep learning model in time series forecasting. RNN has memory and can extract information from time series by sharing parameters at different times. RNN variants, such as long short-term memory network (LSTM), bidirectional long short-term memory network (Bi-LSTM), gated recurrent unit network (GRU), and bidirectional gated recurrent unit network (Bi-GRU), effectively enhance the accuracy and stability of time series forecasting by improving and extending the standard RNN model, making it widely adopted in various practical applications.
[0004] Many researchers use a single model to extract information from time series data because of its simple structure and fast convergence speed. However, a single model usually has limitations. Its prediction accuracy is limited, and it is difficult to predict time series with large fluctuations and long time scales. It is still insufficient in extracting deep features and processing long time series. Therefore, more and more researchers use hybrid models for time series prediction. Combining single models can overcome the disadvantage of single feature extraction.
[0005] Considering that most current studies focus on the extraction of time series features and ignore the deep implicit relationship between battery swapping demand and external influencing factors, the accuracy of battery swapping demand prediction still needs to be improved. Therefore, it is necessary to deeply explore the implicit information of battery swapping demand and external influencing factors.
[0006] There is an existing document entitled "A method and system for predicting the battery replacement demand of electric vehicles based on time series", with the Chinese patent publication number CN114943386A. It uses the historical battery replacement records and N long short-term memory network models to predict the number of battery replacement demands and tiered electricity prices, to reasonably configure charging methods and improve the operating efficiency of battery replacement stations.
[0007] There is an existing document entitled "A Data-driven Method and System for Predicting Battery Replacement Demand at Battery Swap Stations", with the Chinese patent publication number CN118014137A. It uses the collected daily battery replacement order data from battery swap stations and adopts the Prophet model and the long short-term memory network (LSTM) model to build a combined model to achieve accurate prediction of battery replacement demand at battery swap stations.
[0008] The temporal convolutional network (TCN) can capture time series information. Its ability to process time series is better than that of recurrent neural networks and their variants, and it can build long-term time series dependencies. The bidirectional gated recurrent unit (BiGRU) can process forward and backward, so that the model can not only consider the current time step, but also integrate the context information, so as to more comprehensively capture the contextual information in the time series and improve the accuracy of the battery replacement demand forecast. The self-attention mechanism dynamically adjusts the focus on different time steps, highlights key features, and improves the interpretability and accuracy of the model.
[0009] The TCN-BiGRU-Attention hybrid model can effectively combine the advantages of TCN and BiGRU, and further improve the accuracy of feature extraction and the robustness of the model through the self-attention mechanism.
[0010] The model first extracts the features of the time series through TCN to capture the relationship between variables such as the historical data of battery swapping at battery swapping stations, weather data, holiday data, and daily cycles. Then, the extracted features are input into the BiGRU layer to make full use of the forward and reverse time-dependent information to extract the intrinsic correlation between each influencing factor and the battery swapping demand. Next, the self-attention mechanism is applied to obtain the connection between different time scales, and the important time steps are weighted. Finally, all the features are integrated through the Flatten layer and the fully connected layer to output the final battery swapping demand forecast for battery swapping demand forecasting.
[0011] Citation article: Wang S, Chen A, Wang P, et al. Short-term electric vehicle battery swapping demand prediction: Deep learning methods[J]. TransportationResearch Part D: Transport and Environment, 2023, 119: 103746. Summary of the invention
[0012] In view of the above problems, the purpose of the present invention is to provide a method for predicting battery swapping demand at a battery swap station based on deep learning, which is used to study a battery swapping demand prediction model with high prediction accuracy and strong generalization ability, and can integrate multiple influencing factors. It can provide more accurate and efficient decision support for the operation of electric vehicle battery swap stations, so as to overcome the shortcomings of the above-mentioned prior art.
[0013] To achieve the above object, the present invention adopts the following technical solution:
[0014] A method for predicting battery swap demand at a battery swap station based on deep learning, comprising the following steps:
[0015] Step A: Obtain historical battery swap data of the battery swap station, including order ID, battery swap event completion time, battery swap station name and vehicle ID; obtain weather data and holiday data, where the weather data and holiday data match the time of the historical battery swap data of the battery swap station;
[0016] Step B: Preprocess the historical battery swapping data, weather data, and holiday data of the battery swapping station; due to equipment failure, signal loss, and interference problems during data collection, transmission, and storage, the final stored data may contain errors or mistakes; directly using these erroneous or wrong data for modeling will reduce the accuracy and reliability of the model; therefore, data preprocessing is performed to improve data quality, eliminate the impact of abnormal data, ensure data integrity, and improve model accuracy by correcting or filtering these erroneous or wrong data;
[0017] Step C: A battery swap demand prediction model based on deep learning TCN-BiGRU-Attention. The TCN-BiGRU-Attention model includes an input layer, a temporal convolutional network layer, a bidirectional gated recurrent unit network layer, a Self-Attention layer, a neural network layer, and a fully connected layer.
[0018] Step D: Model training and verification, select appropriate loss function and gradient optimization algorithm to improve the prediction accuracy of the model. The loss function is used to measure the difference between the model prediction value and the actual value. The gradient optimization algorithm iteratively updates the model parameters to minimize the loss function.
[0019] Step E: Model effectiveness analysis, selecting evaluation indicators and comparative tests to verify the prediction effect of the model;
[0020] Step F: Model prediction and application, predicting the battery swapping demand at different time intervals for m selected battery swapping stations based on the trained model; the model prediction results are used for operational decisions of the battery swapping stations.
[0021] As the preferred embodiment of the present invention, step B also includes the following steps:
[0022] Step B1: Data cleaning, rechecking and proofreading the data for errors, including duplicate data, missing data, time anomaly data, out-of-range data, and irrelevant data;
[0023] Step B2: Time slicing: Use the Pandas data processing tool in Python to slice the battery swapping data set into different time intervals of 15 minutes, 30 minutes, 1 hour, 3 hours, 6 hours, 12 hours, and 24 hours, and count the number of battery swapping events in each time segment;
[0024] Step B3: Normalization processing, scaling the data to a specific range, specifically [0, 1] or [-1,1], so that data with different features can be compared and processed on the same scale;
[0025] The minimum-maximum normalization formula is as follows: ;
[0026] is the original data, is the normalized data, and Characteristics The minimum and maximum values of
[0027] Step B4: Analysis of the time characteristics of battery swapping data. The battery swapping demand data shows a certain time dependence, including daily and weekly periodicity of battery swapping demand. The battery swapping demand also shows a certain regularity in time, specifically peak and trough periods, seasonal changes, periodic changes, and trend changes. The time characteristics of the battery swapping data set of the battery swapping station are analyzed to mine the rich information contained in the data, thereby building a data-driven battery swapping demand prediction model to improve the prediction effect of the model.
[0028] Step B5: Analyze the impact of weather factors on battery replacement demand, including temperature and rainfall;
[0029] Step B6: Analyze the impact of other factors on battery replacement demand, including: holidays;
[0030] Step B7: Use the Spearman correlation coefficient to calculate the correlation between various influencing factors and the demand for battery replacement; judge the strength of the correlation based on the absolute value of the Spearman correlation coefficient; the formula is as follows:
[0031] ;
[0032] in is the Spearman correlation coefficient, It is The rank difference of observations, the number of observations, is a constant factor;
[0033] The Spearman correlation coefficient ranges from -1 to 1. The closer the value is to 1, the stronger the positive correlation is. The closer the value is to -1, the stronger the negative correlation is. The closer the value is to 0, the less correlation there is.
[0034] When determining the number of features, a threshold is set based on the absolute value of the Spearman correlation coefficient. Only features exceeding this threshold are selected for model training; the threshold range is as follows:
[0035] : Highly correlated, it is believed that there is a strong relationship between the feature and the target variable;
[0036] : Moderate correlation, there is a medium-strength relationship between the feature and the target variable;
[0037] : Low correlation, the relationship between the feature and the target variable is weak;
[0038] Step B8: The pre-processed data of battery swapping events, temperature and holidays are divided into training set, validation set and test set in a ratio of 8:1:1.
[0039] As the preferred embodiment of the present invention, step C also includes the following steps:
[0040] Step C1: Input layer. The input layer of the model receives a variety of data, including historical data of battery swap stations, weather data, holiday data, daily cycle data, and weekly cycle data. The various data are integrated into a three-dimensional tensor as input for subsequent layers.
[0041] ;
[0042] in, represents a three-dimensional tensor, is the number of samples, which is equal to the number of battery swap stations. is the number of features at each time step, is the number of time steps;
[0043] For each battery swap station, historical data, weather data, holiday data, daily cycle data, and weekly cycle data are comprehensively considered at each time step. Multidimensional features need to be organized into vector or matrix formats for input into the deep learning model. The following is the vector or matrix format of each data:
[0044] Step C1.1: Battery swap history data. The number of battery swap requirements at each time step is represented by a scalar. The scalar or vector format is , represents the number of battery swapping requirements at each time step;
[0045] Step C1.2: Weather data, including multiple weather features, specifically temperature and rainfall. In the feature vector, each weather feature occupies one position; the vector format for each time step is W= , where W is the weather characteristic for each time step, vector is a specific weather feature of temperature or rainfall, and t represents the number of weather features considered. The present invention considers factors such as temperature, humidity, rainfall, and snowfall. ;
[0046] : weather characteristic vector at time step n;
[0047] : Temperature at time step n;
[0048] : Humidity at time step n;
[0049] : rainfall at time step n;
[0050] : Snowfall at time step n;
[0051] Step C1.3: Holiday data, indicating whether the current time step is a holiday, in scalar or vector format , represented by a binary flag, 1 represents holidays and 0 represents non-holidays, that is, H takes the value of 0 or 1;
[0052] Step C1.4: Daily cycle data: the number of hours in a day for the current time step, in vector format , the value range of hour is 0-23;
[0053] Step C1.5; Weekly data: the day of the week for the current time step, in vector format , the value range of day is 1-7;
[0054] Step C1.6: Feature vector construction, the feature vector of each time step is expressed as ;
[0055] The two-dimensional matrix of sample m can be expressed as: ;
[0056] The three-dimensional tensor of samples can be expressed as: ;
[0057] : A two-dimensional matrix, the matrix form of sample m;
[0058] : represents the pth feature of sample m at time step n;
[0059] : A three-dimensional tensor, a three-dimensional tensor of m samples;
[0060] : Feature p of sample m at time step n;
[0061] Need to determine the sample size , determine the time step to be predicted and number of features ;
[0062] Feature determination: Spearman correlation coefficient according to step B6 Determine the number of features, for The data features with medium correlation or above are determined as two-dimensional matrices or three-dimensional tensors to improve the performance and robustness of the model and avoid selecting features with weak correlation with the target variable;
[0063] Step C2: Temporal Convolutional Network Layer,
[0064] Step C2.1: Dilated Causal Convolution Formula: ;
[0065] in, : The value of the output at position s after the convolution operation;
[0066] : input signal or input tensor;
[0067] : represents a convolution operation with a dilation factor;
[0068] : convolution kernel;
[0069] : current position or time step;
[0070] d: expansion factor;
[0071] : The size of the convolution kernel;
[0072] : The function of the convolution filter,
[0073] : In time step Data entered at all times;
[0074] Expansion Factor With the number of layers The increase is exponential, ;
[0075] Step C2.2: The residual connection formula is ;
[0076] in, is the activation function, is the output of the previous layer, is a transformation after dilated causal convolution, weight normalization, activation function and random dropout. is the output after residual connection;
[0077] Step C2.3: Input tensor Input to the temporal convolutional network structure, the output tensor after the dilated causal convolution , the shape of the output tensor after the residual connection remains unchanged and remains as ,but Each element in is already a new feature after the dilated causal convolution operation; the changes in the input tensor after the temporal convolutional network structure are mainly reflected in feature extraction and expansion. After the dilated causal convolution and residual connection, the shape of the input tensor remains unchanged, but the information contained in each feature vector becomes richer, capturing dependencies over a longer time range;
[0078] Step C3: Bidirectional Gated Recurrent Unit Network Layer,
[0079] Forward propagation formula: ;
[0080] Back propagation formula: ;
[0081] Hidden layer merging formula: ;
[0082] in: It is at the moment Forward hidden layer output, It is at the moment The reverse hidden layer output of It is at the moment The merged hidden layer output, , represents the weight coefficient, represents the bias coefficient;
[0083] After the forward and backward GRU, the output tensor of the merged hidden layer is ;
[0084] Step C4: Self-Attention layer,
[0085] Calculate Query, Key, and Value: ;
[0086] Among them, Query: query vector, used to represent the input of the current time step or position in the attention mechanism;
[0087] Key: key vector, used to represent the characteristics of each input vector;
[0088] Value: value vector, representing the actual information of each input vector;
[0089] Calculate the attention weights: ;
[0090] Weighted sum: ;
[0091] in, is the input matrix, , , They are the weight matrices of Query, Key and Value respectively. is the query matrix, is the key matrix, is the value matrix, is the dimension of the key vector;
[0092] Output tensor after the Self-Attention layer ;
[0093] Step C5: Neural network layer, used to flatten the multi-dimensional matrix of input data into a one-dimensional vector, and convert the output of the convolutional layer or high-dimensional layer into the input form accepted by the fully connected layer;
[0094] Input: a multidimensional matrix,
[0095] Output: A one-dimensional vector containing all elements in the input matrix;
[0096] The output matrix after the neural network layer , express and The product of
[0097] Step C6: Fully connected layer, which integrates the output of the feature extraction layer and uses it for the final prediction or classification task through linear transformation and nonlinear activation, outputs the final prediction result, and receives the flattened vector for the final battery swap demand prediction;
[0098] ;
[0099] in, is the output matrix of the fully connected layer, is the output matrix of the neural network layer, is the weight matrix of the fully connected layer, is the bias vector of the fully connected layer, is the activation function;
[0100] The output matrix after the fully connected layer , the matrix output by the fully connected layer In , each element represents the predicted value of the battery swap demand at a specific battery swap station within the selected time interval.
[0101] As the preferred embodiment of the present invention, step D also includes the following steps:
[0102] Step D1: Loss function selection, select the root mean square error to measure the difference between the predicted value and the actual value.
[0103] Step D2: Optimization algorithm selection. The Adam optimizer updates parameters by calculating the first-order moment estimate and the second-order moment estimate of the gradient.
[0104] Step D3: Model training, using the training set data to train the model and continuously update the model parameters;
[0105] Step D4: Model validation: Use validation set data to validate the model. Based on the performance of the validation set, continuously adjust the model hyperparameters and select the best model structure.
[0106] As a preferred embodiment of the present invention, step E also includes the following steps:
[0107] Step E1: Select the evaluation indicators, mean absolute percentage error and root mean square error;
[0108] The mean absolute percentage error is used for regression problems and represents the average absolute error between the predicted value and the true value as a percentage of the true value. The formula is as follows:
[0109] ;
[0110] in, For the The true value of the samples, For the The predicted value of samples, is the sample size;
[0111] The root mean square error is used for regression problems and represents the square root of the mean of the squared errors between the predicted values and the true values. The formula is as follows:
[0112] ;
[0113] Step E2: Comparative test to verify that the overall performance of the model used is better than the existing benchmark method;
[0114] Remove some features: gradually remove weather data and holiday data from the input features, and compare the impact of different features on model performance.
[0115] As the preferred embodiment of the present invention, step F also includes the following steps:
[0116] Step F1: In the battery swap demand forecast,
[0117] The time division of battery swap demand forecasting focuses more on demand changes in a short period of time, adapts to battery swap demand scenarios with strong dynamics, and has high real-time requirements;
[0118] Short-term forecast: 5 minutes to 1 hour, suitable for real-time decision-making and real-time information push;
[0119] Medium-term forecast: 1 to 12 hours, suitable for operation scheduling and resource optimization;
[0120] Long-term forecast: 12 hours to 24 hours or longer, suitable for strategic planning and long-term decision-making;
[0121] Step F2: Application of short-term battery swap demand forecast results,
[0122] Real-time information push: Customers can check the number of available batteries and queue status at the battery swap station through the mobile app and choose a reasonable time and place for battery swap;
[0123] Battery replacement reservation system: customers can make reservations for battery replacement services in advance to reduce waiting time;
[0124] Real-time decision-making: real-time operations of operators, including price adjustment decisions and battery charging decisions;
[0125] Step F3: Application of mid-term battery swap demand forecast results,
[0126] Dynamic pricing: Encourage customers to switch batteries during off-peak hours to balance demand;
[0127] Operational scheduling: mobilization of batteries and human resources to ensure supply in the next few hours;
[0128] Charging plan: optimize the charging plan to avoid overcharging or undersupply of batteries, and arrange charging reasonably according to electricity prices;
[0129] Step F4: Application of long-term battery replacement demand forecast results,
[0130] Strategic Planning: Develop a day's operational strategy, including inventory management and staffing arrangements;
[0131] Pricing strategy: Develop a dynamic pricing strategy for the day to balance supply and demand and optimize revenue;
[0132] Resource allocation: Carry out long-term resource allocation and maintenance planning to ensure the normal operation of equipment and facilities.
[0133] The advantages and positive effects of the present invention are:
[0134] 1. The present invention takes into account the limitations of the current single model for battery swap demand prediction and the limited prediction accuracy, and the superiority of convolutional neural networks over recurrent neural networks and their variants in processing time series data. By proposing a hybrid model of TCN-BiGRU-Attention, the three different types of model architectures of TCN, BiGRU and Self-Attention are integrated, each of which plays its unique advantages to improve the prediction accuracy.
[0135] 2. The present invention only considers that most current studies focus on the extraction of time series features, ignoring the deep implicit relationship between battery swap demand and external influencing factors. It is necessary to further improve the accuracy of battery swap demand prediction and deeply explore the implicit information of battery swap demand and external influencing factors. It is necessary to consider not only the time series characteristics, but also the external influencing factors, such as weather, holidays, etc., by studying a battery swap demand prediction model with high prediction accuracy and strong generalization ability, and capable of integrating multiple influencing factors. The battery swap demand prediction model has significant advantages in processing time series and external influencing factors, and can provide more accurate and efficient decision support for the operation of electric vehicle battery swap stations; the matrix is considered to be composed of historical data of battery swap stations, weather data, holiday data, hours of a day, and days of a week. Effectively integrate multiple data sources, including historical battery swap data, weather data, holiday data, daily cycle and weekly cycle characteristics. The demand for battery swapping of electric vehicles changes with time during the day and with the number of days in a week. Consider the impact of time factors on battery swap demand, such as daily periodicity and weekly periodicity. Analyzing the time characteristics of historical battery swapping data is conducive to mining the rich information contained in the data, which is conducive to building a battery swapping demand prediction model based on battery swapping data and improving the prediction effect of the model.
[0136] 3. The present invention takes into account the degree of attention paid to different time steps, and develops a method for dividing the short-term, medium-term and long-term forecast time in the battery swap demand forecasting scenario. The Self-Attention mechanism can dynamically adjust the weights of different time steps according to the current input data. It has strong adaptability and can adaptively adjust the model's attention to different time steps according to the characteristics of the input data. It is particularly suitable for capturing short-term demand fluctuations and improving forecasting accuracy. Compared with the traditional division method, the battery swap demand changes more frequently and requires higher real-time performance. The time division standard is more refined, and the application of short-term, medium-term and long-term battery swap demand forecasting is given. BRIEF DESCRIPTION OF THE DRAWINGS
[0137] Figure 1 It is a schematic diagram of the battery replacement demand prediction structure of the present invention.
[0138] Figure 2 It is the overall structural framework diagram of the present invention.
[0139] Figure 3 It is a flow chart of model training, verification and evaluation of the present invention.
[0140] Figure 4 It is a TCN structure diagram of the present invention.
[0141] Figure 5 It is the Bi-GRU structure diagram of the present invention. DETAILED DESCRIPTION
[0142] See also Figure 1-5 This embodiment provides a method for predicting battery swapping demand at a battery swapping station based on deep learning, comprising the following steps:
[0143] Step A: Obtain the historical battery swapping data of the battery swapping station, including the order ID, completion time of the battery swapping event, the name of the battery swapping station and the vehicle ID; obtain weather data and holiday data, wherein the weather data and holiday data match the time of the historical battery swapping data of the battery swapping station.
[0144] Step B: Preprocess the historical battery swapping data, weather data, and holiday data of the battery swapping station; due to equipment failure, signal loss, and interference problems during data collection, transmission, and storage, the final stored data may contain errors or mistakes; directly using these erroneous or wrong data for modeling will reduce the accuracy and reliability of the model; therefore, data preprocessing can help improve data quality, eliminate the impact of abnormal data, ensure data integrity, and improve model accuracy by correcting or filtering these erroneous or wrong data;
[0145] Step B1: Data cleaning, rechecking and proofreading the data for errors, including duplicate data, missing data, time anomaly data, out-of-range data, and irrelevant data;
[0146] Step B2: Time slicing: Use the Pandas data processing tool in Python to slice the battery swapping data set into different time intervals of 15 minutes, 30 minutes, 1 hour, 3 hours, 6 hours, 12 hours, and 24 hours, and count the number of battery swapping events in each time segment;
[0147] Step B3: Normalization processing, scaling the data to a specific range, specifically [0, 1] or [-1,1], so that data with different features can be compared and processed on the same scale; normalization is especially important in the neural network training process because it can accelerate convergence and improve the performance and stability of the model.
[0148] The minimum-maximum normalization formula is as follows: ;
[0149] is the original data, is the normalized data, and Characteristics The minimum and maximum values of
[0150] Step B4: Analysis of the time characteristics of battery swapping data. The battery swapping demand data shows a certain time dependence, including daily and weekly periodicity of battery swapping demand. The battery swapping demand also shows a certain regularity in time, specifically peak and trough periods, seasonal changes, periodic changes, and trend changes. Performing time characteristic analysis on the battery swapping data set of battery swapping stations is helpful for mining the rich information contained in the data, thereby facilitating the construction of a data-driven battery swapping demand prediction model and improving the prediction effect of the model.
[0151] Step B5: Analyze the impact of weather factors on the demand for battery swapping, including temperature and rainfall; changes in these influencing factors will cause changes in the demand for battery swapping.
[0152] Step B6: Analyze the impact of other factors on battery replacement demand, including: holidays;
[0153] Step B7: Use the Spearman's rank correlation coefficient to calculate the correlation between various influencing factors and battery swapping demand; the Spearman's rank correlation coefficient, also known as the Spearman's rank correlation coefficient, is a method for describing the correlation between two sets of variables, and is particularly suitable for non-normally distributed data or measurement rank data. The strength of the correlation is determined based on the absolute value of the Spearman's correlation coefficient; the formula is as follows:
[0154] ;
[0155] in is the Spearman correlation coefficient, It is The rank difference of observations, the number of observations, is a constant factor;
[0156] The Spearman correlation coefficient ranges from -1 to 1. The closer the value is to 1, the stronger the positive correlation is. The closer the value is to -1, the stronger the negative correlation is. The closer the value is to 0, the less correlation there is.
[0157] When determining the number of features, a threshold is set based on the absolute value of the Spearman correlation coefficient. Only features exceeding this threshold are selected for model training. The specific threshold can be adjusted according to the specific situation. The threshold range is as follows:
[0158] : Highly correlated, it is believed that there is a strong relationship between the feature and the target variable;
[0159] : Moderate correlation, there is a medium-strength relationship between the feature and the target variable;
[0160] : Low correlation, the relationship between the feature and the target variable is weak;
[0161] Step B8: The pre-processed data of battery swapping events, temperature and holidays are divided into training set, validation set and test set in a ratio of 8:1:1.
[0162] Step C: A battery swap demand prediction model based on deep learning TCN-BiGRU-Attention (Temporal Convolutional Network-Bidirectional Gated Recurrent Unit-Attention Mechanism). The TCN-BiGRU-Attention model includes an input layer, a temporal convolutional network (TCN) layer, a bidirectional gated recurrent unit network (BiGRU) layer, a Self-Attention layer, a neural network (Flatten) layer, and a fully connected layer.
[0163] Step C1: Input layer. The input layer of the model receives a variety of data, including historical data of battery swap stations, weather data, holiday data, daily cycle data, and weekly cycle data. The various data are integrated into a three-dimensional tensor as input for subsequent layers.
[0164] ;
[0165] in, represents a three-dimensional tensor, is the number of samples, which is equal to the number of battery swap stations. is the number of features at each time step, is the number of time steps;
[0166] For each battery swap station, historical data, weather data, holiday data, daily cycle data, and weekly cycle data are comprehensively considered at each time step. Multidimensional features need to be organized into vector or matrix formats for input into the deep learning model. The following is the vector or matrix format of each data:
[0167] Step C1.1: Battery swap history data. The number of battery swap requirements at each time step is represented by a scalar. The scalar or vector format is , represents the number of battery swapping requirements at each time step;
[0168] Step C1.2: Weather data, including multiple weather features, specifically temperature and rainfall. In the feature vector, each weather feature occupies one position; the vector format for each time step is W= , where W is the weather characteristic for each time step, vector is a specific weather feature of temperature or rainfall, and t represents the number of weather features considered. The present invention considers factors such as temperature, humidity, rainfall, and snowfall. ;
[0169] : weather characteristic vector at time step n;
[0170] : Temperature at time step n (unit: degrees Celsius);
[0171] : Humidity at time step n (unit: percentage);
[0172] : rainfall at time step n (unit: mm);
[0173] : Snowfall at time step n (unit: mm);
[0174] Step C1.3: Holiday data, indicating whether the current time step is a holiday, in scalar or vector format , represented by a binary flag, 1 represents holidays and 0 represents non-holidays, that is, H takes the value of 0 or 1;
[0175] Step C1.4: Daily cycle data: the number of hours in a day for the current time step, in vector format , the value range of hour is 0-23;
[0176] Step C1.5; Weekly data: the day of the week for the current time step, in vector format , the value range of day is 1-7;
[0177] Step C1.6: Feature vector construction, the feature vector of each time step is expressed as ;
[0178] The two-dimensional matrix of sample m can be expressed as: ;
[0179] The three-dimensional tensor of samples can be expressed as: ;
[0180] : A two-dimensional matrix, the matrix form of sample m;
[0181] : represents the pth feature of sample m at time step n.
[0182] : A three-dimensional tensor, a three-dimensional tensor of m samples;
[0183] : Feature p of sample m at time step n;
[0184] The number of samples (i.e. the number of battery swap stations) needs to be determined , determine the time step to be predicted and number of features ;
[0185] Feature determination: Spearman correlation coefficient according to step B6 Determine the number of features, for The data features with medium correlation or above are determined as two-dimensional matrices or three-dimensional tensors to improve the performance and robustness of the model and avoid selecting features with weak correlation with the target variable;
[0186] Step C2: Temporal Convolutional Network (TCN) layer. The temporal convolutional network layer is a new network architecture based on the convolutional neural network (CNN), which adds dilated causal convolution and residual connection. In this case, the size of the effective window of the dilated convolution increases exponentially with the increase in the number of layers. TCN achieves the goal of obtaining a large receptive field with fewer layers, and the residual connection solves the gradient vanishing problem of deep networks. The TCN structure is as follows Figure 4 :
[0187] Step C2.1: Dilated Causal Convolution Formula: ;
[0188] in, : The value of the output at position s after the convolution operation;
[0189] : input signal or input tensor;
[0190] : represents a convolution operation with a dilation factor;
[0191] :convolution kernel (filter);
[0192] : current position or time step;
[0193] d: expansion factor;
[0194] : The size of the convolution kernel;
[0195] : The function of the convolution filter,
[0196] : In time step Data entered at all times;
[0197] Expansion Factor With the number of layers The increase is exponential, ;
[0198] Step C2.2: The residual connection formula is ;
[0199] in, is the activation function, is the output of the previous layer, is a transformation after dilated causal convolution, weight normalization, activation function and random dropout. is the output after residual connection;
[0200] Step C2.3: Input tensor Input to the temporal convolutional network structure, the output tensor after the dilated causal convolution , the shape of the output tensor after the residual connection remains unchanged and remains as ,but Each element in is already a new feature after the dilated causal convolution operation; the changes in the input tensor after the temporal convolutional network structure are mainly reflected in feature extraction and expansion. After the dilated causal convolution and residual connection, the shape of the input tensor remains unchanged, but the information contained in each feature vector becomes richer, capturing dependencies over a longer time range;
[0201] Step C3: Bidirectional Gated Recurrent Unit (BiGRU) layer. The Bidirectional Gated Recurrent Unit (BiGRU) layer is an improved network structure based on the Gated Recurrent Unit (GRU). Compared with the traditional GRU which only considers the correlation between the current moment and the past moment, the BiGRU can simultaneously consider the impact of the past and future moment data on the current data, making the predicted value closer to the true value. The BiGRU structure is as follows: Figure 5 :
[0202] Forward propagation formula: ;
[0203] Back propagation formula: ;
[0204] Hidden layer merging formula: ;
[0205] in: It is at the moment Forward hidden layer output, It is at the moment The reverse hidden layer output of It is at the moment The merged hidden layer output, , represents the weight coefficient, represents the bias coefficient;
[0206] After the forward and backward GRU, the output tensor of the merged hidden layer is .
[0207] Step C4: Self-Attention layer. The Self-Attention mechanism is a special form of the Attention mechanism. The core idea is to assign an attention weight to each input element, which is applied to the relationship between each position in the sequence and all other positions in the sequence. The calculation steps of Self-Attention are similar to those of ordinary Attention, but its Query, Key, and Value all come from the same input sequence.
[0208] Calculate Query, Key, and Value: ;
[0209] Among them, Query: query vector, used to represent the input of the current time step or position in the attention mechanism;
[0210] Key: key vector, used to represent the characteristics of each input vector;
[0211] Value: value vector, representing the actual information of each input vector;
[0212] Calculate the attention weights: ;
[0213] Weighted sum: ;
[0214] in, is the input matrix, , , They are the weight matrices of Query, Key and Value respectively. is the query matrix, is the key matrix, is the value matrix, is the dimension of the key vector;
[0215] Output tensor after the Self-Attention layer ;
[0216] Step C5: Neural network (Flatten) layer. The Flatten layer is a neural network layer that flattens the multi-dimensional matrix of input data into a one-dimensional vector and converts the output of the convolutional layer or other high-dimensional layer into the input form accepted by the fully connected layer.
[0217] Input: A multi-dimensional matrix, such as a 3D tensor from a convolutional layer.
[0218] Output: A one-dimensional vector containing all elements in the input matrix;
[0219] Output matrix after the neural network (Flatten) layer , express and The product of
[0220] Step C6: Fully connected layer, which integrates the output of feature extraction layer (such as convolution layer, recurrent layer), and uses it for final prediction or classification task through linear transformation and nonlinear activation, outputs the final prediction result, and receives the flattened vector for final battery swap demand prediction;
[0221] ;
[0222] in, is the output matrix of the fully connected layer, is the output matrix of the neural network layer, is the weight matrix of the fully connected layer, is the bias vector of the fully connected layer, is the activation function;
[0223] The output matrix after the fully connected layer , the matrix output by the fully connected layer In , each element represents the predicted value of the battery swap demand at a specific battery swap station within the selected time interval.
[0224] Step D: Model training and verification, select appropriate loss function and gradient optimization algorithm to improve the prediction accuracy of the model. The loss function is used to measure the difference between the model prediction value and the actual value, often referred to as the cost function or objective function. The gradient optimization algorithm iteratively updates the model parameters to minimize the loss function. The basic idea is to update the parameters along the negative direction of the gradient until the minimum value of the loss function is reached;
[0225] Step D1: Loss function selection, select the root mean square error (RMSE) to measure the difference between the predicted value and the actual value. In order to evaluate the quality of a prediction model, it is necessary to measure the difference between the predicted value and the actual value from different angles through multiple indicators, and finally draw a comprehensive conclusion.
[0226] Step D2: Optimization algorithm selection. Adam optimizer (Adaptive Moment Estimation) is a commonly used optimization algorithm that combines the advantages of momentum and adaptive learning rate. It is suitable for deep learning tasks that process large amounts of data and complex models. Adam optimizer updates parameters by calculating the first-order moment estimate (mean) and the second-order moment estimate (uncentered variance) of the gradient.
[0227] Step D3: Model training, using the training set data to train the model and continuously update the model parameters;
[0228] Step D4: Model validation: Use validation set data to validate the model. Based on the performance of the validation set, continuously adjust the model hyperparameters and select the best model structure.
[0229] Step E: Model effectiveness analysis, selecting evaluation indicators and comparative tests to verify the prediction effect of the model;
[0230] Step E1: Select the evaluation indicators, mean absolute percentage error (MAPE) and root mean square error (RMSE);
[0231] The mean absolute percentage error is used for regression problems and represents the average absolute error between the predicted value and the true value as a percentage of the true value. The formula is as follows:
[0232] ;
[0233] in, For the The true value of the samples, For the The predicted value of samples, is the sample size;
[0234] The root mean square error is used for regression problems and represents the square root of the mean of the squared errors between the predicted values and the true values. The formula is as follows:
[0235] ;
[0236] Step E2: Comparative test is used to verify that the overall performance of the model used is better than the existing benchmark method; the prediction and comparison of battery replacement demand at different time intervals are carried out, and the TCN-BiGRU-Attention model in this paper is compared with the LSTM, Bi-LSTM, GRU, Bi-GRU, TCN, TCN-BiGRU, TCN-Attention, and BiGRU-Attention models to compare the prediction performance of each model and verify the prediction effect of the model.
[0237] Remove some features: gradually remove weather data and holiday data from the input features, and compare the impact of different features on model performance.
[0238] Step F: Model prediction and application: The battery swap demand prediction results of m selected battery swap stations at different time intervals (5min, 15min, 30min, 1h, 3h, 6h, 12h, 24h) are obtained based on the trained model; the model prediction results are used for operational decisions of the battery swap stations, such as customer search and reservation of battery swap stations, real-time operation of operators, and battery dispatch and recharging optimization;
[0239] Step F1: In the battery swap demand forecast, since the demand changes frequently and requires high real-time performance, the short-term, medium-term and long-term forecast time division standards are more refined, and the time span is determined according to the specific situation. Different fields and industries may adopt different division standards, and the division method is usually based on the characteristics of specific application scenarios and needs.
[0240] The time division of battery swap demand forecasting focuses more on demand changes in a short period of time, adapts to battery swap demand scenarios with strong dynamics, and has high real-time requirements;
[0241] Short-term forecast: 5 minutes to 1 hour, suitable for real-time decision-making and real-time information push;
[0242] Medium-term forecast: 1 to 12 hours, suitable for operation scheduling and resource optimization;
[0243] Long-term forecast: 12 hours to 24 hours or longer, suitable for strategic planning and long-term decision-making;
[0244] Step F2: Application of short-term battery swap demand forecast results,
[0245] Real-time information push: Customers can check the number of available batteries and queue status at the battery swap station through the mobile app and choose a reasonable time and place for battery swap;
[0246] Battery replacement reservation system: customers can make reservations for battery replacement services in advance to reduce waiting time;
[0247] Real-time decision-making: real-time operations of operators, including price adjustment decisions and battery charging decisions;
[0248] Step F3: Application of mid-term battery swap demand forecast results,
[0249] Dynamic pricing: Encourage customers to switch batteries during off-peak hours to balance demand;
[0250] Operational scheduling: mobilization of batteries and human resources to ensure supply in the next few hours;
[0251] Charging plan: optimize the charging plan to avoid overcharging or undersupply of batteries, and arrange charging reasonably according to electricity prices;
[0252] Step F4: Application of long-term battery replacement demand forecast results,
[0253] Strategic Planning: Develop a day's operational strategy, including inventory management and staffing arrangements;
[0254] Pricing strategy: Develop a dynamic pricing strategy for the day to balance supply and demand and optimize revenue;
[0255] Resource allocation: Carry out long-term resource allocation and maintenance planning to ensure the normal operation of equipment and facilities.
[0256] The above description is only a preferred example of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various changes and variations. Any modification, equivalent substitution, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for predicting battery swap demand at a battery swap station based on deep learning, characterized in that: The following steps are involved: Step A: Obtain historical battery swap data of the battery swap station, including order ID, battery swap event completion time, battery swap station name and vehicle ID; obtain weather data and holiday data, where the weather data and holiday data match the time of the historical battery swap data of the battery swap station; Step B: Preprocess the historical battery swapping data, weather data, and holiday data of the battery swapping station; due to equipment failure, signal loss, and interference problems during data collection, transmission, and storage, the final stored data may contain errors or mistakes; directly using these erroneous or wrong data for modeling will reduce the accuracy and reliability of the model; therefore, data preprocessing is performed to improve data quality, eliminate the impact of abnormal data, ensure data integrity, and improve model accuracy by correcting or filtering these erroneous or wrong data; Step C: A battery swap demand prediction model based on deep learning TCN-BiGRU-Attention. The TCN-BiGRU-Attention model includes an input layer, a temporal convolutional network layer, a bidirectional gated recurrent unit network layer, a Self-Attention layer, a neural network layer, and a fully connected layer. Step C1: Input layer. The input layer of the model receives a variety of data, including historical data of battery swap stations, weather data, holiday data, daily cycle data, and weekly cycle data. The various data are integrated into a three-dimensional tensor as input for subsequent layers. X∈R m×p×n ; Among them, R m×n×p Represents a three-dimensional tensor, m is the number of samples, which is equivalent to the number of battery swap stations, p is the number of features per time step, and n is the number of time steps; For each battery swap station, historical data, weather data, holiday data, daily cycle data, and weekly cycle data are comprehensively considered at each time step. Multidimensional features need to be organized into vector or matrix formats for input into the deep learning model. The following is the vector or matrix format of each data: Step C1.1: Battery swap history data, the number of battery swap requirements at each time step is represented by a scalar, the scalar or vector format is [L], L represents the number of battery swap requirements at each time step; Step C1.2: Weather data, including multiple weather features, specifically temperature and rainfall. In the feature vector, each weather feature occupies one position; the vector format of each time step is W = [w1, w2, ..., w t ], where W is the weather characteristic for each time step, and the vector w i (i∈[1,t]) is a specific weather feature of temperature or rainfall, and t represents the number of weather features considered; the present invention considers factors such as temperature, humidity, rainfall, and snowfall, W n =[T n ,D n ,R n ,S n ]; W n : weather characteristic vector at time step n; T n : Temperature at time step n; D n : Humidity at time step n; R n : rainfall at time step n; S n : Snowfall at time step n; Step C1.3: Holiday data, indicating whether the current time step is a holiday, the scalar or vector format is [H], represented by a binary flag, 1 represents a holiday, 0 represents a non-holiday, that is, H takes the value of 0 or 1; Step C1.4: Daily period data: the number of hours in a day for the current time step, the vector format is [hour], and the value range of hour is 0-23; Step C1.5; Weekly period data: the day of the week of the current time step, the vector format is [day], and the value range of day is 1-7; Step C1.6: Feature vector construction, the feature vector of each time step is expressed as [L, W, H, hour, day]; The two-dimensional matrix of sample m can be expressed as: The three-dimensional tensor of m samples can be expressed as: A two-dimensional matrix, the matrix form of sample m; x p,n : represents the pth feature of sample m at time step n; X m×p×n : A three-dimensional tensor, a three-dimensional tensor of m samples; x m,p,n : Feature p of sample m at time step n; It is necessary to determine the number of samples m, the time step n to be predicted and the number of features p; Feature determination: The number of features is determined based on the Spearman correlation coefficient ρ in step B6. For features with |ρ|≥0.3, i.e., moderate correlation or above, the data features are determined as two-dimensional matrices or three-dimensional tensors to improve the performance and robustness of the model and avoid selecting features with a weak relationship with the target variable. Step C2: Temporal Convolutional Network Layer, Step C2.1: Dilated Causal Convolution Formula: Among them, F(s): the value of the output at position s after the convolution operation; x: input signal or input tensor; * d : represents the convolution operation with dilation factor; f: convolution kernel; s: current position or time step; d: expansion factor; k: the size of the convolution kernel; f(i): function of the convolution filter, X s-d·i : Data input at time step s; The expansion factor d increases exponentially with the number of layers L, d = [1,2,4,…,2 L ]; Step C2.2: The residual connection formula is X h =δ(G(X h-1 )+X h-1 ); Among them, δ(·) is the activation function, X h-1 is the output of the previous layer, G(·) is the transformation after dilated causal convolution, weight normalization, activation function and random dropout, X h is the output after residual connection; Step C2.3: Input the input tensor X into the temporal convolutional network structure, and the output tensor X1∈R after the dilated causal convolution m×n×p , the shape of the output tensor after the residual connection remains unchanged and remains as X2∈R m×p×n , but each element in X2 is already a new feature after the dilated causal convolution operation; the changes in the input tensor after the temporal convolutional network structure are mainly reflected in feature extraction and expansion. After the dilated causal convolution and residual connection, the shape of the input tensor remains unchanged, but the information contained in each feature vector becomes richer, capturing dependencies over a longer time range; Step C3: Bidirectional Gated Recurrent Unit Network Layer, Forward propagation formula: Back propagation formula: Hidden layer merging formula: in: is the output to the hidden layer before time t, is the reverse hidden layer output at time t, N t is the hidden layer output after merging at time t, α t , β t represents the weight coefficient, b t represents the bias coefficient; After the forward and backward GRU, the output tensor of the merged hidden layer is X3∈R m×p×n ; Step C4: Self-Attention layer, Calculate Query, Key, Value: Q = XW Q , K = XW K , V = XW V ; Among them, Query: query vector, used to represent the input of the current time step or position in the attention mechanism; Key: key vector, used to represent the characteristics of each input vector; Value: value vector, representing the actual information of each input vector; Calculate the attention weights: Weighted sum: output = Self-Attention(Q,K,V) = Attention(Q,K,V)·V; Where X is the input matrix, W Q , W K , W V They are the weight matrices of Query, Key and Value respectively, Q is the query matrix, K is the key matrix, V is the value matrix, d k is the dimension of the key vector; The output tensor Y1∈R after the Self-Attention layer m×p×n ; Step C5: Neural network layer, used to flatten the multi-dimensional matrix of input data into a one-dimensional vector, and convert the output of the convolutional layer or high-dimensional layer into the input form accepted by the fully connected layer; Input: a multidimensional matrix, Output: A one-dimensional vector containing all elements in the input matrix; The output matrix Y2∈R after the neural network layer m×pn , pn represents the product of p and n; Step C6: Fully connected layer, which integrates the output of the feature extraction layer and uses it for the final prediction or classification task through linear transformation and nonlinear activation, outputs the final prediction result, and receives the flattened vector for the final battery swap demand prediction; Y3=φ(W·Y2+b); Among them, Y3 is the output matrix of the fully connected layer, Y2 is the output matrix of the neural network layer, W is the weight matrix of the fully connected layer, b is the bias vector of the fully connected layer, and φ is the activation function; The output matrix Y3∈R after the fully connected layer m×1 ,In the matrix Y3 output by the fully connected layer, each element represents the predicted value of the battery swap demand of a specific battery swap station within the selected time interval. Step D: Model training and verification, select appropriate loss function and gradient optimization algorithm to improve the prediction accuracy of the model. The loss function is used to measure the difference between the model prediction value and the actual value. The gradient optimization algorithm iteratively updates the model parameters to minimize the loss function. Step E: Model effectiveness analysis, selecting evaluation indicators and comparative tests to verify the prediction effect of the model; Step F: Model prediction and application, predicting the battery swapping demand at different time intervals for m selected battery swapping stations based on the trained model; the model prediction results are used for operational decisions of the battery swapping stations.
2. The method for predicting battery swap demand at a battery swap station based on deep learning according to claim 1, characterized in that: Step B also includes the following steps: Step B1: Data cleaning, rechecking and proofreading the data for errors, including duplicate data, missing data, time anomaly data, out-of-range data, and irrelevant data; Step B2: Time slicing: Use the Pandas data processing tool in Python to slice the battery swapping data set into different time intervals of 15 minutes, 30 minutes, 1 hour, 3 hours, 6 hours, 12 hours, and 24 hours, and count the number of battery swapping events in each time segment; Step B3: Normalization processing, scaling the data to a specific range, specifically [0, 1] or [-1, 1], so that data with different features can be compared and processed on the same scale; The minimum-maximum normalization formula is as follows: X is the original data, X ′ is the normalized data, X max and X min are the minimum and maximum values of feature X respectively; Step B4: Analysis of the time characteristics of battery swapping data. The battery swapping demand data shows a certain time dependence, including daily and weekly periodicity of battery swapping demand. The battery swapping demand also shows a certain regularity in time, specifically peak and trough periods, seasonal changes, periodic changes, and trend changes. The time characteristics of the battery swapping data set of the battery swapping station are analyzed to mine the rich information contained in the data, thereby building a data-driven battery swapping demand prediction model to improve the prediction effect of the model. Step B5: Analyze the impact of weather factors on battery replacement demand, including temperature and rainfall; Step B6: Analyze the impact of other factors on battery replacement demand, including: holidays; Step B7: Use the Spearman correlation coefficient to calculate the correlation between various influencing factors and the demand for battery replacement; judge the strength of the correlation based on the absolute value of the Spearman correlation coefficient; the formula is as follows: where ρ is the Spearman correlation coefficient, d i is the rank difference of the ith observation, q is the number of observations, and 6 is a constant factor; The Spearman correlation coefficient ranges from -1 to 1. The closer the value is to 1, the stronger the positive correlation is. The closer the value is to -1, the stronger the negative correlation is. The closer the value is to 0, the less correlation there is. When determining the number of features, a threshold is set based on the absolute value of the Spearman correlation coefficient. Only features exceeding this threshold are selected for model training; the threshold range is as follows: |ρ|≥0.7: Highly correlated, indicating that there is a strong relationship between the feature and the target variable; 0.3≤|ρ|≤0.7: Moderate correlation, there is a moderately strong relationship between the feature and the target variable; |ρ|≤0.3: low correlation, the relationship between the feature and the target variable is weak; Step B8: The pre-processed data of battery swapping events, temperature and holidays are divided into training set, validation set and test set in a ratio of 8:1:
1.
3. The method for predicting battery swap demand at a battery swap station based on deep learning according to claim 1, characterized in that: Step D also includes the following steps: Step D1: Loss function selection, select the root mean square error to measure the difference between the predicted value and the actual value. Step D2: Optimization algorithm selection. The Adam optimizer updates parameters by calculating the first-order moment estimate and the second-order moment estimate of the gradient. Step D3: Model training, using the training set data to train the model and continuously update the model parameters; Step D4: Model validation: Use validation set data to validate the model. Based on the performance of the validation set, continuously adjust the model hyperparameters and select the best model structure.
4. The method for predicting battery swap demand at a battery swap station based on deep learning according to claim 1, characterized in that: Step E also includes the following steps: Step E1: Select evaluation indicators, mean absolute percentage error and root mean square error; The mean absolute percentage error is used for regression problems and represents the average absolute error between the predicted value and the true value as a percentage of the true value. The formula is as follows: Among them, y i is the true value of the i-th sample, is the predicted value of the i-th sample, and m is the number of samples; The root mean square error is used for regression problems and represents the square root of the mean of the squared errors between the predicted values and the true values. The formula is as follows: Step E2: Comparative test to verify that the overall performance of the model used is better than the existing benchmark method; Remove some features: gradually remove weather data and holiday data from the input features, and compare the impact of different features on model performance.
5. The method for predicting battery swap demand at a battery swap station based on deep learning according to claim 1, characterized in that: Step F also includes the following steps: Step F1: In the battery swap demand forecast, The time division of battery swap demand forecasting focuses more on demand changes in a short period of time, adapts to battery swap demand scenarios with strong dynamics, and has high real-time requirements; Short-term forecast: 5 minutes to 1 hour, suitable for real-time decision-making and real-time information push; Medium-term forecast: 1 to 12 hours, suitable for operation scheduling and resource optimization; Long-term forecast: 12 hours to 24 hours or longer, suitable for strategic planning and long-term decision-making; Step F2: Application of short-term battery swap demand forecast results, Real-time information push: Customers can check the number of available batteries and queue status at the battery swap station through the mobile app and choose a reasonable time and place for battery swap; Battery replacement reservation system: customers can make reservations for battery replacement services in advance to reduce waiting time; Real-time decision-making: real-time operations of operators, including price adjustment decisions and battery charging decisions; Step F3: Application of mid-term battery swap demand forecast results, Dynamic pricing: Encourage customers to switch batteries during off-peak hours to balance demand; Operational scheduling: mobilization of batteries and human resources to ensure supply in the next few hours; Charging plan: optimize the charging plan to avoid overcharging or undersupply of batteries, and arrange charging reasonably according to electricity prices; Step F4: Application of long-term battery replacement demand forecast results, Strategic Planning: Develop a day's operational strategy, including inventory management and staffing arrangements; Pricing strategy: Develop a dynamic pricing strategy for the day to balance supply and demand and optimize revenue; Resource allocation: Carry out long-term resource allocation and maintenance planning to ensure the normal operation of equipment and facilities.
Citation Information
Patent Citations
Method and system for predicting battery swap demand of battery swap station based on data driving
CN118014137A
Method and system for predicting battery replacement demand of electric vehicle based on time sequence
CN114943386A
Load prediction method considering multi-scale time sequence information
CN118013408A
