A short-term power load forecasting method, system and storage medium based on meta-heuristic algorithm optimization

Through the method based on metaheuristic algorithm optimization, combined with random forests and long and short-term memory residual network, the problems of large data volume and low accuracy in short-term power load prediction are solved, and higher prediction accuracy and stability are achieved.

CN118467992BActive Publication Date: 2024-11-08LISHUI POWER SUPPLY COMPANY OF STATE GRID ZHEJIANG ELECTRIC POWER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410285672.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-13
Publication Date
2024-11-08
Estimated Expiration
2044-03-13

AI Technical Summary

Technical Problem

Existing short-term power load prediction methods are difficult to meet stability requirements when facing massive data, and there are challenges in prediction accuracy and computational cost.

Method used

Using a method based on metaheuristic algorithm optimization, the data set is constructed by obtaining historical power load data and meteorological data, and the feature extraction filter module and the fusion residual optimization network module are used to predict. The feature extraction module uses a random forest algorithm to optimize the network The module consists of an iterative optimization algorithm and a long and short-term memory residual network. The iterative optimization algorithm adopts a whale optimization algorithm based on cosine evolution and an elite reverse learning strategy.

Benefits of technology

It improves the accuracy of short-term power load prediction, ensures the global optimal solution for parameter optimization, reduces the computational complexity, better captures the long-term dependence mode of power load, and greatly improves the prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118467992B_ABST
    Figure CN118467992B_ABST
Patent Text Reader

Abstract

The present invention discloses a short-term power load forecasting method, system and storage medium based on meta-heuristic algorithm optimization, which belongs to the technical field of power load forecasting, including pre-processing the acquired historical power load data and historical meteorological data to obtain an initial feature data set; inputting the initial feature data set into a pre-built short-term power load forecasting model for forecasting to obtain a short-term power load forecasting result. The present invention introduces a stacked residual module into a long short-term memory network structure to form a fused residual optimization network module, and designs a multi-strategy whale optimization algorithm for global optimization of hyperparameters, which can not only better capture the long-term dependency pattern of power load, more accurately predict the dynamic changes of power load, but also realize fast and effective hyperparameter adjustment engineering, greatly improving the robustness and prediction accuracy of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power load forecasting, and more specifically to a short-term power load forecasting method, system and storage medium based on meta-heuristic algorithm optimization. Background Art

[0002] Nowadays, residential electricity load forecasting is the key to power system dispatching and demand response. As the demand for power system information has increased significantly compared with the past, the importance of short-term power load forecasting has become more prominent. High-precision short-term power load forecasting can ensure the accuracy of power system dispatching decisions, alleviate the contradiction between power supply and demand, and ensure the safety of power system operation.

[0003] However, the existing short-term power load forecasting methods are mainly implemented using traditional statistical analysis methods, which often require a lot of data preparation and are difficult to guarantee accuracy. With the development of deep learning, how to use deep learning models to accurately predict short-term power loads has become a major research direction. However, when faced with massive amounts of power load data in actual application scenarios of power load forecasting, although power load forecasting based on deep learning models has certain advantages in some aspects, it cannot meet the requirements for stability in power load forecasting. At the same time, there are still some challenges in prediction accuracy and computational cost.

[0004] Therefore, how to provide a short-term power load forecasting method and system based on meta-heuristic algorithm optimization and storage medium that can solve the above problems is an urgent problem that technicians in this field need to solve. Summary of the invention

[0005] In view of this, the present invention provides a short-term power load forecasting method, system and storage medium based on meta-heuristic algorithm optimization, which is used to solve the problem that the existing short-term power load forecasting method cannot meet the stability requirements in power load forecasting when faced with massive power load data, and there are still some problems in prediction accuracy and computational cost.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] On the one hand, a short-term power load forecasting method based on meta-heuristic algorithm optimization includes the following steps:

[0008] Acquire historical power load data and historical meteorological data associated with the historical power load data to construct a historical data set;

[0009] Preprocessing the historical data set to obtain a corresponding initial feature data set;

[0010] The initial feature data set is input into a pre-built short-term power load prediction model for prediction to obtain a short-term power load prediction result; the short-term power load prediction model includes a feature extraction and screening module and a fusion residual optimization network module connected in sequence, and the fusion residual optimization network module is formed by a series-connected iterative optimization module and a long short-term memory residual network module; wherein the iterative optimization algorithm in the iterative optimization module adopts a whale optimization algorithm that introduces a random Levy flight strategy based on cosine evolution and an elite reverse learning strategy.

[0011] Preferably, the step of preprocessing the historical data set to obtain a corresponding initial feature data set includes:

[0012] The outliers and missing values ​​in the historical data set are cleaned using a preset data cleaning strategy to obtain a corresponding initial feature data set, wherein the data cleaning strategy includes Lagrange interpolation, averaging and / or Laida criterion.

[0013] Preferably, the long short-term memory residual network module includes an input layer, a stacked residual module, an intermediate layer and an output layer connected in sequence.

[0014] Preferably, the step of inputting the initial feature data set into a pre-built short-term power load forecasting model for forecasting to obtain a short-term power load forecasting result includes:

[0015] The feature extraction and screening module is used to extract and screen out important features in the initial feature data set to obtain an important feature set;

[0016] The model hyperparameters of the long short-term memory residual network module are set, and the model hyperparameters include the number of hidden nodes, learning rate and filter coefficient of the long short-term memory residual network module; the model hyperparameters are input into an iterative optimization module, and the model hyperparameters are iteratively optimized by using an iterative optimization algorithm in the iterative optimization module using a whale optimization algorithm that introduces a random Levy flight strategy based on cosine evolution and an elite reverse learning strategy to obtain an optimal solution combination of the hyperparameters;

