Electric vehicle charging load prediction method combining attention mechanism and multi-scale characteristics

By combining attention mechanism and multi-scale feature method, using whale optimization algorithm and variational modal decomposition, multi-scale features in electric vehicle charging load data are extracted, and the problems of low prediction accuracy and slow convergence speed in the existing technology are solved. , achieving more accurate electric vehicle charging load prediction.

CN119315527APending Publication Date: 2025-01-14SOUTHWEAT UNIV OF SCI & TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411337021.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The existing electric vehicle charging load prediction methods fail to effectively explore deep-level information in the load sequence and ignore multi-scale features, resulting in low prediction accuracy and slow convergence speed, which is easy to fall into local optimality.

Method used

Using an electric vehicle charging load prediction method combining attention mechanism and multi-scale features, load decomposition is carried out through whale optimization algorithm and variational mode decomposition, and gate control mechanism, time attention and channel attention are introduced in the TCN residual block. Force, construct multi-scale feature modules to extract features at different time scales and channel levels.

Benefits of technology

The decomposition quality of load components is improved, local optimization is avoided, prediction accuracy and convergence speed are significantly improved, and more accurate electric vehicle charging load prediction is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119315527A_ABST
    Figure CN119315527A_ABST
Patent Text Reader

Abstract

The invention discloses an electric vehicle charging load prediction method combining an attention mechanism and multi-scale features. The method comprises the following steps: firstly, combining a whale optimization algorithm containing a differential variation factor and a nonlinear convergence factor with variational mode decomposition, and decomposing an electric vehicle charging load sequence aggregated according to hour-level granularity to obtain a load component; establishing a multivariate linear model to realize meteorological characteristic screening; then, an electric vehicle charging load prediction model combining an attention mechanism and multi-scale features is established, and deep learning is carried out on load components and meteorological features; and finally, adding load component prediction results to obtain a final electric vehicle charging load prediction value. Aiming at the problems that the existing electric vehicle charging load data feature mining is insufficient and the model is insufficient in important feature capturing capability, the hidden information in the electric vehicle charging load data can be fully mined, the features of different levels and different time scales are extracted, and the accuracy of load prediction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of Internet of Vehicles, and more specifically, relates to a method for predicting charging load of electric vehicles combining attention mechanism and multi-scale features. Background Art

[0002] As a large number of electric vehicles are connected to the power grid, the accuracy of electric vehicle charging load forecasting has become extremely important. Accurate electric vehicle charging load forecasting not only helps optimize the allocation of power grid resources, but also balances power supply and demand, and provides assistance for charging facility planning, traffic flow management, user charging experience, etc.

[0003] The methods for predicting electric vehicle charging load can be divided into two main categories: one is based on traditional statistical methods, including time series analysis and regression analysis, which mainly use historical data and statistical models for prediction; the other is based on deep learning methods, such as deep neural networks and generative adversarial networks, which can handle complex nonlinear relationships and time series characteristics, and provide more accurate load forecasts.

[0004] At present, some scholars have done some research on the prediction of electric vehicle charging load. For example, Shukla et al. [A. Shukla, AK Gupta. Electric Load Forecasting through CNN: A Deep Learning Approach Considering Weather data [C]. 2022 IEEE 10th Power India International Conference (PIICON), New Delhi, India, 2022, pp. 1-6] combined load and weather data such as temperature and humidity to establish a load prediction model based on convolutional neural network. However, the model is too single and the prediction accuracy is not high. Guo et al. [L.Guo, P.Shi, Y.Zhang, et.al. Short-term EV Charging Load Forecasting Based on GA-GRUModel[C]. 2021 3rd Asia Energy and Electrical Engineering Symposium(AEEES), Chengdu, China, 2021, pp.679-683] proposed a gated recurrent unit neural network prediction model and optimized the network hyperparameters through a genetic algorithm. However, this method simply predicts the load data and does not explore the deep potential information in the load data.

