A comprehensive load forecasting method and system based on Transformer
Through the comprehensive load forecasting method based on Transformer, the trend and seasonal characteristics of multiple loads in the regional integrated energy system are extracted, and combined with the self-attention mechanism and the decoupling linear layer, the problem of difficulty in capturing the coupling relationship of multiple loads in the traditional method is solved. Improved prediction accuracy and reduced model complexity.
Patent Information
- Application Number
- CN202410609965.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-16
AI Technical Summary
Traditional load forecasting methods cannot effectively satisfy the coupling relationship between multiple loads in regional integrated energy systems, resulting in low prediction accuracy and unable to meet the needs of multi-level load forecasting.
A comprehensive load forecasting method based on Transformer is used to build a comprehensive load forecasting model by acquiring and preprocessing historical data, using multi-scale decomposition and sequence division to extract trend and seasonal features, and combining self-attention mechanism and decoupled linear layer for prediction. , optimize model parameters to improve prediction accuracy.
It improves the accuracy of multi-load forecasting of regional comprehensive resource systems, reduces model complexity and training resource overhead, and achieves more flexible, efficient, and accurate multi-energy load forecasting.
Smart Images

Figure CN118195103B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of energy forecasting, and in particular relates to a Transformer-based comprehensive load forecasting method and system. Background Art
[0002] Energy is the cornerstone of social development and economic operation, and plays a vital role in people's lives and industrial production. However, the limited availability of traditional energy (such as coal, oil and natural gas) and its adverse impact on the environment have attracted widespread attention, which has led to an increasing demand for renewable energy. The volatility and uncontrollability of renewable energy have brought challenges to the stability and reliability of the energy system, so other energy sources need to be configured for coordination. Against this background, many countries have begun to focus on integrated energy systems to cope with the diversity and sustainability of energy demand. Among them, the Regional Integrated Energy System (RIES) is the basis for comprehensive analysis of wide-area energy and is also a specific application scenario of the integrated energy system.
[0003] Regional integrated energy systems can effectively improve the utilization efficiency of multiple loads such as electricity, cooling, and heat through coordinated planning and flexible scheduling. Long-term prediction of multiple loads is an important prerequisite for the safe and stable operation and economic optimization management of regional integrated energy systems, and is of great significance for achieving the balance between supply and demand of electricity, cooling, and heat loads. Therefore, it is crucial to achieve efficient and accurate long-term prediction of multiple loads. Due to the complementary effects between multiple energy forms in the RIES system, there are complex coupling characteristics between multiple loads, which brings new challenges to RIES multiple load prediction.
[0004] Traditional load forecasting mainly conducts single forecasting for specific energy sources, such as electricity, natural gas, cold and heat, and thermal energy. It models and forecasts based on historical electricity load data and related influencing factors, such as weather and season. In RIES, electricity, cold and heat are intertwined and complementary, and their supply and demand relationships and mutual influences are inseparable. Traditional load forecasting ignores the coupling relationship between multiple energy forms in the regional integrated energy system. In addition, the singleness of traditional load forecasting cannot meet the needs of the RIES system for multi-energy load forecasting. In view of these shortcomings of traditional load forecasting, it has become an urgent problem to deeply explore the coupling relationship between different energy systems and realize more flexible, efficient and accurate multi-energy load forecasting. Summary of the invention
[0005] In order to address the deficiencies of the prior art, the present invention provides a Transformer-based comprehensive load forecasting method and system, which fully considers the characteristics of comprehensive energy load data, provides a series of solutions for the trend, seasonality, long-term dependency and coupling characteristics of different loads of the data, and improves the multi-load forecasting accuracy of the regional comprehensive resource system.
[0006] The technical solution adopted by the present invention is as follows.
[0007] In a first aspect, the present invention proposes a Transformer-based comprehensive load forecasting method comprising:
[0008] Acquire detection calendar data, load detection data and meteorological detection data, and input them into the pre-trained comprehensive load forecasting model to obtain real-time heat energy forecast value, real-time cooling energy forecast value and real-time electric energy forecast value;
[0009] The construction process of the comprehensive load forecasting model is as follows:
[0010] Calendar data, load history data and meteorological history data are obtained from the historical comprehensive load data set, the load history data is preprocessed to obtain load training data, and the load training data, meteorological history data and calendar data are subjected to correlation analysis and screening to obtain meteorological training data and calendar training data; a training set is constructed from the calendar training data, load training data and meteorological training data;
[0011] A comprehensive load forecasting model is constructed based on the Transformer deep learning model, and the training set is input into the comprehensive load forecasting model for multi-scale decomposition operation to obtain trend characteristics and seasonal characteristics; the trend characteristics and the seasonal characteristics are respectively subjected to sequence division operation; the seasonal characteristics after the sequence division operation are subjected to a first feature extraction operation to obtain seasonal prediction values of the electric load, the cooling load and the heating load, and the trend characteristics after the sequence division operation are subjected to a second feature extraction operation to obtain trend prediction values of the electric load, the cooling load and the heating load; the seasonal prediction values of the electric load, the cooling load and the heating load and the trend prediction values of the electric load, the cooling load and the heating load are respectively added correspondingly to finally obtain the training prediction result of the training set, the training loss value is calculated based on the training prediction result, the parameters of the comprehensive load forecasting model are optimized according to the training loss value, and the training process of the comprehensive load forecasting model is iterated repeatedly to obtain the trained comprehensive load forecasting model.
[0012] Optionally, the load history data is preprocessed to obtain load training data, and the process includes:
[0013] Default value interpolation processing, abnormal value repair processing, smoothing processing of the load historical data and normalization processing of the historical comprehensive load data set;
[0014] The specific step of the default value interpolation process is to fill in the current default value with the mean of the previous non-default value and the next non-default value data;
[0015] If the difference between the load data at a certain moment and the average value of the load data on that day exceeds a preset percentage of the average value of the load data on that day, the load data is regarded as an abnormal value; the abnormal value repair process adopts the linear spline interpolation method, and its formula is as follows:
[0016] ;
[0017] in, Indicates the current moment, Indicates the load data value to be estimated and repaired for abnormal values at the current moment. Indicates the last moment, Indicates the load data value at the previous moment; Indicates the next moment, Indicates the load data value at the next moment;
[0018] The smoothing operation is implemented using a Savitzky-Golay filter.
[0019] Optionally, correlation analysis and screening are performed on the load training data, meteorological historical data, and calendar data to obtain meteorological training data, and the process includes:
[0020] The Person correlation coefficients between different variables in the load training data and the meteorological historical data and calendar data are calculated, and the meteorological historical data and calendar data whose Person correlation coefficients are greater than a preset threshold are selected as auxiliary variables to obtain meteorological training data and calendar training data.
[0021] Optionally, the construction process of the comprehensive load forecasting model also includes:
[0022] Construct validation set and test set from calendar training data, load training data and meteorological training data;
[0023] After each training cycle, the trained comprehensive load forecasting model is evaluated using the validation set, and the comprehensive load forecasting model is updated to obtain the best comprehensive load forecasting model;
[0024] The test set is input into the optimal comprehensive load forecasting model, and the thermal energy prediction value, cooling energy prediction value and electric energy prediction value of the test set are output. The thermal energy prediction value, cooling energy prediction value and electric energy prediction value of the test set are used to calculate the evaluation index of the comprehensive load forecasting model.
[0025] Optionally, the evaluation indicators include root mean square error, mean absolute error and mean absolute percentage error.
[0026] Optionally, updating the comprehensive load forecasting model refers to adjusting the hyperparameters of the comprehensive load forecasting model according to the evaluation indicators obtained from the verification set, finding the optimal parameter configuration through repeated training and verification processes, and obtaining the best comprehensive load forecasting model.
[0027] Optionally, the multi-scale decomposition operation refers to decomposing the training set into trend features and seasonal features, and the scale decomposition includes a linear branch and a pooling layer branch. The specific steps are as follows:
[0028] The linear branching process is to copy the training set three times, and multiply the copied identical training sets by the weight matrix of size (15,15) in the linear layer respectively to obtain the fourth eigenvector, the fifth eigenvector and the sixth eigenvector, and perform data normalization operation on the eigenvectors to obtain the linear layer branching results;
[0029] The pooling layer branching process is to copy the training set three times, and input the copied same training set into the 1-dimensional average pooling function with pooling windows of 6, 12, and 24 respectively, to obtain the first eigenvector, the second eigenvector, and the third eigenvector of different trend degrees, and obtain the pooling layer branching result;
[0030] Performing element-wise multiplication of the linear layer branch result and the pooling layer branch result, specifically, multiplying feature vector 1 and feature vector 4 element-wise, feature vector 2 and feature vector 5 element-wise, and feature vector 3 and feature vector 6 element-wise, to obtain three new and different feature vectors, and then performing an addition operation on the three new and different feature vectors to obtain the trend feature;
[0031] The training set is subtracted from the trend feature to obtain the seasonal feature.
[0032] Optionally, the specific steps of the sequence division operation are: performing the sequence division operation on the seasonal characteristics to obtain seasonal characteristic data including electric load, seasonal characteristic data including cooling load, and seasonal characteristic data including heating load, the seasonal characteristic data including electric load includes electric load, meteorological data and calendar data; the seasonal characteristic data including cooling load includes cooling load, meteorological data and calendar data; the seasonal characteristic data including heating load includes heating load, meteorological data and calendar data; the sequence division rules of the seasonal characteristics and the trend characteristics are the same, the trend characteristics are subjected to the sequence division operation to obtain trend characteristic data including electric load, trend characteristic data including cooling load, and trend characteristic data including heating load, respectively.
[0033] Optionally, the seasonal characteristic data containing electric load, the seasonal characteristic data containing cooling load and the seasonal characteristic data containing heating load after the sequence is divided are subjected to the same first feature extraction operation to obtain seasonal prediction values of electric load, cooling load and heating load respectively;
[0034] The first feature extraction operation includes two parallel structure branches, namely a local branch and a global branch;
[0035] For the local branch, a linear layer is used to embed the seasonal feature data from the time dimension, so as to obtain a high-dimensional representation of the seasonal feature data at different times, and then the encoded seasonal feature data is subjected to feature extraction through a self-attention mechanism, so as to obtain the features extracted by the local branch. The calculation formula of the self-attention mechanism is:
[0036] ;
[0037] in, represents the query matrix, represents the key matrix, represents the value matrix, T represents the transpose, , , The seasonal feature data is input and calculated through three different linear layers to obtain the feature matrix. A characteristic dimension representing the seasonal characteristic data; Represents the calculation of the query matrix With the key matrix The attention weights between them are calculated to obtain the correlation scores between different variables, and finally the correlation scores between them are obtained by adding them to the value matrix Perform weighted summation to finally obtain the output of the self-attention mechanism , i.e., the features extracted by the local branch;
[0038] For the global branch, a fast Fourier transform is used to implement a convolution operation, thereby performing a global convolution on the long time series. The calculation formula of the global convolution is as follows:
[0039] ;
[0040] in, represents the seasonal characteristic data, , Indicates the length of the seasonal characteristic data, represents the characteristic dimension of the seasonal characteristic data, express A real matrix of size , represents the learnable global kernel of the global convolution, , represents the features extracted by the global branch, , represents the fast Fourier transform, represents a fast inverse Fourier transform, and the features extracted by the global branch are finally obtained by using the calculation formula of the global convolution;
[0041] The local branch extraction features containing seasonal characteristic data of electric load are added to the global branch extraction features containing seasonal characteristic data of electric load, and a Dropout operation is performed to obtain a seasonal characteristic vector containing electric load; the local branch extraction features containing seasonal characteristic data of cooling load are added to the global branch extraction features containing seasonal characteristic data of cooling load, and a Dropout operation is performed to obtain a seasonal characteristic vector containing cooling load; the local branch extraction features containing seasonal characteristic data of heating load are added to the global branch extraction features containing seasonal characteristic data of heating load, and a Dropout operation is performed to obtain a seasonal characteristic vector containing heating load;
[0042] The seasonal characteristic vector containing the electric load Decoupling linear layers using electrical loads Processing is performed to obtain the seasonal forecast value of electric load , as shown in formula (1); the seasonal characteristic vector containing the cooling load is decoupled using the cooling load linear layer Processing is performed to obtain the seasonal forecast value of cooling load , as shown in formula (2); the seasonal characteristic vector containing the heat load Decoupling Linear Layers Using Heat Load Processing to obtain seasonal forecast value of heat load , as shown in formula (3):
[0043] (1);
[0044] (2);
[0045] (3).
[0046] Optionally, the specific steps of the second feature extraction operation are: using the same decoupled multi-layer perceptron to input trend feature data containing electric load , including trend characteristic data of cooling load and trend characteristic data including heat load Process them separately to obtain the trend prediction value of electric load , Cooling load trend prediction value and heat load trend prediction value , the multi-layer perceptron adds a reversible instance normalization layer before and after, and the calculation formula is as follows:
[0047] ;
[0048] ;
[0049] ;
[0050] in, represents the reversible instance normalization layer, Represents a multi-layer perceptron.
[0051] In a second aspect, the present invention provides a Transformer-based integrated load forecasting system, comprising:
[0052] The prediction module obtains load detection data and meteorological detection data, and inputs them into the pre-trained comprehensive load prediction model to obtain thermal energy prediction values, cooling energy prediction values, and electric energy prediction values;
[0053] The data acquisition module acquires load historical data and meteorological historical data from the historical comprehensive load data set, pre-processes the load historical data to obtain load training data, performs correlation analysis and screening on the load training data and meteorological historical data to obtain meteorological training data; and constructs a training set from the load training data and meteorological training data;
[0054] Model building module, used to build a comprehensive load forecasting model based on the Transformer deep learning model,
[0055] A multi-scale decomposition module, used for performing a multi-scale decomposition operation after the training set is input into the comprehensive load forecasting model to obtain trend characteristics and seasonal characteristics;
[0056] A sequence division module performs sequence division operations on the trend feature and the seasonal feature respectively;
[0057] A first feature extraction module performs a first feature extraction operation on the seasonal features after the sequence division operation to obtain seasonal prediction values of electric load, cooling load, and heating load,
[0058] The second feature extraction module performs a second feature extraction operation on the trend feature after the sequence division operation to obtain the trend prediction values of the electric load, the cooling load, and the heating load; the seasonal prediction values of the electric load, the cooling load, and the heating load and the trend prediction values of the electric load, the cooling load, and the heating load are added respectively, and finally the training prediction result of the training set is obtained.
[0059] The model optimization module calculates the training loss value based on the training prediction result, optimizes the parameters of the comprehensive load prediction model according to the training loss value, and repeatedly iterates the training process of the comprehensive load prediction model to obtain the trained comprehensive load prediction model.
[0060] The beneficial effects of the present invention are as follows: the Transformer-based comprehensive energy load forecasting method proposed by the present invention fully considers the characteristics of comprehensive energy load data, provides a series of solutions for the trend, seasonality, long-term dependency and coupling characteristics of different loads of the data, and improves the multi-load forecasting accuracy of the regional comprehensive resource system. In addition, the use of regression forecasting based on linear methods greatly reduces the model complexity of the Transformer model and reduces the training resource overhead without affecting the forecasting accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a flow chart of the comprehensive load forecasting method based on Transformer in Example 1;
[0062] Figure 2 It is the attribute item diagram of the data set in Example 2;
[0063] Figure 3 This is a structural diagram of the multi-scale decomposition steps in Example 2;
[0064] Figure 4 This is a structural diagram of the first feature extraction step in Example 2;
[0065] Figure 5 This is a structural diagram of the second feature extraction step in Example 2;
[0066] Figure 6 It is a structural diagram of the comprehensive load forecasting model in Example 2;
[0067] Figure 7 A comparison diagram of the predicted curves and actual curves of the electric energy data of the five prediction models in Example 4;
[0068] Figure 8 It is a comparison diagram of the predicted curve and the actual curve of the cold energy data of the five prediction models in Example 4;
[0069] Fig. 9 This is a comparison chart of the predicted curves and actual curves of the thermal energy data of the five prediction models in Example 4. DETAILED DESCRIPTION
[0070] The present invention is further described below in conjunction with the embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0071] Example 1
[0072] This embodiment provides a comprehensive load forecasting method based on Transformer. Figure 1 shown.
[0073] Obtaining a historical comprehensive load data set and performing data preprocessing and correlation analysis to obtain calendar training data, load training data and meteorological training data; wherein the load training data includes electric load, cooling load and heating load;
[0074] Divide the calendar training data, load training data and meteorological training data into training set, validation set and test set according to the set ratio;
[0075] Using the training set and the validation set to perform model training to obtain a trained comprehensive load forecasting model;
[0076] The test set is input into the trained comprehensive load forecasting model, and the heat energy forecast value, the cold energy forecast value and the electric energy forecast value of the test set are obtained according to the learned load data characteristics.
[0077] Acquire detection calendar data, load detection data and meteorological detection data, and input them into the pre-trained comprehensive load forecasting model to obtain real-time heat energy forecast value, real-time cooling energy forecast value and real-time electric energy forecast value;
[0078] Different methods are used to predict different characteristics of the load, namely seasonal and trend characteristics, which improves the accuracy of load prediction; the decoupling idea and linear method are adopted to make the comprehensive load prediction model can simply and efficiently predict the change trend of the load, so that the model of the present invention focuses on predicting only the same type of load, providing data reference for the energy scheduling of the regional comprehensive resource system.
[0079] Example 2
[0080] Based on Example 1, the comprehensive load forecasting method of Transformer is further described.
[0081] S1: See Figure 2 The type characteristics of the historical data set include load data, meteorological data and calendar data; the load data includes electrical load, cooling load and heating load; the meteorological data includes temperature, dew point, relative humidity, air pressure, wind speed, wind direction, precipitation, surface albedo, solar zenith angle, cloud type; the calendar data includes whether it is a weekend, whether it is a holiday, year, month, day and time, a total of 19.
[0082] S2: Obtain load historical data and meteorological historical data from the historical comprehensive load data set, and preprocess the load historical data to obtain load training data; wherein the data preprocessing includes interpolation processing of the default value of the load data, outlier repair processing, smoothing processing and normalization processing of all the historical data sets.
[0083] The step of interpolation processing of the default value is that if the data at a certain moment is missing, it is filled with the average of the previous non-default value and the next non-default value data to supplement the default value position.
[0084] The smoothing process mainly uses the Savitzky-Golay filter to smooth the trend of the data set, which can effectively reduce noise and remove high-frequency oscillations. The Savitzky-Golay filter is a commonly used digital signal processing filtering method for smoothing and denoising signals. It estimates the smoothing value of the signal by fitting a polynomial to the signal, and uses the fitting result to calculate the filtered value. The advantage of the Savitzky-Golay filter is that it can retain the overall shape and characteristics of the signal while removing high-frequency noise. It performs well in smoothing data and removing noise, and has high computational efficiency.
[0085] However, for signals containing spikes or mutations, the Savitzky-Golay filter may not be able to handle them well. Therefore, if the load data error at a certain moment exceeds 5% of the average load data of the day, the data point can be determined as an outlier. The error refers to the difference between the load data at this moment and the average load data of the day. The linear spline interpolation method is used to repair the distorted data. The linear spline interpolation method formula is as follows:
[0086] ;
[0087] in, Indicates the current moment, Indicates the load data value to be estimated and repaired for abnormal values at the current moment. Indicates the last moment, Indicates the load data value at the previous moment; Indicates the next moment, Indicates the load data value at the next moment.
[0088] Data normalization is an important step in data preprocessing. It converts data into a uniform range or distribution to eliminate the dimensional differences between different features, making the data more suitable for machine learning and data analysis tasks. This article uses mean square error data normalization operation for processing. The specific formula is as follows:
[0089] ;
[0090] in, It represents the input sample after the interpolation of the sequence default value, the repair of the data outliers, and the smoothing operation. represents the average value in the historical input data, represents the standard deviation in the historical input data, Represents the data matrix after normalization operation.
[0091] S3: After data preprocessing, the Person correlation coefficient between different variables in the load training data and the meteorological historical data and calendar data is calculated, and the meteorological historical data and calendar data whose Person correlation coefficient is greater than a preset threshold are selected as auxiliary variables to obtain meteorological training data and calendar training data; the correlation analysis of some variables is shown in Table 1.
[0092] Table 1, list of correlations between variables;
[0093]
[0094] For the Person correlation coefficient, it is generally believed that the correlation coefficient between 0.8-1.0 is extremely correlated, 0.6-0.8 is strongly correlated, 0.4-0.6 is moderately correlated, 0.2-0.4 is weakly correlated, and 0.0-0.2 is extremely weakly correlated or uncorrelated. In Table 1, the electric load and cooling load are strongly correlated with the temperature, dew point and precipitation, respectively, and show a strong negative correlation with the thermal load. In addition, the thermal load shows a strong negative correlation with other variables. The features that were screened out are: surface albedo, solar zenith angle, cloud type, and year. The features obtained after the final screening are: the updated load data includes electric load, cooling load and thermal load; the updated meteorological data includes temperature, dew point, precipitation, wind direction, wind speed, relative humidity and air pressure; the updated calendar data includes whether it is a weekend, whether it is a holiday, month, day and time, a total of 15 columns, such as Figure 2 shown.
[0095] The training set, validation set and test set are constructed from calendar training data, load training data and meteorological training data.
[0096] S4: Preliminarily build a Transformer-based comprehensive load forecasting model, and use the training set to train the Transformer-based comprehensive load forecasting model.
[0097] The Transformer-based comprehensive load forecasting model includes a multi-scale decomposition operation, a sequence partitioning operation, a first feature extraction operation, and a second feature extraction operation. Figure 6As shown, the training set is subjected to a multi-scale decomposition operation to obtain trend characteristics and seasonal characteristics, and both the trend characteristics and the seasonal characteristics are subjected to a sequence division operation; the seasonal characteristics after the sequence division operation are subjected to a first feature extraction operation to obtain seasonal prediction values of electric load, cooling load and heating load, and the trend characteristics after the sequence division and splicing operation are subjected to a second feature extraction operation to obtain trend prediction values of electric load, cooling load and heating load; the seasonal prediction values of the electric load, cooling load and heating load and the trend prediction values of the electric load, cooling load and heating load are added respectively, and finally the electric energy prediction value, cooling energy prediction value and thermal energy prediction value of the training set, as well as the comprehensive load prediction model after training, are obtained;
[0098] The specific steps are as follows:
[0099] S41: According to the inherent characteristics of the load itself, the training set is decomposed by multi-scale decomposition operation to obtain trend characteristics and seasonal characteristics, such as Figure 3 shown.
[0100] Since a series of existing variational mode decomposition (VMD) decomposition methods have the disadvantages of high algorithm complexity and sensitivity to noise, the present invention proposes a multi-scale decomposition method with low algorithm complexity and high generalization performance.
[0101] First, the training set is input into the linear layer to obtain the feature vector corresponding to the linear layer; the training set preprocessed in step S2 is input into the pooling layer to obtain the feature vector corresponding to the pooling layer.
[0102] The specific steps corresponding to the linear branch are: copy the training set three times, multiply the copied identical training set with the weight matrix of size (15,15) in the linear layer to obtain the fourth eigenvector, the fifth eigenvector and the sixth eigenvector, and perform data normalization on the eigenvectors to obtain the linear layer branch results.
[0103] The specific steps corresponding to the pooling branch are: copying the training set three times, inputting the copied same training set into the 1-dimensional average pooling function with pooling windows of 6, 12, and 24 respectively, obtaining the first eigenvector, the second eigenvector, and the third eigenvector of different trend degrees, and obtaining the pooling layer branch result;
[0104] The length of the pooled vector is calculated as follows:
[0105] ;
[0106] in, represents the length of the output vector, Indicates the length of input data. Indicates the filling quantity, represents the pooling kernel size, Represents the pooling stride.
[0107] Secondly, the first eigenvector, the second eigenvector, the third eigenvector obtained through the linear layer branch and the fourth eigenvector, the fifth eigenvector, and the sixth eigenvector obtained through the pooling branch are element-wise multiplied. The specific steps are: element-by-element multiplication of the first eigenvector and the fourth eigenvector, element-by-element multiplication of the second eigenvector and the fifth eigenvector, and element-by-element multiplication of the third eigenvector and the sixth eigenvector to obtain three new and different eigenvectors, and then the three new and different eigenvectors are added to obtain the trend feature.
[0108] Finally, the preprocessed training set is subtracted from the trend feature to obtain the seasonal feature of the preprocessed training set.
[0109] Specifically, the size of the training set is (96, 15), where 96 refers to the time step of the input sequence, and 15 refers to 15 columns of feature attribute items, including load data, meteorological data, and calendar data, specifically electrical load, cooling load, heating load, temperature, dew point, relative humidity, air pressure, wind speed, wind direction, precipitation, whether it is a weekend, whether it is a holiday, month, day, and time. After the multi-scale decomposition operation, the training set is divided into two parts, the first part is seasonal feature data, with a size of (96, 15); the second part is trend feature data, with a size of (96, 15), and the seasonal feature data and the trend feature both include 15 columns of feature attribute items.
[0110] S42: performing a sequence division operation on both the trend feature and the seasonal feature.
[0111] The model of the present invention belongs to a multi-input and multi-output structure. In order to better handle the coupling relationship and characteristics between the electric load, cooling load and heating load, it is necessary to perform sequence division operations on both the trend characteristics and the seasonal characteristics. That is, it is necessary to split the electric load, cooling load and heating load, and splice the electric load, cooling load and heating load separately with their respective meteorological and date auxiliary variables. The spliced input data will be divided into three parts, and the seasonal characteristic data containing the electric load, the seasonal characteristic data containing the cooling load, and the seasonal characteristic data containing the heating load, as well as the trend characteristic data containing the electric load, the trend characteristic data containing the cooling load, and the trend characteristic data containing the heating load are obtained respectively.
[0112] Specifically, taking the electric load of the seasonal characteristic data as an example, the seasonal characteristic data containing the electric load includes the electric load as well as temperature, dew point, relative humidity, air pressure, wind speed, wind direction, precipitation, whether it is a weekend, whether it is a holiday, month, day, and time; taking the cooling load of the seasonal characteristic data as an example, the seasonal characteristic data containing the cooling load includes the cooling load as well as temperature, dew point, relative humidity, air pressure, wind speed, wind direction, precipitation, whether it is a weekend, whether it is a holiday, month, day, and time; taking the thermal load of the seasonal characteristic data as an example, the seasonal characteristic data containing the thermal load includes the thermal load as well as temperature, dew point, relative humidity, air pressure, wind speed, wind direction, precipitation, whether it is a weekend, whether it is a holiday, month, day, and time; the sequence division rules of the seasonal characteristic data and the trend characteristic data are the same.
[0113] The input size of the seasonal characteristic data is (96, 15). After the sequence division module, three data are generated, and the size of each data is (96, 13). Here, 13 represents one of the load data characteristics (such as electric load, cooling load, heating load), meteorological data and calendar data. The sequence division module can process three different load data at one time.
[0114] S43: using the first feature extraction module to perform the same first feature extraction operation on the seasonal feature data containing the electric load, the seasonal feature data containing the cooling load, and the seasonal feature data containing the heating load after the sequence division operation in step S42, respectively, to obtain seasonal prediction values of the electric load, the cooling load, and the heating load, respectively, such as Figure 4 shown.
[0115] The first feature extraction module is mainly divided into two branches of parallel structure: global branch and local branch, and the seasonal feature processing module is as follows: Figure 3 shown.
[0116] For global branches, fast Fourier transform is used to implement convolution operation, so as to perform global convolution on long time series and obtain the features extracted by global branches corresponding to electric load, cooling load and heating load;
[0117] For local branches, the seasonal feature data is first embedded and encoded based on the dimension, and then the encoded data is calculated by the self-attention mechanism to obtain the features extracted by the local branches corresponding to the electric load, cooling load, and heating load;
[0118] Finally, the features extracted from the global branches corresponding to the electric load, cooling load and heating load and the features extracted from the local branches corresponding to the electric load, cooling load and heating load are added and dropped out to obtain the seasonal feature vectors of the electric load, cooling load and heating load. The seasonal feature vectors of the electric load, cooling load and heating load are processed using the decoupled linear layers corresponding to the electric load, cooling load and heating load for regression prediction to obtain the seasonal prediction values of the decoupled electric load, cooling load and heating load.
[0119] S431: inputting the seasonal characteristic data including the electric load, the seasonal characteristic data including the cooling load and the seasonal characteristic data including the heating load after the sequence division operation into the local branch for feature extraction, and obtaining the local branch extraction features including the electric load, the cooling load and the heating load respectively.
[0120] For the local branch, the seasonal characteristic data including the electric load, the seasonal characteristic data including the cooling load and the seasonal characteristic data including the heating load after the sequence is divided are firstly encoded respectively from the time dimension, and then the features are extracted through the self-attention mechanism.
[0121] First, a linear layer is used to embed and encode the seasonal characteristic data from a time dimension, so as to obtain a high-dimensional representation of the same seasonal characteristic data at different times, and the high-dimensional representation is the encoded seasonal characteristic data.
[0122] Most Transformer-based load forecasting methods map different variables at the same time in the time series into the same vector in the encoding part, and then predict the results based on the encoded vector. This cross-variable encoding at the same time cannot accurately reflect the properties of a specific variable, limiting the model's prediction ability. In addition, the change of variables is greatly affected by time, and the inappropriate use of the permutation-invariant attention mechanism in the time dimension will cause the model to be defective in modeling sequence time dependencies and multivariate correlations.
[0123] At the same time, the present invention designs a feature extraction module that can arbitrarily replace the attention mechanism. In the present invention, a simple self-attention mechanism is used to capture the coupling relationship between different variables for the multivariate correlation between variables. , the dimension is , Indicates the number of variables in the sequence data. Each variable can be represented as a dimensional vector. By performing a linear transformation on each variable in the sequence, we can obtain the query vector (Query), key vector (Key) and value vector (Value) of the vector. The query vector, key vector and value vector of vectors constitute the query matrix , key matrix Sum Matrix , , , The seasonal feature data of the input is calculated through three different linear layers, which are three different mapping representations of the input data X through the linear layer. Next, the query matrix is calculated With key matrix These weights describe the correlation or importance between different variables, thereby capturing the coupling relationship between different variables in the sequence. Finally, the attention weights are multiplied by the value matrix , and get the output of the self-attention mechanism. The specific formula of the self-attention mechanism is as follows:
[0124] ;
[0125] Where T represents transpose, Represents the characteristic dimension of the input data; Represents the computational query matrix With key matrix The attention weights between them are used to obtain the correlation scores between different variables, and finally combined with the value matrix Perform weighted summation, the weights of highly correlated variables will be larger, and finally the output of the self-attention mechanism is obtained , thus obtaining the features extracted by local branches.
[0126] The self-attention mechanism allows the model to automatically focus on relevant variables when processing sequence data and weight them according to their importance, so that the model can better understand and model the association relationships in the sequence data.
[0127] The present invention introduces a dimension embedding coding method, which mainly uses a linear layer to perform high-dimensional mapping on all time steps of the same variable from the time dimension, so that each variable at different times can be mapped to a corresponding vector to obtain a sequence matrix. Such a coding method can better focus on the variable and better capture the time dependency of each variable.
[0128] In addition, the present invention adopts a unique dimensional embedding coding method combined with the self-attention mechanism. The feature extraction part not only supports the self-attention mechanism, but can also replace the self-attention mechanism with any attention mechanism.
[0129] S432: Input the seasonal characteristic data including the electric load, the seasonal characteristic data including the cooling load and the seasonal characteristic data including the heating load after the sequence division operation into the global branch for feature extraction, and obtain the features extracted by the global branch including the electric load, the cooling load and the heating load respectively.
[0130] The global branch directly performs a fast convolution operation on the seasonal characteristic data containing electric load, seasonal characteristic data containing cooling load and seasonal characteristic data containing heating load after the sequence is divided to extract features. The global convolution operation has a significant effect in capturing long-term dependencies. Specifically, by using a lengthy kernel, it spans the entire sequence length, thereby being able to capture long-term dependencies.
[0131] For the global branch, fast Fourier transform is used to implement the convolution operation, so as to perform global convolution on the long time series. The complexity of the global convolution operation is In order to reduce the computational complexity, the fast Fourier transform can be introduced to implement convolution, and its computational complexity is , the calculation formula of global convolution is as follows:
[0132] ;
[0133] in, represents the seasonal characteristic data, , Indicates the length of the seasonal characteristic data, represents the characteristic dimension of the seasonal characteristic data, express A real matrix of size , represents a learnable global kernel for global convolution, , represents the features extracted by the global branch, , represents the fast Fourier transform, It represents the fast inverse Fourier transform, and the calculation formula of global convolution is used to finally obtain the features extracted by the global branch.
[0134] S433: Fusing the features extracted by the local branch and the features extracted by the global branch to obtain a seasonal feature vector.
[0135] The local branch extraction features containing seasonal characteristic data of electric load are added to the global branch extraction features containing seasonal characteristic data of electric load, and a Dropout operation is performed to obtain a seasonal characteristic vector containing electric load; the local branch extraction features containing seasonal characteristic data of cooling load are added to the global branch extraction features containing seasonal characteristic data of cooling load, and a Dropout operation is performed to obtain a seasonal characteristic vector containing cooling load; the local branch extraction features containing seasonal characteristic data of heat load are added to the global branch extraction features containing seasonal characteristic data of heat load, and a Dropout operation is performed to obtain a seasonal characteristic vector containing heat load.
[0136] Applying the Dropout module can reduce the risk of overfitting and improve the generalization ability of the model. Through the local branch and the global branch structure, two different feature representations are fused together to enrich the model's ability to express input data. This fusion can capture different features and structures of the sequence at different levels.
[0137] S44: The seasonal characteristic vectors of the electric load, cooling load, and heating load processed in step S43 are processed by three different decoupled linear layers for regression prediction to obtain seasonal prediction values of the electric load, cooling load, and heating load, such as Figure 4 shown.
[0138] Abandoning the traditional decoder structure with multiple attention mechanisms stacked, a simple and efficient channel linear layer module is used to perform regression prediction on the seasonal feature extraction results after processing in step S43. Different from other multi-load prediction methods, this application designs corresponding decoupled linear layer modules for electric load, cooling load and heating load respectively. Such a regression head design can alleviate the interference problem between different loads, so that each linear layer only focuses on a specific load prediction, thereby better fitting the seasonal characteristics of different loads. The existing method only uses a single prediction head module to predict all loads, while the present invention designs a decoupling method to predict separately, which can better improve the model prediction ability. The seasonal feature vector containing the electric load Decoupling linear layers using electrical loads Processing is performed to obtain the seasonal forecast value of electric load , as shown in formula (1); the seasonal characteristic vector containing the cooling load is decoupled using the cooling load linear layer Processing is performed to obtain the seasonal forecast value of cooling load , as shown in formula (2); the seasonal characteristic vector containing the heat load Decoupling Linear Layers Using Heat Load Processing to obtain seasonal forecast value of heat load , as shown in formula (3):
[0139] (1);
[0140] (2);
[0141] (3);
[0142] S45: Perform a second feature extraction operation on the trend feature after the sequence division operation to obtain trend prediction values of electric load, cooling load, and heating load, such as Figure 5 shown.
[0143] The trend feature data spliced in step S42 is processed by the second feature extraction module, such as Figure 4 As shown, the present invention mainly uses a decoupled multi-layer perceptron to predict input data.
[0144] In time series, statistical properties such as mean and variance often change over time, that is, time series data has a distribution shift problem. This change in time distribution is one of the main challenges that hinder accurate time series prediction. This change is the well-known distribution shift problem, which will produce differences between the distribution of training data and test data of the prediction model. In time series prediction tasks, training and test data are usually separated from the original data according to specific time points. Therefore, they are usually difficult to overlap, which is a common reason for the decline in model performance. Reversible instance normalization is a generally applicable normalization and denormalization method with a learnable affine transformation. This method uses a symmetric structure to remove and restore the statistical information of time series instances, effectively alleviating the difference in the distribution of training data and test data, and significantly improving the performance of time series prediction.
[0145] Therefore, the same decoupled multi-layer perceptron is used to input the trend feature data containing the electric load. , including trend characteristic data of cooling load and trend characteristic data including heat load Process them separately to obtain the trend prediction value of electric load , Cooling load trend prediction value and heat load trend prediction value , the multi-layer perceptron adds a reversible instance normalization layer before and after, and the calculation formula is as follows:
[0146] ;
[0147] ;
[0148] ;
[0149] in, represents the reversible instance normalization layer, Represents a multi-layer perceptron.
[0150] The second feature extraction module is used to process the trend feature data spliced in step S52, and uses reversible instance normalization and a multi-layer perceptron (MLP) to extract and predict features of the data.
[0151] S46: The seasonal forecast values of the electric load, the cooling load, and the heating load and the trend forecast values of the electric load, the cooling load, and the heating load are added together to obtain the thermal energy forecast value, the cooling energy forecast value, and the electric energy forecast value.
[0152] Due to the sequence decomposition of step S41, the final thermal energy prediction value, cooling energy prediction value and electric energy prediction value are obtained by adding the seasonal prediction values of electric load, cooling load and heating load and the trend prediction values of electric load, cooling load and heating load respectively. The size of the final prediction result is (3, 24), where 24 represents the load data predicted for the next 24 hours, and 3 represents the three loads of electric load, cooling load and heating load.
[0153] When building the model, use the PyTorch deep learning framework, use the training set to train the model, and update the parameters through back propagation and optimization algorithms.
[0154] S5: Input the validation set data into the trained comprehensive energy load forecasting model and update the comprehensive energy load forecasting model.
[0155] After each training cycle, the model performance is evaluated using the validation set and the prediction results of the final integrated energy load forecasting model to verify the generalization and prediction capabilities of the integrated energy load forecasting model, and the hyperparameters of the integrated energy load forecasting model are adjusted according to the indicators on the validation set, such as the training batch size, learning rate, number of training rounds, etc. By repeating the training and verification process, the optimal parameter configuration is found to obtain the optimal integrated energy load forecasting model.
[0156] S6: Input the test set into the optimal comprehensive energy load forecasting model, output the thermal energy forecast value, cooling energy forecast value and electric energy forecast value of the test set, and output the model evaluation index.
[0157] After selecting the best comprehensive energy load forecasting model, inputting the test set into the best comprehensive energy load forecasting model to obtain the heat energy forecast value, cooling energy forecast value and electric energy forecast value of the test set, and using the heat energy forecast value, cooling energy forecast value and electric energy forecast value of the test set to calculate the model evaluation index of the comprehensive load forecasting model;
[0158] The accuracy and deviation of the comprehensive energy load forecasting model are measured by three evaluation indicators: root mean square error (RMSE), mean absolute error (MAE) and mean absolute percentage error (MAPE); the lower the RMSE, MAE and MAPE values, the better the prediction effect of the model and the closer it is to the actual observed value. The specific calculation formulas for each indicator are as follows:
[0159] ;
[0160] ;
[0161] ;
[0162] in, represents the number of prediction points, represents the true value of the sample, Indicates the predicted value of the sample. In specific implementation, the predicted result and the true value need to be denormalized. The specific formula for denormalization of the normalization operation in the present invention is as follows:
[0163] ;
[0164] in, represents the predicted value after denormalization, represents the normalized predicted value, represents the standard deviation in the historical input data, Represents the mean value in the historical input data.
[0165] By default, a sequence of 96 consecutive input steps is used as input to predict the electric, cooling and heating load data for the next 24 time steps; the model parameters do not need to be adjusted during the prediction.
[0166] Example 3
[0167] This embodiment is further described based on the embodiment 2.
[0168] S1: Preparation of historical data sets, which include the electrical load, cooling load, and heating load of the Tempe campus of Arizona State University from January 1, 2019 to December 31, 2022. Related meteorological data and calendar data are selected from the US Solar Radiation Database.
[0169] S2: Data preprocessing, which includes smoothing of the training set, validation set, and test set, and interpolation of outliers and default values. The smoothing process uses the Savitzky-Golay filter to smooth the trend of the data set and remove special values.
[0170] The updated historical data set with 15 features including power load, cooling load, heating load, temperature, dew point, precipitation, wind direction, wind speed, relative humidity, air pressure, whether it is a weekend, whether it is a holiday, month, day and time is obtained by screening. The historical data set is divided into training set, validation set and test set. The training set time span is from January 1, 2019 to March 9, 2022, the validation set time span is from March 10, 2022 to August 1, 2022, and the test set time span is from August 2, 2022 to December 31, 2022.
[0171] S3: Build a comprehensive load forecasting model based on Transformer. When building the model, use the PyTorch deep learning framework and select appropriate model hyperparameters based on the size of the historical data set and hardware configuration.
[0172] On the test set, the model proposed in this paper and other time series models are compared and the experimental results are Figure 7 , Figure 8 ,like Fig. 9 The comparison models include Informer, AUTOformer, FEDformer and TDformer. Figure 7 This is a comparison chart of electric load prediction. Figure 8 This is a comparison chart of cooling load prediction. Fig. 9 This is a heat load prediction comparison chart.
[0173] It can be found that the model of the present invention is closer to the true value than the other four comparison models, which also confirms that the model proposed by the present invention has better prediction accuracy for regional comprehensive energy load forecasting.
[0174] From the above analysis, it can be seen that the Transformer-based comprehensive energy load forecasting method proposed in this invention fully considers the characteristics of comprehensive energy load data, and provides a series of solutions for the trend, seasonality, long-term dependency and coupling characteristics of different loads of the data, thereby improving the multi-load forecasting accuracy of the regional comprehensive resource system. In addition, the use of regression prediction based on linear methods greatly reduces the model complexity of the Transformer model without affecting the forecasting accuracy, and reduces the training resource overhead.
[0175] Example 4
[0176] This embodiment provides a Transformer-based integrated load forecasting system. The integrated load forecasting system described in this embodiment can execute the integrated load forecasting method described in Embodiment 1 and Embodiment 2, including:
[0177] The prediction module obtains load detection data and meteorological detection data, and inputs them into the pre-trained comprehensive load prediction model to obtain thermal energy prediction values, cooling energy prediction values, and electric energy prediction values;
[0178] The data acquisition module acquires load historical data and meteorological historical data from the historical comprehensive load data set, pre-processes the load historical data to obtain load training data, performs correlation analysis and screening on the load training data and meteorological historical data to obtain meteorological training data; and constructs a training set from the load training data and meteorological training data;
[0179] Model building module, used to build a comprehensive load forecasting model based on the Transformer deep learning model,
[0180] A multi-scale decomposition module, used for performing a multi-scale decomposition operation after the training set is input into the comprehensive load forecasting model to obtain trend characteristics and seasonal characteristics;
[0181] A sequence division module performs sequence division operations on the trend feature and the seasonal feature respectively;
[0182] A first feature extraction module performs a first feature extraction operation on the seasonal features after the sequence division operation to obtain seasonal prediction values of electric load, cooling load, and heating load,
[0183] The second feature extraction module performs a second feature extraction operation on the trend feature after the sequence division operation to obtain the trend prediction values of the electric load, the cooling load, and the heating load; the seasonal prediction values of the electric load, the cooling load, and the heating load and the trend prediction values of the electric load, the cooling load, and the heating load are added respectively, and finally the training prediction result of the training set is obtained.
[0184] The model optimization module calculates the training loss value based on the training prediction result, optimizes the parameters of the comprehensive load prediction model according to the training loss value, and repeatedly iterates the training process of the comprehensive load prediction model to obtain the trained comprehensive load prediction model.
[0185] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0186] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0187] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0189] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.
[0190] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A Transformer-based comprehensive load forecasting method, characterized in that: include: Acquire detection calendar data, load detection data and meteorological detection data, and input them into the pre-trained comprehensive load forecasting model to obtain real-time heat energy forecast value, real-time cooling energy forecast value and real-time electric energy forecast value; The construction process of the comprehensive load forecasting model is as follows: Calendar data, load history data and meteorological history data are obtained from the historical comprehensive load data set, the load history data is preprocessed to obtain load training data, and the load training data is correlated and screened with the meteorological history data and calendar data to obtain meteorological training data and calendar training data; Constructing a training set from calendar training data, load training data and meteorological training data; A comprehensive load forecasting model is constructed based on the Transformer deep learning model, and the training set is input into the comprehensive load forecasting model for multi-scale decomposition operation to obtain trend characteristics and seasonal characteristics; wherein the multi-scale decomposition operation refers to decomposing the training set into trend characteristics and seasonal characteristics, and the scale decomposition includes linear branches and pooling layer branches, and the specific steps are as follows: The linear branching process is to copy the training set three times, and multiply the copied identical training sets by the weight matrix of size (15,15) in the linear layer respectively to obtain the fourth eigenvector, the fifth eigenvector and the sixth eigenvector, and perform data normalization operation on the eigenvectors to obtain the linear layer branching results; The pooling layer branching process is to copy the training set three times, and input the copied same training set into the 1-dimensional average pooling function with pooling windows of 6, 12, and 24 respectively, to obtain the first eigenvector, the second eigenvector, and the third eigenvector of different trend degrees, and obtain the pooling layer branching result; Performing element-wise multiplication of the linear layer branch result and the pooling layer branch result, specifically, multiplying feature vector 1 and feature vector 4 element-wise, feature vector 2 and feature vector 5 element-wise, and feature vector 3 and feature vector 6 element-wise, to obtain three new and different feature vectors, and then performing an addition operation on the three new and different feature vectors to obtain the trend feature; Subtracting the training set from the trend feature to obtain the seasonal feature; The trend characteristics and the seasonal characteristics are respectively subjected to sequence division operations; the seasonal characteristics after the sequence division operation are subjected to a first feature extraction operation to obtain seasonal prediction values of the electric load, the cooling load and the heating load; the trend characteristics after the sequence division operation are subjected to a second feature extraction operation to obtain trend prediction values of the electric load, the cooling load and the heating load; the seasonal prediction values of the electric load, the cooling load and the heating load and the trend prediction values of the electric load, the cooling load and the heating load are respectively added correspondingly to finally obtain the training prediction results of the training set, the training loss value is calculated based on the training prediction results, the parameters of the comprehensive load prediction model are optimized according to the training loss value, and the training process of the comprehensive load prediction model is iterated repeatedly to obtain the trained comprehensive load prediction model.
2. The Transformer-based comprehensive load forecasting method according to claim 1, characterized in that: The load history data is preprocessed to obtain load training data. The process includes: Default value interpolation processing, abnormal value repair processing, smoothing processing of the load historical data and normalization processing of the historical comprehensive load data set; The specific step of the default value interpolation process is to fill in the current default value with the mean of the previous non-default value and the next non-default value data; If the difference between the load data at a certain moment and the average value of the load data on that day exceeds a preset percentage of the average value of the load data on that day, the load data is regarded as an abnormal value; the abnormal value repair process adopts the linear spline interpolation method, and its formula is as follows: ; in, Indicates the current moment, Indicates the load data value to be estimated and repaired for abnormal values at the current moment. Indicates the last moment, Indicates the load data value at the previous moment; Indicates the next moment, Indicates the load data value at the next moment; The smoothing operation is implemented using a Savitzky-Golay filter.
3. The Transformer-based comprehensive load forecasting method according to claim 1, characterized in that: The load training data and meteorological historical data are correlated and screened to obtain meteorological training data. The process includes: The Person correlation coefficients between different variables in the load training data and the meteorological historical data and calendar data are calculated, and the meteorological historical data and calendar data whose Person correlation coefficients are greater than a preset threshold are selected as auxiliary variables to obtain meteorological training data and calendar training data.
4. The Transformer-based comprehensive load forecasting method according to claim 1, characterized in that: The construction process of the comprehensive load forecasting model also includes: Construct validation set and test set from calendar training data, load training data and meteorological training data; After each training cycle, the trained comprehensive load forecasting model is evaluated using the validation set, and the comprehensive load forecasting model is updated to obtain the best comprehensive load forecasting model; The test set is input into the optimal comprehensive load forecasting model, and the thermal energy prediction value, cooling energy prediction value and electric energy prediction value of the test set are output. The thermal energy prediction value, cooling energy prediction value and electric energy prediction value of the test set are used to calculate the evaluation index of the comprehensive load forecasting model.
5. The Transformer-based comprehensive load forecasting method according to claim 4 is characterized in that: The evaluation indicators include root mean square error, mean absolute error and mean absolute percentage error.
6. The Transformer-based comprehensive load forecasting method according to claim 4, characterized in that: Updating the comprehensive load forecasting model refers to adjusting the hyperparameters of the comprehensive load forecasting model according to the evaluation indicators obtained from the verification set, finding the optimal parameter configuration through repeated training and verification processes, and obtaining the best comprehensive load forecasting model.
7. The Transformer-based comprehensive load forecasting method according to claim 4, characterized in that: The specific steps of the sequence division operation are: performing the sequence division operation on the seasonal characteristics to obtain seasonal characteristic data including electric load, seasonal characteristic data including cooling load, and seasonal characteristic data including heating load, wherein the seasonal characteristic data including electric load includes electric load, meteorological data, and calendar data; the seasonal characteristic data including cooling load includes cooling load, meteorological data, and calendar data; the seasonal characteristic data including heating load includes heating load, meteorological data, and calendar data; the sequence division rules of the seasonal characteristics and the trend characteristics are the same, and the trend characteristics are subjected to the sequence division operation to obtain trend characteristic data including electric load, trend characteristic data including cooling load, and trend characteristic data including heating load, respectively.
8. The Transformer-based comprehensive load forecasting method according to claim 7, characterized in that: The seasonal characteristic data including the electric load, the seasonal characteristic data including the cooling load and the seasonal characteristic data including the heating load after the sequence is divided are subjected to the same first feature extraction operation to obtain seasonal prediction values of the electric load, the cooling load and the heating load respectively; The first feature extraction operation includes two parallel structure branches, namely a local branch and a global branch; For the local branch, a linear layer is used to embed the seasonal feature data from the time dimension, so as to obtain a high-dimensional representation of the seasonal feature data at different times, and then the encoded seasonal feature data is subjected to feature extraction through a self-attention mechanism, so as to obtain the features extracted by the local branch. The calculation formula of the self-attention mechanism is: ; in, represents the query matrix, represents the key matrix, represents the value matrix, T represents the transpose, , , The seasonal feature data is input and calculated through three different linear layers to obtain the feature matrix. A characteristic dimension representing the seasonal characteristic data; Represents the calculation of the query matrix With the key matrix The attention weights between them are calculated to obtain the correlation scores between different variables, and finally the correlation scores between them are obtained by adding them to the value matrix Perform weighted summation to finally obtain the output of the self-attention mechanism , i.e., the features extracted by the local branch; For the global branch, a fast Fourier transform is used to implement a convolution operation, thereby performing a global convolution on the long time series. The calculation formula of the global convolution is as follows: ; in, represents the seasonal characteristic data, , Indicates the length of the seasonal characteristic data, represents the characteristic dimension of the seasonal characteristic data, express A real matrix of size , represents the learnable global kernel of the global convolution, , represents the features extracted by the global branch, , represents the fast Fourier transform, represents a fast inverse Fourier transform, and the features extracted by the global branch are finally obtained by using the calculation formula of the global convolution; The local branch extraction features containing seasonal characteristic data of electric load are added to the global branch extraction features containing seasonal characteristic data of electric load, and a Dropout operation is performed to obtain a seasonal characteristic vector containing electric load; the local branch extraction features containing seasonal characteristic data of cooling load are added to the global branch extraction features containing seasonal characteristic data of cooling load, and a Dropout operation is performed to obtain a seasonal characteristic vector containing cooling load; the local branch extraction features containing seasonal characteristic data of heating load are added to the global branch extraction features containing seasonal characteristic data of heating load, and a Dropout operation is performed to obtain a seasonal characteristic vector containing heating load; The seasonal characteristic vector containing the electric load Decoupling linear layers using electrical loads Processing is performed to obtain the seasonal forecast value of electric load , as shown in formula (1); the seasonal characteristic vector containing the cooling load is decoupled using the cooling load linear layer Processing is performed to obtain the seasonal forecast value of cooling load , as shown in formula (2); the seasonal characteristic vector containing the heat load Decoupling Linear Layers Using Heat Load Processing to obtain seasonal forecast value of heat load , as shown in formula (3): (1); (2); (3)。 9. The Transformer-based comprehensive load forecasting method according to claim 7, characterized in that: The specific steps of the second feature extraction operation are: using the same decoupled multi-layer perceptron to extract the trend feature data of the input electric load , including trend characteristic data of cooling load and trend characteristic data including heat load Process them separately to obtain the trend prediction value of electric load , Cooling load trend prediction value and heat load trend prediction value , the multi-layer perceptron adds a reversible instance normalization layer before and after, and the calculation formula is as follows: ; ; ; in, represents the reversible instance normalization layer, Represents a multilayer perceptron.
10. A Transformer-based integrated load forecasting system, characterized in that: include: The prediction module obtains load detection data and meteorological detection data, and inputs them into the pre-trained comprehensive load prediction model to obtain thermal energy prediction values, cooling energy prediction values, and electric energy prediction values; The data acquisition module acquires load historical data and meteorological historical data from the historical comprehensive load data set, pre-processes the load historical data to obtain load training data, and performs correlation analysis and screening on the load training data and meteorological historical data to obtain meteorological training data; Constructing a training set from load training data and meteorological training data; Model building module, used to build a comprehensive load forecasting model based on the Transformer deep learning model, A multi-scale decomposition module, used for performing a multi-scale decomposition operation after the training set is input into the comprehensive load forecasting model to obtain trend characteristics and seasonal characteristics; A sequence division module performs sequence division operations on the trend feature and the seasonal feature respectively; A first feature extraction module performs a first feature extraction operation on the seasonal features after the sequence division operation to obtain seasonal prediction values of electric load, cooling load, and heating load, A second feature extraction module performs a second feature extraction operation on the trend feature after the sequence division operation to obtain trend prediction values of electric load, cooling load, and heating load; The seasonal prediction values of the electric load, cooling load and heating load and the trend prediction values of the electric load, cooling load and heating load are added together respectively, and finally the training prediction result of the training set is obtained. A model optimization module calculates a training loss value based on the training prediction result, optimizes the parameters of the comprehensive load forecasting model according to the training loss value, and repeatedly iterates the training process of the comprehensive load forecasting model to obtain the trained comprehensive load forecasting model; The multi-scale decomposition operation performed by the multi-scale decomposition module refers to: decomposing the training set into trend features and seasonal features, and the scale decomposition includes a linear branch and a pooling layer branch. The specific steps are as follows: The linear branching process is to copy the training set three times, and multiply the copied identical training sets by the weight matrix of size (15,15) in the linear layer respectively to obtain the fourth eigenvector, the fifth eigenvector and the sixth eigenvector, and perform data normalization operation on the eigenvectors to obtain the linear layer branching results; The pooling layer branching process is to copy the training set three times, and input the copied same training set into the 1-dimensional average pooling function with pooling windows of 6, 12, and 24 respectively, to obtain the first eigenvector, the second eigenvector, and the third eigenvector of different trend degrees, and obtain the pooling layer branching result; Performing element-wise multiplication of the linear layer branch result and the pooling layer branch result, specifically, multiplying feature vector 1 and feature vector 4 element-wise, feature vector 2 and feature vector 5 element-wise, and feature vector 3 and feature vector 6 element-wise, to obtain three new and different feature vectors, and then performing an addition operation on the three new and different feature vectors to obtain the trend feature; The training set is subtracted from the trend feature to obtain the seasonal feature.
