Short-term power load prediction method and device, terminal and medium

By using Spearman's order correlation coefficient to determine the input data dimensions in power load prediction, and using the LSTM-seq2seq model combined with the adaptive enhanced elite particle swarm optimization algorithm to optimize hyperparameters, the problems of inappropriate input data dimensions and experience in hyperparameter adjustment in the existing technology are solved, and more efficient and accurate short-term power load prediction is achieved.

CN119558474APending Publication Date: 2025-03-04STATE GRID JIANGSU ELECTRIC POWER CO LTD +4
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411646764.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the prior art, the dimension determination of the input data of the power load prediction model is not objective enough, resulting in a decrease in the accuracy of the prediction result, and the hyperparameter adjustment depends on experience, reducing the timeliness of the prediction.

Method used

The Spearman order correlation coefficient was used for autocorrelation analysis to determine the dimensions of the input data, and a sequence-to-sequence LSTM-seq2seq load prediction model was constructed using long and short-term memory neural networks. At the same time, the model hyperparameters are optimized through the adaptive enhanced elite particle swarm optimization algorithm.

Benefits of technology

The accuracy and adaptability of load prediction results are improved, the prediction accuracy decrease caused by inappropriate dimensions of the input data is avoided, and the efficiency and accuracy of the model are improved by optimizing hyperparameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119558474A_ABST
    Figure CN119558474A_ABST
Patent Text Reader

Abstract

The invention discloses a short-term power load prediction method and device, a terminal and a medium, and the method comprises the steps: collecting the historical load time series data of a plurality of groups of power systems and the historical exogenous variable time series data of the same time scale according to a set time step, and constructing an original data set; preprocessing the original data set to obtain a complete and available sample set; constructing a sequence-to-sequence LSTM-seq2seq load prediction model by using a long short-term memory neural network; training the constructed LSTM-seq2seq load prediction model on the basis of the sample set; and preprocessing historical load time sequence data and historical exogenous variable time sequence data within a set time step before a to-be-predicted time period, and inputting the preprocessed historical load time sequence data and historical exogenous variable time sequence data into the trained LSTM-seq2seq load prediction model to obtain a power load prediction result within the prediction time period. According to the method, short-term power load prediction can be efficiently and accurately realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Load forecasting is one of the important tools of the energy management system (EMS) of power companies. Real-time load forecasting for online control should be executed a few minutes in advance. Among them, accurate spatiotemporal load forecasting is crucial for the planning and operation of new power systems. Short-term multi-node load forecasting can be used to formulate power supply plans, assist market participants in decision-making, and provide important references for real-time security analysis, real-time economic dispatch and automatic generation control (AGC) of power systems. It can effectively improve the stability of power systems and is of great significance to the stable operation of power systems. However, with the further transformation of my country's energy structure, the mobility of new power loads such as electric vehicles has made the randomness and uncertainty of power loads more complicated. Although a lot of research has been done in this field, accurate prediction models are still needed.

[0003] At present, the number of input data for load forecasting models is often determined by heuristic methods (such as the gray wolf algorithm, etc.), but the dimension of the input data is not objective enough. If the dimension is too long, the correlation between the input data and the forecast data will be too low, and if the dimension is too short, the input data will be insufficient, both of which will lead to a decrease in the accuracy of the forecast results. At the same time, the hyperparameters in the current power system load forecasting deep learning model (such as kernel size, pool size, number of kernels, number of layers in the neural network, etc.) are determined by empirical evaluation, and the forecasting process requires repeated manual adjustments, which reduces the timeliness and accuracy of short-term load forecasting. Summary of the invention

[0004] In order to solve the deficiencies in the prior art, the present invention provides a short-term power load forecasting method, device, terminal and medium, which can realize short-term power load forecasting more effectively and reliably.

[0005] The present invention adopts the following technical solution.

[0006] In a first aspect, the present invention provides a short-term power load forecasting method, the method comprising: 1. A short-term power load forecasting method, characterized in that the method comprises:

[0007] Collect multiple sets of historical load time series data of the power system and historical exogenous variable time series data of the same time scale according to the set time step to construct the original data set;

[0008] Preprocessing the original data set to obtain a complete and usable sample set;

[0009] A sequence-to-sequence LSTM-seq2seq load forecasting model is constructed using long short-term memory neural network;

[0010] Training the constructed LSTM-seq2seq load prediction model based on the sample set;