[0005] Although the existing methods have certain prediction effects, there are some problems: First, the existing research methods do not consider in-depth mining of load sequences. At the same time, the load decomposition parameters have large randomness, convergence speed is slow, and it is easy to fall into local optimal problems; Second, the existing electric vehicle charging load prediction model does not consider the multi-scale characteristics of the load, and cannot effectively capture important characteristics at the time and channel levels, and the prediction accuracy is not high. Summary of the invention

[0006] The purpose of the present invention is to overcome the shortcomings of the prior art. Aiming at the problems of insufficient feature mining of existing electric vehicle charging load data, insufficient ability to capture important features of electric vehicle charging load data, and ignoring characteristics of different time scales, a method for predicting electric vehicle charging load is proposed to fully mine the hidden information in the electric vehicle charging load data, extract its different levels of features and different time scales, and achieve more accurate load forecasting.

[0007] In order to achieve the above-mentioned invention object, the present invention provides an electric vehicle charging load prediction method combining attention mechanism and multi-scale features, and the specific steps are as follows:

[0008] S1: Downsample the electric vehicle charging load dataset and the meteorological dataset to obtain the electric vehicle charging load sequence aggregated at the hourly granularity;

[0009] S2: Establish a multivariate linear model to screen the atmospheric temperature, horizontal atmospheric pressure, sea level atmospheric pressure, atmospheric pressure change within three hours, ground relative humidity, average wind speed, dew point temperature, and precipitation to obtain the meteorological characteristics that have a greater impact on the load;

[0010] S3: The whale optimization algorithm including differential variation factor and nonlinear convergence factor is combined with variational mode decomposition to decompose the aggregated electric vehicle charging load sequence into load components;

[0011] S4: Establish an electric vehicle charging load prediction model combining attention mechanism and multi-scale features, and perform deep learning on load components and meteorological characteristics;

[0012] S5: Input the load components into the model for prediction, and add the prediction results of the load components to obtain the final prediction value of the electric vehicle charging load.

[0013] As a further optimization scheme of the present invention, in step S3, by introducing the whale optimization algorithm including the differential variation factor and the nonlinear convergence factor, it is combined with the variational mode decomposition to decompose the electric vehicle charging load sequence into load components; introducing the differential variation factor and nonlinear convergence factor θ, the position update method in the whale optimization algorithm is as follows:

[0014]

[0015] in, represents the best whale position at the tth iteration, L t (n) represents the position of the nth whale at the tth iteration, ψ is a random number between 0 and 1, |·| represents the absolute value operation, and the calculation method of the parameters θ, γ, and β that control the position update is as follows:

[0016] β=2θr1-θ

[0017] γ=2r2

[0018]

[0019] Among them, r1 and r2 are random numbers in the range of 0 to 1, and t max is the maximum number of iterations;

[0020] As a further optimization scheme of the present invention, in step S4, in the established electric vehicle charging load prediction model combining the attention mechanism and the multi-scale features, the TCN residual block containing the gating mechanism is composed of a first dilated causal convolution layer, a first gating mechanism operation layer, a first ReLU operation layer, a first Dropout layer, a second dilated causal convolution layer, a second gating mechanism operation layer, a second ReLU operation layer, and a second Dropout layer connected in sequence;

[0021] The first dilated causal convolution layer extracts the features of the input data X. The output H1 of the first dilated causal convolution layer is selectively transmitted and filtered through the first gating mechanism operation layer, and then processed by the first ReLU operation layer and the first Dropout layer to obtain the feature G1. The formula is as follows:

[0022] H1=ReLU(W F *X+b F )

[0023] update1 = sigmoid(W update1 *H1+b update1 )

[0024] reset1=sigmoid(W reset1 *H1+b reset1 )

[0025]

[0026] G1 = Dropout(ReLU(H1′))

[0027] Among them, state represents the hidden state at the previous moment, and the symbol ⊙ represents the element-by-element multiplication operation;

