Electric vehicle charging load prediction method based on IACO-Attention-LSTM

Through the IACO-Attention-LSTM method, the LSTM neural network hyperparameters are optimized, combined with the Attention mechanism, to solve the randomness and complexity problems of electric vehicle charging load prediction, and improve the prediction accuracy and efficiency, especially during peak periods and spatial correlation. Sexually.

CN118645992APending Publication Date: 2024-09-13HUBEI FUBIAN SPACETIME ENERGY TECH CO LTD +3
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410689561.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

Electric vehicle charging load prediction is subject to randomness and complexity, especially during peak periods and is affected by multiple factors, which makes prediction more difficult, especially the problems of spatial correlation and uneven geographical distribution.

Method used

The electric vehicle charging load prediction method based on IACO-Attention-LSTM is used to initialize the LSTM neural network model, use the IACO algorithm to optimize the hyperparameters, combine the Attention mechanism for data integration, select electricity prices and holidays as input variables, and ignore the effects of time and weather. Accelerate hyperparameter selection and model training with the Elite Ant System.

Benefits of technology

The accuracy and efficiency of charging load prediction are improved. Through the minimum and maximum ant system and elite ant optimization, the optimal hyperparameters of the LSTM neural network are quickly found, which improves the accuracy of the prediction results and the stability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118645992A
    Figure CN118645992A
Patent Text Reader

Abstract

The invention discloses an electric vehicle charging load prediction method based on IACO-Attention-LSTM. The method comprises the following steps: selecting an electricity price and holidays as input variables; the IACO algorithm adopts an elite ant system and a minimum and maximum ant system, and when the IACO algorithm is used for optimizing the LSTM neural network, the IACO feeds back a prediction error of the LSTM neural network; before load prediction of the IACO-LSTM method, the IACO algorithm trains the LSTM, selects different hyper-parameters to train a data set and predicts an output result, determines hyper-parameters for enabling ants to traverse all targets as soon as possible according to an error between a prediction result and a real load value, outputs an optimal solution after completion of iteration, assigns the optimal solution to an LSTM neural network, and finally performs load prediction. And determining a final LSTM neural network prediction model, and integrating all prediction results by using an Attention mechanism to obtain a prediction result so as to improve prediction accuracy and efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electric vehicle charging load prediction, and in particular relates to an electric vehicle charging load prediction method based on IACO-Attention-LSTM. Background Art

[0002] At present, due to the randomness of the charging behavior of electric vehicle users, the charging load fluctuates greatly, especially during peak hours, which brings certain difficulties to the prediction work; secondly, the charging behavior of electric vehicles is affected by many factors. The load of charging stations is not only affected by user behavior, but may also be affected by external factors such as meteorological conditions and holidays, which increases the complexity of charging station load prediction; finally, it is affected by the spatial correlation of charging demand. Due to the uneven geographical distribution of electric vehicle charging stations, load prediction based on spatial information has become an important challenge. Summary of the invention

[0003] In view of this, the present invention provides an electric vehicle charging load prediction method based on IACO-Attention-LSTM to improve the accuracy and efficiency of the prediction.

[0004] An electric vehicle charging load prediction algorithm based on IACO-Attention-LSTM is characterized by comprising the following steps:

[0005] Step 1: Initialize the LSTM neural network model, select different LSTM hyperparameters as targets, and preprocess the input electric vehicle historical charging load data to obtain a data set. Use the LSTM neural network to train the data set to obtain the predicted future charging load of the electric vehicle. Compare the predicted future charging load of the electric vehicle with the actual charging load to obtain the error value.

[0006] Step 2: Using the error value as the initialization parameter of the IACO algorithm, the pheromones on each path are equal. Ants select paths to traverse according to the random proportion rule. After each cycle, they make relative adjustments to the pheromones in different paths and record the action path with the highest pheromone concentration under the current number of iterations.

