A method and device for power system load forecasting based on XGBoost

Through the power system load forecasting method based on XGBoost, historical power load data is extracted and processed to solve the problems of complex nonlinear relationships and timing characteristics in medium and long-term power load forecasting, achieving higher forecast accuracy and power system stability. .

CN117458481BActive Publication Date: 2025-01-24GUANGDONG POWER GRID CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311529375.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-15
Publication Date
2025-01-24
Estimated Expiration
2043-11-15

Smart Images

  • Figure CN117458481B_ABST
    Figure CN117458481B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for predicting load of a power system based on XGBoost, wherein the method comprises: obtaining historical power load data of a preset period, preprocessing the historical power load data of the preset period, and obtaining first power load data; processing the first power load data by a preset XGBoost algorithm, and obtaining a cross-feature value; performing feature processing on the historical power load data and the cross-feature value of the preset period by a preset feature engineering, and obtaining second feature data; performing load prediction on the second feature data by a preset DNN model, and obtaining predicted load data; comparing the predicted load data with the actual historical load data, and obtaining a medium- and long-term load prediction result of the power system by a preset screening condition. The present invention can better capture the complex nonlinear relationship and time series characteristics in the actual power load data, improve the accuracy and robustness of medium- and long-term power load prediction, and enhance the load capacity and operation stability of the power system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of medium- and long-term load forecasting of power grids, and specifically relates to a method and device for power system load forecasting based on XGBoost. Background Art

[0002] Power load forecasting plays a vital role in power system dispatching, maintenance and capacity planning, and is of great significance for guiding power grid planning and construction and improving the optimal allocation of power system resources. The actual power load forecast is divided into short-term, medium-term and long-term forecasts, and medium-term and long-term load forecasts are of great significance for the economic, efficient and safe operation of the power system. However, medium-term and long-term load forecasting faces many challenges, especially under the new industrial system, which causes the load to present complex asymmetric oscillation and variable characteristics, increasing the difficulty of accurate forecasting. Compared with short-term load forecasting, medium-term and long-term load forecasting requires less data. Therefore, accurate power load forecasting with a large time span is of great significance for the economic, efficient and safe operation of the power system, as well as power generation planning and power layout planning.

[0003] Because actual power load data often exhibits strong nonlinear, large volatility and time series characteristics, and existing load forecasting models rarely consider complex nonlinear relationships and time series characteristics, the accuracy of the forecast needs to be improved. Summary of the invention

[0004] The present invention proposes a method and device for power system load forecasting based on XGBoost, which can better capture the complex nonlinear relationship and time series characteristics in actual power load data, improve the accuracy and robustness of medium- and long-term power load forecasting, and enhance the load capacity and operation stability of the power system.

[0005] A first aspect of the present invention provides a method for power system load forecasting based on XGBoost, the method comprising:

[0006] Acquire historical power load data for a preset period, and preprocess the historical power load data for the preset period to obtain first power load data;

[0007] Processing the first power load data by a preset XGBoost algorithm to obtain a cross-eigenvalue; wherein the calculation parameters in the preset XGBoost algorithm are obtained by optimizing the preset BSO algorithm, and the calculation parameters include a learning rate, the number of regression trees, and the depth of the regression trees;

[0008] Performing feature processing on historical power load data and cross-feature values ​​for a preset period of time through preset feature engineering to obtain second feature data;

[0009] Perform load forecasting on the second characteristic data through a preset DNN model to obtain forecasted load data;

[0010] Compare the predicted load data with the actual historical load data, and obtain the medium- and long-term load forecast results of the power system through preset screening conditions.

[0011] The above scheme uses historical power load data of a preset time period, and through feature extraction and data prediction, it can better capture the nonlinear relationship and time series characteristics of the data, and then improve the accuracy of the data through data comparison to obtain medium- and long-term load forecast results, so that the power load forecast has higher accuracy and robustness, which helps to improve the load capacity and operational stability of the power system.

