LSTM load prediction method and system based on meteorological factors and wavelet transform, medium and processor
By decomposing the power grid load data into components of different frequencies and building a multi-input LSTM prediction model, the problem in the prior art is solved that it is difficult to reflect the superposition impact of load laws, and the prediction accuracy and model learning ability are improved.
Patent Information
- Application Number
- CN202411439656.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-03-11
AI Technical Summary
The prior art is difficult to effectively reflect the superposition of many different laws in the grid load, resulting in the weakening or disappearance of short-term laws, thereby increasing prediction errors.
The LSTM load prediction method based on meteorological factors and wavelet transformation is used to decompose the grid load data into several load components of different frequencies. The regularity and periodicity of each component are more obvious, and then a multi-input LSTM prediction model is constructed for prediction.
By decomposing the load data, the prediction accuracy is improved, the components of short-term laws are avoided from being weakened or disappeared, and the model's learning ability to achieve the complexity of load changes is enhanced.
Smart Images

Figure CN119602216A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid load forecasting, and in particular to an LSTM load forecasting method, system, medium and processor based on meteorological factors and wavelet transform. Background Art
[0002] Domestic and foreign scholars have conducted a lot of research on the prediction methods of power grid load data, including using an improved GRU network to propose a prediction method for cooling load of large public buildings; using the BiLSTM model with integrated attention mechanism to realize the prediction of power load; based on the improved LSTM method, the short-term load prediction of the substation area is realized; or with the help of reduced-dimensional meteorological data, the short-term power load prediction is realized by integrating deep learning technology. However, since the power grid load is not only greatly affected by meteorological factors and seasonal fluctuations, the traditional load prediction model, whether it is the neural network method or the time series method, cannot reflect the superposition of many different laws. Instead, the entire load data is used for prediction, which greatly weakens or even eliminates the short-term laws. This may be an important source of prediction errors, and it is difficult for general load prediction methods to achieve good prediction results.
[0003] In view of this, a LSTM load forecasting method, system, medium and processor based on meteorological factors and wavelet transform are needed. Summary of the invention
[0004] In view of the problem that the existing technology cannot reflect the superposition of many different laws, the present invention provides an LSTM load forecasting method, system, medium and processor based on meteorological factors and wavelet transform, which can decompose the original load data into several components, and the regularity and periodicity of each component are more obvious, so the prediction accuracy is also higher. The specific technical solution is as follows:
[0005] An LSTM load forecasting method based on meteorological factors and wavelet transform includes:
[0006] S1: Collect power load and meteorological historical data and pre-process them;
[0007] S2: Decompose the preprocessed load data by wavelet transform to obtain several load components with different frequencies;
[0008] S3: Divide each load component obtained by decomposition and the meteorological data of the corresponding time scale into a training set and a test set respectively;
[0009] S4: A multi-input LSTM prediction model is constructed based on each load component, and training is performed by extracting time series features from the training set data in a targeted manner;
[0010] S5: Use the test set data to test the trained LSTM prediction model, calculate the prediction error, and analyze and evaluate the quality of the prediction model based on the prediction error;
[0011] S6: Use the trained LSTM prediction model to predict each load component for a continuous time period using a rolling prediction method;
[0012] S7: Reconstruct the load forecast data according to each load component obtained to obtain a complete hourly load forecast result;
[0013] S8: Perform a denormalization transformation on the load forecast result to obtain a true forecast value.
[0014] Furthermore, the data preprocessing includes filling of missing data, vertical processing of data, horizontal processing of data and normalization processing.
[0015] Furthermore, the normalization processing formula is as follows:
[0016] In the above formula, x max and x min Represents the maximum and minimum values of the load in this set; x i is the actual load data; is the normalized load data. After normalization, the data is converted to the [0,1] interval.
[0017] Furthermore, the load components of several different frequencies are obtained, and the formula is as follows:
[0018] P(t)=B(t)+W(t)+S(t)+V(t);
[0019] In the above formula, P(t) is the total system load at time t; B(t) is the normal load component at time t; W(t) is the load component affected by weather factors at time t; S(t) is the load component affected by special events at time t; V(t) is the random load component at time t.
[0020] Furthermore, the calculation formulas of the gate units of each part of the LSTM prediction model are as follows:
[0021] f t =σ(W f [h t-1 ,x t ]+b f );
[0022] i t =σ(W i [h t-1 ,x t ]+b i );
[0023] g t =tanh(W f [h t-1 ,x t ]+b c );
[0024] C t =f t ×C t-1 +i t ×g t ;
[0025] o t =σ(W o [h t-1 ,x t ]+b o );
[0026] h t =o t *tanh(C t );
[0027] In the above formula, f t Represents the forget gate, reflecting the degree to which the output of the previous hidden layer is forgotten; i t Represents the input gate, which controls the extent to which the input and current computational state are updated to the memory unit; o t Represents the output gate, which controls the input and current output depending on the degree of the current memory unit; x t Indicates the input quantity; g t Indicates the input node; h t Indicates intermediate output; W f , W i , W c , W o Respectively represent the weights of the corresponding gates; h t-1 Represents the hidden state vector of the previous cell; C t represents the updated state memory unit; several bs represent the deviation matrix; σ(x) is the activation function Sigmoid; tanh is the hyperbolic tangent function.
[0028] Furthermore, the calculation of the prediction error includes calculating the root mean square error and the mean square error between the predicted load data and the actual load data, and the formula is as follows:
[0029]
[0030] In the above formula, RMSE is the root mean square error; MAE is the mean square error; Represents the predicted value, y i Represents the true value.
[0031] Further, in step S6, the use of the trained LSTM prediction model to predict each load component for a continuous time period using a rolling prediction method includes the following steps:
[0032] S61: extracting data from each load component database, sorting the data, and obtaining continuous time series state data of each load component;
[0033] S62: using the current data as input, using the LSTM prediction model to predict the data, and obtaining a first set of prediction results for each load component;
[0034] S63: The first set of prediction results and the original data are used as inputs for the second prediction, and the LSTM prediction model is used for prediction to obtain the second set of prediction results. The prediction is performed in this way, and the long-term and short-term prediction data of the power grid load can be obtained.
[0035] An LSTM load forecasting system based on meteorological factors and wavelet transform, applied to the above-mentioned LSTM load forecasting method based on meteorological factors and wavelet transform, comprises:
[0036] A collection module, which is used to collect power load and meteorological historical data and perform preprocessing;
[0037] A decomposition module is used to perform wavelet transform decomposition on the preprocessed load data to obtain a number of load components with different frequencies;
[0038] A partitioning module is used to divide each load component obtained by decomposition and the meteorological data of the corresponding time scale into a training set and a test set respectively;
[0039] The construction module is used to build a multi-input LSTM prediction model according to each load component, and train it by extracting the time series features in the training set data;
[0040] The test module is used to test the trained LSTM prediction model using the test set data, calculate the prediction error, and analyze and evaluate the quality of the prediction model based on the prediction error;
[0041] The prediction module is used to use the trained LSTM prediction model to predict each load component for a continuous time period using a rolling prediction method;
[0042] A reconstruction module, which is used to reconstruct the load forecast data according to each load component obtained to obtain a complete hourly load forecast result;
[0043] The conversion module is used to perform a denormalization conversion on the load forecast result to obtain a true forecast value.
[0044] A computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned LSTM load forecasting method based on meteorological factors and wavelet transform.
[0045] A processor is used to run a program, wherein the program executes the above-mentioned LSTM load forecasting method based on meteorological factors and wavelet transform when running.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] 1. By decomposing the original load data into several components, the regularity and periodicity of each component are more obvious, and then prediction is made based on each component to avoid the short-term regular components being greatly weakened or even disappearing. Therefore, the prediction accuracy of this scheme is also higher.
[0048] 2. By better understanding and utilizing the temporal features in the data, the LSTM model considering meteorological factors can more accurately capture the complexity of load changes, thereby improving the accuracy of future load forecasts. This shows that the auxiliary role of meteorological factors not only makes the model more adaptable, but also enhances the model's ability to learn the potential complexity in load changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.
[0050] Figure 1 A schematic diagram of a flow chart of an LSTM load forecasting method based on meteorological factors and wavelet transform according to the present invention;
[0051] Figure 2 The middle is a schematic diagram of the wavelet decomposition tree structure;
[0052] Figure 3 It is a schematic diagram of the original load curve and the decomposed load curve;
[0053] Figure 4 This is a schematic diagram of a single LSTM network structure;
[0054] Figure 5 This is a schematic diagram of the multi-layer LSTM prediction model structure;
[0055] Figure 6 This is a flowchart of the rolling forecast method. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0058] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0059] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0060] Embodiment 1
[0061] The grid load forecast follows the principle of "large near and small far", that is, when the forecast time is close to the historical load data, the correlation is greater; when the forecast time is far from the historical load data, the correlation is smaller.
[0062] like Figure 1 The figure shows a flow chart of an LSTM load forecasting method based on meteorological factors and wavelet transform, which specifically includes the following steps:
[0063] S1: Collect historical data and fill in missing data, perform vertical and horizontal data normalization, and unify different data scales to make model training more accurate.
[0064] Historical data includes power load data and meteorological data. Power load data includes real daily load data, which is collected at 24 collection points every day with a time interval of 1 hour. Meteorological data includes two categories: one is the maximum temperature, minimum temperature, average temperature, day type and other attributes, which are collected as daily average data; the other is daily rainfall and humidity data, which are collected at 24 collection points every day with a time interval of 1 hour. The meteorological data are shown in Table 1 below:
[0065] Table 1 Types, variable symbols and values of meteorological data
[0066]
[0067] The establishment of a prediction model requires a large amount of historical load data. With the widespread application of modern energy management systems in power energy management, human errors in manually recorded data have been avoided. However, in addition to interference from the energy management system during data transmission or failures in the system itself, improper human operation, emergencies, or artificial power outages may cause a lot of bad data to be mixed in the historical data. The existence of bad data has a great impact on load forecasting, so it is necessary to preprocess the data.
[0068] The preprocessing of historical data mainly considers comparing the original data with the typical load curve. If the error between the original data and the typical load curve is too large, it will be corrected and removed.
[0069] Further, the specific practices are mainly:
[0070] 1) Filling in missing data: Use the loads of several days before and after the same day, and use the principle of large near and small far to perform weighted processing;
[0071] 2) Vertical processing of data. The loads at the same time on similar days are similar. If the load difference at the same time on similar days is too large, then consider correcting it;
[0072] 3) Horizontal processing of data: In data analysis, the load data of the previous and next moments are used as the benchmark. If the load change of the previous and next moments exceeds the maximum load change threshold of the previous and next moments, the load data is considered to be corrected.
[0073] Data preprocessing includes normalizing the input samples to avoid the impact of large differences in the magnitude of input vectors on training results.
[0074] Furthermore, the normalization formula is as follows:
[0075]
[0076] In the above formula, x max and x min represents the maximum and minimum values of the load in this set, x i is the actual load data, is the normalized load data. After normalization, the data is converted to the [0,1] interval.
[0077] S2: Perform wavelet transform decomposition on the pre-processed load data to obtain a number of load components with different frequencies, wherein the load components include regular load components with strong periodicity and random load components affected by meteorological conditions.
[0078] Furthermore, load data can generally be decomposed into four load components, which are described as follows:
[0079] P(t)=B(t)+W(t)+S(t)+V(t);
[0080] In the above formula, P(t) is the total system load at time t; B(t) is the basic normal load component at time t; W(t) is the load component affected by weather factors at time t; S(t) is the load component affected by special events at time t; V(t) is the random load component at time t.
[0081] In traditional load forecasting models, whether neural network method or time series method, they cannot reflect the superposition of many different laws. Instead, they use the entire load data for forecasting, which greatly weakens or even eliminates short-term laws. This may be an important source of forecasting errors. This application divides irregular load fluctuations into several regular fluctuations that follow certain rules. For example, the first type has a small change amplitude, a short cycle, and a high degree of randomness; the second and third types have large change amplitudes, long cycles, and are relatively stable, so that the load can be decomposed into different frequency bands.
[0082] Wavelet transform (WT) is one of the means of data mining. It is a time-frequency domain analysis method that can capture any tiny part of a weak signal for analysis. It is particularly sensitive to the singularity of the signal and can handle weak or mutation signals. Through orthogonal binary wavelet transform, the load data can be projected to different scales. The load data of each scale can be regarded as different frequency bands. The load data on each frequency band represents the components of different frequencies of the original sequence, which more clearly expresses the regularity and periodicity. On this basis, the sub-load components on each frequency band are predicted separately. Since the regularity and periodicity of the sub-load components at each decomposition scale are more obvious, the prediction accuracy is also higher. By reorganizing the load, a complete hourly load forecast result is obtained, and the result is further improved than directly predicting the original load.
[0083] Wavelet transform includes a variety of transform algorithms. Among them, binary wavelet transform of load data retains all the information of the original signal and discretizes it in scale. Compared with continuous wavelet transform, it has less calculation and greater data compression ratio. The load formula for wavelet decomposition using Mallat is as follows:
[0084]
[0085] Where hj and gj are discrete filters. It represents the low-frequency component and high-frequency component of wavelet decomposition. Mallat uses a two-decimation method to shorten the original sequence by half, greatly reducing the amount of calculation in wavelet transform, improving the speed of real-time processing of a large amount of information in engineering, and is more suitable for processing non-stationary sequences in engineering. Since load data is a non-stationary random sequence, using Mallat for wavelet decomposition and reconstruction is more suitable for load forecasting.
[0086] There are other wavelet transform methods. For example, in the following implementation, the monitoring data extracted from the SCADA power monitoring system installed in a shopping mall supermarket in summer was selected for wavelet decomposition. The decomposition results are also different when different wavelet bases and decomposition scales are selected. Table 2 shows the main features of the commonly used wavelets in the MATLAB toolbox.
[0087] Table 2
[0088]
[0089] Daubechies wavelet has good compact support and regularity, and the time series law after decomposition is more obvious, so Daubechies wavelet is usually used for wavelet transform of load data. Using the characteristics of multi-resolution wavelet, low-frequency signals can be decomposed into the next level of low-frequency signals and high-frequency signals. The original signal can be regarded as the superposition of the final signal after decomposition, that is:
[0090] S = A3 + D3 + D2 + D1;
[0091] Figure 2 The 3-layer decomposition tree structure diagram is shown in the figure. If further wavelet transform results are required, A3 can be further decomposed into A4 and D4 wavelet signals. For the decomposition scale, if the scale is too small, it is impossible to obtain the detailed information of each frequency band, and the superiority of the wavelet transform cannot be reflected; if the scale is too large, more prediction models are required to predict the load data. Since each model will introduce some errors, it is easy to cause the final prediction error to become larger. At the same time, too many models will also reduce the calculation speed. It is generally considered that decomposition to scale 3 is more appropriate. This embodiment selects the db3 wavelet to decompose the load data, and uses the wavedec wavelet decomposition and wrcoef wavelet reconstruction functions in MATLAB to perform wavelet transform. Its format is
[0092] [C,L]=wavedec(X,N,'wname'), the format is [C,L]=wavedec(X,N,'wname'), where C and L have the following meanings: Figure 2 As shown, the wrcoef wavelet reconstruction function uses a zero-filling expansion mode to load a one-dimensional signal.
[0093] Figure 3The original load curve recorded by the SCADA system and the decomposed load curve, where a0 is the original load data and a3 is the low-frequency load data, which reduces the non-stationarity of the original load data and has obvious daily periodicity, maintaining the shape of the original load. It can be considered as the base load part of the load and has strong predictability. d2 and d3 are the high-frequency parts of the load, which fluctuate with a period of about 4h to 12h. The high-frequency component d1 has a smaller value and fluctuates with a period of 2-4h, with strong randomness.
[0094] S3: Divide each load component obtained by decomposition and the meteorological data of the corresponding time scale into a training set and a test set, and set the ratio of the training set to the test set to 70% and 30% respectively in chronological order.
[0095] S4: A multi-input LSTM prediction model is constructed based on each load component, and the training is carried out by extracting the time series features in the training set data in a targeted manner. The long short-term memory network (LSTM) is used to extract the time series features in the data to facilitate the complex time series relationship in the modeling data and provide more accurate model support for subsequent load forecasting. Furthermore, for each time step, 24 load data and 7 meteorological data are connected together to form an input vector.
[0096] Furthermore, the LSTM prediction model constructs multiple LSTM layers in the hidden layer part to enhance the learning ability of the model, which helps the network capture the time dependency in the data; in the output part, the next sampling period is used as the output to predict the short-term trend of the load data.
[0097] Furthermore, when training the LSTM prediction model, the number of input, output and hidden layer nodes were set to 31, 24 and 30 respectively, and the number of iterations was 500 rounds; the Adam optimizer was selected as the gradient descent method; the tanh function was selected as the activation function; and the learning rate was set to 0.0005.
[0098] like Figure 4 , Figure 5 As shown in the figure, the Long Short-Term Memory Network (LSTM) is a network structure proposed to solve the problem of gradient disappearance in traditional recurrent neural networks (RNNs) during training. It has stronger memory capacity and better long-term dependency modeling capabilities. The key idea is to introduce a structure called a "memory unit" that is used to store and access long-term memory information. The memory unit consists of a vector called a "cell state" that can transfer information between different time steps. In addition, LSTM also contains three gating units, namely the input gate, forget gate, and output gate, which are used to control the flow and update of information, so as to achieve accurate modeling of sequence data and effective management of long-term memory.
[0099] In the LSTM network, time series feature extraction is accomplished through the long short-term memory unit of LSTM. The LSTM unit has a memory unit and three gates (input gate, forget gate, and output gate). Through these structures, the model can effectively capture the long-term dependencies in the data; at the same time, through learning at different time steps, the model can extract time series features in the data, including seasonal changes in load data, periodic trends, and sensitivity to abnormal events.
[0100] At each time step, in order to enable the model to pay more attention to important information related to time series features, the LSTM unit selectively accepts the load data and meteorological data of the current time step through the input gate; at the same time, to ensure that the model can forget unimportant information, the model maintains a reasonable memory capacity in a long time series through the storage of the forget gate; in the memory unit update phase, the LSTM unit maintains an internal state so that the model can correctly reflect the trend of load increase in winter every year or the difference in load patterns between weekdays and weekends; finally, through the output gate, the LSTM unit generates predictions for future load changes and sensitivity to abnormal load events, such as sudden high or low load conditions. Through such a time series feature extraction process, the LSTM network can model complex time series relationships in the data and provide more accurate model support for subsequent load forecasting.
[0101] The definitions of each gate unit and the related calculation formulas are as follows:
[0102] f t =σ(W f [h t-1 ,x t ]+b f );
[0103] i t =σ(W i [h t-1 ,x t ]+b i );
[0104] g t =tanh(W f [h t-1 ,x t ]+b c );
[0105] C t =f t ×C t-1 +i t ×g t ;
[0106] o t =σ(W o [ht-1 ,x t ]+b o );
[0107] h t =o t *tanh(C t );
[0108] In the above formula, f t Represents the forget gate, reflecting the degree to which the output of the previous hidden layer is forgotten; i t Represents the input gate, which controls the extent to which the input and current computational state are updated to the memory unit; o t Represents the output gate, which controls the input and current output depending on the degree of the current memory unit; x t Indicates the input quantity; g t Indicates the input node; h t Indicates intermediate output; W f , W i , W c , W o Respectively represent the weights of the corresponding gates; h t-1 Represents the hidden state vector of the previous cell; C t represents the updated state memory unit; several bs represent the deviation matrix; σ(x) is the activation function Sigmoid; tanh is the hyperbolic tangent function.
[0109] S5: Use the test set data to test the trained LSTM prediction model, calculate the prediction error, and analyze and evaluate the quality of the prediction model based on the prediction error.
[0110] Furthermore, the prediction error is calculated, and analysis and evaluation based on the prediction error helps to evaluate the quality of the prediction method and make improvements. There are mainly the following prediction error analysis methods:
[0111] Absolute error AE:
[0112]
[0113] y i is the actual load data, is the predicted load data;
[0114] Relative error RE:
[0115]
[0116] In order to accurately reflect the prediction performance, the root mean square error (RMSE) and mean absolute error (MAE) between the predicted load data and the actual load data can also be calculated as shown below:
[0117]
[0118] In the above formula, Represents the predicted value, y i Represents the true value.
[0119] The commonly used prediction model is compared with the prediction method of this scheme. Table 3 shows the evaluation indicators of the prediction day:
[0120] Table 3 Prediction evaluation indicators
[0121] Comparison Method RMSE MAE GRU 2.851 2.074 LSTM 3.002 2.397 Methods 1.557 1.168
[0122] It can be seen from the table that compared with the traditional GRU and LSTM models, the method of this embodiment has better results in evaluation indicators. In addition, by comparing the changes in RMSE and MAE, since the embodiment method takes meteorological factors into account, it has better results in evaluation indicators than the traditional GRU and LSTM models. This shows that the introduction of meteorological factors has a significant positive impact on load forecasting and provides a more comprehensive source of information for the model. By better understanding and utilizing the time series characteristics in the data, the LSTM model considering meteorological factors can more accurately capture the complexity of load changes, thereby improving the prediction accuracy of future loads. This shows that the auxiliary role of meteorological factors not only makes the model more adaptable, but also enhances the model's ability to learn the potential complexity in load changes.
[0123] S6: Figure 6 As shown in the figure, the trained LSTM prediction model is used to predict each load component for a continuous time period using the rolling prediction method. In order to ensure the real-time and continuity of the prediction data and enable the model to adapt to changes in the data, the future load data is predicted through a gradual update and rolling prediction method.
[0124] The specific steps include:
[0125] S61: extracting data from each load component database, sorting the data, and obtaining continuous time series state data of each load component;
[0126] S62: using the current data as input, using the LSTM prediction model to predict the data, and obtaining a first set of prediction results for each load component;
[0127] S63: The first set of prediction results and the original data are used as inputs for the second prediction, and the LSTM prediction model is used for prediction to obtain the second set of prediction results. The prediction is performed in this way, and the long-term and short-term prediction data of the power grid load can be obtained.
[0128] S7: Reconstruct the load forecast data according to the obtained load components to obtain a complete hourly load forecast result.
[0129] Furthermore, the Mallat algorithm (correspondingly, the Mallat algorithm is also used in decomposition) can be used to reconstruct the load forecast data. The formula is as follows:
[0130]
[0131] Furthermore, the wrcoef wavelet reconstruction function may be used to perform wavelet transform reconstruction. The wrcoef wavelet reconstruction function adopts a zero-filling expansion mode to load a one-dimensional signal.
[0132] S8: Perform a denormalization transformation on the load forecast result to obtain a true forecast value.
[0133] Furthermore, the following formula is used to convert the data into true prediction values:
[0134]
[0135] In the above formula, Represents the predicted value, y i Represents the true value.
[0136] Compared with traditional prediction methods, the method of this embodiment significantly improves the accuracy of prediction, provides more reliable results for load management, and further promotes the application of power system load data.
[0137] Embodiment 2
[0138] An LSTM load forecasting system based on meteorological factors and wavelet transform, applied to the above-mentioned LSTM load forecasting method based on meteorological factors and wavelet transform, comprises:
[0139] A collection module, which is used to collect power load and meteorological historical data and perform preprocessing;
[0140] A decomposition module is used to perform wavelet transform decomposition on the preprocessed load data to obtain a number of load components with different frequencies;
[0141] A partitioning module is used to divide each load component obtained by decomposition and the meteorological data of the corresponding time scale into a training set and a test set respectively;
[0142] The construction module is used to build a multi-input LSTM prediction model according to each load component, and train it by extracting the time series features in the training set data;
[0143] The test module is used to test the trained LSTM prediction model using the test set data, calculate the prediction error, and analyze and evaluate the quality of the prediction model based on the prediction error;
[0144] The prediction module is used to use the trained LSTM prediction model to predict each load component for a continuous time period using a rolling prediction method;
[0145] A reconstruction module, which is used to reconstruct the load forecast data according to each load component obtained to obtain a complete hourly load forecast result;
[0146] The conversion module is used to perform a denormalization conversion on the load forecast result to obtain a true forecast value.
[0147] Embodiment 3
[0148] A computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned LSTM load forecasting method based on meteorological factors and wavelet transform.
[0149] Embodiment 4
[0150] A processor is used to run a program, wherein the program executes the above-mentioned LSTM load forecasting method based on meteorological factors and wavelet transform when running.
[0151] The present application provides an LSTM load forecasting method based on meteorological factors and wavelet transform, comprising: S1: collecting power load and meteorological historical data and preprocessing them; S2: performing wavelet transform decomposition on the preprocessed load data to obtain a number of load components of different frequencies; S3: dividing each load component obtained by decomposition and the meteorological data of the corresponding time scale into a training set and a test set respectively; S4: constructing a multi-input LSTM forecasting model according to each load component, and training it by extracting the time series features in the training set data in a targeted manner; S5: using the test set data to test the trained LSTM forecasting model, calculating the forecast error, and analyzing and evaluating the quality of the forecasting model based on the forecast error; S6: using the trained LSTM forecasting model to adopt a rolling forecasting method to forecast each load component for a continuous time period; S7: reconstructing the load forecasting data according to the obtained load components to obtain a complete hourly load forecasting result; S8: performing a denormalization transformation on the load forecasting result to obtain a true forecast value. By decomposing the original load data into several components, the regularity and periodicity of each component are more obvious. Then, prediction is made based on each component to avoid the components with short-term regularity being greatly weakened or even disappearing. Therefore, the prediction accuracy of this scheme is also higher. By better understanding and utilizing the time series characteristics in the data, the LSTM model considering meteorological factors can more accurately capture the complexity of load changes, thereby improving the prediction accuracy of future loads. This shows that the auxiliary role of meteorological factors not only makes the model more adaptable, but also enhances the model's ability to learn the potential complexity in load changes.
[0152] Those of ordinary skill in the art will appreciate that the units of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition of each example has been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0153] In the embodiments provided by the present invention, it should be understood that the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units can be combined into one unit, one unit can be split into multiple units, or some features can be ignored, etc.
[0154] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0155] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-0nlyMemory), random access memory (RAM, RandomAccessMemory), mobile hard disk, magnetic disk or optical disk, etc., which can store program code.
[0156] 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 aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
Claims
1. An LSTM load forecasting method based on meteorological factors and wavelet transform, characterized in that: include: S1: Collect power load and meteorological historical data and pre-process them; S2: Decompose the preprocessed load data by wavelet transform to obtain several load components with different frequencies; S3: Divide each load component obtained by decomposition and the meteorological data of the corresponding time scale into a training set and a test set respectively; S4: A multi-input LSTM prediction model is constructed based on each load component, and training is performed by extracting time series features from the training set data in a targeted manner; S5: Use the test set data to test the trained LSTM prediction model, calculate the prediction error, and analyze and evaluate the quality of the prediction model based on the prediction error; S6: Use the trained LSTM prediction model to predict each load component for a continuous time period using a rolling prediction method; S7: Reconstruct the load forecast data according to each load component obtained to obtain a complete hourly load forecast result; S8: Perform a denormalization transformation on the load forecast result to obtain a true forecast value.
2. The LSTM load forecasting method based on meteorological factors and wavelet transform according to claim 1 is characterized in that: The data preprocessing includes filling missing data, vertical processing of data, horizontal processing of data and normalization processing.
3. The LSTM load forecasting method based on meteorological factors and wavelet transform according to claim 1 is characterized in that: The normalization processing formula is as follows: In the above formula, x max and x min Represents the maximum and minimum values of the load in this set; x i is the actual load data; is the normalized load data. After normalization, the data is converted to the [0,1] interval.
4. The LSTM load forecasting method based on meteorological factors and wavelet transform according to claim 1 is characterized in that: The above-mentioned load components with different frequencies are obtained by the following formula: P(t)=B(t)+W(t)+S(t)+V(t); In the above formula, P(t) is the total system load at time t; B(t) is the normal load component at time t; W(t) is the load component affected by weather factors at time t; S(t) is the load component affected by special events at time t; V(t) is the random load component at time t.
5. The LSTM load forecasting method based on meteorological factors and wavelet transform according to claim 1 is characterized in that: The calculation formulas of the gate units of each part of the LSTM prediction model are as follows: f t =σ(W f [h t-1 ,x t ]+b f ); i t =σ(W i [h t-1 ,x t ]+b i ); g t =tanh(W f [h t-1 ,x t ]+b c ); C t =f t ×C t-1 +i t ×g t ; the t =σ(W o [h t-1 ,x t ]+b o ); h t =o t *tanh(C t ); In the above formula, f t Represents the forget gate, reflecting the degree to which the output of the previous hidden layer is forgotten; i t Represents the input gate, which controls the extent to which the input and current computational state are updated to the memory unit; o t Represents the output gate, which controls the input and current output depending on the degree of the current memory unit; x t Indicates the input quantity; g t Indicates the input node; h t Indicates intermediate output; W f , W i , W c , W o Respectively represent the weights of the corresponding gates; h t-1 Represents the hidden state vector of the previous cell; C t represents the updated state memory unit; several bs represent the deviation matrix; σ(x) is the activation function Sigmoid; tanh is the hyperbolic tangent function.
6. The LSTM load forecasting method based on meteorological factors and wavelet transform according to claim 1 is characterized in that: The calculation of the prediction error includes calculating the root mean square error and the mean square error between the predicted load data and the actual load data, and the formula is as follows: In the above formula, RMSE is the root mean square error; MAE is the mean square error; Represents the predicted value, y i Represents the true value.
7. The LSTM load forecasting method based on meteorological factors and wavelet transform according to claim 1 is characterized in that: In step S6, the trained LSTM prediction model is used to predict each load component for a continuous time period using a rolling prediction method, including the following steps: S61: extracting data from each load component database, sorting the data, and obtaining continuous time series state data of each load component; S62: using the current data as input, using the LSTM prediction model to predict the data, and obtaining a first set of prediction results for each load component; S63: The first set of prediction results and the original data are used as inputs for the second prediction, and the LSTM prediction model is used for prediction to obtain the second set of prediction results. The prediction is performed in this way, and the long-term and short-term prediction data of the power grid load can be obtained.
8. An LSTM load forecasting system based on meteorological factors and wavelet transform, characterized in that: The LSTM load forecasting method based on meteorological factors and wavelet transform applied to any one of claims 1 to 7 comprises: A collection module, which is used to collect power load and meteorological historical data and perform preprocessing; A decomposition module is used to perform wavelet transform decomposition on the preprocessed load data to obtain a number of load components with different frequencies; A partitioning module is used to divide each load component obtained by decomposition and the meteorological data of the corresponding time scale into a training set and a test set respectively; The construction module is used to build a multi-input LSTM prediction model according to each load component, and train it by extracting the time series features in the training set data; The test module is used to test the trained LSTM prediction model using the test set data, calculate the prediction error, and analyze and evaluate the quality of the prediction model based on the prediction error; The prediction module is used to use the trained LSTM prediction model to predict each load component for a continuous time period using a rolling prediction method; A reconstruction module, which is used to reconstruct the load forecast data according to each load component obtained to obtain a complete hourly load forecast result; The conversion module is used to perform a denormalization conversion on the load forecast result to obtain a true forecast value.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the LSTM load forecasting method based on meteorological factors and wavelet transform as described in any one of claims 1 to 7.
10. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the LSTM load forecasting method based on meteorological factors and wavelet transform as described in any one of claims 1 to 7.