[0011] After preprocessing, the historical load time series data and historical exogenous variable time series data within the set time step before the forecast period are input into the trained LSTM-seq2seq load forecasting model to obtain the power load forecast results within the forecast period.

[0012] Optionally, the exogenous variables include climate data and calendar data, the climate data including temperature, humidity, precipitation, air pressure, wind speed and light intensity; the calendar data including date, time of day, holiday label and weekday label.

[0013] Optionally, the set time step is determined by using the Spearman rank correlation coefficient to perform autocorrelation analysis on historical load time series data, and the calculation formula is as follows:

[0014]

[0015] Where ρ(n) is the correlation coefficient, S(t) is the load time series of period t, S(tn) is the load time series after period t is shifted forward by n, μ1 and μ2 are the average values ​​of S(t) and S(tn), respectively, and T is the length of the historical load time series data;

[0016] The value of n corresponding to the maximum correlation coefficient calculated by the above formula is the set time step, also known as the dimension of the model input data.

[0017] Optionally, the preprocessing includes: filling missing data, removing abnormal data and data normalization.

[0018] Optionally, the structure of the constructed LSTM-seq2seq load forecasting model includes: an encoder and a decoder;

[0019] The encoder includes multiple layers of sequentially connected LSTM encoding networks, wherein the first layer of LSTM encoding network processes the input sequence x=(x1, x2, ..., x n ) obtains hidden state h1 and unit state c1 after feature encoding of the first-dimensional data x1, and obtains hidden state h2 and unit state c2 after feature encoding of the second-dimensional data x2 by combining the hidden state h1 and unit state c1, and so on, until the n-th dimensional data x n Complete encoding, and finally get the intermediate state data z n =(hn ,c n );

[0020] The decoder includes multiple layers of sequentially connected LSTM decoding networks, wherein the first layer of LSTM decoding network processes the input intermediate state data z n =(h n ,c n ) is decoded, and a new hidden state s1 and unit state v1, as well as load forecast data load1 are output and marked as y1; the second layer LSTM decoding network decodes the hidden state s1 and unit state v1 output by the first layer LSTM decoding network for the second time, and outputs a new hidden state s2 and unit state v2, as well as load forecast data load2 and marked as y2; and so on, until the mth layer LSTM decoding network outputs the load forecast data load m And marked as y m ; According to y1,y2,...,y m After sorting and splicing the load forecast data in order, the entire load forecast sequence is obtained.

[0021] Optionally, when training the constructed LSTM-seq2seq load forecasting model, an adaptive enhanced elite particle swarm algorithm is used to optimize the model's hyperparameters;

[0022] The adaptive enhanced elite particle swarm algorithm includes: training the model hyperparameters by assigning the state information of each particle in the population to the LSTM-seq2seq load forecasting model, and dynamically adjusting the inertia weight and learning factor according to the number of iterations to update the speed and position of each particle, thereby obtaining the optimal solution.

[0023] Optionally, the step of optimizing the hyperparameters of the model using the adaptive enhanced elite particle swarm algorithm specifically includes:

[0024] Step 1: Set the particle swarm size, maximum number of iterations, learning factor, and inertia weight range, and randomly generate the initial position and velocity of each particle. The state information of each particle represents a set of model hyperparameter selection options;

[0025] Step 2: Assign the current optimal position of each particle to the LSTM-seq2seq load forecasting model to obtain different LSTM-seq2seq load forecasting models;

[0026] Step 3: Based on the sample set, use the Adam optimizer to train each of the LSTM-seq2seq load prediction models, and use the prediction errors of each currently trained model as the fitness value of each particle;

[0027] Step 4: Update the inertia weight and learning factor of each particle based on its current fitness value to update the speed and position of each particle;

[0028] Step 5: Based on the updated speed and position of each particle, recalculate the fitness value of each particle and update the optimal position of each particle;

[0029] Step 6: Determine whether the current number of iterations k reaches the set maximum number of iterations; if not, set k=k+1 and return to step 2; if so, select the optimal position of the particle with the highest fitness value as the optimal solution, that is, obtain the best selection scheme for the model hyperparameters and output the final LSTM-seq2seq load prediction model.

[0030] Optionally, the model hyperparameters include the number of convolution layers, the number of filters, the convolution kernel size, the pooling layer size, the partial random inactivation rate, the random inactivation rate and the number of hidden layer neurons.

[0031] Optionally, in step 3, the calculation formula of the prediction error of each model is as follows:

[0032]

[0033] In the formula, RMSE is the root mean square error, L represents the number of test samples, and y l is the true load of the lth sample, y l is the predicted load of the model for the lth sample.

[0034] Optionally, the updating formula of the inertia weight is as follows:

[0035]

[0036] In the formula, ω k is the inertia weight after the kth iteration; ω1 and ω2 are the original value and the final value of the inertia weight; MAX is the maximum number of iterations set; z k and z k-1 are the parameters after the kth and k-1th iterations respectively.

[0037] Optionally, the updating formula of the learning factor is as follows:

[0038]

[0039] In the formula, and are the first learning factor, the second learning factor and the third learning factor after the kth iteration, It represents the best value in the prediction error of the trained model based on the optimal position assignment of each particle at the kth iteration; τ is the set multiplier.

[0040] Optionally, the formulas for updating the speed and position of each particle are as follows:

[0041]

[0042] In the formula, and are the velocities of particle p after the k+1th and kth iterations respectively; and are the positions of particle p after the k+1th and kth iterations respectively; ω k is the inertia weight after the kth iteration; and are the first learning factor, the second learning factor and the third learning factor after the kth iteration respectively; r1, r2 and r3 are all random numbers between 0 and 1; is the average vector of all particle positions after the kth iteration; is the optimal position of particle p after the kth iteration, is the optimal position in the particle group after the kth iteration.

[0043] In a second aspect, the present invention provides a short-term power load forecasting device, which runs the steps of any method described in the first aspect of the present invention, and the device comprises:

[0044] The acquisition module is used to collect multiple groups of historical load time series data of the power system and historical exogenous variable time series data of the same time scale according to the set time step to construct the original data set;

[0045] A preprocessing module, used to preprocess the original data set to obtain a complete and usable sample set;

[0046] Build a model module to build a sequence-to-sequence LSTM-seq2seq load forecasting model using a long short-term memory neural network;

[0047] A training model module, used for training the constructed LSTM-seq2seq load forecasting model based on the sample set;

[0048] The load forecasting module is used to pre-process the historical load time series data and historical exogenous variable time series data within a set time step before the forecast period, and input them into the trained LSTM-seq2seq load forecasting model to obtain the power load forecasting results within the forecast period.

[0049] In a third aspect, the present invention provides a terminal, including a processor and a storage medium;

[0050] The storage medium is used to store instructions;

[0051] The processor is used to operate according to the instructions to execute the steps of any one of the methods described in the first aspect of the present invention.

[0052] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect of the present invention.

[0053] The beneficial effects of the present invention are as follows:

[0054] 1. The present invention uses the Spearman rank correlation coefficient to perform autocorrelation analysis on historical load time series data to determine the data dimension of exogenous variables in the power system, which can more objectively determine the dimension of input data and avoid sampling time steps that are too short or too long. By using data with higher correlation, the accuracy of load forecasting results can be further improved.

[0055] 2. The present invention uses a long short-term memory neural network to construct a sequence-to-sequence LSTM-seq2seq load prediction model, which can support input and output data of different lengths and has better adaptability. It overcomes the problem that traditional neural network models are prone to errors in input data, resulting in partial prediction data loss, changes in input data length, and inability to complete training well.

[0056] 3. The enhanced elite particle swarm optimization algorithm provided by the present invention has a stronger ability to handle complex, nonlinear and chaotic relationships, and can better optimize the hyperparameters of the LSTM-seq2seq load forecasting model; by optimizing the inertia weight and learning factor, it overcomes the problem that the convergence speed and convergence accuracy of the traditional PSO algorithm are difficult to coexist and it is easy to fall into the local optimum, improves the flexibility and adaptability of the global search, and has a better convergence effect, so that the finally optimized LSTM-seq2seq load forecasting model can more efficiently and accurately realize short-term power load forecasting. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 It is a flow chart of the method for forecasting short-term power load of the present invention;

[0058] Figure 2 It is a structural diagram of the LSTM-seq2seq load prediction model in the present invention;

[0059] Figure 3 A schematic diagram of a process for optimizing the hyperparameters of a model using the adaptive enhanced elite particle swarm algorithm of the present invention;

[0060] Figure 4 It is a prediction result diagram of the LSTM-seq2seq load prediction model and the SVM model in the present invention;

[0061] Figure 5 It is a structural principle block diagram of the medium- and short-term power load forecasting device of the present invention. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in the present invention are only part of the embodiments of the present invention, not all of the embodiments. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the scope of protection of the present invention.