[0017] The optimal solution combination of the hyperparameters and the important feature set are input into the long short-term memory residual network module for prediction to obtain a short-term power load prediction result.

[0018] Preferably, the feature extraction and screening module uses a random forest algorithm to screen important features from the initial feature data set to obtain an important feature set, specifically:

[0019] Calculating the feature importances in the initial feature data set, and sorting all the feature importances according to a preset sorting order to obtain a sorting result;

[0020] Determine a elimination ratio, and according to the feature importance, eliminate the features in the sorting result according to the elimination ratio to obtain a candidate feature set;

[0021] If the number of elements in the candidate feature set does not meet the preset feature number condition, the above steps are executed repeatedly, and the candidate feature set is eliminated again according to the elimination ratio and feature importance, until the number of elements in the candidate feature set meets the preset feature number condition;

[0022] The out-of-bag error rate of all candidate feature sets is calculated, and the optimal candidate feature set is selected as the important feature set according to the out-of-bag error rate. The calculation formula of the out-of-bag error rate (OOBerror) is:

[0023]

[0024] In the formula, is the number of out-of-bag data observations of the qth tree; I(g) is the indicator function, that is, it takes 1 when the two values ​​are equal and 0 when they are not equal; Y b ∈{0,1} is the true result of the b-th observation; is the prediction result of the qth tree for the bth observation of OOB data before random permutation; is the prediction result of the qth tree for the bth observation of the out-of-bag data after random permutation.

[0025] Preferably, the step of iteratively optimizing the model hyperparameters by using the iterative optimization algorithm in the iterative optimization module using a whale optimization algorithm that introduces a random Levy flight strategy based on cosine evolution and an elite reverse learning strategy to obtain the optimal solution combination of the hyperparameters includes:

[0026] According to the predefined population size, total number of iterations and search space limit, a uniformly distributed initial population is generated using Gaussian mapping;

[0027] Process the initial population to generate an inverse solution population;

[0028] The fitness value of each original solution population and inverse solution population in the initial population is calculated according to a pre-constructed fitness function to obtain a solution fitness value, and an elite reverse learning strategy is used to select an elite group that meets a preset fitness threshold from the original solution population and the inverse solution population according to the solution fitness value;

[0029] Select the best individual from the current population and the reverse population of the elite group as the best sub-individual for the next round of iteration;

[0030] Calculate the fitness value corresponding to the optimal sub-individual according to the pre-constructed fitness function, obtain the optimal fitness value, and determine the optimal individual position corresponding to the optimal fitness value;

[0031] Determine the coefficient vector and the state judgment coefficient, and determine whether the absolute value of the coefficient vector exceeds the total number of iterations. If so, determine whether the state judgment coefficient exceeds the preset state threshold. If the state judgment coefficient exceeds the preset state threshold, surround the prey; if the state judgment coefficient does not exceed the preset state threshold, use the random Levy flight strategy based on cosine evolution to update the optimal individual position to the current global optimal position;

[0032] Determine whether the current number of iterations reaches the total number of iterations. If so, obtain the optimal solution combination of input parameters according to the current global optimal position, and the optimal solution combination of parameters includes the optimal number of hidden nodes, the optimal learning rate and the optimal filter coefficient; if not, recalculate the fitness value of each original solution population and inverse solution population in the initial population according to the pre-constructed fitness function.

[0033] Preferably, the fitness value of the iterative optimization algorithm is the mean square error of the prediction result of the long short-term memory residual network module, and the fitness function is specifically:

[0034]

[0035] In the formula, Fit represents the fitness value; n represents the number of samples; y i represents the observed value of the i-th sample; x i represents the predicted value of the i-th sample output; p represents the number of hidden nodes; l represents the learning rate; λ represents the filter coefficient;

[0036] The random Levy flight strategy based on cosine evolution is specifically:

[0037]

[0038]

[0039]

[0040] ζ=rand(0,1]

[0041] Wherein, L(s,γ,μ) represents the random Lévy flight path of cosine evolution; s represents the random step length of Lévy flight; γ represents a constant; μ represents the minimum number of jump steps; z represents the cosine evolution factor; ζ represents a random number in the range of (0,1]; t represents the current number of iterations; r represents the distance between the individual and the target; u, v are constants that conform to the normal distribution; β is a constant between [1,2]; τ is a constant, which can be 3; rand represents the random number generation function;

[0042] The update formula of the current global optimal position is:

[0043]

[0044] Where X(t+1) represents the position of the individual whale at the (t+1)th iteration; X(t) represents the position of the individual whale at the tth iteration; A represents the coefficient vector; D represents the distance between the individual and the prey; T represents the total number of iterations; Represents the state judgment coefficient.

[0045] In a second aspect, the present invention provides a short-term power load forecasting system based on meta-heuristic algorithm optimization, comprising:

[0046] A data acquisition module, used to acquire historical power load data and historical meteorological data associated with the historical power load data, and construct a historical data set;

[0047] A data processing module, used for preprocessing the historical data set to obtain a corresponding initial feature data set;

[0048] A data prediction module is used to input the initial feature data set into a pre-built short-term power load prediction model for prediction, so as to obtain a short-term power load prediction result; the short-term power load prediction model includes a feature extraction and screening module and a fusion residual optimization network module connected in sequence, and the fusion residual optimization network module is formed by a series-connected iterative optimization module and a long short-term memory residual network module; wherein the iterative optimization algorithm in the iterative optimization module adopts a whale optimization algorithm that introduces a random Levy flight strategy based on cosine evolution and an elite reverse learning strategy.

[0049] In a third aspect, the present invention further provides a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program implements the steps of the above method when executed by a processor.