[0007] Step 3: After reaching the maximum number of iterations of the IACO algorithm, the optimal path is output, that is, the optimal hyperparameter selection of LSTM, and the test data and data preprocessing are re-performed. The data set is then trained and the obtained prediction results are compared with the actual load. If the error meets the requirements, the training is stopped and the final model of LSTM is determined. The prediction results are obtained through the training data.

[0008] Step 4: Integrate the prediction results through the Attention mechanism, calculate the weight of the output in each time step in the final load forecast output, and then take the weighted average based on the obtained weights to obtain the final power load forecast value of the electric vehicle charging station.

[0009] Furthermore, in step 1, the input electric vehicle historical charging load data of LSTM selects electricity prices and holidays, without considering the impact of time and weather, and the data is normalized.

[0010] Furthermore, in step 2, the elite ant formula is used to select the best performing ants in the ant colony as elite ants. The optimization of elite ants is based on the original ant colony algorithm. For the ants that have found the optimal path, an additional amount of pheromone is added to their path. This optimal path is recorded as T bs , for path T bs The size of the added pheromone is Δτ b (i,j), the mathematical expression of the corresponding pheromone update is as follows:

[0011]

[0012] Where t represents the current number of iterations; ρ is the pheromone volatilization factor, which is a pre-set constant between 0.2 and 0.5; (1-ρ) represents the current pheromone retention coefficient; τ ij represents the pheromone content on path ij, remains unchanged, e is the weight parameter, the first part of the formula represents the remaining pheromone content value of all ants in the previous cycle on a path from target i to target j, and the second part represents the pheromone left by all ants on this path in the current cycle:

[0013]

[0014] Among them, Q is a constant, L bs Indicates the length of the current optimal path.

[0015] Furthermore, the LSTM hyperparameters in step 1 include the number of iterations, the learning rate, the maximum allowed error, the number of input layer nodes, the number of hidden layer layers, and the number of hidden layer nodes.

[0016] The present invention has the following beneficial effects: electricity prices and holidays are selected as input variables, and the influence of time and weather is not considered; the IACO algorithm adopts an elite ant system and a minimum-maximum ant system, and when the IACO algorithm is used to optimize the LSTM neural network, the feedback of IACO is the prediction error of the LSTM neural network; the LSTM method is allowed to select different hyperparameters to train the data set and predict the output results, and the hyperparameters that can allow ants to traverse all targets fastest are judged according to the error between the prediction result and the actual load value, and the optimal solution is output after the number of iterations is completed, and is assigned to the LSTM neural network, so as to more accurately determine the final LSTM neural network prediction model to improve the accuracy and efficiency of the prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of a method for predicting electric vehicle charging load based on IACO-Attention-LSTM according to an embodiment of the present invention;

[0018] Figure 2 A schematic diagram of the structure of an LSTM neural network according to an embodiment of the present invention. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] See also Figure 1 The embodiment of the present invention provides an electric vehicle charging load prediction method based on IACO-Attention-LSTM, comprising the following steps:

[0021] Step 1: Initialize the LSTM neural network model (such as Figure 2 As shown in the figure), different hyperparameters are selected as targets, and the input electric vehicle historical charging load data is preprocessed, and the data set is trained to obtain the predicted future charging load of the electric vehicle, and the predicted future charging load of the electric vehicle is compared with the actual charging load to obtain the error value;

[0022] Step 2: Use the error value as the initialization parameter of the IACO algorithm. The pheromones on each path are equal. Ants will randomly select paths to traverse according to the random proportion rule. After each cycle, they will make relative adjustments to the amount of pheromones in different paths, and record the action path with the highest pheromone concentration under the current number of iterations.