[0063] Embodiment 1:

[0064] Reference Figure 1 The present invention provides a short-term power load forecasting method, which specifically includes the following steps:

[0065] Step S1, collecting multiple groups of historical load time series data of the power system and historical exogenous variable time series data of the same time scale according to the set time step, and constructing an original data set;

[0066] Among them, exogenous variables include climate data and calendar data. Climate data includes temperature, humidity, precipitation, air pressure, wind speed and light intensity, etc. Calendar data includes date, time of day, holiday label and weekday label. Holiday label is set to 1; weekday label is set to 0.

[0067] In a preferred but non-limiting embodiment, in step S1, the set time step is determined by using the Spearman rank correlation coefficient to perform autocorrelation analysis on the historical load time series data, and the calculation formula is as follows:

[0068]

[0069] Where ρ(n) is the correlation coefficient, S(t) is the load time series of period t, S(tn) is the load time series after period t is shifted forward by n, μ1 and μ2 are the average values ​​of S(t) and S(tn), respectively, and T is the length of the historical load time series data;

[0070] The value of n corresponding to the maximum correlation coefficient calculated by the above formula is the set time step, also known as the dimension of the model input data.

[0071] It is further explained that after solving the correlation of the load sequence data, the dimension n of the input data is determined according to the correlation; all input data (such as load history data, climate data, etc.) have the same dimension, which is n; the input sequence of the model is defined as x = (x1, x2, ..., xn ), where x n is the n-th dimension data in the input sequence; each dimension of data constitutes a global feature; x n =(o n , 1n ,e 2n ,…,e Hn ), o n is the load of the n-th dimension data, e Hn It represents the Hth exogenous variable in the nth dimension data, where H is the number of exogenous variables.

[0072] Step S2: preprocessing the original data set to obtain a complete and usable sample set;

[0073] In this embodiment, the preprocessing includes: filling missing data, removing abnormal data and data normalization.

[0074] The normalized formula is as follows:

[0075]

[0076] In the formula, a i,j is the value of the jth data in the time series of the i-th sample (such as load, temperature, humidity, etc.); max(a i ) is the time series a i The maximum value in min(a i ) is the time series a i The minimum value in .

[0077] Step S3, using a long short-term memory neural network to build a sequence-to-sequence LSTM-seq2seq load forecasting model;

[0078] Reference Figure 2 As shown, the structure of the LSTM-seq2seq load prediction model constructed in this embodiment includes: an encoder and a decoder;

[0079] The encoder includes multiple layers of sequentially connected LSTM encoding networks, where the first layer of LSTM encoding network is conditioned on the input sequence x = (x1, x2, ..., x n ) obtains hidden state h1 and unit state c1 after feature encoding of the first-dimensional data x1, and obtains hidden state h2 and unit state c2 after feature encoding of the second-dimensional data x2 by combining the hidden state h1 and unit state c1, and so on, until the n-th dimensional data x n Complete encoding, and finally get the intermediate state data z n =(h n ,c n );

[0080] The decoder includes multiple layers of sequentially connected LSTM decoding networks, where the first layer of LSTM decoding network processes the input intermediate state data z n =(h n ,c n ) is decoded, and a new hidden state s1 and unit state v1, as well as load forecast data load1 are output and marked as y1; the second layer LSTM decoding network decodes the hidden state s1 and unit state v1 output by the first layer LSTM decoding network for the second time, and outputs a new hidden state s2 and unit state v2, as well as load forecast data load2 and marked as y2; and so on, until the mth layer LSTM decoding network outputs the load forecast data load m And marked as y m ; According to y1,y2,...,y m After sorting and splicing the load forecast data in order, the entire load forecast sequence is obtained.

[0081] Further, the model encoder is described in detail as follows:

[0082] Use a multi-layer LSTM encoding network to encode the input sequence x=(x1,x2,...,x n ) for encoding; after the input sequence is vectorized, the input array x is fed back to the multi-layer LSTM encoding network, and the output hidden state h={h1,h2,...,h n} as the input of the next layer of LSTM decoding network; this embodiment represents the hidden state in the corresponding layer through the following expression.

[0083] h n =EncoderLSTM(x n ,h n-1 )

[0084] Introducing hidden state c n , used to store long-term information across time steps; the intermediate state vector includes the final hidden state and the final unit state, i.e. z = (h n ,c n ).