[0012] In a possible implementation method of the first aspect, historical power load data for a preset period is obtained, and the historical power load data for the preset period is preprocessed to obtain first power load data, specifically:

[0013] According to the historical power load data of a preset time period, the historical power load data of the preset time period is sequentially subjected to time resolution determination, feature extraction, seasonal adjustment, missing value processing and data standardization to obtain first power load data.

[0014] Among them, determining the time resolution is to determine the time interval for data sampling, feature extraction is to extract the average, maximum, minimum and standard deviation of the historical power load data for a preset period, seasonal adjustment is to adjust the data using a preset differential operation and seasonal indicators, missing value processing is to fill the missing values ​​of the historical power load data for a preset period using a preset interpolation method, and data standardization is to unify the data format of the historical power load data for a preset period using a preset standardization processing method.

[0015] The above scheme pre-processes the historical power load data of the preset time period, extracts the data features required by the XGBoost algorithm, and sets the time interval for data sampling to facilitate the subsequent calculation of the XGBoost algorithm and improve the efficiency of data calculation.

[0016] In a possible implementation method of the first aspect, the first power load data is processed by a preset XGBoost algorithm to obtain a cross eigenvalue, specifically:

[0017] According to the first power load data, a derivative of each first power load data is calculated by a preset loss function of the XGBoost algorithm;

[0018] constructing a regression tree corresponding to the first power load data according to the derivative of the first power load data;

[0019] updating the first power load data according to the regression tree;

[0020] When the regression tree meets the preset termination condition, a cross characteristic value is obtained according to the current first power load data;

[0021] Otherwise, the regression tree is constructed again according to the current first power load data.

[0022] The above scheme processes the first power load data through the preset XGBoost algorithm, extracts the target feature data, and obtains a high-precision cross-feature value for power load prediction.

[0023] In a possible implementation method of the first aspect, updating the first power load data is specifically:

[0024] Updated First Power Load Data The specific formula is:

[0025]

[0026] Among them, t is the number of times the regression tree is constructed, x i is the first power load data of the ith k is the regression tree constructed for the kth time, F is the set of all regression trees, f t is the regression tree constructed for the tth time, It is the first power load data after the last update.

[0027] In a possible implementation method of the first aspect, the calculation parameters in the preset XGBoost algorithm are obtained by optimizing the preset BSO algorithm, specifically:

[0028] The learning rate, number of regression trees and depth of regression trees in the preset XGBoost algorithm are optimized according to the preset BSO algorithm, and the optimal learning rate, number of regression trees and depth of regression trees are obtained through the preset k-means clustering algorithm;

[0029] The optimal learning rate, number of regression trees, and depth of the regression trees are input into the preset XGBoost algorithm to optimize the calculation parameters of the preset XGBoost algorithm.

[0030] The above scheme searches for and optimizes the parameters of the preset XGBoost algorithm through the preset BSO algorithm, so that the preset XGBoost algorithm has better feature extraction capabilities and can capture the features of the data more accurately.

[0031] In a possible implementation method of the first aspect, feature processing is performed on historical power load data and cross-feature values ​​of a preset period of time through preset feature engineering to obtain second feature data, specifically:

[0032] According to the historical power load data of the preset period, the time resolution is set, and then seasonal adjustment is performed to obtain the output characteristics;

[0033] The output feature and the cross feature value are concatenated to obtain the second feature data.

[0034] The above solution divides the data into time periods through feature engineering to reduce the impact of seasonal changes on the data, and then splices the data to obtain complete data for subsequent load forecasting.

[0035] In a possible implementation method of the first aspect, load prediction is performed on the second characteristic data by using a preset DNN model to obtain predicted load data, specifically:

[0036] Inputting the second feature data into a preset DNN model, delinearizing the second feature data, and capturing the nonlinear relationship of the second feature data to obtain a third input value;

[0037] According to the third input value, an iterative operation is performed with a preset timing target through the offset vector and a plurality of weight coefficient matrices of the DNN model, and when the preset iteration conditions are met, the predicted load data is determined.

