A large user power load prediction method based on machine learning and deep learning

By combining heterogeneous modeling of random forest, LightGBM and GRU models, optimizing data preprocessing and weighted fusion, the problems of insufficient accuracy and computational complexity of traditional power load forecasting methods for large users are solved, and high-precision, low-cost load forecasting for special large users such as steel plants is achieved.

CN121435194BActive Publication Date: 2026-04-07TELLHOW SOFTWARE
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-29
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Traditional power load forecasting methods cannot effectively integrate the impact of production plans on load when dealing with the high-precision requirements of large users, especially special large users such as steel mills. This results in a large deviation between the forecast results and the actual situation. Furthermore, existing models are computationally expensive, complex to train, and difficult to adjust in real time.

Method used

We employ a random forest model for feature extraction, combine it with LightGBM and GRU models for training, and use a LASSO model for weighted fusion. By leveraging the heterogeneous modeling mechanism of LightGBM and GRU models, we extract complementary information, optimize data preprocessing and model training processes, and generate a more stable and generalized combined prediction model.

Benefits of technology

It improves the accuracy and stability of power load forecasting for large users, reduces computational costs, enables accurate forecasting of planned load fluctuations, and enhances the training and forecasting efficiency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121435194B_ABST
    Figure CN121435194B_ABST
Patent Text Reader

Abstract

This invention discloses a large-user power load forecasting method based on machine learning and deep learning, belonging to the field of power load forecasting technology. The method includes the following steps: A) Collecting relevant power load forecasting data and preprocessing the data to improve data quality and integrate multi-source data; selecting data from the most recent year as the test set and the remaining data as the training set; B) Using a random forest model to extract features from the preprocessed data; C) Training the LightGBM model and the GRU model on the training set respectively; D) Using the trained GRU and LightGBM models to predict user power load, inputting the results into a LASSO model for weighted fusion to obtain the final prediction result. This invention can overcome the shortcomings of existing technologies and improve the ability to predict planned load fluctuations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power load forecasting technology, and in particular to a method for forecasting the power load of large users based on machine learning and deep learning. Background Technology

[0002] With global economic development and increased industrial activity, electricity consumption continues to rise, especially for large industrial users whose electricity loads are not only large but also highly volatile. This poses a significant challenge to the power system, particularly in ensuring power supply stability and optimizing resource allocation. Traditional load forecasting methods, such as ARIMA, LSTM, and XGBoost models, perform well in forecasting relatively stable or regularly changing regional loads, but they fall short when faced with the high-precision load forecasting requirements of large users.

[0003] First, the ARIMA model, based on linear assumptions, is suitable for short-term load forecasting with relatively small fluctuations, but its prediction accuracy is significantly insufficient for complex and variable large-user load scenarios. Second, although the LSTM model can capture nonlinear temporal features through gating mechanisms, thereby improving its adaptability to fluctuating loads to some extent, its training process is complex and computationally expensive, making it unsuitable for real-time adjustment of prediction results. Finally, while the XGBoost model possesses powerful multi-dimensional feature learning capabilities and can improve local prediction performance through rich feature engineering, it also faces challenges in feature selection and parameter tuning, making it difficult to directly apply to large-user production plans containing numerous uncertainties.

[0004] Especially in the presence of large, specialized users such as steel mills, their production plans directly impact electricity load changes, further increasing the difficulty of load forecasting. Traditional methods, lacking effective integration with actual production plans, often fail to accurately reflect the influence of these external factors on the load, resulting in significant discrepancies between forecasts and actual conditions. Summary of the Invention

[0005] The technical problem to be solved by this invention is to provide a large-user power load forecasting method based on machine learning and deep learning, which can overcome the shortcomings of existing technologies and improve the ability to predict planned load fluctuations.

