Method for establishing short-term building cold load prediction model based on transformer model, prediction method and computer equipment

CN115391875BActive Publication Date: 2026-05-29HARBIN UNIV OF SCI & TECH +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HARBIN UNIV OF SCI & TECH
Filing Date
2022-07-28
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing methods for predicting building cooling load suffer from low accuracy. In particular, white-box models require too many assumptions and detailed data input, gray-box models lack sufficient prediction accuracy in modern buildings, and black-box data-driven models lack the ability to perform feature analysis and capture time series information.

Method used

A short-term building cooling load prediction method based on the Transformer model is adopted. By selecting linearly independent weather and time feature variables, a sequence input dataset is generated. Data processing is performed using encoder and decoder blocks, and prediction is performed by combining a multi-head attention mechanism and a neural network.

Benefits of technology

It improves prediction accuracy and precision, resulting in better and smoother predictions, with uncertainty controlled within ±10%, significantly enhancing model performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115391875B_ABST
    Figure CN115391875B_ABST
Patent Text Reader

Abstract

The application discloses a method for establishing a short-term building cold load prediction model based on a Transformer model, a prediction method and computer equipment, belongs to the technical field of building cold load prediction, and solves the problem of low prediction accuracy of existing building cold load prediction. The method comprises the following steps: selecting feature variables required for building cold load prediction, wherein the feature variables comprise weather feature variables and time feature variables; obtaining linear correlation of each two feature variables, and selecting feature variables linearly independent with each other as input data of a prediction model; establishing a data set with a sequence information mode according to the input data of the prediction model, and generating a sequence input data set according to the data set with the sequence information mode; dividing the sequence input data set into training data and test data, training a model based on a Transformer network; and obtaining the short-term building cold load prediction model based on the Transformer model according to the model based on the Transformer network after training. The application is suitable for predicting short-term building cold load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of building cooling load prediction technology, and in particular to a method for establishing a short-term building cooling load prediction model based on the Transformer model, a prediction method, and a computer device. Background Technology

[0002] Rapid global economic and population growth is increasing global primary energy consumption, with the building sector accounting for over 33% of all energy consumption. Buildings contain various service systems, with HVAC systems contributing the largest proportion of total building energy consumption. Furthermore, a significant portion of HVAC systems contain energy-inefficient components. Therefore, accurately predicting building cooling loads is crucial for improving HVAC system efficiency and reducing overall energy consumption. Existing methods for predicting building cooling loads include three types: physics-based white-box models, gray-box reduced-order models, and black-box data-driven models.

[0003] For white-box models, the first step is to establish an accurate physical model of the building, including its geometry, thermal characteristics, and the activities of people inside. Secondly, relevant weather data is needed for load forecasting, and the model must be validated using past actual load data to ensure its accuracy. While commercially available mature software tools exist for users to build these models, this approach still has some drawbacks: First, it requires too many assumptions to calculate heat load using the heat and mass transfer equations, making it overly complex and difficult to use; second, the model requires excessive detailed input data, which is time-consuming and labor-intensive; and finally, inputting inaccurate data into the model can lead to significant discrepancies between simulation and actual results, resulting in poor prediction performance.

[0004] The gray-box reduced-order model predicts heat flow in building walls by simplifying the wall structure and its thermal resistance and capacitance (RC). Existing RC models can significantly reduce the required input information and computation time without compromising computational accuracy, and can predict building load and indoor heat gain relatively accurately. However, in modern buildings, the proportion of internal heat gain is gradually increasing, and the accuracy of prediction cannot be guaranteed by using this model.

[0005] Black-box data-driven models are pure data-driven models based on shallow machine learning and deep learning algorithms. Compared to white-box and gray-box reduced-order models, black-box data-driven models only require recording sufficient historical data and do not need much building information to predict building loads. Current research on black-box data-driven models has two shortcomings: First, except for Long Short-Term Memory (LSTM) algorithms, none are specifically designed for extracting time-series data and cannot capture and retain sequence information. While LSTM algorithms can extract time-series data, the captured sequence information becomes irrelevant as the prediction time increases, leading to worse prediction results. Second, due to limitations in data recording, current research on black-box data-driven models lacks research on feature analysis (especially the analysis of solar radiation intensity, wind speed, and time-related variables). Summary of the Invention