[0050] Through the above technical solutions, it can be known that compared with the prior art, the present invention discloses a short-term power load forecasting method, system and storage medium based on meta-heuristic algorithm optimization, the method includes obtaining historical power load data and historical meteorological data associated with the historical power load data, constructing a historical data set; preprocessing the historical data set to obtain a corresponding initial feature data set; inputting the initial feature data set into a pre-constructed power load short-term forecasting model for forecasting to obtain a short-term power load forecasting result; the power load short-term forecasting model includes a feature extraction and screening module and a fusion residual optimization network module connected in sequence. Compared with the prior art, this method combines the feature extraction and screening module and the fusion residual optimization network module to realize short-term power load forecasting, which can not only ensure the global optimal solution attribute of parameter optimization, but also effectively realize short-term power load forecasting while ensuring that the data is complete and effective, and the features are concise and effective, and can better capture the long-term dependence pattern of the power load, more accurately predict the dynamic changes of the power load, and greatly improve the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0052] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0053] Figure 2 A flow chart showing the principle of a short-term power load forecasting method provided by an embodiment of the present invention;

[0054] Figure 3 A schematic diagram of the importance of random forest features provided by an embodiment of the present invention;

[0055] Figure 4 A schematic diagram for comparing model prediction results provided by an embodiment of the present invention;

[0056] Figure 5 is a system structure block diagram of the present invention;

[0057] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.

[0059] The purpose of the present invention is to provide a short-term power load forecasting method, system and storage medium based on meta-heuristic algorithm optimization, the method comprising: obtaining historical power load data and historical meteorological data associated with the historical power load data, constructing a historical data set; pre-processing the historical data set to obtain a corresponding initial feature data set; inputting the initial feature data set into a pre-constructed power load short-term forecasting model for forecasting, and obtaining a short-term power load forecasting result; the power load short-term forecasting model comprises a feature extraction and screening module and a fusion residual optimization network module connected in sequence, and the fusion residual optimization network module is formed by a series of iterative optimization modules and long short-term memory residual network modules; wherein, the iterative optimization algorithm in the iterative optimization module adopts a whale optimization algorithm that introduces a random Levy flight strategy based on cosine evolution and an elite reverse learning strategy. The present invention combines the feature extraction and screening module and the fusion residual optimization network module to realize short-term power load forecasting, and provides a solution for the existing short-term power load forecasting method that cannot meet the stability requirements in power load forecasting when facing massive power load data, and still has some problems in prediction accuracy and computational cost.

[0060] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0061] The embodiment of the present invention discloses a short-term power load forecasting method based on meta-heuristic algorithm optimization, see Figure 1 As shown, the method specifically comprises the following steps:

[0062] S1: Acquire historical power load data and historical meteorological data associated with the historical power load data to construct a historical data set.

[0063] Specifically, since meteorological factors have a significant impact on electricity demand, it is very important to consider meteorological data when making short-term electricity load forecasts. For example, seasonal changes usually lead to fluctuations in electricity demand. By analyzing the seasonal patterns in the meteorological data, the seasonal changes in load can be predicted and corresponding adjustments can be made. In addition, meteorological data such as wind force and wind speed are also related to wind power generation. The capacity of wind power generation can be predicted by analyzing wind speed data and incorporated into the short-term electricity load forecasting model to more accurately predict short-term electricity loads. This embodiment uses historical electricity load data and meteorological data related to the historical electricity load data to perform short-term electricity load forecasts, which can more accurately estimate the demand and supply of electricity loads to meet user needs and ensure the stable operation of the power grid.

[0064] S2: Preprocess the historical data set to obtain the corresponding initial feature data set.

[0065] Specifically, this embodiment uses a preset data cleaning strategy to clean the abnormal values ​​and missing values ​​in the historical data set, and obtains the corresponding initial feature data set, so as to process the sample data with defects such as abnormal values ​​and missing values ​​into an initial feature data set that can support model training and prediction, thereby realizing accurate prediction of power load, wherein the data cleaning strategy includes numerical processing methods such as Lagrange interpolation, averaging and / or Laida criterion. For example, when using Lagrange interpolation for data cleaning, assuming that there are n data in total, then an n-1 degree polynomial can be found so that this polynomial passes through these n points, and the missing value can be obtained through the polynomial, and the missing value can be predicted based on this principle. Those skilled in the art can adjust the numerical processing method according to the specific implementation situation, and are not limited to the numerical processing method provided in the embodiment of the present invention.

[0066] S3: Input the initial feature data set into the pre-built short-term power load forecasting model to perform forecasting and obtain the short-term power load forecasting result;

[0067] Specifically, the short-term prediction model of power load includes a feature extraction and screening module and a fusion residual optimization network module connected in sequence. The fusion residual optimization network module is formed by a series of iterative optimization modules and long short-term memory residual network modules. Among them, the iterative optimization algorithm in the iterative optimization module adopts the whale optimization algorithm that introduces a random Levy flight strategy based on cosine evolution and an elite reverse learning strategy.

[0068] In a specific embodiment, the steps of inputting the initial feature data set into a pre-built short-term power load forecasting model for forecasting and obtaining a short-term power load forecasting result include:

[0069] The feature extraction and screening module is used to extract and screen out important features in the initial feature data set to obtain an important feature set;

[0070] Set the model hyperparameters of the LSTM residual network module, input the model hyperparameters into the iterative optimization module, use the iterative optimization algorithm to iteratively optimize the model hyperparameters, and obtain the optimal solution combination of the hyperparameters;

[0071] The optimal solution combination of hyperparameters and important feature sets are input into the long short-term memory residual network module for prediction to obtain the short-term power load forecasting results.

[0072] In a specific embodiment, the feature extraction and screening module uses a random forest algorithm to screen important feature sets from the initial feature data set, specifically:

[0073] Calculate the feature importance in the initial feature data set, and sort all the feature importances according to a preset sorting order to obtain a sorting result; in this embodiment, the preset sorting order is preferably set to descending order, and those skilled in the art may adjust the sorting order according to specific implementation conditions;

[0074] Determine the elimination ratio, and according to the feature importance, eliminate the features in the sorting results according to the elimination ratio to obtain the candidate feature set;

[0075] If the number of elements in the candidate feature set does not meet the preset feature number condition, the above steps are executed repeatedly, and the candidate feature set is eliminated again according to the elimination ratio and feature importance until the number of elements in the candidate feature set meets the preset feature number condition;

[0076] Calculate the out-of-bag error rate of all candidate feature sets, and use the candidate feature set with the smallest out-of-bag error rate as the important feature set for subsequent model training. Through this method, we can improve the prediction accuracy while ensuring the data validity of model training, and greatly reduce the computational complexity of model training. According to the out-of-bag error rate, the optimal candidate feature set is selected as the important feature set, among which, in this embodiment, the feature set with the lowest out-of-bag error rate is preferentially selected as the important feature set, and the calculation formula of the out-of-bag error rate (OOBerror) is:

[0077]

[0078] In the formula, is the number of out-of-bag data observations of the qth tree; I(g) is the indicator function, that is, it takes 1 when the two values ​​are equal and 0 when they are not equal; Y b ∈{0,1} is the true result of the b-th observation; is the prediction result of the qth tree for the bth observation of OOB data before random permutation; is the prediction result of the qth tree for the bth observation of the out-of-bag data after random permutation.

[0079] Among them, the significance test formula of variable importance VIM is as follows:

[0080]

[0081]

[0082] In the formula, Z VIM represents the significance test value; represents the permutation importance of variables; Represents the standard deviation of each classification tree in the random forest algorithm; represents the permutation importance of the qth classification tree; Q represents the number of classification trees in the random forest algorithm.

[0083] This embodiment uses the random forest algorithm for feature screening, which can retain the features that have a greater impact on the prediction results, eliminate redundant features, and improve computational efficiency. It can be seen that the random forest algorithm can not only process high-dimensional data (the number of variables is much larger than the number of observations), effectively analyze nonlinear, collinear and interactive data, but also give variable importance scores (variable importance measures, VIM) while analyzing the data. The random forest method plays a crucial role in a specific embodiment. At the same time, by calculating the significance test value of the out-of-bag error rate and the variable importance VIM, the features that have the greatest impact on the prediction results can be further screened out, thereby improving the prediction accuracy. As an integrated learning algorithm based on decision trees, the random forest algorithm has excellent prediction ability and stability. It generates the final prediction output by constructing multiple decision trees and combining their prediction results, thereby effectively reducing the risk of overfitting that may be generated by a single decision tree. In power load forecasting, the random forest algorithm can make full use of historical load data, meteorological data and other related factors to establish an accurate prediction model. In the application process of the random forest algorithm, the data needs to be preprocessed first, including steps such as data cleaning, feature selection and feature engineering. Through data preprocessing, the accuracy and generalization ability of the prediction model can be effectively improved. Then, the historical data is trained using the random forest algorithm to establish a prediction model. During the training process, the performance of the model can be optimized by adjusting the algorithm parameters.

[0084] In addition to the basic prediction function, the random forest algorithm can also be used to evaluate feature importance. By calculating the contribution of each feature in the model, the factors that have the greatest impact on power load forecasting can be identified, providing decision support for subsequent power system planning and operation.

[0085] In a specific embodiment, the model hyperparameters include the number of hidden nodes, learning rate and filter coefficient of the long short-term memory residual network module; in order to solve the problems of poor initial population quality, poor nonlinear and random solution ability, easy to fall into the local optimal trap and low convergence accuracy in the original algorithm, in a specific embodiment, the iterative optimization algorithm in the iterative optimization module adopts a whale optimization algorithm that introduces a random Levy flight strategy based on cosine evolution and an elite reverse learning strategy, so as to perform global optimization through an improved modified whale optimization algorithm (MWOA), thereby solving the pain points of neural network parameter adjustment. The whale optimization algorithm (MWOA) is a meta-heuristic algorithm. Specifically, as Figure 2 As shown, the iterative optimization algorithm is used to iteratively optimize the model hyperparameters, and the steps of obtaining the optimal solution combination of hyperparameters include:

[0086] According to the predefined population size, the total number of iterations and the search space limits (the upper and lower bounds of the search space), a Gaussian mapping is used in the search space to generate a uniformly distributed initial population; wherein, the individuals in the initial population are predators, and this embodiment replaces the original random generation method with a Gaussian mapping to generate a more uniformly distributed initial population, which can optimize the quality of the initial population, improve the global convergence speed and quality of the WOA optimal solution, and thus enhance the algorithm performance.

[0087] The initial population is processed to generate an inverse solution population. The fitness value of each original solution population and inverse solution population in the initial population is calculated according to the pre-constructed fitness function to obtain the solution fitness value. According to the solution fitness value, the elite reverse learning strategy is used to select an elite group that meets the preset fitness threshold from the original solution population and the inverse solution population, and the elite group is used as the dominant solution for target hunting; the best individual is selected from the current population and the reverse population of the elite group as the optimal sub-individual for the next round of iteration; the fitness value of the iterative optimization algorithm is the mean square error of the prediction result of the long short-term memory residual network module, and the fitness function is specifically:

[0088]

[0089] In the formula, Fit represents the fitness value; n represents the number of samples; y i represents the observed value of the i-th sample; x i represents the predicted value of the i-th sample output; p represents the number of hidden nodes; l represents the learning rate; λ represents the filter coefficient;

[0090] In a specific embodiment, the elite reverse learning strategy is specifically:

[0091] Assume x i =(x ii ,x i2 ,x i3 ,…,xiN ), (i=1,2,…,n) is the elite individual in the N-dimensional search space. The inverse solution of the elite individual Defined as:

[0092]

[0093]

[0094] like If it crosses the boundary, it needs to be redefined:

[0095]

[0096] In the formula, The j-dimensional vector representing the elite solution δ is a random number in the interval [0, 1], s i,j ∈[αb j ,βb j ]; αb j =max(ε i,j ), βb j =min(ε i,j ) defines the dynamic boundary; rand(αb j ,βb j ) represents the interval [αb j ,βb j ] is a random value within ].

[0097] It should be noted that since the search method of the original WOA algorithm is that whales surround prey (optimization target), and the generated population is a single population, this is not conducive to the search and hunting of the global optimal solution. Therefore, the embodiment of the present invention adopts the iterative optimization algorithm based on the elite reverse learning strategy to realize the global search capability. In the power load forecasting, since the power load is affected by many factors, such as weather, season, holidays, etc., the forecasting difficulty is relatively large. Traditional forecasting methods often find it difficult to fully consider various factors, resulting in inaccurate forecasting results. The iterative optimization algorithm based on the elite reverse learning strategy adopted in the embodiment of the present invention can search in a global range and gradually approach the optimal solution, thereby improving the forecasting accuracy. Specifically, the algorithm first generates a set of initial solutions through the reverse learning strategy. These initial solutions have strong diversity and distribution and can be searched in a global range. Then, the elite strategy is used to screen the initial solutions, retain the excellent solutions, and eliminate the poor solutions. Then, the excellent solutions retained are continuously optimized through the iterative optimization algorithm to gradually approach the optimal solution. In the process of power load forecasting, the global search capability is realized, the forecast accuracy and efficiency are improved, and strong support is provided for the intelligent development of the power industry. By selecting the elite group with greater fitness in the original solution population and its inverse solution population as the dominant solution for target hunting, and selecting the best individual from the current population and reverse population of the elite group as the optimal sub-individual for the next round of iteration, the diversity of the population is increased, and the algorithm's ability to search for the global optimal solution is improved.

[0098] The fitness value corresponding to the optimal sub-individual is calculated according to the pre-constructed fitness function, the optimal fitness value is obtained, and the optimal individual position corresponding to the optimal fitness value is determined.

[0099] Determine the coefficient vector and the state judgment coefficient, and determine whether the absolute value of the coefficient vector exceeds the total number of iterations. If so, determine whether the state judgment coefficient exceeds the preset state threshold. If the state judgment coefficient exceeds the preset state threshold, surround the prey; if the state judgment coefficient does not exceed the preset state threshold, the random Levy flight strategy based on cosine evolution is used to update the optimal individual position to the current global optimal position; it should be noted that after entering the hunting stage, the random search and follow strategy proposed by the original WOA algorithm population individual cannot guarantee the comprehensiveness of effective exploration in the search space. Therefore, the embodiment of the present invention proposes a random Levy flight strategy based on cosine evolution. The strategy can change the search direction and range of the individual as the number of iterations changes, so as to achieve a more comprehensive coverage of the solution space. This method can effectively solve the blindness of the global search of the population individual, and effectively alleviate the dilemma of the algorithm tending to the local optimal. After adjusting the random Levy flight strategy of cosine evolution, the algorithm can effectively exit the local optimal solution to improve its global search capability. The random Levy flight strategy based on cosine evolution is specifically:

[0100]

[0101]

[0102]

[0103] ζ=rand(0,1]

[0104] Where L(s,γ,μ) represents the random Lévy flight path of cosine evolution; s represents the random step size of Lévy flight; γ represents a constant; μ represents the minimum number of jump steps; z represents the cosine evolution factor; ζ represents a random number in the range of (0,1]; t represents the current number of iterations; r represents the distance between the individual and the target; u, v are constants that conform to the normal distribution; β is a constant between [1,2]; τ is a constant, which can be 3; rand represents the random number generation function.

[0105] The update formula for the current global optimal position is:

[0106]

[0107] Where X(t+1) represents the position of the individual whale at the (t+1)th iteration; X(t) represents the position of the individual whale at the tth iteration; A represents the coefficient vector; D represents the distance between the individual and the prey; T represents the total number of iterations; Represents the state judgment coefficient.

[0108] Determine whether the current number of iterations reaches the total number of iterations. If so, decode the incoming parameters corresponding to the current global optimal position to obtain the optimal solution combination of the input parameters. The optimal solution combination of parameters includes the optimal number of hidden nodes, the optimal learning rate, and the optimal filter coefficient. If not, recalculate the fitness value of each original solution population and inverse solution population in the initial population according to the pre-constructed fitness function.

[0109] It should be noted that the adjustment of hyperparameters is crucial to the prediction results of the power load model. However, before the emergence of metaheuristic algorithms, manual parameter adjustment was often relied on, and this method was based only on the experience of the parameter adjusters. Such prediction results are not reliable, and manual parameter adjustment requires a lot of time and computing resources. For short-term power load forecasting, timeliness will be greatly affected. The use of the MWOA algorithm can greatly reduce the time required for parameter adjustment while ensuring the quality of parameter optimization results. At the same time, compared with the WOA algorithm, the MWOA algorithm has better robustness and optimization performance. Moreover, the MWOA algorithm performs better in performing hyperparameter optimization tasks for the long short-term memory residual network module (Residual_LSTM), improves robustness, and can meet the stability requirements of the short-term power load forecasting model.

