Multi-factor fusion electric vehicle charging station adjustable capacity prediction method
The adjustable capacity prediction method for electric vehicle charging stations, which integrates multiple factors, utilizes a dual-input fusion network and an improved sparrow search algorithm to address the issues of insufficient consideration of environmental factors and limitations in matching similar days in the prediction of adjustable capacity of charging stations, thereby achieving more accurate load and capacity prediction.
Patent Information
- Application Number
- CN202511046066.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2025-07-28
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-14
AI Technical Summary
Existing methods for predicting the adjustable capacity of electric vehicle charging stations fail to adequately consider environmental factors, resulting in unsatisfactory prediction results. Furthermore, the limitations of matching similar days lead to a decrease in model accuracy.
A multi-factor fusion method for predicting the adjustable capacity of electric vehicle charging stations is designed. By collecting and preprocessing historical load and weather data, a dual-input fusion network prediction model is established. The model is trained using an improved sparrow search algorithm and combined with consumer psychology theory on electricity price response intentions to obtain future load and adjustable capacity prediction values.
It improves the dimensionality of the input data for the prediction model, captures global dependencies, ensures the stability and accuracy of the prediction, and solves the problems of insufficient consideration of environmental factors and limitations in matching similar days.
Smart Images

Figure CN120952226A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of new energy regulation technology, specifically a multi-factor integrated method for predicting the adjustable capacity of electric vehicle charging stations. Background Technology
[0002] With the increasing severity of global environmental pollution and the energy crisis, governments and automakers worldwide are actively shifting towards the research and manufacturing of electric vehicles (EVs). The large-scale development of EVs is reshaping the operation of traditional power systems. Compared to gasoline-powered vehicles, EVs not only offer zero-emission environmental benefits, but their efficient electric drive systems also utilize resources more efficiently than traditional internal combustion engines. However, with the rapid growth in the number of EVs, their disorderly charging behavior may exacerbate the peak-valley difference in the power grid and even lead to localized line overloads. This contradiction precisely reveals the dual nature of EVs in the new power system: they are both potential loads requiring management and dispatchable distributed energy storage resources. Predicting the adjustable capacity of EV charging stations, as a primary task in managing and dispatching this distributed energy storage, is a current research hotspot.
[0003] Many researchers have already studied methods for predicting the adjustable capacity of electric vehicle charging stations. However, due to differences in research methods and model focuses, there is still no mature solution for predicting the adjustable capacity of electric vehicle charging stations. Data-driven methods for electric vehicle load forecasting are currently a research hotspot, including but not limited to: regression analysis, similarity day method, artificial neural network method, and support vector machine method.
[0004] Weather conditions have a significant impact on the charging demand of electric vehicles (EVs). In cold weather, EV battery performance deteriorates, reducing driving range and potentially requiring more frequent and longer charging sessions. Conversely, in warmer weather, battery performance remains relatively stable, though charging demand and duration may vary. Furthermore, extreme weather events such as heavy rain and blizzards can alter travel patterns and EV usage frequency, thus affecting charging load. If load forecasting methods do not consider weather factors, they struggle to accurately predict charging station loads under different weather conditions, failing to provide effective support for the power grid to cope with load fluctuations in varying weather conditions. Patent CN202411619671 (An EV Load Forecasting Method and System) focuses on predicting EV loads through processing household user bus load sequences and building specific models to improve forecast accuracy and optimize resource allocation. However, this patent lacks consideration of the dynamic impact of the external environment.
[0005] Patent CN202411070468 (A Parameter-Adaptive Electric Vehicle Load Prediction Method Based on Reinforcement Learning) relies on the grey relational coefficient method to select similar days by calculating the similarity of feature vectors such as electric vehicle charging volume, traffic flow, and charging pile utilization rate in historical data. However, when encountering sudden events, the travel and charging behavior of electric vehicles will undergo non-steady-state changes, and the similar day features in historical data cannot reflect such abnormal patterns, causing the correlation calculation to fail. Summary of the Invention
[0006] To address the shortcomings of existing technologies, the present invention aims to provide a multi-factor fusion method for predicting the adjustable capacity of electric vehicle charging stations, thereby solving the problem that existing methods for predicting adjustable capacity of charging stations do not adequately consider environmental factors, resulting in unsatisfactory prediction results; and addressing the limitation of similar day matching, which reduces the accuracy of existing prediction models.
[0007] The technical solution of this invention is to design a multi-factor fusion method for predicting the adjustable capacity of electric vehicle charging stations, which specifically includes the following steps:
[0008] S1: Collect historical load data of the target electric vehicle charging station for at least one year, with a resolution of 1 hour. Then, preprocess the historical load data, remove outliers, and fill missing values using mean interpolation. At the same time, obtain historical weather data of the area where the target electric vehicle charging station is located for the same time period as the above historical load data through publicly available data, including temperature T, humidity RH, visibility VI, precipitation R, and wind WP, with a resolution of 1 hour.
[0009] S2: Obtain training data based on the preprocessed historical load data and corresponding historical weather data;
[0010] S3: Establish a prediction model; the prediction model is a dual-input fusion network, which processes historical features and future features through two parallel branches, and finally fuses the features and outputs the prediction result.
[0011] S4: Train the prediction model based on the improved sparrow search algorithm to obtain the optimal prediction model;
[0012] S5: Using the optimal prediction model in S4, obtain the predicted value of the future load data of the target electric vehicle charging station for the target time period;
[0013] S6: Based on the predicted future load data of the target electric vehicle charging station for the target time period and the price elasticity model between electric vehicle demand response intention and electricity price based on consumer psychology theory, the predicted adjustable capacity of the target electric vehicle charging station for the same time period is obtained.
[0014] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0015] (1) By performing feature processing and extraction on the environmental factors of the charging station area, the dimension of the features is increased, making the factor dimensions contained in the input data of the prediction model richer, thus solving the problem that the existing charging station load prediction does not take environmental factors into account enough, resulting in unsatisfactory prediction effect.
[0016] (2) A prediction model containing a dual-input fusion network was constructed. Historical features and future features were processed through two parallel branches, and finally the features were fused and the prediction results were output. This prediction model can capture global dependencies and solves the problem that the limitations of similar day matching cause the accuracy of existing prediction models to decrease.
[0017] (3) The improved sparrow search algorithm is used to optimize the hyperparameters of the prediction model, so that the obtained optimal model not only has the best trainable parameters, but also the best hyperparameters, thus ensuring the stability and accuracy of the prediction data. Attached Figure Description
[0018] Figure 1 This is a schematic diagram illustrating the structure and principle of a prediction model for an embodiment of the multi-factor fusion method for predicting the adjustable capacity of electric vehicle charging stations according to the present invention.
[0019] Figure 2 This is a comparison chart showing the adjustable capacity of electric vehicle charging stations obtained by the multi-factor fusion adjustable capacity prediction method of the present invention, as an embodiment, and the adjustable capacity of electric vehicle charging stations obtained by other adjustable capacity prediction methods using LSTM, CNN-LSTM, and CNN-Transformer-LSTM models. Detailed Implementation
[0020] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0021] This invention provides a multi-factor fusion method for predicting the adjustable capacity of electric vehicle charging stations, which specifically includes the following steps:
[0022] S1: Collect historical load data for the target electric vehicle charging station for at least one year, with a resolution of 1 hour. Then, preprocess the historical load data, remove outliers, and fill in missing values using mean interpolation. Simultaneously, obtain historical weather data for the area where the target electric vehicle charging station is located for the same time period as the aforementioned historical load data through publicly available data (such as data from the meteorological station website where the charging station is located), including temperature (T), humidity (RH), visibility (VI), precipitation (R), and wind speed (WP), with a resolution of 1 hour.
[0023] To obtain information on the adjustable capacity of electric vehicles (EVs) at charging stations, it is necessary to predict the future adjustable capacity of these stations. Therefore, the most important input feature is the EV load at the charging station. Using the charging station operator's statistical system as an example, historical charging station load data with a one-year timeframe and a one-hour resolution is collected, including 8760 data points, denoted by L. The collected historical EV charging station load data is preprocessed to remove outliers caused by statistical errors by the charging station operator, and missing values are filled using mean interpolation.
[0024]
[0025] In the formula: L qs,o For operators, missing values of charging station load are counted, where 'o' is the time-series label of the missing value.
[0026] Outliers were identified using the interquartile range method based on periodic grouping. The 8760 load data points were divided into 24 groups by hour, with each group corresponding to the 0th to 23rd hour of each day, and each group containing 365 data points.
[0027] Calculate the first quartile Q for the Kth data set. 1,k The third and fourth quartiles Q 3,k and interquartile distance I QR,k .
[0028] I QR,k =Q 3,k -Q 1,k (2)
[0029]
[0030] In the formula: L yc,o To help operators identify outliers in the charging station load; The abnormal threshold is set to 3; o = k, k+24, k+2×24, ..., k+364×24.
[0031] Meanwhile, weather data for the same period of the charging station's load, including temperature (T), humidity (RH), visibility (VI), precipitation (R), and wind force (WP), were obtained from publicly available meteorological data.
[0032] Temperature (T) is expressed in degrees Celsius. Humidity (RH) is expressed in relative humidity. Visibility is expressed in kilometers, with 20 kilometers or more indicated by 20. Precipitation is categorized into five levels based on hourly precipitation: R=0 for no precipitation, R=1 for light rain, R=2 for moderate rain, R=3 for heavy rain, and R=4 for torrential rain or worse. Wind speed (WP) is expressed using the Beaufort scale.
[0033] S2: Obtain training data based on the preprocessed historical load data and corresponding historical weather data.
[0034] S2.1: Extract additional feature data from the prediction model
[0035] First, the time feature H of historical load data is extracted using a periodic coding method. sin H cos W sin W cos The discrete time variables hour and weekday are mapped to a continuous cyclic coordinate system using sine and cosine functions, and mathematically, this mapping satisfies equation (4). This encoding method fully preserves the phase information of time points through the orthogonality of trigonometric functions, forming a compact circular distribution in the feature space. This enables the neural network to simultaneously identify the periodicity and absolute phase position of the time series, effectively improving the model's ability to model the day-night and week-week cyclic patterns of power load.
[0036]
[0037] In the formula: t hour For hourly variables; t week H is the day of the week variable (i.e., the day of the week for the current day); sin H is the hourly variable mapped from the sine function. cos The hourly variable is the result of mapping the cosine function; W sin W is the weekday variable mapped from a sine function. cos The weekday variable is the result of mapping the cosine function.
[0038] Considering that the charging load of electric vehicles during the day and night has little correlation with temperature, and to eliminate the impact of seasonal temperature differences on the prediction model, daytime temperature abrupt events are captured to improve prediction accuracy. The temperature is differentially processed to obtain the diurnal temperature difference ΔT:
[0039] ΔT(t)=T(t)-T(t-12) (9)
[0040] In the formula: T(t) is the temperature at the current time t; T(t-12) is the temperature 12 hours ago.
[0041] Considering that extreme, sudden gusts have little impact on the charging load of electric vehicles, to mitigate the impact of extreme gusts on the accuracy of electric vehicle load prediction, a 6-hour moving average of the wind force is used to obtain the wind smoothness W. pma :
[0042]
[0043] In the formula: t is the current time point, and WP(tj) is the wind speed in the j-th hour in the past.
[0044] The Driver Comfort Index (HI) is a quantification of human perception of temperature and humidity, widely used in meteorology and energy load forecasting, and can measure a driver's willingness to travel. The Driver Comfort Index (HI) is derived from temperature and humidity:
[0045]
[0046] In the formula: HI(t) is the driver comfort index at time t; T(t) is the temperature of the charging station at time t; RH(t) is the humidity of the charging station at time t.
[0047] The raw features include preprocessed historical load data L and corresponding historical weather data. The historical weather data, serving as the raw weather features, includes data on temperature T, humidity RH, visibility VI, precipitation R, and wind WP, represented by matrix A.
[0048] A = [T,RH,VI,R,WP] (12)
[0049] The additional feature data includes time features and additional weather features, wherein the additional weather features include diurnal temperature range ΔT and wind smoothness W. pma The driver comfort index (HI) data is represented by matrix B:
[0050] B=[ΔT,W pma ,HI] (13)
[0051] Time features include H sin H cos W sin W cos Represented by matrix H:
[0052] H = [H] sin H cos W sin W cos (14) S2.2: For the preprocessed historical load data, the corresponding historical weather data, and the additional feature data extracted in step S2.1, divide the data into training sets by time point order, with the remainder as validation sets.
[0053] S2.3: Standardize each feature in the training and validation sets separately to obtain the training and validation datasets. The standardization formula is:
[0054]
[0055] In the formula: x is the value of a certain element of a certain feature in the original model; x min The original minimum value of this feature; x max This represents the original maximum value of the feature; x one The output value is the standardized value of the element for this feature.
[0056] S2.4: For both the training and validation datasets, a sliding window with a stride of N+M is used for slicing and sampling, resulting in several training samples for both datasets. A training sample X... z Includes a historical feature input matrix with a duration of N. Following The subsequent future feature input matrix with a duration of M And following in The subsequent future load feature matrix with a duration of M
[0057]
[0058] In the formula: The input matrix is a historical feature matrix of duration N, including a standardized weather feature matrix of duration N. Additional weather features of duration N after standardization Standardized historical load feature matrix with duration N The standardized time feature matrix of duration N To connect in The subsequent future feature input matrix of duration M, including the standardized continuation... The subsequent weather feature matrix with a duration of M Standardized sequence Subsequent additional weather features of duration M Standardized sequence The subsequent time feature matrix with a duration of M The subscript 'one' represents the feature value obtained after standardization by equation (15) in S2.3. The historical feature input matrix of a training sample. and future feature input matrix The future load feature matrix serves as input to the prediction model. As the true value relative to the predicted output obtained by the prediction model based on the input.
[0059] As one example, N=168, M=24, and a training sample includes 192 consecutive hours of data.
[0060] S3: Establish a prediction model
[0061] The prediction model is a dual-input fusion network that processes historical and future features through two parallel branches, ultimately fusing the features and outputting the prediction result. The prediction model consists of three main parts: a historical feature branch model, a future feature branch model, and a feature fusion processing model. The historical feature branch model includes a CNN convolutional neural network, a Transformer feature extraction module, and a BiLSTM-LSTM module. The CNN convolutional neural network includes an input layer, convolutional layers, Swish activation function layers, and fully connected layers.
[0062] The input layer receives training samples X. z Historical feature input matrix The historical feature input matrix of a batch of training samples is data X. CNN1 Its shape is (κ, N, 13), where κ is the training batch size; as an example, N is 168, that is, the data X CNN1 The sequence consists of κ historical feature input matrices, each with a duration of 7 days. The convolutional layer has a kernel size of β1 and ρ1 filters. The historical feature input matrices of a batch of training samples are processed sequentially through the convolutional layer, the Swish activation function layer, and the fully connected layer to obtain the feature sequence C1, as shown in equation (18):
[0063] C1 = CNN(X) CNN1 (18)
[0064] The feature sequence C1 has a shape of (κ, N, ρ1), and this CNN convolutional neural network expands the 13-dimensional input features to ρ1 dimensions.
[0065] The Transformer feature extraction module includes an input layer, a multi-head attention mechanism layer, a first residual connection layer (Add(x)), a first normalization layer (LayerNorm1), a feedforward network layer (Dense()), a second residual connection layer (Add(X)), and a second normalization layer (LayerNorm2). The input layer receives the feature sequence C1 output by the CNN convolutional neural network and then inputs it to the multi-head attention mechanism layer. The multi-head attention mechanism layer first transforms the data of each training sample in the feature sequence C1 into a matrix of query, key, and value for x self-attention heads through x linear transformations, where the query matrix Q of the h-th head corresponding to the i-th training sample is... h,i Key matrix K h,i Value matrix V h,i for:
[0066] Q h,i =C 1,i ·WQ,h,i (19)
[0067] K h,i =C 1,i ·W K,h,i (20)
[0068] V h,i =C 1,i ·W V,h,i (twenty one)
[0069] In the formula: i is the data sequence index of this batch, corresponding to the i-th training sample of this batch; C is the learnable weight matrix for the h-th head of the i-th training sample in this batch; 1,i d represents the data corresponding to the i-th training sample in the feature sequence C1; k d v For each head's query dimension, d k =d v =δ.
[0070] Then, the output of a single self-attention head for the i-th training sample is calculated to measure the attention of each time step to other time steps:
[0071]
[0072] In the formula: softmax normalizes the scores into a probability distribution, thus obtaining the attention weight matrix.
[0073] Then, the outputs of the χ self-attention heads of the i-th training sample are concatenated and mapped back to the original feature dimension ρ1:
[0074] MultiHead(Q i ,K i V i =Concat(head) 1,i ,...,head h,i ,...,head χ,i )·W T (twenty three)
[0075] head h,i =Attention(Q) h,i ,K h,i V h,i ) (twenty four)
[0076] In the formula: χ represents the number of attention heads; Concat(head) 1,i ,head 2,i ,...,head χ,i ) is a concatenation matrix of x heads; For the dimension mapping matrix, Concat(head) 1,i ,head 2,i ,...,head χ,i The concatenated matrix is mapped back to the original feature dimension ρ1.
[0077] Therefore, the output of the multi-head self-attention mechanism layer for a batch of κ training samples is:
[0078] MultiHead(Q,K,V)=[MultiHead(Q1,K1,V1),...,MultiHead(Q i ,K i V i ),...,MultiHead(Q κ ,K κ V κ (25)
[0079] The output of the multi-head self-attention mechanism layer and the feature sequence C1 received by the input layer are joined by a residual connection in the first residual connection layer (Add(x)). The result is then input into the first normalization layer. The first normalization layer first standardizes the features of each dimension of the input data, taking the feature data X of dimension G as an example. G Process description:
[0080]
[0081] In the formula: μ is the feature data X of dimension G. G The mean; σ 2 X is the variance of the feature data; D is the total number of elements in the feature data; ε1 is a constant to prevent division by zero; X G,ζ This is the value of the ζ-th element of the feature data before standardization; This is the standardized value of the ζ-th element of the feature data.
[0082] Then, learnable scaling and translation parameters, X, are added to the standardized values. G,ζ After processing by the first normalization layer, the feature element Y is obtained. G,ζ Its formula is:
[0083]
[0084] In the formula: γ ζ Let β be the learnable scaling parameter for the ζ-th element; ζ Let be the learnable translation parameter of the ζ-th element.
[0085] Feature data X of dimension G GEach element in the equation is normalized according to equations (26)-(29) to obtain a new feature of dimension G, Y. G The process is defined as equation (30):
[0086] Y G =LayerNorm(X G (30)
[0087] The feature data of each dimension of the data input to the first normalization layer are processed according to formulas (26)-(30) to obtain the feature sequence C2 as follows:
[0088] C2=LayerNorm1(C1+MultiHead(Q,K,V)) (31)
[0089] In the formula, the shape of the feature sequence C2 is (κ, N, ρ1).
[0090] The feature sequence C2 output from the first normalized layer is input into the feedforward network layer for nonlinear transformation and feature enhancement:
[0091] FFN(C2)=W2·ReLU(W1·C2+b1)+b2 (32)
[0092] In the formula: d represents the linear transformation weights of the first layer of the feedforward network. ff As the intermediate dimension, d ff =4ρ1; The bias is applied to the first-layer linear transformation node of the feedforward network. d represents the weights of the second layer linear transformation of the feedforward network. ff As the intermediate dimension, d ff =4ρ1; is the bias of the second-layer linear transformation node of the feedforward network; ReLU is the activation function.
[0093] The output FFN(C2) of the feedforward network layer is processed sequentially through the second residual connection layer (Add(X)) and the second normalization layer (LayerNorm2) to obtain the final feature sequence C3 output by the Transformer feature extraction module. Its shape is (κ, N, ρ1), and the formula is:
[0094] C3=LayerNorm2(C2+FNN(C2)) (33)
[0095] The working principle and process of the second normalization layer are the same as those of the first normalization layer.
[0096] The BiLSTM-LSTM module comprises a BiLSTM module and an LSTM module. The BiLSTM module includes two parallel LSTM layers in forward and backward directions to capture past and future contextual information. The hyperparameters are set so that each LSTM layer has ω1 LSTM units. The output of the BiLSTM module serves as the input to the LSTM module, which includes a unidirectional LSTM layer that extracts the feature representation at the final time step. Its initial hyperparameters are set to contain ω2 LSTM units.
[0097] The LSTM layer controls the flow of information through forget gates, input gates, and output gates. The data processing principle formula of the LSTM unit at time step j is as follows:
[0098] E j =sig(U E ·X L,j +W E ·H L,j-1 +b E (34)
[0099] I j =sig(U I ·X L,j +W I ·H L,j-1 +b I (35)
[0100] O j =sig(U O ·X L,j +W O ·H L,j-1 +b O (36)
[0101]
[0102] H L,j =O j ⊙tanh(C j (39)
[0103] In the formula: E j U is the output of the forget gate of the LSTM unit at time step j; E Enter X for the forget gate L,j The weight matrix W E Input H for the forget gate L,j-1 The weight matrix; b E I is the forget gate bias matrix; j The output of the input gate of the LSTM unit at time step j; U I Input X to the input gate L,j The weight matrix WI The input H of the input gate L,j-1 The weight matrix; b I The bias matrix of the input gate; O j The output of the LSTM cell at time step j is the output gate; U O The input X of the output gate L,j The weight matrix W E The input H of the output gate L,j-1 The weight matrix; b O This is the bias matrix for the output gate; b represents the candidate memory cell state at time step j; C For memory cell bias; C j H represents the memory cell state at time step j; L,j Here are the hidden layer states at time step j; sig() is the sigmoid activation function; tanh() is the tanh activation function; H L,j-1 For the hidden state at time step j-1, C j-1 This represents the memory cell state at time step j-1.
[0104] From equations (34) to (39), it can be seen that the output of an LSTM layer is the hidden state H. L .
[0105] H L =LSTM(X) L (40)
[0106] In the above formula, X L This is the input to the LSTM layer.
[0107] BiLSTM is a significant improvement over traditional LSTM. It constructs two independent LSTM structures in parallel, one for forward and one for backward propagation. This allows the model to simultaneously capture historical sequence features prior to time j and future sequence context when processing information at time j. This bidirectional information exchange mechanism significantly enhances the completeness and accuracy of time series feature extraction, effectively improving the overall performance of the model in sequence modeling tasks. At each time step j, the two LSTM units of the BiLSTM module output the forward hidden state and the backward hidden state, respectively. These two states are concatenated to form the output H of the BiLSTM layer. BiL .
[0108]
[0109] In the formula: The hidden state output by the forward LSTM layer; This represents the hidden state output by the inverse LSTM layer.
[0110] In summary, the feature sequence C3 output by the Transformer feature extraction module is processed by the BiLSTM-LSTM module to obtain the output feature sequence C4, which has the shape (κ, ω2), and the formula is:
[0111]
[0112] In the formula: This indicates the processing by a BiLSTM module that has ω1 LSTM units in each direction; This indicates processing by an LSTM module containing ω² LSTM units.
[0113] The feature sequence C4 output by the BiLSTM-LSTM module is the output of the historical feature branch model.
[0114] The future feature branching model includes a CNN convolutional neural network, a global max pooling layer, and an LSTM module. The CNN convolutional neural network includes an input layer, convolutional layers, and a Swish activation function layer. The input layer receives training samples X. z Future feature input matrix The future feature input matrix of a batch of training samples is data X. CNN2 Its shape is (κ, M, 12), including the data for the day to be predicted, where κ is the training batch size; in one embodiment, M is 24, meaning the sample is a sequence composed of κ future feature input matrices with a duration of 1 day. The convolutional layer has a kernel size of β2 and ρ2 filters. The future feature input matrices of a batch of training samples are processed sequentially through this convolutional layer and the Swish activation function layer, and the results are then processed through a global max pooling layer to obtain the feature sequence. for:
[0115]
[0116] In the above formula, [·] MP This indicates the execution of a global max pooling operation, for the feature sequence. The shape is (κ, M, ρ2), and this CNN convolutional neural network expands the 12-dimensional features of the input to ρ2 dimensions.
[0117] The LSTM module includes a unidirectional LSTM layer with ω³ LSTM units, used to extract the feature representation at the final time step, and the feature sequence output by the global max pooling layer. After processing by this LSTM module, the feature sequence is obtained. Its shape is (κ, ω3), and the formula is:
[0118]
[0119] Feature sequences output by the LSTM module This is the output of the future feature branch model.
[0120] The feature fusion processing model comprises a feature fusion layer (Concatenate), a first fully connected layer (L2 regularization), a Dropout regularization unit, and a second fully connected layer (Dense). The input to the feature fusion layer is the ω² feature sequence C4 output by the historical feature branch model and the ω³ feature sequence output by the future feature branch model. The feature sequence C5 is fused into ω2+ω3 dimensions through a feature fusion layer, as shown in the formula:
[0121]
[0122] The shape of the characteristic sequence C5 is (κ, ω2+ω3).
[0123] The first fully connected layer performs a linear transformation operation. The feature sequence C5 output by the feature fusion layer is used as the input of the fully connected layer, and the output feature sequence C6 is given by the formula:
[0124] C6 = W Q ·C5+b Q (46)
[0125] In the formula: W Q b is the weight matrix of the first fully connected layer; Q This is the bias of the first fully connected layer.
[0126] The weight matrix W of the first fully connected layer Q The sum of squares is used as a penalty term for the training loss to prevent the model from over-relying on a few features and to suppress excessively large weight values.
[0127] The bias W of the first fully connected layer Q L2 regularization is performed by adding the sum of squared weights as a penalty term to the loss function. The L2 regularized loss function L is:
[0128]
[0129] In the formula: L date λ is the original loss of the model; λ is the regularization coefficient.
[0130] The Dropout regularization unit contains the same number of neurons as the first fully connected layer, and is used to receive the output of the first fully connected layer. Each neuron is either temporarily dropped (i.e., its output is set to zero) with probability p, or retained with probability 1-p. To maintain the expected value of the data sequence output, the output of the retained neurons needs to be scaled by a factor of 1 / (1-p).
[0131] The feature sequence C6 output from the first fully connected layer is used as the input to the Dropout regularization unit, and the Dropout regularization unit outputs the feature sequence C7, as shown in the formula:
[0132]
[0133] In the formula: feature sequence C6 is the input vector; m is a mask vector with the same dimension as C6, each element of which is independently sampled from the Bernoulli distribution Bernoulli(1-p); ⊙ represents element-wise multiplication; p is the dropout probability, i.e., the probability that the neuron is set to zero. The feature sequence C7 output by the Dropout regularization unit has the shape (κ, ω2+ω3).
[0134] The input to the second fully connected layer is the feature sequence C7 output by the Dropout regularization unit, and the output is the future load feature matrix of κ time steps corresponding to a batch of input training samples, predicted by the prediction model.
[0135]
[0136] In the formula: W C b is the weight matrix of the second fully connected layer; C For the bias of the second fully connected layer; The shape is (κ, M).
[0137] S4: Training a prediction model based on an improved sparrow search algorithm
[0138] S4.1: Given the range of values for the hyperparameters of the prediction model, the hyperparameters of the historical feature branch model are: the number of filters ρ1 of the CNN convolutional neural network, with an optimization range of [16,256], and the kernel size β1, with an optimization range of [3,12]; the number of heads χ of the multi-head self-attention mechanism of the Transformer feature extraction module, with an optimization range of [4,10], and the query dimension δ of each head, with an optimization range of [8,128]; the number of LSTM units ω1 of the LSTM layer in each direction of the BiLSTM module, with an optimization range of [8,256]; and the number of LSTM units ω2 of the LSTM module, with an optimization range of [8,256].
[0139] The hyperparameters of the future feature branch model include the number of filters ρ2 of the CNN convolutional neural network, with an optimization range of [16,256], the kernel size β2 with an optimization range of [3,12], and the number of LSTM units ω3 of the LSTM module with an optimization range of [8,256].
[0140] The global hyperparameters include: the initial learning rate LR0, whose value ranges from [1e...]. -6 ,1e -2 The dropout rate p of the Dropout regularization unit ranges from [0.05, 0.6]; the training batch size κ has an optimization range of [32, 512]. To ensure that all hyperparameter optimization mappings are integer mappings, the initial learning rate LR0 is set to an optimization range of [1, 1e] during hyperparameter optimization. 4 The dropout rate p of the Dropout regularization unit is set to the optimization range of [5, 60], and the optimization result is mapped back to the value range and then substituted into the prediction model.
[0141] S4.2: Set the maximum number of iterations N for the improved sparrow search algorithm. max The sparrow population size is 50, N. zq Set to 25, initialize each hyperparameter of the prediction model through equation (50) to obtain 25 sets of hyperparameters with different values, corresponding to 25 prediction models; use random assignment method to initialize the trainable parameters of each prediction model, and the initialization of each prediction model is completed.
[0142] X C,u,w =round[lb w +(ub w -lb w [ )·rand(0,1)] (50)
[0143] In the formula: u is the sparrow individual index; w is the hyperparameter dimension index, corresponding to the number of hyperparameter categories; X C,u,w This represents the position (i.e., value) of the w-th hyperparameter of the u-th sparrow; lb w ub is the lower bound of the w-th hyperparameter; w The upper bound of the w-th hyperparameter is given; rand(0,1) is a random number that follows a uniform distribution between the interval (0,1); round() is the rounding function.
[0144] S4.3: Train the 25 initialized prediction models from S4.2 using the training dataset. Input a batch of training samples from the training dataset into one of the initialized prediction models in S4.2. This model outputs predicted values of future load characteristics for M time points in a batch. The sum of the Huber loss and L2 regularization loss of k training samples in a batch is used as the training loss L.
[0145]
[0146] In the formula: T C,v This represents the true value of the v-th training sample corresponding to the batch of prediction results; This is the predicted value for the v-th training sample corresponding to the batch of prediction results. For the prediction results of this batch, the prediction result corresponds to the vth training sample. One true value; For the prediction results of this batch, the prediction result corresponds to the vth training sample. The predicted values are M, where M is the number of time points in the prediction results for a training sample. In this embodiment, M = 24; δ h The threshold for error segmentation is set to 0.5; v is the index of the corresponding training sample in this batch of prediction results; W Qτ W is the weight matrix of the first fully connected layer. Q One of the element values, E is the weight matrix W Q The total number of elements in the dataset. λ is the regularization coefficient, with a value of 1e. -4 .
[0147] Based on the training loss of a batch of training samples in the training dataset, the trainable parameters of the prediction model are updated once using the gradient descent algorithm, completing the training of one batch. The trainable parameters of the prediction model after completing one batch of training are used as the initial trainable parameters for the next batch of training, and the training process is repeated for one batch until the last batch of training samples in the training dataset is completed, at which point the training of the prediction model is finished.
[0148] The specific process of updating the trainable parameters of the prediction model using the gradient descent algorithm is as follows:
[0149] For each trainable parameter θ (weights W and bias b) in the prediction model, the gradient is g. s :
[0150]
[0151] In the formula: s is the batch index, L s Let represent the total loss function for the s-th batch of training data.
[0152] Update the trainable parameters based on the gradient calculation results. Calculate the first-moment estimate of the gradient:
[0153]
[0154] Where: G 1,s h1 is the first moment estimate of the gradient of the s-th batch of data; h1 is the first decay rate, which is taken as 0.9.
[0155] Calculate the second moment estimate of the gradient:
[0156]
[0157] Where: G 2,s h1 represents the second moment estimate of the gradient of the s-th batch of data; h2 is the second decay rate, which is set to 0.999.
[0158] Correcting the deviations between the first and second moments:
[0159]
[0160] Trainable parameter updates:
[0161]
[0162] In the formula: ε2 is a constant to prevent division by zero; θ s+1 LR(s) represents the trainable parameters of the updated prediction model corresponding to the (s+1)th batch of data; LR(s) represents the current learning rate.
[0163] The learning rate is dynamically updated using the cosine annealing algorithm, the core of which is to achieve a periodic and smooth decay of the learning rate through a cosine function. The update formula for the learning rate LR(s) is:
[0164]
[0165] In the formula: s is the current training step number, i.e. the index of the current training batch; LR0 is the initial learning rate; H is the total number of decay cycles, i.e. the total training steps of the prediction model, i.e. the training samples of the training dataset are trained in H batches; α is the final learning rate scaling factor, with a value of 0.1.
[0166] S4.4: Input the training samples from the validation dataset into the 25 trained prediction models from S4.3. Each prediction model outputs the predicted value for the corresponding training sample, and calculates the evaluation metric R for each prediction model. 2 We calculate the fitness function value of the hyperparameters of each prediction model, including MAPE and MAE.
[0167] R 2 R measures the model's ability to explain the variability of the target variable, with values ranging from [0,1]. 2=1: The model perfectly fits the data (the predicted values are exactly the same as the actual values). R 2 =0: The model is equivalent to directly using the mean of the target variable for prediction. R 2 <0: The model performs worse than the mean prediction.
[0168]
[0169] In the formula: Y Z To verify the true values of future load data at M time points of the training samples in the dataset, To be with Y Z The predicted value output by the corresponding prediction model; Y Z,g This represents the true value of the future load characteristics at time points M for the g-th training sample in the validation dataset. To be with Y Z,g The corresponding prediction model outputs the predicted value, where P is the number of training samples in the validation dataset; Y Z,g,n To verify the true value of the future load feature at the nth time point out of the M time points of the g-th training sample in the dataset, To be with Y Z,g,n The predicted value output by the corresponding prediction model, To verify the mean of the true values of the future load characteristics at M time points of the g-th training sample in the dataset.
[0170] MAPE measures the average relative percentage error between the predicted and actual values, reflecting the proportional error of the prediction accuracy relative to the actual value.
[0171]
[0172] MAE can accurately reflect the magnitude of the actual prediction error. MAE evaluates the degree of deviation between the true value and the fitted value. The closer the MAE value is to 0, the better the model fit and the higher the model prediction accuracy.
[0173]
[0174] The fitness function F of the hyperparameters of the prediction model is:
[0175]
[0176] In the formula: ψ1, ψ2, and ψ3 are the fitness function weights, which are 0.3, 0.3, and 0.4 respectively.
[0177] Calculate the fitness function value of the hyperparameters of each prediction model, and sort them from largest to smallest according to the fitness function value. The hyperparameter value corresponding to the prediction model with the largest fitness function value is taken as the global optimal position. The top 20% of the hyperparameter values are taken as the producer positions in the sparrow search algorithm, the bottom 10% are taken as the watcher positions in the sparrow search algorithm, and the rest are taken as the follower positions. This completes one iteration of training.
[0178] S4.5: Increment the iteration step by 1, and then update the values of the 25 hyperparameters according to the improved sparrow search algorithm.
[0179] Adaptive producer position update formula:
[0180]
[0181] In the formula: u is the sparrow individual index; w is the hyperparameter dimension index; f is the current number of iterations completed; This indicates the position of the w-th hyperparameter of the u-th sparrow in the (f+1)-th iteration; This indicates the position of the w-th hyperparameter of the u-th sparrow in the f-th iteration; The globally optimal position; The location is randomly generated for search enhancement; c1(f) is an adaptive exploration factor; c 1,cs The initial exploration intensity is set to 1.5; τ1 is the decay coefficient, with a value of 2; c2(f) is the dynamic exploration weight; c 2,cs Initial weighting coefficients, set to 1; N max r1 and r2 are the maximum number of iterations for optimizing the model hyperparameters; r1 and r2 are random numbers uniformly distributed in the interval [0,1].
[0182] Follower position update formula:
[0183]
[0184] In the formula: u is the sparrow individual index; w is the hyperparameter dimension index; f is the current number of iterations completed; This indicates the position of the w-th hyperparameter of the u-th sparrow in the (f+1)-th iteration; This indicates the position of the w-th hyperparameter of the u-th sparrow in the f-th iteration; This represents the worst position in the population during the f-th iteration, i.e., the position with the smallest corresponding fitness function value. Let Q be the optimal position of the producer in the f-th iteration; Q is a random matrix whose elements follow a normal distribution; A sc Given a random matrix, For A sc transpose of A sc The inverse matrix of the product of E;sc c is the identity matrix; c3(f) is the dynamic convergence factor; c 3,cs τ is the initial convergence coefficient, taken as 0.5; τ2 is the decay coefficient, taken as 2.
[0185] Adaptive monitor position update formula:
[0186]
[0187] In the formula: u is the sparrow individual index; w is the hyperparameter dimension index; f is the current number of iterations completed; This indicates the position of the w-th hyperparameter of the u-th sparrow in the (f+1)-th iteration; c represents the position of the w-th hyperparameter of the u-th sparrow in the f-th iteration; c4 is the periodic fluctuation factor; c5 is the perturbation coefficient, which is 0.1; r3 is a random number that follows a Gaussian distribution in the interval [0,1].
[0188] S4.6: Based on the updated values of the 25 sets of hyperparameters, 25 corresponding prediction models are obtained. The trainable parameters of each prediction model are initialized using a random assignment method, and the initialization of each prediction model is completed. Then, the process of steps S4.3-S4.6 is repeated until the number of iterations reaches the set maximum value. The global optimal position obtained in the last iteration is the optimal set of hyperparameter values, and the prediction model that has been trained is the optimal prediction model.
[0189] S5: Obtain weather data X for the target electric vehicle charging station area in S1, with a predicted duration of M and a resolution of 1 hour, including temperature, humidity, visibility, precipitation, and wind speed. OM Simultaneously, acquire the same weather data with a duration of at least N and a resolution of 1 hour preceding it, as well as the historical load data X of the target electric vehicle charging station within the same time period with a duration of at least N and a resolution of 1 hour. ON Then, the load data of the electric vehicle charging stations is preprocessed according to the method in S1, and the historical feature input matrix X with a duration of N is obtained according to the method in S2. h And the future feature input matrix X with a duration of M following it in the time dimension. p Input historical features into matrix X h Future feature input matrix X p The data is input into the optimal prediction model in S4 to obtain the predicted value of the future load feature matrix of the target electric vehicle charging station with a duration of M and a resolution of 1 hour. This predicted value of the future load feature matrix is then de-standardized to obtain the target electric vehicle charging station's weather data X. OM The predicted value of future load data with a duration of M and a resolution of 1 hour within the same time period.
[0190] The denormalization process is the inverse operation of formula (15), where the original minimum value of the feature x min Take historical load data X O The minimum value in the value, the original maximum value of the feature x max Take historical load data X O The maximum value in.
[0191] S6: Adjustable capacity prediction for target electric vehicle charging stations
[0192] Based on the target electric vehicle charging station and weather data X OM The adjustable capacity of the target electric vehicle charging station during the same time period is predicted using the predicted values of future load data with a duration of M and a resolution of 1 hour.
[0193] The adjustable capacity of electric vehicle charging stations is related to the willingness of electric vehicle users to participate. A demand-response willingness model for electric vehicle users is constructed to predict the adjustable capacity ΔQ of electric vehicle charging stations. total .
[0194] Based on consumer psychology theory, the relationship between the willingness to respond to electric vehicle demand and electricity prices can be represented by a price elasticity model.
[0195]
[0196] In the formula: Let ΔP be the price elasticity coefficient at time t; t The adjustable capacity of the target electric vehicle charging station at time t; The future load data for the target electric vehicle charging station at time point t predicted in S5; Δc dt c represents the change in charging price between time t and time t-1; dt The charging price at time t-1. The predicted adjustable capacity ΔQ of the target electric vehicle charging station during the same time period. total The calculation formula is:
[0197]
[0198] In the formula: when M = 24, ΔQ total This represents the predicted total adjustable capacity of electric vehicle charging stations for a single day.
[0199] To verify the prediction performance of the prediction method of this invention, prediction methods using LSTM, CNN-LSTM, and CNN-Transformer-LSTM models were trained on the same training, validation, and test sets, and the load prediction performance was tested on the test set. Except for the prediction model, all other steps are the same as in the prediction method of this invention. R is used on the test set. 2 The MAPE and MAE indicators were used for evaluation, and the prediction results are shown in Table 1.
[0200] Table 1. Prediction performance of different prediction models
[0201]
[0202]
[0203] The data in Table 1 show that, guided by the prediction method of this invention, the prediction effects of different prediction models are all good, and the prediction model of the prediction method of this invention has the best prediction effect. Meanwhile, Figure 2 The figure shows the predicted load values of a data sample in the test set by different prediction models. It can also be seen that the prediction results of the prediction method of the present invention are closest to the actual load curve.
[0204] Any aspects not covered in this invention are applicable to existing technologies.
Claims
1. A multi-factor fusion method for predicting the adjustable capacity of electric vehicle charging stations, characterized in that, The method specifically includes the following steps: S1: Collect historical load data of the target electric vehicle charging station for at least one year, with a resolution of 1 hour. Then, preprocess the historical load data, remove outliers, and fill missing values using mean interpolation. At the same time, obtain historical weather data of the area where the target electric vehicle charging station is located for the same time period as the above historical load data through publicly available data, including temperature T, humidity RH, visibility VI, precipitation R, and wind WP, with a resolution of 1 hour. S2: Obtain training data based on the preprocessed historical load data and corresponding historical weather data; S2.1: Extract additional feature data from the prediction model First, the time feature H of historical load data is extracted using a periodic coding method. sin H cos W sin W cos The discrete time variables hour and weekday are mapped to a continuous cyclic coordinate system through sine and cosine functions, and mathematically, this mapping satisfies equation (4). In the formula: t hour For hourly variables; t week H is the weekday variable; sin H is the hourly variable mapped from the sine function. cos The hourly variable is the result of mapping the cosine function; W sin W is the weekday variable mapped from a sine function. cos The weekday variable is the result of mapping the cosine function. The temperature is differentially processed to obtain the diurnal temperature difference ΔT: ΔT(t)=T(t)-T(t-12) (9) In the formula: T(t) is the temperature at the current time t; T(t-12) is the temperature 12 hours ago; The wind smoothness W is obtained by performing a 6-hour moving average on the wind force. pma : In the formula: t is the current time point, and WP(tj) is the wind speed in the j-th hour in the past; Based on temperature and humidity, the driver comfort index (HI) is obtained: In the formula: HI(t) is the driver comfort index at time t; T(t) is the temperature of the charging station at time t; RH(t) is the humidity of the charging station at time t. The raw features include preprocessed historical load data L and corresponding historical weather data. The historical weather data, serving as the raw weather features, includes data on temperature T, humidity RH, visibility VI, precipitation R, and wind WP, represented by matrix A. A = [T,RH,VI,R,WP] (12) The additional feature data includes time features and additional weather features, wherein the additional weather features include diurnal temperature range ΔT and wind smoothness W. pma The driver comfort index (HI) data is represented by matrix B: B=[ΔT,W pma ,HI] (13) Time features include H sin H cos W sin W cos Represented by matrix H: H=[H sin ,H cos ,W sin ,W cos ] (14) S2.2: For the preprocessed historical load data, the corresponding historical weather data, and the additional feature data extracted in step S2.1, divide the data into training sets by time point order, with the remainder used as validation sets, and the first 60% of the data as training sets. S2.3: Standardize each feature in the training set and validation set to obtain the training dataset and validation dataset respectively; S2.4: For both the training and validation datasets, a sliding window with a step size of N+M is used for slicing and sampling, resulting in several training samples for both datasets; a training sample X z Includes a historical feature input matrix with a duration of N. Following The subsequent future feature input matrix with a duration of M And following in The subsequent future load feature matrix with a duration of M In the formula: The input matrix is a historical feature matrix of duration N, including a standardized weather feature matrix of duration N. Additional weather features of duration N after standardization Standardized historical load feature matrix with duration N The standardized time feature matrix with a duration of N To connect in The subsequent future feature input matrix of duration M, including the standardized continuation... The subsequent weather feature matrix with a duration of M Standardized sequence The following additional weather features lasting for M duration Standardized sequence The subsequent time feature matrix with a duration of M The subscript 'one' represents the feature value obtained after standardization in S2.3; the historical feature input matrix of a training sample. and future feature input matrix The future load feature matrix serves as input to the prediction model. As the true value relative to the predicted output obtained by the prediction model based on the input; S3: Establish a prediction model The prediction model comprises three main parts: a historical feature branching model, a future feature branching model, and a feature fusion processing model. The historical feature branching model includes a CNN convolutional neural network, a Transformer feature extraction module, and a BiLSTM-LSTM module. The CNN convolutional neural network includes an input layer, convolutional layers, a Swish activation function layer, and a fully connected layer. The input layer receives training samples X. z Historical feature input matrix The historical feature input matrix of a batch of training samples is data X. CNN1 Its shape is (κ, N, 13), where κ is the training batch size; the convolutional kernel size of the convolutional layer is β1, and there are ρ1 filters. The historical feature input matrix of a batch of training samples is processed by the convolutional layer, the Swish activation function layer, and the fully connected layer in sequence to obtain the feature sequence C1, as shown in equation (18): C1=CNN(X CNN1 ) (18) The feature sequence C1 has a shape of (κ, N, ρ1), and this CNN convolutional neural network expands the 13-dimensional input features to ρ1 dimensions; The Transformer feature extraction module includes an input layer, a multi-head self-attention mechanism layer, a first residual connection layer, a first normalization layer (LayerNorm1), a feedforward network layer, a second residual connection layer, and a second normalization layer (LayerNorm2). The input layer receives the feature sequence C1 output by the CNN convolutional neural network and then inputs it into the multi-head self-attention mechanism layer. The multi-head self-attention mechanism layer first transforms the data of each training sample in the feature sequence C1 into a matrix of query, key, and value for χ self-attention heads through χ linear transformations, where the query matrix Q of the h-th head corresponding to the i-th training sample is... h,i Key matrix K h,i Value matrix V h,i for: Q h,i =C 1,i ·W Q,h,i (19) K h,i =C 1,i ·W K,h,i (20) V h,i =C 1,i ·W V,h,i (21) In the formula: i is the data sequence index of this batch, corresponding to the i-th training sample of this batch; C is the learnable weight matrix for the h-th head of the i-th training sample in this batch; 1,i d represents the data corresponding to the i-th training sample in the feature sequence C1; k d v For each head's query dimension, d k =d v =δ; Then, the output of a single self-attention head for the i-th training sample is calculated to measure the attention of each time step to other time steps: In the formula: softmax normalizes the scores into a probability distribution, thus obtaining the attention weight matrix; Then, the outputs of the χ self-attention heads of the i-th training sample are concatenated and mapped back to the original feature dimension ρ1: MultiHead(Q i ,K i ,V i )=Concat(head 1,i ,...,head h,i ,...,head χ,i )·W T (23) head h,i =Attention(Q h,i ,K h,i ,V h,i ) (24) In the formula: χ represents the number of attention heads; Concat(head) 1,i ,head 2,i ,...,head χ,i ) is a concatenation matrix of x heads; For the dimension mapping matrix, Concat(head) 1,i ,head 2,i ,...,head χ,i The concatenated matrix is mapped back to the original feature dimension ρ1; Therefore, the output of the multi-head self-attention mechanism layer for a batch of κ training samples is: MultiHead(Q,K,V)=[MultiHead(Q1,K1,V1),...,MultiHead(Q i ,K i ,V i ),...,MultiHead(Q κ ,K κ ,V κ )] (25) The output of the multi-head self-attention mechanism layer and the feature sequence C1 received by the input layer are joined by a residual connection operation in the first residual connection layer, and the result is input into the first normalization layer. The feature sequence C2 output from the first normalized layer is input into the feedforward network layer for nonlinear transformation and feature enhancement: FFN(C2)=W2·ReLU(W1·C2+b1)+b2 (32) In the formula: d represents the weights of the first layer linear transformation of the feedforward network. ff As the intermediate dimension, d ff =4ρ1; The bias is applied to the first-layer linear transformation node of the feedforward network; d represents the weights of the second layer linear transformation of the feedforward network. ff As the intermediate dimension, d ff =4ρ1; The bias is the second-layer linear transform node bias of the feedforward network; ReLU is the activation function. The output FFN(C2) of the feedforward network layer is processed sequentially through the second residual connection layer and the second normalization layer to obtain the final feature sequence C3 output by the Transformer feature extraction module. Its shape is (κ, N, ρ1), and the formula is: C3=LayerNorm2(C2+FNN(C2)) (33) The BiLSTM-LSTM module includes a BiLSTM module and an LSTM module. The BiLSTM module includes two parallel LSTM layers in the forward and backward directions to capture past and future context information. The hyperparameters are set so that each LSTM layer in each direction has ω1 LSTM units. The output of the BiLSTM module serves as the input of the LSTM module. The LSTM module includes a unidirectional LSTM layer to extract the feature representation of the final time step. Its initial hyperparameters are set to contain ω2 LSTM units. The feature sequence C3 output by the Transformer feature extraction module is processed by the BiLSTM-LSTM module to obtain the output feature sequence C4, which has the shape (κ, ω2), and the formula is: In the formula: This indicates the processing by a BiLSTM module that has ω1 LSTM units in each direction; This indicates processing by an LSTM module containing ω² LSTM units; The feature sequence C4 output by the BiLSTM-LSTM module is the output of the historical feature branch model. The future feature branching model includes a CNN convolutional neural network, a global max pooling layer, and an LSTM module; the CNN convolutional neural network includes an input layer, a convolutional layer, and a Swish activation function layer, and the input layer receives training samples X. z Future feature input matrix The future feature input matrix of a batch of training samples is data X. CNN2 Its shape is (κ, M, 12); the convolutional kernel size of the convolutional layer is β2, and there are ρ2 filters. The future feature input matrix of a batch of training samples is processed sequentially through this convolutional layer and the Swish activation function layer, and the result is then processed through a global max pooling layer to obtain the feature sequence. for: In the above formula, [·] MP This indicates the execution of a global max pooling operation, for the feature sequence. The shape is (κ, M, ρ2), and this CNN convolutional neural network expands the 12-dimensional features of the input to ρ2 dimensions; The LSTM module includes a unidirectional LSTM layer with ω³ LSTM units, used to extract the feature representation at the final time step, and the feature sequence output by the global max pooling layer. After processing by this LSTM module, the feature sequence is obtained. Its shape is (κ, ω3), and the formula is: Feature sequences output by the LSTM module This is the output of the future feature branch model; The feature fusion processing model includes a feature fusion layer, a first fully connected layer, a Dropout regularization unit, and a second fully connected layer. The input to the feature fusion layer is the ω2-dimensional feature sequence C4 output by the historical feature branch model and the ω3-dimensional feature sequence output by the future feature branch model. The feature sequence C5 is fused into ω2+ω3 dimensions through a feature fusion layer, as shown in the formula: The shape of the feature sequence C5 is (κ, ω2+ω3); The first fully connected layer performs a linear transformation operation. The feature sequence C5 output by the feature fusion layer is used as the input of the fully connected layer, and the output feature sequence C6 is given by the formula: C6=W Q ·C5+b Q (46) In the formula: W Q b is the weight matrix of the first fully connected layer; Q The bias of the first fully connected layer; The Dropout regularization unit contains the same number of neurons as the first fully connected layer, and is used to receive the output of the first fully connected layer. Each neuron is either temporarily dropped with probability p or retained with probability 1-p. To maintain the expected value of the data sequence output, the output of the retained neurons needs to be scaled by a factor of 1 / (1-p). The feature sequence C6 output from the first fully connected layer serves as the input to the Dropout regularization unit, and the Dropout regularization unit outputs the feature sequence C7, as shown in the formula: In the formula: feature sequence C6 is the input vector; m is a mask vector with the same dimension as C6, each element of which is independently sampled from the Bernoulli distribution Bernoulli(1-p); ⊙ represents element-wise multiplication; p is the dropout probability, i.e. the probability that the neuron is set to zero; the shape of the feature sequence C7 output by the Dropout regularization unit is (κ, ω2+ω3). The input to the second fully connected layer is the feature sequence C7 output by the Dropout regularization unit, and the output is the future load feature matrix of κ time steps corresponding to a batch of input training samples, predicted by the prediction model. In the formula: W C b is the weight matrix of the second fully connected layer; C For the bias of the second fully connected layer; The shape is (κ, M); S4: Training a prediction model based on an improved sparrow search algorithm S4.1: Given the range of values for the hyperparameters of the prediction model, the hyperparameters of the historical feature branch model are: the number of filters ρ1 in the CNN convolutional neural network, with an optimization range of [16,256]; the kernel size β1, with an optimization range of [3,12]; the number of heads χ in the multi-head self-attention mechanism of the Transformer feature extraction module, with an optimization range of [4,10]; the query dimension δ of each head, with an optimization range of [8,128]; the number of LSTM units ω1 in each direction of the BiLSTM module, with an optimization range of [8,256]; and the number of LSTM units ω2 in the LSTM module, with an optimization range of [8,256]. The hyperparameters of the future feature branch model include the number of filters ρ2 in the CNN convolutional neural network, with an optimization range of [16,256], the kernel size β2, with an optimization range of [3,12], and the number of LSTM units ω3 in the LSTM module, with an optimization range of [8,256]. The global hyperparameters include: the initial learning rate LR0, whose value ranges from [1e...]. -6 ,1e -2 The dropout rate p of the Dropout regularization unit ranges from [0.05, 0.6]; the training batch size κ has an optimization range of [32, 512]; to ensure that all hyperparameter optimization mappings are integer mappings, the initial learning rate LR0 is set to an optimization range of [1, 1e] during hyperparameter optimization. 4 The dropout rate p of the Dropout regularization unit is set to the optimization range of [5, 60], and the optimization result is mapped back to the value range and then substituted into the prediction model. S4.2: Set the maximum number of iterations N for the improved sparrow search algorithm. max Sparrow population size N zq By initializing the hyperparameters of the prediction model using equation (50), N is obtained. zq The hyperparameters with different values correspond to N zq Each prediction model has a set of training parameters; the training parameters of each prediction model are initialized using a random assignment method, and the initialization of each prediction model is completed. X C,u,w =round[lb w +(ub w -lb w )·rand(0,1)] (50) In the formula: u is the sparrow individual index; w is the hyperparameter dimension index, corresponding to the number of hyperparameter categories; X C,u,w This represents the position (i.e., value) of the w-th hyperparameter of the u-th sparrow; lb w ub is the lower bound of the w-th hyperparameter; w The upper bound of the w-th hyperparameter; rand(0,1) is a random number that follows a uniform distribution between the interval (0,1); round() is the rounding function; S4.3: Using the training dataset, respectively analyze N in S4.2 zq A pre-initialized prediction model is trained; a batch of training samples from the training dataset is input into a pre-initialized prediction model in S4.2, which outputs predicted values of future load characteristics for M time points in a batch; the sum of the Huber loss and L2 regularization loss of k training samples in a batch is used as the training loss L. In the formula: Y C,v This represents the true value of the v-th training sample corresponding to the batch of prediction results; This is the predicted value for the v-th training sample corresponding to the batch of prediction results; For the prediction results of this batch, the prediction result corresponds to the vth training sample. One true value; For the prediction results of this batch, the prediction result corresponds to the vth training sample. 1 predicted value; M is the number of time points of the prediction results for a training sample; δ h The threshold for error segmentation is set to 0.5; v is the index of the corresponding training sample in this batch of prediction results; W Qτ W is the weight matrix of the first fully connected layer. Q One of the element values, E is the weight matrix W Q The total number of elements in the matrix; λ is the regularization coefficient; Based on the training loss of a batch of training samples in the training dataset, the trainable parameters of the prediction model are updated once using the gradient descent algorithm, thus completing the training of one batch. The trainable parameters of the prediction model after completing the training of one batch are used as the initial trainable parameters for the next batch of training. The training process of one batch is repeated until the last batch of training samples in the training dataset is trained, and the training of the prediction model is completed. S4.4: Input the training samples from the validation dataset into N in S4.3 respectively. zq In a set of trained prediction models, each model outputs a predicted value for the corresponding training sample. The evaluation metric R for each prediction model is calculated. 2 , MAPE, MAE, and calculate the fitness function value of the hyperparameters of each prediction model; In the formula: Y Z To verify the true values of future load data at M time points of the training samples in the dataset, To be with Y Z The predicted value output by the corresponding prediction model; Y Z,g This represents the true value of the future load characteristics at time points M for the g-th training sample in the validation dataset. To be with Y Z,g The corresponding prediction model outputs the predicted value, where P is the number of training samples in the validation dataset; Y Z,g,n To verify the true value of the future load feature at the nth time point out of the M time points of the g-th training sample in the dataset, To be with Y Z,g,n The predicted value output by the corresponding prediction model, To verify the mean of the true values of the future load characteristics at M time points of the g-th training sample in the dataset; The fitness function F of the hyperparameters of the prediction model is: In the formula: ψ1, ψ2, and ψ3 are the fitness function weights, which are 0.3, 0.3, and 0.4 respectively; Calculate the fitness function value of the hyperparameters of each prediction model, and sort them from largest to smallest according to the size of the fitness function value. The hyperparameter value corresponding to the prediction model with the largest fitness function value is taken as the global optimal position. The first 30% of the hyperparameter values are taken as the producer position in the sparrow search algorithm, the last 20% of the hyperparameter values are taken as the watcher position in the sparrow search algorithm, and the rest are the follower positions. This completes one iteration of training. S4.5: Increment N by 1 in each iteration, then update N according to the improved sparrow search algorithm. zq The values of the group hyperparameters; Adaptive producer position update formula: In the formula: u is the sparrow individual index; w is the hyperparameter dimension index; f is the current number of iterations completed; This indicates the position of the w-th hyperparameter of the u-th sparrow in the (f+1)-th iteration; This indicates the position of the w-th hyperparameter of the u-th sparrow in the f-th iteration; The globally optimal position; The location is randomly generated for search enhancement; c1(f) is an adaptive exploration factor; c 1,cs The initial exploration intensity is set to 1.5; τ1 is the decay coefficient; c2(f) is the dynamic exploration weight; c 2,cs Initial weighting coefficients, set to 1; N max The maximum number of iterations for optimizing the model hyperparameters; r1 and r2 are random numbers uniformly distributed in the interval [0,1]. Follower position update formula: In the formula: u is the sparrow individual index; w is the hyperparameter dimension index; f is the current number of iterations completed; This indicates the position of the w-th hyperparameter of the u-th sparrow in the (f+1)-th iteration; This indicates the position of the w-th hyperparameter of the u-th sparrow in the f-th iteration; This represents the worst position in the population during the f-th iteration, i.e., the position with the smallest corresponding fitness function value. Let Q be the optimal position of the producer in the f-th iteration; Q is a random matrix whose elements follow a normal distribution; A sc Given a random matrix, For A sc transpose of A sc The inverse matrix of the product of E; sc c is the identity matrix; c3(f) is the dynamic convergence factor; c 3,cs τ is the initial convergence coefficient, taken as 0.5; τ2 is the decay coefficient; Adaptive guard position update formula: In the formula: u is the sparrow individual index; w is the hyperparameter dimension index; f is the current number of iterations completed; This indicates the position of the w-th hyperparameter of the u-th sparrow in the (f+1)-th iteration; c represents the position of the w-th hyperparameter of the u-th sparrow in the f-th iteration; c4 is the periodic fluctuation factor; c5 is the perturbation coefficient, which is 0.1; r3 is a random number that follows a Gaussian distribution on the interval [0,1]. S4.6: According to N zq The updated values of the hyperparameters are used to obtain the corresponding N. zq Each prediction model is initialized with a random assignment method to trainable parameters. Once the initialization of each prediction model is complete, steps S4.3-S4.6 are repeated until the number of iterations reaches the set maximum value. The global optimal position obtained in the last iteration is the optimal set of hyperparameter values, and the prediction model that has been trained is the optimal prediction model. S5: Obtain weather data X for the target electric vehicle charging station area in S1, with a predicted duration of M and a resolution of 1 hour, including temperature, humidity, visibility, precipitation, and wind speed. OM Simultaneously, acquire the same weather data with a duration of at least N and a resolution of 1 hour preceding it, as well as the historical load data X of the target electric vehicle charging station within the same time period with a duration of at least N and a resolution of 1 hour. ON Then, the load data of the electric vehicle charging stations is preprocessed according to the method in S1, and the historical feature input matrix X with a duration of N is obtained according to the method in S2. h And the future feature input matrix X with a duration of M following it in the time dimension. p Input historical features into matrix X h Future feature input matrix X p The data is input into the optimal prediction model in S4 to obtain the predicted value of the future load feature matrix of the target electric vehicle charging station with a duration of M and a resolution of 1 hour. This predicted value of the future load feature matrix is then de-standardized to obtain the target electric vehicle charging station's weather data X. OM The predicted value of future load data with a duration of M and a resolution of 1 hour within the same time period; S6: Adjustable capacity prediction for target charging stations Based on the target charging station and weather data X OM The predicted values of future load data with a duration of M and a resolution of 1 hour are used to predict the adjustable capacity of the target charging station during the same time period. Based on consumer psychology theory, the relationship between the willingness to respond to electric vehicle demand and electricity prices is represented by a price elasticity model. In the formula: Let ΔP be the price elasticity coefficient at time t; t The adjustable capacity of the target electric vehicle charging station at time t; The future load data for the target electric vehicle charging station at time point t predicted in S5; Δc dt c represents the change in charging price between time t and time t-1; dt The charging price at time t-1; the predicted adjustable capacity ΔQ of the target electric vehicle charging station during the same time period. total The calculation formula is:
2. The method for predicting the adjustable capacity of electric vehicle charging stations based on multi-factor fusion according to claim 1, characterized in that, In S1, outliers are identified by using the interquartile range rule based on periodic grouping for historical load data.
3. The method for predicting the adjustable capacity of electric vehicle charging stations based on multi-factor fusion according to claim 1, characterized in that, In S1, temperature T is expressed in degrees Celsius; humidity RH is expressed in relative humidity; visibility VI is expressed in kilometers, with 20 indicating visibility exceeding 20 kilometers; precipitation R is divided into 5 levels based on hourly precipitation, with R=0 indicating no precipitation, R=1 indicating light rain, R=2 indicating moderate rain, R=3 indicating heavy rain, and R=4 indicating torrential rain or above; wind WP uses the Beaufort scale.
4. The method for predicting the adjustable capacity of electric vehicle charging stations based on multi-factor fusion according to claim 1, characterized in that, In S2.3, the standardization formula is: In the formula: x is the value of a certain element of a certain feature in the original model; x min The original minimum value of this feature; x max This represents the original maximum value of the feature; x one The output value is the standardized value of the element for this feature.
5. The method for predicting the adjustable capacity of electric vehicle charging stations based on multi-factor fusion according to claim 1, characterized in that, In S3, the first normalization layer first standardizes the features of each dimension of the input data, using the feature data X of dimension G. G Process description: In the formula: μ is the feature data X of dimension G. G The mean; σ 2 X is the variance of the feature data; D is the total number of elements in the feature data; ε1 is a constant to prevent division by zero; X G,ζ This is the value of the ζ-th element of the feature data before standardization; This is the standardized value of the ζ-th element of the feature data; Then, learnable scaling and translation parameters, X, are added to the standardized values. G,ζ After processing by the first normalization layer, the feature element Y is obtained. G,ζ Its formula is: In the formula: γ ζ Let β be the learnable scaling parameter for the ζ-th element; ζ Let be the learnable translation parameter of the ζ-th element; Feature data X of dimension G G Each element in the equation is normalized according to equations (26)-(29) to obtain a new feature of dimension G, Y. G The process is defined as equation (30): Y G =LayerNorm(X G ) (30) The feature data of each dimension of the data input to the first normalization layer are processed according to formulas (26)-(30) to obtain the feature sequence C2 as follows: C2=LayerNorm1(C1+MultiHead(Q,K,V)) (31) In the formula, the shape of the feature sequence C2 is (κ, N, ρ1).
6. The method for predicting the adjustable capacity of electric vehicle charging stations based on multi-factor fusion according to claim 1, characterized in that, In S3, the working principle and process of the second normalization layer are the same as those of the first normalization layer.
7. The method for predicting the adjustable capacity of electric vehicle charging stations based on multi-factor fusion according to claim 1, characterized in that, In S4, the learning rate is dynamically updated using the cosine annealing algorithm. The update formula for the learning rate LR(s) is: In the formula: s is the current training step number, i.e., the index of the current training batch; LR0 is the initial learning rate; H is the total number of decay cycles, i.e., the total training steps of the prediction model training, i.e., the training samples of the training dataset are trained in H batches; α is the final learning rate scaling factor.
8. The method for predicting the adjustable capacity of electric vehicle charging stations based on multi-factor fusion according to claim 4, characterized in that, In S5, the denormalization process is the inverse operation of formula (15), where the original minimum value of the feature x is obtained. min Take historical load data X O The minimum value in the value, the original maximum value of the feature x max Take historical load data X O The maximum value in.
9. The method for predicting the adjustable capacity of electric vehicle charging stations based on multi-factor fusion according to claim 4, characterized in that, In S2.4, N = 168 and M = 24.
10. The method for predicting the adjustable capacity of electric vehicle charging stations based on multi-factor fusion according to claim 4, characterized in that, In S4.2, the maximum number of iterations N of the improved sparrow search algorithm max The population size of the sparrow is 50, N. zq It is 25.
Citation Information
Patent Citations
Reinforcement learning-based parameter adaptive electric vehicle load prediction method and system, medium and equipment
CN119047624A
Electric vehicle load prediction method and system
CN119674922A