[0085] By extending the multi-layer equation to LSTM, the following equation is obtained:

[0086] (h n ,c n )=EncoderLSTM(x n ,(h n-1 ,c n-1 ))

[0087] Furthermore, the model decoder is described in detail as follows:

[0088] Construct a multi-layer LSTM decoding network to perform a single decoding step at each time step, that is, output a single instruction. x and c x denote the hidden layer state and the final unit state of the decoder respectively, and compare them with the current embedded tag y x are input to the LSTM together to generate new hidden states and cell states (s x+1 ,c x+1 ), whose equation is as follows:

[0089]

[0090] The data in the decoder are always generated sequentially, one data per time step.

[0091] In this embodiment, the number of hidden layer nodes of the encoder and decoder used is 512, the batch size (batchsize) is 50, and the cycle (epoch) is 50.

[0092] Step S4: training the constructed LSTM-seq2seq load forecasting model based on the sample set;

[0093] In this embodiment, an adaptive enhanced elite-based particle swarm optimization (EEPSO) algorithm is used to optimize the hyperparameters of the model, including: training the model hyperparameters by assigning the state information of each particle in the population to the LSTM-seq2seq load forecasting model, and dynamically adjusting the inertia weight and learning factor according to the number of iterations to update the speed and position of each particle, thereby obtaining the optimal solution.

[0094] Reference Figure 3 ,The specific steps of the EEPSO algorithm include:

[0095] Step 1: Set the particle swarm size, maximum number of iterations, learning factor, and inertia weight range, and randomly generate the initial position and velocity of each particle. The state information of each particle represents a set of model hyperparameter selection options;

[0096] In this embodiment, the particle population has a total of 36 particles, and each particle has a decision variable F of one dimension. p , generate feasible particles, and the initial position of the particle swarm can be expressed as:

[0097] F p =(f1,f2,…,f r )

[0098] In the formula, f ris the associated hyperparameter, and r is the number of hyperparameters. Table 1 lists the detailed information of the hyperparameter search space for each particle. The maximum number of iterations is set to 50, the speed and position are randomly initialized in the speed interval and search space, the particle speed is the change after iteration, the particle swarm size is set, and each particle is randomly initialized.

[0099] Table 1: Search space of adaptive enhanced elite particle swarm algorithm

[0100]

[0101]

[0102] Step 2: Assign the current optimal position of each particle to the LSTM-seq2seq load forecasting model to obtain different LSTM-seq2seq load forecasting models;

[0103] Step 3: Based on the sample set, use the Adam optimizer to train each of the LSTM-seq2seq load prediction models, and use the prediction errors of each currently trained model as the fitness value of each particle;

[0104] In this embodiment, the calculation formula of the prediction error of each model is as follows:

[0105]

[0106] In the formula, RMSE is the root mean square error, L represents the number of test samples, and y l is the true load of the lth sample, y l is the predicted load of the model for the lth sample.

[0107] Step 4: Update the inertia weight and learning factor of each particle based on its current fitness value to update the speed and position of each particle;

[0108] Considering that in the optimization process of the PSO algorithm, as the number of iterations increases, some particles are prone to fall into the local optimal solution in the middle and late stages, this embodiment dynamically adjusts the inertia weight according to the number of iterations so that the algorithm maintains a larger inertia weight in the early stage, enhancing the global search capability, and reduces the inertia weight in the later stage to focus on local search. The first learning factor decreases with the number of iterations, guiding particles to explore their own optimal position first in the early stage; the second learning factor gradually increases, making particles closer to the global optimal position in the later stage and improving the convergence speed; the third learning factor introduced guides particles to move closer to the average position of the group, further balancing exploration and development, avoiding particles from falling into the local optimum, and thus improving the overall convergence effect of the algorithm.

[0109] In a preferred but non-limiting embodiment, the updating formula of the inertia weight is as follows:

[0110]

[0111] In the formula, ω k is the inertia weight after the kth iteration; ω1 and ω2 are the original value and the final value of the inertia weight; MAX is the maximum number of iterations set; z k and z k-1 are the parameters after the kth and k-1th iterations respectively.

[0112] In this embodiment, the inertia weight is the chaotic descending inertia weight, which represents the trust in the current position. The inertia weight ω k Changes with the iteration index k; the parameter of the chaotic descent inertia is set to z 0 =0.1, ω1=0.9, ω2=0.4 and MAX=50.