[0110] In a specific embodiment, since gradient vanishing and gradient exploding have always been the shackles that plague the performance of neural networks, in order to enable the LSTM network to perform as it should and not be limited by this problem, this embodiment embeds a stacked residual module in the back end of the input layer data flow of the long short-term memory network. Compared with the traditional fusion residual optimization network and the long short-term memory residual network, we introduce a stacked residual module between the input layer and the core processing module. This stacked residual module is to pre-process and enhance the features of the data before it flows into the core long short-term memory network. By stacking multiple residual units, we can not only gradually extract and enhance the features of the input data, but also effectively avoid the problem of gradient vanishing or gradient exploding, thereby ensuring the stability and convergence of the network during training. That is, the long short-term memory residual network module includes an input layer, a stacked residual module, an intermediate layer and an output layer connected in sequence, and the stacked residual module stacks K residual block structures, and the output of each residual block structure can be expressed by the following formula:

[0111] x e+1 =F(x e ,w e )+x e

[0112] In the formula, x e+1 represents the output of the e-th residual block structure in the stacked residual module; x e represents the input of the e-th residual block structure in the stacked residual module; F represents the residual mapping to be learned; w e Represents the weight parameters to be learned.

[0113] The forward propagation of each residual block structure can be expressed as:

[0114]

[0115] In the formula, x Krepresents the output of the Kth residual block structure in the stacked residual module; x0 represents the input of the stacked residual module; x e-1 represents the input of the e-th residual block structure in the stacked residual module; W e-1 represents the weight set associated with the e-th residual block structure, where W e ={w e ,|1≤e≤K|}, K represents the number of layers of the residual block structure.

[0116] The output formula of the above residual block structure reflects the forward propagation process of the stacked residual module, that is, the learning process of transferring data from the first layer to the last layer of the residual network. In a specific embodiment, the back propagation of the error can be expressed as:

[0117]

[0118] Where loss represents the loss function of the long short-term memory residual network module; 1 represents the shortcut connection in the stacked residual module.

[0119] In order to verify that the prediction accuracy of the power load short-term prediction model (RF-MWOA-ResidualLSTM) based on the random forest algorithm-whale optimization algorithm (MWOA)-long short-term memory residual network module proposed in this embodiment can reach higher than the prediction accuracy of the long short-term memory network (LSTM) and the unimproved whale algorithm-long short-term memory network (WOA-LSTM), this embodiment is based on the control experiment idea, and uses the same historical data set of the isolated island microgrid test system for comparative verification. After running, the power load short-term prediction model (RF-MWOA-ResidualLSTM) proposed in this embodiment The operation results of different models such as the improved whale algorithm-long short-term memory network (WOA-LSTM) and the long short-term memory network (LSTM) are compared, and the fitting of the observed values ​​is judged. The mean absolute percentage error (MAPE), root mean square error (RMSE), and mean absolute error (MAE) of the three models are calculated. The prediction accuracy of the power load short-term prediction model proposed in this embodiment is verified by the mean absolute percentage error, root mean square error, and mean absolute error. Specifically, this embodiment uses the historical data of the isolated island microgrid test system to run the random forest algorithm to screen out the top three important features. Figure 3 The following is a schematic diagram of the importance of random forest features. The whale optimization algorithm MWOA is then run to calculate the number of hidden nodes, learning rate, and filter coefficients. Finally, LSTM, WOA-LSTM, and RF-MWOA-ResidualLSTM are run to output the true value and the curves of the three models. Figure 4The following is a schematic diagram comparing the prediction results of the three models with the true values. The fitting situation is observed and the MAPE, RMSE and MAE of each model are calculated. Table 1 shows the MAPE, RMSE and MAE parameters of the isolated microgrid test system. It can be obtained that the number of hidden nodes, learning rate and filter coefficient are 30, 0.0072 and 3 respectively. Table 1 is shown below:

[0120] Table 1

[0121]

[0122] In actual power load forecasting application scenarios, we usually face massive amounts of historical power load data and related meteorological data and other historical data. The LSTM neural network model is a variant of a recursive neural network (RNN). It solves long-term dependency problems and long time interval problems that traditional RNNs cannot handle by memorizing sequence information. When using a deep learning model for power load forecasting, the huge amount of data often leads to gradient vanishing or gradient exploding problems. However, when the LSTM neural network model is applied to actual power load forecasting application scenarios, although the LSTM can save information for a relatively long time during operation, when faced with massive amounts of historical power load data and related meteorological data and other historical data, the existing LSTM model is difficult to avoid power load forecasting losses caused by gradient problems, and does not solve the problems of gradient vanishing and gradient exploding. Therefore, when using the LSTM neural network model to predict massive amounts of historical power load data and related meteorological data and other historical data, the LSTM neural network model also faces two main problems of gradient vanishing and gradient exploding. If these problems are not solved, they will affect the accuracy, stability and efficiency of power load forecasting. Therefore, the present invention implements By introducing a stacked residual module into the LSTM network structure and short-circuiting the path so that the gradient can be continuously propagated in the deep network without causing the gradient to disappear due to the superposition of too many convolutional layer gradients, the long short-term memory residual network module can effectively process and memorize long-term information, thereby better capturing the long-term dependence pattern of the power load and more accurately predicting the dynamic change of the power load; at the same time, based on the LSTM network structure, this embodiment designs a whale optimization algorithm MWOA (heuristic optimization algorithm) based on the random Levy flight strategy of cosine evolution and the elite reverse learning strategy to perform global optimization of LSTM hyperparameters, thereby realizing fast and effective hyperparameter adjustment engineering, greatly improving the robustness of the model and the accuracy of prediction, while the original WOA algorithm has low robustness and cannot meet the stability requirements required in power load prediction. In summary, compared with the traditional statistical analysis method, the embodiment of the present invention simplifies the processing of multidimensional features while ensuring data integrity, improves the quality of parameter adjustment, and realizes high-accuracy short-term power load future point prediction. In addition, this embodiment also eliminates redundant features through the feature screening function of random forest, greatly saves the calculation amount of the model, and shortens the model operation time.

