Power load prediction method and system based on RF-TCN-FEDFORMER
Through the power load prediction method based on RF-TCN-FEDFORMER, the nonlinear and timing-dependent modeling problems of power load prediction in the prior art are solved, the prediction accuracy and speed are improved, and reliable power generation planning support is provided for the power grid.
Patent Information
- Application Number
- CN202411342255.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-14
AI Technical Summary
The existing power load prediction methods have difficulties in processing nonlinear and timing-dependent data, especially in long-term prediction, prediction errors are prone to accumulate, resulting in a large deviation from the actual load.
Using the power load prediction method based on RF-TCN-FEDFORMER, the power load prediction model including random forest, time convolution layer and frequency enhancement attention module is constructed and model training is carried out. and validate to improve prediction accuracy.
The accuracy and speed of short-term power load prediction is achieved, providing a reliable basis for power generation planning, and reducing fuel consumption and environmental impact.
Smart Images

Figure CN119313183A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of electric power engineering, and in particular to an electric power load forecasting method and system based on RF-TCN-FEDFORMER. Background Art
[0002] Electricity resources have become an indispensable means of production in life and production. In order to meet the electricity needs of users, how to achieve reliable, stable and reasonable use of electricity is a key difficulty in the power industry. Since large-scale energy storage technology is difficult to achieve at present, in order to achieve efficient and stable operation of the power system based on the supply and demand relationship, it is necessary to achieve a dynamic balance between power generation and consumption. Achieving dynamic balance can prevent excessive waste of electricity resources and eliminate the need to increase the output power of the generator set due to insufficient power generation. Therefore, power load forecasting can ensure the safe and stable operation of the power system. By predicting the peak and valley values of load, it can avoid insufficient or excessive power supply and maintain the balance and stable operation of the power system. Economic dispatch of generator sets, dispatching according to the load forecast results, can maximize the efficiency of generator sets, reduce power generation costs, reduce fuel consumption, and improve the energy efficiency of the power system. Planning the development of the power system, by predicting future load demand, it can determine the expansion needs of the power system, the scale and type of new power generation facilities, and the transformation and upgrading plan of the power transmission and distribution network, so as to meet future electricity demand and improve the reliability and adaptability of the power system. Save energy and reduce emissions. Accurate load forecasting can help power companies optimize power production plans and avoid unnecessary excess power generation and energy waste. By reasonably predicting load demand and adjusting power generation plans accordingly, it is possible to reduce the consumption of traditional energy such as coal and gas, reduce the emission of greenhouse gases such as carbon dioxide, and thus reduce the negative impact on the environment.
[0003] At present, the research on power load forecasting at home and abroad covers many different methods and technologies. Some commonly used methods include statistical time series models (such as ARIMA, SARIMA, ARMA), machine learning-based regression models (such as support vector machines, artificial neural networks), and deep learning-based models (such as recurrent neural networks, long short-term memory networks). In addition, some studies focus on integrating multi-source data (such as meteorological data, economic data) for load forecasting to improve forecasting accuracy. In addition, some studies focus on using ensemble learning, model combination or model optimization methods to improve forecasting performance. Some of the above methods have certain shortcomings, such as the difficulty of modeling nonlinearity and time series dependence. Power load data usually has nonlinear relationships and time series dependencies, and traditional linear models may not be able to capture these complex relationships. Although deep learning models perform well in processing nonlinear and time series data, their complexity also increases the difficulty of model training and interpretation. Long-term forecasting challenges. Long-term power load forecasting is more difficult because long-term trends are affected by more uncertain factors and the availability of data is also limited. Accumulation of forecast errors. Any load forecasting model has certain errors. These errors may accumulate in long-term forecasts, resulting in a large deviation between the forecast results and the actual load. Summary of the invention
[0004] The purpose of the present invention is to solve the above technical problems and provide a method and system for power load forecasting based on RF-TCN-FEDFORMER.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] The technical solution adopted by the present invention to solve the technical problem is: a method and system for power load forecasting based on RF-TCN-FEDFORMER described in the present invention, the method comprises the following steps;
[0007] S1: Obtain the power load data and influencing factor data of a certain area to form the original data set;
[0008] S2: Data preprocessing: including filling in missing data in abnormal data sets, correcting deviation data in abnormal data, and then normalizing the data and dividing it into training set, validation set and test set according to a certain ratio;
[0009] S3: Build a power load forecasting model based on RF-TCN-FEDformer, including the construction of the network structure and the setting of related hyperparameters;
[0010] S4: training the power load forecasting model based on RF-TCN-FEDformer established in the third step;
[0011] S5: Based on the power load prediction model obtained above, the power load is predicted, and the predicted power load data prediction value is stored in the database.
[0012] Furthermore, the S1 includes original data sets including: power load data set, meteorological data, electricity price, season and working day; meteorological data includes wind speed, wind direction, temperature, humidity, air pressure and rainfall.
[0013] Furthermore, the S2 data set preprocessing specifically includes the following steps:
[0014] (S2.1) Missing value processing: The missing values are filled using the sliding mean filling method. The mean of the non-missing data in the sliding window is used to replace the missing values in the data set to complete the filling of missing values;
[0015] (S2.2) Outlier processing: Specifically, a box plot is used to analyze the data to identify outliers and missing values in the data; when the value is lower than the lower limit set by the box plot or higher than the upper limit set, it can be regarded as an outlier; there are discontinuous points in the upper and lower parts of the graph, which are the detected abnormal data; for these outliers, the completion method is used, that is, the average value of the time near the abnormal point is used to complete the data repair;
[0016] (S2.3) Data normalization: The power load data is normalized using the min-max normalization method, where for each attribute, minA and maxA are respectively the minimum and maximum values of attribute A, and an original value x of A is mapped to a value x' in the interval [0,1] through min-max normalization, and the formula is: new data = (original data - minimum value) / (maximum value - minimum value);
[0017] (S2.4) Dataset division: The preprocessed data set is divided into 80% of the data as a training set, 10% of the data as a validation set, and 10% of the data as a test set in a ratio of 8:1:1. At the same time, the batch_size needs to be set to convert the data into small batches to increase the training speed. Here, the batch_size is set to 32.
[0018] Furthermore, the steps for constructing the S3 network structure are as follows:
[0019] (S3.1) Random Forest: Random Forest can calculate the importance of the relationship between the associated features and the target features, and can evaluate the contribution of each feature to the model prediction based on methods such as node purity improvement, Out-of-Bag error reduction, and average accuracy reduction;
[0020] (S3.2) Input layer: The input layer is a Dense layer. First, the input data is sent to the Dense layer. The input data is a time series of relevant features such as historical load, climate, electricity price, date type, etc. after random forest weight allocation. The input matrix is shown in formula (1):
[0021]
[0022] In the formula, is the D-dimensional feature set at time t; is the data of the Dth feature at the time (1≤t≤T);
[0023] (S3.3) Temporal convolution layer: The temporal convolution module is improved from the convolutional neural network. Compared with the convolutional neural network, in order to be more suitable for sequence problems, the causal convolution, dilated convolution and residual modules are improved.
[0024] The sequence problem can be represented as follows: predict y1, y2, ..., yt based on x1, x2, ..., xt; the definition of causal convolution is filter F = (f1, f2, ..., f K ), the sequence x1, x2, ..., x T , in x t The causal product at is: Causal convolution has two characteristics:
[0025] No future information is considered; given an input sequence x1, x2, ..., x t Predict y1, y2, ..., y t ; But in predicting y t When , only the observed sequence x1, x2, ..., x t , but not x t+1 , x t+2 …;
[0026] Assume that the second hidden layer is used as the output, and its last node is associated with the three input nodes, namely x t-2 , x t-1 , x t ; Assuming that the output layer is used as the output, its last node is associated with the four input nodes, namely x t-3 , x t-2 , x t-1 , x t ;
[0027] The standard CNN increases the receptive field by adding a pooling layer. The dilated convolution increases the receptive field by expanding the standard convolution. The dilated convolution has an additional hyperparameter, dilation rate, which refers to the number of kernel intervals (the dilatation rate in the standard CNN is equal to 1). The advantage of the dilated convolution is that it increases the receptive field without losing information through pooling, so that each convolution output contains a larger range of information. The definition of the dilated convolution is as follows: Filter F = (f1, f2, ..., f K ), the sequence x1, x2, ..., x T , in x t The dilated convolution with a dilatation rate equal to d is:
[0028] (S3.4) Temporal feature extraction layer: The temporal feature extraction module consists of an encoder and a decoder, which are connected together through a frequency enhanced attention module (FEA);
[0029] (S3.5) Output layer: The output layer is a fully connected layer, whose activation function is Sigmoid, and the predicted output is shown in formula (5):
[0030] y t =Sigmoid(w o s t +b o ) (5)
[0031] Where y t Represented as the predicted output value at time t; w o is the weight matrix; b o is the deviation vector;
[0032] After completing the construction of the model structure, you also need to set the hyperparameters related to model training;
[0033] (S3.6) Setting of hyperparameters, including initial learning rate, number of iterations and expected error value;
[0034] (S3.7) Use the Dropout regularization method to lose some neurons to avoid overfitting of the model and improve the generalization ability of the model;
[0035] (S3.8) Selection of loss function: Calculate the error between the predicted value of the model and the true value. Considering that the predicted result is regression, the mean square error is used here. The calculation formula is shown in formula (6):
[0036]
[0037] Among them, the true value of the original data set is y, and the output value predicted by the power load model is
[0038] Furthermore, the steps for constructing the S4 network structure are as follows:
[0039] The training set is used to train the power load forecasting model based on RF-TCN-FEDformer constructed in the third step to obtain a power load forecasting model with moderate fitting state, specifically:
[0040] (S4.1) The training set is used to train the power load forecasting model based on RF-TCN-FEDformer, and the loss is calculated by the loss function, and the calculation formula is shown in the above formula (6);
[0041] (S4.2) Determine whether the loss of the current model reaches the expected loss;
[0042] If it is reached, stop training, save the model, and go to step (S4.4) to avoid overfitting of the model;
[0043] If it is not achieved, it means that the current model is underfitting and training should continue;
[0044] (S4.3) Determine whether the number of rounds of model training reaches a preset number of iterations;
[0045] If it is not reached, back-propagate the model, perform gradient descent, update the parameters of each layer of the model, and repeat step (S4.1);
[0046] If the preset number of iterations is reached, the training is stopped and the model is saved;
[0047] (S4.4) using the divided validation set to validate the trained RF-TCN-FEDformer-based power load forecasting model;
[0048] (S4.5) Determine whether the current model has reached a fitting state on the validation set;
[0049] If the performance of the model in the training set and the test set is significantly different, it means that the model has reached an overfitting state, and the neural network model parameters need to be adjusted, and steps (S4.1) to (S4.5) need to be repeated;
[0050] If the model performs similarly in the training set and the test set, it means that the model has achieved moderate fit;
[0051] (S4.6) The divided test set is used to verify the reliability of the power load forecasting model based on RF-TCN-FEDformer that has been trained in step (S4.5), and the model is saved.
[0052] Furthermore, the system includes a user interaction module and a model module, wherein the user interaction module includes a data acquisition submodule, a hyperparameter setting submodule and a data visualization submodule; the model module includes a data processing submodule, a model training submodule and a power load prediction submodule;
[0053] The data acquisition submodule obtains historical power load data and influencing factor data; the hyperparameter setting submodule is based on the setting of parameters in the RF-TCN-FEDforme model; the data visualization submodule is used to display the data in operation for easy observation; the data processing submodule performs exception processing and normalization on the acquired data set; the model training submodule corresponds to model training; the power load forecasting submodule corresponds to short-term power load forecasting and writes the predicted data into the database.
[0054] The present invention provides a method and system for power load forecasting based on RF-TCN-FEDFORMER, which has the following beneficial effects:
[0055] 1. The present invention provides a reliable basis for the power grid to formulate power generation plans through the prediction results of the RF-TCN-FEDformer short-term power load model;
[0056] 2. The present invention adopts the RF-TCN-FEDformer short-term power load forecasting model, wherein the weights of relevant features can be assigned so that the correlation between data can be reflected; then the time series can be convolved to improve the prediction accuracy; finally, the features of the load data are extracted through the FEDformer module to obtain the final prediction data;
[0057] 3. Use the trained model to predict power load data. The prediction model has the advantages of fast prediction speed and high prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The specific embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings;
[0059] Figure 1 Box plot of a power load forecasting method based on RF-TCN-FEDFORMER;
[0060] Figure 2 It is a flow chart of power load forecasting of a power load forecasting method and system based on RF-TCN-FEDFORMER;
[0061] Figure 3 The figure is a model training flowchart of a power load forecasting method and system based on RF-TCN-FEDFORMER. DETAILED DESCRIPTION
[0062] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0063] 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 only 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.
[0064] It should be noted that all directional indications in the embodiments of the present invention (such as up-down-left-right-front-back...) are only used to explain the relative position relationship - movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly. The connection can be a direct connection or an indirect connection.
[0065] See also Figure 1-3 As shown, a method and system for power load forecasting based on RF-TCN-FEDFORMER, the method comprising the following steps;
[0066] S1: Obtain the power load data and influencing factor data of a certain area to form the original data set;
[0067] S2: Data preprocessing: including filling in missing data in abnormal data sets, correcting deviation data in abnormal data, and then normalizing the data and dividing it into training set, validation set and test set according to a certain ratio;
[0068] S3: Build a power load forecasting model based on RF-TCN-FEDformer, including the construction of the network structure and the setting of related hyperparameters;
[0069] S4: training the power load forecasting model based on RF-TCN-FEDformer established in the third step;
[0070] S5: Based on the power load forecasting model obtained above, the power load is predicted, and the predicted power load data is stored in the database; when working, the prediction results of the RF-TCN-FEDformer short-term power load model are used to provide a reliable basis for the power grid to formulate power generation plans; through the RF-TCN-FEDformer short-term power load forecasting model, the relevant features can be weighted so that the correlation between the data can be reflected; then the time series can be convolved to improve the prediction accuracy; finally, the features of the load data are extracted through the FEDformer module to obtain the final prediction data; the trained model is used to predict the power load data, and the prediction model has the advantages of fast prediction speed and high accuracy of prediction results.
[0071] The S1 includes original data sets including: power load data set, meteorological data, electricity price, season and working day; meteorological data includes wind speed, wind direction, temperature, humidity, air pressure and rainfall; when working, by collecting factors that affect the power load from multiple angles, training and finding rules, the prediction accuracy is improved, thereby achieving the function of short-term prediction of power load, solving the problem of low accuracy of existing power load prediction.
[0072] The S2 data set preprocessing specifically includes the following steps:
[0073] (S2.1) Missing value processing: The missing values are filled using the sliding mean filling method. The mean of the non-missing data in the sliding window is used to replace the missing values in the data set to complete the filling of missing values;
[0074] (S2.2) Outlier processing: Specifically, a box plot is used to analyze the data to identify outliers and missing values in the data; when the value is lower than the lower limit set by the box plot or higher than the upper limit set, it can be regarded as an outlier; there are discontinuous points in the upper and lower parts of the graph, which are the detected abnormal data; for these outliers, the completion method is used, that is, the average value of the time near the abnormal point is used to complete the data repair;
[0075] (S2.3) Data normalization: The power load data is normalized using the min-max normalization method, where for each attribute, minA and maxA are respectively the minimum and maximum values of attribute A, and an original value x of A is mapped to a value x' in the interval [0,1] through min-max normalization, and the formula is: new data = (original data - minimum value) / (maximum value - minimum value);
[0076] (S2.4) Dataset division: The preprocessed data set is divided into 80% of the data as a training set, 10% of the data as a validation set, and 10% of the data as a test set in a ratio of 8:1:1. At the same time, the batch_size needs to be set to convert the data into small batches to increase the training speed. Here, the batch_size is set to 32. During work, the overall law of the data can be effectively learned through the division of the data set, and it can also be verified. Setting a reasonable batch_size can not only allow the model to be trained efficiently, but also prevent loss oscillations and prevent the model training from falling into a local minimum.
[0077] The steps for constructing the S3 network structure are as follows:
[0078] (S3.1) Random Forest: Random Forest can calculate the importance of the relationship between the associated features and the target features, and can evaluate the contribution of each feature to the model prediction based on methods such as node purity improvement, Out-of-Bag error reduction, and average accuracy reduction;
[0079] (S3.2) Input layer: The input layer is a Dense layer. First, the input data is sent to the Dense layer. The input data is a time series of relevant features such as historical load, climate, electricity price, date type, etc. after random forest weight allocation. The input matrix is shown in formula (1):
[0080]
[0081] In the formula, is the D-dimensional feature set at time t; is the data of the Dth feature at the time (1≤t≤T);
[0082] (S3.3) Temporal convolution layer: The temporal convolution module is improved from the convolutional neural network. Compared with the convolutional neural network, in order to be more suitable for sequence problems, the causal convolution, dilated convolution and residual modules are improved.
[0083] The sequence problem can be represented as follows: predict y1, y2, ..., yt based on x1, x2, ..., xt; the definition of causal convolution is filter F = (f1, f2, ..., f K ), the sequence x1, x2, ..., x T , in x t The causal product at is: Causal convolution has two characteristics:
[0084] No future information is considered; given an input sequence x1, x2, ..., x tPredict y1, y2, ..., y t ; But in predicting y t When , only the observed sequence x1, x2, ..., x t , but not x t+1 , x t+2 …;
[0085] Assume that the second hidden layer is used as the output, and its last node is associated with the three input nodes, namely x t-2 , x t-1 , x t ; Assuming that the output layer is used as the output, its last node is associated with the four input nodes, namely x t-3 , x t-2 , x t-1 , x t ;
[0086] The standard CNN increases the receptive field by adding a pooling layer. The dilated convolution increases the receptive field by expanding the standard convolution. The dilated convolution has an additional hyperparameter, dilation rate, which refers to the number of kernel intervals (the dilatation rate in the standard CNN is equal to 1). The advantage of the dilated convolution is that it increases the receptive field without losing information through pooling, so that each convolution output contains a larger range of information. The definition of the dilated convolution is as follows: Filter F = (f1, f2, ..., f K ), the sequence x1, x2, ..., x T , in x t The dilated convolution with a dilatation rate equal to d is:
[0087] (S3.4) Temporal feature extraction layer: The temporal feature extraction module consists of an encoder and a decoder, which are connected together through a frequency enhanced attention module (FEA);
[0088] (S3.5) Output layer: The output layer is a fully connected layer, whose activation function is Sigmoid, and the predicted output is shown in formula (5):
[0089] y t =Sigmoid(w o s t +b o ) (5)
[0090] Where y t Represented as the predicted output value at time t; w o is the weight matrix; b o is the deviation vector;
[0091] After completing the construction of the model structure, you also need to set the hyperparameters related to model training;
[0092] (S3.6) Setting of hyperparameters, including initial learning rate, number of iterations and expected error value;
[0093] (S3.7) Use the Dropout regularization method to lose some neurons to avoid overfitting of the model and improve the generalization ability of the model;
[0094] (S3.8) Selection of loss function: Calculate the error between the predicted value of the model and the true value. Considering that the predicted result is regression, the mean square error is used here. The calculation formula is shown in formula (6):
[0095]
[0096] Among them, the true value of the original data set is y, and the output value predicted by the power load model is When working, the encoder includes a frequency enhancement module (FEB) and a seasonal trend decomposition module; the input x∈R T×D First, use ω∈R D×D Perform a linear mapping, so we get q = x·ω; then convert q from the time domain to the frequency domain; the Fourier transform of q is recorded as Q∈C T×D ; In the frequency domain, only M randomly selected modes are retained, so we use the selection operator in And M<<N; then FEB can be defined as where R∈C D×D×M is a randomly initialized parameterized kernel; let Y = Q⊙C, where Y∈C D×M ; The production operator ⊙ is defined as follows: where d i =1, 2...D as input channel, d o =1, 2...D as output channels; the result of Q⊙R is zero-filled to C before performing the inverse Fourier transform back to the time domain N×D middle;
[0097] Since complex periodic patterns are often combined with trend components in real data, it is difficult to extract trends using fixed window average pooling. To address this problem, a seasonal trend decomposition module is designed. The module contains a set of average filters of different sizes to extract multiple trend components from the input signal and a set of data-related weights to combine them into the final trend. The seasonal trend decomposition module can be expressed as formula (2):
[0098] X trend=Softmax(L(x))*(F(x)) (2)
[0099] where F(·) is a set of average pooling filters and Softmax(L(x)) is the weight to mix these extracted trends.
[0100] Decoder: The decoder module functions basically the same as the encoder, but the decoder has a frequency enhanced attention module (FEA) connected to the encoder. The input of FEA is query, key, and value, denoted as q∈R L×D ,k∈R L×D ,v∈R L×D In the cross-attention mechanism, the query comes from the decoder and can be expressed as q = x en ·ω q ,ω q ∈R D×D The key and value come from the encoder and can be expressed as k=x de ·ω k , v = x de ·ω v , where ω k ,ω v ∈R D×D Therefore, its attention formula can be expressed as formula (3)
[0101]
[0102] We transform the query, key, and value using Fourier transform and perform a similar attention mechanism in the frequency domain by randomly selecting M patterns, which can then be expressed as Equation (4)
[0103]
[0104] Where σ is the activation function, and the SoftMax function is used for activation.
[0105] The steps for constructing the S4 network structure are as follows:
[0106] The training set is used to train the power load forecasting model based on RF-TCN-FEDformer constructed in the third step to obtain a power load forecasting model with moderate fitting state, specifically:
[0107] (S4.1) The training set is used to train the power load forecasting model based on RF-TCN-FEDformer, and the loss is calculated by the loss function, and the calculation formula is shown in the above formula (6);
[0108] (S4.2) Determine whether the loss of the current model reaches the expected loss;
[0109] If it is reached, stop training, save the model, and go to step (S4.4) to avoid overfitting of the model;
[0110] If it is not achieved, it means that the current model is underfitting and training should continue;
[0111] (S4.3) Determine whether the number of rounds of model training reaches a preset number of iterations;
[0112] If it is not reached, back-propagate the model, perform gradient descent, update the parameters of each layer of the model, and repeat step (S4.1);
[0113] If the preset number of iterations is reached, the training is stopped and the model is saved;
[0114] (S4.4) using the divided validation set to validate the trained RF-TCN-FEDformer-based power load forecasting model;
[0115] (S4.5) Determine whether the current model has reached a fitting state on the validation set;
[0116] If the performance of the model in the training set and the test set is significantly different, it means that the model has reached an overfitting state, and the neural network model parameters need to be adjusted, and steps (S4.1) to (S4.5) need to be repeated;
[0117] If the model performs similarly in the training set and the test set, it means that the model has achieved moderate fit;
[0118] (S4.6) The divided test set is used to verify the reliability of the power load forecasting model based on RF-TCN-FEDformer that has been trained in step (S4.5), and the model is saved; when working, overfitting on the training set is avoided, and by loading the verification set and observing the effect of the verification set, it can be determined whether the model is truly effective.
[0119] A method and system for power load forecasting based on RF-TCN-FEDFORMER: The system comprises the user interaction module and model module described in any one of the above, wherein the user interaction module comprises a data acquisition submodule, a hyperparameter setting submodule and a data visualization submodule; the model module comprises a data processing submodule, a model training submodule and a power load forecasting submodule;
[0120] The data acquisition submodule obtains historical power load data and influencing factor data; the hyperparameter setting submodule is based on the setting of parameters in the RF-TCN-FEDforme model; the data visualization submodule is used to display the data in operation for easy observation; the data processing submodule performs exception processing and normalization on the acquired data set; the model training submodule corresponds to model training; the power load forecasting submodule corresponds to short-term power load forecasting and writes the predicted data into the database; when working, historical data is collected through the data acquisition module, abnormal data is processed and normalized, and then loaded into the model; according to the optimal parameters obtained by pre-training, it is loaded into the model to obtain the prediction results. The MAPE (Mean Absolute Percentage Error) mean absolute percentage error of the prediction results can be below 10%, ensuring that the prediction results are more accurate; according to the predicted results, it is written into the database.
[0121] By adopting the above scheme, the present invention, when in use, obtains power load data and influencing factor data from the power grid company through the RF-TCN-FEDformer power load forecasting method, performs data preprocessing, constructs a power load forecasting model based on RF-TCN-FEDformer, and uses the data set to train and verify the constructed power load forecasting model to achieve a moderate fitting state for predicting power load data.
[0122] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0123] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.
Claims
1. A power load forecasting method based on RF-TCN-FEDFORMER, characterized in that; The method comprises the following steps: S1: Obtain the power load data and influencing factor data of a certain area to form the original data set; S2: Data preprocessing: including filling in missing data in abnormal data sets, correcting deviation data in abnormal data, and then normalizing the data and dividing it into training set, validation set and test set according to a certain ratio; S3: Build a power load forecasting model based on RF-TCN-FEDformer, including the construction of the network structure and the setting of related hyperparameters; S4: training the power load forecasting model based on RF-TCN-FEDformer established in the third step; S5: Based on the power load prediction model obtained above, the power load is predicted, and the predicted power load data prediction value is stored in the database.
2. The power load forecasting method based on RF-TCN-FEDFORMER according to claim 1, characterized in that: The S1 includes the original data set including: power load data set, meteorological data, electricity price, season and working day; the meteorological data includes wind speed, wind direction, temperature, humidity, air pressure and rainfall.
3. The power load forecasting method based on RF-TCN-FEDFORMER according to claim 2 is characterized in that: The S2 data set preprocessing specifically includes the following steps: (S2.1) Missing value processing: The missing values are filled using the sliding mean filling method. The mean of the non-missing data in the sliding window is used to replace the missing values in the data set to complete the filling of missing values; (S2.2) Outlier processing: Specifically, a box plot is used to analyze the data to identify outliers and missing values in the data; when the value is lower than the lower limit set by the box plot or higher than the upper limit set, it can be regarded as an outlier; there are discontinuous points in the upper and lower parts of the graph, which are the detected abnormal data; for these outliers, the completion method is used, that is, the average value of the time near the abnormal point is used to complete the data repair; (S2.3) Data normalization: The power load data is normalized using the min-max normalization method, where for each attribute, minA and maxA are respectively the minimum and maximum values of attribute A, and an original value x of A is mapped to a value x' in the interval [0,1] through min-max normalization, and the formula is: new data = (original data - minimum value) / (maximum value - minimum value); (S2.4) Dataset division: The preprocessed data set is divided into 80% of the data as a training set, 10% of the data as a validation set, and 10% of the data as a test set in a ratio of 8:1:
1. At the same time, the batch_size needs to be set to convert the data into small batches to increase the training speed. Here, the batch_size is set to 32.
4. The method for power load forecasting based on RF-TCN-FEDFORMER according to claim 3 is characterized in that: The steps for constructing the S3 network structure are as follows: (S3.1) Random Forest: Random Forest can calculate the importance of the relationship between the associated features and the target features, and can evaluate the contribution of each feature to the model prediction based on methods such as node purity improvement, Out-of-Bag error reduction, and average accuracy reduction; (S3.2) Input layer: The input layer is a Dense layer. First, the input data is sent to the Dense layer. The input data is a time series of relevant features such as historical load, climate, electricity price, date type, etc. after random forest weight allocation. The input matrix is shown in formula (1): In the formula, is the D-dimensional feature set at time t; is the data of the Dth feature at the time (1≤t≤T); (S3.3) Temporal convolution layer: The temporal convolution module is improved from the convolutional neural network. Compared with the convolutional neural network, in order to be more suitable for sequence problems, the causal convolution, dilated convolution and residual modules are improved. The sequence problem can be represented as follows: predict y1, y2, ..., yt based on x1, x2, ..., xt; the definition of causal convolution is filter F = (f1, f2, ..., f K ), the sequence x1, x2, ..., x T , in x t The causal product at is: Causal convolution has two characteristics: No future information is considered; given an input sequence x1, x2, ..., x t Predict y1, y2, ..., y t ; But in predicting y t When , only the observed sequence x1, x2, ..., x t , but not x t+1 , x t+2 ...; Assume that the second hidden layer is used as the output, and its last node is associated with the three input nodes, namely x t-2 , x t-1 , x t ; Assuming that the output layer is used as the output, its last node is associated with the four input nodes, namely x t-3 , x t-2 , x t-1 , x t ; The standard CNN increases the receptive field by adding a pooling layer. The dilated convolution increases the receptive field by expanding the standard convolution. The dilated convolution has an additional hyperparameter, dilation rate, which refers to the number of kernel intervals (the dilatation rate in the standard CNN is equal to 1). The advantage of the dilated convolution is that it increases the receptive field without losing information through pooling, so that each convolution output contains a larger range of information. The definition of the dilated convolution is as follows: Filter F = (f1, f2, ..., f K ), the sequence x1, x2, ..., x T , in x t The dilated convolution with a dilatation rate equal to d is: (S3.4) Temporal feature extraction layer: The temporal feature extraction module consists of an encoder and a decoder, which are connected together through a frequency enhanced attention module (FEA); (S3.5) Output layer: The output layer is a fully connected layer, whose activation function is Sigmoid, and the predicted output is shown in formula (5): y t =Sigmoid(w o st+b o ) (5) Where y t Represented as the predicted output value at time t; w o is the weight matrix; b o is the deviation vector; After completing the construction of the model structure, you also need to set the hyperparameters related to model training; (S3.6) Setting of hyperparameters, including initial learning rate, number of iterations and expected error value; (S3.7) Use the Dropout regularization method to lose some neurons to avoid overfitting of the model and improve the generalization ability of the model; (S3.8) Selection of loss function: Calculate the error between the predicted value of the model and the true value. Considering that the predicted result is regression, the mean square error is used here. The calculation formula is shown in formula (6): Among them, the true value of the original data set is y, and the output value predicted by the power load model is 5. The method and system for power load forecasting based on RF-TCN-FEDFORMER according to claim 4, characterized in that: The steps for constructing the S4 network structure are as follows: The training set is used to train the power load forecasting model based on RF-TCN-FEDformer constructed in the third step to obtain a power load forecasting model with a moderate fitting state, specifically: (S4.1) The training set is used to train the power load forecasting model based on RF-TCN-FEDformer, and the loss is calculated by the loss function, and the calculation formula is shown in the above formula (6); (S4.2) Determine whether the loss of the current model reaches the expected loss; If it is reached, stop training, save the model, and go to step (S4.4) to avoid overfitting of the model; If it is not achieved, it means that the current model is underfitting and training should continue; (S4.3) Determine whether the number of rounds of model training reaches a preset number of iterations; If it is not reached, back-propagate the model, perform gradient descent, update the parameters of each layer of the model, and repeat step (S4.1); If the preset number of iterations is reached, the training is stopped and the model is saved; (S4.4) using the divided validation set to validate the trained RF-TCN-FEDformer-based power load forecasting model; (S4.5) Determine whether the current model has reached a fitting state on the validation set; If the performance of the model in the training set and the test set is significantly different, it means that the model has reached an overfitting state, and the neural network model parameters need to be adjusted, and steps (S4.1) to (S4.5) need to be repeated; If the model performs similarly in the training set and the test set, it means that the model has achieved moderate fit; (S4.6) The divided test set is used to verify the reliability of the power load forecasting model based on RF-TCN-FEDformer that has been trained in step (S4.5), and the model is saved.
6. A power load forecasting system based on RF-TCN-FEDFORMER, characterized by: The system comprises the user interaction module and the model module as described in any one of claims 1 to 5, wherein the user interaction module comprises a data acquisition submodule, a hyperparameter setting submodule and a data visualization submodule; the model module comprises a data processing submodule, a model training submodule and a power load prediction submodule; Data acquisition submodule, to obtain historical power load data and influencing factor data; Hyperparameter setting submodule, based on the setting of parameters in the RF-TCN-FEDforme model; The data visualization submodule is used to display the data in operation for easy observation; The data processing submodule performs exception processing and normalization on the acquired data set; The model training submodule corresponds to model training; The power load forecasting submodule corresponds to short-term power load forecasting and writes the predicted data into the database.
Citation Information
Cited By
Air conditioner recommendation method and device based on LSTM model and air conditioner
CN120561514A