Short-term load forecasting method, system and storage medium integrating time series decomposition and machine learning model

Through deep learning combined with time series decomposition and machine learning, the ARIMA, GRU and TimesNet models are used to accurately predict trend, seasonal and residual components of power load data, which solves the shortcomings of traditional methods in dealing with nonlinear and large-scale data. Improve the accuracy and stability of power load prediction.

CN118229119BActive Publication Date: 2024-11-12NANJING TECH UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410644746.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-11-12
Estimated Expiration
2044-05-23

AI Technical Summary

Technical Problem

The prior art is difficult to effectively process nonlinear and large-scale data in power load prediction. Traditional timing models process non-stationary data cumbersome and information is lost. The decision-making process of machine learning models is difficult to explain, resulting in insufficient prediction accuracy and stability.

Method used

Deep learning method combined with time series decomposition and machine learning, and obtain trend, seasonal and residual components through STL decomposition, and use ARIMA, GRU and TimesNet models for accurate prediction, and use the prediction results through the full connection layer to improve prediction performance and resistance. Interference capability.

Benefits of technology

It improves the accuracy and robustness of short-term load prediction, enhances the anti-interference ability of the model, can effectively capture the periodic fluctuations of power load, and provides more scientific and accurate power load prediction support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118229119B_ABST
    Figure CN118229119B_ABST
Patent Text Reader

Abstract

The present invention provides a short-term load forecasting method, system and storage medium integrating time series decomposition and machine learning models, using STL to decompose trend, season and residual components, improving the performance of the forecasting model input data, respectively applying ARIMA, GRU and TimesNet models to accurately forecast different components, and obtaining the forecast results through the fully connected layer, which can effectively improve the overall forecasting performance, enhance the anti-interference ability of the model, and improve the accuracy of the forecast. The present invention combines deep learning with machine learning to make up for the shortcomings of traditional methods. The comprehensive application of ARIMA, GRU and TimesNet models further enhances the accuracy and robustness of load forecasting, provides a new perspective and method for load forecasting, promotes the development of power load forecasting technology, and provides more scientific and accurate data support for the planning and operation decisions of power systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of electric power technology, and in particular relates to a short-term load forecasting method, system and storage medium integrating time series decomposition and machine learning models. Background Art

[0002] As a key link in power system planning and operation management, power demand forecasting is essential to ensure the economic and efficient operation of power systems. Advanced technologies are widely used in power load forecasting, which greatly improves the accuracy and efficiency of forecasting.

[0003] In the existing technology, researchers use simple traditional time series forecasting methods and machine learning, such as STL decomposition, to decompose load data into components such as trend, seasonality and residual, so that the internal structure and change pattern of the data can be clearly displayed, which plays a vital role in further data classification and stable operation. However, traditional methods cannot better handle nonlinear and large-scale data, introduce shared models on the same data set, and require manual feature engineering. In addition, many traditional time series models require that the data is stationary, that is, with a constant mean and variance. For non-stationary data, preprocessing steps such as difference and logarithmic transformation are required first, which may lead to information loss; in terms of machine learning, compared with traditional statistical models, the internal decision-making process of many machine learning models is difficult to explain, so traditional methods have defects in data processing complexity, stability and interpretability.

[0004] In order to solve the above defects, the present invention designs a new technical solution, a short-term load combination forecasting method, system and storage medium that integrates time series decomposition and machine learning, which combines deep learning methods with machine learning to make up for the shortcomings of traditional methods. Summary of the invention

[0005] In view of the shortcomings in the prior art, the present invention provides a short-term load forecasting method, system and storage medium that integrate time series decomposition and machine learning models. STL is used to decompose trend, seasonal and residual components, and ARIMA, GRU and TimesNet models are used to accurately predict different components. The prediction results are obtained through the fully connected layer, which improves the overall prediction performance, enhances the model's anti-interference ability, and improves the prediction accuracy.

[0006] The present invention achieves the above technical objectives through the following technical means.

[0007] A short-term load forecasting method integrating time series decomposition and machine learning model includes the following processes:

[0008] Step 1: Preprocess the historical load data and then use the Kalman filter to perform denoising;

[0009] Step 2: Perform time series decomposition on the historical load data processed in step 1 to obtain trend component, seasonal component and residual component;

[0010] Step 3: Use the trend component as the input data set of the ARIMA model, the seasonal component as the input data set of the GRU model, and the residual component as the input data set of the TimesNet model. Use the fully connected layer to fuse the prediction results of the three groups of models to obtain a combined prediction model.

[0011] Step 4: Train the combined prediction model obtained in step 3 on the training set;

