Short-term load prediction method and system

By using convolutional neural network, gated cyclic unit and attention layer models in electric vehicle load prediction, and combining with improved particle swarm optimization algorithm to optimize hyperparameters, the problems of slow model training speed and strong dependence on hyperparameters in the existing technology are solved, and efficient and accurate short-term load prediction is achieved.

CN120046765APending Publication Date: 2025-05-27CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +2
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411899300.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

When the prior art processes nonlinear and non-stationary time series data of electric vehicle charging load, the model training speed is slow and has strong dependence on hyperparameters, resulting in inaccurate prediction results.

Method used

The load prediction model is constructed using the convolutional neural network layer, the gated cyclic unit layer and the attention layer, and combined with the improved particle swarm optimization algorithm to optimize hyperparameters to improve the prediction accuracy and efficiency of the model.

Benefits of technology

By extracting the feature vectors of load input data and performing deep learning processing, short-term load prediction can be performed quickly and accurately, accurately capturing the complex characteristics of electric vehicle charging load data, solving the limitations of traditional methods for processing such data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120046765A_ABST
    Figure CN120046765A_ABST
Patent Text Reader

Abstract

The invention provides a short-term load prediction method and system, and the method comprises the steps: obtaining load input data of a target charging station, inputting the load input data into a pre-constructed load prediction model, and extracting a feature vector of the load input data through a convolutional neural network layer in the pre-constructed load prediction model; serialized feature processing and deep learning of time sequence information are carried out on the extracted feature vectors through a gating circulation unit layer in the load prediction model to generate hidden state vectors, and then weight coefficients of the hidden state vectors are calculated through an attention layer in the load prediction model; and further weighting the hidden state vector through a weight coefficient, and then carrying out short-term load prediction on the weighted hidden state vector through a full connection layer to generate a load prediction result. According to the invention, short-term load prediction can be rapidly and accurately carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of load forecasting, and in particular to a short-term load forecasting method and system. Background Art

[0002] Currently, the load forecasting of electric vehicles (EVs) mainly adopts model-driven methods, but due to the lack of real load data, these forecast results are often significantly different from the actual load demand. With the rapid advancement of artificial intelligence (AI) technology, data-driven forecasting methods have provided a new direction for EV load forecasting. Although traditional AI algorithms, such as random forests, support vector machines, and back propagation neural networks, perform well in nonlinear data fitting and parameter learning, they often fail to effectively learn time series features when processing time series data such as charging load history data, and sometimes even damage the time series continuity of the data. In contrast, deep learning, with its multi-level nonlinear mapping structure, can deeply explore the potential features in the EV load series and significantly improve the accuracy of prediction.

[0003] In addition, the selection of neural network hyperparameters is often manually adjusted based on experience, and the effect is difficult to guarantee. In addition, conventional models have slow training speed and high computational complexity, and when used for large-scale nonlinear and non-stationary time series data, such as electric vehicle charging load data, they have the defects of slow training speed and high computational complexity.

[0004] Therefore, it is of great significance to process nonlinear and non-stationary time series data while improving the accuracy and efficiency of model prediction. Summary of the invention

[0005] In order to solve the problems of slow model training speed and strong dependence of the model on hyperparameters in the prior art, the present invention proposes a short-term load forecasting method and system.

[0006] In a first aspect, a short-term load forecasting method is provided, comprising:

[0007] Obtaining load input data of a target charging station, wherein the load input data includes historical load time series data and load influencing factors corresponding to each moment of the historical load time series data;

[0008] Inputting the load input data into a pre-built load forecasting model to generate load forecasting data for the target charging station;

[0009] Wherein, the pre-built load forecasting model includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer;

[0010] The convolutional neural network layer is used to extract the feature vector of the load input data and input it into the gated recurrent unit layer;

[0011] The gated recurrent unit layer is used to perform serialized feature processing based on the feature vector and deep learning of time series information to generate a hidden state vector and input it into the attention layer;

[0012] The attention layer is used to calculate the weight coefficient based on the hidden state vector, weight the hidden state vector through the weight coefficient, and perform short-term load prediction through a fully connected layer based on the weighted hidden state vector to generate a load prediction result.

[0013] Preferably, the construction process of the load prediction model includes:

[0014] Obtain the load training data in the historical time interval of the target charging station and the load verification data corresponding to the load training data, wherein the load training data includes historical load sample time series data and historical load sample influencing factors corresponding to each moment of the historical load sample time series data;

[0015] Taking the load training data as the input and the load verification data as the output corresponding to the load training data, training the load prediction model to be trained to obtain the trained load prediction model, wherein the load prediction model to be trained includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer;

[0016] Obtain the hyperparameters to be optimized of the trained load prediction model, and iteratively optimize the hyperparameters to be optimized based on the improved particle swarm optimization algorithm to generate optimized hyperparameters, wherein the improved particle swarm optimization algorithm improves the particle swarm optimization algorithm by using a chaotic mapping strategy, a dynamic adjustment of population size strategy, and an adaptive adjustment of learning factor strategy;

[0017] Substitute the optimized hyperparameters into the optimized load prediction model and retrain the optimized load prediction model based on the load training data and the load verification data to generate a load prediction model.

[0018] Preferably, the iteratively optimizing the hyperparameters to be optimized based on the improved particle swarm optimization algorithm to generate optimized hyperparameters includes:

[0019] Randomly generate multiple groups of hyperparameters to be optimized based on the hyperparameters to be optimized, wherein each group of hyperparameters to be optimized includes one or more of the following: the number of convolutional kernels in the convolutional neural network layer of the load prediction model, the number of hidden neurons in the gated recurrent unit layer, the maximum number of iterations, the learning rate, and the batch size;

[0020] Map each set of hyperparameters to be optimized to the positions of each particle in the improved particle swarm optimization algorithm, initialize the population size, individual optimal position, optimal particle, and the velocity of each particle, and initialize the population position based on the chaos mapping strategy of the improved particle swarm optimization algorithm;

[0021] After selecting the mean absolute error or root mean square error to evaluate the training load prediction model of the hyperparameter set corresponding to each particle, generate a load training prediction result based on the trained load prediction model, with the minimum error between the load training prediction result and the load validation data as the fitness function, evaluate the fitness of each particle based on the fitness function, and update the individual optimal position based on the fitness of each particle;

[0022] Calculate the population diversity metric based on the average particle spacing, and adjust the population size according to the population diversity metric result based on the dynamic population size adjustment strategy of the improved particle swarm optimization algorithm;

[0023] Determine the updated optimal particle based on the updated individual optimal position, and determine the updated optimal particle as the optimal particle;

[0024] Update the velocity and position of each particle according to the preset update method, and adjust the learning factor based on the adaptive adjustment of the learning factor strategy of the improved particle swarm optimization algorithm according to the iteration progress, so that the particle can find the optimal solution in the search space;

[0025] Evaluate the fitness of the optimal solution target of the hyperparameter set corresponding to each particle based on the fitness function, and update the individual optimal position based on the fitness of each particle for iterative optimization until the preset iteration end condition is met to obtain the optimized hyperparameters.

[0026] Preferably, the adjusting the population size according to the population diversity metric result based on the dynamic population size adjustment strategy of the improved particle swarm optimization algorithm includes:

[0027] Set a preset diversity threshold, a preset population adjustment amount, and a population size range;

[0028] After the population diversity metric result is lower than the preset diversity threshold, increase the population size based on the preset population adjustment amount, and ensure that the adjusted population size is within the population size range;

[0029] After the population diversity metric result is higher than the preset diversity threshold, reduce the population size based on the preset population adjustment amount, and ensure that the adjusted population size is within the population size range.