[0038] The above scheme uses a preset DNN model to perform load forecasting. It first delinearizes the data and then performs iterative calculations to continuously improve the prediction accuracy and accurately capture the timing characteristics of the data to obtain predicted load data that meets the iteration conditions.

[0039] In a possible implementation method of the first aspect, the load data is predicted by:

[0040] Forecast load data i The specific formula is:

[0041]

[0042] Among them, x i is the third input value of i, w ij is the weight coefficient matrix, b j is the offset vector, n is the total number of third input values, and j is x i The jth operation in a hidden layer of the preset DNN model.

[0043] In a possible implementation method of the first aspect, the predicted load data and the actual historical load data are compared, and a medium- and long-term load forecast result is obtained through a preset screening condition, specifically:

[0044] Calculate the root mean square error and mean absolute percentage error between the predicted load data and the actual historical load data;

[0045] According to the root mean square error and the mean absolute percentage error, the accuracy of the predicted load data is evaluated through preset screening conditions to obtain a medium- and long-term load forecasting result that meets the preset data accuracy.

[0046] The above scheme compares the predicted load data with the actual historical load data, calculates the root mean square error and the mean absolute percentage error to evaluate the accuracy of the predicted load data, finds data that meets the requirements, and improves data accuracy.

[0047] In a possible implementation method of the first aspect, the root mean square error and the mean absolute percentage error are specifically:

[0048] Root mean square error y RMSE The specific formula is:

[0049]

[0050] Among them, n is the number of predicted load data, m is the number of predicted future time points, and X true (ij) is the actual historical load data of the ith item at the jth time point, X pred (ij) is the predicted load data of the ith item at the jth time point;

[0051] Mean absolute percentage error y MAPE The specific formula is:

[0052]

[0053] The second aspect of the present invention provides a power system load forecasting device based on XGBoost, the device comprising: a data preprocessing module, a feature extraction module, a feature processing module, a power load forecasting module and a data verification module;

[0054] The data preprocessing module is used to obtain historical power load data of a preset period for preprocessing to obtain first power load data; wherein the preprocessing includes setting time resolution, feature extraction, seasonal adjustment, missing value processing and data standardization;

[0055] The feature extraction module is used to process the first power load data through a preset XGBoost algorithm to obtain a cross-feature value; wherein the preset XGBoost algorithm has optimized calculation parameters through a preset BSO algorithm, and the calculation parameters include a learning rate, the number of regression trees, and the depth of the regression trees;

[0056] The feature processing module is used to perform feature processing through preset feature engineering according to the historical power load data and the cross feature value of the preset period to obtain the second feature data;

[0057] The power load prediction module is used to perform load prediction based on the second characteristic data through a preset DNN model to obtain predicted load data;

[0058] The data verification module is used to compare the predicted load data with the actual historical load data, and obtain the medium- and long-term load forecast results through preset screening conditions;

[0059] The power system optimization module is used to optimize the load capacity of the power system according to the medium and long-term load forecast results. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the implementation mode will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0061] Figure 1 A specific flow chart of a method for load forecasting of a power system based on XGBoost is provided in a certain embodiment of the present invention;

[0062] Figure 2 A schematic diagram of a BSO-XGBoost-DNN neural network model of a power system load forecasting method based on XGBoost is provided in a certain embodiment of the present invention;

[0063] Figure 3 A structural diagram of an XGBoost-based power system load forecasting device is provided in accordance with a certain embodiment of the present invention. DETAILED DESCRIPTION

[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0065] It should be understood that the step numbers used in this article are only for the convenience of description and are not intended to limit the order in which the steps are executed.

[0066] like Figure 1 As shown, Figure 1 A specific flow chart of a power system load forecasting method based on XGBoost is provided for a certain embodiment of the present invention. The power system load forecasting method based on XGBoost in this embodiment includes steps S1 to S5, which are described in detail as follows:

[0067] Step S1, obtaining historical power load data of a preset period, preprocessing the historical power load data of the preset period, and obtaining first power load data;