[0028] G1 passes through the second dilated causal convolution layer, the second gating mechanism operation layer, the second ReLU operation layer, and the second Dropout layer in sequence to obtain the features to obtain G2.

[0029] As a further optimization scheme of the present invention, in step S4, the TCN residual block containing time attention and channel attention is composed of a time attention module, a channel attention module, and a residual connection module;

[0030] The temporal attention module consists of a Dense layer, a Flatten layer, a softmax operation layer, a RepeatVector layer, a Permute layer, and a Multiply layer. The weight tensor generated by the Dense layer is flattened and the attention weight score is generated using softmax. time , adjust the attention weight dimension through the RepeatVector layer and the Permute layer to align it with the input feature, apply the attention weight to G2 through the Multiply layer, and obtain feature Feature2. The formula is expressed as:

[0031] score time =softmax(Flatten(tanh(W time *X+C)))

[0032] score t ' ime =Permute(RepeatVector(score time ))

[0033] Feature2=G2*score t ' ime

[0034] The channel attention module consists of a global average pooling layer, a Reshape layer, two Dense layers, and a Multiply layer. The output Feature2 obtained by the temporal attention module is globally average pooled, the shape is adjusted by the Reshape layer, two Dense layers are used to reduce and restore the number of channels respectively, and the channel features are weighted by the Multiply layer to obtain the feature Feature3. The formula is expressed as:

[0035] Feature2′=GlobalAveragePooling1D(Feature2)

[0036] Feature2″=Reshape(Feature2′)

[0037] scorechannel =Dense(Dense(Feature2″))

[0038] Feature3 = Feature2 * score channel

[0039] The residual connection module forms the output Res by adding the original input and the features output by the channel attention module i , the formula is:

[0040] Res i =X+Feature3.

[0042] As a further optimization scheme of the present invention, in step S4, the constructed multi-scale feature module is composed of a first TCN residual block, a second TCN residual block, a third TCN residual block, an Add layer, an Attention layer, a Dropout layer, a Flatten layer, and three Dense layers;

[0043] The first TCN residual block, the second TCN residual block, and the third TCN residual block are all composed of TCN residual blocks containing gating mechanisms, temporal attention, and channel attention. Different convolution kernel lengths and different expansion coefficients are used. The first TCN residual block, the second TCN residual block, and the third TCN residual block are connected in parallel to process different time scale features, and the output is added through the Add layer to form a multi-scale feature Res mul , the formula is:

[0044] Res mul =Res1+Res2+Res3

[0045] Among them, Res1, Res2, and Res3 are the outputs of the first TCN residual block, the second TCN residual block, and the third TCN residual block respectively;

[0046] Res mul Then, the multi-scale features are dynamically adjusted through the Attention layer to form the fusion feature Res fusion , the Attention layer consists of the first Permute layer, the Dense layer, the second Permute layer, and the Multiply layer; it is expressed as:

[0047] A d =Dense(softmax(Permute(Res mul )))

[0048] Res fusion =Res mul *(Permute(A d ))

[0049] Fusion feature Res fusion The neurons are randomly discarded through the Dropout layer, and the multi-dimensional fusion feature tensor is converted into a one-dimensional tensor through the Flatten layer operation. The conversion from high-dimensional features to the final prediction is realized through three Dense layers, which is expressed as:

[0050] Res′ fusion =Flatten(Dropout(Res fusion ))

[0051] V=Dense(Dense(Dense(Res′ fusion ))

[0052] Among them, Res fusion represents the fusion feature, and V represents the predicted value.

[0053] The present invention adopts the above technical method. Compared with the prior art, the present invention has the following advantages:

[0054] 1) By introducing the whale optimization algorithm containing differential variation factors and nonlinear convergence factors, the convergence speed is accelerated to avoid falling into the local optimum. It is combined with variational mode decomposition to mine the hidden information of the load sequence, reduce the randomness of the empirical parameters, and improve the decomposition quality of the load components;