[0030] Preferably, adjusting the learning factor according to the adaptive adjustment learning factor strategy based on the improved particle swarm optimization algorithm according to the iteration progress includes:

[0031] Set a preset learning factor adjustment amount and a learning factor adjustment range, and calculate the current iteration fitness;

[0032] When it is determined that the current iteration fitness is improved, increase the learning factor based on the preset learning factor adjustment amount, and ensure that the adjusted learning factor is within the learning factor adjustment range;

[0033] When it is determined that the current iteration fitness decreases or stagnates, reduce the learning factor based on the preset learning factor adjustment amount, and ensure that the adjusted learning factor is within the learning factor adjustment range.

[0034] Preferably, using the load training data as the input and the load verification data as the output corresponding to the load training data, training the load prediction model to be trained to obtain a trained load prediction model, includes:

[0035] Input the load training data into the convolutional neural network layer of the load prediction model to be trained;

[0036] Extract the feature vector of the load training data through the convolutional neural network layer, and input the feature vector into the gated recurrent unit layer of the load prediction model to be trained to generate a hidden state vector;

[0037] Input the hidden state vector into the attention layer of the load prediction model to be trained, calculate the weight coefficient of each time step in the hidden state vector through the attention layer, weight the hidden state vector based on the weight coefficient, and perform short-term load prediction through a fully connected layer based on the weighted hidden state vector to generate a load training prediction result;

[0038] Based on the load training prediction result, the load verification data, and the load training data, iteratively optimize the parameters corresponding to the convolutional neural network layer, the gated recurrent unit layer, and the attention layer in the load prediction model to be trained through the root mean square error loss function and the root mean square propagation optimization algorithm by backpropagation until the preset iteration end condition is met, to obtain a trained load prediction model.

[0039] Preferably, calculating the weight coefficient of each time step in the hidden state vector through the attention layer, weighting the hidden state vector based on the weight coefficient, and performing short-term load prediction through a fully connected layer based on the weighted hidden state vector to generate a load training prediction result, includes:

[0040] Calculate the weight coefficients for each time step in the hidden state vector, and calculate the context vector based on each time step and the weight coefficient corresponding to each time step;

[0041] Based on the context vector and the output of the current time step, perform concatenation and summation, and input it into the fully connected layer for load prediction to generate the load training prediction result.

[0042] In a second aspect, the present invention provides a short-term load prediction system, including:

[0043] An acquisition module, configured to acquire load input data of a target charging station, where the load input data includes historical load time series data and load influencing factors corresponding to each moment of the historical load time series data;

[0044] A prediction module, configured to input the load input data into a pre-constructed load prediction model to generate load prediction data of the target charging station;

[0045] Wherein, the pre-constructed load prediction model includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer;

[0046] The convolutional neural network layer is configured to extract a feature vector of the load input data and input it into the gated recurrent unit layer;

[0047] The gated recurrent unit layer is configured to perform serialized feature processing based on the feature vector and deep learning of time series information to generate a hidden state vector and input it into the attention layer;

[0048] The attention layer is configured to calculate weight coefficients based on the hidden state vector, weight the hidden state vector through the weight coefficients, and perform short-term load prediction through the fully connected layer based on the weighted hidden state vector to generate a load prediction result.

[0049] Preferably, the prediction module includes:

[0050] A load prediction model training sub-module, configured to acquire load training data in a historical time interval of a target charging station and load verification data corresponding to the load training data, where the load training data includes historical load sample time series data and historical load sample influencing factors corresponding to each moment of the historical load sample time series data;

[0051] Using the load training data as input and the load verification data as the output corresponding to the load training data, train the load prediction model to be trained to obtain a trained load prediction model, where the load prediction model to be trained includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer;

[0052] Obtain the hyperparameters to be optimized of the trained load prediction model, and iteratively optimize the hyperparameters to be optimized based on the improved particle swarm optimization algorithm to generate optimized hyperparameters, where the improved particle swarm optimization algorithm improves the particle swarm optimization algorithm by using a chaotic mapping strategy, a dynamic population size adjustment strategy, and an adaptive learning factor adjustment strategy;

[0053] Substitute the optimized hyperparameters into the optimized load prediction model, and retrain the optimized load prediction model based on the load training data and the load validation data to generate a load prediction model.

[0054] Preferably, the load prediction model training sub-module includes:

[0055] An iterative optimization sub-module, configured to randomly generate multiple groups of hyperparameters to be optimized based on the hyperparameters to be optimized, where each group of hyperparameters to be optimized includes one or more of the following: the number of convolution kernels in the convolutional neural network layer in the load prediction model, the number of hidden neurons in the gated recurrent unit layer, the maximum number of iterations, the learning rate, and the batch size;

[0056] Map each group of hyperparameters to be optimized to the position of each particle in the improved particle swarm optimization algorithm, initialize the population size, the individual optimal position, the optimal particle, and the velocity of each particle, and initialize the population position based on the chaotic mapping strategy of the improved particle swarm optimization algorithm;

[0057] After selecting the mean absolute error or the root mean square error to evaluate the load prediction model trained by the hyperparameter group corresponding to each particle, generate a load training prediction result and a fitness function with the minimum error between the load validation data based on the trained load prediction model, and evaluate the fitness of each particle based on the fitness function, and update the individual optimal position based on the fitness of each particle;

[0058] Calculate the population diversity metric based on the average particle spacing, and adjust the population size according to the population diversity metric result based on the dynamic population size adjustment strategy of the improved particle swarm optimization algorithm;

[0059] Determine the updated optimal particle based on the updated individual optimal position, and determine the updated optimal particle as the optimal particle;

[0060] Update the velocity and position of each particle according to a preset update method, and adjust the learning factor according to the iteration progress based on the adaptive learning factor adjustment strategy of the improved particle swarm optimization algorithm, so that the particles can find the optimal solution in the search space based on the adjusted learning factor;

[0061] Evaluate the fitness of each particle corresponding to the optimal solution target of the hyperparameter group based on the fitness function, and update the individual optimal position based on the fitness of each particle for iterative optimization until the preset iteration end condition is satisfied, so as to obtain the optimized hyperparameters.

[0062] Preferably, the iterative optimization sub-module includes:

[0063] The population adjustment sub-module is used to set a preset diversity threshold, a preset population adjustment amount, and a population size range;

[0064] After the population diversity measurement result is lower than the preset diversity threshold, increase the population size based on the preset population adjustment amount, and ensure that the adjusted population size is within the population size range;

[0065] After the population diversity measurement result is higher than the preset diversity threshold, reduce the population size based on the preset population adjustment amount, and ensure that the adjusted population size is within the population size range.

[0066] Preferably, the iterative optimization sub-module includes:

[0067] The learning factor adjustment sub-module is used to set a preset learning factor adjustment amount and a learning factor adjustment range, and calculate the current iteration fitness;

[0068] When it is determined that the current iteration fitness improves, increase the learning factor based on the preset learning factor adjustment amount, and ensure that the adjusted learning factor is within the learning factor adjustment range;

[0069] When it is determined that the current iteration fitness decreases or stagnates, reduce the learning factor based on the preset learning factor adjustment amount, and ensure that the adjusted learning factor is within the learning factor adjustment range.

[0070] Preferably, the load prediction model training sub-module includes:

[0071] The iterative training sub-module is used to input the load training data into the convolutional neural network layer of the load prediction model to be trained;

[0072] Extract the feature vector of the load training data through the convolutional neural network layer, and input the feature vector into the gated recurrent unit layer of the load prediction model to be trained to generate a hidden state vector;