[0012] Step 5: Use the root mean square error RMSE, mean absolute percentage error MAPE, and mean absolute error MAE to measure the prediction accuracy of the combined prediction model trained in step 4.

[0013] Furthermore, the specific process of step 2 is as follows:

[0014] Step 2.1: The time series decomposition formula is shown in formula (3). Formulas (4) and (5) represent the calculation formulas of trend component and seasonal component respectively:

[0015] (3)

[0016] (4)

[0017] (5)

[0018] In the formula, , , , Respectively expressed in time , , , The observed value at express Trend value at the moment; express Seasonal item value at the moment; Represents the residual value at the moment; Representing a collection of data Middle Observed values ​​at each time point; Representing a collection of data The average of all observations in ; Represents the average value of all time points in the data set; Indicates the length of the seasonal cycle; , They represent the trend constant and the slope of the trend respectively; Indicates The time point corresponding to the observation value;

[0019] Step 2.2: Combine the three components of trend, seasonality and residual into a three-element array data set ,in, Represents a collection of trend data, represents a collection of seasonal data, Represents a collection of residual data.

[0020] Furthermore, the specific process of step 3 is as follows:

[0021] Step 3.1: Divide the triplet dataset into training set and test set;

[0022] Step 3.2: ARIMA model input and parameter setting;

[0023] Step 3.3: GRU model input and parameter setting;

[0024] Step 3.4: TimesNet model input and parameter setting;

[0025] Step 3.5: According to the prediction results of each model obtained in step 3.2, step 3.3, and step 3.4, output the prediction of each model to the fully connected layer to obtain the final combined prediction model:

[0026] (twenty two)

[0027] in, The final prediction result; represents a fully connected layer; is the ReLU activation function, is the weight matrix; is the bias vector; , , They respectively represent the prediction results of the ARIMA model, the GRU model, and the TimesNet model.

[0028] Furthermore, the specific process of step 3.2 is as follows:

[0029] Step 3.2.1: Use the training central tendency component data as input to the ARIMA model;

[0030] Step 3.2.2: Define the parameter search space for the ARIMA model, including the order of the autoregressive term , Difference times , the order of the moving mean , parameters of the seasonal ARIMA model , seasonal difference , seasonal moving average , Seasonal Cycle ;

[0031] Step 3.2.3: For each set of parameters and , fit the ARIMA model;

[0032] Step 3.2.4: Use the information criterion to evaluate the performance of each model. and As evaluation criteria, they are defined as:

[0033] (6)

[0034] (7)

[0035] in, is the likelihood function value of the model, is the number of model parameters, is the number of observation samples;

[0036] Step 3.2.5: Select the or The model with the best value is taken as the best model, and the parameters of the selected best model are output. and , used for further model prediction, to obtain the ARIMA model prediction results .

[0037] Furthermore, the specific process of step 3.3 is as follows:

[0038] Step 3.3.1: Use the seasonal component data in the training set as the input of the GRU model;

[0039] Step 3.3.2: Set the bidirectional GRU layer and the GRU fully connected layer. The initialization of the bidirectional GRU layer is expressed as:

[0040] (8)

[0041] in, For input data, , Represents the GRU model input data set, is the batch size, is the sequence length, is the characteristic dimension; and Represent the weight matrices of the forward and reverse GRU layers respectively; and Represent the bias terms of the forward and reverse GRU layers respectively;

[0042] The output of the bidirectional GRU layer is the concatenation of the hidden states in both directions, expressed as:

[0043] (9)

[0044] in, is the hidden state of the forward GRU layer, , is the dimension of the hidden state; is the hidden state of the inverse GRU layer, .

[0045] Step 3.3.3: Input Data Through the bidirectional GRU layer, the output is , take the hidden state of the last time step And through the dropout layer, and finally through the fully connected layer weight matrix and the bias term Get the predicted output of the GRU model , the formula is as follows:

[0046] (10)

[0047] (11)

[0048] in, For application Regularization function.

[0049] Furthermore, the specific process of step 3.4 is as follows:

[0050] Step 3.4.1: Use the residual component data in the training set as the input of the GRU model;

[0051] Step 3.4.2: Use fast Fourier transform to calculate the periodicity of the residual component. The formula is as follows:

[0052] (12)

[0053] (13)

[0054] (14)

[0055] in, Represents the original one-dimensional time series The intensity of each frequency component in , Represents the TimesNet model input data set, the strongest Frequency The most significant Cycle length , which has the following form:

[0056] (15)

[0057] Step 3.4.3: The original one-dimensional time series is transformed according to the selected period Folding is performed to obtain a set of two-dimensional tensors, and the process is expressed as:

[0058] (16)

[0059] (17)

[0060] in, To add 0 at the end of the sequence, the sequence can be divisible, Represents the period length calculated from the different frequency components in the time series data; Indicates The TimesBlock layer is processed to obtain the A two-dimensional tensor of periods; Indicates that in the TimesNet model, after the The one-dimensional time series features obtained after processing by TimesBlock layer; Indicates cycles; represents the number of periodic components selected in the time series analysis; Indicates converting a one-dimensional array into a two-dimensional matrix;

[0061] Step 3.4.4: Use 2D convolution to extract the two-dimensional temporal change representation, and then convert the two-dimensional into one-dimensional for information aggregation:

[0062] (18)

[0063] (19)

[0064] in, Indicates The output of the TimesBlock layer corresponds to the periodic component Two-dimensional representation of , express Model; Indicates that The 0 added by the operation is removed;

[0065] Step 3.4.5: Use the Softmax function to calculate the weights and perform weighted fusion to obtain the final prediction output of the TimesNet model:

[0066] (20)

[0067] (twenty one)

[0068] in, , Respectively represent The frequency obtained by Softmax in the TimesBlock layer , The intensity of the frequency components of , Respectively represent The frequency corresponding to the TimesBlock layer , The intensity of the frequency components of Indicates The output of the TimesBlock layer corresponds to the periodic component One-dimensional representation of .

[0069] Furthermore, the specific process of step 4 is as follows:

[0070] Step 4.1, set the ARIMA model, GRU model, TimesNet model parameters, and optimizer parameters and , learning rate , initialize network parameters , set the number of training iterations , training batch size ;

[0071] Step 4.1.1, sample from the training set obtained in step 3.1 according to the training batch size;

[0072]

[0073]

[0074]

[0075]

[0076] Step 4.1.2, , , They are used as inputs of the ARIMA model, GRU model, and TimesNet model to obtain the prediction results of each model. , , ;

[0077] Step 4.1.3: Output the prediction results of each model obtained in step 4.1.2 to the fully connected layer to obtain the final prediction result. ;

[0078]

[0079] Step 4.1.4, use the gradient descent method to update the network, calculate the loss function and the gradient of the loss function with respect to the model parameters, and update the model weights:

[0080]

[0081] in, represents the loss function;

[0082] Step 4.1.5, when the number of loop iterations is less than Return to step 4.1.1 and continue the same operation until the number of loop iterations reaches , end the loop and obtain the trained combined prediction model.

[0083] A system for implementing the above-mentioned short-term load forecasting method integrating time series decomposition and machine learning model, comprising:

[0084] The preprocessing module is used to correct and fill in abnormal values ​​and missing values ​​in the historical load data, and to perform denoising on the historical load data;

[0085] STL decomposition module, used to perform time series decomposition on the historical load data after denoising to obtain trend component, seasonal component and residual component;

[0086] The model combination prediction module is used to use the trend component as the input data set of the ARIMA model, the seasonal component as the input data set of the GRU model, and the residual component as the input data set of the TimesNet model, and fuse the prediction results of the three groups of models using a fully connected layer to obtain the combined prediction model and train it;

[0087] The evaluation module uses three indicators, namely root mean square error, mean absolute percentage error and mean absolute error, to evaluate the prediction accuracy of the model combination prediction module.

[0088] A storage medium storing computer-readable instructions, wherein the computer-readable instructions, when executed by one or more processors, control the device where the storage medium is located to execute the above-mentioned short-term load forecasting method integrating time series decomposition and machine learning model.

[0089] The present invention has the following beneficial effects:

[0090] The present invention proposes that STL can be used to decompose trend, season and residual components, improve the performance of the forecast model input data, respectively apply ARIMA, GRU and TimesNet models to accurately predict different components, and obtain the forecast results through the fully connected layer, which can effectively improve the overall forecast performance, enhance the anti-interference ability of the model, and improve the accuracy of the forecast. The present invention adopts a deep learning method combined with machine learning to make up for the shortcomings of traditional methods. The comprehensive application of ARIMA, GRU and TimesNet models further enhances the accuracy and robustness of load forecasting, can effectively capture the periodic fluctuations of power load, and deeply explore the randomness of data through two-dimensional space modeling. The integrated application of these technologies provides a new perspective and method for load forecasting, which not only promotes the development of power load forecasting technology, but also provides more scientific and accurate data support for the planning and operation decisions of power systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0091] Figure 1 It is a flow chart of the short-term load forecasting method integrating time series decomposition and machine learning model according to the present invention;

[0092] Figure 2 Obtain trend component, seasonal component and residual component diagram for STL decomposition;

