Load prediction method and system, computer equipment and computer readable storage medium
Through the integration depth trust network (DBN) and two -way long -term memory network (BILSTM) model, using the Stacking integrated learning algorithm to solve the problem of load uncertainty and volatility in the new power system, improve the accuracy and accuracy of load prediction and the accuracy and rate of load prediction and the accuracy and rate of load prediction and the accuracy and rate of load forecast stability.
Patent Information
- Application Number
- CN202411511094.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-01-24
AI Technical Summary
The prior art is difficult to adapt to the uncertainty and volatility of loads in new power systems at the same time, resulting in a low accuracy of load prediction, affecting the stability and reliability of power supply.
The deep confidence network (DBN) and two -way long -term memory network (BILSTM) are used as the base learning model, and the structure of different models is integrated through the Stacking integrated learning algorithm to form a load prediction model to improve the prediction accuracy.
Through multi -dimensional learning, reduce the impact of uncertainty and volatility in load data, improve the accuracy, stability, and generalization ability of the load prediction model, thereby improving the accuracy of load prediction.
Smart Images

Figure CN119358754A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power systems, and in particular to a load forecasting method, system, computer equipment, and computer-readable storage medium. Background Art
[0003] In the related art, a single-structure convolutional neural network is usually used, and the spatiotemporal characteristics of ultra-short-term power loads in load data are considered to perform load forecasting.
[0004] However, the new loads in the power system have great uncertainty and volatility. The single-structure convolutional neural network is difficult to adapt to the uncertainty and volatility of the loads in the new power system at the same time, resulting in low accuracy in subsequent load forecasting, making it difficult to ensure the stability and reliability of power supply. Summary of the invention
[0005] In order to solve the above technical problems, the embodiments of the present application propose a load forecasting method, system, computer device and computer-readable storage medium, which can improve the accuracy of load forecasting.
[0006] In a first aspect, an embodiment of the present application provides a load forecasting method, including:
[0007] Obtaining load data related to the area to be predicted, and inputting the load data into a trained load prediction model for prediction, to obtain a load prediction result for the area to be predicted;
[0008] The training process of the load forecasting model includes:
[0009] determining training set data, wherein the training set data indicates historical load information;
[0010] Based on the training set data, a deep belief network DBN-based learning model is trained to obtain a DBN-based prediction model;
[0011] Based on the training set data, a bidirectional long short-term memory network BILSTM based learning model is trained to obtain a BILSTM based prediction model;
[0012] The load forecasting model is determined based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model.
[0013] Optionally, the step of training a deep belief network (DBN)-based learning model based on the training set data to obtain a DBN-based prediction model includes:
[0014] Using K-fold cross validation, the DBN-based learning model is trained K times based on the training set data to obtain a DBN-based prediction model, where K is a positive integer.
[0015] Optionally, the loss function corresponding to the DBN-based learning model includes a penalty term constructed based on L2 regularization;
[0016] The optimizer corresponding to the DBN-based learning model is determined by the Adam adaptive learning rate optimization algorithm based on historical gradients;
[0017] The hyperparameters corresponding to the DBN-based learning model are adjusted via random search, and the hyperparameters include batch size.
[0018] Optionally, the step of training a bidirectional long short-term memory network BILSTM-based learning model based on the training set data to obtain a BILSTM-based prediction model includes:
[0019] In the process of training the BILSTM-based learning model according to the training set data, using Bayesian optimization to find the optimal hyperparameters of the BILSTM-based learning model;
[0020] Based on the optimal hyperparameters, the BILSTM-based learning model is adjusted to obtain a BILSTM-based prediction model.
[0021] Optionally, determining the load forecasting model based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model includes:
[0022] The DBN-based prediction model and the BILSTM-based prediction model are integrated according to the training set data through the Stacking ensemble learning algorithm to obtain the load prediction model.
[0023] Optionally, the DBN-based prediction model and the BILSTM-based prediction model are integrated according to the training set data by using a Stacking ensemble learning algorithm to obtain the load prediction model, including:
[0024] Performing bagging integration on the DBN-based prediction model to generate multiple new DBN networks, and combining the multiple new DBN networks into a homogeneous integration model;
[0025] Inputting the training set data into the homogeneous integration model to obtain a first prediction result output by the homogeneous integration model;
[0026] Inputting the training set data into the BILSTM-based prediction model to obtain a second prediction result output by the BILSTM-based prediction model;
[0027] The load forecasting model is determined based on the training set data, the first forecasting result and the second forecasting result by utilizing a K-nearest neighbor based Stacking integration algorithm.
[0028] Optionally, the using a K-nearest neighbor based Stacking ensemble algorithm to determine the load forecasting model based on the training set data, the first forecasting result, and the second forecasting result includes:
[0029] The stacking integration algorithm is used, the first prediction result and the second prediction result are used as input features of the meta-learner, and the true label corresponding to the training set data is used as the output of the meta-learner to train the meta-learner to obtain the load forecasting model, wherein the meta-learner is constructed based on the K-nearest neighbor algorithm.
[0030] Optionally, determine the training set data, including:
[0031] Obtain sample load data;
[0032] Performing feature engineering processing on the sample load data to add preset factors to the sample load data, wherein the preset factors include holiday factors;
[0033] Divide the sample load data processed by feature engineering into an initial training set and a test set according to a set ratio and / or time sequence, wherein the test set is used to verify the prediction accuracy of the load forecasting model;
[0034] The initial training set is preprocessed to obtain the training set data.
[0035] Optionally, the preprocessing includes at least one of the following:
[0036] Abnormal data identification and processing based on quartile method;
[0037] Data correction processing based on non-nearest neighbor mean generation;
[0038] Data denoising based on wavelet transform.
[0039] In a second aspect, an embodiment of the present application provides a load forecasting system, including:
[0040] A prediction module is used to obtain load data related to the area to be predicted, and input the load data into the trained load prediction model for prediction to obtain a load prediction result for the area to be predicted;
[0041] The training process of the load forecasting model includes:
[0042] determining training set data, wherein the training set data indicates historical load information;
[0043] Based on the training set data, a deep belief network DBN-based learning model is trained to obtain a DBN-based prediction model;
[0044] Based on the training set data, a bidirectional long short-term memory network BILSTM based learning model is trained to obtain a BILSTM based prediction model;
[0045] The load forecasting model is determined based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model.
[0046] Optionally, the step of training a deep belief network (DBN)-based learning model based on the training set data to obtain a DBN-based prediction model includes:
[0047] Using K-fold cross validation, the DBN-based learning model is trained K times based on the training set data to obtain a DBN-based prediction model, where K is a positive integer.
[0048] Optionally, the loss function corresponding to the DBN-based learning model includes a penalty term constructed based on L2 regularization;
[0049] The optimizer corresponding to the DBN-based learning model is determined by the Adam adaptive learning rate optimization algorithm based on historical gradients;
[0050] The hyperparameters corresponding to the DBN-based learning model are adjusted via random search, and the hyperparameters include batch size.
[0051] Optionally, the step of training a bidirectional long short-term memory network BILSTM-based learning model based on the training set data to obtain a BILSTM-based prediction model includes:
[0052] In the process of training the BILSTM-based learning model according to the training set data, using Bayesian optimization to find the optimal hyperparameters of the BILSTM-based learning model;
[0053] Based on the optimal hyperparameters, the BILSTM-based learning model is adjusted to obtain a BILSTM-based prediction model.
[0054] Optionally, determining the load forecasting model based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model includes:
[0055] The DBN-based prediction model and the BILSTM-based prediction model are integrated according to the training set data through the Stacking ensemble learning algorithm to obtain the load prediction model.
[0056] Optionally, the DBN-based prediction model and the BILSTM-based prediction model are integrated according to the training set data by using a Stacking ensemble learning algorithm to obtain the load prediction model, including:
[0057] Performing bagging integration on the DBN-based prediction model to generate multiple new DBN networks, and combining the multiple new DBN networks into a homogeneous integration model;
[0058] Inputting the training set data into the homogeneous integration model to obtain a first prediction result output by the homogeneous integration model;
[0059] Inputting the training set data into the BILSTM-based prediction model to obtain a second prediction result output by the BILSTM-based prediction model;
[0060] The load forecasting model is determined based on the training set data, the first forecasting result and the second forecasting result by utilizing a K-nearest neighbor based Stacking integration algorithm.
[0061] Optionally, the using a K-nearest neighbor based Stacking ensemble algorithm to determine the load forecasting model based on the training set data, the first forecasting result, and the second forecasting result includes:
[0062] The stacking integration algorithm is used, the first prediction result and the second prediction result are used as input features of the meta-learner, and the true label corresponding to the training set data is used as the output of the meta-learner to train the meta-learner to obtain the load forecasting model, wherein the meta-learner is constructed based on the K-nearest neighbor algorithm.
[0063] Optionally, determine the training set data, including:
[0064] Obtain sample load data;
[0065] Performing feature engineering processing on the sample load data to add preset factors to the sample load data, wherein the preset factors include holiday factors;
[0066] Divide the sample load data processed by feature engineering into an initial training set and a test set according to a set ratio and / or time sequence, wherein the test set is used to verify the prediction accuracy of the load forecasting model;
[0067] The initial training set is preprocessed to obtain the training set data.
[0068] Optionally, the preprocessing includes at least one of the following:
[0069] Abnormal data identification and processing based on quartile method;
[0070] Data correction processing based on non-nearest neighbor mean generation;
[0071] Data denoising based on wavelet transform.
[0072] In a third aspect, an embodiment of the present application provides a computer device, including: one or more processors;
[0073] The processor is used to store one or more programs;
[0074] When the one or more programs are executed by the one or more processors, the steps of any of the above-mentioned load forecasting methods are implemented.
[0075] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed, the steps of any of the load forecasting methods described above are implemented.
[0076] In summary, the embodiments of the present application have at least the following beneficial effects:
[0077] By adopting the embodiment of the present application, a load forecasting model integrating different model structures is determined by respectively training a DBN-based forecasting model and a BILSTM-based forecasting model. After the load data is input into the load forecasting model, the load forecasting model can be enabled to perform learning in multiple different dimensions according to the load data to learn multi-dimensional features and reduce the impact of uncertainty and volatility in the load data, thereby improving the accuracy, stability and generalization ability of the model in prediction, and thus improving the accuracy of load prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] Figure 1 is a flow chart of a load forecasting method provided in an embodiment of the present application;
[0079] Figure 2 is a schematic diagram of the structure of a DBN provided in an embodiment of the present application;
[0080] Figure 3 It is a schematic diagram of the structure of the BILSTM provided in the embodiment of the present application;
[0081] Figure 4 is a schematic diagram of Bayesian optimization provided in an embodiment of the present application;
[0082] Figure 5is a schematic diagram of the evaluation results of the mutual information method provided in the embodiment of the present application;
[0083] Figure 6 It is a schematic diagram of the data provided in the embodiment of the present application before and after data preprocessing;
[0084] Figure 7 It is a schematic diagram of the data difference before and after the data preprocessing provided by the embodiment of the present application;
[0085] Figure 8 is a schematic diagram of load forecasting provided by an embodiment of the present application;
[0086] Fig. 9 It is a schematic diagram of prediction based only on DBN provided in an embodiment of the present application;
[0087] Fig.10 This is a schematic diagram of prediction based only on BILSTM provided in an embodiment of the present application;
[0088] Fig.11 It is a schematic diagram of using the present application to make predictions provided in the embodiments of the present application;
[0089] Fig.12 is a schematic diagram of the structure of a load forecasting system provided in an embodiment of the present application;
[0090] Fig.13 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0091] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0092] In the description of the present application, the terms "first", "second", "third", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, features defined as "first", "second", "third", etc. may explicitly or implicitly include one or more of the features. In the description of the present application, unless otherwise specified, the meaning of "multiple" is two or more. In the description of the present application, the term "including" and its variations are open inclusions, i.e., "including but not limited to". The term "based on" means "at least partially based on". The term "according to" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments".
[0093] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0094] In the description of this application, it should be noted that, unless otherwise defined, all technical and scientific terms used in this application have the same meaning as those commonly understood by those skilled in the art. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood by specific circumstances.
[0095] The following is an explanation of some terminology concepts involved in the embodiments of the present application:
[0096] Deep Belief Network (DBN) is a deep learning model composed of multiple Restricted Boltzmann Machine (RBM) layers. DBN learns high-level feature representation of data through two stages: unsupervised pre-training and supervised fine-tuning.
[0097] Bidirectional Long Short-Term Memory (BILSTM) is an improved recurrent neural network structure that is particularly suitable for processing sequence data. BiLSTM captures the forward and backward information of the sequence through two LSTM layers in opposite directions, thereby providing a richer contextual representation.
[0098] Adam (Adaptive Moment Estimation) adaptive learning rate optimization algorithm accelerates the training process and improves the convergence speed of the model by adaptively adjusting the learning rate of each parameter.
[0099] The Stacking ensemble learning algorithm builds a stronger model by combining the prediction results of multiple base learners. The core idea of Stacking is to use one or more meta-learners to relearn the prediction results of base learners to improve the performance of the overall model.
[0100] Bagging (Bootstrap Aggregating) is an ensemble learning method that improves the stability and accuracy of the model by training multiple base learners and aggregating their prediction results. The core idea of Bagging is to generate multiple training sets through the bootstrap method, each training set is used to train a base learner, and finally the prediction results of all base learners are aggregated by voting or averaging.
[0101] See also Figure 1 , shows a flow chart of a load forecasting method provided in an embodiment of the present application, the method includes step S101, which is as follows:
[0102] S101, acquiring load data related to the area to be predicted, and inputting the load data into a trained load prediction model for prediction, to obtain a load prediction result for the area to be predicted;
[0103] The training process of the load forecasting model includes:
[0104] determining training set data, wherein the training set data indicates historical load information;
[0105] Based on the training set data, a deep belief network DBN-based learning model is trained to obtain a DBN-based prediction model;
[0106] Based on the training set data, a bidirectional long short-term memory network BILSTM based learning model is trained to obtain a BILSTM based prediction model;
[0107] The load forecasting model is determined based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model.
[0108] In an optional implementation, the deep belief network DBN-based learning model is trained based on the training set data to obtain a DBN-based prediction model, including:
[0109] Using K-fold cross validation, the DBN-based learning model is trained K times based on the training set data to obtain a DBN-based prediction model, where K is a positive integer.
[0110] In this embodiment, the K-fold cross validation method can improve the generalization ability of the DBN model. Exemplarily, K is 5, that is, the K-fold cross validation is a 5-fold cross validation method.
[0111] In an optional implementation, the loss function corresponding to the DBN-based learning model includes a penalty term constructed based on L2 regularization;
[0112] The optimizer corresponding to the DBN-based learning model is determined by the Adam adaptive learning rate optimization algorithm based on historical gradients;
[0113] The hyperparameters corresponding to the DBN-based learning model are adjusted via random search, and the hyperparameters include batch size.
[0114] In this embodiment, the L2 regularization method is adopted to add a penalty term to the loss function, and the complexity of the model is reduced by limiting the weight parameters, thereby preventing the DBN model from overfitting; the Adam adaptive learning rate optimization algorithm that considers historical gradients is selected as the optimizer, and when the number of RBM layers and the number of neurons in the visual layer and hidden layer are appropriately selected, the hyperparameters such as the batch size are adjusted by the random search method; and the trained DBN-based prediction model is obtained.
[0115] In one example, see Figure 2 , DBN includes a hidden layer and a visible layer. The DBN is a deep learning model composed of multiple restricted Boltzmann machines (RBMs) stacked together. A single RBM model includes a hidden layer and a visible layer. The layers are fully connected, and the units in the layer do not affect each other. Each unit is in a binary state of activation or deactivation.
[0116] Assuming that the hidden layer neurons are represented by h, the visible layer neurons are represented by v, the bias coefficients are represented by a and b, and the weights are represented by w, the energy function expression between each RBM input and output is:
[0117] E(v,h)=-∑a i v i-∑b j h j -∑v i h j w ij
[0118] In the formula, a i represents the i-th visual layer neuron, h j represents the jth hidden layer neuron. The joint probability P(v,h) between the hidden layer and the visual layer neurons is expressed as:
[0119]
[0120] Where Z represents the normalization constant. In the case of bidirectional connection, the hidden layer and visual layer neural units can activate each other, and their probabilities are:
[0121]
[0122]
[0123] RBM can be determined by contrastive divergence algorithm, and the gradient of the model is calculated by using Gibbs sampling approximation and updating the parameters of the model, that is, the state of the visual layer unit is determined by data samples and the hidden layer calculation is completed using the above formula, and the visual layer is reconstructed by reverse calculation results, so that the entire RBM minimizes the energy or maximizes the joint probability to complete the update of parameters a, b, and w. RBM stacking forms a DBN deep learning network, and the calculation results of the RBM of the previous layer are used as the input vector of the RBM of the next layer to complete the unsupervised greedy layer-by-layer pre-training. Finally, supervised fine-tuning training is performed using back propagation, Contrastive Wake-Sleep and other algorithms. For each RBM except the top layer, the upward cognitive weight is used to calculate the posterior probability, and the downward generation weight is used to define the overall model. The parameter update of the entire model is completed by maximizing the posterior probability of the adjacent layers.
[0124] Compared to the sparse effect of L1 regularization, the L2 regularization function is completely differentiable, so it can produce smooth weights. The specific formulas of its regularization and loss function are as follows:
[0125]
[0126]
[0127] In the formula, λ is the regularization parameter. A reasonable regularization parameter prevents the model from overfitting or underfitting.
[0128] The five-fold cross-validation method divides the data set into five equal parts. Unlike the bagging method, the five subsets in the cross-validation are mutually exclusive. During training, four subsets are taken as training sets each time, and the remaining subset is taken as the test set. If the five training models can obtain good training results on the corresponding test sets, it proves that the model has good generalization ability.
[0129] In an optional implementation, the bidirectional long short-term memory network BILSTM-based learning model is trained based on the training set data to obtain a BILSTM-based prediction model, including:
[0130] In the process of training the BILSTM-based learning model according to the training set data, using Bayesian optimization to find the optimal hyperparameters of the BILSTM-based learning model;
[0131] Based on the optimal hyperparameters, the BILSTM-based learning model is adjusted to obtain a BILSTM-based prediction model.
[0132] In one example, Bayesian optimization can be used to find the optimal LSTM network hidden layer neuron number, number of layers, learning rate and other hyperparameters.
[0133] Among them, LSTM is a recurrent neural network, which has a strong long-term memory ability and can better capture the long-term dependency information in the sequence. It also has the advantages of strong noise resistance and the ability to handle complex nonlinear relationships. The power load data itself has a certain periodicity and an overall upward trend, so the LSTM network is very suitable for power load prediction. The input of the recurrent neural network RNN at the current moment contains the output information of the previous moment and has a memory function. Therefore, it has a better prediction effect on time series problems than the traditional BP neural network. Based on RNN, the LSTM neural network solves the problem of gradient disappearance in its long time series, adds gate structure and cell memory units, so that LSTM can retain information from a long time ago and apply the information to data processing at the current moment. The specific formula of LSTM is expressed as follows:
[0134] i t =σ(W i [h t-1 ,x t ]+b i )
[0135]
[0136] f t =σ(W f [h t-1 ,x t ]+b f )
[0137]
[0138] o t =σ(W o [h t-1 ,x t ]+b o )
[0139]
[0140] Among them, W f ,W i ,W c ,W o is the weight matrix, b f ,b i ,b c ,b o is the corresponding bias vector, x t ,o t are the input and output matrices, C t-1 ,C t is the state at time t-1 and t. Figure 3 , which combines the forward LSTM and the reverse LSTM to fully explore the reverse time series factor information of historical moments to improve data utilization efficiency, is the second deep learning model used in this embodiment. Its formula is as follows:
[0141]
[0142] where h t represents the forward LSTM hidden layer output at time t, represents the output of the reverse LSTM hidden layer, and α and β represent weights.
[0143] In the LSTM neural network, due to the requirement for the time sequence of training data, the time series cross-validation method is adopted to split the training set and the test set in time sequence in a sliding window manner according to a certain step size to ensure that the test set data is after the training set data. Similarly, the number of sliding windows is also selected as 5.
[0144] The following Table 1 shows the optimal results of Bayesian optimization hyperparameters in this embodiment.
[0145] hidden_dim num_layers learning_rate num_epochs 5 5 0.004428482446676804 132
[0146] Among them, hidden_dim represents the hidden layer dimension, num_layers represents the number of layers, learning_rate represents the learning rate, and num_epochs represents the number of training rounds.
[0147] See also Figure 4 , which is a Bayesian optimization process.
[0148] In an optional implementation, determining the load forecasting model based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model includes:
[0149] The DBN-based prediction model and the BILSTM-based prediction model are integrated according to the training set data through the Stacking ensemble learning algorithm to obtain the load prediction model.
[0150] In an optional implementation, the DBN-based prediction model and the BILSTM-based prediction model are integrated according to the training set data by using a Stacking ensemble learning algorithm to obtain the load prediction model, including:
[0151] Performing bagging integration on the DBN-based prediction model to generate multiple new DBN networks, and combining the multiple new DBN networks into a homogeneous integration model;
[0152] Inputting the training set data into the homogeneous integration model to obtain a first prediction result output by the homogeneous integration model;
[0153] Inputting the training set data into the BILSTM-based prediction model to obtain a second prediction result output by the BILSTM-based prediction model;
[0154] The load forecasting model is determined based on the training set data, the first forecasting result and the second forecasting result by utilizing a K-nearest neighbor based Stacking integration algorithm.
[0155] In this embodiment, the DBN network is firstly subjected to Bagging homogeneous integration to improve the stability of the deep learning model, and then the prediction results of the base learner are trained again using the Stacking integration method based on the K-nearest neighbor algorithm to improve the generalization ability of the model.
[0156] The Bagging algorithm is suitable for homogeneous ensemble models. It uses random subsets of the training set, that is, it repeatedly extracts the same number of samples from the training set with replacement (in parallel) as new model parameter training. The core idea is: given a training set D of size n, m subsets of size n are uniformly selected with replacement, and these subsets are used as new training sets. Applying the algorithm selected for a specific problem on these m training sets separately, you can get m models, and then by taking the average, taking the majority vote, etc., you can achieve ensemble learning under the Bagging algorithm.
[0157] The Stacking ensemble algorithm is suitable for heterogeneous ensembles. First, multiple weak learners of different categories are trained, and then the meta-learner is used to train them again to obtain the final prediction results. The results of homogeneous ensembles are often not better than the prediction results of the learner with the best prediction performance in the test set, and they emphasize the improvement of stability and generalization ability. The Stacking ensemble method combines the advantages of different weak learners to obtain results with higher prediction accuracy than any weak learner. Since the Stacking method has undergone two layers of training, it can usually only obtain better prediction results when the data set is large and the data is sufficient.
[0158] In an optional implementation, the use of a K-nearest neighbor based Stacking ensemble algorithm to determine the load forecasting model based on the training set data, the first forecast result, and the second forecast result includes:
[0159] The stacking integration algorithm is used, the first prediction result and the second prediction result are used as input features of the meta-learner, and the true label corresponding to the training set data is used as the output of the meta-learner to train the meta-learner to obtain the load forecasting model, wherein the meta-learner is constructed based on the K-nearest neighbor algorithm.
[0160] In an optional implementation, determining the training set data includes:
[0161] Obtain sample load data;
[0162] Performing feature engineering processing on the sample load data to add preset factors to the sample load data, wherein the preset factors include holiday factors;
[0163] Divide the sample load data processed by feature engineering into an initial training set and a test set according to a set ratio and / or time sequence, wherein the test set is used to verify the prediction accuracy of the load forecasting model;
[0164] The initial training set is preprocessed to obtain the training set data.
[0165] In an example, a three-value variable method can be used to add a holiday factor, that is, if the corresponding date is a statutory holiday, the value is 2, if it is a weekend, the value is 1, and the value is 0 on a weekday. In key feature identification, the mutual information method is used to extract 5 key feature factors; the initial training set and test set are directly divided in chronological order at a ratio of 8:2.
[0166] In an example, when the test set is used to verify the prediction accuracy of the load prediction model, the verification can be performed by calculating evaluation indicators such as root mean square error (RMSE).
[0167] In one example, feature engineering can select a subset of features based on the importance of their contribution to the label results, removing redundant features in the data with minimal loss. Considering the impact of holidays on power load, a three-value variable method is used to add holiday factors, that is, if the corresponding date is a statutory holiday, the value is 2, if it is a weekend, the value is 1, and the value is 0 on a weekday. Considering that too many input features will affect the efficiency and accuracy of the model, the mutual information method is used to identify key features and extract 5 key feature factors.
[0168] Among them, the mutual information method is specifically described as follows:
[0169] In thermodynamics, entropy represents the degree of disorder of a system. Based on this, Shannon proposed a description of the uncertainty measurement of information, namely information entropy H. For any random variable X:
[0170]
[0171] In the formula, Ω x represents the space of all possible values of X, p(x) represents the probability of X=x, and the larger the information entropy H of random variable X is, the more uncertainty information there is in X. On this basis, the quantity that measures the uncertainty of the joint distribution system is called joint entropy H(X,Y), and the quantity that measures the uncertainty of random variable Y under the condition that random variable X is known is called conditional entropy H(X|Y), and their formulas are as follows:
[0172]
[0173] H(X|Y)=-∑ x,y p(x,y)log2(p(x|y))
[0174] H(X|Y)=H(X,Y)-H(X)
[0175] Among them, mutual information measures the mutual dependence between two random variables, represented by I(X,Y), and its definition is:
[0176] I(X,Y)=H(X)-H(X|Y)=H(Y)-H(Y|X)
[0177] In feature engineering, the mutual information method is used to measure the degree of dependence between each feature and the result label. The larger the mutual information value, the closer the correlation between the feature and the result. Selecting several features with strong correlation with the result as sample input for model training can greatly reduce the amount of calculation without affecting the prediction accuracy and improve the speed of model training. The data set after feature engineering is divided into training set and test set directly in time order with a ratio of 8:2.
[0178] See also Figure 5 , is the result of feature selection using the mutual information method.
[0179] In an optional embodiment, the preprocessing includes at least one of the following:
[0180] Abnormal data identification and processing based on quartile method;
[0181] Data correction processing based on non-nearest neighbor mean generation;
[0182] Data denoising based on wavelet transform.
[0183] In one example, the quartile method is used to identify abnormal data in the training set data, the non-nearest neighbor mean generation idea is used to correct the data, and the wavelet transform method is used to further carry out noise reduction processing on the data. The quartile method calculates the interquartile range between the lower quartile (0.25) and the upper quartile (0.75) of the sample, and determines the values higher than 1.5 times the interquartile range of the upper quartile and lower than 1.5 times the interquartile range of the lower quartile as abnormal values. The specific formula for data correction using the non-nearest neighbor mean generation idea is as follows:
[0184]
[0185] In the formula, Y(t) represents the load value at time t, Y * (t) represents the load value obtained by flexibly adjusting the data spacing and weight coefficient according to the correction target and the characteristics of the data itself, k1, k2, h1, h2 represent weight coefficients, and Δt represents the interval between the next normal data and the current data. The above method balances the two aspects of smoothing extreme value data and retaining data characteristics. Specifically, if the left and right adjacent values of the abnormal extreme value data are normal values, the correction is generated by the non-nearest neighbor mean, k2 takes a larger value (>0.8), and k1 takes a smaller value. The purpose is to take into account the characteristics of the abnormal data itself when establishing the prediction model. If the data collected for a period of time after the abnormal extreme value data are all abnormal, it is determined that an abnormal event has occurred, such as an abnormal data acquisition device. The idea of correction is the "forward filling method" smoothing method, and the abnormal data is corrected with the nearest normal data.
[0186] Then the wavelet transform method is used to reduce noise. When designing the threshold, the overall fluctuation of the power load data is within 0.5-1% (within 100kw) to prevent data distortion. The wavelet transform threshold method is based on the minimum mean square error theory. Through signal decomposition, threshold processing and signal reconstruction, the optimal estimated data of the original signal can be obtained. The specific description is as follows:
[0187] for have
[0188]
[0189] In the formula, is the Fourier transform of ψ(t). For the scaling and translation of ψ(t), τ is selected to represent the translation factor and s to represent the scaling factor. The continuous wavelet function is expressed as follows:
[0190]
[0191] For Gaussian white noise signals mixed in the signal, the properties and amplitude of white noise remain unchanged after wavelet transform. At the same time, it is usually dispersed in wavelet coefficients with lower amplitudes. By setting the threshold to set the low amplitude coefficients to 0, the noise signal can be effectively suppressed. The entire wavelet transform denoising process is as follows:
[0192] (1) First, a wavelet function is used to decompose each one-dimensional feature data according to the maximum decomposable layer number N to obtain N+1 sequences;
[0193] (2) Secondly, the adaptive threshold method is used to divide the median of each sequence by 0.6745, and the result is set as the corresponding sequence threshold after scaling to ensure that the threshold selection matches the data scale. The coefficients less than the threshold are set to zero, and the coefficients greater than the threshold are reduced proportionally;
[0194] (3) Finally, the length of the sequence is restored to be consistent with the original data through data reconstruction and truncation, completing the entire process of data denoising.
[0195] In this embodiment, see Figure 6 , shows the feature data comparison results of the initial training set before and after the preprocessing described in this embodiment. Wherein, real represents the data before processing, and preprocessing represents the data after processing. Figure 7 , then it shows the difference between the feature data before and after processing.
[0196] In summary, see Figure 8 , which is an embodiment of load forecasting provided in this application.
[0197] Fig. 9 This is the prediction result based only on the DBN network. Fig.10 is the prediction result based only on the BiLSTM neural network. Fig.11 The following is a prediction result obtained by using the embodiment of the present application to perform load prediction.
[0198] 1. The two-layer integration method based on Bagging and Stacking proposed in the embodiment of the present application can realize multi-dimensional learning of key features and sequence temporal features, thereby improving the accuracy, stability and generalization ability of the prediction results of the entire model.
[0199] 2. The feature engineering method, abnormal data identification, and missing value survival proposed in the embodiments of the present application can effectively reduce data redundancy, improve data quality, and reduce the interference of outliers and noise on the model.
[0200] 3. The BILSTM model used in the embodiment of the present application can obtain more comprehensive information and has higher prediction accuracy for large-scale, long-time span, and multi-feature dimension power load data sets.
[0201] On the second aspect, accordingly, the embodiments of the present application also provide a load forecasting system that can implement all the processes of the load forecasting method provided in the above embodiments.
[0202] See also Fig.12 , shows a schematic diagram of the structure of a load forecasting system provided in an embodiment of the present application, the load forecasting system comprising:
[0203] The prediction module 1201 is used to obtain load data related to the area to be predicted, and input the load data into the trained load prediction model for prediction to obtain the load prediction result of the area to be predicted;
[0204] The training process of the load forecasting model includes:
[0205] determining training set data, wherein the training set data indicates historical load information;
[0206] Based on the training set data, a deep belief network DBN-based learning model is trained to obtain a DBN-based prediction model;
[0207] Based on the training set data, a bidirectional long short-term memory network BILSTM based learning model is trained to obtain a BILSTM based prediction model;
[0208] The load forecasting model is determined based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model.
[0209] In an optional implementation, the deep belief network DBN-based learning model is trained based on the training set data to obtain a DBN-based prediction model, including:
[0210] Using K-fold cross validation, the DBN-based learning model is trained K times based on the training set data to obtain a DBN-based prediction model, where K is a positive integer.
[0211] In an optional implementation, the loss function corresponding to the DBN-based learning model includes a penalty term constructed based on L2 regularization;
[0212] The optimizer corresponding to the DBN-based learning model is determined by the Adam adaptive learning rate optimization algorithm based on historical gradients;
[0213] The hyperparameters corresponding to the DBN-based learning model are adjusted via random search, and the hyperparameters include batch size.
[0214] In an optional implementation, the bidirectional long short-term memory network BILSTM-based learning model is trained based on the training set data to obtain a BILSTM-based prediction model, including:
[0215] In the process of training the BILSTM-based learning model according to the training set data, using Bayesian optimization to find the optimal hyperparameters of the BILSTM-based learning model;
[0216] Based on the optimal hyperparameters, the BILSTM-based learning model is adjusted to obtain a BILSTM-based prediction model.
[0217] In an optional implementation, determining the load forecasting model based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model includes:
[0218] The DBN-based prediction model and the BILSTM-based prediction model are integrated according to the training set data through the Stacking ensemble learning algorithm to obtain the load prediction model.
[0219] In an optional implementation, the DBN-based prediction model and the BILSTM-based prediction model are integrated according to the training set data by using a Stacking ensemble learning algorithm to obtain the load prediction model, including:
[0220] Performing bagging integration on the DBN-based prediction model to generate multiple new DBN networks, and combining the multiple new DBN networks into a homogeneous integration model;
[0221] Inputting the training set data into the homogeneous integration model to obtain a first prediction result output by the homogeneous integration model;
[0222] Inputting the training set data into the BILSTM-based prediction model to obtain a second prediction result output by the BILSTM-based prediction model;
[0223] The load forecasting model is determined based on the training set data, the first forecasting result and the second forecasting result by utilizing a K-nearest neighbor based Stacking integration algorithm.
[0224] In an optional implementation, the use of a K-nearest neighbor based Stacking ensemble algorithm to determine the load forecasting model based on the training set data, the first forecast result, and the second forecast result includes:
[0225] The stacking integration algorithm is used, the first prediction result and the second prediction result are used as input features of the meta-learner, and the true label corresponding to the training set data is used as the output of the meta-learner to train the meta-learner to obtain the load forecasting model, wherein the meta-learner is constructed based on the K-nearest neighbor algorithm.
[0226] In an optional implementation, determining the training set data includes:
[0227] Obtain sample load data;
[0228] Performing feature engineering processing on the sample load data to add preset factors to the sample load data, wherein the preset factors include holiday factors;
[0229] Divide the sample load data processed by feature engineering into an initial training set and a test set according to a set ratio and / or time sequence, wherein the test set is used to verify the prediction accuracy of the load forecasting model;
[0230] The initial training set is preprocessed to obtain the training set data.
[0231] In an optional embodiment, the preprocessing includes at least one of the following:
[0232] Abnormal data identification and processing based on quartile method;
[0233] Data correction processing based on non-nearest neighbor mean generation;
[0234] Data denoising based on wavelet transform.
[0235] In a third aspect, an embodiment of the present application provides a computer device, including: one or more processors;
[0236] The processor is used to store one or more programs;
[0237] When the one or more programs are executed by the one or more processors, the steps of any of the above-mentioned load forecasting methods are implemented.
[0238] See also Fig.13 The computer device of this embodiment includes: a processor 1301, a memory 1302, and a computer program stored in the memory 1302 and executable on the processor 1301, such as a load prediction program. When the processor 1301 executes the computer program, the steps in the above-mentioned various load prediction method embodiments are implemented.
[0239] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 1302 and executed by the processor 1301 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the computer device.
[0240] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may include, but not limited to, a processor 1301 and a memory 1302. Those skilled in the art may understand that the schematic diagram is only an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than shown in the figure, or may combine certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0241] The processor 1301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor 1301 may also be any conventional processor, etc. The processor 1301 is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer device.
[0242] The memory 1302 can be used to store the computer program and / or module. The processor 1301 implements various functions of the computer device by running or executing the computer program and / or module stored in the memory 1302 and calling the data stored in the memory 1302. The memory 1302 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1302 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0243] Wherein, if the module / unit integrated in the computer device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor 1301. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0244] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed, the steps of any of the load forecasting methods described above are implemented.
[0245] In summary, the embodiments of the present application have at least the following beneficial effects:
[0246] By adopting the embodiment of the present application, a load forecasting model integrating different model structures is determined by respectively training a DBN-based forecasting model and a BILSTM-based forecasting model. After the load data is input into the load forecasting model, the load forecasting model can be enabled to perform learning in multiple different dimensions according to the load data to learn multi-dimensional features and reduce the impact of uncertainty and volatility in the load data, thereby improving the accuracy, stability and generalization ability of the model in prediction, and thus improving the accuracy of load prediction.
[0247] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary hardware platform, and of course, it can also be implemented entirely by hardware. Based on such an understanding, all or part of the contribution of the technical solution of the present application to the background technology can be embodied in the form of a software product, and the computer software product can be stored in a storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0248] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications are also considered to be within the scope of protection of the present application.
Claims
1. A load forecasting method, characterized in that: include: Obtaining load data related to the area to be predicted, and inputting the load data into a trained load prediction model for prediction, to obtain a load prediction result for the area to be predicted; The training process of the load forecasting model includes: determining training set data, wherein the training set data indicates historical load information; Based on the training set data, a deep belief network DBN-based learning model is trained to obtain a DBN-based prediction model; Based on the training set data, a bidirectional long short-term memory network BILSTM based learning model is trained to obtain a BILSTM based prediction model; The load forecasting model is determined based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model.
2. The method according to claim 1, characterized in that The method of training a deep belief network (DBN)-based learning model based on the training set data to obtain a DBN-based prediction model includes: Using K-fold cross validation, the DBN-based learning model is trained K times based on the training set data to obtain a DBN-based prediction model, where K is a positive integer.
3. The method according to claim 1, characterized in that The loss function corresponding to the DBN-based learning model includes a penalty term constructed based on L2 regularization; The optimizer corresponding to the DBN-based learning model is determined by the Adam adaptive learning rate optimization algorithm based on historical gradients; The hyperparameters corresponding to the DBN-based learning model are adjusted via random search, and the hyperparameters include batch size.
4. The method according to claim 1, characterized in that The method of training the bidirectional long short-term memory network BILSTM based learning model based on the training set data to obtain the BILSTM based prediction model includes: In the process of training the BILSTM-based learning model according to the training set data, using Bayesian optimization to find the optimal hyperparameters of the BILSTM-based learning model; Based on the optimal hyperparameters, the BILSTM-based learning model is adjusted to obtain a BILSTM-based prediction model.
5. The method according to claim 1, characterized in that The determining the load forecasting model based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model includes: The DBN-based prediction model and the BILSTM-based prediction model are integrated according to the training set data through the Stacking ensemble learning algorithm to obtain the load prediction model.
6. The method according to claim 5, characterized in that The stacking ensemble learning algorithm is used to integrate the DBN-based prediction model and the BILSTM-based prediction model according to the training set data to obtain the load prediction model, including: Performing bagging integration on the DBN-based prediction model to generate multiple new DBN networks, and combining the multiple new DBN networks into a homogeneous integration model; Inputting the training set data into the homogeneous integration model to obtain a first prediction result output by the homogeneous integration model; Inputting the training set data into the BILSTM-based prediction model to obtain a second prediction result output by the BILSTM-based prediction model; The load forecasting model is determined based on the training set data, the first forecasting result and the second forecasting result by utilizing a K-nearest neighbor based Stacking integration algorithm.
7. The method according to claim 6, characterized in that The method of using the K-nearest neighbor based Stacking ensemble algorithm to determine the load forecasting model based on the training set data, the first forecasting result, and the second forecasting result includes: The stacking integration algorithm is used, the first prediction result and the second prediction result are used as input features of the meta-learner, and the true label corresponding to the training set data is used as the output of the meta-learner to train the meta-learner to obtain the load forecasting model, wherein the meta-learner is constructed based on the K-nearest neighbor algorithm.
8. The method according to any one of claims 1 to 7, characterized in that: Determine the training set data, including: Obtain sample load data; Performing feature engineering processing on the sample load data to add preset factors to the sample load data, wherein the preset factors include holiday factors; Divide the sample load data processed by feature engineering into an initial training set and a test set according to a set ratio and / or time sequence, wherein the test set is used to verify the prediction accuracy of the load forecasting model; The initial training set is preprocessed to obtain the training set data.
9. The method according to claim 8, characterized in that The preprocessing includes at least one of the following: Abnormal data identification and processing based on quartile method; Data correction processing based on non-nearest neighbor mean generation; Data denoising based on wavelet transform.
10. A load forecasting system, characterized in that: include: A prediction module is used to obtain load data related to the area to be predicted, and input the load data into the trained load prediction model for prediction to obtain a load prediction result for the area to be predicted; The training process of the load forecasting model includes: determining training set data, wherein the training set data indicates historical load information; Based on the training set data, a deep belief network DBN-based learning model is trained to obtain a DBN-based prediction model; Based on the training set data, a bidirectional long short-term memory network BILSTM based learning model is trained to obtain a BILSTM based prediction model; The load forecasting model is determined based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model.
11. The system according to claim 10, characterized in that The method of training a deep belief network (DBN)-based learning model based on the training set data to obtain a DBN-based prediction model includes: Using K-fold cross validation, the DBN-based learning model is trained K times based on the training set data to obtain a DBN-based prediction model, where K is a positive integer.
12. The system according to claim 10, characterized in that The loss function corresponding to the DBN-based learning model includes a penalty term constructed based on L2 regularization; The optimizer corresponding to the DBN-based learning model is determined by the Adam adaptive learning rate optimization algorithm based on historical gradients; The hyperparameters corresponding to the DBN-based learning model are adjusted via random search, and the hyperparameters include batch size.
13. The system of claim 10, wherein: The method of training the bidirectional long short-term memory network BILSTM based learning model based on the training set data to obtain the BILSTM based prediction model includes: In the process of training the BILSTM-based learning model according to the training set data, using Bayesian optimization to find the optimal hyperparameters of the BILSTM-based learning model; Based on the optimal hyperparameters, the BILSTM-based learning model is adjusted to obtain a BILSTM-based prediction model.
14. The system according to claim 10, characterized in that The determining the load forecasting model based on the training set data, the DBN-based forecasting model and the BILSTM-based forecasting model includes: The DBN-based prediction model and the BILSTM-based prediction model are integrated according to the training set data through the Stacking ensemble learning algorithm to obtain the load prediction model.
15. The system of claim 14, wherein: The stacking ensemble learning algorithm is used to integrate the DBN-based prediction model and the BILSTM-based prediction model according to the training set data to obtain the load prediction model, including: Performing bagging integration on the DBN-based prediction model to generate multiple new DBN networks, and combining the multiple new DBN networks into a homogeneous integration model; Inputting the training set data into the homogeneous integration model to obtain a first prediction result output by the homogeneous integration model; Inputting the training set data into the BILSTM-based prediction model to obtain a second prediction result output by the BILSTM-based prediction model; The load forecasting model is determined based on the training set data, the first forecasting result and the second forecasting result by utilizing a K-nearest neighbor based Stacking integration algorithm.
16. The system of claim 15, wherein: The method of using the K-nearest neighbor based Stacking ensemble algorithm to determine the load forecasting model based on the training set data, the first forecasting result, and the second forecasting result includes: The stacking integration algorithm is used, the first prediction result and the second prediction result are used as input features of the meta-learner, and the true label corresponding to the training set data is used as the output of the meta-learner to train the meta-learner to obtain the load forecasting model, wherein the meta-learner is constructed based on the K-nearest neighbor algorithm.
17. The system according to any one of claims 10 to 16, characterized in that: Determine the training set data, including: Obtain sample load data; Performing feature engineering processing on the sample load data to add preset factors to the sample load data, wherein the preset factors include holiday factors; Divide the sample load data processed by feature engineering into an initial training set and a test set according to a set ratio and / or time sequence, wherein the test set is used to verify the prediction accuracy of the load forecasting model; The initial training set is preprocessed to obtain the training set data.
18. The system of claim 17, wherein: The preprocessing includes at least one of the following: Abnormal data identification and processing based on quartile method; Data correction processing based on non-nearest neighbor mean generation; Data denoising based on wavelet transform.
19. A computer device, characterized in that: include: one or more processors; The processor is used to store one or more programs; When the one or more programs are executed by the one or more processors, the load forecasting method according to any one of claims 1 to 9 is implemented.
20. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the load forecasting method as described in any one of claims 1 to 9 is implemented.
Citation Information
Cited By
Short-term load prediction method based on specific features and polar bear optimization
CN120297460A