[0055] 2) Establish an electric vehicle charging load prediction model that combines attention mechanism and multi-scale features, and introduce a gating mechanism in the TCN residual block to dynamically capture the information of electric vehicle charging load components; in order to highlight the importance of different time influencing factors and channel-level features, temporal attention and channel attention are introduced, and multiple TCN residual blocks are used to realize multi-scale feature extraction to improve the model's prediction ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a flowchart of a specific implementation method of the electric vehicle charging load prediction method combining the attention mechanism and multi-scale features of the present invention;

[0057] Figure 2 It is a structural diagram of the TCN residual block including the gating mechanism, time attention, and channel attention of the present invention;

[0058] Figure 3 It is a structural diagram of the multi-scale feature module in the present invention; DETAILED DESCRIPTION

[0059] In order to better illustrate the technical effects of the present invention, the specific embodiments of the present invention are described below in conjunction with the accompanying drawings so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when the detailed description of known functions and designs may dilute the main content of the present invention, these descriptions will be omitted here.

[0060] Example

[0061] Figure 1 This is a flowchart of a specific implementation method of an electric vehicle charging load prediction method combining attention mechanism and multi-scale features in the present invention; an actual electric vehicle charging load data set and a meteorological data set are used as examples to test the accuracy of load prediction of the present invention method and the comparison method. The present invention is a method for predicting electric vehicle charging load by combining attention mechanism and multi-scale features, and the specific steps are as follows:

[0062] S1: Obtain the electric vehicle charging load dataset and the meteorological dataset, perform data preprocessing and downsampling on the electric vehicle charging load dataset and the meteorological dataset respectively, and obtain the electric vehicle charging load aggregated at the hourly granularity. The process includes the following steps:

[0063] Step 1: Obtain electric vehicle charging load dataset and meteorological dataset;

[0064] The electric vehicle charging load dataset was obtained through the public ElaadNL project. The dataset collects electric vehicle charging data from January 1, 2019 to June 30, 2019, and contains a total of 163,255 electric vehicle charging records, each of which contains charging load data and a corresponding timestamp. The meteorological dataset is the meteorological data of Amsterdam, the Netherlands from January 1, 2019 to June 30, 2019, including meteorological characteristics such as atmospheric temperature, horizontal atmospheric pressure, and precipitation. It contains a total of 4,344 meteorological records, each of which contains meteorological characteristic data and a corresponding timestamp, and the sampling interval is 1 hour.

[0065] Step 2: Preprocess and downsample the electric vehicle charging load dataset and the meteorological dataset to obtain hourly granularity aggregated data.

[0066] S2: Considering that there are many meteorological factors, in order to improve the accuracy of prediction, a multivariate linear model is established to screen the atmospheric temperature, horizontal atmospheric pressure, sea level atmospheric pressure, pressure change within three hours, ground relative humidity, average wind speed, dew point temperature, and precipitation to obtain the characteristics that have a greater impact on the load. The specific method is as follows:

[0067] The meteorological data value sequence W * As an independent variable, the load value sequence Y *As the dependent variable, by fitting a linear model to the meteorological data values ​​and load values, the impact of the weather on the load is obtained, and the multivariate linear model is established as follows:

[0068] Y * =a1W * _1+...+a i W * _i+...+a s W * _s+b1

[0069] Among them, a1,...,a i ...,a s is the coefficient corresponding to the independent variable, b1 is the intercept; if a i ≥0.5, keep a i The corresponding meteorological feature is the i-th one; otherwise, a is ignored. i The corresponding i-th meteorological feature;

[0070] The influence of meteorological characteristics on the charging load of electric vehicles is shown in Table 1; where T represents atmospheric temperature, Po represents horizontal atmospheric pressure, P represents sea level atmospheric pressure, Pa represents the change in air pressure within three hours, U represents ground relative humidity, Ff represents average wind speed, Td represents dew point temperature, and RR represents precipitation.

[0071] Table 1 Impact of meteorological characteristics on electric vehicle charging load

[0072]

[0073]