[0068] In this step, firstly, based on the historical power load data of a preset time period in a certain area, the historical power load data of the preset time period is sequentially subjected to time resolution determination, feature extraction, seasonal adjustment, missing value processing and data standardization to obtain the first power load data.

[0069] Among them, these preprocessing are specifically:

[0070] Determine the time resolution: Determine the data sampling time interval as daily to ensure that the power load data has consistent sampling within this time interval;

[0071] Feature extraction: extracting features from the historical power load data for a preset period of time for input into the XGBoost algorithm; in some embodiments, the features are the average, maximum, minimum, and standard deviation of the power load data for each day, week, or season;

[0072] Seasonal adjustment: Use preset differential operations and seasonal indicators to seasonally adjust power quotas and data to eliminate the impact of seasonal changes on load forecasts;

[0073] Missing value processing: Use interpolation methods (linear interpolation or spline interpolation) to fill in the missing values ​​of power load data to ensure data continuity;

[0074] Data standardization: Use the preset z-score standardization to standardize the power load data and unify the data format.

[0075] Step S2, processing the first power load data by a preset XGBoost algorithm to obtain a cross eigenvalue;

[0076] In this step, the preset XGBoost algorithm first optimizes the calculation parameters therein through the preset BSO algorithm, and then processes the first power load data through the preset XGBoost algorithm to obtain the cross eigenvalue.

[0077] The preset BSO algorithm optimizes the values ​​of the three calculation parameters of the preset XGBoost algorithm: learning rate, number of regression trees, and depth of regression trees. The specific operations are as follows:

[0078] 1) Initialization: First, initialize the preset parameters of the BSO algorithm, including the population size, dimension, number of clusters, number of iterations, and the range of the search space; at the same time, during the population size initialization process, randomly generate N idea individuals as a population of individuals randomly and evenly distributed within the dynamic range of the solution space;

[0079] 2) Clustering: Using the preset k-means clustering algorithm, idea individuals in the same or similar fields are grouped into a group. All idea individuals in the population are clustered into several clusters, and the center of each cluster is the idea individual with the best performance in the cluster;

[0080] 3) Individual update: In the preset BSO algorithm, new idea individuals are generated by adding random perturbations to the centers or idea individuals in one or more clusters; when a cluster is selected to generate new idea individuals, the formula is as follows:

[0081] X new =X old +ξ(t)*random(t)

[0082] Among them, X new is the new idea individual, X old is the original idea, t is the current iteration number, random(t) is a function used to generate a random number between 0 and 1, and ξ(t) is a random number generated by random() to X new The coefficient for weighting the contribution of

[0083] The specific formula of ξ(t) is as follows:

[0084]

[0085] Where logsig() is the transfer function, T is the maximum number of iterations, and k is the coefficient that controls the slope of logsig();

[0086] When two clusters are selected to generate new idea individuals, the formula is as follows:

[0087] X olds =w*X old 1+(1-w)*X old 2

[0088] X new =X olds+ξ(t)*random(t)

[0089] Among them, X olds For X old 1 and X old 2, w is a randomly generated coefficient between 0 and 1, X old 1 and X old 2 are the idea individuals selected from the two clusters respectively;

[0090] 4) Idea replacement: Calculate the fitness of the new idea individual and the original idea individual, compare the fitness, and keep the idea individual with a higher fitness value; the commonly used fitness function is to calculate the mean square error or mean absolute error;

[0091] 5) Repeat 2) to 4) until the termination condition is met;

[0092] 6) Input the idea individuals with higher fitness values ​​obtained within the population into the preset XGBoost algorithm to optimize the learning rate, number of regression trees and depth of the preset XGBoost algorithm.

[0093] In some embodiments, the step S2 comprises:

[0094] The specific steps of the preset XGBoost algorithm are:

[0095] 1) Initialization: optimizing the learning rate, the number of regression trees, and the depth of the regression trees of the preset XGBoost algorithm through the preset BSO algorithm, and initializing the remaining calculation parameters and each first power load data;

