Transform and RF fused power load prediction method
By combining the power load prediction method of Transformer and RF, using technologies such as clustering, decomposition and multimodal timing prediction converters, the problems of insufficient power load prediction accuracy and model complexity in the existing technology are solved, and more efficient and accurate power load forecast.
Patent Information
- Application Number
- CN202411579243.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-14
AI Technical Summary
The existing power load prediction methods have limited accuracy when dealing with complex and nonlinear trends, and the establishment and optimization of combination models are complex, making it difficult to adapt to data characteristics changes caused by climate change.
Using the method of fusion of Transformer and RF, the power load data is clustered and decomposed, and the adversarial network is generated by combining multimodal timing prediction transformers and conditions to generate feature sequences and train a random forest network to reduce overfitting and improve prediction accuracy.
Effectively capture the internal structure and mode of power load data, improve prediction accuracy, adapt to changes in different climate scenarios, and reduce the computational cost and time consumption of model training.
Smart Images

Figure CN119448265A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power load forecasting, and in particular relates to a power load forecasting method integrating Transformer and RF. Background Art
[0002] With the continuous progress of society, the scale of electricity consumption has shown a rapid growth trend, which in turn has led to an exponential increase in energy demand. In this context, it is particularly urgent to improve energy utilization efficiency and reduce power energy loss. Among them, improving the accuracy of power load forecasting has become a crucial link. Traditional load forecasting technologies, such as trend extrapolation, are simple in theory and easy to operate, but they are obviously insufficient in accuracy. At present, the methods of power load forecasting have formed three main categories: classical models, modern intelligent methods, and combined models. These methods have their own characteristics and adapt to the forecasting needs in different scenarios, providing strong technical support for the sustainable development of the power industry. The classical model method is mature in theory and easy to operate, but it has limitations in dealing with complex and nonlinear trends, and the forecasting accuracy is subject to certain restrictions; modern intelligent methods can process a large amount of nonlinear data, but these methods require a lot of computing resources and time for model training and tuning, and the implementation is relatively complex; the combined model combines different models and uses the advantages of a single model to reduce errors, but the establishment and optimization of the combined model is a complex process.
[0003] In view of the complexity of establishing and optimizing the combined model in load forecasting, the influence of complex environmental factors on power load forecasting is reduced. Because when the climate scene changes, the statistical characteristics of the collected data change accordingly, and the combined model method used in the original scene will reduce the prediction accuracy for the new scene. Therefore, clustering and decomposing the power load data, and analyzing and predicting the load data of different clusters can effectively improve the prediction accuracy.
[0004] In current ensemble learning, the stacking method is a popular method. It combines the prediction results of different base learners by using the outputs of multiple base learners (such as random forests, support vector machines, etc.) as the input of another meta-learner (Meta-Learner), thereby improving the overall prediction performance. However, Stacking requires training multiple base learners and at least one meta-learner, which increases the computational cost and time consumption of the model. Secondly, if the base learner itself has an overfitting problem, or the meta-learner fails to correctly combine the prediction results of the base learner, then the entire Stacking model is prone to overfitting, resulting in a decrease in performance on the test set, affecting the accuracy of the power load forecasting results. Summary of the invention
[0005] In order to solve the above technical problems, the present invention proposes a power load forecasting method integrating Transformer and RF. The method comprises:
[0006] Obtain the short-term power load data to be predicted in the target area, input it into the trained random forest network after clustering and decomposition, and output the power load prediction result;
[0007] The training process of the random forest network includes:
[0008] Collect historical power load data and corresponding historical weather data of a specific area, and obtain a first training data set and a second training data set with labels after preprocessing;
[0009] Based on the time series characteristics of the historical power load data and the corresponding historical weather data, the first labeled training data set and the second labeled training data are clustered and decomposed respectively;
[0010] Inputting the clustered and decomposed power load data into a multi-modal time series prediction converter to obtain a feature sequence;
[0011] The feature sequence is input into the random forest network for regression prediction, the regression loss is calculated, and the random forest network is iteratively optimized through the regression loss.
[0012] Furthermore, the K-Shape algorithm is used to cluster the power load data to obtain the power load data of different clusters after clustering.
[0013] Furthermore, the STL algorithm is used to decompose the overall trend of power load data in different clusters after clustering into trend component, seasonal cycle component and residual component.
[0014] Furthermore, during the training process of the random forest network, the labeled first training data set is clustered and decomposed and then input into the pre-trained conditional generative adversarial network, and the conditional information is combined to generate synthetic data, which is then input into the multimodal time series prediction transformer.
[0015] Furthermore, the training process of the random forest network includes: inputting the feature sequences of the synthetic data into pre-trained diversified basis regressors respectively, and obtaining different regression prediction results after regression processing; and inputting the regression prediction results into the random forest network for regression prediction.
[0016] Furthermore, the first labeled training data set is a training data set formed after preprocessing the historical power load data and its corresponding historical weather data in the Boston area, and the second labeled training data set is a training data set formed after preprocessing the historical power load data and its corresponding historical weather data in the New Zealand area.
[0017] Beneficial effects of the present invention:
[0018] First, based on the time series characteristics of power load data, the present invention uses K-shape to cluster the power load data, and after clustering, uses the STL algorithm to decompose the overall trend of the power load data over time into trend components, seasonal cycle components and residual components to obtain processed data. The STL algorithm is combined with the K-Shape algorithm to effectively cluster and decompose the power load data. This method is particularly suitable for processing power load data with obvious seasonality and trend, which can better capture the inherent structure and pattern of the power load data.
[0019] Secondly, in the training process of the random forest network, the present invention collects the historical power load data and the corresponding historical weather data of the Boston area and the New Zealand area respectively, and obtains the first training data set and the second training data set with labels after preprocessing. After clustering and decomposition, they are input into the multimodal time series prediction transformer M2PT. The M2PT model can identify the difference in seasonal characteristics of the two places and generate new feature representations. These feature representations not only contain the unique seasonality of each region, but also integrate the commonality and differences across regions, thereby enriching the expression ability of the model. Using these feature representations to train the random forest network RF can improve the performance of the random forest network and significantly improve the accuracy of the power load forecasting results.
[0020] Finally, the present invention utilizes the stacking structure in ensemble learning to perform regression prediction on the feature sequence of synthetic data through multiple base regressors, and then inputs the regression prediction results into the random forest network for training, iteratively optimizes the random forest network, effectively prevents overfitting during network training, and further improves the training performance of the random forest network. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of the overall process of the present invention;
[0022] Figure 2 Schematic diagram of the training steps of a random forest network in an embodiment of the present invention;
[0023] Figure 3 Schematic diagram of the process of K-shape algorithm clustering in an embodiment of the present invention;
[0024] Figure 4 A schematic diagram of the process of K-shape algorithm clustering and STL algorithm decomposition in an embodiment of the present invention;
[0025] Figure 5 This is a schematic diagram of the STL algorithm processing flow in an embodiment of the present invention;
[0026] Figure 6 A schematic diagram of the network structure of a multi-modal timing prediction converter in an embodiment of the present invention
[0027] Figure 7 Schematic diagram of the existing CGAN network structure;
[0028] Figure 8 The overall flow chart of the preferred embodiment of the present invention;
[0029] Fig. 9 Schematic diagram of the prediction training process of the random forest network in an embodiment of the present invention;
[0030] Fig.10 Schematic diagram of simulation results of comparative tests of different power load forecasting networks;
[0031] Fig.11 Schematic diagram of K-Shape_STL algorithm simulation results in an embodiment of the present invention;
[0032] Fig.12 Schematic diagram of MAPE index of simulation results of K-Shape_STL algorithm and other algorithms in the embodiment of the present invention;
[0033] Fig.13 R comparison of simulation results of K-Shape_STL algorithm and other algorithms in the embodiment of the present invention 2 Schematic diagram of the indicator. DETAILED DESCRIPTION
[0034] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances. This is just a way of distinguishing objects with the same attributes when describing the embodiments of this application.
[0035] 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.
[0036] Terminology explanation:
[0037] AIGC (Artificial Intelligence Generated Content): Artificial Intelligence Generated Content;
[0038] M2PT (Multi-Modal Multi-site Probabilistic Transfer): Multi-modal timing prediction transformer;
[0039] STL (Seasonal and Trend decomposition using LOESS): Seasonal and trend decomposition algorithm using local weighted scatter plot smoothing method, referred to as seasonal trend decomposition algorithm based on time series;
[0040] LOESS (Locally Estimated Scatterplot Smoothing): Locally weighted regression scatter plot smoothing method;
[0041] K-Means (K-Means Clustering): K-means clustering algorithm;
[0042] K-Shape (K-Shape: Efficient and Accurate Clustering of Time Series): time series clustering algorithm;
[0043] K-Shape_STL: Clustering and seasonal trend decomposition algorithm based on time series;
[0044] RF (Random Forests): Random Forests;
[0045] Stacking (Stacked Generalization): Stacked generalization;
[0046] SVM (Support Vector Machine) support vector machine;
[0047] XG Boost (Extreme Gradient Boosting): Extreme gradient boosting;
[0048] Light GBM (Light Gradient Boosting Machine): Lightweight gradient boosting machine;
[0049] KNN (k-Nearest Neighbor Classification): K nearest neighbor classification;
[0050] CGAN (Conditional Generative Adversarial Network): Conditional Generative Adversarial Network;
[0051] EMD (Empirical Mode Decomposition): Empirical Mode Decomposition;
[0052] GBDT (Gradient Boosting Decision Tree): Gradient boosting decision tree.
[0053] The embodiment of the present invention proposes a power load forecasting method integrating Transformer and RF, referring to Figure 1 , 2 As shown, the method includes:
[0054] Obtain the short-term power load data to be predicted in the target area, input it into the trained random forest network after clustering and decomposition, and output the power load prediction result;
[0055] The training process of the random forest network includes:
[0056] S1: Collect historical power load data and corresponding historical weather data of a specific area, and obtain a first training data set and a second training data set with labels after preprocessing;
[0057] S2: clustering and decomposing the first training data set and the second training data with labels respectively based on the time series characteristics of the historical power load data and the corresponding historical weather data;
[0058] S3: respectively inputting the clustered and decomposed power load data into a multi-modal time series prediction converter to obtain a feature sequence;
[0059] S4: Input the feature sequence into the random forest network for regression prediction, calculate the regression loss, and iteratively optimize the random forest network through the regression loss.
[0060] Figure 1 It is a schematic diagram of the overall process of the present invention. Figure 1 The present invention is divided into a training phase and a prediction phase. In the training phase, a first training data set and a second training data set with labels are respectively used, and after being subjected to K-Shape algorithm clustering processing and STL algorithm decomposition processing, they are input into a multimodal time series prediction transformer to obtain a feature sequence; the feature sequence is input into a random forest network for network training, and the random forest network is iteratively optimized. In the prediction phase, the short-term power load data to be predicted is obtained, and after being subjected to K-Shape algorithm clustering processing and STL algorithm decomposition processing, it is input into a trained random forest network to output a power load prediction result.
[0061] Figure 2 Schematic diagram of the training steps of the random forest network in an embodiment of the present invention.
[0062] It has been found through research that the weather conditions in a region will have a significant impact on the electricity consumption (i.e., power load) of users in the region. The embodiment of the present invention fully considers the influencing factors of weather conditions when conducting network training. In the embodiment of the present invention, the power load historical data and historical weather data of a specific region are selected during network training. The selection of the specific region is based on the geographical environment and weather conditions of the target region. For different target regions, during the network training stage, you can select a specific region with a similar geographical environment and weather conditions, or just the power load data and historical weather data of the target region.
[0063] In some preferred embodiments, the first training data set is a training data set formed by preprocessing the historical power load data and the corresponding historical weather data in the Boston area, and the second training data set is a training data set formed by preprocessing the historical power load data and the corresponding historical weather data in the New Zealand area.
[0064] The training data sets (including the first and second training data sets) in the embodiments of the present invention are all derived from open source data platforms, such as the UCI machine learning database and the Kaggle data competition platform. Specifically, the household electricity consumption data set in the Boston area provided by the platform (affected by the unique region, low electricity consumption in summer and high electricity consumption in other seasons), the weather data used is also from the area, including 13 parameters such as temperature, humidity, visibility, weather, perceived temperature, pressure, wind speed, cloud layer, and dew point. The embodiment of the present invention first calculates the person correlation coefficient between the power load data and each weather variable, and preliminarily understands that there is a strong linear relationship between those weather data and the power load; then the built-in feature_importances in the random forest model is used to obtain the importance score of each weather variable for load prediction; finally, based on the above information, the 8-dimensional weather data and the power load data are extracted as the first labeled training data set, and the 8-dimensional weather parameters are temperature, perceived temperature, humidity, pressure, dew point, icon, wind speed and wind direction. Using the same method, the household electricity data set and its historical weather data in the New Zealand area are obtained from the open source data platform, and the second labeled training data set can be obtained after preprocessing. Boston is located in the Northern Hemisphere, where seasonal changes are typically characterized by cold winters and warm summers, while New Zealand, located in the Southern Hemisphere, has opposite seasons and, due to its maritime climate, has relatively mild seasonal changes and higher humidity. This difference in geographic latitude leads to essential differences in the seasonality of electricity consumption patterns in the two places.
[0065] Since power load data is obtained through physical devices such as electric meters, missing values and omissions are inevitable in this process. Therefore, in order to reduce the impact of missing values on subsequent data predictions and ensure minimal distortion of data information, it is necessary to fill in the missing values in the collected power load data.
[0066] In the process of collecting smart meter performance data, we often encounter problems such as significant order of magnitude differences in the original data samples, inconsistent data value ranges, and fuzzy data trends. These problems may introduce unnecessary biases in the model training process, thereby affecting the accuracy of the model and the training efficiency of the network. In order to effectively solve these problems, improve the prediction ability of the model and accelerate the convergence speed of the network, it is necessary to adjust all data to the same order of magnitude through normalization methods to ensure comparability between data.
[0067] In some preferred embodiments, the preprocessing process includes: deleting outliers in the power load data; using a linear interpolation algorithm to fill in missing values in the power load data; and normalizing the power load data using a maximum and minimum method.
[0068] The formula of the linear interpolation algorithm is as follows:
[0069]
[0070] Where Y represents the power load value to be estimated at time X, Y2 and Y1 represent known power load data points, corresponding to time X2 and X1 respectively. It represents the rate of change from Y1 to Y2, (X-X1) represents the time difference from X1 to X, which is the time distance from the known point X1 to the estimated time point X.
[0071] The normalization preprocessing method used in the embodiment of this patent is a linear maximum and minimum method (Min-Max), and the Min-Max formula is as follows:
[0072]
[0073] In the formula, x * represents the normalized value, x represents the value before normalization, and x min represents the minimum value of the sample, x max Represents the maximum value of the sample. After preprocessing the household electricity consumption dataset and the local weather dataset in the Boston area collected from the platform, the first and second training datasets selected by the embodiment of the present invention are obtained. The datasets are labeled, and the labels are generated based on the clustering results of household electricity consumption behaviors. For example, the label "0" represents an ordinary normal user; the label with other specific values represents a user with relatively prominent household electricity consumption in the area.
[0074] The traditional K-means clustering algorithm is simple and has a fast clustering speed, but the selection of the initial K value will have a great impact on the final result. The iterative calculation method is easy to form a local optimal solution. The K-means clustering algorithm does not fit curve data well, and power load data is a typical time series data. Therefore, the K-means clustering algorithm is not ideal for clustering power load data. Compared with the K-means method, the K-shape clustering algorithm takes into account the scale invariance and translation invariance of the time series, so it can better process time series data with different amplitudes and phase differences. Therefore, the embodiment of the present invention uses a clustering algorithm specifically designed for time series data, namely the K-shape clustering algorithm.
[0075] Figure 3 The figure is a schematic diagram of the process of K-shape algorithm clustering in an embodiment of the present invention. Figure 3 In the process of K-shape clustering algorithm, the process includes: inputting power load data, selecting the number of clusters, i.e., the initial K value (initial centroid); calculating the normalized correlation coefficient NCC between the power load data; calculating the centroid of each class (cluster) according to the normalized correlation coefficient NCC; after iterative optimization, obtaining the clustering result of K-shape clustering (i.e., the power load data of different clusters after clustering). The input power load data here can come from the first training data set, the second training data set, or the power load data to be tested. Different input power load data will result in different clustering results.
[0076] In some preferred embodiments, in step S2, the power load data is clustered using a time series clustering algorithm, namely a K-shape clustering algorithm, to obtain power load data of different clusters after clustering. Figure 3 As shown, the clustering process includes:
[0077] S201: Based on the power load data of the input power load data set, the silhouette coefficient is used to calculate the K value, which is used as the initial centroid of the cluster.
[0078] Currently, the commonly used methods for selecting the K value are the direct method, elbow rule, interval statistics, silhouette coefficient, and Canopy. This patent embodiment uses the silhouette coefficient to calculate the K value, which can not only quantify the degree of dispersion of data points within the cluster to which they belong, but also evaluate the degree of difference between them and different clusters. The value of the silhouette coefficient is between -1 and 1, and the larger the value, the better the clustering effect.
[0079] Evaluate the clustering characteristics of a power load data point i. The specific process is:
[0080] First, the distance between the power load data point i and other data points in the same cluster is calculated, and then the average distance D(i) is obtained, which represents the dispersion degree of data point i in the cluster.
[0081] Next, in order to measure the difference between the power load data point i and different clusters, the minimum distance between the power load data point i and all other cluster samples is calculated, that is, d(i, j), where d(i, j) represents the degree of dissimilarity between the power load data point i and other clusters; the silhouette coefficient calculation formula is:
[0082]
[0083] Where s(i) represents the calculated cluster silhouette coefficient, D(i) represents the intra-cluster dissimilarity between power load data points in the same cluster, and d(i) represents the minimum value of the dissimilarity between sample data i and all other samples.
[0084] Calculate any two short-term power load data sequences x=(x1,x2,…,x m ) and y=(y1,y2,…,y m ), the calculation formula is as follows:
[0085]
[0086] In the formula, C ω (x,y) represents the similarity between any two short-term power load data sequences x and y, ω represents the cross-correlated short-term power load data sequence of length 2m-1, ω∈{1,2,…,2m-1}, m represents the length of the time series; Cov(x,y) represents the covariance between any two short-term power load data sequences x and y; Var[x] represents the variance of the short-term power load data sequence x, and Var[y] represents the variance of the short-term power load data sequence y.
[0087] The similarity between vectors x and y can be further expressed as:
[0088]
[0089] In the formula, R T (x,y) represents the similarity between the two vectors x and y, T represents the correlation length of the two sequences, T = ω-m,x i Represents a value of a short-term power load data series, y i Represents a value of another short-term power load data series, R -(T) (y,x) represents the similarity of y relative to x with a delay of -T.
[0090] Use the normalization method to convert x in each sequence i Convert to Among them, μ is the mean of the sequence and σ is the standard deviation.
[0091] S202: Calculate the correlation coefficient (NCC) between power load data.
[0092] The calculation formula of the cross correlation coefficient (NCC) is specifically:
[0093]
[0094] Where NCC(x,y) represents the mutual correlation coefficient between vectors x and y, R0(x,x) represents the autocorrelation of vector x, and R0(y,y) represents the autocorrelation of vector y.
[0095] S203: Calculating shape-based distances between power load data in the input power load data set using a maximized cross-correlation coefficient (NCC);
[0096] S204: according to the calculated distance, each power load data is assigned to the cluster where the centroid with the smallest distance to it is located;
[0097] S205: Iteratively calculate the centroid of the cluster until the centroid no longer changes or reaches a preset number of iterations.
[0098] Figure 4 The figure is a flow chart of K-shape algorithm clustering and STL algorithm decomposition in an embodiment of the present invention. Figure 4 In the example, the power load data of the power load data set is input, and the clustering process of the K-shape clustering algorithm for the input data includes: obtaining the K value according to the silhouette coefficient, calculating the mutual correlation coefficient (NCC) between the power load data; calculating the centroid according to the mutual correlation coefficient; iterative optimization, continuous clustering, and obtaining the power load data of different clusters. The process of decomposing the power load data of different clusters using the STL algorithm includes: initializing trend parameters, subsequence smoothing, low-pass filtering, calculating seasonal trends, smoothing again, and decomposing the overall trend of the power load data of different clusters over time into seasonal terms, trend terms, and residual terms. The input power load data here can come from the first labeled training data set, the second labeled training data set, or the power load data to be detected. Different input power load data will result in different data processing results.
[0099] When clustering based on the time series clustering algorithm, namely the K-shape algorithm, is performed according to the time series characteristics of the power load data (i.e., the power load data is presented as a time series curve), the influence of complex environmental factors on the power load prediction effect needs to be considered. The embodiment of the present invention continues to use the time series seasonal trend decomposition algorithm (i.e., the STL algorithm) based on K-shape to divide the load data of different clusters into seasonal items, trend items, and incomplete items.
[0100] The STL (Seasonal-Trend decomposition using LOESS) algorithm is a powerful tool for time series data decomposition. It combines the Locally Estimated Scatterplot Smoothing (LOESS) method for data smoothing. The STL algorithm aims to decompose time series data into three main components: trend, seasonal, and residual (usually including cyclic trends and irregular trends).
[0101] Figure 5 Schematic diagram of the STL algorithm processing flow in an embodiment of the present invention.
[0102] In some preferred embodiments, in step S2, the STL algorithm is used to decompose the overall trend of the power load data of different clusters after clustering over time into a trend component, a seasonal cycle component and a residual component, and the specific calculation formula is:
[0103] Y[v]=T[v]+S[v]+L[v] (7)
[0104] Where Y[v] represents the overall trend of power load data over time, T[v] represents the trend component, S[v] represents the seasonal cycle component, L[v] represents the residual component, and v represents the time index.
[0105] Reference Figure 5 As shown in the figure, the specific process of using the STL algorithm to decompose the overall trend of power load data of different clusters after clustering over time is as follows:
[0106] S301 Initialization: Divide the power load data of different clusters after clustering into periodic subsequences, initialize the trend component of the periodic subsequence, that is, T[v]=0, initialize the number of iterations k=0, and initialize the trend component T[v] of the kth iteration periodic subsequence k =0.
[0107] Specifically, in the power load data of different clusters after clustering, the power load data at the same position in each period are grouped into a subsequence, and there are n(p) subsequences in total, which are called periodic subsequences.
[0108] S302 Preliminary removal of trend components: subtract the trend component of the previous round of calculation results from the overall trend of the periodic subsequence changing over time to obtain a periodic subsequence with trend components removed, i.e., Y[v]-T[v] k Step S302 is used to reduce the impact of the trend on the seasonality estimate.
[0109] S303 uses the LOESS algorithm to smooth the periodic subsequences: Use the LOESS algorithm to smooth each periodic subsequence without trend items; in this process, the LOESS algorithm fits a local linear regression model at each time point and weights the data points according to the distance between them, thereby obtaining a smooth seasonal curve; and for the multiple periodic subsequences into which the second training sample data is divided according to seasonality, the multiple periodic subsequences are extended backward and forward by one cycle each, obtaining a smoothing result and recording it as C[v] k+1 ; For the smoothed result C[v] k+1 Perform 3 sliding averages to get the result after 3 sliding averages.
[0110] S304 low pass filter for periodic subsequence: use LOESS algorithm to regress the result after 3 sliding averages to obtain the residual component L[v] of the periodic subsequence k+1 , the residual component is the low-pass residual component;
[0111] S305 calculates the seasonal trend term: smoothing the result C[v] k+1 Remove the residual component L[v] k+1 Get the seasonal periodic component S[v] of the periodic subsequence k+1 , that is, S[v] k+1 =C[v] k+1 -L[v] k+1 ;
[0112] S306: Remove the seasonal periodic component S[v] from the overall trend of the power load data in different clusters after clustering. k+1 , smoothed again, we get the trend component T[v] k+1 ;
[0113] S307: Iterate the calculation (i.e. repeat the above steps S301-S306) until the trend component S[v] k+1 When converged, the final trend component T[v], seasonal cycle component S[v] and residual component L[v] are obtained, that is, the power load data after clustering and decomposition are obtained.
[0114] It should be noted that in the training stage and prediction stage of the random forest network, the first labeled training data set, the second labeled training data set and the short-term power load data to be predicted are used respectively. When clustering and decomposing, the K-Shape algorithm and the STL algorithm are used to cluster and classify the power load data respectively to obtain different clustered and decomposed power load data. The decomposed power load data respectively include the trend component, seasonal cycle component and residual component of the power load data changing over time.
[0115] The embodiment of the present invention adopts a method combining the K-shape clustering algorithm and the STL decomposition algorithm, which shows significant advantages in the detailed analysis and processing of power load data and effectively reduces the interference caused by different weather conditions and random fluctuation data.
[0116] In some preferred embodiments, the labeled first training data set and the second training data are clustered and decomposed and then input into the multimodal time series prediction transformer M2PT, and a fused embedding is obtained through multimodal embedding and weighted fusion, and the fused embedding is decoded to obtain a feature sequence.
[0117] Figure 6 Schematic diagram of the network structure of the multimodal timing prediction transformer in an embodiment of the present invention. Figure 6 In the paper, the multimodal time series prediction transformer M2PT integrates the advanced sequence analysis capabilities of the Transformer architecture with a sophisticated multimodal data integration mechanism. M2PT includes core modules including input encoding layer, multimodal spatiotemporal Transformer block, and decoding layer. The main function of the input encoding layer is to convert the raw input data of different modalities into a format that the model can handle. The multimodal spatiotemporal Transformer block is the core module of M2PT, responsible for processing data from different modalities and different time points. This module adopts the Transformer structure and captures the spatiotemporal dependencies in the data through self-attention mechanism and feedforward neural network. The main function of the decoding layer is to convert the feature representation output by the multimodal spatiotemporal Transformer block into the final prediction result.
[0118] In the context of power load forecasting, the labeled first training dataset (Boston area) and the labeled second training dataset (New Zealand area) are clustered and decomposed as the input data of M2PT. Boston is located in the northern hemisphere, and its seasonal changes are typically characterized by cold winters and warm summers, while New Zealand is located in the southern hemisphere, with opposite seasons to the northern hemisphere, and due to its maritime climate, the seasonal changes are relatively mild and the humidity is high. This difference in geographical latitude leads to essential differences in the seasonality of electricity consumption patterns in the two places. This allows the M2PT model to combine climate data such as temperature, humidity, and sunshine duration in addition to basic load data. These data are significantly different between the two places, providing additional seasonal context information for the M2PT model. The M2PT model is able to identify the differences in seasonal characteristics between the two places and generate new feature representations (i.e., feature sequences). These feature representations not only contain the unique seasonality of each region, but also integrate the commonality and differences across regions, thereby enriching the model's expressive power.
[0119] The power data in the present invention has unique characteristics, such as high seasonality, periodicity, and strong correlation with external factors such as weather and holidays. Therefore, the improvement of M2PT in the embodiment of the present invention is mainly focused on enhancing the model's sensitivity and processing capabilities to these characteristics. Taking into account the seasonality of power load, a more periodic position code is designed, which combines the periodic signal generated by Fourier transform as part of the position code to better capture seasonal changes. In order to combine geographic location and seasonal information, an enhanced multimodal fusion layer (including a multimodal spatiotemporal Transformer block) is used.
[0120] Introducing geolocation and seasonal encoding to account for differences in latitude and longitude, and the fact that the seasons are opposite in the northern and southern hemispheres. S = f season (lat,long,season), where f season It represents encoding geographic location and seasonal information. S captures the impact of geographic location (latitude, longitude) and seasonal changes on power load. lat represents longitude, long represents latitude, and season represents seasonal label.
[0121] In the enhanced multimodal fusion layer (including the multimodal spatiotemporal Transformer block), the multimodal embeddings are weighted fused by combining the geographic location and seasonality information to obtain the fused embedding (i.e., feature sequence).
[0122] E fused =αE boston +βE nz +γS
[0123] Among them, E fusedrepresents the fusion embedding obtained after the enhanced multimodal fusion layer processing, α, β, γ represent different weight coefficients, E boston represents the power load data of the first labeled training data set (i.e., the power load data of the Boston area and its corresponding historical weather data) after clustering and decomposition, E nz represents the power load data of the second labeled training data set (i.e., the power load data of New Zealand and its corresponding historical weather data) after clustering and decomposition, and S represents the position code. fused It is the input data for the subsequent pre-trained diversified base regressor or random forest network.
[0124] In order to enhance the first training data set, the embodiment of the present invention introduces a conditional generative adversarial network (CGAN), combines conditional information, and generates synthetic data; the synthetic data is input into a multimodal time series prediction transformer, and the intrinsic dependency and contextual information of the synthetic data are extracted to obtain the feature sequence of the synthetic data. The conditional generative adversarial (CGAN) network introduced in the embodiment of the present invention introduces a layer of autoencoder into the original GAN network structure. It allows the generative network to consider additional conditional information when generating data, thereby generating power load data that is more in line with the actual situation.
[0125] In some preferred embodiments, the labeled first training data set is clustered and decomposed and then input into a pre-trained conditional generative adversarial network, and the conditional information is combined to generate synthetic data, which is then input into a multimodal time series prediction transformer.
[0126] Figure 7 Schematic diagram of the CGAN network structure in an embodiment of the present invention. Figure 7 In the above figure, D represents the discriminator, G represents the generator, Z represents random noise, C represents conditional information, G(Z,C) represents that the generator G takes random noise Z and conditional information C as input, X represents real data, and D(X,C) represents that the discriminator takes real data and conditional information as input. Considering that the multivariate autoencoder will compress and transform the input data to a certain extent during the encoding process, this helps to enhance the robustness of the cGAN generator to changes in input conditions, making the generated synthetic data more stable and reliable. Therefore, the output input of the generator is encoded based on the multivariate autoencoder, and the multivariate autoencoder is used to output the synthetic data.
[0127] In CGAN, both the generator and the discriminator accept conditional information as input and generate or judge data accordingly. For power load data, conditional information can include timestamps, weather conditions, etc. By introducing conditional information, CGAN can generate synthetic data that is more in line with the actual power load change law, thereby improving the accuracy of power load prediction and analysis.
[0128] In some preferred embodiments, the pre-training process of the conditional generative adversarial network includes:
[0129] Based on the time series characteristics of the power load historical data and its corresponding historical weather data, clustering and decomposing the first labeled training data set respectively to obtain first processed data, which includes a trend component, a seasonal cycle component and a residual component of the power load data changing over time;
[0130] Input the first processed data into a discriminator of a conditional generative adversarial network, combine the condition information, the discriminator outputs a discrimination result, and calculates the discrimination loss between the first processed data and the discrimination result;
[0131] The discriminant result output by the discriminator is input into the generator. Combined with the conditional information, the generator outputs synthetic data, and the generation loss between the discriminant result and the synthetic data is calculated; the synthetic data output by the generator is input into the autoencoder for feature reconstruction, and the reconstructed data is output, and the reconstruction loss between the reconstructed data and the synthetic data is calculated;
[0132] The discrimination loss, generation loss and reconstruction loss constitute the overall loss, and the adversarial network is generated according to the iterative optimization conditions of the overall loss.
[0133] More specifically, the conditional generative adversarial network training process specifically includes:
[0134] S401: Collect historical power load data and corresponding historical weather data of a specific area (specifically, the Boston area), and obtain a first labeled training data set after preprocessing.
[0135] The specific method of this step is the same as that of S1 above, and will not be repeated here.
[0136] S402: Based on the time series characteristics of the power load historical data and its corresponding historical weather data, the labeled first training data are clustered and decomposed to obtain the clustered and decomposed power load data, which includes the trend component, seasonal cycle component and residual component of the power load data changing over time.
[0137] The specific method of this step is the same as that of S2 above, and will not be repeated here.
[0138] S403: The first processed data is input into the discriminator of the conditional generation adversarial network. Combined with the conditional information, the discriminator outputs a discrimination result (the discrimination result is a probability value between 0 and 1), and the discrimination loss between the first processed data and the discrimination result output by the discriminator is calculated.
[0139] S404: The discrimination result output by the discriminator is input into the generator, and combined with the condition information, the condition information in the embodiment of the present invention is the historical power load data of the target area in the same period, the generator outputs synthetic data (i.e., simulated power load data), and the generation loss between the synthetic data and the generator input data (i.e., the discrimination result output by the discriminator) is calculated.
[0140] S405: Input the synthetic data output by the generator into the autoencoder for encoding (also feature reconstruction), output the reconstructed data, and calculate the reconstruction loss between the reconstructed data and the synthetic data. The reconstructed data is specifically the result (reconstructed version) of the synthetic data being encoded in a low-dimensional space and then decoded back to the original synthetic data space.
[0141] S406: Iteratively optimizing the conditions to generate an adversarial network according to the discrimination loss, the generation loss, and the reconstruction loss until the discriminator cannot distinguish between true and false.
[0142] In the embodiment of the present invention, the synthetic data generated by cGAN is arranged in time series order to construct an input sequence suitable for M2PT network processing. Each input sequence contains a certain length of historical electricity consumption data, which is intended to enable the model to learn the changing trend and periodicity of electricity consumption.
[0143] In some preferred embodiments, the overall loss L of the conditional generative adversarial network CGAN is total The function is as follows:
[0144] L total =αL cGAN +βL rec (9)
[0145]
[0146] Among them, L cGAN represents the loss function of the conditional generative adversarial network itself, L rec represents the reconstruction loss of the autoencoder, α and β represent different hyperparameters, α represents the first hyperparameter, β represents the second hyperparameter, represents the discriminant loss of the discriminator in the conditional generation adversarial network, x represents the input data of the discriminator, and p data represents the distribution of the discriminator input data, that is, the probability distribution obeyed by x, D(x|c) represents the output of the discriminator for the input data x under given conditions in the conditional generative adversarial network, c represents the conditional information, z represents the random noise vector, p z represents the distribution of the random noise vector z, that is, the probability distribution that z obeys, represents the average logarithmic loss of the generator generating fake data under the discriminator, D(G(z|c)|c) represents the output of the discriminator for the generator generating fake data under the given condition c, and G(z|c) represents the output of the generator under the given condition c and the random noise vector z.
[0147] In order to prevent overfitting of the random forest network during training and further improve the training performance of the random forest network, an integrated learning framework is adopted during the training of the random forest network.
[0148] Figure 8 This is an overall flow chart of a preferred embodiment of the present invention. Figure 8 As shown, the preferred embodiment of the present invention proposes a three-layer stacking integrated learning model, wherein the first layer structure is an AIGC module, which includes a CGAN network and an M2PT network. The CGAN network is used to generate synthetic data that is more in line with the actual situation based on the labeled first training data set, and the M2PT network obtains feature representation (i.e., intrinsic dependency and context information) based on the power load data after K-Shape clustering and STL decomposition of the labeled first training data set and the second training data set; the core of the second layer structure is a diversified base learner network (referred to as the base model), and the embodiment of the present invention adopts a diversified base regressor as the base learning network, and the diversified base regressor includes a trained SVM regressor, an XGBoost regressor, a Light GBM regressor, and a KNN regressor. These learners are designed to achieve complementarity, ensuring that they have good generalization capabilities and can show significant differences in power prediction performance; the third layer structure integrates and optimizes the prediction results of each base regressor by introducing a meta-learner, namely a random forest network RF (referred to as a meta-model), and the training data set of the random forest network RF is derived from the prediction output results of each base regressor in the second layer structure, and the output result of the random forest network RF is the prediction result of the power load data.
[0149] In some preferred embodiments, reference Figure 8 As shown, the training process of the random forest network also includes: inputting the feature sequences into the pre-trained diversified base regressors respectively, and obtaining different regression prediction results after regression processing; inputting the regression prediction results into the random forest network for regression prediction, and the diversified base regressors include SVM regressor, XGBoost regressor, Light GBM regressor and KNN regressor.
[0150] Specifically, before training the base learner, the feature sequence output by the multimodal time series prediction transformer is divided into five non-overlapping subsets using the 5-fold cross-validation technique. The non-overlapping subsets are used to input the pre-trained SVM regressor, pre-trained XGBoost regressor, pre-trained Light GBM regressor, and pre-trained KNN regressor for regression prediction, and the regression prediction results are input into the random forest network for regression prediction. In this way, the data relied on by the meta-learner (random forest network) actually comes from the prediction results of the base learner on the validation set, thereby ensuring the objectivity and validity of the data.
[0151] Fig. 9 Schematic diagram of the prediction training process of the random forest network in an embodiment of the present invention. Fig. 9 In the example, the training set is the prediction result of each base regressor, which includes n training data, which are input into n decision trees respectively, and the output results of n decision trees are averaged to obtain the final prediction result. Random forest is constructed by multiple decision trees. As a supervised classification learning algorithm, the core components of decision tree (Decision Tree, DT) include root node, internal node, leaf node and branch path. The algorithm follows the principle of divide-and-conquer. Through continuous testing of internal nodes, the training data set is recursively divided to maximize the purity of data in each subset. In the initial stage of the training process, all data sets are gathered at the root node of the decision tree. As the decision tree continues to grow and split, the sample data is recursively assigned to each internal node. This process continues until all the sample data contained in each node belong to the same category, at which time the iterative process reaches the termination condition.
[0152] Simulation verification:
[0153] Simulation platform: mainly tslearn0.5.1, tensorflow2.7.0.
[0154] Simulation results:
[0155] Fig.10 Schematic diagram of simulation results of comparative tests of different power load forecasting networks. Fig.10In the figure, the horizontal axis (day) is the date, and the vertical axis is the power load (i.e., power consumption); the actual value refers to the real training sample data in the training sample data set; kshape_stl_svm means that the training sample data is clustered and decomposed based on the time series using the K-Shape algorithm and the STL algorithm, and the processed data is obtained, and the svm (SVM, support vector machine) is trained with the data, and the simulation curve output by the svm is obtained; kshape_stl_lgb_predict means that the training sample data is clustered and decomposed based on the time series using the K-Shape algorithm and the STL algorithm, and the processed data is trained with the data lgb (Light GBM, lightweight gradient boosting machine) network, lgb network prediction output simulation curve; kshape_stl_rf means that the training sample data is clustered and decomposed based on time series by using K-Shape algorithm and STL algorithm respectively, and the processed data is obtained, and the random forest network RF is trained with the data, and the simulation curve of RF network output; kshape_stl_gbdt means that the training sample data is clustered and decomposed based on time series by using K-Shape algorithm and STL algorithm respectively, and the processed data is trained with the data gbdt (GBDT, Gradient boosting decision tree) network, the simulation curve output by the gbdt network; kshape_stl_predict_final rf integration (i.e., the method adopted in the preferred embodiment of the present invention) means that the training sample data is clustered and decomposed based on the time series by using the K-Shape algorithm and the STL algorithm respectively, and the processed data is obtained, and the random forest network RF is trained based on the ensemble learning (stacking) framework with the data, and the RF network predicts the output simulation curve; svm represents support vector machine, and the svm is trained with the training sample data, and the svm predicts the output simulation curve.
[0156] During the simulation verification of the preferred embodiment of the present invention, experimental comparisons of various network models were carried out. After in-depth comparisons of various advanced models, the network training and testing innovatively adopted by the preferred embodiment of the present invention has better effects, and its fitting curve is closer to the true value. For specific results, please refer to Fig.10 shown.
[0157] Fig.11 The present invention uses the K-Shape_STL algorithm to process the training sample data and then uses SVM to perform simulation verification. The simulation results refer to Fig.11 shown. Fig.11In the example, predict means that the real training sample data is clustered and decomposed by the K-Shape_STL algorithm in the embodiment of the present invention, and the processed data is input into the SVM, and the simulation curve output by the SVM is obtained; true means that the real training sample data is input into the SVM, and the simulation curve output by the SVM is obtained. By comparison, it is found that the distribution of the test set data divided by the K-shape_STL hybrid clustering decomposition algorithm in the feature space is closer to the real training set data.
[0158] The present invention adopts MAPE (mean absolute percentage error) index and R 2 (coefficient of determination) indicator is used to evaluate the simulation results of different algorithms.
[0159] Fig.12 It is a schematic diagram of the MAPE index of the simulation results of the K-Shape_STL algorithm and other algorithms in an embodiment of the present invention. Fig.12 In the figure, the horizontal axis model name indicates the abbreviation of the algorithm model, the vertical axis indicates the MAPE index score, mape indicates the MAPE (mean absolute percentage error) index, mape_train indicates the MAPE index calculated based on the results obtained by different algorithms in the training set, and mape_test indicates the MAPE index calculated based on the results obtained by different algorithms in the test set; kmeans_svm indicates: clustering is performed on the training set and the test set using the K-means algorithm, and the clustering results are input into the SVM for training. The output of the SVM is used to calculate the MAPE index; kshape_ svm means: use K-Shape algorithm to cluster the training set and test set respectively, input the clustering results into SVM for training, and calculate the MAPE index based on the output of SVM; emd_svm means: use EMD algorithm to decompose the training set and test set respectively, input the clustering results into SVM for training, and calculate the MAPE index based on the output of SVM; stl_svm means: use STL algorithm to decompose the training set and test set respectively, input the decomposition results into SVM for training, and calculate the MAPE index based on the output of SVM;
[0160] kmeans_stl_svm means: use K-means algorithm to cluster the training set and test set respectively, use STL algorithm to decompose the clustering result, input the decomposed result into SVM for training, and calculate the MAPE index based on the output of SVM; kshape_stl_svm means: use K-Shape algorithm to cluster the training set and test set respectively, use STL algorithm to decompose the clustering result, input the decomposed result into SVM for training, and calculate the MAPE index based on the output of SVM; svm means: use training set and test set respectively to train SVM, and calculate the MAPE index based on the output of SVM. Fig.12 As shown, from the simulation results of different algorithms, in terms of MAPE (mean absolute percentage error) index, although the training set and test set results of the K-shape_STL algorithm adopted in the embodiment of the present invention are not the best among all the compared algorithms, the results of the test set are closer to the actual training set, showing good stability and consistency.
[0161] Fig.13 is the R of the simulation results of the K-Shape_STL algorithm and other algorithms in the embodiment of the present invention 2 Schematic diagram of the indicator. Fig.13 In the figure, the horizontal axis model name represents the abbreviation of the algorithm model, and the vertical axis represents R 2 Index score, r2 represents R 2 (coefficient of determination) indicator, mape_train represents the R calculated based on the results obtained by different algorithms in the training set. 2 Indicator, mape_test represents the R calculated by the results obtained by different algorithms in the test set 2 Indicator; kmeans_svm means: Use K-means algorithm to cluster the training set and test set respectively, input the clustering results into SVM for training, and calculate R based on the output of SVM 2 Indicator; kshape_svm means: use the K-Shape algorithm to cluster the training set and the test set respectively, input the clustering results into SVM for training, and calculate R based on the output of SVM 2 Indicator; emd_svm means: use the EMD algorithm to decompose the training set and the test set respectively, input the clustering results into SVM for training, and calculate R based on the output of SVM 2 Indicator; stl_svm means: use the STL algorithm to decompose the training set and the test set respectively, input the decomposition results into SVM for training, and calculate R based on the output of SVM 2Indicator; kmeans_stl_svm means: use K-means algorithm to cluster the training set and test set respectively, use STL algorithm to decompose the clustering results, input the decomposed results into SVM for training, and calculate R based on the output of SVM 2 Indicator; kshape_stl_svm means: use the K-Shape algorithm to cluster the training set and the test set respectively, use the STL algorithm to decompose the clustering results, input the decomposed results into SVM for training, and calculate R based on the output of SVM 2 Indicator; svm means: use the training set and the test set to train the SVM, and calculate R based on the output of the SVM. 2 Indicator. Fig.13 Analysis, through R 2 (coefficient of determination) indicators, it was found that the K-shape_STL algorithm performed better in predictive ability.
[0162] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, which may include: ROM, RAM, magnetic disk or optical disk, etc. Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for power load forecasting by integrating Transformer and RF, characterized in that: include: Obtain the short-term power load data to be predicted in the target area, input it into the trained random forest network after clustering and decomposition, and output the power load prediction result; The training process of the random forest network includes: Collect historical power load data and corresponding historical weather data of a specific area, and obtain a first training data set and a second training data set with labels after preprocessing; Based on the time series characteristics of the historical power load data and the corresponding historical weather data, the first labeled training data set and the second labeled training data are clustered and decomposed respectively; Inputting the clustered and decomposed power load data into a multi-modal time series prediction converter to obtain a feature sequence; The feature sequence is input into the random forest network for regression prediction, the regression loss is calculated, and the random forest network is iteratively optimized through the regression loss.
2. The power load forecasting method integrating Transformer and RF according to claim 1 is characterized in that: The K-Shape algorithm is used to cluster the power load data to obtain the power load data of different clusters after clustering. The clustering process includes: S201: Calculate the K value using the silhouette coefficient according to the power load data of the input power load data set, and use it as the initial centroid of the cluster; S202: Calculate the correlation coefficient between power load data; S203: Calculating shape-based distances between power load data of the input power load data set using the maximized mutual correlation coefficient; S204: according to the calculated distance, each power load data is assigned to the cluster where the centroid with the smallest distance to it is located; S205: Iteratively calculate the centroid of the cluster until the centroid no longer changes or reaches a preset number of iterations, and obtain the power load data of different clusters after clustering.
3. The power load forecasting method integrating Transformer and RF according to claim 2 is characterized in that: The STL algorithm is used to decompose the overall trend of power load data of different clusters after clustering into trend component, seasonal cycle component and residual component, which is specifically expressed as follows: Y[v]=T[v]+S[v]+L[v] In the formula, Y[v] represents the overall trend of power load data over time, T[v] represents the trend component, S[v] represents the seasonal cycle component, L[v] represents the residual component, and v represents the time index; The specific decomposition process includes: S301: Divide the power load data in different clusters after clustering into n(p) subsequences, form a periodic subsequence from them, initialize the trend component of the periodic subsequence, that is, T[v]=0, initialize the number of iterations k=0, initialize the trend component T[v] of the k-th iteration periodic subsequence k =0; S302: Subtract the trend component from the overall trend of the periodic subsequence changing over time to obtain a subsequence without the trend component, that is, Y[v]-T[v] k ; S303: Use the LOESS algorithm to smooth each periodic subsequence without trend components to obtain a smoothing result C[v] k+1 , for the smoothed result C[v] k+1 Perform 3 sliding averages to get the result after 3 sliding averages; S304: Use the LOESS algorithm to regress the results of the three sliding averages to obtain the residual component L[v] of the periodic subsequence k+1 ; S305: Use the smoothing result C[v] k+1 Remove the residual component L[v] k+1 Get the seasonal periodic component S[v] of the periodic subsequence k+1 , that is: S[v] k+1 =C[v] k+1 -L[v] k+1 ; S306: Remove the seasonal periodic component S[v] from the overall trend of the power load data in different clusters after clustering. k+1 , smoothed again, we get the trend component T[v] k+1 ; S307: Iterate the calculation until the trend component S[v] k+1 When converged, the final trend component T[v], seasonal cycle component S[v] and residual component L[v] are obtained.
4. The power load forecasting method integrating Transformer and RF according to claim 1 is characterized in that: After clustering and decomposing the labeled first training data set and the second training data, they are input into the multimodal time series prediction transformer, and the fused embedding is obtained through multimodal embedding and weighted fusion. The fused embedding is specifically expressed as: E fused =αE boston +βE nz +γS Among them, E fused represents the fusion embedding of the output of the multimodal time series prediction transformer, α represents the first weight coefficient, β represents the second weight coefficient, γ represents the third weight coefficient, E boston represents the power load data of the first labeled training data set after clustering and decomposition, E nz represents the power load data of the second labeled training data set after clustering and decomposition, and S represents the position code.
5. The power load forecasting method integrating Transformer and RF according to claim 1 is characterized in that: During the training process of the random forest network, the first training data set is clustered and decomposed and then input into the pre-trained conditional generative adversarial network, and the conditional information is combined to generate synthetic data, which is then input into the multimodal time series prediction transformer.
6. The power load forecasting method integrating Transformer and RF according to claim 5 is characterized in that: The pre-training process of the conditional generative adversarial network includes: Based on the time series characteristics of the power load historical data and its corresponding historical weather data, clustering and decomposing the first labeled training data set respectively to obtain first processed data, which includes a trend component, a seasonal cycle component and a residual component of the power load data changing over time; Input the first processed data into a discriminator of a conditional generative adversarial network, combine the condition information, the discriminator outputs a discrimination result, and calculates the discrimination loss between the first processed data and the discrimination result; The discriminant result output by the discriminator is input into the generator. Combined with the conditional information, the generator outputs synthetic data, and the generation loss between the discriminant result and the synthetic data is calculated; the synthetic data output by the generator is input into the autoencoder for feature reconstruction, and the reconstructed data is output, and the reconstruction loss between the reconstructed data and the synthetic data is calculated; The discrimination loss, generation loss and reconstruction loss constitute the overall loss, and the adversarial network is generated according to the iterative optimization conditions of the overall loss.
7. The power load forecasting method integrating Transformer and RF according to claim 6 is characterized in that: The overall loss L of the conditional generative adversarial network during training total Specifically: L total =αL cGAN +βL rec , Among them, L cGAN represents the loss of the conditional generative adversarial network itself, L rec represents the reconstruction loss of the autoencoder, α represents the first hyperparameter, and β represents the second hyperparameter. represents the discriminant loss of the discriminator in the conditional generation adversarial network, x represents the input data of the discriminator, and p data represents the distribution of the discriminator input data, that is, the probability distribution obeyed by x, D(x|c) represents the output of the discriminator for the input data x under given conditions in the conditional generative adversarial network, c represents the conditional information, z represents the random noise vector, p z represents the distribution of random noise z, that is, the probability distribution that z obeys, represents the average logarithmic loss of the generator generating fake data under the discriminator, D(G(z|c)|c) represents the output of the discriminator for the generator generating fake data under the given condition c, and G(z|c) represents the output of the generator under the given condition c and the random noise vector z.
8. The method for power load forecasting by integrating Transformer and RF according to any one of claims 1 to 6, characterized in that: The first labeled training data set is a training data set formed after preprocessing the historical data of power load and its corresponding historical weather data in the Boston area, and the second labeled training data set is a training data set formed after preprocessing the historical data of power load and its corresponding historical weather data in the New Zealand area.
9. The power load forecasting method integrating Transformer and RF according to claim 1, characterized in that: The preprocessing process includes: deleting abnormal values in the power load data; using a linear interpolation algorithm to fill in the missing values of the power load data; and using a maximum and minimum value method to normalize the power load data.
10. The power load forecasting method integrating Transformer and RF according to claim 1, characterized in that: The training process of the random forest network also includes: inputting the feature sequences into pre-trained diversified base regressors respectively, and obtaining different regression prediction results after regression processing; inputting the regression prediction results into the random forest network for regression prediction, and the diversified base regressors include SVM regressor, XGBoost regressor, Light GBM regressor and KNN regressor.
Citation Information
Patent Citations
Clustering and trend index-based power distribution network line load prediction method and device
CN112508275A
Transform and Bi-LSTM-based power load prediction method and system
CN117638860A
Short-term bus load prediction method and system for identifying abnormal weather
CN117709540A
Industrial park-oriented multi-type load cooperative control method and system
CN118469332A
Photovoltaic power generation power prediction method based on multivariable time sequence decomposition and multiple models
CN118657243A
Cited By
Non-intrusive load decomposition method and device for energy scene
CN120337161A
A non-invasive load decomposition method and device for energy scenarios
CN120337161B
Cross-season short-term load prediction method and system for electric power spot market
CN122136812A
Load prediction method and system based on decomposition and cross-correlation feature fusion
CN122136830A
A load prediction method and system based on decomposition and cross-correlation feature fusion
CN122136830B