[0074] S3: Combine the whale optimization algorithm with the difference variation factor and nonlinear convergence factor with the variational mode decomposition to decompose the aggregated electric vehicle charging load sequence into load components; introduce the difference variation factor and nonlinear convergence factor θ, the position update method in the whale optimization algorithm is as follows:

[0075]

[0076] in, represents the best whale position at the tth iteration, L t (n) represents the position of the nth whale at the tth iteration, ψ is a random number between 0 and 1, |·| represents the absolute value operation, and the calculation method of the parameters θ, γ, and β that control the position update is as follows:

[0077] β=2θr1-θ

[0078] γ=2r2

[0079]

[0080] Among them, r1 and r2 are random numbers in the range of 0 to 1, and t max is the maximum number of iterations; in the process of whale optimization algorithm combined with variational mode decomposition, the number of whale populations is set to 10, the maximum number of iterations is 50, and the dimension of the whale value is 2, which respectively represents the number of load component decompositions k and the penalty factor α. The k value range is [2,10], and the α value range is [100,3000].

[0081] S4: Establish an electric vehicle charging load prediction model that combines attention mechanism and multi-scale features. The model contains TCN residual blocks with gating mechanism, temporal attention, and channel attention, such as Figure 2 As shown; it contains multi-scale feature modules, such as Figure 3 As shown; the details are as follows:

[0082] S401: The TCN residual block including the gating mechanism is formed by sequentially connecting a first dilated causal convolution layer, a first gating mechanism operation layer, a first ReLU operation layer, a first Dropout layer, a second dilated causal convolution layer, a second gating mechanism operation layer, a second ReLU operation layer, and a second Dropout layer;

[0083] The first dilated causal convolution layer extracts the features of the input data X. The output H1 of the first dilated causal convolution layer is selectively transmitted and filtered through the first gating mechanism operation layer, and then processed by the first ReLU operation layer and the first Dropout layer to obtain the feature G1. The formula is as follows:

[0084] H1=ReLU(W F *X+b F )

[0085] update1 = sigmoid(W update1 *H1+b update1 )

[0086] reset1=sigmoid(W reset1 *H1+b reset1 )

[0087]

[0088]

[0089] G1 = Dropout(ReLU(H1′))

[0090] Among them, state represents the hidden state at the previous moment, and the symbol ⊙ represents the element-by-element multiplication operation;

[0091] G1 passes through the second dilated causal convolution layer, the second gating mechanism operation layer, the second ReLU operation layer, and the second Dropout layer in sequence to obtain the features to obtain G2;

[0092] S402: The TCN residual block including temporal attention and channel attention is composed of a temporal attention module, a channel attention module, and a residual connection module;

[0093] The temporal attention module consists of a Dense layer, a Flatten layer, a softmax operation layer, a RepeatVector layer, a Permute layer, and a Multiply layer. The weight tensor generated by the Dense layer is flattened and the attention weight score is generated using softmax. time , adjust the attention weight dimension through the RepeatVector layer and the Permute layer to align it with the input feature, apply the attention weight to G2 through the Multiply layer, and obtain feature Feature2. The formula is expressed as:

[0094] score time =softmax(Flatten(tanh(W time *X+C)))

[0095] score t ' ime =Permute(RepeatVector(score time ))

[0096] Feature2=G2*score t ' ime

[0097] The channel attention module consists of a global average pooling layer, a Reshape layer, two Dense layers, and a Multiply layer. The output Feature2 obtained by the temporal attention module is globally average pooled, the shape is adjusted by the Reshape layer, two Dense layers are used to reduce and restore the number of channels respectively, and the channel features are weighted by the Multiply layer to obtain the feature Feature3. The formula is expressed as:

[0098] Feature2′=GlobalAveragePooling1D(Feature2)

[0099] Feature2″=Reshape(Feature2′)

[0100] score channel=Dense(Dense(Feature2″))

[0101] Feature3 = Feature2 * score channel