[0073] Input the hidden state vector into the attention layer of the load prediction model to be trained, calculate the weight coefficients of each time step in the hidden state vector through the attention layer, weight the hidden state vector based on the weight coefficients, and perform short-term load prediction through a fully connected layer based on the weighted hidden state vector to generate a load training prediction result;

[0074] Based on the load training prediction result, the load validation data, and the load training data, use the root mean square error loss function and the root mean square propagation optimization algorithm to iteratively optimize the parameters corresponding to the convolutional neural network layer, the gated recurrent unit layer, and the attention layer in the load prediction model to be trained through backpropagation until the preset iteration end condition is met, and obtain the trained load prediction model.

[0075] Preferably, the iterative training sub-module includes:

[0076] A gated recurrent sub-module for calculating the weight coefficients of each time step in the hidden state vector and calculating a context vector based on each time step and the weight coefficient corresponding to each time step;

[0077] Perform concatenation summation based on the context vector and the output of the current time step, and input it into a fully connected layer for load prediction to generate a load training prediction result.

[0078] On the other hand, the present application also provides an electronic device, including: at least one processor and a memory; the memory and the processor are connected through a bus;

[0079] The memory is used to store one or more programs;

[0080] When the one or more programs are executed by the at least one processor, the method for short-term load prediction as described above is implemented.

[0081] On the other hand, the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the method for short-term load prediction as described above is implemented.

[0082] Compared with the prior art, the beneficial effects of the present invention are:

[0083] The present invention provides a short-term load forecasting method and system. The method obtains the load input data of a target charging station and inputs the load input data into a pre-constructed load forecasting model. The convolutional neural network layer in the pre-constructed load forecasting model extracts the feature vectors of the load input data, and the gated recurrent unit layer in the load forecasting model performs serialized feature processing on the extracted feature vectors and deep learning of time series information to generate hidden state vectors. Then, the attention layer in the load forecasting model calculates the weight coefficients for the hidden state vectors, further weights the hidden state vectors through the weight coefficients, and then passes the weighted hidden state vectors through the fully connected layer for short-term load forecasting to generate the load forecasting results. Through the present invention, short-term load forecasting can be carried out quickly and accurately, and at the same time, the complex characteristics of electric vehicle charging load data can be accurately captured for non-linear and non-stationary time series data, solving the limitations of traditional methods in dealing with such data. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] Figure 1 It is a flowchart of the short-term load forecasting method of the present invention;

[0085] Figure 2 It is a specific flowchart of the short-term load forecasting method of the present invention;

[0086] Figure 3 It is a schematic structural diagram of the gated recurrent unit layer of the short-term load forecasting method of the present invention;

[0087] Figure 4 It is a schematic flow diagram of the improved particle swarm optimization algorithm of the short-term load forecasting method of the present invention;

[0088] Figure 5 It is a schematic structural diagram of the short-term load forecasting system of the present invention;

[0089] Figure 6 It is a schematic structural diagram of an electronic device of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0090] The present invention provides a short-term load forecasting method and system. The method obtains the load input data of a target charging station and inputs the load input data into a pre-constructed load forecasting model. The convolutional neural network layer in the pre-constructed load forecasting model extracts the feature vectors of the load input data, and the gated recurrent unit layer in the load forecasting model performs serialized feature processing on the extracted feature vectors and deep learning of time series information to generate hidden state vectors. Furthermore, the attention layer in the load forecasting model calculates weight coefficients based on the hidden state vectors, further weights the hidden state vectors through the weight coefficients, and then performs short-term load forecasting on the weighted hidden state vectors through a fully connected layer to generate a load forecasting result. Through the present invention, short-term load forecasting can be performed quickly and accurately, and at the same time, the complex characteristics of electric vehicle charging load data can be accurately captured for non-linear and non-stationary time series data, solving the limitations of traditional methods in processing such data.

[0091] To better understand the present invention, the content of the present invention will be further described below in conjunction with the specification drawings and embodiments.

[0092] Embodiment 1:

[0093] A short-term load forecasting method, as Figure 1 shown, includes:

[0094] Step S1: Obtain the load input data of the target charging station, where the load input data includes historical load time series data and load influencing factors corresponding to each moment of the historical load time series data;

[0095] Step S2: Input the load input data into a pre-constructed load forecasting model to generate the load forecasting data of the target charging station;

[0096] Among them, the pre-constructed load forecasting model includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer; the convolutional neural network layer is used to extract the feature vectors of the load input data and input them into the gated recurrent unit layer; the gated recurrent unit layer is used to perform serialized feature processing on the feature vectors and deep learning of time series information to generate hidden state vectors and input them into the attention layer; the attention layer is used to calculate weight coefficients based on the hidden state vectors, and weight the hidden state vectors through the weight coefficients, and perform short-term load forecasting on the weighted hidden state vectors through a fully connected layer to generate a load forecasting result.

[0097] In this embodiment, the construction process of the load forecasting model in step S2 includes:

[0098] Obtain the load training data for the historical time interval of the target charging station and the load verification data corresponding to the load training data, where the load training data includes historical load sample time series data and historical load sample influencing factors corresponding to each moment of the historical load sample time series data;

[0099] Use the load training data as the input and the load verification data as the output corresponding to the load training data to train the load prediction model to be trained, and obtain the trained load prediction model, where the load prediction model to be trained includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer;

[0100] Obtain the hyperparameters to be optimized of the trained load prediction model, and iteratively optimize the hyperparameters to be optimized based on the improved particle swarm optimization algorithm to generate optimized hyperparameters, where the improved particle swarm optimization algorithm improves the particle swarm optimization algorithm by using a chaotic mapping strategy, a dynamic population size adjustment strategy, and an adaptive learning factor adjustment strategy;

[0101] Substitute the optimized hyperparameters into the optimized load prediction model and retrain the optimized load prediction model based on the load training data and the load verification data to generate a load prediction model.

[0102] In this embodiment, in the step of iteratively optimizing the hyperparameters to be optimized based on the improved particle swarm optimization algorithm to generate optimized hyperparameters, it includes:

[0103] Randomly generate multiple groups of hyperparameters to be optimized based on the hyperparameters to be optimized, where each group of hyperparameters to be optimized includes one or more of the following: the number of convolutional kernels in the convolutional neural network layer of the load prediction model, the number of hidden neurons in the gated recurrent unit layer, the maximum number of iterations, the learning rate, and the batch size;

[0104] Correspond each group of hyperparameters to be optimized to the position of each particle in the improved particle swarm optimization algorithm, initialize the population size, the individual optimal position, the optimal particle, and the velocity of each particle, and initialize the population position based on the chaotic mapping strategy of the improved particle swarm optimization algorithm;

[0105] After selecting the mean absolute error or the root mean square error to evaluate the load prediction model trained by the hyperparameter group corresponding to each particle, use the minimum error between the load training prediction result generated by the trained load prediction model and the load verification data as the fitness function, evaluate the fitness of each particle based on the fitness function, and update the individual optimal position based on the fitness of each particle;

[0106] Calculate the population diversity metric based on the average particle spacing, and adjust the population size according to the population size adjustment strategy of the improved particle swarm optimization algorithm based on the population diversity metric result;

[0107] Determine the updated optimal particle based on the updated individual optimal position, and determine the updated optimal particle as the optimal particle;

[0108] Update the velocity and position of each particle according to the preset update method, and adjust the learning factor according to the iteration progress based on the adaptive adjustment learning factor strategy of the improved particle swarm optimization algorithm, so that the particle can find the optimal solution in the search space based on the adjusted learning factor;