[0096] 2) Calculating the loss function: defining the loss function and calculating the derivative of the loss function for each first power load data;

[0097] 3) Constructing a regression tree: According to the derivative of the first power load data, an approximate greedy algorithm is used to find the optimal cutting point, and then a new regression tree is generated;

[0098] 4) Accumulation calculation: the first power load data is updated by accumulating the new regression tree to the first power load data;

[0099] 5) Repeat steps 2) to 4) until the regression tree meets the preset termination condition and stops iteration;

[0100] 6) Obtain a cross eigenvalue based on the current first power load data and the regression tree; wherein each element of the vector of the cross eigenvalue corresponds to a leaf node of the regression tree, the length of the vector of the cross eigenvalue is the sum of the number of leaf nodes of all regression trees, and the cross eigenvalue takes a value of 0 or 1.

[0101] Updated First Power Load Data The specific formula is:

[0102]

[0103] Among them, t is the number of times the regression tree is constructed, x i is the first power load data of the ith k is the regression tree constructed for the kth time, F is the set of all regression trees, f t is the regression tree constructed for the tth time, It is the first power load data after the last update.

[0104] The default objective function of the XGBoost algorithm is:

[0105]

[0106] in, is the loss function, representing the predicted value y of the i-th first power load data i and The difference between Ω(f i ) is the complexity of the regression tree, which is used to prevent the results of the preset XGBoost algorithm from being overfitted;

[0107] Ω(f i ) is as follows:

[0108]

[0109] Among them, γ is the parameter used to control the number of leaves of the regression tree, T is the number of leaves of the regression tree, is the L2 norm of the leaf node weight vector of the regression tree, and λ is a parameter that controls the regularization strength (usually the default value is 1, λ∈[0,+∞));

[0110] In the objective function O optimized by the addition strategy (t) , the specific formula is:

[0111]

[0112]

[0113]

[0114] Where N is the total number of regression trees, g i For x i The first-order derivative of the squared loss function, h i For x i The second derivative of the squared loss function, For x i The square of the regression tree at the tth iteration of .

[0115] Step S3, performing feature processing on the historical power load data and the cross-feature values ​​of the preset time period through a preset feature engineering to obtain second feature data;

[0116] In this step, the historical power load data of the preset time period is first processed in three aspects of year, month and day through preset feature engineering, and the time resolution is set; then the multi-order differential data is used as the offset value to process the historical power load data of the preset time period; wherein the multi-order differential data is the difference between the load at the previous time point and the load at the current time point; finally, the historical power load data of the preset time period is processed by unique hot encoding according to the feature category to obtain the output features.

[0117] The output feature and the cross feature value are concatenated to obtain the second feature data.

[0118] Step S4, performing load prediction on the second characteristic data by using a preset DNN model to obtain predicted load data;

[0119] In this step, the second feature data is input into the preset DNN model to learn the time series target of the medium- and long-term power load, and then the medium- and long-term power load in years is predicted.

[0120] The specific learning process of the preset DNN model is:

[0121] 1) Weight initialization: taking the second feature data as training data, and using a preset initialization method to initialize the parameters of the training data to obtain a third input value; the initialized parameters include the number of hidden layers, the number of neurons in each hidden layer, the learning rate, the activation function and the optimizer;

[0122] 2) Forward propagation calculation: linear operation and activation operation are performed on the third input value using the offset vector and a plurality of weight coefficient matrices; wherein the activation function used in the activation operation is the ReLU function, and the function of the activation function is to delinearize the data and realize the nonlinear classification task; the linear operation and activation operation start from the input layer of the DNN model, and are calculated backward layer by layer until the output layer of the DNN model is reached to obtain the output value;

[0123] 3) Loss calculation: The preset DNN model uses the logarithm of the binary classification as the loss function, and calculates the loss value through the loss function; the formula of the loss function cost of the preset DNN model is:

[0124]

[0125] Among them, m is the total number of output layers, i is the i-th layer, and h θ (x) is the activation value of the last output layer, y i is the output value;