[0102] The residual connection module forms the output by adding the original input to the features output by the channel attention module, which can be expressed as:

[0103] Res i =X+Feature3;

[0105] S403: The constructed multi-scale feature module is composed of a first TCN residual block, a second TCN residual block, a third TCN residual block, an Add layer, an Attention layer, a Dropout layer, a Flatten layer, and three Dense layers;

[0106] The first TCN residual block, the second TCN residual block, and the third TCN residual block are all composed of TCN residual blocks containing gating mechanisms, temporal attention, and channel attention. The convolution kernel sizes are 3, 5, and 7 and the expansion coefficients are 1, 2, and 4 respectively. The first TCN residual block, the second TCN residual block, and the third TCN residual block are connected in parallel to process different time scale features, and the outputs are added through the Add layer to form a multi-scale feature Res mul , the formula is:

[0107] Res mul =Res1+Res2+Res3

[0108] Among them, Res1, Res2, and Res3 are the outputs of the first TCN residual block, the second TCN residual block, and the third TCN residual block respectively;

[0109] Res mul Then, the multi-scale features are dynamically adjusted through the Attention layer to form the fusion feature Res fusion , enhance the model's extraction of multi-level features. The Attention layer consists of the first Permute layer, the Dense layer, the second Permute layer, and the Multiply layer; it is expressed as:

[0110] A d =Dense(softmax(Permute(Res mul )))

[0111] Res fusion =Res mul *(Permute(A d ))

[0112] Fusion feature Res fusion Neurons are randomly discarded through the Dropout layer with a discard rate of 0.2. The multi-dimensional fusion feature tensor is converted into a one-dimensional tensor through the Flatten layer operation. The conversion from high-dimensional features to the final prediction is realized through three Dense layers. The number of neurons in the three Dense layers is 128, 16, and 1 respectively. The formula is expressed as:

[0113] Res′ fusion =Flatten(Dropout(Res fusion ))