[0093] Figure 3 It is a comparison chart of the prediction curve of the KF-STL combined prediction model and the prediction curves of the KF-ARIMR, KF-GRU, and KF-TimesNet models; DETAILED DESCRIPTION

[0094] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments, but the protection scope of the present invention is not limited thereto.

[0095] Embodiment 1:

[0096] Reference Figure 1 The short-term load forecasting method integrating time series decomposition and machine learning model of the present invention includes the following process:

[0097] Step 1: Export the power data in the corresponding recording instrument and organize and collect them to form historical load data, pre-process the historical load data, and use the Kalman Filter (KF) to denoise the historical load data to obtain the denoised historical load data;

[0098] Step 1.1: Preprocess the historical load data, including correcting and filling the abnormal values ​​and missing values ​​in the data, and normalizing the data. The processed data set is represented as ;

[0099] Step 1.2: Use KF to train the dataset Perform denoising, the formula is as follows:

[0100] (1)

[0101] (2)

[0102] In the formula, Respectively indicate time , state estimation; Indicates at time The predicted state of information; represents the state transfer matrix, which represents the evolution of the state over time; represents the Kalman gain, which is used to adjust the prediction error; Indicates time The actual observed value of represents the measurement matrix;

[0103] Setting the initial state estimate , initial covariance matrix , state transfer matrix , based on the predicted state and system parameters, calculate the Kalman gain of the data set , and then obtain the filtered historical load data set .

[0104] Step 2: Reference Figure 2 , perform time series decomposition (Seasonal and Trend decomposition using Loess, STL) on the historical load data processed in step 1 to obtain trend component, seasonal component and residual component;

[0105] Step 2.1: STL fusion timing decomposition is an efficient simulation timing analysis method, which can combine the timing decomposition and fusion in STL to improve the analysis efficiency. It is decomposed into three components: trend, seasonality and residual to understand the load change in more detail. The decomposition formula is shown in formula (3). Formulas (4) and (5) represent the calculation formulas of trend component and seasonal component respectively:

[0106] (3)

[0107] (4)

[0108] (5)

[0109] In the formula, , , , Respectively expressed in time , , , The observed value at express Trend value at the moment; express Seasonal item value at the moment; express The residual value at the moment; Representing a collection of data Middle Observed values ​​at each time point; Representing a collection of data The average of all observations in ; Represents the average value of all time points in the data set; Indicates the length of the seasonal cycle; , They represent the trend constant and the slope of the trend respectively; Indicates The time point corresponding to the observation.

[0110] Step 2.2: Combine the three components of trend, seasonality and residual into a three-element array data set ,in, Represents a collection of trend data, , represents a collection of seasonal data, , represents the set of residual data, .

[0111] Step 3: Use the trend component in step 2 as the input data set of the ARIMA model, the seasonal component as the input data set of the GRU model, and the residual component as the input data set of the TimesNet model. Use the fully connected layer to fuse the prediction results of the three groups of models, set the relevant initial parameters, and use the combined prediction model for prediction;

[0112] Step 3.1: Divide the ternary array data set obtained in step 2 into a training set and test set , where the training set is represented as , the test set is represented as , , , Respectively represent the trend component data, seasonal component data, and residual component data in the training set, , , They represent the trend component data, seasonal component data, and residual component data in the test set respectively.

[0113] Step 3.2: ARIMA model input and parameter setting, the steps are as follows:

[0114] Step 3.2.1: Train the training set Medium trend component data As input to the ARIMA model;

[0115] Step 3.2.2: Use the pmdarima module of Python software to automatically select the best ARIMA model parameters and use the best parameters to fit the ARIMA model parameters. The steps are as follows:

[0116] Step 3.2.2.1: Define the parameter search space of the ARIMA model, including the order of the autoregressive term (AR) , Difference times , the order of the moving average (MA) , parameters of the seasonal ARIMA model , seasonal difference , seasonal moving average , Seasonal Cycle ;

[0117] Step 3.2.2.2: For each set of parameters and , fit the ARIMA model;

[0118] Step 3.2.2.3: Use the information criterion to evaluate the performance of each model. and As evaluation criteria, they are defined as:

[0119] (6)

[0120] (7)

[0121] in, is the likelihood function value of the model, is the number of model parameters, is the number of observation samples.

[0122] Step 3.2.2.4: Select the or The model with the best value is taken as the best model, and the parameters of the selected best model are output. and , used for further model prediction, to obtain the ARIMA model prediction results .

[0123] Step 3.3: GRU model input and parameter setting, the specific steps are as follows:

[0124] Step 3.3.1: Train the training set Moderate seasonal component data As the input of the GRU model;