[0126] 4) Backward propagation calculation: Use the loss value obtained in step 3) to calculate the gradient, and propagate the gradient to the input layer to update the weight coefficient matrix;

[0127] 5) Update weights: After all gradients are obtained, update the weight coefficient matrix; this embodiment uses the gradient descent method to update the weight coefficient matrix, and the specific formula is:

[0128] W=W-αdW

[0129] b=b-αdb

[0130] Among them, W is the weight coefficient matrix, α is the learning rate, and b is the bias term of the preset DNN model;

[0131] 6) Repeat steps 2) to 5) until the preset iteration condition is met, and then end the calculation;

[0132] 7) The output value after training is used as the predicted load data.

[0133] Forecast load data i The specific formula is:

[0134]

[0135] Among them, x i is the third input value of i, w ij is the weight coefficient matrix, b j is the offset vector, n is the total number of third input values, and j is x i The jth operation in a hidden layer of the preset DNN model;

[0136] Use the ReLU activation function to predict the load data y i Make corrections, specifically:

[0137]

[0138] In order to better describe how the preset DNN model predicts power load data, Figure 2 A schematic diagram of the BSO-XGBoost-DNN neural network model of the power system load forecasting method based on XGBoost is provided. As shown in the figure, the BSO algorithm is first used to optimize the calculation parameters of the XBBoost algorithm, and the data output by the XBBoost algorithm is transformed to obtain feature data, and then the feature data is input into the DNN model, and the predicted power load data is obtained after layers of calculations.

[0139] Step S5, comparing the predicted load data with the actual historical load data, and obtaining the long-term load forecast result of the power system through the preset screening conditions;

[0140] In this step, the root mean square error and mean absolute percentage error of the predicted load data and the actual historical load data are first calculated, and then the accuracy of the predicted load data is evaluated based on the root mean square error and the mean absolute percentage error through preset screening conditions to obtain a medium- and long-term load forecast result that meets the preset data accuracy.

[0141] Root mean square error y RMSE The specific formula is:

[0142]

[0143] Among them, n is the number of predicted load data, m is the number of predicted future time points, and X true (ij) is the actual historical load data of the ith item at the jth time point, X pred (ij) is the predicted load data of the ith item at the jth time point.

[0144] Mean absolute percentage error y MAPE The specific formula is:

[0145]

[0146] Further, in order to execute the XGBoost-based power system load forecasting device corresponding to the above method embodiment to achieve the corresponding functions and technical effects, Figure 3 A structural diagram of a power system load forecasting device based on XGBoost is provided. For ease of explanation, only the parts related to this embodiment are shown. The power system load forecasting device based on XGBoost provided by the embodiment of the present invention includes:

[0147] The data preprocessing module 201 is used to obtain historical power load data for a preset period, and preprocess the historical power load data for the preset period to obtain first power load data;

[0148] A feature extraction module 202 is used to process the first power load data by a preset XGBoost algorithm to obtain a cross-feature value; wherein the calculation parameters in the preset XGBoost algorithm are obtained by optimizing the preset BSO algorithm, and the calculation parameters include a learning rate, a number of regression trees, and a depth of the regression trees;

[0149] A feature processing module 203 is used to perform feature processing on the historical power load data and the cross feature value of a preset period through a preset feature engineering to obtain second feature data;

[0150] The power load prediction module 204 is used to perform load prediction on the second characteristic data through a preset DNN model to obtain predicted load data;

[0151] The data verification module 205 is used to compare the predicted load data with the actual historical load data, and obtain the medium- and long-term load forecast result of the power system through preset screening conditions.

