Short-term power load prediction method
By using MPSR and IHBA-BiGRU-Attention methods, the nonlinearity and nonstationarity problems in short-term power load forecasting are solved. By optimizing the BiGRU network with an improved honey badger algorithm and introducing an attention mechanism, higher accuracy power load forecasting is achieved.
Patent Information
- Application Number
- CN202511510108.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-01-13
AI Technical Summary
Due to its nonlinear and non-stationary characteristics, short-term power load forecasting is difficult to achieve with high accuracy using existing technologies. It is also affected by a variety of factors and existing algorithms suffer from problems such as insufficient population diversity, imbalance between the mining and harvesting stages, and susceptibility to getting trapped in local optima.
We employ MPSR and IHBA-BiGRU-Attention short-term load forecasting methods, select influencing factors through Spearman correlation analysis, reconstruct the multivariate phase space using the CC method, improve the Honey Badger Algorithm (IHBA), optimize the hyperparameters of the BiGRU network, and introduce an attention mechanism to construct the IHBA-BiGRU-Attention power load forecasting model.
It improved the model's ability to process time-series power load data, enhanced its ability to capture key information, significantly improved prediction accuracy and precision, and reduced prediction errors.
Smart Images

Figure CN121327409A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of power load prediction, and particularly relates to a short-term power load prediction method. BACKGROUND
[0002] Accurate short-term load prediction is crucial for the economic, safe operation and reliability of the power system. The accuracy of short-term power load prediction will directly affect the stable operation of the power system and the orderly competition of the power market. As is known to all, the power load in the modern power system is affected by various external factors such as meteorological factors and economic level. In terms of meteorological factors, some regions have high dry heat, some have high humidity, and some have high altitude, etc. In terms of economic factors, some regions are economically developed, some are underdeveloped, and some have both of these influencing factors.
[0003] Due to the non-linear and non-stationary characteristics of short-term power load, the difficulty of load prediction is increased. Therefore, there is an urgent need for a short-term power load prediction method that can solve the above problems.
[0004] The above information disclosed in this BACKGROUND section is only for increasing the understanding of the background of the present application, and therefore, can include matters known by those of ordinary skill in the art. SUMMARY
[0005] The present application proposes a short-term power load prediction method, which is a short-term load prediction method based on MPSR and IHBA-BiGRU-Attention. First, considering the numerous factors affecting power load, the Spearman correlation analysis is used to select the factors with strong correlation with power load, and a multivariate time series is formed with the power load sequence. Then, the delay time and embedding dimension of each time series are calculated by using the C-C method, and the multivariate phase space reconstruction is realized. Second, in view of the problems of the HBA algorithm such as lack of population diversity, imbalance between the mining stage and the honey gathering stage, and easy to fall into local optimal solution, the Kent chaotic mapping is introduced, the density factor is improved, and the small hole imaging reverse learning strategy is improved. Then, the improved honey badger algorithm (IHBA) is used to optimize the hyperparameters of the BiGRU network, and the attention mechanism is introduced into the BiGRU network to establish the IHBA-BiGRU-Attention power load prediction model. Finally, the power load of two public data sets and one measured data set is predicted to verify the effectiveness and superiority of the method proposed in the present application.
[0006] In some embodiments of the present application, a short-term power load prediction method is provided, comprising the following steps:
[0007] Step 1. Feature selection: the power load data influencing factors are preferably selected and the multivariate time series is constructed, historical power load data and influencing factor data are selected, the influencing factors with strong correlation with power load are selected through an algorithm, and a multivariate time series for power load prediction is constructed;
[0008] Step 2. Multivariate phase space reconstruction: the delay time and embedding dimension of each time series are calculated by the C-C method, and the reconstructed multivariate phase space is obtained;
[0009] Step 3. Improvement from HBA to IHBA: in order to enrich the diversity of solutions, Kent chaotic mapping is used to initialize the meerkat population; in order to balance the mining stage and the honey collecting stage, the density factor is improved; in order to avoid the algorithm falling into local optimal value and improve the anti-local extreme value ability, a pinhole imaging reverse learning strategy is introduced;
[0010] Step 4. The hyperparameters of the BiGRU network are optimized by using the IHBA, and an IHBA-BiGRU-Attention prediction model is constructed by combining the attention mechanism;
[0011] Step 5. Index evaluation: one of the root mean square error, mean absolute error, mean absolute percentage error and determination coefficient index is used to evaluate the accuracy of the prediction model.
[0012] In some embodiments of the application, the feature selection in step 1 is specifically: the correlation analysis is performed by using the Spearman correlation coefficient method, and the calculation formula is as follows:
[0013]
[0014] In the formula, ρ is the Spearman correlation coefficient, ranging from -1 to 1; n is the number of samples in each variable, d i is the rank difference of the corresponding data points in two variables; the larger the absolute value of ρ, the stronger the correlation between the variables.
[0015] In some embodiments of the application, the multivariate phase space reconstruction in step 2 is specifically: the historical sequence is reconstructed into a low-order nonlinear dynamic system by using MPSR, and the historical time highly related to the prediction time is identified; M-dimensional multivariate time series {x i ,i=1,2,…,M} contains power load time series x1 and e influencing factor series x2, x3,…,x e+1 ; wherein x i =[x i (1),x i (2),…,x i (N)], N is the length of the time series; for a single variable time series x iFind the delay time τ i and embedding dimension d i Then, the phase space of the M-dimensional multivariate time series can be obtained as follows:
[0016]
[0017] In the formula: k = max(d i -1)τ i +1,max(d i -1)τ i +2,…,N; According to Takens' embedding theorem, if d or d i If it is large enough, the expression for d is:
[0018]
[0019] Then there exists a deterministic mapping F:R d →R d F is a smooth function in d-dimensional space that satisfies:
[0020] P k+1 =F(P k (4)
[0021] The CC method is used to simultaneously determine the embedding dimension and delay time;
[0022] In obtaining the statistic and S cor (τ i After that, the optimal delay time is The τ corresponding to the first local minimum point i , will S cor (τ i The minimum value of τ corresponds to i Let τ' be the optimal delay window i Then according to τ' i =(d i -1)τ i Calculate the optimal embedding dimension d i .
[0023] In some embodiments of this application, in step 3, HBA (honey badger algorithm) is a swarm intelligence optimization algorithm proposed by simulating the foraging behavior of honey badgers. When searching for prey, honey badgers go through two stages. The first stage is the "digging stage," where honey badgers use scent to continuously approach prey, dig for its location, and capture it. The second stage is the "honey gathering stage," where honey badgers, guided by honeyguide birds, successfully locate the food source, which includes:
[0024] Initialization phase
[0025] The population size (Q) of honey badgers is initialized as follows:
[0026] X i =lb i +r1×(ub i -lb i (9)
[0027] In the formula: ub i and lb i These are the upper and lower bounds of the search space, respectively, X. i Let r1 be the position of the i-th honey badger in population Q, and r1 be a random number between 0 and 1.
[0028] Define olfactory intensity
[0029] Honey badger's sense of smell intensity I i Influenced by the distance between it and its prey and the intensity of the prey's scent, I i The larger the size, the faster the honey badger moves, and vice versa, as shown in the following formula:
[0030]
[0031] In the formula: r2 is a random number between 0 and 1, X prey The optimal location for the prey currently identified is given by s, where s is the odor intensity of the prey, and l is the odor intensity of the prey. i Let be the distance between the prey and the i-th badger;
[0032] Density factor
[0033] The density factor ψ reflects the uncertainty that evolves over time during the search process, ensuring a smooth transition from exploration to mining. As the number of iterations increases, the value of ψ decreases, thereby reducing the uncertainty that changes over time during the search process. See the following formula for details:
[0034]
[0035] In the formula: t and t max These represent the current iteration number and the maximum iteration number, respectively, where C ≥ 1, and is usually set to 2;
[0036] Excavation stage
[0037] During the excavation phase, the honey badger's movement pattern is shown in the following formula:
[0038] X new =X prey +λ×β×I×X prey +λ×r3×ψ×l i ×|cos(2πr4)×[1-cos(2πr5)]| (12)
[0039] In the formula: β represents the honey badger's ability to obtain food, β≥1 (usually set to 6), r3, r4, and r5 are three distinct random numbers between 0 and 1, and λ is the interference factor, expressed as follows:
[0040]
[0041] In the formula: r6 is a random number between 0 and 1;
[0042] During the excavation phase, the intensity of the honey badger's scent s and the distance l between the honey badger and its prey are considered. i And the effect of the density factor ψ changing over time.
[0043] Honey collection stage
[0044] The movement of a honey badger following a honeyguide bird in search of prey can be represented by the following formula:
[0045] X new =X prey +λ×r7×ψ×l i (14)
[0046] In the formula: r7 is a random number between 0 and 1, X new The updated location for the honey badger.
[0047] During the honey-collecting phase, the honey badger's search process is affected by the interference factor λ and the density factor ψ.
[0048] In some embodiments of this application, step 3, IHBA (Improved Honey Badger Algorithm), includes:
[0049] Kent Chaotic Map Population Initialization
[0050] Using the Kent chaotic map for population initialization maps the initial population to a chaotic sequence, resulting in a more uniform distribution of the population in the search space. Its mathematical model is shown below:
[0051]
[0052] In the formula: a∈(0,1), represents the control parameter, E i This represents the Kent mapping value for the current iteration.
[0053] Then, the chaotic sequence is mapped to the corresponding solution space using formula (7) to generate the initial population individuals.
[0054] X i =lb i +E i ×(ub i -lb i(16)
[0055] Improved density factor
[0056] The density factor affects the balanced layout of the honey badger's digging and honey-gathering stages. To balance the exploratory and developmental aspects of the algorithm, the improved density factor formula is as follows:
[0057]
[0058] In the formula: rand is a random number in [0,1], and ψ' is the improved density factor;
[0059] Pinhole imaging reverse learning strategy
[0060] To address the issue that the HBA algorithm is prone to getting stuck in local optima, a pinhole imaging reverse learning strategy is adopted to obtain the reverse solution of the current optimal solution, thereby increasing the range of the solution space and enhancing the algorithm's ability to escape local optima.
[0061] Based on the principle of pinhole imaging:
[0062]
[0063] Where h is the image height, the height of the image on the imaging screen; H is the height of the actual object; X prey X' represents the current optimal solution (the prey position in the honey badger algorithm); prey This is the inverse solution (a new solution generated through the pinhole imaging principle).
[0064] Let the adjustment factor θ = h / H, then we get X' prey The expression:
[0065]
[0066] After updating the solution using the pinhole imaging back-learning strategy, a greedy rule is introduced to compare the fitness values of the solutions before and after back-learning and select the best one to retain. The greedy rule is shown in the formula:
[0067]
[0068] In the formula: f(X) prey ) is X prey The fitness value, f(X') prey ) is X' prey The fitness value.
[0069] In some embodiments of this application, the IHBA algorithm flow is as follows:
[0070] Step 3.1: Initialize IHBA algorithm parameters: population size Q, upper and lower bounds of the search space ub i lbi Maximum number of iterations t max ;
[0071] Step 3.2: Initialize the population using the Kent map, calculate the fitness value of each individual, and save the initial optimal individual and its position;
[0072] Step 3.3: Determine I using formula (13) i Update ψ using formula (19);
[0073] Step 3.4: If the random number between (0,1) is less than 0.5, update the population position according to formula (18); otherwise, update the population position using formula (17).
[0074] Step 3.5: Recalculate the fitness value of each individual and record the current optimal individual position, and perform pinhole imaging reverse learning according to Equation (12);
[0075] Step 3.6: Calculate the updated fitness value and select the best candidates to retain based on the greedy strategy;
[0076] Step 3.7: Determine if the maximum number of iterations has been reached. If so, output the globally optimal individual and its position. Otherwise, jump to step 3.3 until the iteration ends.
[0077] In some embodiments of this application, step 4 introduces an attention mechanism into the BiGRU network. Specifically, the core structure of the BiGRU neural network consists of two GRU layers, which are responsible for processing the forward and reverse information of the sequence respectively. The outputs of these two GRU layers are weighted and merged to form the final sequence representation. This structure can capture information from both directions in the input sequence, thereby improving the performance of the model. The calculation formula is as follows:
[0078]
[0079] In the formula, and These represent the output values of the GRU forward and backward hidden layers at time points W and V, respectively, where W is the forward weight coefficient, V is the backward weight coefficient, and b is the output value of the GRU forward and backward hidden layers at time points V and V, respectively. t These are bias parameters;
[0080] An attention mechanism is introduced into the BiGRU network. Let the output state matrix of the BiGRU network be H = [h1, h2, ..., h...]. m ], where m is the number of vectors in the state matrix that need to be weighted; the attention layer is calculated as follows:
[0081] s(h i ,h q ) = vtanh(uhi +wh q (6)
[0082]
[0083] In the formula: s(h i ,h q Let h be the attention scoring function. i h represents the hidden state at the current moment. q α represents the state representation in the input state vector that is relevant to the current task. i Let y be the attention weight for the i-th input information, softmax represents the activation function, v, u, and w represent the weight coefficients, and y be the output value of the attention layer.
[0084] In some embodiments of this application, in step 4, the hyperparameters of the BiGRU network, such as the number of hidden layer neurons and the learning rate, are optimized using IHBA. Historical load data is input and the hidden state sequence is output. Attention weighting: the weights of each time step are calculated to highlight key periods (such as peak electricity consumption). Prediction output: the fully connected layer maps the context vector to the predicted value (such as the load in the next 24 hours).
[0085] In some embodiments of this application, step 5 selects the root mean squared error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R-squared, R0). 2 The model performance is evaluated.
[0086] Among them, the smaller the RMSE, MAE, and MAPE, the closer the model's predicted value is to the true value, and the higher the model's prediction accuracy. 2 The closer R is to 1, the better the model fit. 2 The closer the value is to 0, the worse the fit. The calculation formulas for each model are as follows:
[0087]
[0088]
[0089] In the formula, N is the number of samples in the test set, and y i This represents the actual value corresponding to sample point i. Let i be the predicted value corresponding to sample point i. This represents the average value of the sample points.
[0090] Compared with existing short-term power load forecasting methods, this application has at least the following advantages:
[0091] (1) The BiGRU model can effectively handle the temporal nature of load data, while mining the hidden information contained in the past and future of the time series. Combined with the Attention mechanism, it can improve the model's ability to capture key information and further improve the model's prediction accuracy.
[0092] (2) Compared with other optimization algorithms, IHBA has the best effect on hyperparameter optimization of BiGRU model and can improve the prediction performance of the model to the greatest extent.
[0093] (3) By comparing with other models, the model proposed in this application shows significant superiority on two public datasets and one measured dataset, which can effectively improve the accuracy of load forecasting and reduce forecasting error. Attached Figure Description
[0094] The accompanying drawings, which are provided to further illustrate this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application.
[0095] Figure 1 This is a schematic diagram of the BiGRU structure in some embodiments of this application;
[0096] Figure 2 This is a schematic diagram illustrating the reverse learning principle of pinhole imaging in some embodiments of this application;
[0097] Figure 3 This is a schematic diagram of the IHBA algorithm flow in some embodiments of this application.
[0098] Figure 4 Data for datasets in some embodiments of this application: (a) dataset one, (b) dataset two;
[0099] Figure 5 The results of Spearman correlation analysis in some embodiments of this application;
[0100] Figure 6 These are prediction curves for different optimization algorithms in some embodiments of this application;
[0101] Figure 7 This is a prediction curve of ablation experiments in some embodiments of this application;
[0102] Figure 8 The prediction curves are used to demonstrate the engineering application of the model in some embodiments of this application. Detailed Implementation
[0103] The technical solution of this application will be clearly and completely described below with reference to the accompanying drawings and specific embodiments. However, those skilled in the art will understand that the embodiments described below are some embodiments of this application, but not all embodiments, and are only used to illustrate this application, and should not be regarded as limiting the scope of this application.
[0104] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0105] This application provides a short-term power load forecasting method, including the following steps:
[0106] Step 1. Feature Selection: Optimization of Influencing Factors and Construction of Multivariate Time Series for Power Load Data. Historical power load data and its influencing factor data are selected. The algorithm selects influencing factors with strong correlation to power load and constructs a multivariate time series for power load forecasting.
[0107] Step 2. Multivariate phase space reconstruction: The delay time and embedding dimension of each time series are calculated using the CC method to obtain the reconstructed multivariate phase space;
[0108] Step 3. Improvements from HBA to IHBA: To enrich the diversity of solutions, the honey badger population is initialized using Kent chaotic mapping; to balance the digging and honey-collecting stages, the density factor is improved; to avoid the algorithm getting trapped in local optima and to improve its resistance to local extrema, a pinhole imaging reverse learning strategy is introduced.
[0109] Step 4. Construct the prediction model: Optimize the hyperparameters of the BiGRU network using IHBA, and construct the IHBA-BiGRU-Attention prediction model by combining it with the attention mechanism.
[0110] Step 5. Evaluation of indicators: Use one of the following indicators to evaluate the accuracy of the prediction model: root mean square error, mean absolute error, mean absolute percentage error, and coefficient of determination.
[0111] In some embodiments of this application, feature selection involves choosing influencing factors that are highly correlated with power load data. This requires quantitative correlation analysis between these influencing factors and the load data. This application uses the Spearman correlation coefficient method for correlation analysis, and the calculation formula is as follows:
[0112]
[0113] In the formula, ρ is the Spearman correlation coefficient, ranging from -1 to 1. n is the number of samples in each variable, and d...i ρ represents the rank difference between corresponding data points of two variables. The larger the value of ρ, the stronger the correlation between the variables.
[0114] In some embodiments of this application, multivariate phase space reconstruction (MPSR) can reconstruct a historical sequence into a low-order nonlinear dynamic system, deeply exploring the evolutionary patterns of the system, thereby accurately identifying historical moments highly correlated with the prediction time. M-dimensional multivariate time series {x} i The sequence {i = 1, 2, ..., M} contains the time series of electricity load x1 and its e influencing factor sequences x2, x3, ..., x e+1 Where x i =[x i (1),x i (2),…,x i [(N)], where N is the length of the time series. For a univariate time series x i Find the delay time τ i and embedding dimension d i Then, the phase space of the M-dimensional multivariate time series can be obtained as follows:
[0115]
[0116] In the formula: k = max(d i -1)τ i +1,max(d i -1)τ i +2,…,N. According to Takens' embedding theorem, if d or dn i If it is large enough, the expression for d is:
[0117]
[0118] Then there exists a deterministic mapping F:R d →R d F is a smooth function in d-dimensional space that satisfies:
[0119] P k+1 =F(P k (4)
[0120] As can be seen from the above, the values of the embedding dimension d and the delay time τ for each time series are crucial. This application uses the CC method to determine the embedding dimension and delay time simultaneously.
[0121] In obtaining the statistic and S cor (τ i After that, the optimal delay time is The τ corresponding to the first local minimum point i , will S cor (τi The minimum value of τ corresponds to i Let τ' be the optimal delay window i Then according to τ' i =(d i -1)τ i Calculate the optimal embedding dimension d i .
[0122] In some embodiments of this application, the core structure of the BiGRU neural network consists of two GRU layers, each responsible for processing the forward and reverse information of the sequence. The outputs of these two GRU layers are weighted and merged to form the final sequence representation. This structure can capture information from both the forward and reverse directions of the input sequence, thereby improving the model's performance. The calculation formula is as follows:
[0123]
[0124] In the formula, and These represent the output values of the GRU forward and backward hidden layers at time points W and V, respectively, where W is the forward weight coefficient, V is the backward weight coefficient, and b is the output value of the GRU forward and backward hidden layers at time points V and V, respectively. t The bias parameter has the following structure: Figure 1 As shown.
[0125] In some embodiments of this application, by introducing an attention mechanism into the BiGRU network, the model can dynamically focus on other elements most relevant to the current task when processing each sequence element, thereby improving the model's predictive performance. Let the output state matrix of the BiGRU network be H = [h1, h2, ..., h...]. m ], where m is the number of vectors in the state matrix that need to be assigned weights. The attention layer is calculated as follows:
[0126] s(h i ,h q ) = vtanh(uh i +wh q (6)
[0127]
[0128] In the formula: s(h i ,h q Let h be the attention scoring function. i h represents the hidden state at the current moment. q α represents the state representation in the input state vector that is relevant to the current task. i Let y be the attention weight for the i-th input information, softmax represents the activation function, v, u, and w represent the weight coefficients, and y be the output value of the attention layer.
[0129] In some embodiments of this application, the honey badger algorithm (HBA) is a swarm intelligence optimization algorithm proposed by simulating the foraging behavior of honey badgers. When searching for prey, honey badgers go through two stages. The first stage is the "digging stage," in which honey badgers continuously approach prey by scent, digging to locate and capture the prey. The second stage is the "honey-gathering stage," in which honey badgers successfully locate food sources with the help of honeyguide birds.
[0130] Initialization phase
[0131] The population size (Q) of honey badgers is initialized as follows:
[0132] X i =lb i +r1×(ub i -lb i (9)
[0133] In the formula: ub i and lb i These are the upper and lower bounds of the search space, respectively, X. i Let r1 be the position of the i-th honey badger in population Q, and r1 be a random number between 0 and 1.
[0134] Define olfactory intensity
[0135] Honey badger's sense of smell intensity I i Influenced by the distance between it and its prey and the intensity of the prey's scent, I i The larger the value, the faster the honey badger moves, and vice versa. The specific formula is as follows:
[0136]
[0137] In the formula: r2 is a random number between 0 and 1, X prey The optimal location for the prey currently identified is given by s, where s is the odor intensity of the prey, and l is the odor intensity of the prey. i Let be the distance between the prey and the i-th badger.
[0138] Density factor
[0139] The density factor ψ reflects the uncertainty that evolves over time during the search process, ensuring a smooth transition from exploration to mining. As the number of iterations increases, the value of ψ decreases, thereby reducing the uncertainty that changes over time during the search process. This is illustrated in the following equation:
[0140]
[0141] In the formula: t and t max These represent the current iteration number and the maximum iteration number, respectively, with C ≥ 1 (usually set to 2).
[0142] Excavation stage
[0143] During the excavation phase, the honey badger's movement pattern is shown in the following formula:
[0144] X new =X prey +λ×β×I×X prey +λ×r3×ψ×l i ×|cos(2πr4)×[1-cos(2πr5)]| (12)
[0145] In the formula: β represents the honey badger's ability to obtain food, β≥1 (usually set to 6), r3, r4, and r5 are three distinct random numbers between 0 and 1, and λ is the interference factor, expressed by the following formula:
[0146]
[0147] In the formula: r6 is a random number between 0 and 1.
[0148] During the excavation phase, the intensity of the honey badger's scent s and the distance l between the honey badger and its prey are considered. i And the effect of the density factor ψ changing over time.
[0149] Honey collection stage
[0150] The movement of a honey badger following a honeyguide bird in search of prey can be represented by the following formula:
[0151] X new =X prey +λ×r7×ψ×l i (14)
[0152] In the formula: r7 is a random number between 0 and 1, X new The updated location for the honey badger.
[0153] During the honey-collecting phase, the honey badger's search process is affected by the interference factor λ and the density factor ψ.
[0154] In some embodiments of this application, the improved honey badger algorithm includes:
[0155] Kent Chaotic Map Population Initialization
[0156] The HBA algorithm randomly initializes the honey badger positions in space, which can easily lead to problems such as lack of population diversity and uneven distribution. To solve this problem, Kent's chaotic map is used for population initialization; it maps the initial population to a chaotic sequence, resulting in a more even distribution of the population in the search space. Its mathematical model is as follows:
[0157]
[0158] In the formula: a∈(0,1), represents the control parameter, E i This represents the Kent mapping value for the current iteration.
[0159] Then, the chaotic sequence is mapped to the corresponding solution space using formula (7) to generate the initial population individuals.
[0160] X i =lb i +E i ×(ub i -lb i (16)
[0161] Improved density factor
[0162] The density factor is a crucial parameter that influences the balanced layout of the honey badger during the digging and foraging phases. To better balance the exploratory and exploitative aspects of the algorithm, this application improves upon the original formula. The specific formula is shown below:
[0163]
[0164] In the formula: rand is a random number in [0,1], and ψ' is the improved density factor.
[0165] The improved density factor will better position the key components of the algorithm, allowing for a balance between the mining and harvesting phases.
[0166] Pinhole imaging reverse learning strategy
[0167] To address the issue of the HBA algorithm easily getting trapped in local optima, this application employs a pinhole imaging back-learning strategy to obtain the reverse solution of the current optimal solution, thereby increasing the range of the solution space and enhancing the algorithm's ability to escape local optima. The principle of pinhole imaging is as follows: Figure 2 As shown, based on the principle of pinhole imaging, we can conclude that:
[0168]
[0169] Where h is the image height, the height of the image on the imaging screen; H is the height of the actual object; X prey X' represents the current optimal solution (the prey position in the honey badger algorithm); prey This is the inverse solution (a new solution generated through the pinhole imaging principle); l b and u b These are the lower and upper bounds of the search space.
[0170] Let the adjustment factor θ = h / H, then we get X' prey The expression:
[0171]
[0172] After updating the solution using the pinhole imaging back-learning strategy, a greedy rule is introduced to compare the fitness values of the solutions before and after back-learning and select the best one to retain. The greedy rule is shown in the formula:
[0173]
[0174] In the formula: f(X) prey ) is X prey The fitness value, f(X') prey ) is X' prey The fitness value.
[0175] Based on the three improvement strategies introduced above, the flowchart of the IHBA algorithm proposed in this paper is as follows: Figure 3 As shown, it includes:
[0176] Step 4.1: Initialize IHBA algorithm parameters: population size Q, upper and lower bounds of the search space ub i lb i Maximum number of iterations t max wait.
[0177] Step 4.2: Initialize the population using the Kent map, calculate the fitness value of each individual, and save the initial optimal individual and its position.
[0178] Step 4.3: Determine I using formula (13) i Update ψ using formula (19).
[0179] Step 4.4: If the random number between (0,1) is less than 0.5, update the population position according to formula (18); otherwise, update the population position using formula (17).
[0180] Step 4.5: Recalculate the fitness value of each individual and record the current optimal individual position, and perform pinhole imaging reverse learning according to Equation (12).
[0181] Step 4.6: Calculate the updated fitness value and select the best to retain based on the greedy strategy.
[0182] Step 4.7: Determine if the maximum number of iterations has been reached. If so, output the globally optimal individual and its position; otherwise, jump to step 4.3 until the iteration ends.
[0183] In some embodiments of this application, IHBA is compared with the standard HBA algorithm, the Butterfly Optimization Algorithm (BOA), and the Slime Mold Algorithm (SMA). Five benchmark functions are used to evaluate the performance of IHBA, as shown in Table 1. F1, F2, and F3 are unimodal benchmark functions, while F4 and F5 are multimodal benchmark functions. The value ranges and optimal solutions of the five benchmark functions are shown in the table. The algorithm parameters are given in Table 2, with a population size of 30 and 500 iterations. The experimental environment is a Win11 operating system, based on a hardware platform with an Intel Core i5-12400F processor, 16GB of memory, and an NVIDIA GeForce RTX4060 graphics card. The compiler is [compiler name missing].
[0184] MATLAB 2024b.
[0185] Table 1 Benchmark Functions
[0186]
[0187] Table 2 Parameter Settings
[0188]
[0189] This application conducted numerical experiments on a 30-dimensional search space, and the experimental results are shown in Table 3. Analysis of the optimal value data in Table 1 reveals that the optimal values found by the IHBA algorithm for unimodal functions F1, F3, and multimodal functions F5 are closer to the theoretical optimal values than those found by the other three algorithms. For unimodal functions F2 and multimodal functions F4, the IHBA optimization algorithm directly finds the theoretical optimal value of the function. Although the SMA and HBA algorithms also find the theoretical optimal value of the function in F4, their performance in other test functions is not as good. This indicates that the Kent chaotic mapping, improved density factor, and pinhole imaging reverse learning strategy are effective improvements to the HBA algorithm. Their improvements in population diversity, the balance between the mining and harvesting stages, and how to avoid local optima enhance the algorithm's optimization performance.
[0190] Table 3 Comparison of test results for the 30-dimensional benchmark test function
[0191]
[0192] In some embodiments of this application, to better evaluate model parameters, the root mean squared error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R-squared, R0) are selected. 2 The model performance is evaluated using metrics such as RMSE, MAE, and MAPE. The smaller the RMSE, MAE, and MAPE values, the closer the model's predicted values are to the true values, and the higher the model's prediction accuracy. 2 The closer R is to 1, the better the model fit. 2 The closer the value is to 0, the worse the fit. The calculation formulas for each model are as follows:
[0193]
[0194] In the formula, N is the number of samples in the test set, and y i This represents the actual value corresponding to sample point i. Let i be the predicted value corresponding to sample point i. This represents the average value of the sample points.
[0195] In some embodiments of this application, historical data from a region in Singapore from June 1, 2008 to October 28, 2008 (Dataset 1) and from New South Wales, Australia from January 1, 2009 to March 31, 2009 (Dataset 2) were selected. Dataset 1 was sampled at 1-hour intervals, 24 times per day, and included historical power load data and corresponding data on external influencing factors such as temperature, humidity, wind speed, air pressure, and electricity price, totaling 3600 data sets. Dataset 2 was sampled at 30-minute intervals, 48 times per day, and included historical power load data and corresponding data on external influencing factors such as dry-bulb temperature, dew point temperature, wet-bulb temperature, humidity, and electricity price, totaling 4320 data sets. Datasets 1 and 2 were allocated to the training set, validation set, and test set in an 8:1:1 ratio. The unit for power load values was MW. The data from Datasets 1 and 2 are as follows: Figure 4 As shown.
[0196] To eliminate dimensional differences between different data sources, data normalization is necessary. The maximum and minimum normalization formulas are as follows:
[0197]
[0198] In the formula, x i For the original time series, x max x min Represents the maximum and minimum values in this time series. This is the time series after normalization.
[0199] In some embodiments of this application, in order to more effectively screen out influencing factors that are highly correlated with power load and at the same time reduce the dimensionality of input features, the power load and its influencing factors are analyzed according to equation (1), and the results are as follows: Figure 5 As shown. According to Figure 5 This application selects influencing factors with an absolute value of correlation coefficient with power load greater than 0.5 as input variables for modeling and prediction, ensuring that the selected influencing factors have a strong correlation with power load, thereby improving the accuracy of load forecasting.
[0200] In some embodiments of this application, by Figure 4 It can be seen that in dataset 1, temperature, humidity, wind speed, and electricity price are selected to form a 5-dimensional multivariate time series with the power load series. In dataset 2, dry-bulb temperature, wet-bulb temperature, and electricity price are selected to form a 4-dimensional multivariate time series with the power load series. The CC method is used to calculate the delay time i and the embedding dimension d. i The results are shown in Tables 4 and 5.
[0201] Table 4 shows the delay time and embedding dimension of the feature time series in Dataset 1.
[0202]
[0203] Table 5 shows the delay time and embedding dimension of the feature time series in Dataset 2.
[0204]
[0205]
[0206] In some embodiments of this application, in order to verify the prediction performance of the BiGRU model, SVM, ELM, LSTM and GRU were selected as comparison models, and the evaluation indexes of each model are shown in Table 6.
[0207] Table 6 Prediction Indicators of Single-Model Comparison Experiment
[0208]
[0209] As shown in the table, in Dataset 1, compared with SVM, ELM, LSTM, and GRU, BiGRU reduced RMSE by 23.504%, 19.123%, 10.354%, and 6.607%, respectively; MAE by 20.820%, 17.275%, 10.127%, and 6.555%, respectively; and MAPE by 0.840%, 0.667%, 0.359%, and 0.221%, respectively. R 2These improvements were 6.7%, 5.0%, 2.3%, and 1.4%, respectively. In dataset two, BiGRU also demonstrated the best prediction performance, with an RMSE of 438.395MW, a MAE of 368.585MW, a MAPE of 4.499%, and an R² score of [missing value]. 2 The value was 0.904, which is better than other comparative models. This demonstrates that the BiGRU model has scalability.
[0210] In some embodiments of this application, in order to fully test the performance of different optimization algorithm models in short-term load forecasting, this application sets up a comparative experiment of BOA, SMA and HBA optimization algorithms under the condition that other conditions remain unchanged, and optimizes the initial learning rate, number of hidden layer neurons and regularization parameters of BiGRU. The population size is set to 10 and the maximum number of iterations is set to 50. The optimization range of each parameter is shown in Table 7, and the optimization results of each algorithm for BiGRU hyperparameters are shown in Table 8.
[0211] Table 7. Optimization Range of BiGRU Hyperparameters
[0212]
[0213]
[0214] Table 8 Optimization results of each optimization algorithm
[0215]
[0216] The optimal hyperparameter values found by the four optimization algorithms through training were then substituted into the prediction model for prediction, and the prediction results were as follows: Figure 6 As shown in Table 9, the evaluation indicators are as follows.
[0217] As can be seen from the prediction curves, the MPSR-IHBA-BiGRU-Attention model performs the best. As shown in the figure, the prediction curve of this model is the best match with the actual load curve, and it can accurately fit the power load sequence value, demonstrating superior prediction performance.
[0218] Table 9 Evaluation metrics for different optimization algorithms
[0219]
[0220] Table 9 shows that, in Dataset 1, when optimizing the model, IDBO reduced RMSE by 44.739% and 36.536% respectively, MAE by 48.056% and 40.4105% respectively, and MAPE by 0.623% and 0.459% respectively, compared to BOA and SMA. Meanwhile, R... 2These figures represent improvements of 1.7% and 1.2% respectively, demonstrating the superior performance of the IHBA algorithm in reducing prediction error and improving model fit. Compared to the HBA algorithm, IHBA also exhibits significant performance improvements, with RMSE reduced by 26.118%, MAE by 34.438%, MAPE by 0.352%, and R... 2 This represents a 0.7% improvement, demonstrating the effectiveness of the chaotic initialization, the improved density factor, and the pinhole imaging back-learning strategy in the IHBA algorithm. In Dataset 2, the model achieved an RMSE of 136.441MW, a MAE of 87.668MW, a MAPE of 1.067%, and R0. 2 The value is 0.991, maintaining its leading position. These data demonstrate that the IHBA algorithm can significantly improve prediction accuracy and exhibit superior fitting performance when optimizing model parameters.
[0221] In some embodiments of this application, to evaluate the specific contribution of each component in the model to the overall prediction performance, ablation experiments were conducted using a consistent experimental environment, dataset, and model parameter settings. Based on the overall model, the following models were proposed: (1) an MPSR-BiGRU-Attention model without IHBA; (2) an IHBA-BiGRU-Attention model without MPSR; and (3) an MPSR-IHBA-BiGRU model without an Attention mechanism. The prediction result curves are shown in the figure. Table 10 lists the performance on datasets one and two after removing different components of the model.
[0222] from Figure 7 In terms of the smoothness and trend consistency of the prediction curve, the MPSR-IHBA-BiGRU-Attention model is quite accurate in predicting both peaks and troughs, and the overall trend is consistent without any obvious deviations or fluctuations.
[0223] Table 10 Evaluation Indicators for Ablation Experiments
[0224]
[0225] Table 10 shows that after removing the IHBA optimization algorithm, the RMSE, MAE, and MAPE of both datasets 1 and 2 increased significantly, and the goodness of fit R... 2 The significant decrease indicates that IHBA plays a crucial role in optimizing BiGRU model parameters and improving prediction accuracy. After removing the MPSR module, prediction performance decreased, while RMSE, MAE, and MAPE increased, and R... 2The decrease demonstrates that MPSR can fully exploit the temporal coupling relationship between power load and strong influencing factors, thereby improving the accuracy of the load forecasting model. The removal of the Attention mechanism also led to a decrease in prediction performance, indicating that introducing the Attention mechanism allows the model to dynamically and selectively focus on information at different locations based on the relevance of the input, improving the model's ability to capture key information and thus enhancing its prediction performance.
[0226] In some embodiments of this application, to further verify the generalization ability of the proposed model, this model is applied to the prediction of regional power load data in China. The data comes from multidimensional power load data of a region in southern China from April 1, 2024 to May 15, 2024 (45 days in total), including power load data and corresponding data on external influencing factors such as average temperature, maximum temperature, minimum temperature, humidity, and ground wind speed. The sampling period is 15 minutes, with 96 sets of data collected daily. The dataset is allocated to the training set, validation set, and test set in an 8:1:1 ratio. The prediction result curve is shown below. Figure 8 As shown in Table 11, the evaluation indicators are as follows.
[0227] Table 11 Prediction Errors of Different Models
[0228]
[0229] As can be seen from the table, the RMSE of the model proposed in this application is reduced by 70.219%, 67.262%, and 61.894% respectively compared with other models; the MAE is reduced by 76.076%, 74.057%, and 68.567% respectively; and the MAPE is reduced by 5.006%, 4.552%, and 3.394% respectively. 2 The accuracy rates were improved by 6.7%, 5.4%, and 3.8% respectively, demonstrating that the model proposed in this application has superior predictive performance and generalization ability.
[0230] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these fall within the scope of protection of this application. Therefore, the scope of protection of this patent application should be determined by the appended claims.
Claims
1. A short-term power load forecasting method, characterized in that, Includes the following steps: Step 1. Feature Selection: Optimization of Influencing Factors and Construction of Multivariate Time Series for Power Load Data. Historical power load data and its influencing factor data are selected. The algorithm selects influencing factors with strong correlation to power load and constructs a multivariate time series for power load forecasting. Step 2. Multivariate phase space reconstruction: The delay time and embedding dimension of each time series are calculated using the CC method to obtain the reconstructed multivariate phase space; Step 3. Improvements from HBA to IHBA: To enrich the diversity of solutions, the honey badger population is initialized using Kent chaotic mapping; to balance the digging and honey-collecting stages, the density factor is improved; to avoid the algorithm getting trapped in local optima and to improve its resistance to local extrema, a pinhole imaging reverse learning strategy is introduced. Step 4. Optimize the hyperparameters of the BiGRU network using IHBA, and construct the IHBA-BiGRU-Attention prediction model by combining it with the attention mechanism; Step 5. Evaluation of indicators: Use one of the following indicators to evaluate the accuracy of the prediction model: root mean square error, mean absolute error, mean absolute percentage error, and coefficient of determination.
2. The short-term power load forecasting method according to claim 1, characterized in that, The feature selection in step 1 specifically involves: performing correlation analysis using the Spearman correlation coefficient method, with the following calculation formula: In the formula, ρ is the Spearman correlation coefficient, ranging from -1 to 1; n is the number of samples in each variable; and d... i ρ represents the rank difference between corresponding data points in two variables; the larger the ρ is, the stronger the correlation between the variables.
3. The short-term power load forecasting method according to claim 1, characterized in that, The multivariate phase space reconstruction in step 2 specifically involves: using MPSR to reconstruct the historical sequence into a low-order nonlinear dynamic system, identifying historical moments highly correlated with the prediction time; the M-dimensional multivariate time series {x} i Let {i = 1, 2, ..., M} contain the time series of electricity load x1 and its e influencing factor sequences x2, x3, ..., x e+1 ;where x i =[x i (1),x i (2),…,x i [(N)], where N is the length of the time series; for a univariate time series x i Find the delay time τ i and embedding dimension d i Then, the phase space of the M-dimensional multivariate time series can be obtained as follows: In the formula: k = max(d i -1)τ i +1,max(d i -1)τ i +2,…,N; According to Takens' embedding theorem, if d or d i If it is large enough, the expression for d is: Then there exists a deterministic mapping F:R d →R d F is a smooth function in d-dimensional space that satisfies: The CC method is used to simultaneously determine the embedding dimension and delay time; In obtaining the statistic and S cor (τ i After that, the optimal delay time is The τ corresponding to the first local minimum point i , will S cor (τ i The minimum value of τ corresponds to i Let τ' be the optimal delay window i Then according to τ' i =(d i -1)τ i Calculate the optimal embedding dimension d i .
4. The short-term power load forecasting method according to claim 1, characterized in that, In step 3, the Honey Badger Algorithm (HBA) is a swarm intelligence optimization algorithm proposed by simulating the foraging behavior of honey badgers. When searching for prey, the honey badger goes through two stages: the first stage is the "digging stage," where the honey badger uses scent to continuously approach the prey, digging to locate and capture it; the second stage is the "honey-gathering stage," where the honey badger, guided by honeyguide birds, successfully locates the food source, which includes: Initialization phase The initial population of honey badgers, their population size Q, and their respective locations are as follows: X i =lb i +r1×(ub i -lb i ) (9) In the formula: ub i and lb i These are the upper and lower bounds of the search space, respectively, X. i Let r1 be the position of the i-th honey badger in population Q, and r1 be a random number between 0 and 1. Define olfactory intensity Honey badger's sense of smell intensity I i Influenced by the distance between it and its prey and the intensity of the prey's scent, I i The larger the size, the faster the honey badger moves, and vice versa, as shown in the following formula: In the formula: r2 is a random number between 0 and 1, X prey The optimal location for the prey currently identified is given by s, where s is the odor intensity of the prey, and l is the odor intensity of the prey. i Let be the distance between the prey and the i-th badger; Density factor The density factor ψ reflects the uncertainty that evolves over time during the search process, ensuring a smooth transition from exploration to mining. As the number of iterations increases, the value of ψ decreases, thereby reducing the uncertainty that changes over time during the search process. See the following formula for details: In the formula: t and t max Let C represent the current iteration number and the maximum iteration number, respectively, where C ≥ 1; Excavation stage During the excavation phase, the honey badger's movement pattern is shown in the following formula: X new =X prey +λ×β×I×X prey +λ×r3×ψ×l i ×|cos(2πr4)×[1-cos(2πr5)]| (12) In the formula: β represents the honey badger's ability to obtain food, β≥1, r3, r4, and r5 are three distinct random numbers between 0 and 1, and λ is the interference factor, expressed as follows: In the formula: r6 is a random number between 0 and 1; During the excavation phase, the intensity of the honey badger's scent s and the distance l between the honey badger and its prey are considered. i And the effect of the density factor ψ changing over time; Honey collection stage The movement of a honey badger following a honeyguide bird in search of prey can be represented by the following formula: X new =X prey +λ×r7×ψ×l i (14) In the formula: r7 is a random number between 0 and 1, X new Updated location for the honey badger; During the honey-collecting phase, the honey badger's search process is affected by the interference factor λ and the density factor ψ.
5. The short-term power load forecasting method according to claim 4, characterized in that, In step 3, the improved honey badger algorithm IHBA includes: Kent Chaotic Map Population Initialization Using the Kent chaotic map for population initialization maps the initial population to a chaotic sequence, resulting in a more uniform distribution of the population in the search space; its mathematical model is shown below: In the formula: a∈(0,1), represents the control parameter, E i This represents the Kent mapping value for the current iteration; Then, the chaotic sequence is mapped to the corresponding solution space using formula (7) to generate the initial population individuals; X i =lb i +E i ×(ub i -lb i ) (16) Improved density factor The density factor affects the balanced layout of the honey badger's digging and honey-gathering stages. To balance the exploratory and developmental aspects of the algorithm, the improved density factor formula is as follows: In the formula: rand is a random number in [0,1], and ψ' is the improved density factor; Pinhole imaging reverse learning strategy To address the issue that the HBA algorithm is prone to getting stuck in local optima, a pinhole imaging reverse learning strategy is adopted to obtain the reverse solution of the current optimal solution, thereby increasing the range of the solution space and enhancing the algorithm's ability to escape local optima. Based on the principle of pinhole imaging: Where h is the image height, the height of the image on the imaging screen; H is the height of the actual object; X prey This is the current optimal solution; X' prey The solution is the reverse solution; Let the adjustment factor θ = h / H, then we get X' prey The expression: After updating the solution using the pinhole imaging back-learning strategy, a greedy rule is introduced to compare the fitness values of the solutions before and after back-learning and select the best one to retain. The greedy rule is shown in the formula: In the formula: f(X) prey ) is X prey The fitness value, f(X') prey ) is X' prey The fitness value.
6. The short-term power load forecasting method according to claim 5, characterized in that, The IHBA algorithm flow is as follows: Step 3.1: Initialize IHBA algorithm parameters: population size Q, upper and lower bounds of the search space ub i lb i Maximum number of iterations t max ; Step 3.2: Initialize the population using the Kent map, calculate the fitness value of each individual, and save the initial optimal individual and its position; Step 3.3: Determine I using formula (13) i Update ψ using formula (19); Step 3.4: If the random number between (0,1) is less than 0.5, update the population position according to formula (18); otherwise, update the population position using formula (17). Step 3.5: Recalculate the fitness value of each individual and record the current optimal individual position, and perform pinhole imaging reverse learning according to Equation (12); Step 3.6: Calculate the updated fitness value and select the best candidates to retain based on the greedy strategy; Step 3.7: Determine if the maximum number of iterations has been reached. If so, output the globally optimal individual and its position. Otherwise, jump to step 3.3 until the iteration ends.
7. The short-term power load forecasting method according to claim 1, characterized in that, In step 4, an attention mechanism is introduced into the BiGRU network. Specifically, the core structure of the BiGRU neural network consists of two GRU layers, which are responsible for processing the forward and reverse information of the sequence, respectively. The outputs of these two GRU layers are weighted and merged to form the final sequence representation. This structure can capture information from both directions in the input sequence, thereby improving the model's performance. The calculation formula is as follows: In the formula, and These represent the output values of the GRU forward and backward hidden layers at time points W and V, respectively, where W is the forward weight coefficient, V is the backward weight coefficient, and b is the output value of the GRU forward and backward hidden layers at time points V and V, respectively. t These are bias parameters; An attention mechanism is introduced into the BiGRU network. Let the output state matrix of the BiGRU network be H = [h1, h2, ..., h...]. m ], where m is the number of vectors in the state matrix that need to be weighted; the attention layer is calculated as follows: s(h i ,h q )=vtanh(uh i +wh q ) (6) In the formula: s(h i ,h q Let h be the attention scoring function. i h represents the hidden state at the current moment. q α represents the state representation in the input state vector that is relevant to the current task. i Let y be the attention weight for the i-th input information, softmax represents the activation function, v, u, and w represent the weight coefficients, and y be the output value of the attention layer.
8. The short-term power load forecasting method according to claim 1, characterized in that, In step 4, the hyperparameters of the BiGRU network are optimized using IHBA, historical load data is input, and the hidden state sequence is output; Attention weighting: the weights of each time step are calculated to highlight key time periods; Prediction output: the fully connected layer maps the context vector to the predicted value.
9. The short-term power load forecasting method according to claim 1, characterized in that, In step 5, the root mean square error, mean absolute error, mean absolute percentage error, and coefficient of determination are selected to evaluate the model performance. Among them, the smaller the RMSE, MAE, and MAPE, the closer the model's predicted value is to the true value, and the higher the model's prediction accuracy. 2 The closer R is to 1, the better the model fit. 2 The closer it is to 0, the worse the fit.
10. A short-term power load forecasting method according to claim 9, characterized in that, The calculation formulas for each model are as follows: In the formula, N is the number of samples in the test set, and y i This represents the actual value corresponding to sample point i. Let i be the predicted value corresponding to sample point i. This represents the average value of the sample points.