[0125] Step 3.3.2: Set the bidirectional GRU layer and the GRU fully connected layer. The initialization of the bidirectional GRU layer is expressed as:

[0126] (8)

[0127] in, For input data, , Represents the GRU model input data set, is the batch size, is the sequence length, is the characteristic dimension; and Represent the weight matrices of the forward and reverse GRU layers respectively; and Represent the bias terms of the forward and reverse GRU layers respectively;

[0128] The output of the bidirectional GRU layer is the concatenation of the hidden states in both directions, expressed as:

[0129] (9)

[0130] in, is the hidden state of the forward GRU layer, , is the dimension of the hidden state; is the hidden state of the reverse GRU layer, .

[0131] Step 3.3.3: Input Data Through the bidirectional GRU layer, the output is , take the hidden state of the last time step And through the dropout layer, and finally through the fully connected layer weight matrix and the bias term Get the predicted output of the GRU model , the formula is as follows:

[0132] (10)

[0133] (11)

[0134] in, For application Regularization function.

[0135] Step 3.4: TimesNet model input and parameter setting, the steps are as follows:

[0136] Step 3.4.1: Train the training set Residual component data As the input of the GRU model;

[0137] Step 3.4.2: Use Fast Fourier Transform (FFT) to calculate the periodicity of the residual component. The formula is as follows:

[0138] (12)

[0139] (13)

[0140] (14)

[0141] in, Represents the amplitude function, which is used to calculate the amplitude of each frequency component in the fast Fourier transform result; It means to find the maximum value in the data An index collection of data; Indicates taking the average value; represents fast Fourier transform; Indicates the length of time; Represents the original one-dimensional time series The intensity of each frequency component in , Represents the TimesNet model input data set, the strongest Frequency The most significant Cycle length , its abbreviated form is as follows:

[0142] (15)

[0143] Step 3.4.3: The original one-dimensional time series is transformed according to the selected period Folding is performed to obtain a set of two-dimensional tensors, and the process is expressed as:

[0144] (16)

[0145] (17)

[0146] in, represents the periodic features extracted from the time series by Fourier transform; To add 0 at the end of the sequence, the sequence can be divisible, Represents the period length calculated from the different frequency components in the time series data; Indicates The TimesBlock layer is processed to obtain the A two-dimensional tensor of periods; Indicates that in the TimesNet model, after the The one-dimensional time series features obtained after processing by TimesBlock layer; Indicates cycles; represents the number of periodic components selected in the time series analysis; Represents the conversion of a one-dimensional array into a two-dimensional matrix, or the conversion of a multidimensional array into an array with different dimensions.

[0147] Step 3.4.4: Use 2D convolution to extract the two-dimensional temporal change representation, and then convert the two-dimensional into one-dimensional for information aggregation:

[0148] (18)

[0149] (19)

[0150] in, Indicates The output of the TimesBlock layer corresponds to the periodic component Two-dimensional representation of , express Model; Indicates that The operation complements the 0 removal.

[0151] Step 3.4.5: Use the Softmax function to calculate the weights and perform weighted fusion to obtain the final prediction output of the TimesNet model :

[0152] (20)

[0153] (twenty one)

[0154] in, , Respectively represent The frequency obtained by Softmax in the TimesBlock layer , The intensity of the frequency components of , Respectively represent The TimesBlock layer corresponds to the frequency , The intensity of the frequency components of Indicates The output of the TimesBlock layer corresponds to the one-dimensional representation of the periodic component 𝑖.

[0155] Step 3.5: Get the final prediction model:

[0156] According to the prediction results of each model obtained in step 3.2, step 3.3, and step 3.4, the predictions of each model are output to the fully connected layer, as shown in formula (22), and the final combined prediction model is obtained:

[0157] (twenty two)

[0158] in, The final prediction result; represents a fully connected layer; is the ReLU activation function, is the weight matrix, , represents the weight matrix; is the bias vector.

[0159] Step 4: Train the combined prediction model obtained in step 3 on the training set. The specific steps are as follows:

[0160] Step 4.1, set the ARIMA model, GRU model, TimesNet model parameters, and adam hyperparameters (i.e. optimizer parameters) and , learning rate , initialize network parameters , set the number of training iterations , training batch size ;

[0161] Step 4.1.1, sample from the training set obtained in step 3.1 according to the training batch size;

[0162]

[0163]

[0164]

[0165]

[0166] Step 4.1.2, , , They are used as inputs of the ARIMA model, GRU model, and TimesNet model to obtain the prediction results of each model. , , ;

[0167] Step 4.1.3: Output the prediction results of each model to the fully connected layer to obtain the prediction results ;