[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows.

[0007] A method for large-user electricity load forecasting based on machine learning and deep learning includes the following steps:

[0008] A. Collect relevant data on power load forecasting, and preprocess the data to improve data quality and integrate multi-source data; select the data from the most recent year as the test set, and the remaining data as the training set;

[0009] B. Use a random forest model to extract features from the preprocessed data;

[0010] C. Train the LightGBM model and the GRU model on the training set respectively;

[0011] D. Use the trained GRU and LightGBM models to predict user power load, input the results into the LASSO model for weighted fusion, and obtain the final prediction result.

[0012] Preferably, the power load forecasting data includes power load data, weather data, and production plan data.

[0013] Preferably, the preprocessing of electricity load forecasting data includes the following steps.

[0014] Calculate the first quartile Q1, the third quartile Q3, and the interquartile range IQR of the data. Determine the outlier limit as Q1-1.5×IQR×Q1-1.5×IQR to Q3+1.5×IQR×Q3+1.5×IQR, where IQR=Q3-Q1. Mark data points outside this range as outliers and set the records corresponding to these outliers to null.

[0015] The number of data points set to null values ​​every 24 hours is counted, and the data loss rate is calculated. If the data loss rate on a certain day exceeds the threshold, it is determined that the data on that day is insufficient to reflect the actual situation, and all data on that day is deleted. For days with a data loss rate not exceeding the threshold, linear interpolation is used to fill in the null values.

[0016] By using a unified time field as the primary key, the power load forecasting data is aligned and correlated along the time dimension and merged into a structured wide table. The wide table is indexed by the time column and contains the load value, weather elements, and a field indicating whether it is a holiday or not for each time point.

[0017] As a preferred approach, a random forest model is used to extract features from the preprocessed data, obtaining two types of feature vectors: the first type is the correlation feature vector based on data correlation, and the second type is the time series feature vector based on time series.

[0018] Preferably, the training process of the GRU model involves inputting the temporal feature vectors of the training set into the GRU model and calculating the loss function f of the GRU model. GRU The loss function f is calculated through backpropagation.GRU The gradient, according to the loss function f GRU The direction and magnitude of the gradient determine the direction and magnitude of parameter adjustments for the GRU model. This adjustment occurs when the number of training iterations reaches its upper limit or the current loss function f... GRU If the value is less than the set threshold, training is complete;

[0019] The LightGBM model and the GRU model are trained simultaneously. The training process of the LightGBM model is as follows: the initial output of the LightGBM model is set to the average value of the input values; the associated feature vectors are input into the LightGBM model to construct a new decision tree; and the loss function f of the LightGBM model is calculated. LightGBM According to minimizing the loss function f LightGBM The principle determines the splitting nodes of the new decision tree, and then the new decision tree is merged into the LightGBM model, and Y. t+1 =Y t +αF t , where Y t+1 Y is the output of the LightGBM model trained in the (t+1)th round. t Let F be the output of the LightGBM model trained in the t-th round, where α is the learning factor and F is the learning factor. t The new decision tree is constructed for the t-th round of training. The size of α is inversely proportional to the current loss function value of the GRU model. When the GRU model finishes training, the LightGBM model stops training synchronously.

[0020] As a preferred approach, the test set is input into the LightGBM model and the GRU model respectively to obtain the prediction results of the LightGBM model and the GRU model. If the deviation between the prediction results of the LightGBM model and the GRU model exceeds the threshold, the model whose prediction result in the previous round is closer to the output result of the LASSO model is used as the reference model. The prediction result of the reference model in this round is regarded as the true value, and the other model is trained for another round.

[0021] As a preferred method, the LASSO model performs a weighted fusion of the outputs of the LightGBM model and the GRU model, including the following steps:

[0022] Using a sliding window approach, data from m consecutive historical time steps preceding the current discrete time step index t to be predicted are collected to construct a local training set. A Lasso regression model is then fitted to this local training set. For the current time step index t, its corresponding historical time step index set is constructed: τ∈{tm,t-m+1,…,t-1}.

[0023]

[0024] ,

[0025] The outputs of the LightGBM and GRU models are input into the Lasso regression model, and the final prediction result is: ,

[0026] in, This represents the actual load value at a historical moment τ. and W corresponds to the prediction results of the pre-trained LightGBM model and GRU model at time τ, respectively. L and W G These are the weights of the LightGBM and GRU models, respectively, where λ is the penalty coefficient and L is the weight of the GRU model. t and L g This represents the final predictions of the LightGBM and GRU models at time t.

[0027] The beneficial effects of adopting the above technical solution are as follows: This invention utilizes the "same source input, different modeling" mechanism of LightGBM and GRU models, enabling them to extract complementary information based on the same data, thereby achieving collaborative capture of structural and dynamic features. Simultaneously, by optimizing data preprocessing methods, the efficiency of model training and prediction is improved while ensuring data quality. The LASSO model can automatically adjust the weights of the two model outputs, assigning higher weights to the more predictive model, suppressing redundant or error-prone prediction terms, and ultimately generating a more stable and generalized combined prediction model. Furthermore, this invention improves the training process of the LightGBM model, enhancing the specificity of the output features of both the LightGBM and GRU models, thus solving the problem of unstable feature selection in traditional Lasso regression models. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of a specific embodiment of the present invention. Detailed Implementation

[0029] In the following description of the embodiments, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of this application with unnecessary detail.

[0030] See Figure 1Before making a forecast, we first collect the power load data (power consumption, energy demand, etc.), weather data (temperature, humidity, rainfall, wind speed, air pressure, etc.) and production plan data (week, whether it is working, working hours, holidays, and the day of the holiday).

[0031] Calculate the first quartile Q1, the third quartile Q3, and the interquartile range IQR of the data. Determine the outlier limit as Q1 - 1.5 × IQR × Q1 - 1.5 × IQR to Q3 + 1.5 × IQR × Q3 + 1.5 × IQR, where IQR = Q3 - Q1. Mark data points outside this range as outliers and set the corresponding records to null.

[0032] The number of data points set as null values ​​is counted every 24 hours, and the data loss rate is calculated. If the data loss rate of a certain day exceeds the threshold, it is determined that the data for that day is insufficient to reflect the actual situation, and all data for that day is deleted. For dates where the data loss rate does not exceed the threshold, linear interpolation is used to fill in the null values.

[0033] By using a unified time field as the primary key, the power load forecasting data is aligned and correlated along the time dimension and merged into a structured wide table. The wide table is indexed by the time column and contains the load value, weather elements, and a field indicating whether it is a holiday or not for each time point.

[0034] The random forest model is used to extract features from the preprocessed data, resulting in two types of feature vectors: the first type is the correlation feature vector based on data correlation, and the second type is the time series feature vector based on time series.

[0035] We selected data from the most recent year as the test set and the remaining data as the training set to train the LightGBM and GRU models.

[0036] The training process of the GRU model involves inputting the temporal feature vectors of the training set into the GRU model and calculating the loss function f of the GRU model. GRU The loss function f is calculated through backpropagation. GRU The gradient, according to the loss function f GRU The direction and magnitude of the gradient determine the direction and magnitude of parameter adjustments for the GRU model. This adjustment occurs when the number of training iterations reaches its upper limit or the current loss function f... GRU If the value is less than the set threshold, then training is complete.

[0037] The LightGBM model and the GRU model are trained simultaneously. The training process of the LightGBM model is as follows: the initial output of the LightGBM model is set to the average value of the input values; the associated feature vectors are input into the LightGBM model to construct a new decision tree; and the loss function f of the LightGBM model is calculated. LightGBM According to minimizing the loss function f LightGBM The principle determines the splitting nodes of the new decision tree, and then the new decision tree is merged into the LightGBM model, and Y. t+1 =Y t +αF t , where Y t+1 Y is the output of the LightGBM model trained in the (t+1)th round. t Let F be the output of the LightGBM model trained in the t-th round, where α is the learning factor and F is the learning factor. t The new decision tree constructed for the t-th training round has an α value that is inversely proportional to the current loss function value of the GRU model. When the GRU model finishes training, the LightGBM model simultaneously stops training. By using the training results of the GRU model to correct the decision tree merging weights of the LightGBM model, we can leverage the GRU model's ability to capture long-sequence temporal features to improve the feature capture capability of the LightGBM model, thereby enhancing the output feature specificity of both the LightGBM and GRU models.

[0038] During the training phase, LightGBM and GRU learn from the training data separately and generate two independent load prediction models. Although the two models use the same original feature set (such as timestamps, temperature, production plan flags, historical loads, etc.), their input organization methods are fundamentally different, resulting in completely different data structures "seen" by the models. LightGBM "flattens" the time series into wide feature vectors of independent samples, losing explicit temporal order dependencies. GRU organizes the data into a "spatiotemporal sequence," preserving the continuity and evolution direction in the time dimension, as shown in Table 1. Meanwhile, both models tend to extract different types of information under the same input, as shown in Table 2.

[0039] Table 1 Model Feature Input

[0040]

[0041] Table 2 Model Information Extraction Preferences

[0042]

[0043] Current power load forecast data is input into both the LightGBM and GRU models to obtain their respective prediction results. If the deviation between the LightGBM and GRU predictions exceeds a threshold, the model whose previous prediction result is closer to the LASSO model's output is used as the reference model. The current prediction result of the reference model is then considered the true value, and the other model is trained for another round. By monitoring the outputs of both models, interference from sudden data fluctuations on the prediction results can be avoided.

[0044] Finally, a sliding window approach is used to collect data from m consecutive historical time steps preceding the current discrete time step index t to be predicted, constructing a local training set. A Lasso regression model is then fitted to this local training set. For the current time step index t, its corresponding historical time step index set is constructed: τ∈{tm,t-m+1,…,t-1}.

[0045]

[0046] ,

[0047] The outputs of the LightGBM and GRU models are input into the Lasso regression model, and the final prediction result is: ,

[0048] in, This represents the actual load value at a historical moment τ. and W corresponds to the prediction results of the pre-trained LightGBM model and GRU model at time τ, respectively. L and W G These are the weights of the LightGBM and GRU models, respectively, where λ is the penalty coefficient and L is the weight of the GRU model. t and L g Let λ represent the final predictions of the LightGBM and GRU models at time t. When λ is large, the LASSO model tends to compress the weights of the poorly performing model to zero, thus automatically filtering out unreliable prediction sources; when λ is small, it focuses more on fitting historical errors and retains the contributions of both models. By appropriately setting λ, the LASSO model can automatically adjust the weights of the two model outputs, assigning higher weights to the more predictive model, suppressing redundant or error-prone predictions, and ultimately generating a more stable and generalized combined prediction model.

[0049] LASSO is a linear regression method with L1 regularization. Its optimization objective is to minimize the sum of squared residuals while introducing parameter sparsity constraints, thereby achieving the goals of variable selection and model compression. It overcomes the problem that fixed-weight fusion (such as equal-weighted averaging) cannot adapt to differences in model performance over different time periods by using a sliding window-based LASSO regression method to dynamically calculate fusion weights.

[0050] Experimental verification

[0051] Electricity load data, weather data, and production plan data of a steel plant were collected. The prediction algorithm of this invention was used to predict different operating conditions, and the prediction results were compared with those obtained by using the LightGBM algorithm and the gru algorithm alone. The results are as follows.

[0052] Table 3 Prediction accuracy of the present invention

[0053]

[0054] Table 4 Prediction Accuracy of LightGBM Algorithm

[0055]

[0056] Table 5. Prediction accuracy of the GRU algorithm

[0057]

[0058] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0059] The present invention can implement all or part of the processes in the methods of the above embodiments, or it can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0060] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A method for predicting the power load of large users based on machine learning and deep learning, characterized in that... Includes the following steps: A. Collect relevant data on power load forecasting and preprocess the data to improve data quality and integrate multi-source data; We selected the data from the most recent year as the test set and the remaining data as the training set. B. Use a random forest model to extract features from the preprocessed data; C. Train the LightGBM model and the GRU model on the training set respectively; The training process of the GRU model involves inputting the temporal feature vectors of the training set into the GRU model and calculating the loss function f of the GRU model. GRU The loss function f is calculated through backpropagation. GRU The gradient, according to the loss function f GRU The direction and magnitude of the gradient determine the direction and magnitude of parameter adjustments for the GRU model. This adjustment occurs when the number of training iterations reaches its upper limit or the current loss function f... GRU If the value is less than the set threshold, training is complete; The LightGBM model and the GRU model are trained simultaneously. The training process of the LightGBM model is as follows: the initial output of the LightGBM model is set to the average value of the input values; the associated feature vectors are input into the LightGBM model to construct a new decision tree; and the loss function f of the LightGBM model is calculated. LightGBM According to minimizing the loss function f LightGBM The principle determines the splitting nodes of the new decision tree, and then the new decision tree is merged into the LightGBM model, i.e., Y. t+1 =Y t +αF t , where Y t+1 Y is the output of the LightGBM model trained in the (t+1)th round. t Let F be the output of the LightGBM model trained in the t-th round, where α is the learning factor and F is the learning factor. t The new decision tree constructed for the t-th round of training has an inverse relationship between the value of α and the current loss function value of the GRU model. When the GRU model finishes training, the LightGBM model stops training synchronously. D. Use the trained GRU and LightGBM models to predict user power load. The current power load forecast data is input into the LightGBM model and the GRU model respectively to obtain the prediction results of the LightGBM model and the GRU model. If the deviation between the prediction results of the LightGBM model and the GRU model exceeds the threshold, the model whose prediction result in the previous round is closer to the output result of the LASSO model is used as the reference model. The prediction result of the reference model in this round is regarded as the true value, and the other model is trained for one round. The results are input into the LASSO model for weighted fusion to obtain the final prediction result.