[0123] The embodiment of the present invention provides a short-term power load forecasting method based on meta-heuristic algorithm optimization. The method obtains the corresponding initial feature data set by pre-processing the historical power load data and the historical meteorological data associated with the historical power load data, and inputs the initial feature data set into the pre-built power load short-term forecasting model for forecasting to obtain the short-term power load forecasting result; the power load short-term forecasting model includes a feature extraction and screening module and a fusion residual optimization network module connected in sequence. Compared with the prior art, the embodiment of the present invention realizes accurate power load forecasting through data pre-processing when there are missing samples and anomalies in the data set, and the method of screening effective features through the random forest algorithm saves a lot of computing power and training time. In addition, the embodiment of the present invention adopts a multi-strategy improved whale optimization algorithm to effectively guarantee the forecasting effect, and also effectively reduces the burden and running time of the computing server, and improves the accuracy and timeliness of short-term power load forecasting.

[0124] It should be noted that the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0125] In one embodiment, Figure 5 As shown, an embodiment of the present invention provides a short-term power load forecasting system based on meta-heuristic algorithm optimization, the system comprising:

[0126] The data acquisition module 101 is used to acquire historical power load data and historical meteorological data associated with the historical power load data to construct a historical data set;

[0127] The data processing module 102 is used to pre-process the historical data set to obtain a corresponding initial feature data set;

[0128] The data prediction module 103 is used to input the initial feature data set into a pre-built short-term power load prediction model for prediction to obtain a short-term power load prediction result; the short-term power load prediction model includes a feature extraction and screening module and a fusion residual optimization network module connected in sequence.

[0129] For the specific definition of a short-term power load forecasting system based on metaheuristic algorithm optimization, please refer to the above-mentioned definition of a short-term power load forecasting method based on metaheuristic algorithm optimization, which will not be repeated here. A person of ordinary skill in the art will appreciate that the various modules and steps described in conjunction with the embodiments disclosed in this application can be implemented in hardware, software, or a combination of both. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0130] The embodiment of the present invention provides a short-term power load forecasting system based on meta-heuristic algorithm optimization. The system constructs a historical data set through a data acquisition module; pre-processes the historical data set through a data processing module to obtain an initial feature data set; and inputs the initial feature data set into a pre-constructed short-term power load forecasting model through a data prediction module to obtain a short-term power load forecasting result. The short-term power load forecasting system provided by this embodiment can enable the model to better learn and memorize long-term dependent patterns, thereby more accurately predicting the dynamic changes of power loads, while ensuring the quality of parameter optimization results and greatly reducing the time required for parameter adjustment. At the same time, the MWOA algorithm is used for the long short-term memory residual network module to perform hyperparameter optimization tasks, which has better robustness and optimization performance, and can meet the stability requirements of the short-term power load forecasting model.

[0131] Figure 6 A computer device provided by an embodiment of the present invention includes a memory, a processor and a transceiver, which are connected via a bus; the memory is used to store a set of computer program instructions and data, and can transmit the stored data to the processor, and the processor can execute the program instructions stored in the memory to perform the steps of the above method.

[0132] The memory may include a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories; the processor may be a central processing unit, a microprocessor, an application-specific integrated circuit, a programmable logic device, or a combination thereof. By way of example but not limitation, the programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.

[0133] Additionally, the memory may be a physically separate unit or may be integrated with the processor.

[0134] It can be understood by those skilled in the art that Figure 6The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have the same component arrangement.

[0135] In one embodiment, the present invention provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.

[0136] The embodiments of the present invention provide a short-term power load forecasting method, system and storage medium based on metaheuristic algorithm optimization. The short-term power load forecasting method based on metaheuristic algorithm optimization introduces a stacked residual module into a long short-term memory network structure to form a fused residual optimization network module, which can better capture the long-term dependence pattern of the power load and more accurately predict the dynamic changes of the power load. At the same time, this embodiment designs a whale optimization algorithm based on a random Levy flight strategy based on cosine evolution and an elite reverse learning strategy to perform global optimization of hyperparameters, thereby realizing fast and effective hyperparameter adjustment engineering and greatly improving the robustness of the model and prediction accuracy.

[0137] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.

[0138] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.