[0113] In a preferred but non-limiting embodiment, the updating formula of the learning factor is as follows:

[0114]

[0115] In the formula, and are the first learning factor, the second learning factor and the third learning factor after the kth iteration, It represents the best value in the prediction error of the trained model based on the optimal position assignment of each particle at the kth iteration; τ is the set multiplier.

[0116] In this embodiment, the first learning factor From 2 to 1; the second learning factor Increase from 1 to 2; the third learning factor Gradually decrease to 0; τ is set to 0.9×MAX.

[0117] In a preferred but non-limiting embodiment, the formulas for updating the velocity and position of each particle are as follows:

[0118]

[0119] In the formula, and are the velocities of particle p after the k+1th and kth iterations respectively; and are the positions of particle p after the k+1th and kth iterations respectively; ω k is the inertia weight after the kth iteration; and are the first learning factor, the second learning factor and the third learning factor after the kth iteration respectively; r1, r2 and r3 are all random numbers between 0 and 1; is the average vector of all particle positions after the kth iteration; is the optimal position of particle p after the kth iteration, is the optimal position in the particle group after the kth iteration.

[0120] Step 5: Based on the updated speed and position of each particle, recalculate the fitness value of each particle and update the optimal position of each particle;

[0121] Step 6: Determine whether the current number of iterations k reaches the set maximum number of iterations; if not, set k=k+1 and return to step 2; if so, select the optimal position of the particle with the highest fitness value as the optimal solution, that is, obtain the best selection scheme for the model hyperparameters and output the final LSTM-seq2seq load prediction model.

[0122] Step S5: pre-process the historical load time series data and the historical exogenous variable time series data within the set time step before the forecast period, and input them into the trained LSTM-seq2seq load forecasting model to obtain the power load forecasting result within the forecast period.

[0123] The effectiveness of the short-term power load forecasting method provided by the present invention is verified by a specific experimental example.

[0124] Climate data, calendar data and power load data for 100 consecutive days were collected and divided into training set and test set. The last 24 days were used as prediction set and the rest as training set. The training set was trained with the EEPSO algorithm based on adaptive enhanced elite particle swarm according to the method of the present invention to train the hyperparameters of the neural network and obtain the optimal LSTM-seq2seq load prediction model. Based on the test set, the traditional support vector machine (SVM) model was compared with the LSTM-Seq2Seq model of the present invention; the output results are shown in the figure. Figure 4 As shown. The prediction result of the SVM model is shown in Figure A, and the result of the LSTM-Seq2Seq model is shown in Figure B. Among them, the root mean square error RMSE and the mean absolute percentage error MAPE of the SVM model prediction result are 2.897% and 219.908 respectively. The root mean square error RMSE and the mean absolute percentage error MAPE of the prediction result of the model of the present invention are 0.980% and 100.516 respectively. The two prediction errors of the LSTM-seq2seq load forecasting model provided by the present invention are significantly smaller than those of the traditional method, which greatly improves the prediction accuracy of the power load.

[0125] The beneficial effects of the present invention are as follows:

[0126] 1. The present invention uses the Spearman rank correlation coefficient to perform autocorrelation analysis on historical load time series data to determine the data dimension of exogenous variables in the power system, which can more objectively determine the dimension of input data and avoid sampling time steps that are too short or too long. By using data with higher correlation, the accuracy of load forecasting results can be further improved.

[0127] 2. The present invention uses a long short-term memory neural network to construct a sequence-to-sequence LSTM-seq2seq load prediction model, which can support input and output data of different lengths and has better adaptability. It overcomes the problem that traditional neural network models are prone to errors in input data, resulting in partial prediction data loss, changes in input data length, and inability to complete training well.

[0128] 3. The enhanced elite particle swarm optimization algorithm provided by the present invention has a stronger ability to handle complex, nonlinear and chaotic relationships, and can better optimize the hyperparameters of the LSTM-seq2seq load forecasting model; by optimizing the inertia weight and learning factor, it overcomes the problem that the convergence speed and convergence accuracy of the traditional PSO algorithm are difficult to coexist and it is easy to fall into the local optimum, improves the flexibility and adaptability of the global search, and has a better convergence effect, so that the finally optimized LSTM-seq2seq load forecasting model can more efficiently and accurately realize short-term power load forecasting.

[0129] Embodiment 2:

[0130] like Figure 5 As shown, the present invention provides a short-term power load forecasting device, which is used to implement the steps of the method in the above embodiment 1, and the device specifically includes:

[0131] The acquisition module is used to collect multiple groups of historical load time series data of the power system and historical exogenous variable time series data of the same time scale according to the set time step to construct the original data set;

[0132] A preprocessing module, used to preprocess the original data set to obtain a complete and usable sample set;

[0133] Build a model module to build a sequence-to-sequence LSTM-seq2seq load forecasting model using a long short-term memory neural network;

[0134] A training model module, used for training the constructed LSTM-seq2seq load forecasting model based on the sample set;

[0135] The load forecasting module is used to pre-process the historical load time series data and historical exogenous variable time series data within a set time step before the forecast period, and input them into the trained LSTM-seq2seq load forecasting model to obtain the power load forecasting results within the forecast period.

[0136] The short-term power load forecasting device provided in the embodiment of the present invention and the short-term power load forecasting method provided in Example 1 are based on the same technical concept, and can produce the beneficial effects as described in Example 1. For the contents not described in detail in this embodiment, please refer to Example 1.

[0137] Embodiment three:

[0138] A terminal provided by an embodiment of the present invention includes a processor and a storage medium;

[0139] The storage medium is used to store instructions;

[0140] The processor is used to operate according to the instruction to execute the steps of the method according to any one of the embodiments.

[0141] Embodiment 4:

[0142] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of any method described in Embodiment 1 are implemented.

[0143] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0144] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0145] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0146] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A short-term power load forecasting method, characterized in that: Methods include: Collect multiple sets of historical load time series data of the power system and historical exogenous variable time series data of the same time scale according to the set time step to construct the original data set; Preprocessing the original data set to obtain a complete and usable sample set; A sequence-to-sequence LSTM-seq2seq load forecasting model is constructed using long short-term memory neural network; Training the constructed LSTM-seq2seq load prediction model based on the sample set; After preprocessing, the historical load time series data and historical exogenous variable time series data within the set time step before the forecast period are input into the trained LSTM-seq2seq load forecasting model to obtain the power load forecast results within the forecast period.

2. The short-term power load forecasting method according to claim 1, characterized in that: The exogenous variables include climate data and calendar data. The climate data includes temperature, humidity, precipitation, air pressure, wind speed and light intensity; the calendar data includes date, time of day, holiday label and weekday label.

3. The short-term power load forecasting method according to claim 1, characterized in that: The set time step is determined by using the Spearman rank correlation coefficient to perform autocorrelation analysis on the historical load time series data, and the calculation formula is as follows: Where ρ(n) is the correlation coefficient, S(t) is the load time series of period t, S(tn) is the load time series after period t is shifted forward by n, μ1 and μ2 are the average values ​​of S(t) and S(tn), respectively, and T is the length of the historical load time series data; The value of n corresponding to the maximum correlation coefficient calculated by the above formula is the set time step, also known as the dimension of the model input data.

4. The short-term power load forecasting method according to claim 1, characterized in that: The preprocessing includes: filling missing data, eliminating abnormal data and data normalization.

5. The short-term power load forecasting method according to claim 1, characterized in that: The structure of the constructed LSTM-seq2seq load forecasting model includes: encoder and decoder; The encoder includes multiple layers of sequentially connected LSTM encoding networks, wherein the first layer of LSTM encoding network processes the input sequence x=(x1, x2, ..., x n ) obtains hidden state h1 and unit state c1 after feature encoding of the first-dimensional data x1, and obtains hidden state h2 and unit state c2 after feature encoding of the second-dimensional data x2 by combining the hidden state h1 and unit state c1, and so on, until the n-th dimensional data x n Complete encoding, and finally get the intermediate state data z n =(h n ,c n ); The decoder includes multiple layers of sequentially connected LSTM decoding networks, wherein the first layer of LSTM decoding network processes the input intermediate state data z n =(h n ,c n ) is decoded, and a new hidden state s1 and unit state v1, as well as load forecast data load1 are output and marked as y1; the second layer LSTM decoding network decodes the hidden state s1 and unit state v1 output by the first layer LSTM decoding network for the second time, and outputs a new hidden state s2 and unit state v2, as well as load forecast data load2 and marked as y2; and so on, until the mth layer LSTM decoding network outputs the load forecast data load m And marked as y m ; According to y1,y2,...,y m After sorting and splicing the load forecast data in order, the entire load forecast sequence is obtained.