[0168]

[0169] Step 4.1.4, use the gradient descent method to update the network, calculate the loss function and the gradient of the loss function with respect to the model parameters, and update the model weights:

[0170]

[0171] in, represents the loss function; Represents the gradient descent Optimization algorithms;

[0172] Step 4.1.5, when the number of loop iterations is less than Return to step 4.1.1 and continue the same operation until the number of loop iterations reaches , end the loop and obtain the trained combined prediction model.

[0173] Step 5: Use the three indicators of root mean square error (RMSE), mean absolute percentage error (MAPE), and mean absolute error (MAE) to measure the prediction accuracy of the combined prediction model finally obtained in step 3, as follows:

[0174] (twenty three)

[0175] (twenty four)

[0176] (25)

[0177] In the formula, is the predicted value, is the true value, is the number of prediction points, Indicates Datasets.

[0178] Embodiment 2:

[0179] This embodiment is based on the Python platform, and performs simulation and optimization analysis in the WIN10 operating system, AMD Ryzen 7 5800H, 4.50GHz processor environment. The specific solution flow chart is as follows: Figure 1 shown.

[0180] In this embodiment, the load data of 61 days in June and July in a certain area in the northwest are used, of which the load data of the first 59 days are used as the training sample set, and the load data of the last 2 days are used as the test set data. The training set prediction data is compared with the test set data to verify the effectiveness of the model. There are a total of 61×24 load data, that is, one load data is selected every 1 hour.

[0181] To verify the effectiveness of the method proposed in Example 1, the following four scenarios are set up for comparative analysis: Scenario 1: Load forecasting using the KF-ARIMA model; Scenario 2: Load forecasting using the KF-GRU model; Scenario 3: Load forecasting using the KF-TimesNet model; Scenario 4: Load forecasting using the KF-STL combined forecasting model described in the present invention.

[0182] The comparison curves between the prediction curves and the actual values ​​of the four scenarios are as follows: Figure 3As shown, it can be seen that the load curve prediction value obtained based on the KF-STL combined prediction model is closer to the true value. This is because the load data after KF processing is smoother, and the STL decomposition method is used to decompose it into trend, seasonal and residual components to improve the performance of the prediction model input data; the combined prediction model is used to predict different components separately, enhance the model's anti-interference ability, and better predict the load curve and output curve. Therefore, the prediction curve based on the KF-STL combined prediction model is better than other single prediction models.

[0183] The comparison of the prediction model evaluation parameters for the four scenarios is shown in Table 1:

[0184] Table 1 Comparison of evaluation parameters of KF-STL combined prediction model and KF-ARIMR, KF-GRU, and KF-TimesNet prediction models

[0185]

[0186] It can be seen from Table 1 that compared with other single prediction models, the KF-STL combined prediction model can effectively improve the accuracy of load prediction; the RMSE value of the load prediction result of the method proposed in the present invention is reduced by 0.048791, 0.028038, and 0.009737 respectively compared with ARIMA, GRU, and TimesNet; the MAPE value is reduced by 1.491144, 0.898442, and 0.329922; the MAE value is reduced by 0.03682, 0.02282, and 0.007192. Analysis of the above results shows that the MAE value, RMSE value, and MAPE value of the load prediction results have been reduced to a certain extent, which verifies that the model proposed in the present invention has good applicability in load prediction.

[0187] Embodiment 3:

[0188] This embodiment provides a short-term load forecasting system integrating time series decomposition and machine learning model for implementing the short-term load forecasting method integrating time series decomposition and machine learning model described in Embodiment 1, including:

[0189] The preprocessing module is used to correct and fill in abnormal values ​​and missing values ​​in the historical load data, and to perform denoising on the historical load data;

[0190] STL decomposition module, used to perform STL decomposition on the historical load data after denoising to obtain trend component, seasonal component and residual component;

[0191] The model combination prediction module is used to use the trend component as the input data set of the ARIMA model, the seasonal component as the input data set of the GRU model, and the residual component as the input data set of the TimesNet model. The prediction results of the three groups of models are fused using a fully connected layer and the combined prediction model is used for prediction;

[0192] The evaluation module uses three indicators, namely root mean square error, mean absolute percentage error and mean absolute error, to evaluate the prediction accuracy of the model combination prediction module.

[0193] Embodiment 4:

[0194] This embodiment provides a storage medium, which stores a computer program. When the computer program is executed by a processor, the device where the storage medium is located controls the short-term load forecasting method that integrates time series decomposition and machine learning models described in Example 1.