2. The large-user power load forecasting method based on machine learning and deep learning according to claim 1, characterized in that: The relevant data for power load forecasting includes power load data, weather data, and production plan data.

3. The large-user power load forecasting method based on machine learning and deep learning according to claim 2, characterized in that: Preprocessing of electricity load forecasting data includes the following steps: Calculate the first quartile Q1, the third quartile Q3, and the interquartile range IQR of the data. Determine the outlier limit as Q1-1.5×IQR×Q1-1.5×IQR to Q3+1.5×IQR×Q3+1.5×IQR, where IQR=Q3-Q1. Mark data points outside this range as outliers and set the records corresponding to these outliers to null. The number of data points set to null values ​​every 24 hours is counted, and the data loss rate is calculated. If the data loss rate on a certain day exceeds the threshold, it is determined that the data on that day is insufficient to reflect the actual situation, and all data on that day is deleted. For days with a data loss rate not exceeding the threshold, linear interpolation is used to fill in the null values. By using a unified time field as the primary key, the power load forecasting data is aligned and correlated along the time dimension and merged into a structured wide table. The wide table is indexed by the time column and contains the load value, weather elements, and a field indicating whether it is a holiday or not for each time point.

4. The large-user power load forecasting method based on machine learning and deep learning according to claim 3, characterized in that: The random forest model is used to extract features from the preprocessed data, resulting in two types of feature vectors: the first type is the correlation feature vector based on data correlation, and the second type is the time series feature vector based on time series.

5. The large-user power load forecasting method based on machine learning and deep learning according to claim 4, characterized in that: The LASSO model performs a weighted fusion of the outputs of the LightGBM and GRU models, including the following steps. Using a sliding window approach, data from m consecutive historical time steps preceding the current discrete time step index t to be predicted are collected to construct a local training set. A Lasso regression model is then fitted to this local training set. For the current time step index t, its corresponding historical time step index set is constructed: τ∈{tm,t-m+1,…,t-1}. , The outputs of the LightGBM and GRU models are input into the Lasso regression model, and the final prediction result is: , in, This represents the actual load value at a historical moment τ. and W corresponds to the prediction results of the pre-trained LightGBM model and GRU model at time τ, respectively. L and W G These are the weights of the LightGBM and GRU models, respectively, where λ is the penalty coefficient and L is the weight of the GRU model. t and L g This represents the final predictions of the LightGBM and GRU models at time t.

Citation Information

Patent Citations

  • Short-term load prediction method based on GRU-Light GBM model fusion and Bayesian optimization

    CN116264388A