[0006] The purpose of this invention is to solve the problem of low accuracy in existing building cooling load prediction, and to provide a method for establishing a short-term building cooling load prediction model based on the Transformer model, a prediction method, and computer equipment.

[0007] This invention is achieved through the following technical solution: In one aspect, this invention provides a method for establishing a short-term building cooling load prediction model based on the Transformer model, the method comprising:

[0008] Step 1: Based on historical data of building cooling load, select the characteristic variables required for building cooling load prediction. The characteristic variables include weather characteristic variables and time characteristic variables.

[0009] Step 2: Use the Pearson correlation coefficient to obtain the linear correlation between each pair of feature variables, and select mutually linearly independent feature variables as input data for the prediction model based on the linear correlation.

[0010] Step 3: Based on the input data of the prediction model, establish a dataset with sequence information patterns, and generate a sequence input dataset based on the dataset with sequence information patterns;

[0011] Step 4: Divide the sequence input dataset into training data and test data, and train the model based on the Transformer network;

[0012] Step 5: Based on the trained Transformer network-based model, obtain a short-term building cooling load prediction model based on the Transformer model.

[0013] Further, step 1 specifically includes:

[0014] Based on the historical data, create two-dimensional curves of weather data and building cooling load for different time periods to obtain the weather characteristic variables;

[0015] Create a two-dimensional curve of building load versus time to obtain the time characteristic variable.

[0016] Furthermore, after step 5, the method further includes:

[0017] Step 6: Select the mean absolute error, root mean square error, and coefficient of determination as indicators to evaluate the short-term building cooling load prediction model. Perform performance analysis on the model when different features are input. Based on the performance analysis results, sort the importance of the feature variables from largest to smallest.

[0018] The number of input features is determined based on the predicted building cooling load and the corresponding uncertainties under different numbers of input features;

[0019] Based on the number of input features, the features with the highest importance among the input features are selected as the input data for the prediction model.

[0020] Further, in step 3, a dataset with sequence information patterns is established based on the input data of the prediction model, specifically including:

[0021] Historical data corresponding to the input data of the prediction model within 24 hours before the prediction time point are selected, and the historical data are selected at preset time intervals. The selected historical data are sorted in chronological order, and a dataset with sequence information pattern is established based on the sorted historical data.

[0022] Furthermore, the Transformer network-based model includes: an encoder block and a decoder block; wherein,

[0023] The encoded input data passes through the input embedding layer, and then the sine and cosine functions are used to perform position encoding on the sequence information in the time series data to obtain the position encoding vector of the encoded input data.

[0024] Import the position encoding vector into the encoder block to generate a d that provides data for the decoder block. model The processing method for the encoded output data is the same as that for the encoded input data, resulting in a position encoded vector for the encoded output data. The decoder block then compares this position encoded vector with the d-dimensional vector generated by the encoder block. model The dimensional vectors together generate a vector containing probability information to calculate the output. After the decoder block is fully executed, the output probability is calculated through the linearization layer and the Softmax function layer. The result with the highest probability value is the final result.

[0025] Two artificial neural network layers are added after the Softmax function layer to convert the probability values ​​into the model's decoded output to predict the building's cooling load.

[0026] Furthermore, the encoder block has two identical encoder layers, each containing four cascaded sectors;

[0027] The first sector employs a multi-head attention mechanism to generate three vectors, which are attention values.

[0028] The second sector is for normalization, which normalizes the attention values;

[0029] The third sector is a feedforward neural network used to obtain the data used in the decoder block based on the normalized attention value;

[0030] The fourth sector is for normalization, which normalizes the data used in the decoder block to generate d, which provides data for the decoder block. model Dimensional vector.

[0031] Furthermore, the weather characteristic variables include dry-bulb temperature, relative humidity, direct normal irradiance, and wind speed;

[0032] The time-related variables include month, day, and hour.