[0109] Evaluate the fitness of each particle corresponding to the optimal solution target of the hyperparameter group based on the fitness function, and update the individual optimal position based on the fitness of each particle for iterative optimization until the preset iteration end condition is met, and obtain the optimized hyperparameters.

[0110] In this embodiment, in the step of adjusting the population size according to the population size adjustment strategy of the improved particle swarm optimization algorithm based on the population diversity metric result, it includes:

[0111] Set a preset diversity threshold, a preset population adjustment amount, and a population size range;

[0112] After the population diversity metric result is lower than the preset diversity threshold, increase the population size based on the preset population adjustment amount, and ensure that the adjusted population size is within the population size range;

[0113] After the population diversity metric result is higher than the preset diversity threshold, reduce the population size based on the preset population adjustment amount, and ensure that the adjusted population size is within the population size range.

[0114] In this embodiment, in the step of adjusting the learning factor according to the iteration progress based on the adaptive adjustment learning factor strategy of the improved particle swarm optimization algorithm, it includes:

[0115] Set a preset learning factor adjustment amount and a learning factor adjustment range, and calculate the current iteration fitness;

[0116] When it is determined that the current iteration fitness is improved, increase the learning factor based on the preset learning factor adjustment amount, and ensure that the adjusted learning factor is within the learning factor adjustment range;

[0117] When it is determined that the current iteration fitness decreases or stagnates, reduce the learning factor based on the preset learning factor adjustment amount, and ensure that the adjusted learning factor is within the learning factor adjustment range.

[0118] In this embodiment, taking the load training data as the input and the load verification data as the output corresponding to the load training data, training the load prediction model to be trained to obtain the trained load prediction model, including:

[0119] Input the load training data into the convolutional neural network layer of the load prediction model to be trained;

[0120] Extract the feature vector of the load training data through the convolutional neural network layer, and input the feature vector into the gated recurrent unit layer of the load prediction model to be trained to generate a hidden state vector;

[0121] Input the hidden state vector into the attention layer of the load prediction model to be trained, calculate the weight coefficient of each time step in the hidden state vector through the attention layer, weight the hidden state vector based on the weight coefficient, and perform short-term load prediction through the fully connected layer based on the weighted hidden state vector to generate a load training prediction result;

[0122] Based on the load training prediction result, the load verification data, and the load training data, iteratively optimize the parameters corresponding to the convolutional neural network layer, the gated recurrent unit layer, and the attention layer in the load prediction model to be trained through the mean square error loss function and the root mean square propagation optimization algorithm by backpropagation until the preset iteration end condition is satisfied, and obtain the trained load prediction model.

[0123] In this embodiment, when calculating the weight coefficient of each time step in the hidden state vector through the attention layer, weighting the hidden state vector based on the weight coefficient, and performing short-term load prediction through the fully connected layer based on the weighted hidden state vector to generate a load training prediction result, including:

[0124] Calculate the weight coefficient of each time step in the hidden state vector, and calculate the context vector based on each time step and the weight coefficient corresponding to each time step;

[0125] Based on the context vector and the output of the current time step, perform splicing and summation, and input it into the fully connected layer for load prediction to generate a load training prediction result.

[0126] Embodiment 2:

[0127] See Figure 2 , Figure 2 is the specific flowchart of a short-term load prediction method of the present invention. Hereinafter, the short-term load prediction method of the present invention will be clearly and completely described in conjunction with the embodiments and the drawings.

[0128] See Figure 2 , a short-term load forecasting method for an electric vehicle charging station, comprising the following steps:

[0129] Step 101, initialize the IPSO-CNN-GRU-Attention electric vehicle charging load forecasting model;

[0130] Step 102, set the hyperparameters to be optimized and initialize the particle swarm;

[0131] Step 103, set the error index of the model of the present invention to evaluate the model prediction effect;

[0132] Step 104, perform preprocessing of data normalization and null value filling;

[0133] Step 105, iteratively update the particle swarm to obtain the global optimal hyperparameters, and input the optimized parameters into the neural network for training and prediction.

[0134] In the embodiment of the present invention, in the case of a distribution network containing a high penetration rate of EVs and the increasingly mature research on the two-way interaction (Vehicle to Grid, V2G) technology between EVs and the grid, how to improve the accuracy of EV load forecasting is of crucial research significance for the distribution network planning and efficient control operation, the in-depth exploration of V2G technology, the reasonable location and layout of charging infrastructure, and the optimization of the entire electric vehicle service network.

[0135] In step 101, initialize the IPSO-CNN-GRU-Attention electric vehicle charging load forecasting model.

[0136] In one embodiment, set the initial fixed parameters as follows:

[0137] The CNN (i.e., the aforementioned convolutional neural network layer) structure of the present invention includes two convolutional layers, each convolutional layer is equipped with 32 convolutional kernels, and these layers focus on extracting key features from the input data. After these two convolutional layers, the network is connected with a 2×2 max-pooling layer, which reduces the spatial dimension of the features through the max-pooling strategy to effectively avoid model overfitting. To further enhance the generalization ability of the model, a Dropout layer is also added to the network, and its dropout rate is set to 0.2 to randomly ignore a certain proportion of neuron outputs. After all features are processed as described above, they will be sent to a Dense fully connected layer to complete the final classification or regression task.

[0138] When constructing the three-layer GRU (i.e., the aforementioned gated recurrent unit layer) neural network, the number of neurons in each of the three layers is set to 50. Binary Cross Entropy is used as the loss function to accurately evaluate the classification performance of the model. The network uses the Softmax activation function in the output layer to ensure that the output results can be transformed into a probability distribution, facilitating binary classification tasks. To efficiently optimize the network parameters, the RMSProp optimization algorithm is selected, which can adaptively adjust the learning rate during the training process. In addition, the entire input dataset is divided in a ratio of 7:1:2. This ensures that the training set occupies most of the data to fully learn the model's parameters; at the same time, an appropriate amount of validation set is reserved for adjusting the model hyperparameters and avoiding overfitting; finally, the independent test set occupies the remaining part to conduct a fair performance evaluation of the model after it is trained.

[0139] CNN is a feedforward neural network that is good at extracting multi-angle and deep features of time series data. The network structure consists of an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer, where the convolutional layer and the pooling layer are its core components. The convolutional layer is responsible for extracting local features from the input time series and deeply mining the abstract features in the data; while the pooling layer compresses the features extracted by the convolutional layer to reduce the computational complexity of the network.

[0140] In one-dimensional CNN, the convolutional kernel slides only along the time dimension, while in two-dimensional CNN, the convolutional kernel needs to slide in two spatial dimensions. The following are the construction formulas for the convolutional layer and the pooling layer of two-dimensional CNN:

[0141] For the construction of the two-dimensional CNN convolutional layer, the formula can be described as:

[0142]

[0143] In the formula, O ij represents the value of the calculated output data at position (i, j). ReLU is the activation function. W mn represents the convolutional kernel weight coefficient, where m and n are the spatial indices of the convolutional kernel. X (i+m)(j+n) represents the value of the input variable at position (i + m, j + n), that is, within the area covered by the convolutional kernel. b represents the bias.

[0144] For the construction of the two-dimensional CNN pooling layer, the formula can be described as:

[0145] P ij =Pooling(Region(O ij )) (2)

[0146] In the formula, P ijRepresents the data at position (i, j) after the pooling operation. Pooling is the pooling operation, such as max pooling or average pooling. Region is the region on O covered by the pooling window.