[0195] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0196] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0197] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0198] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0199] The embodiments are preferred implementations of the present invention, but the present invention is not limited to the above-mentioned implementations. Any obvious improvements, substitutions or modifications that can be made by those skilled in the art without departing from the essential content of the present invention belong to the protection scope of the present invention.

Claims

1. A short-term load forecasting method integrating time series decomposition and machine learning model, characterized in that: The process includes the following: Step 1: Preprocess the historical load data and then use the Kalman filter to perform denoising; Step 2: Perform time series decomposition on the historical load data processed in step 1 to obtain trend component, seasonal component and residual component; Step 3: Use the trend component as the input data set of the ARIMA model, the seasonal component as the input data set of the GRU model, and the residual component as the input data set of the TimesNet model. Use the fully connected layer to fuse the prediction results of the three groups of models to obtain a combined prediction model. Step 4: Train the combined prediction model obtained in step 3 on the training set; Step 5: Use the root mean square error RMSE, mean absolute percentage error MAPE, and mean absolute error MAE to measure the prediction accuracy of the combined prediction model trained in step 4.

2. The short-term load forecasting method integrating time series decomposition and machine learning model according to claim 1 is characterized in that: The specific process of step 2 is as follows: Step 2.1: The time series decomposition formula is shown in formula (3). Formulas (4) and (5) represent the calculation formulas of trend component and seasonal component respectively: (3); (4); (5); In the formula, , , , Respectively, in time , , , The observed value at express Trend value at the moment; express Seasonal item value at the moment; express The residual value at the moment; Representing a collection of data Middle Observed values ​​at each time point; Representing a collection of data The average of all observations in ; Represents the average value of all time points in the data set; Indicates the length of the seasonal cycle; , They represent the trend constant and the slope of the trend respectively; Indicates The time point corresponding to the observation value; Step 2.2: Combine the three components of trend, seasonality and residual into a three-element array data set ,in, Represents a collection of trend data, represents a collection of seasonal data, Represents a collection of residual data.

3. The short-term load forecasting method integrating time series decomposition and machine learning model according to claim 2 is characterized in that: The specific process of step 3 is as follows: Step 3.1: Divide the triplet dataset into training set and test set; Step 3.2: ARIMA model input and parameter setting; Step 3.3: GRU model input and parameter setting; Step 3.4: TimesNet model input and parameter setting; Step 3.5: According to the prediction results of each model obtained in step 3.2, step 3.3, and step 3.4, output the prediction of each model to the fully connected layer to obtain the final combined prediction model: (22); in, The final prediction result; represents a fully connected layer; is the ReLU activation function, is the weight matrix; is the bias vector; , , They respectively represent the prediction results of the ARIMA model, the GRU model, and the TimesNet model.

4. The short-term load forecasting method integrating time series decomposition and machine learning model according to claim 3 is characterized in that: The specific process of step 3.2 is as follows: Step 3.2.1: Use the training central tendency component data as input to the ARIMA model; Step 3.2.2: Define the parameter search space for the ARIMA model, including the order of the autoregressive term , Difference times , the order of the moving mean , parameters of the seasonal ARIMA model , seasonal difference , seasonal moving average , Seasonal Cycle ; Step 3.2.3: For each set of parameters and , fit the ARIMA model; Step 3.2.4: Use the information criterion to evaluate the performance of each model. and As evaluation criteria, they are defined as: (6); (7); in, is the likelihood function value of the model, is the number of model parameters, is the number of observation samples; Step 3.2.5: Select the or The model with the best value is taken as the best model, and the parameters of the selected best model are output. and , used for further model prediction, to obtain the ARIMA model prediction results .

5. The short-term load forecasting method integrating time series decomposition and machine learning model according to claim 3 is characterized in that: The specific process of step 3.3 is as follows: Step 3.3.1: Use the seasonal component data in the training set as the input of the GRU model; Step 3.3.2: Set the bidirectional GRU layer and the GRU fully connected layer. The initialization of the bidirectional GRU layer is expressed as: (8); in, For input data, , Represents the GRU model input data set, is the batch size, is the sequence length, is the characteristic dimension; and Represent the weight matrices of the forward and reverse GRU layers respectively; and Represent the bias terms of the forward and reverse GRU layers respectively; The output of the bidirectional GRU layer is the concatenation of the hidden states in both directions, expressed as: (9); in, is the hidden state of the forward GRU layer, , is the dimension of the hidden state; is the hidden state of the reverse GRU layer, ; Step 3.3.3: Input Data Through the bidirectional GRU layer, the output is , take the hidden state of the last time step And through the dropout layer, and finally through the fully connected layer weight matrix and the bias term Get the predicted output of the GRU model , the formula is as follows: (10); (11); in, For application Regularization function.