[0033] Secondly, the present invention provides a short-term building cooling load prediction method based on the Transformer model, the method comprising:

[0034] Based on the input data of the prediction model, a sequence input dataset is generated;

[0035] The sequence input dataset is input into the short-term building cooling load prediction model based on the Transformer model to obtain the building cooling load prediction value.

[0036] Thirdly, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, it executes a short-term building cooling load prediction method based on the Transformer model as described above.

[0037] The fourth invention provides a computer-readable storage medium storing a plurality of computer instructions for causing a computer to execute a short-term building cooling load prediction method based on a Transformer model as described above.

[0038] The beneficial effects of this invention are:

[0039] First, this invention proposes a method for establishing a short-term building cooling load prediction model based on the Transformer model. The method uses a dataset with a sequence information pattern to generate a sequence input dataset. This method can obtain and retain information from long-term time series data. Compared with other models, the method proposed in this invention has better overall performance in terms of accuracy and precision, and the prediction results are better and smoother, with uncertainty kept within ±10%.

[0040] Secondly, the method of this invention can also analyze features and rank their importance, and incorporate time-related feature variables for prediction, which plays a key role in improving the model's prediction accuracy and can significantly improve the model's performance, thereby accurately predicting building loads.

[0041] This invention is applicable to the prediction of short-term building cooling loads. Attached Figure Description

[0042] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a flowchart illustrating the process of establishing a short-term building cooling load prediction model based on the Transformer model in this invention, using a sequence input dataset.

[0044] Figure 2 This is a schematic diagram of the Transformer model of the present invention;

[0045] Figure 3 This is a schematic diagram of the encoder layer and decoder layer of the present invention;

[0046] Figure 4 This is a flowchart illustrating the method for establishing a short-term building cooling load prediction model based on the Transformer model according to the present invention.

[0047] Figure 5The graph shows the two-dimensional curves of weather data and building cooling load for different time periods in this invention (in the graph, the five curves from top to bottom are curve 1, curve 2, curve 3, curve 4 and curve 5, where the vertical axis of curve 1 is drybulb temperature, the vertical axis of curve 2 is relative humidity, the vertical axis of curve 3 is direct normal irradiance, the vertical axis of curve 4 is windvelocity, and the vertical axis of curve 5 is building cooling load, and the horizontal axis of the above five curves is time).

[0048] Figure 6 This is a two-dimensional curve of the building cooling load in hourly units according to the present invention (in the figure, the vertical axis is the cooling load, the horizontal axis is time, the unit is hours, and the curve above the figure represents the day).

[0049] Figure 7 The correlation coefficient between the input features of this invention;

[0050] Figure 8 The figure shows a comparison of historical data and prediction results of building cooling load and an uncertainty curve (in the figure, the vertical axis from top to bottom represents the building cooling load result and uncertainty, the top of the figure shows Results from historical recorded data and Results from TRN based model, and the horizontal axis represents the test time).

[0051] Figure 9 The curves for predicting building cooling load and uncertainty under different input features of the present invention are shown in the figure (the vertical axis from top to bottom represents the building cooling load result and uncertainty, the top of the figure shows Results from historical recorded data, Results from TRN based model corresponding to different input features, and the horizontal axis represents the test time). Detailed Implementation

[0052] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0053] Implementation Method 1: A method for establishing a short-term building cooling load prediction model based on the Transformer model, the method comprising:

[0054] Step 1: Based on historical data of building cooling load, select the characteristic variables required for building cooling load prediction. The characteristic variables include weather characteristic variables and time characteristic variables.

[0055] Step 2: Use the Pearson correlation coefficient to obtain the linear correlation between each pair of feature variables, and select mutually linearly independent feature variables as input data for the prediction model based on the linear correlation.

[0056] It should be noted that in step 2, the Pearson correlation coefficient (ρ) is used. X,Y The linear correlation between each pair of feature variables is calculated and evaluated. When variables are perfectly positively or negatively correlated in the input dataset, the model is likely to exhibit multicollinearity, causing one or more variables in the multiple regression model to be predicted with high accuracy from other variables, leading to biased predictions. ρ X,Y The calculation formula is shown in formula (1):

