Short-term power load forecasting method, device and electronic equipment
By improving the spotted hyena algorithm to optimize the hyperparameters of the ELM model, the problem of unstable output in the ELM model in short-term power load prediction is solved, the prediction accuracy is improved and the data volume requirements are reduced, and more efficient power load prediction is achieved.
Patent Information
- Application Number
- CN202210302207.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-03-24
AI Technical Summary
The output of the extreme learning machine (ELM) model is unstable in the short-term power load prediction, affecting the prediction accuracy. The existing optimization algorithm has problems of local optimal traps and insufficient convergence performance.
The hyperparameters of the ELM model are optimized by using the improved spotted hyena algorithm, and the convergence and global search capabilities of the algorithm are improved through quasi-reverse learning strategies, dynamic weight inertia and elite strategies, and the optimal hyperparameters of the ELM model are found to improve prediction accuracy.
The prediction accuracy of the ELM model is significantly improved, the prediction ability of short-term power load is enhanced, the requirements for the number of original data are reduced, and the local optimal solution is avoided.
Smart Images

Figure CN114781692B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of electric power technology, and in particular relates to a short-term electric power load forecasting method, device and electronic equipment. Background Art
[0002] Short-term power load forecasting is the prediction of power load in a specific area within a few days. Accurate short-term power load forecasting can effectively guarantee the work of the power sector and promote economic development.
[0003] Extreme Learning Machine (ELM) is an algorithm proposed based on a single hidden layer feedforward neural network. It has been widely used in many fields due to its fast learning speed, including the field of short-term power load forecasting. However, in the training process of the ELM model, its hyperparameters (connection weights and thresholds) are randomly determined, which to a certain extent causes the output of the model to be unstable, affecting the prediction accuracy of the ELM model, and further affecting the accuracy of short-term power load forecasting. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a short-term power load forecasting method, device and electronic device to further improve the accuracy of short-term power load forecasting using the ELM model.
[0005] A first aspect of an embodiment of the present invention provides a short-term power load forecasting method, comprising:
[0006] Obtain historical power load data of the target power grid to obtain a training set;
[0007] According to the training set, the improved spotted hyena algorithm is used to find the optimal hyperparameters of the ELM model;
[0008] According to the training set and the optimal hyperparameters, the output weight of the ELM model is trained, and the trained ELM model is determined according to the optimal hyperparameters and the output weights;
[0009] The short-term load forecast of the target power grid is performed based on the trained ELM model.
[0010] A second aspect of an embodiment of the present invention provides a short-term power load forecasting device, comprising:
[0011] An acquisition module is used to acquire historical power load data of the target power grid to obtain a training set;
[0012] The calculation module is used to find the optimal hyperparameters of the ELM model using the improved spotted hyena algorithm according to the training set;
[0013] A training module is used to train the output weight of the ELM model according to the training set and the optimal hyperparameters, and determine the trained ELM model according to the optimal hyperparameters and the output weights;
[0014] The prediction module is used to perform short-term load prediction on the target power grid based on the trained ELM model.
[0015] A third aspect of an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the short-term power load forecasting method of the first aspect described above are implemented.
[0016] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the short-term power load forecasting method of the first aspect are implemented.
[0017] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0018] When training the ELM model, the embodiment of the present invention first finds the optimal hyperparameters of the ELM model by improving the spotted hyena algorithm, and then trains the output weights of the ELM model based on the training set and the optimal hyperparameters to obtain the final ELM model for power load forecasting. Since the improved spotted hyena algorithm has good convergence when optimizing the hyperparameters of the ELM model, it can accurately calculate the optimal hyperparameters of the ELM model, thereby improving the prediction accuracy of the ELM model, thereby improving the prediction accuracy of the ELM model when performing short-term power load forecasting. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0020] Figure 1 It is a flow chart of a short-term power load forecasting method provided by an embodiment of the present invention;
[0021] Figure 2 It is a detailed flow chart of a short-term power load forecasting method provided by an embodiment of the present invention;
[0022] Figure 3 is a schematic diagram of a short-term power load forecasting device provided by an embodiment of the present invention;
[0023] Figure 4is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0025] In order to illustrate the technical solution of the present invention, a specific embodiment is provided below for illustration.
[0026] According to the length of the forecast time, power load forecasting can be divided into long-term, medium-term, short-term and ultra-short-term power load forecasting. The power load forecasting method has gone through a development process from empirical forecasting method to traditional forecasting method and then to modern forecasting method. The empirical forecasting method mainly includes two methods: historical experience forecasting and trend extrapolation forecasting. This method was proposed earlier, but the theory is relatively simple. With the increase in the types and randomness of power loads, there is a lack of objective theoretical basis for forecasting power loads based solely on subjective experience.
[0027] Traditional prediction methods mainly include regression analysis, time series method, grey theory method and Kalman filtering. Regression analysis method predicts power load by establishing regression equations by analyzing the relationship between variables; Prior art 1 predicts medium- and long-term power load of offshore oil fields by applying stepwise regression analysis, but in engineering practice, the relationship between power load and variables often presents a nonlinear relationship, and the accuracy of power load prediction will be reduced by linear regression method. Time series method predicts power load by analyzing the changing law of historical power load data and constructing relevant mathematical models; Prior art 2 constructs a power load time series prediction model based on probability statistics, and processes power operation data through a probability principal component analysis model, achieving high accuracy for power load prediction, but it is still a regression analysis method in essence, and has the same shortcomings as regression analysis. Grey theory method analyzes the internal characteristics of the original power load data, and constructs equations to solve them; Prior art 3 conducts a comparative analysis of single-factor and multi-factor grey theories in power load prediction, and improves the grey prediction theory, but this method has high requirements for the quality of original data. By establishing a model based on the Kalman filter method, the noise in the original power load data can be effectively removed; the existing technology four proposes a power grid false data injection attack detection method based on extreme gradient boosting combined with unscented Kalman filtering, which has moderate computational complexity, but it is very difficult to construct the corresponding state equation.
[0028] Modern prediction methods mainly include expert system method, artificial neural network (ANN), support vector machine (SVM), extreme learning machine (ELM) prediction model and combined prediction method. The expert system method is similar to the traditional empirical prediction method, which generates a processing method for power load data by combining the experience and opinions of relevant experts. Although this method combines modern theories to process load data, there is still an impact on the prediction results due to subjective factors of experts. The artificial neural network method is a new method developed with the development of the computer field. It summarizes and learns the regularity of historical load data by simulating the thinking and working methods of the human brain to obtain the change law of historical load data. Prior art five established a new type of robust artificial neural network framework to improve the prediction ability of traditional artificial neural networks. Artificial neural networks have a good effect on load forecasting, but the problem with this method is that it takes a certain amount of time to determine its relevant parameters. In order to overcome the shortcomings of traditional neural networks such as large prediction errors and long operation time, scholars proposed the ELM theory. ELM is an algorithm proposed on the basis of a single hidden layer feedforward neural network. It has been widely used in many fields due to its fast learning speed, such as the study of external short-circuit thermal model of lithium-ion power batteries for electric vehicles, the prediction of heliostat spot offset, and the evaluation and prediction of steel bridge deck corrosion. ELM is a machine learning algorithm derived from statistical theory, and its solution accuracy is greatly affected by its own random parameters. Some scholars choose to optimize the random parameters of the ELM model through intelligent algorithms to obtain the optimal hyperparameters of the ELM model under corresponding conditions to improve the prediction accuracy of the ELM model, and have achieved certain results. Prior art six proposed a short-term wind power prediction model based on the sparrow algorithm combined with ELM, but the model did not improve the sparrow algorithm, and the algorithm has the disadvantage of being easy to fall into local optimality. Prior art seven combines the fruit fly optimization algorithm with the ELM model for short-term power load prediction, but the algorithm was proposed earlier and the convergence performance is still insufficient. In summary, the algorithms for optimizing the random parameters of ELM in the prior art all have defects.
[0029] In view of this, an embodiment of the present invention provides a short-term power load forecasting method, see Figure 1 As shown, the method comprises the following steps:
[0030] Step S101, obtaining historical power load data of a target power grid to obtain a training set.
[0031] In an embodiment of the present invention, the historical power load data of the target power grid can be directly derived from the power system. The data in the training set is divided into two parts according to time sequence, one part is used as the input value of the ELM model, and the other part is used to verify the predicted value output by the ELM model.
[0032] Step S102, based on the training set, using the improved spotted hyena algorithm to find the optimal hyperparameters of the ELM model.
[0033] In the embodiment of the present invention, the ELM model includes an input layer, an output layer and a hidden layer, and has the characteristics of strong generalization ability and fast learning speed. The activation function of the ELM model is J h , the training set is The mathematical model is:
[0034]
[0035] Among them, n h is the number of hidden layer nodes, and are the connection weights of the output node, input node and hidden layer node, ε is the hidden layer threshold, ζ and λ are the input and output of the training set, and N is the number of samples. The above formula can be converted into the following form:
[0036] Uω=λ
[0037]
[0038] Among them, U is the hidden layer output matrix, ω is the weight matrix, and the expression of U is:
[0039]
[0040] In summary, we can get:
[0041] In the training process of the ELM model, only the output weights need to be trained, and the connection weights and thresholds are usually randomly determined, which causes the output instability of the model to a certain extent. To solve this problem, the embodiment of the present invention adopts the Improved Spotted Hyena Optimizer (ISHO) algorithm to optimize the hyperparameters of the ELM model, thereby constructing the ISHO-ELM short-term power load forecasting model. The Improved Spotted Hyena Algorithm has good convergence when optimizing the hyperparameters of the ELM model, and can accurately calculate the optimal hyperparameters of the ELM model, thereby improving the prediction accuracy of the ELM model.
[0042] Step S103, training the output weights of the ELM model according to the training set and the optimal hyperparameters, and determining the trained ELM model according to the optimal hyperparameters and the output weights.
[0043] In the embodiment of the present invention, after the hyperparameters of the ELM model are determined, the output weights of the ELM model are obtained by training the training set to obtain the trained ELM model.
[0044] Step S104: performing short-term load forecasting on the target power grid based on the trained ELM model.
[0045] In an embodiment of the present invention, the power load data of the target power grid in a preset period before the period to be predicted can be obtained and input into the trained ELM model, and the model output is the load prediction result.
[0046] It can be seen that when the embodiment of the present invention trains the ELM model, the optimal hyperparameters of the ELM model are first found by the improved spotted hyena algorithm, and then the output weights of the ELM model are trained based on the training set and the optimal hyperparameters to obtain the final ELM model for power load forecasting. Since the improved spotted hyena algorithm has good convergence when optimizing the hyperparameters of the ELM model, it can accurately calculate the optimal hyperparameters of the ELM model, thereby improving the prediction accuracy of the ELM model, thereby improving the prediction accuracy of the ELM model when performing short-term power load forecasting.
[0047] As a possible implementation method, in step S102, based on the training set, the improved spotted hyena algorithm is used to find the optimal hyperparameters of the ELM model, including:
[0048] Step 1: Initialize the spotted hyena population through a quasi-reverse learning strategy;
[0049] Step 2: Calculate the fitness of each individual in the spotted hyena population under the same output weight according to the training set, and determine the individual with the best global fitness; the fitness is the fit between the ELM model output value corresponding to the individual and the actual value, and the higher the fit, the better the fitness;
[0050] Step 3: Update each individual in the spotted hyena population;
[0051] Step 4: Repeat steps 2 and 3, and continue to iterate until the iteration termination condition is reached. Output the individual with the best global fitness and obtain the optimal hyperparameters of the ELM model.
[0052] In the embodiment of the present invention, the conventional spotted hyena optimization algorithm is first introduced.
[0053] The spotted hyena mainly simulates the hunting behavior of the spotted hyena. The main mathematical model of the conventional spotted hyena optimization algorithm is as follows:
[0054] (1) Population initialization
[0055] The population initialization matrix for spotted hyenas is as follows:
[0056]
[0057] in, represents the position matrix of the spotted hyena population after initialization, m is the number of spotted hyenas in the spotted hyena population, d represents the dimension of the population, Indicates the position information of the i-th spotted hyena in the j-th dimension. In order to evaluate the quality of the spotted hyena, the degree of fit between the output value of the ELM model and the actual value is used as the fitness function of the algorithm to solve the fitness of the spotted hyena. The fitness function is F and is saved in the form of a matrix. The fitness matrix of the spotted hyena is as follows:
[0058]
[0059] in, is the spotted hyena fitness matrix, m represents the number of spotted hyenas in the population, F i (t) is the fitness value of the i-th spotted hyena.
[0060] (2) Hunting process
[0061] Spotted hyenas can be familiar with the location of prey and surround the prey. Individuals in the spotted hyena population determine their moving direction by judging the distance from the prey. In the spotted hyena optimization algorithm, it is assumed that the population individuals know the location of the prey and approach it. In fact, during the execution of the algorithm, the location of the prey is replaced by the location of the spotted hyena with the best fitness. This behavior can be expressed as:
[0062]
[0063]
[0064]
[0065] Among them, m is the number of individuals in the spotted hyena population, d represents the dimension of the population, represents the position information of the i-th spotted hyena in the j-th dimension, and t is the current iteration number; is the position matrix of each individual after an update in the tth iteration; is the position of the individual with the best global fitness in the t-1th iteration; is the distance between each individual and the individual with the best global fitness in the t-1th iteration; B and E are coefficient vectors used to balance the local search and global search processes of the spotted hyena. By adjusting the values of B and E, the spotted hyena can change its current position to get closer to the prey. The corresponding expressions are as follows:
[0066] B=2·r 1
[0067] E=2h·r 2 -h
[0068] h=5-(t*(5 / T))
[0069] Where h represents the linear convergence factor, which decreases linearly from 5 to 0 as the number of iterations increases, indicating the transition of the spotted hyena from encirclement to attack on prey, r 1 and r 2 represents a random vector in [0,1].
[0070] (3) Attacking and searching for prey
[0071] The values of h and E will change with the increase of the number of iterations. The spotted hyena optimization algorithm stipulates that when |E|<1, the spotted hyena will attack the prey, otherwise it will not attack the prey. The spotted hyena mainly searches for prey in the population based on the location of the spotted hyena group. The prey is determined in the algorithm. They keep a certain distance from each other to search and attack the prey. When |E|>1, the spotted hyena does not attack the prey. This mechanism enables the algorithm to perform a global search. Another constraint on the algorithm to perform a global search is B. B provides a random weight for the position of the prey, which will also help the algorithm to perform a global search and avoid falling into a local optimum. Finally, the algorithm is terminated when the termination condition is met.
[0072] However, the original spotted hyena optimization algorithm still has the problem of being easily trapped in the local optimum when dealing with complex problems, and the convergence accuracy is poor. To address this shortcoming, the embodiment of the present invention proposes a spotted hyena optimization algorithm, namely the ISHO algorithm, and the specific improvement process is as follows:
[0073] Improvement 1: A quasi-reverse learning strategy can be introduced to participate in population initialization.
[0074] The quasi-reverse learning strategy refers to the process of generating individuals with opposite positions in the current population during the initialization of the algorithm to produce better candidate solutions. Introducing the quasi-reverse learning strategy during the initialization process can improve the accuracy of the solution and accelerate the convergence of the algorithm. The possibility of the algorithm falling into the local optimal solution is also reduced, and it has a better chance of reaching the global optimal solution than a randomly generated population.
[0075] The improved initialization formula is as follows:
[0076]
[0077] In the formula, is the spotted hyena individual in the jth dimension after initialization; for Quasi-reverse individual; ub j lb j are the upper and lower limits of the j-th dimension search space respectively; rand() is a random number in [0,1].
[0078] Improvement 2: In the original spotted hyena optimization algorithm, h decreases linearly with the increase of iteration times, which makes the algorithm unable to balance the speed in the early and late stages of iteration. Therefore, dynamic weight inertia can be introduced to search the global area in the early stage of iteration to find the global optimal area faster. In the late stage of iteration, the local search capability of the algorithm can be fully utilized to improve the convergence accuracy of the algorithm. The formula of h is changed to:
[0079]
[0080] According to the above formula, in the early stage of iteration, in order to ensure the global search ability of the algorithm, the inertia weight is set to a large value. As the iteration proceeds, the inertia weight gradually decreases, the algorithm quickly converges to the global optimal solution and gradually narrows the search range, which is conducive to the current population to fully search near the global optimal solution. On the basis of accelerating the convergence speed of the algorithm, the local optimization ability of the algorithm is improved.
[0081] Improvement three: An elite strategy can be introduced to allow the best individuals of the previous generation to participate in the position update of spotted hyenas.
[0082] In the original spotted hyena optimization algorithm, the individual spotted hyena is only affected by the position of the current optimal spotted hyena during the iteration process. Its global search ability is poor and it is easy to fall into the local extreme value area, resulting in low convergence accuracy of the algorithm. Therefore, the position of the previous generation of optimal spotted hyenas is introduced into the individual position update formula of spotted hyenas, so that the position update stage of the optimal spotted hyena is affected by both the position of the previous generation of optimal spotted hyenas and the position of the individual spotted hyenas of the previous generation, so as to avoid the problem that the original algorithm is prone to fall into local extreme values. That is, after updating each individual spotted hyena once according to the original algorithm, the spotted hyena individuals that have been updated once are updated twice according to the following formula:
[0083]
[0084] In the formula, is the position matrix of each individual after the second update in the tth iteration; is the position matrix of each individual after an update in the tth iteration; is the optimal individual in global fitness recalculated after an update in the tth iteration; r is a random vector of [0,1].
[0085] As a possible implementation, the fitness calculation formula of an individual can be:
[0086]
[0087] The root mean square error is calculated as the fitness through the above formula, where fitness is the fitness; n is the number of output values of the ELM model; is the output value of the ith ELM model, y i is the ith actual value.
[0088] Based on the above, the overall process of the short-term power load forecasting method provided by the embodiment of the present invention can be seen in Figure 2 As shown (in actual prediction, the model can be pre-trained and applied directly):
[0089] Import training data and perform normalization processing; initialize the model and algorithm parameters; use quasi-reverse learning to initialize the individual positions of the population; start the algorithm iteration process, update the individual positions, and calculate the individual fitness values; when the iteration termination condition is reached, output the optimal individual position, that is, the optimal hyperparameters of the ELM model; input the optimal hyperparameters into the ELM model and train the output weights of the model; use the trained model to perform short-term power load forecasting.
[0090] The performance of the algorithm proposed in the embodiment of the present invention is tested by comparison below.
[0091] In order to test the performance of the ISHO algorithm, six benchmark test functions are selected to test the performance of the ISHO algorithm to verify the effect of the algorithm improvement. Among them, f1(x)-f3(x) is a single-peak test function, which is mainly used to test the local search ability of the ISHO algorithm; f4(x)-f6(x) is a multi-peak test function, which is mainly used to test the global search ability of the ISHO algorithm. The corresponding benchmark test functions are shown in Table 1.
[0092] Table 1 Benchmark test function table
[0093]
[0094] The SHO algorithm and excellent intelligent algorithms proposed in recent years, such as Grey Wolf Optimizer (GWO), Whale Optimization Algorithm (WOA), Seagull Optimization Algorithm (SOA), Tunicate Swarm Algorithm (TSA) and ISHO algorithm are selected for performance comparison. The number of individuals of all algorithms is set to 30, the number of iterations is 1000, and for each benchmark function, each algorithm is run independently 30 times, and the corresponding experimental data is saved. The optimal value, inferior value, average value and standard deviation of 30 experiments are selected as the evaluation indicators of the experimental results, and the corresponding data are shown in Table 2.
[0095] Table 2 Test results of each algorithm
[0096]
[0097] As can be seen from Table 2, for the single-peak test function f1(x)-f3(x), the ISHO algorithm has the best optimization effect among the six algorithms, and the values of the ISHO algorithm are the smallest for the four evaluation indicators. For f1(x), both the ISHO algorithm and the SHO algorithm can converge to 0, but by comparing the convergence curves, the ISHO algorithm has a better initialization effect and can enter the search state faster; for the multi-peak test function f4(x)-f6(x), the ISHO algorithm also shows excellent search capabilities. For the corresponding evaluation indicators, the values of the ISHO algorithm can reach the best among the six algorithms. It can be seen from the corresponding experimental data that the ISHO algorithm obtained by improving the SHO algorithm has a significant improvement in both global search and local search compared with the optimization algorithms proposed in recent years.
[0098] In addition, by selecting the power load data of a certain region from January 1, 2012 to March 31, 2012, a total of 91 days, the accuracy of the model is tested. For three tests with different numbers of training samples, the fitting coefficient of the ISHO-ELM model proposed in the embodiment of the present invention is improved by 1.6%, 0.93%, and 0.90% respectively compared with the ELM model, and by 1.7%, 1.3%, and 1.3% respectively compared with the SVM model, proving that the prediction of power load data by this model shows a high prediction accuracy. In addition, the ISHO-ELM model has a low requirement for the number of training set data, and does not require a large number of original power load data as the training data of the model to obtain a more accurate power load prediction result.
[0099] It should be understood that the order of execution of the steps in the above embodiment does not necessarily 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 embodiment of the present invention.
[0100] The present invention also provides a short-term power load forecasting device. Figure 3 As shown, the device 30 comprises:
[0101] The acquisition module 31 is used to acquire the historical power load data of the target power grid to obtain a training set.
[0102] The calculation module 32 is used to find the optimal hyperparameters of the ELM model using the improved spotted hyena algorithm according to the training set.
[0103] The training module 33 is used to train the output weight of the ELM model according to the training set and the optimal hyperparameters, and determine the trained ELM model according to the optimal hyperparameters and the output weights.
[0104] The prediction module 34 is used to perform short-term load prediction on the target power grid based on the trained ELM model.
[0105] In a possible implementation, the calculation module 32 is specifically configured to perform the following steps:
[0106] Step 1: Initialize the spotted hyena population through a quasi-reverse learning strategy;
[0107] Step 2: Calculate the fitness of each individual in the spotted hyena population under the same output weight according to the training set, and determine the individual with the best global fitness; the fitness is the fit between the ELM model output value corresponding to the individual and the actual value, and the higher the fit, the better the fitness;
[0108] Step 3: Update each individual in the spotted hyena population;
[0109] Step 4: Repeat steps 2 and 3, and continue to iterate until the iteration termination condition is reached. Output the individual with the best global fitness and obtain the optimal hyperparameters of the ELM model.
[0110] In one possible implementation, the formula for initializing the spotted hyena population through a quasi-reverse learning strategy is:
[0111]
[0112] In the formula, is the spotted hyena individual in the jth dimension after initialization; for Quasi-reverse individual; ub j lbj are the upper and lower limits of the j-th dimension search space respectively; rand() is a random number in [0,1].
[0113] In one possible implementation, the fitness calculation formula of an individual is:
[0114]
[0115] In the formula, fitness is the fitness; n is the number of output values of the ELM model; is the output value of the ith ELM model, y i is the ith actual value.
[0116] In one possible implementation, in each iteration, updating each individual in the spotted hyena population includes:
[0117] Each individual in the hyena population is updated once, and each individual after the first update is updated twice to obtain each individual after the current number of iterations.
[0118] In one possible implementation, the formula for updating each individual in the hyena population is:
[0119]
[0120]
[0121] B=2·r 1
[0122] E=2h·r 2 -h
[0123]
[0124] In the formula, is the position matrix of each individual after an update in the tth iteration; is the position of the individual with the best global fitness in the t-1th iteration; is the distance between each individual and the global optimal fitness individual in the t-1th iteration; B and E are coefficient vectors; r 1 and r 2 is a random vector of [0,1]; h is the convergence factor, t is the current number of iterations, and T is the maximum number of iterations.
[0125] In a possible implementation, the formula for performing a second update on each individual after the first update is:
[0126]
[0127] In the formula, is the position matrix of each individual after the second update in the tth iteration; is the position matrix of each individual after an update in the tth iteration; is the optimal individual in global fitness recalculated after an update in the tth iteration; r is a random vector of [0,1].
[0128] Figure 4 FIG. 4 is a schematic diagram of an electronic device 40 provided by an embodiment of the present invention. Figure 4 As shown, the electronic device 40 of this embodiment includes: a processor 41, a memory 42, and a computer program 43 stored in the memory 42 and executable on the processor 41, such as a short-term power load forecasting program. When the processor 41 executes the computer program 43, the steps in the above-mentioned various short-term power load forecasting method embodiments are implemented, such as Figure 1 Alternatively, when the processor 41 executes the computer program 43, the functions of each module in the above-mentioned device embodiments are realized, for example Figure 3 The functions of the modules 31 to 34 are shown.
[0129] Exemplarily, the computer program 43 may be divided into one or more modules / units, one or more modules / units are stored in the memory 42, and are executed by the processor 41 to complete the present invention. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 43 in the electronic device 40. For example, the computer program 43 may be divided into an acquisition module 31, a calculation module 32, a training module 33, and a prediction module 34 (modules in the virtual device), and the specific functions of each module are as follows:
[0130] The acquisition module 31 is used to acquire the historical power load data of the target power grid to obtain a training set.
[0131] The calculation module 32 is used to find the optimal hyperparameters of the ELM model using the improved spotted hyena algorithm according to the training set.
[0132] The training module 33 is used to train the output weight of the ELM model according to the training set and the optimal hyperparameters, and determine the trained ELM model according to the optimal hyperparameters and the output weights.
[0133] The prediction module 34 is used to perform short-term load prediction on the target power grid based on the trained ELM model.
[0134] The electronic device 40 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 40 may include, but is not limited to, a processor 41 and a memory 42. Those skilled in the art will appreciate that Figure 4 It is only an example of the electronic device 40 and does not constitute a limitation of the electronic device 40. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 40 may also include input and output devices, network access devices, buses, etc.
[0135] The processor 41 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0136] The memory 42 may be an internal storage unit of the electronic device 40, such as a hard disk or memory of the electronic device 40. The memory 42 may also be an external storage device of the electronic device 40, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 40. Further, the memory 42 may also include both an internal storage unit of the electronic device 40 and an external storage device. The memory 42 is used to store computer programs and other programs and data required by the electronic device 40. The memory 42 may also be used to temporarily store data that has been output or is to be output.
[0137] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0138] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0139] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. 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 the present invention.
[0140] In the embodiments provided by the present invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0141] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0142] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0143] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0144] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A short-term power load forecasting method, characterized in that: include: Obtain historical power load data of the target power grid to obtain a training set; According to the training set, the improved spotted hyena algorithm is used to find the optimal hyperparameters of the ELM model; According to the training set and the optimal hyperparameters, the output weights of the ELM model are trained, and according to the optimal hyperparameters and the output weights, the trained ELM model is determined; Perform short-term load forecasting on the target power grid based on the trained ELM model; According to the training set, the improved spotted hyena algorithm is used to find the optimal hyperparameters of the ELM model, including: Step 1: Initialize the spotted hyena population through a quasi-reverse learning strategy; Step 2: Calculate the fitness of each individual in the spotted hyena population under the same output weight according to the training set, and determine the individual with the best global fitness; wherein the fitness is the fit between the ELM model output value corresponding to the individual and the actual value, and the higher the fit, the better the fitness; Step 3: Update each individual in the spotted hyena population; Step 4: Repeat steps 2 and 3, and continue to iterate until the iteration termination condition is reached, output the individual with the best global fitness, and obtain the optimal hyperparameters of the ELM model; In each iteration, the individuals in the spotted hyena population are updated by: Each individual in the hyena population is updated once, and each individual after the first update is updated twice to obtain each individual after the current number of iterations; The formula for updating each individual in the hyena population is: B=2·r1 E=2h·r2-h In the formula, is the position matrix of each individual after an update in the tth iteration; is the position of the individual with the best global fitness in the t-1th iteration; is the distance between each individual and the global optimal fitness individual in the t-1th iteration; B and E are coefficient vectors; r1 and r2 are random vectors of [0,1]; h is the convergence factor, t is the current iteration number, and T is the maximum iteration number; The formula for performing a second update on each individual after the first update is: In the formula, is the position matrix of each individual after the second update in the tth iteration; is the position matrix of each individual after an update in the tth iteration; is the optimal individual in global fitness recalculated after an update in the tth iteration; r is a random vector of [0,1].
2. The short-term power load forecasting method according to claim 1, characterized in that: The formula for initializing the spotted hyena population using the quasi-reverse learning strategy is: In the formula, is the spotted hyena individual in the jth dimension after initialization; for Quasi-reverse individual; ub j lb j are the upper and lower limits of the j-th dimension search space respectively; rand() is a random number in [0,1].
3. The short-term power load forecasting method according to claim 1, characterized in that: The fitness calculation formula of an individual is: In the formula, fitness is the fitness; n is the number of output values of the ELM model; is the output value of the ith ELM model, y i is the ith actual value.
4. A short-term power load forecasting device, characterized in that: include: An acquisition module is used to acquire historical power load data of the target power grid to obtain a training set; A calculation module, used for finding the optimal hyperparameters of the ELM model using an improved spotted hyena algorithm according to the training set; A training module, used for training the output weight of the ELM model according to the training set and the optimal hyperparameters, and determining the trained ELM model according to the optimal hyperparameters and the output weights; The prediction module is used to perform short-term load prediction on the target power grid based on the trained ELM model; According to the training set, the improved spotted hyena algorithm is used to find the optimal hyperparameters of the ELM model, including: Step 1: Initialize the spotted hyena population through a quasi-reverse learning strategy; Step 2: Calculate the fitness of each individual in the spotted hyena population under the same output weight according to the training set, and determine the individual with the best global fitness; wherein the fitness is the fit between the ELM model output value corresponding to the individual and the actual value, and the higher the fit, the better the fitness; Step 3: Update each individual in the spotted hyena population; Step 4: Repeat steps 2 and 3, and continue to iterate until the iteration termination condition is reached, output the individual with the best global fitness, and obtain the optimal hyperparameters of the ELM model; In each iteration, the individuals in the spotted hyena population are updated by: Each individual in the hyena population is updated once, and each individual after the first update is updated twice to obtain each individual after the current number of iterations; The formula for updating each individual in the hyena population is: B=2·r1 E=2h·r2-h In the formula, is the position matrix of each individual after an update in the tth iteration; is the position of the individual with the best global fitness in the t-1th iteration; is the distance between each individual and the global optimal fitness individual in the t-1th iteration; B and E are coefficient vectors; r1 and r2 are random vectors of [0,1]; h is the convergence factor, t is the current iteration number, and T is the maximum iteration number; The formula for performing a second update on each individual after the first update is: In the formula, is the position matrix of each individual after the second update in the tth iteration; is the position matrix of each individual after an update in the tth iteration; is the optimal individual in global fitness recalculated after an update in the tth iteration; r is a random vector of [0,1].
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