6. The short-term power load forecasting method according to claim 1 or 5, characterized in that: When training the constructed LSTM-seq2seq load forecasting model, the adaptive enhanced elite particle swarm algorithm is used to optimize the model's hyperparameters; The adaptive enhanced elite particle swarm algorithm includes: training the model hyperparameters by assigning the state information of each particle in the population to the LSTM-seq2seq load forecasting model, and dynamically adjusting the inertia weight and learning factor according to the number of iterations to update the speed and position of each particle, thereby obtaining the optimal solution.

7. The short-term power load forecasting method according to claim 6, characterized in that: The step of optimizing the hyperparameters of the model using the adaptive enhanced elite particle swarm algorithm specifically includes: Step 1: Set the particle swarm size, maximum number of iterations, learning factor, and inertia weight range, and randomly generate the initial position and velocity of each particle. The state information of each particle represents a set of model hyperparameter selection options; Step 2: Assign the current optimal position of each particle to the LSTM-seq2seq load forecasting model to obtain different LSTM-seq2seq load forecasting models; Step 3: Based on the sample set, use the Adam optimizer to train each of the LSTM-seq2seq load prediction models, and use the prediction errors of each currently trained model as the fitness value of each particle; Step 4: Update the inertia weight and learning factor of each particle based on its current fitness value to update the speed and position of each particle; Step 5: Based on the updated speed and position of each particle, recalculate the fitness value of each particle and update the optimal position of each particle; Step 6: Determine whether the current number of iterations k reaches the set maximum number of iterations; if not, set k=k+1 and return to step 2; if so, select the optimal position of the particle with the highest fitness value as the optimal solution, that is, obtain the best selection scheme for the model hyperparameters and output the final LSTM-seq2seq load prediction model.

8. The short-term power load forecasting method according to claim 7, characterized in that: The model hyperparameters include the number of convolutional layers, the number of filters, the convolution kernel size, the pooling layer size, the partial random dropout rate, the random dropout rate, and the number of hidden layer neurons.

9. The short-term power load forecasting method according to claim 7, characterized in that: In step 3, the calculation formula of the prediction error of each model is as follows: In the formula, RMSE is the root mean square error, L represents the number of test samples, and y l is the true load of the lth sample, y l is the predicted load of the model for the lth sample.

10. The short-term power load forecasting method according to claim 7, characterized in that: The updating formula of the inertia weight is as follows: In the formula, ω k is the inertia weight after the kth iteration; ω1 and ω2 are the original value and the final value of the inertia weight; MAX is the maximum number of iterations set; z k and z k-1 are the parameters after the kth and k-1th iterations respectively.

11. The short-term power load forecasting method according to claim 7, characterized in that: The updating formula of the learning factor is as follows: In the formula, and are the first learning factor, the second learning factor and the third learning factor after the kth iteration, It represents the best value in the prediction error of the trained model based on the optimal position assignment of each particle at the kth iteration; τ is the set multiplier.

12. The short-term power load forecasting method according to claim 7, characterized in that: The formulas for updating the speed and position of each particle are as follows: In the formula, and are the velocities of particle p after the k+1th and kth iterations respectively; and are the positions of particle p after the k+1th and kth iterations respectively; ω k is the inertia weight after the kth iteration; and are the first learning factor, the second learning factor and the third learning factor after the kth iteration respectively; r1, r2 and r3 are all random numbers between 0 and 1; is the average vector of all particle positions after the kth iteration; is the optimal position of particle p after the kth iteration, is the optimal position in the particle group after the kth iteration.

13. A short-term power load forecasting device, running the short-term power load forecasting method according to any one of claims 1 to 12, characterized in that: The device includes: The acquisition module is used to collect multiple groups of historical load time series data of the power system and historical exogenous variable time series data of the same time scale according to the set time step to construct the original data set; A preprocessing module, used to preprocess the original data set to obtain a complete and usable sample set; Build a model module to build a sequence-to-sequence LSTM-seq2seq load forecasting model using a long short-term memory neural network; A training model module, used for training the constructed LSTM-seq2seq load forecasting model based on the sample set; The load forecasting module is used to pre-process the historical load time series data and historical exogenous variable time series data within a set time step before the forecast period, and input them into the trained LSTM-seq2seq load forecasting model to obtain the power load forecasting results within the forecast period.

14. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-12.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

Citation Information

Cited By

  • Intelligent control method and system for commercial energy storage

    CN120357522A