[0057]

[0058] Where COV(X,Y) is the covariance of X and Y, σ X and σ Y It is the deviation between X and Y, μ x and μ y It is the average of X and Y.

[0059] When reducing relevant input variables, ρ X,Y The most commonly used range of variation is ±0.6, and this range can be used to determine the linear correlation between input features: when ρ X,Y When the range of variation is between ±0.6, the two variables are linearly independent of each other.

[0060] Step 3: Based on the input data of the prediction model, establish a dataset with sequence information patterns, and generate a sequence input dataset based on the dataset with sequence information patterns;

[0061] Step 4: Divide the sequence input dataset into training data and test data, and train the model based on the Transformer network;

[0062] It should be noted that in step 4, 80% of the sequence input dataset can be used as training data and the remaining 20% ​​as test data, which can be imported into the Transformer network-based model for algorithm training.

[0063] Step 5: Based on the trained Transformer network-based model, obtain a short-term building cooling load prediction model based on the Transformer model.

[0064] In this embodiment, firstly, time-related features are added to improve prediction accuracy;

[0065] Secondly, linearly independent features are selected as the input data for the model, and then a sequence input dataset is generated using a dataset with sequence information patterns. This allows information to be extracted and retained from long-term time series data. Compared with other models, the method proposed in this invention outperforms other methods in terms of overall accuracy and precision, producing better and smoother prediction results, with uncertainty kept within ±10%.

[0066] Implementation Method Two: This implementation method further defines the method for establishing a short-term building cooling load prediction model based on the Transformer model described in Implementation Method One. In this implementation method, step 1 is further defined, specifically including:

[0067] Based on the original data, create two-dimensional curves of weather data and building cooling load for different time periods, and analyze the weather-related features that the dataset should contain;

[0068] Create a two-dimensional graph of building load versus time, and analyze the characteristics to determine if they include time-related variables.

[0069] It should be noted that, according to the literature review, building cooling load is greatly affected by two factors: building occupancy and outdoor conditions. Outdoor conditions can be well described by outdoor dry-bulb temperature (Tdb), outdoor relative humidity (RH), wind speed (Vwin), and direct normal irradiance (DNI).

[0070] from Figure 5 As can be seen, all parameters change continuously over time, and all of these parameters can be used as feature inputs.

[0071] from Figure 6 To determine whether the scale of cooling load differs across different time units, three points can be summarized:

[0072] Firstly, the cooling load varies from month to month. For example, in October 2015, the load was 0-2.2kW, in November it was 0-2.8kW, and in December it was 0-4.1kW; in January 2016 it was 0-4.3kW, in February it was 0-3.2kW, and in March it was 0-2.1kW.

[0073] Secondly, the cooling load changes daily each month. For example, in October 2015, the cooling load changed from 0 kW to 2 kW on the 28th day, from 0 kW to 1.5 kW on the 25th day, and was 0 kW or changed from 0 kW to <1 kW on the other days.

[0074] Finally, for most of the days recorded, the cooling load initially increased from approximately 8:00 AM to 3:00 PM, and then decreased after 4:00 PM. Therefore, the temporal characteristics analyzed should include MOY, DOM, and HOD.

[0075] In this embodiment, two-dimensional curves of weather data and building cooling load for different time periods are created based on the original data, and the analysis reveals that the dataset should contain weather-related features. Then, a two-dimensional curve of building load versus time is created, and the analysis reveals that the features should include time-related variables. Time-related features are extracted from the original weather dataset and combined with the weather-related features to form a new dataset containing time-related features reflecting internal heat gain, thereby improving the accuracy of building cooling load prediction.

[0076] Implementation Method 3 further defines the method for establishing a short-term building cooling load prediction model based on the Transformer model described in Implementation Method 1. In this implementation method, the operations after step 5 are further defined, such as... Figure 4 As shown, it specifically includes:

[0077] After step 5, the following is also included:

