CNN-BiLSTM and XGBoost combination-based load prediction method and system
By using the method of combining CNN-BiLSTM with XGBoost in power load prediction, the problems of poor data quality and insufficient feature mining in the prior art are solved, and higher load prediction accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202411576363.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the power load prediction, the existing technology has problems such as complex data sources, low interaction intentions of multiple data subjects, inconsistent statistical standards, imperfect data system, missing some core data, and poor data quality. It is also impossible to effectively mine the implicit and spatial characteristics of the load sequence, resulting in low prediction accuracy.
Using a load prediction method based on the combination of CNN-BiLSTM and XGBoost, the load data is extracted through CNN and treated as a one-dimensional vector. The BiLSTM network has added data flow from the future to the past based on LSTM, which can more fully mine the timing feature structure of the data, and combine the trend sequence predicted by the CNN-BiLSTM hybrid model with the seasonal sequence and irregular sequence predicted by the XGBoost model to improve prediction accuracy and generalization capabilities.
Through this method, the linear and nonlinear relationships of load data can be extracted more effectively from complex and huge data, improve the accuracy and efficiency of load prediction, and adapt to the problem that the power grid load is affected by nonlinear factors and uncertain factors.
Smart Images

Figure CN119518726A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of power load forecasting, and specifically relates to a load forecasting method and system based on the combination of CNN-BiLSTM (Convolutional Neural Network with Bidirectional Long Short-Term Memory) and XGBoost (eXtreme Gradient Boosting). Background Art
[0002] Digital technology has gradually become the core driving force for the development of the power economy. Power big data is an important reference indicator in the energy field and the macro-economy. The government advocates paying attention to data assets and digging deep into the value of data. The application scenarios of power data are gradually expanding. Power has been well applied in the areas of economy, environmental protection, tourism, and resumption of work and production. Load forecasting based on power data can provide strong support for the development of government, industry, enterprises, and users.
[0003] At present, load forecasting still has the following shortcomings: the basic data involved in the analysis and forecast have complex data sources, low willingness of multiple data subjects to interact, inconsistent statistical standards, incomplete data system, missing some core data, poor data quality, etc. At the same time, the existing data acquisition technology is difficult to ensure the comprehensiveness, accuracy and sustainability of the data; Affected by natural factors, economic factors, human factors, industrial factors and various emergencies, the correlation between the power and electricity data of different industries, industries and user groups and various related influencing factors such as meteorology and economy under the new power system is becoming increasingly hidden, and intelligent and high-accuracy power and electricity forecasting methods are missing; Analysis and forecasting involve massive data processing and analysis. Currently, forecasting and verification are based on manual experience, and the practicality and intelligence of tools and platforms are not high, resulting in a large workload and low efficiency for grassroots personnel, which seriously restricts the rapid development of analysis and forecasting levels.
[0004] The prior art document (CN114862032B) discloses a method and device for power grid load forecasting based on XGBoost-LSTM. Its disadvantage is that LSTM (Long Short-Term Memory) only has forward propagation operation, and using LSTM to predict uncertain data cannot fully learn the implicit features of the load sequence. At the same time, when the amount of data is large and complex, the LSTM calculation efficiency is low, and the spatial features cannot be mined, resulting in low load forecasting accuracy. Summary of the invention
[0005] In order to solve the deficiencies in the prior art, the present invention provides a load forecasting method and system based on the combination of CNN-BiLSTM and XGBoost. When the CNN-BiLSTM hybrid model uses CNN to extract features from load data, the load data is regarded as a one-dimensional vector, which can process more and more complex data. The BiLSTM network is used to increase the data flow from the future to the past on the basis of the unidirectional flow from the past to the future of the LSTM network, which can more fully mine the temporal feature structure of the data, thereby improving the model prediction ability. The trend sequence predicted by the CNN-BiLSTM hybrid model is combined with the seasonal sequence and irregular sequence prediction results predicted by the XGBoost model, thereby improving the accuracy and generalization ability of load forecasting.
[0006] The present invention adopts the following technical solution.
[0007] The first aspect of the present invention provides a load forecasting method based on the combination of CNN-BiLSTM and XGBoost, comprising:
[0008] Step 1: Obtain historical load data and historical meteorological data, and preprocess the historical load data and historical meteorological data to obtain preprocessed historical load data;
[0009] Step 2: Use the multiplication seasonal adjustment method to decompose the preprocessed historical load data to obtain trend series, seasonal series and irregular series;
[0010] Step 3: Build a CNN-BiLSTM hybrid model to predict the trend sequence obtained in step 2 to obtain the predicted trend sequence;
[0011] Step 4: Build an XGBoost model to predict the seasonal sequence and irregular sequence in step 2 to obtain the predicted seasonal sequence and the predicted irregular sequence;
[0012] Step 5: Multiply the trend sequence predicted in step 3, the seasonal sequence predicted in step 4, and the predicted irregular sequence, and evaluate the results to obtain the predicted load data, thus realizing the load forecasting method and system based on the combination of CNN-BiLSTM and XGBoost.
[0013] Preferably, in step 1, the historical meteorological data with a correlation coefficient greater than 0.2 between the historical load data and the historical meteorological data is extracted by using the Pearson correlation coefficient method, and the historical meteorological data is combined with the historical load data to form the preprocessed historical load data, and the correlation coefficient r xy , expressed as follows:
[0014]
[0015] In the formula,
[0016] J0 represents the sample size,
[0017] x j0 is the historical load data of the j0th sample,
[0018] y j0 is the historical meteorological data of the j0th sample,
[0019] x j0 and j0 The mean of .
[0020] Preferably, in step 3, the CNN-BiLSTM hybrid model includes a CNN (Convolutional Neural Network) model and a BiLSTM (Bi-directional Long Short-Term Memory) model in sequence, wherein the CNN model includes a two-dimensional convolutional layer, a two-dimensional pooling layer and a flattening layer, the flattening layer compresses the array output by the two-dimensional convolutional layer into a one-dimensional vector array, the BiLSTM model includes a repeated vector layer, a BiLSTM network layer and a fully connected layer, the one-dimensional vector array output by the flattening layer is input into the repeated vector layer to convert the data into the input format of the BiLSTM network layer, the output of the BiLSTM network layer is output via the fully connected layer, and the predicted value of the CNN-BiLSTM hybrid model is obtained.
[0021] Preferably, the CNN model is provided with 4 two-dimensional convolutional layers, the number of convolutional kernels is set to 32, 64, 128 and 256 respectively, the size of each convolutional kernel is 3*3, and the convolutional layer is expressed by the following formula:
[0022]
[0023] Where:
[0024] is the feature map from i to convolution layer l+1;
[0025] is the weight of the convolution kernel in convolution layer l, which is obtained by the output of the previous layer Perform convolution operations to create the input for the next layer;
[0026] is the deviation value;
[0027] K is the number of selected convolution kernels;
[0028] σ is the activation function.
[0029] Preferably, the BiLSTM network is composed of a forward LSTM network and a backward LSTM network in parallel, which can be expressed as follows:
[0030]
[0031] In the formula,
[0032] h t is the forward hidden layer state,
[0033] h i is the backward hidden layer state,
[0034] a t and b t are the hidden layer output weights of the forward and backward propagation units, respectively.
[0035] c t is the hidden layer bias optimization parameter at the current moment,
[0036] y t is the output at time t,
[0037] LSTM(x t0 ,h t0-1 ) represents the LSTM network, which is expressed as follows:
[0038]
[0039] In the formula,
[0040] σ and tanh are the Sigmoid function and the hyperbolic tangent function respectively,
[0041] W fx , X ix , W ox With b f 、b i 、b o are the corresponding weight coefficient matrix and bias passing through the LSTM layer, that is, the parameters adjusted after feedback from the loss function during training,
[0042] f t0 Forget gating, which controls the S of the previous state t0-1 The specific forgotten part,
[0043] i t0 is the input gate, which controls the input x t0 Memory,
[0044] o t0 Output gating controls the output of the current state.
[0045] S t0The result is converted to a value between -1 and 1 through tanh.
[0046] h t0 is the output of step t0.
[0047] Preferably, in step 4, the objective function Obj of the XGBoost model is expressed as follows:
[0048]
[0049] In the formula,
[0050] n is the sample size,
[0051] p m is the true value of the mth sample,
[0052] is the load forecast value of the mth sample,
[0053] is the loss function,
[0054] N is the number of trees,
[0055] is the sum of the regularization terms of N trees, Ω(fn ) It is expressed as follows:
[0056]
[0057] In the formula,
[0058] T is the number of leaf nodes in the tree.
[0059] w r is the score of the rth leaf node,
[0060] λ is the fraction that controls the weight of the leaf node.
[0061] γ is the weight coefficient of the penalty term.
[0062] Preferably, in step 5, the prediction effect is evaluated using the mean absolute percentage error, which is expressed as follows:
[0063]
[0064] In the formula,
[0065] Q is the total number of samples,
[0066] is the predicted value of the qth sample,
[0067] y q is the actual value of the qth sample.
[0068] The second aspect of the present invention proposes a load forecasting system based on the combination of CNN-BiLSTM and XGBoost, which is used to run the load forecasting method based on the combination of CNN-BiLSTM and XGBoost, including:
[0069] Data acquisition module: used to acquire historical load data and historical meteorological data, and preprocess the historical load data and historical meteorological data to obtain preprocessed historical load data;
[0070] Data decomposition module: used to decompose the pre-processed historical load data using the multiplication seasonal adjustment method to obtain trend series, seasonal series and irregular series;
[0071] Load forecasting module: used to build a CNN-BiLSTM hybrid model, predict trend sequences, build an XGBoost model, and predict seasonal sequences and irregular sequences;
[0072] Forecast output module: used to multiply the trend sequence, seasonal sequence and irregular sequence, and evaluate the results to obtain the predicted load data, and realize the load forecasting method and system based on the combination of CNN-BiLSTM and XGBoost.
[0073] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the computer program is loaded into the processor, the load forecasting method based on the combination of CNN-BiLSTM and XGBoost is implemented.
[0074] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the load forecasting method based on the combination of CNN-BiLSTM and XGBoost is implemented.
[0075] The beneficial effect of the present invention is that, compared with the prior art, the LSTM network cannot perform large-scale parallel processing. When the CNN-BiLSTM hybrid model uses CNN to extract features from load data, the load data is regarded as a one-dimensional vector. A sufficiently large receptive field is obtained through a multi-layer convolutional network structure to perform parallel processing on the load data. The linear and nonlinear relationships before and after the load data can be better extracted from complex and large data. It is also beneficial to extract spatial features, obtain the mutual dependence between load data and other factors, and maintain the time series characteristics of the correlation between data, which greatly improves the load prediction efficiency and prediction accuracy. The BiLSTM network adds the data flow from the future to the past on the basis of the unidirectional flow from the past to the future of the LSTM network, which can more fully mine the bidirectional time series feature structure of the data, thereby improving the model prediction ability. Therefore, the CNN-BiLSTM hybrid model has advantages in processing fluctuating load data and nonlinear data.
[0076] According to the characteristics of power load features, the present invention uses an adaptive neural network to predict the load, and combines the trend sequence prediction of the CNN-BiLSTM hybrid model with the seasonal sequence prediction and irregular sequence prediction results of the XGBoost model. It has greater advantages in solving the problem that the power grid load is affected by nonlinear and uncertain factors, and can more comprehensively predict the load data when complex factors are present, thereby improving the accuracy and generalization ability of load prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 is a flow chart of load forecasting in the present invention;
[0078] Figure 2 It is the architecture diagram of the CNN-BiLSTM hybrid model in the present invention;
[0079] Figure 3 It is a schematic diagram of the BiLSTM network layer in the present invention. DETAILED DESCRIPTION
[0080] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only part of the embodiments of the present invention, not all of them. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the scope of protection of the present invention.
[0081] The first aspect of the present invention proposes a load forecasting method based on the combination of CNN-BiLSTM and XGBoost, such as Figure 1 As shown, including:
[0082] Step 1: Obtain historical load data and historical meteorological data, and preprocess the historical load data and historical meteorological data to obtain preprocessed historical load data;
[0083] Historical load data includes power load and load-related external factors such as weather, holidays, and economy.
[0084] Historical weather data includes temperature, humidity, wind speed, wind direction, rainfall and air pressure.
[0085] Carry out data preprocessing to handle missing values, outliers, and duplicate values.
[0086] The collected historical load data and historical meteorological data are normalized and expressed as follows:
[0087]
[0088] Where:
[0089] Y t , Y' t They are the data after and before normalization respectively;
[0090] Y t,max , Y t,min are the maximum and minimum values of the data respectively.
[0091] For the normalized historical load data and historical meteorological data, the data with strong correlation with the historical load data in the historical meteorological data are obtained. The historical meteorological data with correlation coefficient greater than 0.2 are extracted by Pearson correlation coefficient method and combined with the historical load data to form the preprocessed historical load data. The correlation coefficient r xy , expressed as follows:
[0092]
[0093] In the formula,
[0094] J0 represents the sample size,
[0095] x j0 is the historical load data of the j0th sample,
[0096] y j0 is the historical meteorological data of the j0th sample,
[0097] x j0 and j0 The mean of .
[0098] Step 2: Use the multiplication seasonal adjustment method to decompose the preprocessed historical load data to obtain trend series, seasonal series and irregular series;
[0099] The multiplication seasonal adjustment method decomposes the pre-processed historical load data and is expressed as follows:
[0100] Y t =TC t ×S t ×I t (3)
[0101] In the formula,
[0102] Y t is the original time series,
[0103] TC t is a trend cycle sequence,
[0104] S t is the seasonal sequence,
[0105] I t An irregular sequence.
[0106] Step 3: Build a CNN-BiLSTM hybrid model to predict the trend sequence of step 2;
[0107] like Figure 2 As shown in the figure, a CNN-BiLSTM hybrid model is constructed, CNN is used to extract features from trend sequence data, and then multi-layer LSTM is used for load forecasting.
[0108] The CNN-BiLSTM hybrid model includes the CNN model and the BiLSTM model.
[0109] The CNN model contains a 2D convolutional layer, a 2D pooling layer, and a flattening layer.
[0110] For the CNN model, four two-dimensional convolutional layers are set, and the number of convolution kernels is set to 32, 64, 128 and 256 respectively. The size of each convolution kernel is 3*3. The convolutional layer is expressed by the following formula:
[0111]
[0112] Where:
[0113] is the feature map from i to convolution layer l+1;
[0114] is the weight of the convolution kernel in convolution layer l, which is obtained by the output of the previous layer Perform convolution operations to create the input for the next layer;
[0115] is the deviation value;
[0116] K is the number of selected convolution kernels;
[0117] σ is the activation function, which uses the nonlinear ReLU function and is expressed as follows:
[0118]
[0119] The two-dimensional pooling layer adjusts the output of neurons by maximum pooling to reduce data size and feature dimension, which can be expressed as follows:
[0120]
[0121] In the formula,
[0122] is the weight of the jth neuron in the i-th class of the l-th layer;
[0123] is the bias of the i-th class in the l-th layer,
[0124] * is the convolution operation,
[0125] is the output of the jth neuron in the lth convolution layer,
[0126] The jth neuron in the l-1th convolution layer is the model activation output, that is, the lth layer input data.
[0127] f(·) is the activation function of the model.
[0128] The flattening layer compresses the array output by the pooling layer into a one-dimensional vector array.
[0129] The BiLSTM model consists of a repeated vector layer, a BiLSTM network layer, and a fully connected layer.
[0130] The one-dimensional vector array output by the flattening layer is input into the repeated vector layer, the data is converted into the input format of the BiLSTM network layer, and then input into the BiLSTM network layer.
[0131] The BiLSTM network layer consists of a forward LSTM network and a backward LSTM network in parallel, such as Figure 3 As shown, it is expressed by the following formula:
[0132]
[0133] In the formula,
[0134] h t is the forward hidden layer state,
[0135] hi is the backward hidden layer state,
[0136] a t and b t are the hidden layer output weights of the forward and backward propagation units, respectively.
[0137] c t is the hidden layer bias optimization parameter at the current moment,
[0138] y t is the output at time t,
[0139] LSTM(x t0 ,h t0-1 ) represents the LSTM network. The LSTM network includes a forget gate, an input gate, and an input gate, which can be expressed as follows:
[0140]
[0141] In the formula,
[0142] σ and tanh are the Sigmoid function and the hyperbolic tangent function respectively,
[0143] W fx , W ix , W ox With b f 、b i 、b o are the corresponding weight coefficient matrix and bias passing through the LSTM layer, i.e., the parameters adjusted after feedback from the loss function during training;
[0144] f t Forget gating, which controls the S of the previous state t-1 The specific forgotten part;
[0145] i t is the input gate, which controls the input x t Memory;
[0146] o t Output gating controls the output of the current state.
[0147] f t 、i t , o t It is converted into a value between 0 and 1 by multiplying the splicing vector by the above structural parameter matrix through the sigmoid activation function;
[0148] S t The result is converted to a value between –1 and 1 through the nonlinear function tanh;
[0149] h tis the output of step t.
[0150] The predicted value of the CNN-BiLSTM hybrid model is then output through the fully connected layer.
[0151] Step 4: Build an XGBoost model to predict the seasonal and irregular sequences in step 2.
[0152] The objective function Obj of the XGBoost model is expressed as follows:
[0153]
[0154] In the formula,
[0155] n is the sample size,
[0156] p m is the true value of the mth sample,
[0157] is the load forecast value of the mth sample,
[0158] is the loss function,
[0159] N is the number of trees,
[0160] is the sum of the regularization terms of N trees, Ω(f n ) is expressed as follows:
[0161]
[0162] In the formula,
[0163] T is the number of leaf nodes in the tree.
[0164] w r is the score of the rth leaf node,
[0165] λ is the fraction that controls the weight of the leaf node.
[0166] γ is the weight coefficient of the penalty term.
[0167] In the iterative process, the XGBoost model continuously calculates the node loss value to obtain w r And the best value of the objective function, select the leaf node with the largest gain loss, and then get the optimal XGBoost model.
[0168] Step 5: Multiply the trend sequence predicted in step 3 and the seasonal sequence and irregular sequence predicted in step 4, and evaluate the results to obtain the predicted load data, thus realizing the load forecasting method and system based on the combination of CNN-BiLSTM and XGBoost.
[0169] The mean absolute percentage error (MAPE) is used to evaluate the prediction effect, which is expressed as follows:
[0170]
[0171] In the formula,
[0172] Q is the total number of samples,
[0173] is the predicted value of the qth sample,
[0174] y q is the actual value of the qth sample.
[0175] For the same batch of data sets, the smaller the MAPE value, the better the prediction effect.
[0176] The beneficial effect of the present invention is that, compared with the prior art, the LSTM network cannot perform large-scale parallel processing. When the CNN-BiLSTM hybrid model uses CNN to extract features from load data, the load data is regarded as a one-dimensional vector. A sufficiently large receptive field is obtained through a multi-layer convolutional network structure to perform parallel processing on the load data. The linear and nonlinear relationships before and after the load data can be better extracted from complex and large data. It is also beneficial to extract spatial features, obtain the mutual dependence between load data and other factors, and maintain the time series characteristics of the correlation between data, which greatly improves the load prediction efficiency and prediction accuracy. The BiLSTM network adds the data flow from the future to the past on the basis of the unidirectional flow from the past to the future of the LSTM network, which can more fully mine the bidirectional time series feature structure of the data, thereby improving the model prediction ability. Therefore, the CNN-BiLSTM hybrid model has advantages in processing fluctuating load data and nonlinear data.
[0177] According to the characteristics of power load features, the present invention uses an adaptive neural network to predict the load, and combines the trend sequence prediction of the CNN-BiLSTM hybrid model with the seasonal sequence prediction and irregular sequence prediction results of the XGBoost model. It has greater advantages in solving the problem that the power grid load is affected by nonlinear and uncertain factors, and can more comprehensively predict the load data when complex factors are present, thereby improving the accuracy and generalization ability of load prediction.
[0178] Embodiment 2 of the present invention proposes a load forecasting system based on the combination of CNN-BiLSTM and XGBoost, which is used to run a load forecasting method based on the combination of CNN-BiLSTM and XGBoost, including:
[0179] Data acquisition module: used to acquire historical load data and historical meteorological data, and preprocess the historical load data and historical meteorological data to obtain preprocessed historical load data;
[0180] Data decomposition module: used to decompose the pre-processed historical load data using the multiplication seasonal adjustment method to obtain trend series, seasonal series and irregular series;
[0181] Load forecasting module: used to build a CNN-BiLSTM hybrid model, predict trend sequences, build an XGBoost model, and predict seasonal sequences and irregular sequences;
[0182] Forecast output module: used to multiply the trend sequence, seasonal sequence and irregular sequence, and evaluate the results to obtain the predicted load data, and realize the load forecasting method and system based on the combination of CNN-BiLSTM and XGBoost.
[0183] Embodiment 3 of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, the load prediction method based on the combination of CNN-BiLSTM and XGBoost according to Embodiment 1 is implemented.
[0184] Embodiment 4 of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements a load prediction method based on the combination of CNN-BiLSTM and XGBoost according to Embodiment 1.
[0185] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A load forecasting method based on the combination of CNN-BiLSTM and XGBoost, characterized by: Step 1: Obtain historical load data and historical meteorological data, and preprocess the historical load data and historical meteorological data to obtain preprocessed historical load data; Step 2: Use the multiplication seasonal adjustment method to decompose the preprocessed historical load data to obtain trend series, seasonal series and irregular series; Step 3: Construct a CNN-BiLSTM (Convolutional Neural Network with Bidirectional Long Short-Term Memory) hybrid model to predict the trend sequence obtained in step 2 to obtain the predicted trend sequence; Step 4: Build an XGBoost (eXtreme GradientBoosting) model to predict the seasonal sequence and irregular sequence in step 2 to obtain the predicted seasonal sequence and the predicted irregular sequence; Step 5: Multiply the trend sequence predicted in step 3, the seasonal sequence predicted in step 4, and the predicted irregular sequence, and evaluate the results to obtain the predicted load data, thus realizing the load forecasting method and system based on the combination of CNN-BiLSTM and XGBoost.
2. According to claim 1, a load forecasting method based on the combination of CNN-BiLSTM and XGBoost is characterized in that: In step 1, the Pearson correlation coefficient method is used to extract historical meteorological data with a correlation coefficient greater than 0.2 between historical load data and historical meteorological data, and the historical load data is combined with the historical load data to form the preprocessed historical load data. xy , expressed as follows: In the formula, J0 represents the sample size, x j0 is the historical load data of the j0th sample, y j0 is the historical meteorological data of the j0th sample, x j0 and j0 The mean of .
3. The load forecasting method based on the combination of CNN-BiLSTM and XGBoost according to claim 1, characterized in that: In step 3, the CNN-BiLSTM hybrid model includes a CNN (Convolutional Neural Network) model and a BiLSTM (Bi-directional Long Short-Term Memory) model in sequence, wherein the CNN model includes a two-dimensional convolutional layer, a two-dimensional pooling layer and a flattening layer, the flattening layer compresses the array output by the two-dimensional convolutional layer into a one-dimensional vector array, the BiLSTM model includes a repeated vector layer, a BiLSTM network layer and a fully connected layer, the one-dimensional vector array output by the flattening layer is input into the repeated vector layer to convert the data into the input format of the BiLSTM network layer, the output of the BiLSTM network layer is output through the fully connected layer, and the predicted value of the CNN-BiLSTM hybrid model is obtained.
4. According to claim 3, a load forecasting method based on the combination of CNN-BiLSTM and XGBoost is characterized in that: The CNN model has four two-dimensional convolutional layers. The number of convolutional kernels is set to 32, 64, 128, and 256 respectively. The size of each convolutional kernel is 3*3. The convolutional layer is expressed as follows: Where: is the feature map from i to convolution layer l+1; is the weight of the convolution kernel in convolution layer l, which is obtained by the output of the previous layer Perform convolution operations to create the input for the next layer; is the deviation value; K is the number of selected convolution kernels; σ is the activation function.
5. The load forecasting method based on the combination of CNN-BiLSTM and XGBoost according to claim 3 is characterized in that: The BiLSTM network consists of a forward LSTM (Long Short-Term Memory) and a backward LSTM network in parallel, which can be expressed as follows: y t =a t h t-1 +b t h i+1 +c t In the formula, h t is the forward hidden layer state, h i is the backward hidden layer state, a t and b t are the hidden layer output weights of the forward and backward propagation units, respectively. c t is the hidden layer bias optimization parameter at the current moment, y t is the output at time t, LSTM(x t0 ,h t0-1 ) represents the LSTM network, which is expressed as follows: In the formula, σ and tanh are the Sigmoid function and the hyperbolic tangent function respectively, W fx , W ix , W ox With b f 、b i 、b o are the corresponding weight coefficient matrix and bias passing through the LSTM layer, that is, the parameters adjusted after feedback from the loss function during training, f t0 Forget gating, which controls the S of the previous state t0-1 The specific forgotten part, i t0 is the input gate, which controls the input x t0 Memory, o t0 It is output gating, which controls the output of the current state. S t0 The result is converted to a value between -1 and 1 through tanh. h t0 is the output of step t0.
6. The load forecasting method based on the combination of CNN-BiLSTM and XGBoost according to claim 1 is characterized in that: In step 4, the objective function Obj of the XGBoost model is expressed as follows: In the formula, n is the sample size, p m is the true value of the mth sample, is the load forecast value of the mth sample, is the loss function, N is the number of trees, is the sum of the regularization terms of N trees, Ω(f n ) is expressed as follows: In the formula, T is the number of leaf nodes in the tree. w r is the score of the rth leaf node, λ is the fraction that controls the weight of the leaf node. γ is the weight coefficient of the penalty term.
7. The load forecasting method based on the combination of CNN-BiLSTM and XGBoost according to claim 1 is characterized in that: In step 5, the mean absolute percentage error is used to evaluate the prediction effect, which is expressed as follows: In the formula, Q is the total number of samples, is the predicted value of the qth sample, y q is the actual value of the qth sample.
8. A load forecasting system based on the combination of CNN-BiLSTM and XGBoost, used to run the load forecasting method based on the combination of CNN-BiLSTM and XGBoost described in any one of claims 1 to 7, characterized in that: Data acquisition module: used to acquire historical load data and historical meteorological data, and preprocess the historical load data and historical meteorological data to obtain preprocessed historical load data; Data decomposition module: used to decompose the pre-processed historical load data using the multiplication seasonal adjustment method to obtain trend series, seasonal series and irregular series; Load forecasting module: used to build a CNN-BiLSTM hybrid model, predict trend sequences, build an XGBoost model, and predict seasonal sequences and irregular sequences; Forecast output module: used to multiply the trend sequence, seasonal sequence and irregular sequence, and evaluate the results to obtain the predicted load data, and realize the load forecasting method and system based on the combination of CNN-BiLSTM and XGBoost.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is loaded into a processor, a load forecasting method based on the combination of CNN-BiLSTM and XGBoost is implemented according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, a load forecasting method based on the combination of CNN-BiLSTM and XGBoost is implemented according to any one of claims 1 to 7.
Citation Information
Patent Citations
A power grid load forecasting method and device based on XGBoost-LSTM
CN114862032B
Cited By
Load prediction method and system based on virtual power plant operation
CN120893637A
A load prediction method and system based on virtual power plant operation
CN120893637B