[0023] In step 2, the elite ant formula is used to select the best performing ants in the ant colony as elite ants. Elite ants have higher pheromone concentrations and larger movement ranges during the search process, so they can find better solutions faster and accelerate convergence. The optimization of elite ants is based on the original ant colony algorithm. For the ants that have found the optimal path, an additional amount of pheromone is added to their path. This optimal path is recorded as T bs , for path T bs The size of the added pheromone is Δτ b (i,j), the mathematical expression of the corresponding pheromone update is as follows:

[0024]

[0025] Among them, t represents the current number of iterations; ρ is the pheromone volatilization factor, which is a constant set in advance, generally between 0.2 and 0.5; (1-ρ) represents the current pheromone retention coefficient. τ ij represents the pheromone content on path ij, remains unchanged, e is the weight parameter, the first part of the formula represents the remaining pheromone content value of all ants in the previous cycle on a path from target i to target j, and the second part represents the pheromone left by all ants on this path in the current cycle.

[0026]

[0027] Among them, Q is a constant, L bs Indicates the length of the current optimal path.

[0028] Step 3: After reaching the maximum number of iterations of the IACO algorithm, output the optimal solution, that is, the optimal hyperparameter selection of LSTM. After determining the hyperparameter selection of LSTM, retrain the data set to obtain the predicted results and compare them with the actual load. If the error meets the requirements, stop training and determine the final model of LSTM;

[0029] Step 4: Integrate all prediction results through the Attention mechanism to obtain the final prediction value. The calculation formula is as follows:

[0030]

[0031] Among them, W, U, W v is the weight matrix, b,b v is the bias matrix, tanh is the nonlinear activation function, and the softmax layer is the intermediate processing layer between the method and the final result.

[0032] Analyzing the graphical relationship between the influencing factors and the load values ​​of the charging load of an electric vehicle charging station at a specific time cannot fully demonstrate the degree of correlation between them. In order to quantify the degree of correlation of the selected factors and ensure reliable data support for the subsequent factor abandonment, the present invention uses the maximum information coefficient to measure the degree of correlation of different factors to the charging station load prediction, and uses the function formula to perform statistical calculations on the data of the entire sample, so as to explore the correlation between different influencing factors and the load curve from a global perspective.

[0033] The maximum information coefficient is a statistical method used to measure the strength of a nonlinear relationship between two variables. It can discover various types of relationships, including linear and nonlinear relationships, and can work effectively even when there is noise in the data. Compared with the traditional correlation coefficient, the maximum information coefficient has a simpler calculation formula; it has outstanding robustness and can better capture complex relationships. The maximum information coefficient MIC ranges from [0,1] and has symmetry, good universality and fairness. If variables X and Y are independent, then MIC(X,Y) = 0; if there is a definite relationship between X and Y, then MIC(X,Y) = 1.

[0034] The specific formula is as follows:

[0035]

[0036] Among them, a and b are the number of grids divided in the (x,y) scatter plot in the x and y directions, which is essentially a grid distribution. B is a variable randomly set based on the experimental results. In this paper, the size of B is set to 0.6 of the amount of data in the data set. I(X,Y) is the mutual information formula, which is mathematically expressed as:

[0037]

[0038] Where p(x,y) represents the probability that X and Y take the values ​​x and y, and p(x) and p(y) represent the marginal probabilities of X and Y respectively.

[0039] The calculation of MIC is divided into two steps:

[0040] Set constants a and b, transform the (x,y) scatter plot into a grid with a columns and b rows, find the maximum mutual information value and perform normalization.

[0041] The maximum mutual information value when a and b take different values ​​is taken as the MIC value.

[0042] The value range of MIC is between [0, 1]. It is generally believed that when MIC exceeds 0.6, we judge that the factor has a significant correlation with the result, and this factor can be used as an input condition when building the model later. The specific correlation strength is shown in Table 1.

[0043] Table 1 MIC correlation strength reference

[0044]

[0045] According to the maximum information coefficient calculation formula, we calculated the MIC value of each influencing factor respectively. The calculation results are shown in Table 2.