[0147] GRU is a gating mechanism in recurrent neural networks. It can learn relatively long-term dependencies without the problems of vanishing gradients and exploding gradients. GRU and Long Short-Term Memory (LSTM) are two types of Recursive Neural Networks (RNN). GRU combines the input gate and forget gate of LSTM into an update gate and retains the reset gate, simplifying the network structure without reducing the prediction accuracy. The structure of GRU is as Figure 3 shown, and the formula is as follows.

[0148] z t = σ(w z × [h t-1 , x t ) (3)

[0149] r t = σ(w r × [h t-1 , x t ) (4)

[0150]

[0151] In the formula, z t represents the update gate, σ represents the sigmoid function, r t represents the reset gate, h t-1 represents the hidden state at the previous moment, and x t represents the input information at the current moment. represents the candidate hidden state, and h t represents the hidden state passed to the next moment. w, w, w represent the weights of each gate.

[0152] z r

[0153] The Attention (i.e., the aforementioned attention layer) mechanism is a general technique used in neural networks to enhance the model's ability to process sequential data. Its core idea is that in each step of the model's output, instead of treating all inputs equally, different weights, i.e., "attention", are assigned to different inputs according to the current task. When processing sequential data (such as natural language text, time series data, etc.), RNN or LSTM has certain limitations. These models may encounter problems of vanishing or exploding gradients in long sequences and are difficult to capture long-distance dependencies in the sequence. The Attention mechanism can help the model focus on the part of the sequence that is most relevant to the current task, thereby improving the ability to process long sequences.

[0154] The following are the construction steps of the Attention mechanism:

[0155] 1. Initialization of the Attention layer

[0156] The Attention layer is placed after the GRU network. It takes the output of the GRU layer as input and learns a set of weight coefficients, which represent the importance of different time-step inputs when predicting the output at the current time step.

[0157] 2. Calculation of the weight coefficients

[0158] The calculation formula for the weight coefficients is as follows:

[0159]

[0160] Where, α t,i is the weight coefficient of the i-th input at time step t, e t,i is the attention score calculated through a scoring function, and T x is the length of the input sequence.

[0161] 3. Scoring function

[0162] The scoring function can be in various forms. For example, it can be calculated using a single-layer neural network:

[0163]

[0164] Where, h i is the output of the GRU layer at time step i, s t-1 is the attention output at the previous time step, and W a , U a and v a are the weights that the model needs to learn.

[0165] 4. Calculation of the context vector

[0166] Context vector c t is the weighted sum of all GRU outputs and their corresponding weight coefficients:

[0167]

[0168] 5. Combination with GRU output

[0169] Finally, the calculated context vector c t is combined with the output s of GRU at the current time step t , usually by concatenation or summation, and then fed into a fully connected layer for final prediction:

[0170]

[0171] where f is the function of the fully connected layer, represents the concatenation operation, and y t represents the concatenation result.

[0172] 6. Model training

[0173] During the model training process, the parameters of the Attention layer will be optimized together with other network layers through the backpropagation algorithm. Using the RMSProp optimization algorithm and combined with the Binary Cross Entropy loss function, the model will learn how to accurately predict the charging load of electric vehicles.

[0174] By introducing the Attention mechanism, the IPSO-CNN-GRU-Attention model can focus more on the parts most relevant to the prediction task when processing time series data, thus improving the prediction accuracy and the generalization ability of the model.

[0175] In step 102, set the number of convolutional kernels of the CNN layer, the number of hidden neurons of the three GRU layers, the maximum number of iterations, the learning rate, and the batch size as hyperparameters to be optimized. As the optimization parameters, and establish the value ranges as shown in Table 1.

[0176] Table 1 Value ranges of optimization parameters

[0177]

[0178]

[0179] In step 102, set the particle swarm population size, the number of group iterations, the acceleration constant c1, the acceleration constant c2, and the inertia weight w as shown in Table 2.

[0180] Table 2 IPSO parameter values

[0181]

[0182] In step 103, the fitness function is taken as the mean absolute error (MAE) and the root mean squared error (RMSE). The definitions of the metrics are as follows: AE ) and the root mean squared error (root mean squared error, RM MSE ).

[0183]

[0184] where y and represent the actual and predicted load values, y i represents the actual load value at the i-th load, and n represents the number of samples.

[0185] In step 104, three factors that have a significant impact on the charging load of electric vehicle charging stations, namely the date type, holiday situation, and temperature (i.e., the aforementioned load influencing factors), are selected as input features.

[0186] To reduce the adverse effects of different dimensions on the prediction accuracy and shorten the time required for model training, the present invention performs normalization processing on the charging load sequence and temperature features in the dataset. At the same time, holiday information is encoded and represented by 0 and 1. The specific formula for normalization is as follows:

[0187]

[0188] where x and x normalization represent the data values before and after normalization respectively, x min and x max represent the minimum value and the minimum value of the data respectively.

[0189] In addition, the original charging load data of the charging station often contains some missing values. Given that the load data of electric vehicle charging stations shows a certain periodicity and high consistency under similar date types. Therefore, we use the following formula to fill these missing values:

[0190]

[0191] where x k represents the data filled at the missing moment; x k-1 represents the charging load value at the same moment on the same week date of the previous week; x k+1 represents the charging load value at the same moment on the same week date of the next week. If there are consecutive missing data at multiple moments, the average charging load of the corresponding time period on the same week date of the previous week and the next week can be used for filling. The same processing method is also adopted for temperature data.

[0192] In step 105, as Figure 4 shown, the IPSO (i.e., the aforementioned improved particle swarm optimization algorithm) is used to optimize the number of convolutional kernels in two layers of the CNN-GRU network model, the number of hidden neurons in three layers of GRU, the batch sample size, the learning rate, and the maximum number of iterations. The selection of hyperparameters for traditional network models usually uses the empirical trial-and-error method, which is often time-consuming and often fails to reach the optimal state.

[0193] In the hyperparameter optimization process of the IPSO algorithm, the specific steps are as follows:

[0194] Step 1: Initialize the particle swarm. Randomly initialize a group of particles in the solution space, and set the initial population size N 0 . Each particle represents a potential solution to a set of hyperparameters and has a random position x i and velocity v i . Initialize the individual best position pbest i , and select a particle as the global best gbest.

[0195] Step 2: Evaluate the individual fitness and population diversity. Calculate the fitness f(x i ) of each particle and update the individual best pbest i . At the same time, calculate the population diversity metric, such as the average particle spacing or entropy.

[0196] Step 3: Dynamically adjust the population size. According to the population diversity metric results, dynamically adjust the population size:

[0197] Step 301: If the diversity is lower than the preset threshold θ low , then increase the population size. For example, N new = N 0 +△N, where △N is the preset increase amount, and N 0 represents the current population size.

[0198] Step 302: If the diversity is higher than the preset threshold θ high , then reduce the population size. For example, N new = N 0 -△N.

[0199] In addition, it is also necessary to ensure that the adjusted population size N new is within the range of [N min , N max .

[0200] Step 4: Update the global best gbest. For all pbest i find the best pbest and set it as the global best gbest.

[0201] Step 5: Update speed and position

[0202] Update the speed and position of each particle using the following formula, and adaptively adjust the learning factors c1 and c2 according to the iteration progress 1 and c2 2 :

[0203] v i = wv i + c1 1 r1 1 (pbest i - x i ) + c2 2 r2 2 (gbest - x i ) (15)

[0204] x i = x i + v i (16)

[0205] where w is the inertia weight, r1 1 and r2 2 are random numbers in the range [0, 1]. The adaptive adjustment rules are as follows:

[0206] If the fitness improves in the current iteration, increase c1 1 and c2 2 , for example c1 1 = c1 1 + α c , c2 2 = c2 2 + α c , where α c is the preset increment.

[0207] If the fitness decreases or stagnates in the current iteration, decrease c1 1 and c2 2 , for example c1 1 = c1 1 - α c , c2 2 = c2 2 - α c .

[0208] Also, ensure that c1 1 and c2 2 are within the preset range, for example c1 1,min ≤ c1 1 ≤ c1 1,max , c2 2,min ≤ c2 2 ≤ c2 2,max .

[0209] Step 6: Evaluate the fitness of each updated particle x i , and calculate its fitness f(x i ).

[0210] Step 7: Iterate in a loop, repeating Steps 2 to 6 until the termination condition is met (reaching the maximum number of iterations or the fitness threshold).

[0211] Through the above improvement strategy, the IPSO algorithm can adjust the search process more intelligently to adapt to complex optimization problems and increase the probability of finding the optimal or near-optimal hyperparameter configuration.

[0212] Furthermore, after iteratively optimizing the hyperparameters to be optimized through the above improved optimization algorithm to generate optimized hyperparameters, the above optimized hyperparameters, input features, and historical load data can be substituted into the trained CNN-GRU-Attention model for model retraining to generate a load prediction model, so as to perform short-term load prediction of the target charging station through the load prediction model in the subsequent stage.

[0213] Embodiment 3:

[0214] The present invention based on the same inventive concept also provides a short-term load prediction system, as Figure 5 shown, including:

[0215] An acquisition module, configured to acquire load input data of a target charging station, where the load input data includes historical load time series data and load influencing factors corresponding to each moment of the historical load time series data;

[0216] A prediction module, configured to input the load input data into a pre-constructed load prediction model to generate load prediction data of the target charging station;

[0217] Wherein, the pre-constructed load prediction model includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer; the convolutional neural network layer is configured to extract a feature vector of the load input data and input it into the gated recurrent unit layer; the gated recurrent unit layer is configured to perform serialized feature processing and deep learning of time series information based on the feature vector to generate a hidden state vector and input it into the attention layer; the attention layer is configured to calculate a weight coefficient based on the hidden state vector, weight the hidden state vector through the weight coefficient, and perform short-term load prediction through a fully connected layer based on the weighted hidden state vector to generate a load prediction result.

[0218] Preferably, the prediction module includes:

[0219] The load prediction model training sub-module is used to obtain the load training data for the historical time interval of the target charging station and the load verification data corresponding to the load training data. Among them, the load training data includes historical load sample time series data and the influencing factors of historical load samples corresponding to each moment of the historical load sample time series data;

[0220] Taking the load training data as the input and the load verification data as the output corresponding to the load training data, training the load prediction model to be trained to obtain a trained load prediction model. Among them, the load prediction model to be trained includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer;

[0221] Obtain the hyperparameters to be optimized of the trained load prediction model, and iteratively optimize the hyperparameters to be optimized based on the improved particle swarm optimization algorithm to generate optimized hyperparameters. Among them, the improved particle swarm optimization algorithm improves the particle swarm optimization algorithm by using a chaotic mapping strategy, a dynamic population size adjustment strategy, and an adaptive learning factor adjustment strategy;

[0222] Substitute the optimized hyperparameters into the optimized load prediction model, and retrain the optimized load prediction model based on the load training data and the load verification data to generate a load prediction model.

[0223] Preferably, the load prediction model training sub-module includes:

[0224] The iterative optimization sub-module is used to randomly generate multiple groups of hyperparameters to be optimized based on the hyperparameters to be optimized. Among them, each group of hyperparameters to be optimized includes one or more of the following: the number of convolutional kernels in the convolutional neural network layer of the load prediction model, the number of hidden neurons in the gated recurrent unit layer, the maximum number of iterations, the learning rate, and the batch size;

[0225] Correspond each group of hyperparameters to be optimized to the position of each particle in the improved particle swarm optimization algorithm, initialize the population size, the individual optimal position, the optimal particle, and the velocity of each particle, and initialize the population position based on the chaotic mapping strategy of the improved particle swarm optimization algorithm;

[0226] After selecting the mean absolute error or the root mean square error to evaluate the load prediction model trained by the hyperparameter group corresponding to each particle, generate a fitness function based on the error between the load training prediction result and the load verification data, which is the smallest, and evaluate the fitness of each particle based on the fitness function, and update the individual optimal position based on the fitness of each particle;

[0227] Calculate the population diversity metric based on the average particle spacing, and adjust the population size according to the population size dynamic adjustment strategy of the improved particle swarm optimization algorithm based on the population diversity metric result;

[0228] Determine the updated optimal particle based on the updated individual optimal position, and determine the updated optimal particle as the optimal particle;

[0229] Update the velocity and position of each particle according to the preset update method, and adjust the learning factor according to the iteration progress based on the adaptive adjustment learning factor strategy of the improved particle swarm optimization algorithm, so that the particle can find the optimal solution in the search space;

[0230] Evaluate the fitness of each particle corresponding to the optimal solution target of the hyperparameter group based on the fitness function, and update the individual optimal position based on the fitness of each particle for iterative optimization until the preset iteration end condition is met, and obtain the optimized hyperparameters.

[0231] Preferably, the iterative optimization sub-module includes:

[0232] The population adjustment sub-module is used to set a preset diversity threshold, a preset population adjustment amount, and a population size range;

[0233] After the population diversity metric result is lower than the preset diversity threshold, increase the population size based on the preset population adjustment amount, and ensure that the adjusted population size is within the population size range;

[0234] After the population diversity metric result is higher than the preset diversity threshold, reduce the population size based on the preset population adjustment amount, and ensure that the adjusted population size is within the population size range.

[0235] Preferably, the iterative optimization sub-module includes:

[0236] The learning factor adjustment sub-module is used to set a preset learning factor adjustment amount and a learning factor adjustment range, and calculate the current iteration fitness;

[0237] When it is determined that the current iteration fitness is improved, increase the learning factor based on the preset learning factor adjustment amount, and ensure that the adjusted learning factor is within the learning factor adjustment range;

[0238] When it is determined that the current iteration fitness decreases or stagnates, reduce the learning factor based on the preset learning factor adjustment amount, and ensure that the adjusted learning factor is within the learning factor adjustment range.

[0239] Preferably, the load prediction model training sub-module includes:

[0240] An iterative training sub-module for inputting the load training data into the convolutional neural network layer of the load prediction model to be trained;

[0241] Extracting a feature vector of the load training data through the convolutional neural network layer, and inputting the feature vector into the gated recurrent unit layer of the load prediction model to be trained to generate a hidden state vector;

[0242] Inputting the hidden state vector into the attention layer of the load prediction model to be trained, calculating the weight coefficient of each time step in the hidden state vector through the attention layer, weighting the hidden state vector based on the weight coefficient, and performing short-term load prediction through a fully connected layer based on the weighted hidden state vector to generate a load training prediction result;

[0243] Based on the load training prediction result, the load verification data, and the load training data, iteratively optimizing the parameters corresponding to the convolutional neural network layer, the gated recurrent unit layer, and the attention layer in the load prediction model to be trained through a root mean square error loss function and a root mean square propagation optimization algorithm via backpropagation until a preset iteration end condition is satisfied to obtain a trained load prediction model.

[0244] Preferably, the iterative training sub-module includes:

[0245] A gated recurrent sub-module for calculating the weight coefficient of each time step in the hidden state vector and calculating a context vector based on each time step and the weight coefficient corresponding to each time step;

[0246] Performing concatenation summation based on the context vector and the output of the current time step, and inputting the result into a fully connected layer for load prediction to generate a load training prediction result.

[0247] Embodiment 4

[0248] As Figure 6 shown, the present invention further provides an electronic device, which may be a computer device, a single-chip microcomputer device, a smart mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, the processor, and the transceiver component are connected through a bus; the memory can be used to store an execution program, and an exemplary execution program may include instructions; the processor is used to execute the instructions stored in the memory. The memory can also be used to store data, and the data can be called and / or modified when the instructions are executed.

[0249] The processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in a storage medium to implement the corresponding method flow or corresponding function, so as to implement the steps of a short-term load forecasting method in the above embodiments.

[0250] Embodiment 5

[0251] Based on the same inventive concept, the present invention also provides a readable storage medium, specifically an electronic device-readable storage medium (Memory). The electronic device-readable storage medium is a memory device in the electronic device, used to store programs and data. It can be understood that the storage medium here can include both the built-in storage medium in the electronic device, and of course can also include the extended storage medium supported by the electronic device. The storage medium provides a storage space, and this storage space stores the operating system of the terminal. And, one or more instructions suitable for being loaded and executed by the processor are also stored in this storage space. These instructions can be one or more executable programs (including program codes). It should be noted that the storage medium here can be a high-speed RAM memory, or a non-volatile memory, such as at least one disk memory. By loading and executing one or more instructions stored in the storage medium by the processor, the steps of a short-term load forecasting method in the above embodiments can be implemented.

[0252] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.

[0253] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general purpose computers, special purpose computers, embedded processors, or other programmable data processing devices to produce a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices produce means for implementing the functions specified in a flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.

[0254] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means for implementing the functions specified in a flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.

[0255] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in a flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.

[0256] The above are only embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included within the scope of the claims of the present invention pending approval.

Claims

1. A short-term load forecasting method, characterized in that: include: Obtaining load input data of a target charging station, wherein the load input data includes historical load time series data and load influencing factors corresponding to each moment of the historical load time series data; Inputting the load input data into a pre-built load forecasting model to generate load forecasting data for the target charging station; Wherein, the pre-built load forecasting model includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer; The convolutional neural network layer is used to extract the feature vector of the load input data and input it into the gated recurrent unit layer; The gated recurrent unit layer is used to generate a hidden state vector based on the serialized feature processing of the feature vector and the deep learning of the time series information and input the hidden state vector into the attention layer; The attention layer is used to calculate a weight coefficient based on the hidden state vector, weight the hidden state vector by the weight coefficient, and perform short-term load forecasting through a fully connected layer based on the weighted hidden state vector to generate a load forecast result.

2. The method according to claim 1, characterized in that The construction process of the load forecasting model includes: Obtain load training data of a target charging station in a historical time interval and load verification data corresponding to the load training data, wherein the load training data includes historical load sample time series data and historical load sample influencing factors corresponding to each moment of the historical load sample time series data; Taking the load training data as input and the load verification data as output corresponding to the load training data, the load forecasting model to be trained is trained to obtain a trained load forecasting model, wherein the load forecasting model to be trained includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer; Obtaining the hyperparameters to be optimized of the trained load forecasting model, and iteratively optimizing the hyperparameters to be optimized based on an improved particle swarm optimization algorithm to generate optimized hyperparameters, wherein the improved particle swarm optimization algorithm adopts a chaotic mapping strategy, a dynamic population size adjustment strategy, and an adaptive learning factor adjustment strategy to improve the particle swarm optimization algorithm; Substituting the optimized hyperparameters into the optimized load forecasting model, retraining the optimized load forecasting model based on the load training data and the load verification data, and generating a load forecasting model.

3. The method according to claim 2, characterized in that The iterative optimization of the hyperparameter to be optimized based on the improved particle swarm optimization algorithm to generate the optimized hyperparameter includes: Based on the hyperparameters to be optimized, a plurality of hyperparameter groups to be optimized are randomly generated, wherein each hyperparameter group to be optimized includes one or more of the following: the number of convolution kernels of the convolutional neural network layer in the load forecasting model, the number of hidden neurons in the gated recurrent unit layer, the maximum number of iterations, the learning rate, and the batch size; Corresponding each group of hyperparameters to be optimized to the position of each particle in the improved particle swarm optimization algorithm, initializing the population size, individual optimal position, optimal particle and the speed of each particle, and initializing the population position based on the chaotic mapping strategy of the improved particle swarm optimization algorithm; After selecting the mean absolute error or the root mean square error to evaluate the training load prediction model corresponding to the hyperparameter group of each particle, a fitness function is generated based on the trained load prediction model with the load training prediction result and the load verification data having the minimum error, and the fitness of each particle is evaluated based on the fitness function, and the individual optimal position is updated based on the fitness of each particle; Calculating a population diversity metric based on an average particle distance, and adjusting the population size based on a dynamic population size adjustment strategy of the improved particle swarm optimization algorithm according to the population diversity metric result; Determine an updated optimal particle based on the updated individual optimal position, and determine the updated optimal particle as the optimal particle; updating the speed and position of each particle according to a preset updating method, and adjusting the learning factor according to the adaptive adjustment learning factor strategy of the improved particle swarm optimization algorithm according to the iteration progress, so that the particle finds the optimal solution in the search space based on the adjusted learning factor; The fitness of each particle corresponding to the optimal solution target of the hyperparameter group is evaluated based on the fitness function, and the individual optimal position is updated based on the fitness of each particle to perform iterative optimization until a preset iteration end condition is met to obtain the optimized hyperparameters.

4. The method according to claim 3, characterized in that The adjusting the population size according to the population diversity measurement result based on the dynamic population size adjustment strategy of the improved particle swarm optimization algorithm includes: Setting preset diversity thresholds, preset population adjustments, and population size ranges; After the population diversity measurement result is lower than a preset diversity threshold, increasing the population size based on the preset population adjustment amount, and ensuring that the adjusted population size is within the population size range; After the population diversity measurement result is higher than a preset diversity threshold, the population size is reduced based on the preset population adjustment amount, and the adjusted population size is ensured to be within the population size range.

5. The method according to claim 3, characterized in that: The step of adjusting the learning factor according to the iteration progress based on the adaptive learning factor adjustment strategy of the improved particle swarm optimization algorithm includes: Set the preset learning factor adjustment amount and learning factor adjustment range, and calculate the current iteration fitness; In the case of determining that the fitness of the current iteration is improved, increasing the learning factor based on the preset learning factor adjustment amount, and ensuring that the adjusted learning factor is within the learning factor adjustment range; When it is determined that the fitness of the current iteration decreases or stagnates, the learning factor is reduced based on the preset learning factor adjustment amount, and it is ensured that the adjusted learning factor is within the learning factor adjustment range.

6. The method according to claim 2, characterized in that The method of taking the load training data as input and the load verification data as output corresponding to the load training data, training the load forecasting model to be trained, and obtaining the trained load forecasting model comprises: Inputting the load training data into a convolutional neural network layer of a load forecasting model to be trained; Extracting a feature vector of the load training data through the convolutional neural network layer, and inputting the feature vector into the gated recurrent unit layer of the load forecasting model to be trained to generate a hidden state vector; The hidden state vector is input into the attention layer of the load forecasting model to be trained, and the weight coefficient of each time step in the hidden state vector is calculated through the attention layer, the hidden state vector is weighted based on the weight coefficient, and short-term load forecasting is performed through the fully connected layer based on the weighted hidden state vector to generate a load training forecast result; Based on the load training prediction result, the load verification data and the load training data, the parameters corresponding to the convolutional neural network layer, the gated recurrent unit layer and the attention layer in the load prediction model to be trained are iteratively optimized through back propagation through the mean square error loss function and the root mean square propagation optimization algorithm until the preset iteration end conditions are met to obtain the trained load prediction model.

7. The method according to claim 6, characterized in that The step of calculating the weight coefficient of each time step in the hidden state vector through the attention layer, weighting the hidden state vector based on the weight coefficient, and performing short-term load forecasting through a fully connected layer based on the weighted hidden state vector to generate a load training forecast result includes: Calculating a weight coefficient for each time step in the hidden state vector, and calculating a context vector based on each time step and the weight coefficient corresponding to each time step; The context vector and the output of the current time step are concatenated and summed, and input into the fully connected layer for load prediction to generate a load training prediction result.

8. A short-term load forecasting system, characterized in that: include: An acquisition module, used to acquire load input data of a target charging station, wherein the load input data includes historical load time series data and load influencing factors corresponding to each moment of the historical load time series data; A prediction module, configured to input the load input data into a pre-built load prediction model to generate load prediction data for the target charging station; Wherein, the pre-built load forecasting model includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer; The convolutional neural network layer is used to extract the feature vector of the load input data and input it into the gated recurrent unit layer; The gated recurrent unit layer is used to generate a hidden state vector based on the serialized feature processing of the feature vector and the deep learning of the time series information and input the hidden state vector into the attention layer; The attention layer is used to calculate a weight coefficient based on the hidden state vector, weight the hidden state vector by the weight coefficient, and perform short-term load forecasting through a fully connected layer based on the weighted hidden state to generate a load forecast result.

9. The system according to claim 8, characterized in that The prediction module comprises: A load forecasting model training submodule, used to obtain load training data of a target charging station in a historical time interval and load verification data corresponding to the load training data, wherein the load training data includes historical load sample time series data and historical load sample influencing factors corresponding to each moment of the historical load sample time series data; Taking the load training data as input and the load verification data as output corresponding to the load training data, the load forecasting model to be trained is trained to obtain a trained load forecasting model, wherein the load forecasting model to be trained includes a convolutional neural network layer, a gated recurrent unit layer, and an attention layer; Obtaining the hyperparameters to be optimized of the trained load forecasting model, and iteratively optimizing the hyperparameters to be optimized based on an improved particle swarm optimization algorithm to generate optimized hyperparameters, wherein the improved particle swarm optimization algorithm adopts a chaotic mapping strategy, a dynamic population size adjustment strategy, and an adaptive learning factor adjustment strategy to improve the particle swarm optimization algorithm; Substituting the optimized hyperparameters into the optimized load forecasting model, retraining the optimized load forecasting model based on the load training data and the load verification data, and generating a load forecasting model.

10. The system according to claim 9, characterized in that The load forecasting model training submodule includes: An iterative optimization submodule, used for randomly generating a plurality of hyperparameter groups to be optimized based on the hyperparameters to be optimized, wherein each hyperparameter group to be optimized includes one or more of the following: the number of convolution kernels of the convolutional neural network layer in the load forecasting model, the number of hidden neurons in the gated recurrent unit layer, the maximum number of iterations, the learning rate, and the batch size; Corresponding each group of hyperparameters to be optimized to the position of each particle in the improved particle swarm optimization algorithm, initializing the population size, individual optimal position, optimal particle and the speed of each particle, and initializing the population position based on the chaotic mapping strategy of the improved particle swarm optimization algorithm; After selecting the mean absolute error or the root mean square error to evaluate the training load prediction model corresponding to the hyperparameter group of each particle, a fitness function is generated based on the trained load prediction model with the load training prediction result and the load verification data having the minimum error, and the fitness of each particle is evaluated based on the fitness function, and the individual optimal position is updated based on the fitness of each particle; Calculating a population diversity metric based on an average particle distance, and adjusting the population size based on a dynamic population size adjustment strategy of the improved particle swarm optimization algorithm according to the population diversity metric result; Determine an updated optimal particle based on the updated individual optimal position, and determine the updated optimal particle as the optimal particle; updating the speed and position of each particle according to a preset updating method, and adjusting the learning factor according to the adaptive adjustment learning factor strategy of the improved particle swarm optimization algorithm according to the iteration progress, so that the particle finds the optimal solution in the search space based on the adjusted learning factor; The fitness of each particle corresponding to the optimal solution target of the hyperparameter group is evaluated based on the fitness function, and the individual optimal position is updated based on the fitness of each particle to perform iterative optimization until a preset iteration end condition is met to obtain the optimized hyperparameters.

11. The system according to claim 10, characterized in that The iterative optimization submodule comprises: A population adjustment submodule, for setting a preset diversity threshold, a preset population adjustment amount, and a population size range; After the population diversity measurement result is lower than a preset diversity threshold, increasing the population size based on the preset population adjustment amount, and ensuring that the adjusted population size is within the population size range; After the population diversity measurement result is higher than a preset diversity threshold, the population size is reduced based on the preset population adjustment amount, and the adjusted population size is ensured to be within the population size range.

12. The system according to claim 10, characterized in that The iterative optimization submodule comprises: The learning factor adjustment submodule is used to set the preset learning factor adjustment amount and the learning factor adjustment range, and calculate the current iteration fitness; In the case of determining that the fitness of the current iteration is improved, increasing the learning factor based on the preset learning factor adjustment amount, and ensuring that the adjusted learning factor is within the learning factor adjustment range; When it is determined that the fitness of the current iteration decreases or stagnates, the learning factor is reduced based on the preset learning factor adjustment amount, and it is ensured that the adjusted learning factor is within the learning factor adjustment range.

13. The system according to claim 9, characterized in that The load forecasting model training submodule includes: An iterative training submodule, used for inputting the load training data into a convolutional neural network layer of a load forecasting model to be trained; Extracting a feature vector of the load training data through the convolutional neural network layer, and inputting the feature vector into the gated recurrent unit layer of the load forecasting model to be trained to generate a hidden state vector; The hidden state vector is input into the attention layer of the load forecasting model to be trained, and the weight coefficient of each time step in the hidden state vector is calculated through the attention layer, the hidden state vector is weighted based on the weight coefficient, and short-term load forecasting is performed through the fully connected layer based on the weighted hidden state vector to generate a load training forecast result; Based on the load training prediction result, the load verification data and the load training data, the parameters corresponding to the convolutional neural network layer, the gated recurrent unit layer and the attention layer in the load prediction model to be trained are iteratively optimized through back propagation through the mean square error loss function and the root mean square propagation optimization algorithm until the preset iteration end conditions are met to obtain the trained load prediction model.

14. The system according to claim 13, characterized in that The iterative training submodule comprises: A gated loop submodule, used to calculate a weight coefficient for each time step in the hidden state vector, and to calculate a context vector based on each time step and the weight coefficient corresponding to each time step; The context vector and the output of the current time step are concatenated and summed, and input into the fully connected layer for load prediction to generate a load training prediction result.

15. An electronic device, characterized in that: include: at least one processor and memory; The memory and the processor are connected via a bus; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, the short-term load forecasting method according to any one of claims 1 to 7 is implemented.

16. A readable storage medium, characterized in that: An execution program is stored thereon, and when the execution program is executed, the short-term load forecasting method as described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Industrial heating furnace temperature prediction method and device based on deep learning and storage medium

    CN121502190A

  • Intelligent EGSB (expanded granular sludge bed) reactor control system and method based on model predictive control

    CN122221700A

  • Model predictive control based intelligent control system and method for egsb reactor

    CN122221700B