Short-term power load prediction method based on improved sparrow search algorithm optimization
By improving the CNN-LSTM-Attention model optimized by the sparrow search algorithm, the problem of insufficient adaptability of short-term power load prediction models in complex feature modeling and cross-scene cross-scene adaptability is solved, and higher prediction accuracy and cross-scene adaptability are achieved, and the operation efficiency of the power system is improved.
Patent Information
- Application Number
- CN202510453123.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-08-01
AI Technical Summary
The existing short-term power load prediction models have shortcomings in complex feature modeling and cross-scene adaptability. Traditional linear models are difficult to accurately characterize the dynamic evolution laws of loads. Deep learning methods have problems such as modeling limitations and high computational complexity.
The deformable convolutional neural network-long and short-term memory network-attention mechanism (CNN-LSTM-Attention) model optimized by improved sparrow search algorithm is adopted to improve the model's modeling accuracy and cross-scene prediction ability in different scenarios by adaptively adjusting the network structure and hyperparameters.
It improves the accuracy and generalization ability of short-term power load prediction, and enhances the operating efficiency and stability of the power system.
Smart Images

Figure BDA0005354688510000021 
Figure BDA0005354688510000022 
Figure BDA0005354688510000023
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of power system load forecasting and intelligent scheduling. Specifically, it involves a multi-scenario short-term power load forecasting method based on an improved Sparrow Search Algorithm to optimize the deformable CNN-LSTM-Attention model, which can be used to improve the accuracy and adaptability of load forecasting, thereby enhancing the operation efficiency and stability of the power system. Background Technique
[0002] Short-term power load forecasting is crucial for power grid scheduling, renewable energy consumption, and the stable operation of the power market. However, the load is affected by multiple factors such as meteorological fluctuations, seasonal changes, and social activities, showing non-linear and highly coupled characteristics. Traditional linear models are difficult to accurately depict its dynamic evolution law, resulting in limited prediction accuracy and difficulty in meeting the requirements of modern power systems.
[0003] Deep learning methods, such as Long Short-Term Memory (LSTM) and Convolutional Neural Network (CNN), have shown strong feature extraction capabilities in load forecasting, but there are still modeling limitations. Existing research mostly targets specific scenarios, with insufficient model generalization ability, difficulty in adapting to extreme climates and sudden load fluctuations, and affecting prediction stability. At the same time, single-feature modeling is difficult to comprehensively depict load dynamics, and the optimization method is limited to a specific environment with weak cross-regional adaptability, further restricting the actual application effect.
[0004] Existing improvement methods mainly include multi-model fusion and optimization strategies. The former combines the advantages of different models to improve prediction accuracy, but has high computational complexity and limited generalization ability; the latter improves the performance of a single model through hyperparameter optimization, but traditional optimization methods have high computational costs and are prone to falling into local optima, making it difficult to fully exploit the potential of the model.
[0005] As a swarm intelligence optimization method, the Sparrow Search Algorithm (SSA) has great application potential in optimizing deep learning models. However, its low search efficiency and easy entrapment in local optima limit the further improvement of load forecasting performance. Summary of the Invention
[0006] Aiming at the deficiencies of existing short-term electric load forecasting models in complex feature modeling and cross-scenario adaptability, this invention proposes a deformable convolutional neural network-long short-term memory network-attention mechanism (CNN-LSTM-Attention) model optimized by an improved sparrow search algorithm (ISSA). The deformability is reflected in dynamically adjusting the neural network structure and hyperparameters in different scenarios. This model integrates the local feature extraction ability of CNN and the time-series dependence modeling ability of LSTM, and introduces the attention mechanism to strengthen the ability to capture key features. Meanwhile, ISSA optimizes the network structure and hyperparameters of the model in different scenarios, adaptively adjusts the number of layers, learning rate, and batch size of CNN and LSTM to improve the modeling accuracy of complex load patterns and cross-scenario prediction ability, thereby enhancing the accuracy and generalization ability of electric load forecasting.
[0007] To achieve the above objectives, this invention provides a multi-scenario short-term electric load forecasting method optimized by an improved sparrow search algorithm, including the following steps:
[0008] Prediction scenario division: According to the time resolution and seasonal characteristics of electric load, the prediction task is divided into the following three typical scenarios to verify the cross-scenario adaptability and generalization ability of the model:
[0009] Scenario 1: Load forecasting at different time resolutions Based on the annual electric load data of a certain area in New York State, USA in 2023, the load data is resampled for time resolutions of 5 minutes, 15 minutes, 30 minutes, and 60 minutes, and the relevant weather data is processed synchronously to evaluate the prediction performance of the model at different time scales.
[0010] Scenario 2: Seasonal changes in a certain area of New York State, USA Based on the 15-minute time-resolution electric load data of New York State, USA in 2023, the data set is divided according to the four seasons of spring, summer, autumn, and winter to evaluate the prediction stability of the model under seasonal load pattern changes.
[0011] Scenario 3: Seasonal changes in a certain area in southern China Based on the 15-minute time-resolution electric load data of a certain area in southern China in 2018, the data set is divided according to the four-season characteristics to analyze the generalization ability of the model in different regions and climate conditions.
[0012] Data preprocessing and division: For different prediction scenarios, the electric load data is standardized and divided into a training set and a test set to improve the adaptability of the model to different load patterns. The standardization and sliding window method are as follows:
[0013]
[0014] X t =[x t-n ,x t-n+1 ,…,x t-1 ]
[0015]
[0016]
[0017] Where: x′ is the standardized data; x is the original data; μ x is the mean of the original data; σ x is the standard deviation of the original data. t is the feature quantity of the sliding window at time t; n is the window size; x i is the characteristic quantity at time i; is the load at time i; is the maximum temperature at time i; is the minimum temperature at time i; is the average temperature at time i; is the relative humidity at time i.
[0018] Initial parameter setting: Set key parameters for the Improved Sparrow Search Algorithm (ISSA) and CNN-LSTM-Attention model, including population size, number of iterations, activation function, convolution kernel size, number of hidden units, and number of training rounds. Also set the hyperparameters and network architecture optimization range for the CNN-LSTM-Attention model, including the number of network layers, learning rate, and batch size. Latin Hypercube Sampling (LHS) is used to generate the initial sparrow population positions to ensure a balanced population distribution, improve search efficiency, and enhance global optimization capabilities. The LHS generation positions are shown below:
[0019]
[0020] Where: n is the number of sparrows; d is the location dimension; N is the total number of samples, indicating that each dimension is divided into N intervals; p n is a random permutation in {0,1,2,...,N-1}; r n is a random number that follows a uniform distribution [0,1); X max,d and X min,d are the lower and upper bounds for each position dimension.
[0021] Prediction model construction: Based on the set parameters, a CNN-LSTM-Attention model is constructed. The mean squared error (MSE) is used as the fitness function to measure the prediction error of the model and guide the optimization search direction. The fitness function is as follows:
[0022]
[0023] where: n is the number of prediction samples, x act,i and x pred,i are the actual value and the predicted value at time i, respectively.
[0024] Fitness calculation and individual ranking: After the model is trained, the fitness value of each sparrow individual is calculated, and they are ranked according to the fitness to determine the current optimal fitness and its corresponding position. At the same time, the sparrow individuals are divided into discoverers, joiners, and guards to adapt to different optimization strategies.
[0025] The discoverers use the cosine annealing strategy to update their positions to improve the convergence stability and achieve a balance between early global exploration and late local fine search, as follows:
[0026]
[0027]
[0028] where: w(t) is the weight factor at the current time; γ is the initial weight value; t is the current iteration number; M is the maximum iteration number; α∈(0,1] is a random number; R∈[0,1] and ST∈[0.5,1] are the warning value and the safety value, respectively; Q is a random number obeying the normal distribution; L is a 1×d all-one matrix, and d is the total dimension; and are the positions of the i-th sparrow at time t + 1 and time t in the j-th dimension, respectively.
[0029] After the discoverers' position update, they are guided to perform long-distance jumps to increase the search range, enhance the global exploration ability of the population, and reduce the risk of falling into local optima, as follows:
[0030]
[0031] where: x′ i,j (t) and x i,j (t) are the positions of the i-th sparrow in the j-th dimension after and before the update at time t, respectively; x best,j is the optimal position of the current population in the j-th dimension; l is the migration step size; λ is the scaling factor; levy(β) is the random step size generated by the Levy distribution; μ and v are random numbers obeying the normal distribution; β is the stability index of the Levy distribution.
[0032] Participants adopt a dynamic spiral search strategy for position adjustment, enhancing local search ability, improving population diversity, and accelerating the convergence of the optimal solution. As follows:
[0033]
[0034]
[0035] Where: z is the spiral factor; l is the migration step size; k is the scaling coefficient; A is a 1×d matrix with values of ±1; x worse,j is the worst position of the current population in the jth dimension; L is a 1×d all-ones matrix, and d is the total dimension; n is the population size.
[0036] The sentinels perform adaptive position adjustment based on the warning mechanism, effectively avoiding overcrowding, reducing the risk of falling into local optima, and enhancing optimization stability.
[0037] Optimal solution update: After completing the position update, calculate the fitness of the new population, record the global optimal fitness value and its corresponding position, and ensure that the population gradually converges to the global optimal solution.
[0038] Iteration termination judgment: Check whether the set maximum number of iterations is reached. If the condition is not met, return to the step of constructing the prediction model for further optimization; if the condition is met, output the current optimal network structure and hyperparameter configuration.
[0039] Model training and optimization: Adopt the optimized CNN-LSTM-Attention model structure and hyperparameters, and use the complete dataset for final model training to ensure its stability and efficiency in different prediction scenarios.
[0040] Model saving and application: After training, save the final optimized model, and perform short-term power load forecasting under different time resolutions and seasonal conditions to verify the prediction accuracy and cross-scenario adaptability. The evaluation index formula is as follows:
[0041]
[0042] Where: n is the number of prediction samples, x act,i and x pred,i are the actual value and the predicted value at the ith moment respectively, is the mean value of the prediction samples.
[0043] The prediction model proposed in this paper is optimized using the improved sparrow search algorithm (ISSA). To verify the optimization performance of ISSA, a system of 6 types of benchmark test functions is constructed for simulation, covering the following three types of test objectives:
[0044] Unimodal functions: Used to evaluate the convergence speed and optimization accuracy of algorithms, and test their solving capabilities in smooth and convex optimization problems.
[0045]
[0046] Multimodal functions: Used to examine the ability of algorithms to escape from local optima and evaluate their global search performance in complex and multi-extremum solution spaces.
[0047]
[0048] Composite functions: Used to investigate the robustness of algorithms under non-linear and asymmetric characteristics, and test their adaptability in high-dimensional complex problems.
[0049] Description of the Drawings
[0050] Figure 1 It is the structural diagram of the CNN-LSTM-Attention model.
[0051] Figure 2 It is the iteration curve diagram of the unimodal function F1.
[0052] Figure 3 It is the iteration curve diagram of the unimodal function F2.
[0053] Figure 4 It is the iteration curve diagram of the multimodal function F3.
[0054] Figure 5 It is the iteration curve diagram of the multimodal function F4.
[0055] Figure 6 It is the iteration curve diagram of the composite function F5.
[0056] Figure 7 It is the iteration curve diagram of the composite function F6.
[0057] Figure 8 It is the flow chart of the ISSA-CNN-LSTM-Attention model.
[0058] Figure 9 It is the overall technical framework diagram of the prediction model. Detailed Implementation Manner
[0059] In the following description of the present invention, specific details such as specific system structures and technologies are proposed for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0060] It should be understood that when used in the specification and appended claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0061] It should also be understood that the term "and / or" used in the specification and appended claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0062] In addition, in the description of the specification and appended claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0063] The reference to "one embodiment" or "some embodiments" etc. described in the specification of the present application means that a specific feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0064] The present application will be described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0065] Figure 1 For the CNN-LSTM-Attention model structure diagram, refer to Figure 1 , and the detailed description of the model is as follows:
[0066] The CNN-LSTM-Attention model combines the local feature extraction ability of the convolutional neural network (CNN), the temporal dependence modeling ability of the long short-term memory network (LSTM), and the key feature capture ability of the attention mechanism (Attention) to improve the accuracy of short-term power load forecasting, including:
[0067] CNN Feature Extraction Module: The input data first passes through the convolutional layer, where local features are extracted using convolutional kernels to capture local spatio-temporal patterns in the power load data; the extracted features pass through the max-pooling layer for dimensionality reduction, reducing the computational amount and extracting key features; the flattening layer processes the pooled features and converts them into one-dimensional vectors for easy input into the fully connected layer; the reshaping layer adjusts the data shape and converts it into a three-dimensional tensor suitable for LSTM processing to ensure the correct transfer of data between different network layers.
[0068] LSTM Temporal Modeling Module: The LSTM structure is used to capture the long-term dependencies in time series data and enhance the model's understanding of historical load change trends. This module includes an input gate, a forget gate, and an output gate, which are used to control the storage, forgetting, and output of information respectively. Through the memory unit of LSTM, the model can effectively learn the temporal variation characteristics of load data.
[0069] Attention Mechanism: The Attention mechanism is introduced to enhance the model's attention to key features, calculate the weights at each time step, and through activation functions and weighted operations, enhance the ability to extract features at important moments and improve the prediction accuracy.
[0070] The Improved Sparrow Search Algorithm (ISSA) is used to optimize the deformable CNN-LSTM-Attention model. To verify the optimization performance of ISSA, a system of 6 types of benchmark test functions is constructed for simulation, covering the following three types of test objectives:
[0071] Exemplarily, unimodal functions: used to evaluate the convergence speed and optimization accuracy of the algorithm and test its solution ability in smooth, convex optimization problems.
[0072]
[0073] Exemplarily, multimodal functions: used to test the ability of the algorithm to escape from local optima and evaluate its global search performance in complex, multi-extremum solution spaces.
[0074]
[0075] Exemplarily, composite functions: used to examine the robustness of the algorithm under non-linear and asymmetric features and test its adaptability in high-dimensional complex problems.
[0076]
[0077] Figures 2 - 7They are respectively the iteration curve diagrams of unimodal function F1, unimodal function F2, multimodal function F3, multimodal function F4, composite function F5, and composite function F6. Compared with SSA and other mainstream optimization methods, ISSA can stably converge to the global optimal solution with fewer iteration times, verifying its excellent optimization ability.
[0078] Figure 8 It is the flowchart of the ISSA-CNN-LSTM-Attention model. Figure 9 It is the overall technical framework diagram of the prediction model.
[0079] Exemplarily, aiming at the deficiencies of existing short-term power load prediction models in complex feature modeling and cross-scenario adaptability, a Convolutional Neural Network-Long Short-Term Memory Network-Attention Mechanism (CNN-LSTM-Attention) model optimized by an Improved Sparrow Search Algorithm (ISSA) is proposed. ISSA optimizes the network structure and hyperparameters of the model in different scenarios, adaptively adjusts the number of layers, learning rate, and batch size of CNN and LSTM to improve the modeling accuracy of complex load patterns and cross-scenario prediction ability, thereby improving the accuracy and generalization ability of power load prediction. It includes:
[0080] Exemplarily, prediction scenario division: According to the time resolution and seasonal characteristics of power load, the prediction task is divided into the following three typical scenarios to verify the cross-scenario adaptability and generalization ability of the model:
[0081] Scenario 1: Load prediction at different time resolutions Exemplarily, based on the annual power load data of a certain area in New York State, USA in 2023, the load data is resampled for time resolutions of 5 minutes, 15 minutes, 30 minutes, and 60 minutes, and the relevant weather data is processed synchronously to evaluate the prediction performance of the model at different time scales.
[0082] Scenario 2: Seasonal changes in a certain area of New York State, USA Exemplarily, based on the 15-minute time resolution power load data of New York State, USA in 2023, the dataset is divided according to the four seasons of spring, summer, autumn, and winter to evaluate the prediction stability of the model under seasonal load pattern changes.
[0083] Scenario 3: Seasonal changes in a certain area in southern China Exemplarily, based on the 15-minute time resolution power load data of a certain area in southern China in 2018, the dataset is divided according to the four-season characteristics to analyze the generalization ability of the model in different regions and climate conditions.
[0084] Exemplarily, data preprocessing and partitioning: For different prediction scenarios, the power load data is standardized and divided into a training set and a test set to improve the adaptability of the model to different load patterns. The standardization and sliding window method are as follows:
[0085]
[0086] X t = [x t-n , x t-n+1 , …, x t-1
[0087]
[0088]
[0089] In the formula: x' is the standardized data; x is the original data; μ x is the mean of the original data; σ x is the standard deviation of the original data. X t is the feature quantity of the sliding window at time t; n is the window size; x i is the feature quantity at time i; is the load at time i; is the highest temperature at time i; is the lowest temperature at time i; is the average temperature at time i; is the relative humidity at time i.
[0090] Exemplarily, initial parameter setting: Set the key parameters of the improved sparrow search algorithm (ISSA) and the CNN-LSTM-Attention model, including population size, number of iterations, activation function, convolution kernel size, number of hidden units, and number of training epochs, etc., and set the hyperparameters and network architecture optimization range of the deformable CNN-LSTM-Attention model, covering the number of network layers, learning rate, and batch size. The Latin hypercube sampling (LHS) is used to generate the positions of the initial sparrow population to ensure the balance of the population distribution, improve the search efficiency and global optimization ability. The LHS generates positions as follows:
[0091]
[0092] In the formula: n is the sparrow individual; d is the position dimension; N is the total number of samplings, indicating that each dimension is divided into N intervals; p n is a random permutation in {0, 1, 2, ..., N - 1}; r n is a random number obeying the uniform distribution [0, 1); X max,d and X min,d are the upper and lower limits of each position dimension.
[0093] Furthermore, for the prediction model construction: a CNN-LSTM-Attention model is constructed based on the set parameters, and the mean squared error (MSE) is used as the fitness function to measure the model prediction error and guide the optimization search direction. The fitness function is as follows:
[0094]
[0095] In the formula: n is the number of prediction samples, x act,i and x pred,i are the actual value and the predicted value at the i-th moment respectively.
[0096] Furthermore, for the fitness calculation and individual ranking: after the model training, the fitness value of each sparrow individual is calculated and sorted according to the fitness, and the current optimal fitness and its corresponding position are determined. At the same time, the sparrow individuals are divided into discoverers, joiners, and vigilants to adapt to different optimization strategies.
[0097] Exemplarily, the discoverers adopt the cosine annealing strategy for position update to improve the convergence stability and achieve the balance between early global exploration and late local fine search, as follows:
[0098]
[0099]
[0100] In the formula: w(t) is the weight factor at the current moment; γ is the initial weight value; t is the iteration number at the current moment; M is the maximum iteration number; α ∈ (0, 1] is a random number; R ∈ [0, 1] and ST ∈ [0.5, 1] are the warning value and the safety value respectively; Q is a random number following the normal distribution; L is a 1×d all-one matrix, and d is the total dimension; and are the positions of the i-th sparrow at the (t + 1)-th moment and the t-th moment in the j-th dimension respectively.
[0101] Furthermore, after the position update of the discoverers, guide them to perform long-distance jumps to increase the search range, enhance the global exploration ability of the population, and reduce the risk of falling into the local optimum, as follows:
[0102]
[0103] In the formula: x i ′ ,j (t) and x i,j (t) are the positions of the i-th sparrow in the j-th dimension after and before the update at the t-th moment respectively; x best,jis the optimal position of the current population in the j-th dimension; l is the migration step size; λ is the scaling factor; levy(β) is the random step size generated by the Levy distribution; μ and v are random numbers following the normal distribution; β is the stability exponent of the Levy distribution.
[0104] Exemplarily, the joiner adopts a dynamic spiral search strategy to adjust the position, enhance the local search ability, improve the population diversity, and accelerate the convergence of the optimal solution. As follows:
[0105]
[0106]
[0107] In the formula: z is the spiral factor; l is the migration step size; k is the scaling coefficient; A is a 1×d matrix with values of ±1; x worse,j is the worst position of the current population in the j-th dimension; L is a 1×d all-ones matrix, d is the total dimension; n is the population size.
[0108] Exemplarily, the vigilant adjusts the position adaptively according to the vigilance mechanism, effectively avoids over-aggregation, reduces the risk of falling into local optima, and improves the optimization stability.
[0109] Furthermore, optimal solution update: After completing the position update, calculate the fitness of the new population, record the global optimal fitness value and its corresponding position, and ensure that the population gradually converges to the global optimal solution.
[0110] Furthermore, iteration termination judgment: Check whether the set maximum number of iterations is reached. If the condition is not met, return to the step of constructing the prediction model for further optimization; if the condition is met, output the current optimal network structure and hyperparameter configuration.
[0111] Furthermore, model training and optimization: Use the optimized CNN-LSTM-Attention model structure and hyperparameters, and use the complete dataset for final model training to ensure its stability and efficiency in different prediction scenarios.
[0112] Furthermore, model saving and application: After training, save the final optimized model, and perform short-term power load forecasting under different time resolutions and seasonal conditions to verify the prediction accuracy and cross-scenario adaptability. The evaluation index formula is as follows:
[0113]
[0114] In the formula: n is the number of prediction samples, x act,i and x pred,i are the actual value and the predicted value at the i-th moment respectively, is the mean value of the prediction samples.
[0115] Embodiment
[0116] The multi-scenario short-term electric load forecasting method based on the improved sparrow search algorithm to optimize the deformable CNN-LSTM-Attention model proposed by the present invention has been tested on various time resolutions (such as 5 minutes, 15 minutes, 30 minutes, 60 minutes) and multi-region load data sets (such as New York State in the United States, southern regions of China). The simulation results show that the model exhibits good fitting ability and forecasting accuracy in different scenarios, superior to mainstream forecasting models such as traditional CNN-LSTM.
[0117] Under multiple typical scenarios, the method in this paper is superior to the comparison model in terms of the mean absolute error (MAE), root mean square error (RMSE), and goodness of fit (R 2 ) indicators, verifying the effectiveness and robustness of the improved ISSA algorithm in the parameter optimization process. At the same time, this forecasting method has good generality and scalability, and is applicable to short-term electric load forecasting tasks with different time scales and different regions.
[0118] This application provides a multi-scenario short-term electric load forecasting method based on the improved sparrow search algorithm. The method includes: constructing short-term electric load forecasting scenarios under different time resolutions and seasonal characteristics; establishing a forecasting model that integrates a convolutional neural network (CNN), a long short-term memory network (LSTM), and an attention mechanism (Attention), where CNN extracts local features, LSTM performs time series modeling, and the Attention mechanism enhances the weights of key features; using the improved sparrow search algorithm for network structure and hyperparameter optimization, adaptively adjusting the number of layers, learning rate, and batch size of CNN and LSTM, and combining the Latin hypercube sampling method, cosine annealing, dynamic spiral search, and Levy flight strategy to improve the optimization efficiency and enhance the global search ability. Based on the optimized forecasting model, electric load forecasting is carried out, and simulation verification is performed in different scenarios to improve the forecasting accuracy and cross-scenario adaptation ability of the model.
[0119] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.
[0120] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A short-term electric load forecasting method optimized based on an improved sparrow search algorithm, characterized in that, Including: Construct short-term power load forecasting scenarios, and construct short-term power load forecasting datasets according to different time resolutions and regional seasonal characteristics; Establish a deformable CNN-LSTM-Attention prediction model, where CNN is responsible for extracting local features, LSTM performs time series modeling, and the Attention mechanism enhances the weights of key features; Adopt the improved sparrow search algorithm (ISSA) to optimize the structure and hyperparameters of the model, including optimizing the number of layers, learning rate, and batch size of CNN and LSTM; Based on the optimized prediction model, perform load forecasting and conduct simulation verification under different scenarios to improve the prediction accuracy and generalization ability of the model.
2. A short-term electric load forecasting method according to claim 1, characterized in that The prediction scenarios include: Load forecasting with different time resolutions: Construct load datasets based on time resolutions of 5 minutes, 15 minutes, 30 minutes, and 60 minutes to evaluate the prediction accuracy and stability of the model at different time scales; Seasonal load forecasting: Based on the historical load data of a certain area in New York State, USA, divide the dataset according to spring, summer, autumn, and winter, and analyze the adaptability of the model under seasonal load changes; Cross-regional load forecasting: Based on the load data of a certain area in southern China, conduct spring, summer, autumn, and winter simulations in combination with seasonal characteristics to evaluate the adaptability and generalization ability of the model under different geographical environments and climate conditions.
3. A short-term electric load forecasting method according to claim 1, characterized in that The optimization scope of the deformable CNN-LSTM-Attention prediction model includes: Setting the optimization range of the number of layers of CNN and LSTM; Setting the adjustment range of the learning rate of the CNN-LSTM-Attention model; Optimizing the batch size of the CNN-LSTM-Attention model.
4. A short-term electric load forecasting method according to claim 1, characterized in that Adopt the improved sparrow search algorithm (ISSA) to optimize the deformable CNN-LSTM-Attention prediction model, and dynamically adjust the neural network structure and hyperparameters under different scenarios, including: Population initialization: Use Latin hypercube sampling (LHS) to generate the initial sparrow population to improve the search balance; Where: n is the sparrow individual; d is the position dimension; N is the total number of samplings, indicating that each dimension is divided into N intervals; p n is a random permutation in {0, 1, 2,..., N - 1}; r n is a random number obeying the uniform distribution [0, 1); X max,d and X min,d are the upper and lower limits of each position dimension; Fitness calculation: Calculate the individual fitness values based on the mean square error (MSE) and sort them; Population position update: The discoverer uses the cosine annealing strategy for position update to improve the convergence stability, achieve the balance between early global exploration and late local fine search, as follows: where: w(t) is the weight factor at the current moment; γ is the initial weight value; t is the iteration number at the current moment; M is the maximum number of iterations; α ∈ (0, 1] is a random number; R ∈ [0, 1] and ST ∈ [0.5, 1] are the warning value and the safety value respectively; Q is a random number obeying the normal distribution; L is a 1×d all-one matrix, and d is the total dimension; and are the positions of the i-th sparrow at the (t + 1)-th moment and the t-th moment in the j-th dimension respectively; After the discoverer's position is updated, guide it to perform long-distance jumps to increase the search range, enhance the global exploration ability of the population, and reduce the risk of falling into local optima, as follows: Where: x' i,j (t) and x i,j (t) are the positions of the i-th sparrow at time t after and before the update in the j-th dimension, respectively; x best,j is the optimal position of the current population in the j-th dimension; l is the migration step size; λ is the scaling factor; levy(β) is the random step size generated by the Levy distribution; μ and v are random numbers obeying the normal distribution; β is the stability index of the Levy distribution; The joiners use a dynamic spiral search strategy for position adjustment to enhance the local search ability, improve the population diversity, and accelerate the convergence of the optimal solution, as follows: l = λ(x i,j (t) - x best,j ) A + = A′·(AA′) -1 x b x(t) = x best,j + |x i,j (t) - x best,j | · A + · L where: z is the spiral factor; l is the migration step; k is the scaling coefficient; A is a 1×d matrix with values of ±1; x worse,j is the worst position of the current population in the j-th dimension; L is a 1×d all-ones matrix, and d is the total dimension; n is the population size; The vigilant adjusts its position adaptively according to the vigilance mechanism, effectively avoids overcrowding, reduces the risk of falling into local optima, and improves the optimization stability; Iterative optimization: In multiple iterative processes, update the population position and calculate the fitness until convergence to the global optimal solution.
5. The short-term electric load forecasting method according to claim 4, wherein The formula for the mean square error (MSE) is as follows: Where: n is the number of prediction samples, x act,i and x pred,i are the actual value and the predicted value at the i-th moment, respectively.
6. A short-term electric load forecasting method according to claim 4, wherein To verify the optimization performance of the proposed ISSA algorithm, six types of benchmark test functions are constructed, including: Unimodal functions: used to evaluate the convergence speed and optimization accuracy of algorithms, and test their solving capabilities in smooth and convex optimization problems; Multimodal functions: used to examine the local optimal escape ability of algorithms and evaluate their global search performance in complex and multi-extreme solution spaces; Composite functions: used to investigate the robustness of algorithms under non-linear and asymmetric characteristics and test their adaptability in high-dimensional complex problems; During the testing process, ISSA was compared with SSA, PSO, GWO, DBO, WOA, and MVO to evaluate the optimization performance.
7. The short-term electric load forecasting method according to claim 6, wherein The following parameter settings were used for the test: The population size was 30; The maximum number of iterations was 50; The algorithm was independently run 20 times to ensure the scientificity and stability of the test results.
8. A short-term electric load forecasting method according to claim 1, characterized in that The prediction model used the sliding window method for power load forecasting and the following evaluation indicators: Root Mean Square Error (RMSE) Mean Absolute Percentage Error (MAPE) Goodness of fit (R 2 ) Where: n is the number of prediction samples, x act,i and x pred,i are the actual value and the predicted value at the i-th moment respectively, is the mean value of the prediction samples.
9. A short-term electric load forecasting method according to claim 1, characterized in that The proposed deformable CNN-LSTM-Attention prediction model optimized based on the improved sparrow search algorithm is applicable to the following application scenarios: Short-term power grid load forecasting to provide accurate load forecasting data for power dispatching; Optimization of renewable energy consumption to improve the forecasting accuracy of new energy sources such as wind power and photovoltaic power; Power market demand forecasting to assist in optimizing electricity price strategies and improving market stability.
Citation Information
Cited By
Power load scene generation method and system fusing cross-seasonal data
CN120896146A
Method and System for Generating Power Load Scenarios by Integrating Cross-Seasonal Data
CN120896146B
Sensor data processing method and device based on cloud computing center
CN121397007A
Metro station air conditioner energy-saving optimization method and system
CN121723436A
A metro station air conditioning energy-saving optimization method and system
CN121723436B