[0078] Step 6: Select the mean absolute error, root mean square error, and coefficient of determination as indicators to evaluate the short-term building cooling load prediction model. Perform performance analysis on the model when different features are input. Based on the performance analysis results, sort the importance of the feature variables from largest to smallest.

[0079] The number of input features is determined based on the predicted building cooling load and the corresponding uncertainties under different numbers of input features;

[0080] Based on the number of input features, the features with the highest importance among the input features are selected as the input data for the prediction model.

[0081] It should be noted that in this embodiment, the mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²) can be selected. 2These three indicators are used as evaluation metrics to analyze the model's performance under different input features. The normal range for these three indicators is 0 to +∞. The smaller the value, the smaller the error between the actual and predicted values, and the better the model's prediction performance. The calculation formulas for these three indicators are shown in formulas (7), (8), and (9), respectively.

[0082]

[0083]

[0084]

[0085] Where i is the i-th observed or predicted value, n is the total number of values, and y is the observed value. is the predicted value; COV(·) is the covariance function between the observed value and the predicted value, and Var(·) is the variance function.

[0086] To eliminate the impact of data volume on feature analysis, we used 50%, 75%, and 100% of the input data to analyze the prediction results of the Transformer network-based model with different numbers of input features. We also ranked the features by importance and analyzed the model accuracy and result error when using different input features.

[0087] In this embodiment, the features used for prediction were analyzed. Feature analysis plays a crucial role in determining the model's prediction accuracy. Using too few features in the model leads to underfitting, while using too many features leads to overfitting. Therefore, there is an optimal number or range for the number of input features to select, ensuring good model performance and low uncertainty. Selecting more important input features can significantly improve model performance.

[0088] The ability to analyze features and rank their importance plays a crucial role in improving the accuracy of model predictions, significantly enhancing model performance and thus enabling accurate prediction of building loads.

[0089] Implementation Method Four: This implementation method further defines the method for establishing a short-term building cooling load prediction model based on the Transformer model described in Implementation Method One. In this implementation method, the step of establishing a dataset with sequence information patterns based on the input data of the prediction model is further defined, specifically including:

[0090] Historical data corresponding to the input data of the prediction model within 24 hours before the prediction time point are selected, and the historical data are selected at preset time intervals. The selected historical data are sorted in chronological order, and a dataset with sequence information pattern is established based on the sorted historical data.

[0091] For example, given the seasonal nature of building loads, using measurement data from the previous 24 hours is expected to improve prediction accuracy. Therefore, the input variables from the previous 24 hours are concatenated into sequential input data to predict the building cooling load for the 25th hour. The final sequential input dataset scheme is as follows... Figure 1 As shown. The sequence input data Xn-i is the vector of [Tdb,RH,DNI,Vwin,MOY,DOM,HOD] at hour ni, and the output data Yn is Qc at hour n. That is, Qc of hour 25 is predicted using historical data from every 24 hours. The first time, hour 25 is predicted using data from hours 1 to 24, the second time, hour 26 is predicted using data from hours 2 to 25, and so on.

[0092] Implementation Method Five: This implementation method further defines the method for establishing a short-term building cooling load prediction model based on a Transformer model as described in Implementation Method One. In this implementation method, the Transformer network-based model is further defined, specifically including:

[0093] The Transformer-based model includes: an encoder block and a decoder block; wherein,

[0094] The encoded input data passes through the input embedding layer, and then the sine and cosine functions are used to perform position encoding on the sequence information in the time series data to obtain the position encoding vector of the encoded input data.

[0095] Import the position encoding vector into the encoder block to generate a d that provides data for the decoder block. model A dimensional vector; the processing method for encoded output data is the same as that for encoded input data, obtaining the position encoded vector of the encoded output data, and comparing it with the d-dimensional vector generated by the encoder block. model The dimensional vectors together generate a vector containing probability information to calculate the output. After the decoder block is fully executed, the output probability is calculated through the linearization layer and the "Softmax function" layer. The result with the highest probability value is the final result.

[0096] Two artificial neural network layers (ANN) are added after the Softmax function layer to convert the probability values ​​into the model's decoded output to predict the building's cooling load.