[0152] This embodiment proposes a method and device for load forecasting of an electric power system based on XGBoost: obtaining historical electric power load data of a preset period, preprocessing the historical electric power load data of the preset period, and obtaining first electric power load data; processing the first electric power load data by a preset XGBoost algorithm to obtain cross-eigenvalues; performing feature processing on the historical electric power load data and cross-eigenvalues ​​of the preset period by a preset feature engineering to obtain second feature data; performing load forecasting on the second feature data by a preset DNN model to obtain predicted load data; comparing the predicted load data with the actual historical load data, and obtaining the medium- and long-term load forecasting results of the electric power system by a preset screening condition. Its beneficial effects are: it can better capture the complex nonlinear relationships and time series characteristics in the actual electric power load data, improve the accuracy and robustness of medium- and long-term electric power load forecasting, and enhance the load capacity and operational stability of the electric power system.

[0153] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A power system load forecasting method based on XGBoost, characterized in that: include: Acquire historical power load data for a preset period, and preprocess the historical power load data for the preset period to obtain first power load data; Processing the first power load data by a preset XGBoost algorithm to obtain a cross-eigenvalue; wherein the calculation parameters in the preset XGBoost algorithm are obtained by optimizing the preset BSO algorithm, and the calculation parameters include a learning rate, the number of regression trees, and the depth of the regression trees; The historical power load data and cross-feature values ​​of the preset time period are processed by the preset feature engineering to obtain the second feature data, specifically: firstly, the historical power load data of the preset time period is processed in three aspects of year, month and day by the preset feature engineering, and the time resolution is set; then, the multi-order difference data is used as the offset value to process the historical power load data of the preset time period; wherein the multi-order difference data is the difference between the load at the previous time point and the load at the current time point; finally, the historical power load data of the preset time period is processed by unique hot encoding according to the feature category, and the output feature is obtained; the output feature and the cross-feature value are spliced ​​to obtain the second feature data; Perform load forecasting on the second characteristic data through a preset DNN model to obtain forecasted load data; Compare the predicted load data with the actual historical load data, and obtain the medium- and long-term load forecast results of the power system through preset screening conditions.

2. The power system load forecasting method based on XGBoost according to claim 1, characterized in that: The obtaining of historical power load data for a preset period of time and preprocessing of the historical power load data for the preset period of time to obtain the first power load data is specifically: According to the historical power load data of the preset period, determining the time resolution, extracting features, performing seasonal adjustment, processing missing values ​​and standardizing data are performed on the historical power load data of the preset period in sequence to obtain first power load data; Among them, determining the time resolution is to determine the time interval for data sampling, feature extraction is to extract the average, maximum, minimum and standard deviation of the historical power load data for a preset period, seasonal adjustment is to adjust the data using a preset differential operation and seasonal indicators, missing value processing is to fill the missing values ​​of the historical power load data for a preset period using a preset interpolation method, and data standardization is to unify the data format of the historical power load data for a preset period using a preset standardization processing method.

3. The power system load forecasting method based on XGBoost according to claim 1, characterized in that: The first power load data is processed by a preset XGBoost algorithm to obtain a cross eigenvalue, specifically: According to the first power load data, a derivative of each first power load data is calculated by a preset loss function of the XGBoost algorithm; constructing a regression tree corresponding to the first power load data according to the derivative of the first power load data; updating the first power load data according to the regression tree; When the regression tree meets the preset termination condition, a cross characteristic value is obtained according to the current first power load data; Otherwise, the regression tree is constructed again according to the current first power load data.

4. The power system load forecasting method based on XGBoost according to claim 3 is characterized in that: The updating of the first power load data is specifically: Updated first power load data The specific formula is: Among them, t is the number of times the regression tree is constructed, x i is the first power load data of the ith k is the regression tree constructed for the kth time, F is the set of all regression trees, f t is the regression tree constructed for the tth time, It is the first power load data after the last update.

5. The power system load forecasting method based on XGBoost according to claim 1, characterized in that: The calculation parameters in the preset XGBoost algorithm are obtained by optimizing the preset BSO algorithm, specifically: The learning rate, number of regression trees and depth of regression trees in the preset XGBoost algorithm are optimized according to the preset BSO algorithm, and the optimal learning rate, number of regression trees and depth of regression trees are obtained through the preset k-means clustering algorithm; The optimal learning rate, number of regression trees, and depth of the regression trees are input into the preset XGBoost algorithm to optimize the calculation parameters of the preset XGBoost algorithm.