[0046] Table 2 The load correlation values ​​of various influencing factors on electric vehicle charging stations

[0047]

[0048] As can be seen from Table 2, there is an extremely significant correlation between electricity prices and the load of electric vehicle charging stations, and holidays also have a relatively obvious correlation with the load of electric vehicle charging stations. In contrast, time and weather have a very low correlation with the load of electric vehicle charging stations. Therefore, when considering the selection of the electric vehicle charging station load prediction model, we choose electricity prices and holidays as input variables, without considering the impact of time and weather.

[0049] The LSTM method can be simply decomposed into four parts: cell state, forget gate, input gate and output gate.

[0050] (1) Cell status

[0051] The cell state is a key part of the LSTM method and is used to store long-term information. It allows the network to keep a memory of past information and apply it to the current task when needed. The cell state controls the input, forgetting, and output of information through a series of gating mechanisms, thereby achieving fine-grained control of information.

[0052]

[0053] (2) Forget Gate

[0054] The function of the forget gate is to filter information. It determines which feature information in the previous unit state can be transferred to the current unit state. The specific method is to use the retention of the hidden layer at the previous moment and the input at the current moment as the value to be processed. And by using the properties of the sigmoid activation function, the activation function generates a variable from 0 to 1 to determine which part of the data is retained and which part of the data is discarded. As a trained LSTM model, most forget gate values ​​are very close to 0 or 1, and the situation of partially retaining and partially discarding is very rare.

[0055] f t =σ(ω f [h t-1 ,x t ]+b f ) (4)

[0056] ω f is the input x t And the hidden layer h at the previous moment t-1 To the weight matrix of the forget gate, b f is the bias matrix and σ is the activation function.

[0057] (3) Input Gate

[0058] Compared to the forget gate that determines whether to keep or discard "memory", the input gate is used to update the state of the cell in real time, and determines how much new information should be added to the cell state in the current time step. In the specific expression, in addition to using the activation function to filter information, tanh is also added to enhance the model's ability to express and learn data. By performing this nonlinear transformation on the incoming data, it can better adapt to the learning tasks of the LSTM neural network. This nonlinear transformation helps the LSTM network better capture the complex patterns and long-term dependencies in time series data, thereby improving the performance and generalization ability of the model.

[0059] i t =σ(ω i [h t-1 ,x t ]+b t ) (5)

[0060]

[0061] ω i and ω c All input x t And the hidden layer h at the previous moment t-1 The weight matrix to the input gate, b t and b c is the corresponding bias matrix and σ is the activation function.

[0062] (4) Output gate

[0063] The output gate is responsible for controlling the information flow of the cell state to the output. It determines how the cell state of the LSTM unit at the current moment is output to the next layer of the network or as the final output. The function of the output gate is to control which parts of the cell state will be output by using the sigmoid activation function. This enables the LSTM network to selectively output information that is useful for the current task, thereby improving the performance and generalization ability of the network.

[0064] The main function of the output gate is to transmit and output, passing the information of the current time step to the next hidden layer and calculating the predicted value at this moment. The output gate controls the information to be output from the input of the previous time step hidden layer and the current time step through the activation function, and further enhances the nonlinear expression ability and generalization ability of the output gate through the tanh layer processing. The specific formula is as follows:

[0065] O t =σ(ω o [h t-1 ,x t ]+b o ) (7)

[0066] h t =O t ×tanhC t (8)

[0067] Among them, ω o is the input x t And the hidden layer h at the previous moment t-1 The weight matrix to the output gate, b o is the corresponding bias matrix and σ is the activation function.

[0068] The attention mechanism is a computational model that mimics the way humans allocate attention and is commonly used in the fields of machine learning and artificial intelligence. Its basic idea is to simulate the attention allocation mechanism of the human brain when processing information. By weighting the input data, the model can pay more attention to important information, thereby improving the performance and effect of the model. The attention mechanism model assigns different attention weights to different parts of the input data, so that the model can pay more attention to important parts when processing data and ignore insignificant parts. This method can help the model better understand the internal structure and association of the input data, thereby improving the generalization ability and accuracy of the model.