6. The short-term load forecasting method integrating time series decomposition and machine learning model according to claim 3 is characterized in that: The specific process of step 3.4 is as follows: Step 3.4.1: Use the residual component data in the training set as the input of the GRU model; Step 3.4.2: Use fast Fourier transform to calculate the periodicity of the residual component. The formula is as follows: (12); (13); (14); in, Represents the amplitude function, which is used to calculate the amplitude of each frequency component in the fast Fourier transform result; It means to find the maximum value in the data An index collection of data; Indicates taking the average value; represents fast Fourier transform; Indicates the length of time; Represents the original one-dimensional time series The intensity of each frequency component in , Represents the TimesNet model input data set, the strongest Frequency The most significant Cycle length , which has the following form: (15); Step 3.4.3: The original one-dimensional time series is transformed according to the selected period Folding is performed to obtain a set of two-dimensional tensors, and the process is expressed as: (16); (17); in, represents the periodic features extracted from the time series by Fourier transform; To add 0 at the end of the sequence, the sequence can be divisible, Represents the period length calculated from the different frequency components in the time series data; Indicates The TimesBlock layer is processed to obtain the A two-dimensional tensor of periods; Indicates that in the TimesNet model, after the The one-dimensional time series features obtained after processing by TimesBlock layer; Indicates cycles; represents the number of periodic components selected in the time series analysis; Indicates converting a one-dimensional array into a two-dimensional matrix; Step 3.4.4: Use 2D convolution to extract the two-dimensional temporal change representation, and then convert the two-dimensional into one-dimensional for information aggregation: (18); (19); in, Indicates In the output of the layer TimesBlock, it corresponds to the two-dimensional representation of the periodic component 𝑖; , express Model; Indicates that The 0 added by the operation is removed; Step 3.4.5: Use the Softmax function to calculate the weights and perform weighted fusion to obtain the final prediction output of the TimesNet model : (20); (21); in, , Respectively represent The frequency obtained by Softmax in the TimesBlock layer , The intensity of the frequency components of , Respectively represent The TimesBlock layer corresponds to the frequency , The intensity of the frequency components of Indicates The output of the TimesBlock layer corresponds to the periodic component One-dimensional representation of .

7. The short-term load forecasting method integrating time series decomposition and machine learning model according to claim 3 is characterized in that: The specific process of step 4 is as follows: Step 4.1, set the ARIMA model, GRU model, TimesNet model parameters, and optimizer parameters and , learning rate , initialize network parameters , set the number of training iterations , training batch size ; Step 4.1.1, sample from the training set obtained in step 3.1 according to the training batch size; ; ; ; ; Step 4.1.2, , , They are used as inputs of the ARIMA model, GRU model, and TimesNet model to obtain the prediction results of each model. , , ; Step 4.1.3: Output the prediction results of each model obtained in step 4.1.2 to the fully connected layer to obtain the final prediction result. ; ; Step 4.1.4, use the gradient descent method to update the network, calculate the loss function and the gradient of the loss function with respect to the model parameters, and update the model weights: ; in, represents the loss function; Represents the gradient descent Optimization algorithms; Step 4.1.5, when the number of loop iterations is less than Return to step 4.1.1 and continue the same operation until the number of loop iterations reaches , end the loop and obtain the trained combined prediction model.

8. A system for implementing the short-term load forecasting method integrating time series decomposition and machine learning model as claimed in claim 1, characterized in that: include: The preprocessing module is used to correct and fill in abnormal values ​​and missing values ​​in the historical load data, and to perform denoising on the historical load data; STL decomposition module, used to perform time series decomposition on the historical load data after denoising to obtain trend component, seasonal component and residual component; The model combination prediction module is used to use the trend component as the input data set of the ARIMA model, the seasonal component as the input data set of the GRU model, and the residual component as the input data set of the TimesNet model, and fuse the prediction results of the three groups of models using a fully connected layer to obtain the combined prediction model and train it; The evaluation module uses three indicators, namely root mean square error, mean absolute percentage error and mean absolute error, to evaluate the prediction accuracy of the model combination prediction module.

9. A storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by one or more processors, the device where the storage medium is located controls the short-term load forecasting method integrating time series decomposition and machine learning model as described in claim 1.

Citation Information

Patent Citations

  • Time series short-term power load prediction method based on STL decomposition

    CN112736902A

  • Load prediction method and system based on seasonal trend decomposition and hybrid neural network

    CN115587666A

  • Power load prediction method for realizing error correction mechanism based on LSTM-XGBoost

    CN116739118A

  • Method and apparatus for predicting household electricity load

    WO2024027503A1