6. The power system load forecasting method based on XGBoost according to claim 1, characterized in that: The feature processing of the historical power load data and the cross-feature values ​​of the preset period is performed through the preset feature engineering to obtain the second feature data, which is specifically: According to the historical power load data of the preset period, the time resolution is set, and then seasonal adjustment is performed to obtain the output characteristics; The output feature and the cross feature value are concatenated to obtain the second feature data.

7. The power system load forecasting method based on XGBoost according to claim 1, characterized in that: The load prediction is performed on the second characteristic data by using a preset DNN model to obtain predicted load data, specifically: Inputting the second feature data into a preset DNN model, delinearizing the second feature data, and capturing the nonlinear relationship of the second feature data to obtain a third input value; According to the third input value, an iterative operation is performed with a preset timing target through the offset vector and a plurality of weight coefficient matrices of the DNN model, and when the preset iteration conditions are met, the predicted load data is determined.

8. The power system load forecasting method based on XGBoost according to claim 7 is characterized in that: The predicted load data is specifically: Forecast load data i The specific formula is: Among them, x i is the third input value of i, w ij For x i The corresponding weight coefficient matrix, b j is the offset vector, n is the total number of third input values, and j is x i The jth operation in a hidden layer of the preset DNN model.

9. The power system load forecasting method based on XGBoost according to claim 1, characterized in that: The predicted load data is compared with the actual historical load data, and the medium- and long-term load forecast results are obtained through preset screening conditions, specifically: Calculate the root mean square error and mean absolute percentage error between the predicted load data and the actual historical load data; According to the root mean square error and the mean absolute percentage error, the accuracy of the predicted load data is evaluated through preset screening conditions to obtain a medium- and long-term load forecasting result that meets the preset data accuracy.

10. The XGBoost-based power system load forecasting method according to claim 9, characterized in that: The root mean square error and mean absolute percentage error are specifically: Root mean square error y RMSE The specific formula is: Among them, n is the number of predicted load data, m is the number of predicted future time points, and X true (ij) is the actual historical load data of the ith item at the jth time point, X pred (ij) is the predicted load data of the ith item at the jth time point; Mean absolute percentage error y MAPE The specific formula is:

11. A power system load forecasting device based on XGBoost, characterized in that: include: Data preprocessing module, feature extraction module, feature processing module, power load forecasting module and data verification module; The data preprocessing module is used to obtain historical power load data of a preset period, preprocess the historical power load data of the preset period, and obtain first power load data; The feature extraction module is used to process the first power load data through a preset XGBoost algorithm to obtain a cross-feature value; wherein the calculation parameters in the preset XGBoost algorithm are obtained by optimizing the preset BSO algorithm, and the calculation parameters include a learning rate, the number of regression trees, and the depth of the regression tree; The feature processing module is used to perform feature processing on the historical power load data and cross-feature values ​​of the preset time period through preset feature engineering to obtain the second feature data, specifically: firstly, the historical power load data of the preset time period is processed in three aspects of year, month and day through the preset feature engineering, and the time resolution is set; then, the multi-order difference data is used as the offset value to process the historical power load data of the preset time period; wherein the multi-order difference data is the difference between the load at the previous time point and the load at the current time point; finally, the historical power load data of the preset time period is processed by unique hot encoding according to the feature category, and the output feature is obtained; the output feature and the cross-feature value are spliced ​​to obtain the second feature data; The power load prediction module is used to perform load prediction on the second characteristic data through a preset DNN model to obtain predicted load data; The data verification module is used to compare the predicted load data with the actual historical load data, and obtain the medium- and long-term load forecast result of the power system through preset screening conditions.

Citation Information

Patent Citations

  • Power load prediction method and device, computer equipment and storage medium

    CN112330077A

  • Power distribution network short-term load prediction method and device, terminal and storage medium

    CN113361785A