[0114] V=Dense(Dense(Dense(Res′ fusion ))

[0115] Among them, Res fusion represents the fusion feature, and V represents the predicted value.

[0116] S5: Input the load components into the model for prediction, and add the prediction results of the load components to obtain the final prediction value, which is expressed as:

[0117]

[0118] in, For the The prediction results of load components, K best is the optimal number of load component decompositions, and Y_pre is the final predicted load value.

[0119] In order to achieve technical effect comparison, the present invention divides the data set into a training set and a test set, takes the last 1200 hours of data as the test set, takes the historical electric vehicle charging load components and the filtered features as input data features, and the load component prediction value as the label, and initializes the model weight parameters; uses the mean absolute error E MAE As the loss function, the Adam optimizer is used to optimize the model parameters, and the parameters are updated by minimizing the loss function; the iterative training is repeated until the set training rounds are reached, the training is stopped, and the model is saved; the trained model is evaluated using the test set, the test samples are input into the model, and the predicted values ​​of the electric vehicle charging load components are obtained. The component prediction results are added to obtain the predicted value of the electric vehicle charging load, and compared with the true value.

[0120] The implementation example verification uses the TCN method, CNN-Attention-LSTM method, VMD-CNN method, and VMD-LSTM method as comparative methods. Among them, the TCN method uses a temporal convolutional network; the CNN-Attention-LSTM method uses a hybrid model that combines convolutional neural networks, attention mechanisms, and long short-term memory networks; the VMD-CNN method uses variational mode decomposition combined with convolutional neural networks; and the VMD-LSTM method uses variational mode decomposition combined with long short-term memory networks.

[0121] The mean square error E MSE , mean absolute error E MAE And the fitting coefficient R 2 As a performance evaluation indicator. MSE Value and E MAE The lower the value, the smaller the gap between the model's prediction result and the true value; R 2 The higher the value, the better the fit between the predicted value and the true value, and the better the model prediction performance. The specific calculation method of each indicator is as follows:

[0122]

[0123] in, Indicates The predicted value of electric vehicle charging load, Indicates The actual value of the electric vehicle charging load, represents the average value of electric vehicle charging load, and samp is the number of samples for prediction of electric vehicle charging load.

[0124] The prediction results of each method are shown in Table 2.

[0125] Table 2 Prediction results of each method

[0126]

[0127] As shown in Table 2, the E calculated by the TCN method MSE 、E MAE The value is the highest among the listed methods, and the prediction effect is poor; E calculated by CNN-Attention-LSTM method MSE 、E MAE Compared with the TCN method, the effect is limited. The VMD-CNN method predicts the load after decomposing it. Compared with TCN and CNN-Attention-LSTM, E MSE 、E MAEThe value is significantly improved, but the CNN network has limited ability to predict time series and the effect is average; the VMD-LSTM method uses LSTM for prediction based on VMD. The LSTM has better sequence prediction effect than CNN, but is inferior to the method of the present invention; the E of the method of the present invention on the data set is MSE 、E MAE The value is lower than other comparison methods, R 2 It is higher than other comparison methods, indicating that the prediction of the method of the present invention has higher accuracy.

[0128] Although the above describes the illustrative specific embodiments of the present invention to facilitate those skilled in the art to understand the present invention, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.

Claims

1. A method for predicting electric vehicle charging load by combining attention mechanism and multi-scale features, characterized in that: The following steps are involved: S1: Downsample the electric vehicle charging load dataset and the meteorological dataset to obtain the electric vehicle charging load sequence aggregated at the hourly granularity; S2: Establish a multivariate linear model to screen the atmospheric temperature, horizontal atmospheric pressure, sea level atmospheric pressure, atmospheric pressure change within three hours, ground relative humidity, average wind speed, dew point temperature, and precipitation to obtain the meteorological characteristics that have a greater impact on the load; S3: The whale optimization algorithm including differential variation factor and nonlinear convergence factor is combined with variational mode decomposition to decompose the aggregated electric vehicle charging load sequence into load components; S4: Establish an electric vehicle charging load prediction model combining attention mechanism and multi-scale features, and perform deep learning on load components and meteorological characteristics; S5: Input the load components into the model for prediction, and add the prediction results of the load components to obtain the final prediction value of the electric vehicle charging load.

2. The electric vehicle charging load prediction method combining attention mechanism and multi-scale features according to claim 1 is characterized in that: In step S3, the whale optimization algorithm including the differential variation factor and the nonlinear convergence factor is combined with the variational mode decomposition to decompose the aggregated electric vehicle charging load sequence into load components; the differential variation factor is introduced into the whale optimization algorithm and nonlinear convergence factor θ, the position update method is as follows: in, represents the best whale position at the tth iteration, L t (n) represents the position of the nth whale at the tth iteration, ψ is a random number between 0 and 1, |·| represents the absolute value operation, and the calculation method of the parameters θ, γ, and β that control the position update is as follows: β=2θr1-θ γ=2r2 Among them, r1 and r2 are random numbers in the range of 0 to 1, and t max is the maximum number of iterations.

3. The electric vehicle charging load prediction method combining attention mechanism and multi-scale features according to claim 1 is characterized in that: In step S4, an electric vehicle charging load prediction model combining attention mechanism and multi-scale features is established, wherein the TCN (Temporal Convolutional Networks) residual block containing the gating mechanism in the model is composed of a first dilated causal convolution layer, a first gating mechanism operation layer, a first ReLU operation layer, a first Dropout layer, a second dilated causal convolution layer, a second gating mechanism operation layer, a second ReLU operation layer, and a second Dropout layer connected in sequence; The first dilated causal convolution layer extracts the features of the input data X. The output H1 of the first dilated causal convolution layer is selectively transmitted and filtered through the first gating mechanism operation layer, and then processed by the first ReLU operation layer and the first Dropout layer to obtain the feature G1. The formula is as follows: H1=ReLU(W F *X+b F ) update1=sigmoid(W update1 *H1+b update1 ) reset1=sigmoid(W reset1 *H1+b reset1 ) G1 = Dropout(ReLU(H1′)) Among them, state represents the hidden state at the previous moment, and the symbol ⊙ represents the element-by-element multiplication operation; G1 passes through the second dilated causal convolution layer, the second gating mechanism operation layer, the second ReLU operation layer, and the second Dropout layer in sequence to obtain feature G2.

4. The electric vehicle charging load prediction method combining attention mechanism and multi-scale features according to claim 1 is characterized in that: In step S4, an electric vehicle charging load prediction model combining attention mechanism and multi-scale features is established, and the TCN residual block containing time attention and channel attention in the model is composed of a time attention module, a channel attention module, and a residual connection module; The temporal attention module consists of a Dense layer, a Flatten layer, a softmax operation layer, a RepeatVector layer, a Permute layer, and a Multiply layer. The weight tensor generated by the Dense layer is flattened and the attention weight score is generated using softmax. time , adjust the attention weight dimension through the RepeatVector layer and the Permute layer to align it with the input feature, apply the attention weight to G2 through the Multiply layer, and obtain feature Feature2. The formula is expressed as: score time =softmax(Flatten(tanh(W time *X+C))) score′ time =Permute(RepeatVector(score time )) Feature2=G2*score′ time The channel attention module consists of a global average pooling layer, a Reshape layer, two Dense layers, and a Multiply layer. The output feature Feature2 of the temporal attention module is globally average pooled, the shape is adjusted through the Reshape layer, two Dense layers are used to reduce and restore the number of channels respectively, and the channel features are weighted through the Multiply layer to obtain the feature Feature3. The formula is expressed as: Feature′2=GlobalAveragePooling1D(Feature2) Feature′2′=Reshape(Feature′2) score channel =Dense(Dense(Feature2″)) Feature3=Feature2*score channel The residual connection module forms the output Res by adding the original input and the features output by the channel attention module i , the formula is: Res i =X+Feature3。 5. The electric vehicle charging load prediction method combining attention mechanism and multi-scale features according to claim 1 is characterized in that: In step S4, the constructed multi-scale feature module consists of a first TCN residual block, a second TCN residual block, a third TCN residual block, an Add layer, an Attention layer, a Dropout layer, a Flatten layer, and three Dense layers; The first TCN residual block, the second TCN residual block, and the third TCN residual block are all composed of TCN residual blocks containing gating mechanisms, temporal attention, and channel attention. Different convolution kernel lengths and different expansion coefficients are used. The first TCN residual block, the second TCN residual block, and the third TCN residual block are connected in parallel to process different time scale features, and the output is added through the Add layer to form a multi-scale feature Res mul , the formula is: Res mul =Res1+Res2+Res3 Among them, Res1, Res2, and Res3 are the outputs of the first TCN residual block, the second TCN residual block, and the third TCN residual block respectively; Res mul Then, the multi-scale features are dynamically adjusted through the Attention layer to form the fusion feature Res fusion ; The Attention layer consists of the first Permute layer, the Dense layer, the second Permute layer, and the Multiply layer; the formula is expressed as: TO d =Dense(softmax(Permute(Res mul ))) Thing fusion =Rea mul *(Swap(A d )) Fusion feature Res fusion The neurons are randomly discarded through the Dropout layer, and the multi-dimensional fusion feature tensor is converted into a one-dimensional tensor through the Flatten layer operation. The conversion from high-dimensional features to the final prediction value is realized through three Dense layers. The formula is expressed as: Res′ fusion =Flatten(Dropout(Res fusion )) V=Dense(Dense(Dense(Res′ fusion )) Among them, Res fusion represents the fusion feature, and V represents the predicted value.

Citation Information

Cited By

  • Method and device for optimizing manufacturing process parameters of traditional Chinese medicine tablets

    CN120782340A

  • An electric vehicle charging load prediction method based on an attention mechanism optimized CNN-BiLSTM model

    CN122796387A