[0139] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0140] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A short-term power load forecasting method based on meta-heuristic algorithm optimization, characterized in that: The following steps are involved: Acquire historical power load data and historical meteorological data associated with the historical power load data to construct a historical data set; Preprocessing the historical data set to obtain a corresponding initial feature data set; The initial feature data set is input into a pre-built short-term power load forecasting model for forecasting, and a short-term power load forecasting result is obtained; wherein, the short-term power load forecasting model includes a feature extraction and screening module and a fusion residual optimization network module connected in sequence, and the fusion residual optimization network module is formed by a serially connected iterative optimization module and a long short-term memory residual network module; the iterative optimization algorithm in the iterative optimization module adopts a whale optimization algorithm that introduces a random Levy flight strategy based on cosine evolution and an elite reverse learning strategy; The step of inputting the initial feature data set into a pre-built short-term power load forecasting model for forecasting to obtain a short-term power load forecasting result includes: The feature extraction and screening module is used to extract and screen out important features in the initial feature data set to obtain an important feature set; The model hyperparameters of the long short-term memory residual network module are set, and the model hyperparameters include the number of hidden nodes, learning rate and filter coefficient of the long short-term memory residual network module; the model hyperparameters are input into an iterative optimization module, and the model hyperparameters are iteratively optimized by using an iterative optimization algorithm in the iterative optimization module using a whale optimization algorithm that introduces a random Levy flight strategy based on cosine evolution and an elite reverse learning strategy to obtain an optimal solution combination of the hyperparameters; Inputting the optimal solution combination of the hyperparameters and the important feature set into the long short-term memory residual network module for prediction to obtain a short-term power load prediction result; The feature extraction and screening module uses a random forest algorithm to screen important features from the initial feature data set to obtain an important feature set, specifically: Calculating the feature importances in the initial feature data set, and sorting all the feature importances according to a preset sorting order to obtain a sorting result; Determine a elimination ratio, and according to the feature importance, eliminate the features in the sorting result according to the elimination ratio to obtain a candidate feature set; If the number of elements in the candidate feature set does not meet the preset feature number condition, the above steps are executed repeatedly, and the candidate feature set is eliminated again according to the elimination ratio and feature importance until the number of elements in the candidate feature set meets the preset feature number condition; The out-of-bag error rate of all candidate feature sets is calculated, and the optimal candidate feature set is selected as the important feature set according to the out-of-bag error rate. The calculation formula of the out-of-bag error rate is: In the formula, is the number of out-of-bag data observations of the qth tree; I(g) is the indicator function, that is, it takes 1 when the two values ​​are equal and 0 when they are not equal; Y b ∈{0,1} is the true result of the b-th observation; is the prediction result of the qth tree for the bth observation of OOB data before random permutation; is the prediction result of the qth tree for the bth observation of the out-of-bag data after random permutation; The step of iteratively optimizing the model hyperparameters by using the iterative optimization algorithm in the iterative optimization module and introducing the whale optimization algorithm based on the cosine evolution random Levy flight strategy and the elite reverse learning strategy to obtain the optimal solution combination of the hyperparameters includes: According to the predefined population size, total number of iterations and search space limit, a uniformly distributed initial population is generated using Gaussian mapping; Process the initial population to generate an inverse solution population; The fitness value of each original solution population and inverse solution population in the initial population is calculated according to a pre-constructed fitness function to obtain a solution fitness value, and an elite reverse learning strategy is used to select an elite group that meets a preset fitness threshold from the original solution population and the inverse solution population according to the solution fitness value; Select the best individual from the current population and the reverse population of the elite group as the best sub-individual for the next round of iteration; Calculate the fitness value corresponding to the optimal sub-individual according to the pre-constructed fitness function, obtain the optimal fitness value, and determine the optimal individual position corresponding to the optimal fitness value; Determine the coefficient vector and the state judgment coefficient, and determine whether the absolute value of the coefficient vector exceeds the total number of iterations. If so, determine whether the state judgment coefficient exceeds the preset state threshold. If the state judgment coefficient exceeds the preset state threshold, surround the prey; if the state judgment coefficient does not exceed the preset state threshold, use the random Levy flight strategy based on cosine evolution to update the optimal individual position to the current global optimal position; Determine whether the current number of iterations reaches the total number of iterations. If so, obtain the optimal solution combination of input parameters according to the current global optimal position, wherein the optimal solution combination of parameters includes the optimal number of hidden nodes, the optimal learning rate, and the optimal filter coefficient; if not, recalculate the fitness value of each original solution population and inverse solution population in the initial population according to the pre-constructed fitness function; The fitness value of the iterative optimization algorithm is the mean square error of the prediction result of the long short-term memory residual network module, and the fitness function is specifically: In the formula, Fit represents the fitness value; n represents the number of samples; y i represents the observed value of the i-th sample; x i represents the predicted value of the i-th sample output; p represents the number of hidden nodes; l represents the learning rate; λ represents the filter coefficient; The random Levy flight strategy based on cosine evolution is specifically: ζ=rand(0,1] Wherein, L(s,γ,μ) represents the random Levy flight path of cosine evolution; s represents the random step size of Levy flight; γ represents a constant; μ represents the minimum number of jump steps; z represents the cosine evolution factor; ζ represents a random number in the range of (0,1]; t represents the current number of iterations; r represents the distance between the individual and the target; u, v are constants that conform to the normal distribution; β is a constant between [1,2]; τ is a constant; rand represents the random number generation function; The update formula of the current global optimal position is: Where X(t+1) represents the position of the individual whale at the (t+1)th iteration; X(t) represents the position of the individual whale at the tth iteration; A represents the coefficient vector; D represents the distance between the individual and the prey; T represents the total number of iterations; Represents the state judgment coefficient.

2. A short-term power load forecasting method based on metaheuristic algorithm optimization according to claim 1, characterized in that: The step of preprocessing the historical data set to obtain a corresponding initial feature data set includes: The outliers and missing values ​​in the historical data set are cleaned using a preset data cleaning strategy to obtain a corresponding initial feature data set, wherein the data cleaning strategy includes Lagrange interpolation, averaging and / or Laida criterion.

3. The short-term power load forecasting method based on metaheuristic algorithm optimization according to claim 1 is characterized in that: The long short-term memory residual network module includes an input layer, a stacked residual module, an intermediate layer and an output layer connected in sequence.

4. A short-term power load forecasting system based on metaheuristic algorithm optimization using the short-term power load forecasting method based on metaheuristic algorithm optimization according to any one of claims 1 to 3, characterized in that: include: A data acquisition module, used to acquire historical power load data and historical meteorological data associated with the historical power load data, and construct a historical data set; A data processing module, used for preprocessing the historical data set to obtain a corresponding initial feature data set; A data prediction module is used to input the initial feature data set into a pre-built short-term power load prediction model for prediction, so as to obtain a short-term power load prediction result; the short-term power load prediction model includes a feature extraction and screening module and a fusion residual optimization network module connected in sequence, and the fusion residual optimization network module is formed by a series-connected iterative optimization module and a long short-term memory residual network module; wherein the iterative optimization algorithm in the iterative optimization module adopts a whale optimization algorithm that introduces a random Levy flight strategy based on cosine evolution and an elite reverse learning strategy.

5. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 3 is implemented.