[0097] It should be noted that the Transformer network-based model proposed in this implementation is an extension of the Transformer algorithm by Vaswani et al. The architecture of the Transformer model is as follows: Figure 2 As shown,

[0098] It mainly consists of two modules: an encoder block and a decoder block.

[0099] First, the encoded input data passes through the input embedding layer, and then the sequence information in the time series data is positionally encoded using sine and cosine functions to obtain the position encoding vector of the encoded input data. The position encoding equation is shown in formula (2):

[0100]

[0101] in, It is the result of position encoding. It is a vector corresponding to the position, where i is the position of the input variable, and d is the position of the input variable. model It refers to the dimension of the input data.

[0102] Then the position encoding vector is imported into the encoder block to generate a d that provides data for the decoder block. model A dimensional vector; the processing method for encoded output data is the same as that for encoded input data, obtaining the position encoded vector of the encoded output data, and comparing it with the d-dimensional vector generated by the encoder block. model The dimensional vectors together generate a vector containing probability information to calculate the output. After the decoder block has been fully executed, the output probability is calculated through the linearization layer and the "Softmax function" layer. The result with the highest probability value is the final result. The calculation formula of the Softmax function is shown in formula (3):

[0103]

[0104] Where, d k The correction parameters are used to adjust the attention value within a certain range.

[0105] Finally, two artificial neural network (ANN) layers are added after the Softmax function layer to convert the probability values ​​into the model's decoded output to predict the building's cooling load. In this embodiment, the model used can improve prediction accuracy.

[0106] Implementation method six is ​​a further limitation on the method for establishing a short-term building cooling load prediction model based on the Transformer model described in implementation method five. In this implementation method, the encoder block is further defined, specifically including:

[0107] The encoder block has two identical encoder layers, each with four cascaded sectors;

[0108] The first sector employs a multi-head attention mechanism to generate three vectors, which are attention values.

[0109] The second sector is for normalization, which normalizes the attention values;

[0110] The third sector is a feedforward neural network used to obtain the data used in the decoder block based on the normalized attention value;

[0111] The fourth sector is for normalization, which normalizes the data used in the decoder block to generate d, which provides data for the decoder block. model Dimensional vector.

[0112] It should be noted that the encoder block contains two identical encoder layers, each with four cascaded sectors. The first sector employs a multi-head attention mechanism to generate three important vectors (Query, Key, and Value vectors), which are the attention values. The formulas for the three vectors are shown in equations (4), (5), and (6), respectively:

[0113]

[0114]

[0115]

[0116] Where ζ, λ, and ω are the Query, Key, and Value vectors, respectively. and These are the matrices used to calculate the Query, Key, and Value vectors, respectively. i It is an input variable.

[0117] The second sector is for normalization, which normalizes the attention values ​​to ensure model stability. The third sector is a feedforward neural network used to compute the data used in the decoder block. The fourth sector is for further normalization to ensure robustness. After processing by the encoder block, the data is input into the decoder block. The decoder block has two identical decoder layers, each with six cascaded sectors, four of which are identical to those in the encoder layer. In addition to the identical sectors, the decoder layer also has encoder-decoder attention sectors and normalization sectors, used to apply the vectors from the encoder block to the decoder block to generate attention between the data in the encoder and decoder blocks.

[0118] The encoder layer and decoder layer are composed as follows: Figure 3 As shown.

[0119] Implementation method seven is a further limitation on the method for establishing a short-term building cooling load prediction model based on the Transformer model described in implementation method one. In this implementation method, the weather characteristic variables and the time characteristic variables are further defined, specifically including:

[0120] The weather characteristic variables include dry-bulb temperature, relative humidity, direct normal irradiance, and wind speed;

[0121] The time-related variables include month, day, and hour.

[0122] The characteristic variables in this embodiment are the main influencing factors for short-term building cooling load forecasting. By using these characteristic variables to forecast short-term building cooling load, the forecasting accuracy can be improved.

[0123] Implementation method eight is a specific embodiment of a prediction method based on a short-term building cooling load prediction model using the Transformer model as described above. Specifically:

[0124] This embodiment takes an office building as the research object and uses the short-term building cooling load prediction model based on the Transformer model and the actual operation data of the office building to predict the building cooling load.

[0125] The parameters required to predict the cooling load of office buildings include: weather data including dry-bulb temperature (T). db ), relative humidity (RH), direct normal irradiance (DNI), and wind speed (V) win The total building cooling load (Q) provided by the building cooling system. c The above data was recorded from October 1, 2015 to March 30, 2016, from 8:00 AM to 5:00 PM, with an hourly interval.

[0126] First, create two-dimensional curves showing the relationship between weather data and building cooling load for different time periods, such as... Figure 5 As shown, the building cooling load at different time periods is closely related to the current weather data. Therefore, it can be concluded that the model characteristics should include all weather-related variables (T...). db RH, DNI, V win ).

[0127] Create a two-dimensional graph of the building's cooling load in hourly units, such as... Figure 6 As shown, the building cooling load is closely related to three time parameters: different months of the year (MOY), different days of the month (DOM), and different hours of the day (HOD). Therefore, the model features should include these time-related variables (MOY, DOM, HOD). These time-related features are extracted from the original dataset and combined with weather features from the original weather data to form a new dataset containing time-related variables reflecting internal heat gain.

[0128] Secondly, use the Pearson correlation coefficient (ρ) X,Y) Calculate and evaluate the linear correlation between each pair of variables, and obtain the correlation coefficient between the input features. The results are as follows: Figure 7 As shown, ρ X,Y The variation range is -0.51 (DNI and RH) to +0.4 (T). db The variation range is between ±0.6 (compared to HOD). This result indicates that the linear correlation among all features is poor, suggesting that the weather features and time-related features of the input are linearly independent of each other. Therefore, all inputs can be used to train the model.

[0129] Linearly independent features are taken as input data for the model. Then, a sequential input dataset is generated using a dataset with a sequence information pattern. The input variables of the first 24 hours are concatenated into sequential input data, which is used to train the algorithm to predict the building cooling load in the 25th hour.

[0130] Next, 80% of the sequence input dataset was used as training data, and the remaining 20% ​​as test data. This data was then imported into a Transformer-based model for algorithm training, outputting predicted building cooling loads. Comparing the predicted building cooling loads with historical data shows that the uncertainty of the prediction results remains within ±10%, indicating that the model's predictions are good and smooth. Figure 8 As shown.

[0131] Finally, use MAE, RMSE, and R 2 The model performance was analyzed under different input features. Tables 1 to 3 show the feature analysis results using 50%, 75%, and 100% of the input data, with different numbers of input features. w =V win .

[0132] Table 1 shows the feature analysis using 100% input data at different numbers of input features.

[0133]

[0134] Table 2 shows the feature analysis using 75% of the input data at different numbers of input features.

[0135]

[0136] Table 3 shows the feature analysis using 50% of the input data at different numbers of input features.

[0137]

[0138] The results show that the amount of input data has almost no impact on feature analysis, T db T represents the most important feature when only one feature is input.db HOD and RH are the two most important features when there are only two input features. When there are three or four input features, RH and DNI are the third and fourth most important features, respectively. DOM, MOY, and V are the next most important features. win The impact on the performance of Transformer-based models is minimal. Therefore, the importance of the input features is ranked as follows: T db HOD, RH, DNI.

[0139] Figure 9 The graphs show the predicted building cooling load and uncertainty curves for different numbers of input features. As the number of input features increases, the model's performance does not significantly improve, but the uncertainty decreases significantly: -50% to +31% (one input feature), -26% to +15% (two input features), -21% to +14% (three input features), and -15% to +16% (four input features). These results indicate that Transformer-based models require at least four input features to achieve good performance and low uncertainty.

[0140] In summary, to fill the gaps in research on extracting sequence information and analyzing weather characteristics, this invention proposes a building cooling load prediction model based on Transformer Network (TRN). This model can extract and retain sequence information from long-term time series data, complete short-term building cooling load prediction, and perform feature analysis and importance ranking of features based on this model.