[0069] The main idea of ​​the Attention method is to calculate the weight of the output in each time step in the final load forecast output, and then take the weighted average according to the obtained weight to obtain the final electric vehicle charging station power load forecast value. The specific weight calculation is shown in formula (9).

[0070]

[0071] Among them, W, U, W v is the weight matrix, b,b v is the bias matrix, tanh is the nonlinear activation function, and the softmax layer is the intermediate processing layer between the method and the final result.

[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. An electric vehicle charging load prediction algorithm based on IACO-Attention-LSTM, characterized in that: The steps include: Step 1: Initialize the LSTM neural network model, select different LSTM hyperparameters as targets, and preprocess the input electric vehicle historical charging load data to obtain a data set. Use the LSTM neural network to train the data set to obtain the predicted future charging load of the electric vehicle. Compare the predicted future charging load of the electric vehicle with the actual charging load to obtain the error value. Step 2: Using the error value as the initialization parameter of the IACO algorithm, the pheromones on each path are equal. Ants select paths to traverse according to the random proportion rule. After each cycle, they make relative adjustments to the pheromones in different paths and record the action path with the highest pheromone concentration under the current number of iterations. Step 3: After reaching the maximum number of iterations of the IACO algorithm, the optimal path is output, that is, the optimal hyperparameter selection of LSTM, and the test data and data preprocessing are re-performed. The data set is then trained and the obtained prediction results are compared with the actual load. If the error meets the requirements, the training is stopped and the final model of LSTM is determined. The prediction results are obtained through the training data. Step 4: Integrate the prediction results through the Attention mechanism, calculate the weight of the output in each time step in the final load prediction output, and then take the weighted average based on the obtained weights to obtain the final power load prediction value of the electric vehicle charging station.

2. The electric vehicle charging load prediction method based on IACO-Attention-LSTM according to claim 1 is characterized in that: In step 1, the input of LSTM to the historical charging load data of electric vehicles selects electricity prices and holidays, without considering the impact of time and weather, and the data is normalized.

3. The electric vehicle charging load prediction method based on IACO-Attention-LSTM according to claim 1 is characterized in that: In step 2, the elite ant formula is used to select the best performing ants in the ant colony as elite ants. The optimization of elite ants is based on the original ant colony algorithm. For the ants that have found the optimal path, additional pheromones are added to their paths. This optimal path is recorded as T. bs , for path T bs The size of the added pheromone is Δτ b (i,j), the mathematical expression of the corresponding pheromone update is as follows: Where t represents the current number of iterations; ρ is the pheromone volatilization factor, which is a pre-set constant between 0.2 and 0.5; (1-ρ) represents the current pheromone retention coefficient; τ ij represents the pheromone content on path ij, remains unchanged, e is the weight parameter, the first part of the formula represents the remaining pheromone content value of all ants in the previous cycle on a path from target i to target j, and the second part represents the pheromone left by all ants on this path in the current cycle: Among them, Q is a constant, L bs Indicates the length of the current optimal path.

4. The electric vehicle charging load prediction method based on IACO-Attention-LSTM according to claim 1 is characterized in that: The LSTM hyperparameters in step 1 include the number of iterations, learning rate, maximum allowed error, number of input layer nodes, number of hidden layer layers, and number of hidden layer nodes.

Citation Information

Cited By

  • Electric vehicle charging load prediction method for improving HHO algorithm and optimizing neural network

    CN120125055A

  • Load prediction method and system based on virtual power plant operation

    CN120893637A

  • A load prediction method and system based on virtual power plant operation

    CN120893637B

  • A charging station load prediction data processing method and system based on dynamic fusion of multi-source heterogeneous data

    CN123032187A