Claims

1. A method for establishing a short-term building cooling load prediction model based on the Transformer model, characterized in that, The method includes: Step 1: Based on historical data of building cooling load, select the characteristic variables required for building cooling load prediction. The characteristic variables include weather characteristic variables and time characteristic variables. Step 2: Use the Pearson correlation coefficient to obtain the linear correlation between each pair of feature variables, and select mutually linearly independent feature variables as input data for the prediction model based on the linear correlation. Step 3: Based on the input data of the prediction model, establish a dataset with sequence information patterns, and generate a sequence input dataset based on the dataset with sequence information patterns; Step 4: Divide the sequence input dataset into training data and test data, and train the model based on the Transformer network; Step 5: Based on the trained Transformer network-based model, obtain a short-term building cooling load prediction model based on the Transformer model. After step 5, the following is also included: Step 6: Select the mean absolute error, root mean square error, and coefficient of determination as indicators to evaluate the short-term building cooling load prediction model. Perform performance analysis on the model when different features are input. Based on the performance analysis results, sort the importance of the feature variables from largest to smallest. The number of input features is determined based on the predicted building cooling load and the corresponding uncertainties under different numbers of input features; Based on the number of input features, the feature with the highest importance among the input features is selected as the input data for the prediction model; The Transformer-based model includes: an encoder block and a decoder block; wherein, The encoded input data passes through the input embedding layer, and then the sine and cosine functions are used to perform position encoding on the sequence information in the time series data to obtain the position encoding vector of the encoded input data. Import the position encoding vector into the encoder block to generate a data source for the decoder block. The processing method for the encoded output data is the same as that for the encoded input data, resulting in a position encoded vector for the encoded output data. The decoder block then compares this position encoded vector with the vector generated by the encoder block. The dimensional vectors together generate a vector containing probability information to calculate the output. After the decoder block is fully executed, the output probability is calculated through the linearization layer and the Softmax function layer. The result with the highest probability value is the final result. Two artificial neural network layers are added after the Softmax function layer to convert the probability values ​​into the model's decoded output to predict the building's cooling load.

2. The method for establishing a short-term building cooling load prediction model based on the Transformer model according to claim 1, characterized in that, Step 1 specifically includes: Based on the historical data, create two-dimensional curves of weather data and building cooling load for different time periods to obtain the weather characteristic variables; Create a two-dimensional curve of building load versus time to obtain the time characteristic variable.

3. The method for establishing a short-term building cooling load prediction model based on the Transformer model according to claim 1, characterized in that, In step 3, a dataset with sequence information patterns is established based on the input data of the prediction model, specifically including: Historical data corresponding to the input data of the prediction model within 24 hours before the prediction time point are selected, and the historical data are selected at preset time intervals. The selected historical data are sorted in chronological order, and a dataset with sequence information pattern is established based on the sorted historical data.

4. The method for establishing a short-term building cooling load prediction model based on the Transformer model according to claim 1, characterized in that, The encoder block has two identical encoder layers, each with four cascaded sectors; The first sector employs a multi-head attention mechanism to generate three vectors, which are attention values. The second sector is for normalization, which normalizes the attention values; The third sector is a feedforward neural network used to obtain the data used in the decoder block based on the normalized attention value; The fourth sector is for normalization, which normalizes the data used in the decoder block to generate data that provides the decoder block. Dimensional vector.

5. The method for establishing a short-term building cooling load prediction model based on the Transformer model according to claim 1, characterized in that, The weather characteristic variables include dry-bulb temperature, relative humidity, direct normal irradiance, and wind speed; The time-related variables include month, day, and hour.

6. A method for predicting short-term building cooling load based on the Transformer model of claim 1, characterized in that, The method includes: Based on the input data of the prediction model, a sequence input dataset is generated; The sequence input dataset is input into the short-term building cooling load prediction model based on the Transformer model to obtain the building cooling load prediction value.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, The method of claim 6 is performed when the processor runs the computer program stored in the memory.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of computer instructions, which are used to cause a computer to perform the method of claim 6.