Building cooling load prediction method based on physical simulation and hybrid neural network
By combining physical simulation with hybrid neural networks and utilizing GRU and Transformer models, the accuracy and adaptability issues of building cooling load forecasting are solved, achieving high-precision load forecasting and energy consumption optimization, which is suitable for building energy management and grid interaction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NO 1 CONSTR ENG CO LTD OF CHINA CONSTR THIRD ENG BUREAU CO LTD
- Filing Date
- 2025-10-30
- Publication Date
- 2026-07-24
Smart Images

Figure CN121435718B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of building physical characteristics simulation technology, specifically to a building cooling load prediction method based on physical simulation and hybrid neural networks. Background Technology
[0002] Building cooling load forecasting is the technological cornerstone of intelligent building energy management, possessing irreplaceable value for energy efficiency optimization control, grid interaction and coordination, and operation and maintenance decision support. As the core input benchmark for Model Predictive Control (MPC), accurate forecasting of building cooling load can optimize HVAC system operation strategies in advance through MPC, driving energy consumption reduction. At the grid interaction level, this technology supports the deep participation of electricity market participants in demand response (DR) and dynamic pricing mechanisms. By guiding HVAC system peak-shifting adjustments through load forecasting, it reduces peak-hour high-price consumption and fully utilizes off-peak low-price electricity, ultimately achieving a reduction in electricity costs. Simultaneously, it provides forward-looking decision-making basis for the optimization of chiller plant and chiller unit group control, effectively reducing equipment start-up and shutdown losses, thereby constructing a technological closed loop for low-carbon building operation.
[0003] Current prediction methods mainly include: physical modeling, data-driven methods, and fusion methods combining physical features and data-driven approaches. However, these methods all have some limitations: firstly, physical modeling methods (such as EnergyPlus) require solving three-dimensional unsteady heat conduction equations (algorithm complexity O(n^2)). 3 The first problem is that the simulation is time-consuming and highly dependent on measured parameters such as the U-value of the building envelope and the COP of the equipment, making it impossible to embed short-cycle MPC real-time control loops. The second problem is that pure data-driven methods (such as GRU / Transformer) require a large amount of historical data for training, which causes new / renovated buildings to fall into a cold start dilemma (initial prediction R...). 2 The following issues exist: First, the low energy density cannot meet production needs, leading to the failure of energy dispatching functions. Second, the single-model architecture has limitations. While GRU excels at capturing local features to achieve accurate short-term predictions, it struggles to model long-term dependencies. Transformer, with its multi-head attention mechanism, is suitable for fitting long-term trends, but it is slow to respond to transient changes. Neither can meet the needs of multi-scale predictions. Third, offline static models, lacking dynamic calibration mechanisms, experience annual prediction error drift driven by equipment performance degradation and climate model migration. Fourth, although the physical-data shallow fusion method introduces constraints such as heat transfer equations, its generalization ability is limited due to deviations in physical parameter estimation (such as the estimation error of the heat transfer coefficient of the building envelope) and design flaws in the embedding mechanism (simple weighted output). It also ignores key factors such as the nonlinearity of equipment operation.
[0004] Therefore, this paper proposes a building cooling load prediction method and system based on physical simulation and hybrid neural networks. First, the project building is modeled using OpenStudio to obtain simulation data. Then, a hybrid model integrating Transformer and GRU models is designed, and the hybrid model is trained using simulation data to obtain the base model. After the project goes live, equipment and weather data are collected through IoT, SCADA, and other systems. The base model is then fine-tuned using a transfer learning engine before being deployed online. Finally, a model update strategy is formulated, and the deployed model is updated online according to the strategy. This method uses simulation data to train the model and obtains the physical characteristics of the building. It also leverages the long-term and short-term prediction advantages of the hybrid model to improve prediction accuracy. The online model update mechanism can also solve the prediction error drift caused by equipment aging and climate change. Summary of the Invention
[0005] The building cooling load prediction method based on physical simulation and hybrid neural network proposed in this invention can at least solve one of the technical problems in the background art.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: A method for predicting building cooling load based on physical simulation and hybrid neural networks, which performs the following steps using computer equipment: S100: Collect target data and information, and construct a 3D simulation model of the building; S200. Train the 3D simulation model of the building; S300: Perform fine-tuning training on the cloud platform for the trained simulation model; S400 uses a forecasting model finely tuned through a cloud platform to perform load forecasting. The method for training the 3D simulation model of the building in step S200 includes: The data is cleaned to construct a dataset suitable for training the load prediction model; Dataset Split into long sequence datasets and short sequence datasets ; S221. Perform feature extraction for GRU and Transformer branches; GRU branch: Captures short-term temporal dependencies by dynamically controlling information flow through update and reset gates for short sequences. Perform time-step encoding and output the hidden state at each time step:
[0007] in The hidden state sequence at each time step is the output of the GRU network. OK A matrix of real numbers in columns; These are the learnable parameters of the GRU; For short sequence time steps; The hidden layer feature dimension; For dataset The split short sequence dataset; The output of the last time step of the GRU is taken as the branch feature, that is:
[0008] Transformer branch: Models global associations in long sequences; the encoder uses a multi-layer self-attention mechanism and a feedforward network to process long sequences. Global encoding, at its core, calculates the dependency between any two positions in the sequence using a "query key-value" mechanism, outputting a feature sequence containing the global context.
[0009] in, These are the learnable parameters of the Transformer; This refers to the time step size for long sequences. For the hidden layer dimension of the Transformer; long sequence dataset Lag characteristic Forecast future cooling load Where t is the current time step, For the historical lag length of long sequences, Predicting step size for the future; S222. Attention mechanism fusion is applied to GRU and Transformer branch features to dynamically focus on key information; Employing a "GRU query-Transformer response" attention mechanism: leveraging the short-term features of GRU For the "query", from the long sequence features of the Transformer Filter out global information related to short-term patterns; Specific steps: Linear mapping: Mapped to the dimension matching the Transformer hidden layer, as the query vector Q; simultaneously... By performing the mapping, we obtain the key vector K and the value vector V:
[0010] in For query vector, It is a sequence of key vectors. It is a sequence of value vectors; ∈ , ∈ , ∈ It is a learnable mapping matrix; Attention Calculation: The similarity scores between Q and K are calculated using the scaled dot product attention formula. After softmax normalization, the weight distribution is obtained, and then the weighted sum with V yields the attention output.
[0011]
[0012]
[0013] S223. Preserve the complete information after the fusion of GRU and Transformer branch feature mechanisms through feature concatenation; To preserve the feature information of the two branches to the greatest extent, a concatenation method is used instead of simple weighting to fuse the features:
[0014] Among them, the spliced features It simultaneously incorporates the short-term fine-grained mode of GRU and the global correlation information of Transformer, and finally maps the fused features to the prediction target space through a fully connected layer:
[0015] in, ∈ and These are the output layer parameters; To predict the target dimension.
[0016] Furthermore, the method for constructing a three-dimensional simulation model of a building in step S100 of the present invention includes: S110: Obtain the physical structure and location information of the project; Collect the architectural structural CAD drawings of the project buildings to prepare for subsequent simulation modeling of the buildings; S120: Simplify the two-dimensional structural diagram of a building by combining the building's structural CAD drawings; Draw the two-dimensional outline of the room using the center lines of the room's walls, and then import the simplified two-dimensional outline CAD drawing of the building into SketchUp software. S130: Import the 2D structural diagram of the building and generate a 3D building simulation model; S140. Combine the internal and external wall structures of the building rooms and perform heat transfer simulation calculations through model simulation. S150. Gradually optimize the simulation calculation results of the model to prepare for subsequent training of the 3D building simulation model.
[0017] Furthermore, the three-dimensional building simulation model training method in step S150 of the present invention includes: S210: Clean the simulation data in S150 and construct a dataset suitable for training the load prediction model; S220: Construct a parallel hybrid model based on GRU and Transformer architecture, combining the advantages of both in short-term and long-term forecasting to improve the model's forecasting accuracy. S230: Input the dataset suitable for training the load prediction model into the fusion model built in S220, and train it on the PyTorch framework to obtain the final trained prediction base model. ; in This is a basic model for predicting cold load, pre-trained based on simulation data, which will be used for fine-tuning training with actual data from the cloud platform.
[0018] Furthermore, the method for constructing a dataset suitable for training the load prediction model in step S210 of the present invention includes: S211. Based on isolated forest outlier detection, the simulation training dataset... Detect outliers; Through each sample point Calculate an outlier score And generate a binary exception identifier. :
[0019]
[0020] in, For the sample Path length on an isolated tree; Let be the expectation function, representing the average path length across all isolated trees; Given a number of samples The path length standardization factor is as follows; The preset anomaly detection threshold; S212. Replace outliers using the sliding window mean to generate the interpolation matrix. ; For those identified as abnormal sample points Use its adjacent front and back The arithmetic mean of each normal sample point is used to replace the original value, thereby generating the processed interpolation matrix. For the samples The processing method is as follows:
[0021] Among them, the definition is based on the first Centered on a sample point, with a size of [number] points... sliding window The set of indices for all normal samples within the sliding window is ; S213. The interpolated matrix Standardize the data according to the characteristic columns to eliminate the influence of dimensions; Calculate each feature dimension mean and standard deviation The standardized matrix is obtained. :
[0022]
[0023]
[0024] Defined as the first after interpolation The nth sample, the nth The element values of each dimension, where N is the number of samples and D is the dimension; S214. Normalize the standardized matrix Z and calculate each feature dimension. new minimum value and maximum value The normalized data matrix is obtained by performing transformations. : The calculation formula is as follows:
[0025]
[0026]
[0027] S215. The normalized dataset Divide the sequence into long and short sequences; S216. For the processed dataset and the corresponding tag set The dataset is divided into training and testing sets according to a set ratio. The training set is 80% of the test set is 20% , Indicates features, Indicates a label.
[0028] Furthermore, in step S215 of the present invention, the normalized dataset... Methods for partitioning long and short sequences include: The specific operation method is as follows, assuming the current time is , using length The predicted sequence length is For sequences, then long sequence datasets Lag characteristic Forecast future cooling load Short sequence dataset Lag characteristic Forecast future cooling load ,in This indicates that the short sequence dataset takes the last element of the long sequence dataset. The training dataset is constructed using the lag feature of length, then the short sequence dataset... In long sequence datasets Based on this, we pay more attention to local temporal characteristics.
[0029] Furthermore, the cloud platform fine-tuning training method in step S300 of the present invention includes: S310: Collects equipment operating parameters through the Internet of Things acquisition module to obtain historical cooling load, and obtains historical weather data such as temperature and humidity by uploading weather data from the local weather station set up in the project to the cloud; Based on this data, an actual dataset was constructed; the collected actual data became the project dataset. Its expression is as follows:
[0030] in, This indicates the number of features, specifically the number of feature values for hourly, temperature, humidity, and load values. To determine the number of samples, refer to the steps in S210 for the project dataset. Cleaning is performed to obtain the actual training dataset. and the actual test dataset ; S320: Load the training base model obtained in S230. The model file is used for fine-tuning and training of the model; The model fine-tuning training method is as follows: A gradual parameter unfreezing strategy is adopted, using the actual training dataset in S310. To fine-tune the base model, use the actual test dataset. Test the predicted performance; The hybrid model consists of the following layers in order: Transformer layer, GRU layer, Attention layer, and fully connected layer; the fine-tuning process includes... Each stage; From number 1 to number The process involves several phases, progressively releasing the fully connected layer, attention layer, GRU layer, and Transformer layer from back to front. Each phase involves training for a specific number of epochs, with a total of 20 epochs and an initial learning rate of... , No. Model parameters at each stage The update is as follows:
[0031] No. The learning rate at each stage ,in This is the attenuation coefficient, with a value of 0.1. The gradient of the loss function with respect to the parameters is given, and the mean squared error (MSE) is chosen as the loss function.
[0032] in, The mean squared error loss value is the optimization objective for model training. For the first Predicted cooling load values for each sample; For the first The true labeled value of the cooling load for each sample; Representing vectors Norm; use this parameter to update the strategy, at each stage. After completion, evaluate the model's performance on the actual test dataset, using the mean absolute percentage error. MAPE Stop training once the percentage drops below 10%.
[0033] In summary, this invention designs a complete method for predicting building cooling load. This method combines simulation data obtained from OpenStudio model simulation for training to build a basic model. Simultaneously, a model fusion method is designed: parallel training of GRU and Transformer models, and fusion of their results through an attention mechanism, thereby improving prediction accuracy. After the project goes live and obtains actual weather and equipment operation data, the basic model will be fine-tuned using actual project data and transfer learning until the model accuracy meets the requirements before deployment and application. Traditional methods typically use prediction models of similar buildings for transfer learning to solve the cold start problem, while this invention, based on actual physical building simulation, training, and transfer learning, ensures higher accuracy. This method has the following advantages: 1. This method innovatively adopts model fusion technology, combining the advantages of GRU in short-term feature capture and Transformer in long-term feature capture. Compared with using GRU or Transformer models alone, this method has higher accuracy.
[0034] 2. Within the overall framework, OpenStudio software is used to perform cold load simulations on buildings, acquire simulation data, and train models based on this data to extract the physical characteristics of the buildings. This method effectively solves the problems of low prediction accuracy and difficulty in cold start-up caused by the lack of historical data in the early stages of new projects by fusing simulation data with physical characteristics.
[0035] 3. In addition, the simulation data of buildings itself contains the physical characteristics of the buildings. The method of training models through simulation data to integrate the physical characteristics of buildings is simpler to operate than the currently popular methods such as PINN. It does not require fitting and solving parameters such as heat transfer coefficients, and the feature acquisition is more direct and the feature extraction is more comprehensive. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the building cooling load prediction system architecture of the present invention; Figure 2 This is a schematic diagram of the model fusion mechanism; Figure 3 This is the building cooling load prediction result of the present invention; Figure 4 This is a schematic diagram of energy consumption optimization control. Figure 5 Simplified CAD schematic diagram of building structure; Figure 6 This is a schematic diagram of the OpenStudio 3D model of the building in this example; Figure 7 This is a schematic diagram of the OpenStudio simulation results; Figure 8 A flowchart for transfer learning; Figure 9 Flowchart for training a GRU / Transformer fusion model. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0038] like Figure 1As shown in the figure, the building cooling load prediction system based on physical simulation and hybrid neural network described in this embodiment includes: a building simulation module, a model training module, a transfer learning module, and a load prediction module.
[0039] The building simulation module constructs a high-fidelity digital twin environment based on actual engineering projects, generates physically realistic building cooling load data through a systematic process, and inputs it into the model training module.
[0040] First, the architectural CAD drawings were imported into SketchUp 2024. Tools such as Push / Pull and Follow Me were used to create a 3D model of the building envelope (including walls, windows, and roof) with millimeter-level precision. The interior and exterior walls were automatically marked using the OpenStudio plugin, and the thermal zone boundaries required for EnergyPlus simulation were precisely defined. The geometric model was then converted into an .osm format file that retains complete topological relationships and material properties.
[0041] Then, open the .osm file using OpenStudio Application 1.8.0 software, configure the core simulation parameters in the OpenStudio software settings, import .epw meteorological data to construct environmental conditions, bind the thermal parameters of the building envelope (such as the heat transfer coefficient U-value of the external wall and the solar heat gain coefficient SHGC of the window), set the internal heat source power density and equipment operation schedule, and deploy the IdealLoadsAirSystem to eliminate the interference of equipment performance on the cooling load calculation.
[0042] Finally, after running the OpenStudio simulation, the software automatically calls the EnergyPlus 24.1 engine. EnergyPlus performs a dynamic physical simulation based on the heat balance method, solving the building heat transfer equation and outputting minute-level true values of cooling loads (ZoneIdeal Loads Total Cooling Rate) and configurable physical characteristic output parameters such as weather parameters. By comparing each item with the HVAC design load calculation (peak load deviation rate ≤30%), iteratively optimizing material properties and internal load settings, the simulation results are made to approximate real-world conditions as closely as possible. Finally, the standardized hourly cooling load dataset is extracted through aggregation processing using the OpenStudio DView plugin. (Integrating hourly, temperature, humidity, and load characteristics) provides a physically interpretable data foundation for subsequent neural network training, expressed as follows:
[0043] in, This indicates the number of features, which is 4 here, representing the number of feature values for hourly, temperature, humidity, and load values. This refers to the number of samples, specifically the number of data points exported from the simulation.
[0044] The model training module takes the data generated by the building simulation module, preprocesses it (DataPreprocessing), and uses it as the input sequence. Then, it segments the data to form a long sequence. , short sequence ,in It is a training dataset with sequence length L, features of hour, temperature, humidity, and hysteresis load, and labeled as load. This is a training dataset with a sequence length of S, features of hour, temperature, humidity, and hysteresis load, and labeled as load. The specific operation involves using the original sequence as the dataset. After cleaning, the training set is It includes training datasets for both long and short sequences. and For detailed cleaning steps, please refer to S210. Long sequences As input to the Transformer branch, the sequence is first processed by linear projection and positional encoding. Linear projection is used to project the input sequence onto high-dimensional features to expand the feature dimension and enhance the model's fitting ability. Positional encoding supplements the sequence position information (solving the problem that Transformer lacks explicit temporal awareness). The processed sequence is then fed into the Transformer encoder (which mines global correlation features through a multi-head self-attention mechanism). The features at the last time step are extracted as the global correlation representation of the Transformer branch and passed to the attention fusion mechanism.
[0045] short sequence As input to the GRU branch, the GRU feature extraction operation (adaptively capturing sequence temporal dependencies through a gating mechanism) outputs an intermediate result containing temporal features. The final time-step features (the last hidden state) are further truncated and used as the key temporal representation of the GRU branch, then passed to the attention fusion mechanism. The attention fusion mechanism receives the output of the last step of the GRU branch and the output of the Transformer branch. Through attention weight calculation, it adaptively assigns fusion weights to the features from both branches, highlighting complementary information and outputting a fused comprehensive feature vector.
[0046] like Figure 2 As shown, the integrated feature vector and the hidden state features from the last step of GRU are aligned and fused. Then, the features are compensated by the fully connected output unit and fed into the final fully connected layer. Through linear transformation and activation function, the features are mapped to the prediction target dimension to complete the model training.
[0047] The transfer learning module refers to using real historical chiller load data collected by systems such as SCADA deployed in the project, as well as historical weather data from external interfaces, to input into the transfer learning engine, fine-tune the cooling load prediction model, and enable the model to accurately predict the future cooling load of buildings.
[0048] This module achieves efficient migration of the basic model to the actual scene by integrating multi-source real-time data of the target building with a progressive parameter unfreezing strategy. For specific operations, please refer to S310 and S320.
[0049] At the data acquisition layer, a SCADA system is deployed to capture core chiller operating parameters in real time (including chilled water supply and return temperature difference, flow rate, compressor power consumption, and real-time COP). Simultaneously, it accesses local weather station data on measured solar radiation intensity, temperature, humidity, and wind speed, supplemented by historical weather data provided by a third-party weather API (MoWeather), constructing a complete data system covering equipment status and meteorological trends. The raw data undergoes a rigorous cleaning process: isolated forests are used to detect sensor outliers, which are then replaced using a sliding window averaging algorithm to form a high-quality static training set of the target building. Based on the cleaned, dedicated dataset, a layered unfreezing and fine-tuning process is performed: initially, 90% of the bottom-level parameters in the base model are frozen (retaining the training parameters of the GRU temporal layer and Transformer layer), and only the final fully connected layer is unfrozen, fine-tuning for 50 rounds with a low learning rate of 0.001. If the validation set accuracy does not reach the 90% threshold, the intermediate layer parameters are gradually unfrozen, iterating for 20 rounds with a low learning rate of 0.001 after each unfreezing stage. This process continues until the validation average prediction accuracy exceeds 90%, at which point the unfreezing is terminated, and the fine-tuned model is saved. This strategy enables the model to accurately absorb the unique physical structure and equipment response characteristics of the target building while inheriting the physical laws learned from simulation training.
[0050] The load forecasting module is a web application developed using the Flask framework in Python after the load forecasting model has been trained. This model service is designed with a RESTful architecture to provide external interfaces, enabling users to call the model to complete forecasts.
[0051] like Figure 3 As shown, after the model service development is completed, an image is built using Docker commands and deployed on the cloud platform as a Docker container. This completes the deployment of the model service interface. The model service can be used by applications such as energy management systems and virtual power plants to achieve functions such as load forecasting dashboard display and energy consumption optimization solutions. When the energy management system backend requests the model service interface, it calls the model to complete load forecasting, returns the forecast data through the interface, and then displays it on the dashboard in a structured format, thus achieving the function of real-time forecasting dashboard display. Figure 4As shown, the energy management system receives the predicted load data returned by the model service, combines it with the control strategy to solve for the optimal operating parameters of the equipment group under the predicted load (such as motor speed, unit power, valve opening, equipment start-up and shutdown status, etc.), and then sends the control commands to each device through the acquisition module via OPC UA, Modbus and other methods to realize equipment control and thus complete the function of energy consumption optimization.
[0052] S100: Collect target data and information, and construct a 3D simulation model of the building; S110: Obtain the physical structure and location information of the project; Collect CAD drawings of the building structure, CAD drawings of HVAC design, manual calculation sheets of HVAC load, and other materials to prepare for subsequent simulation modeling of the building.
[0053] S120: Simplify the two-dimensional structural diagram of a building by combining the building's structural CAD drawings; Draw the room's outline using the center lines of the room's walls. Import the simplified 2D CAD drawing of the building's outline into SketchUp software.
[0054] S130: Import the 2D structural diagram of the building and generate a 3D building simulation model.
[0055] Based on room type and HVAC manual calculation data, adjacent rooms of the same type are grouped together. For example, rooms with the same function, wall type, electrical power load, and occupancy load can be considered as one room. For irregularly shaped rooms, multiple straight lines can be used instead of curves, and rectangular shapes are preferred for room drawing. This simplifies the room structure, reduces model complexity, improves simulation efficiency, and reduces the probability of simulation errors. Figure 5 As shown, the two-dimensional shape of each floor of the building is used to generate a three-dimensional space according to the floor height using the "create spaces from diagram" function of the OpenStudio plugin. Finally, the three-dimensional spaces of each floor are stacked together in floor order to form a complete building simulation model.
[0056] S140. Combine the internal and external wall structures of the building rooms and perform heat transfer simulation calculations through model simulation. like Figure 6As shown, the "Surface Matching" function of the OpenStudio plugin automatically matches the interior and exterior walls of the building's rooms (spaces) for subsequent model simulations to calculate heat transfer. The matching effect is checked; if automatic matching fails, the Inspector function of the OpenStudio plugin is used to find the corresponding walls and manually match them. The matched building model is then exported as a .osm file for subsequent OpenStudio simulations.
[0057] In OpenStudio, set the physical parameters, simulation parameters, weather data, and other information for the building to prepare for the simulation. First, a weather file in .epw format is generated using the Meteonorm software tool based on the building's coordinates, and then imported into the simulation environment. Next, plans are set, including light on / off, personnel activity, equipment operation plans, and HVAC control strategies. The building's load is then set, including personnel load, lighting load, and equipment load, which determine the size of the internal heat source. Based on these settings, combined with room permeability and fresh air exchange rate, the room type ("space type") is determined. Thermal zone types are then set according to ideal air conditioning, typically with different thermal zones for each floor. Finally, the room type is assigned to each room.
[0058] Set the simulation parameters and start the simulation. Set the model's output parameters, including external weather temperature and humidity, and the building's total hourly cooling load (Zone Ideal Loads Total Cooling Rate), then start the simulation. The simulation results are as follows. Figure 7 As shown.
[0059] S150. The data is used to gradually optimize the model simulation calculation results, in preparation for subsequent training of the 3D building simulation model; The simulation results were gradually optimized by adjusting parameters such as material heat transfer coefficient and window-to-wall ratio until the simulated peak cooling load data approached 70% of the load calculation data. Finally, the hourly cooling load data of the weather parameters and building cooling load were exported as CSV files using Dview files to construct the simulation training dataset. (Integrated hourly, temperature, humidity, and load characteristics), expressed as follows:
[0060] in, This indicates the number of features, which is 4 here, representing the number of feature values for hourly, temperature, humidity, and load values. This refers to the number of samples, specifically the number of data points exported from the simulation.
[0061] S200. Model training of the 3D model of the building. S210: Clean the simulation data from S150 to construct a dataset suitable for training the load prediction model. This step consists of the following four sub-steps: S211. Based on outlier detection in isolated forests, the simulation training dataset constructed in S150... The input is fed into the Isolation Forest algorithm model to detect outliers; this model processes each sample point... Calculate an outlier score And generate a binary exception identifier. :
[0062]
[0063] in, For the sample Path length on an isolated tree; Let be the expectation function, representing the average path length across all isolated trees; Given a number of samples The path length standardization factor is as follows; This is the preset threshold for anomaly detection.
[0064] S212. Replace outliers using the sliding window mean to generate the interpolation matrix. ; For those identified as abnormal sample points Use its adjacent front and back The arithmetic mean of each normal sample point is used to replace the original value, thereby generating the processed interpolation matrix. For the samples The processing method is as follows:
[0065] Among them, the definition is based on the first Centered on a sample point, with a size of [number] points... sliding window The set of indices for all normal samples within this window is: .
[0066] S213. The interpolated matrix Standardize the data according to the characteristic columns to eliminate the influence of dimensions; Calculate each feature dimension mean and standard deviation The standardized matrix is obtained. :
[0067]
[0068]
[0069] in, Defined as the first after interpolation The nth sample, the nth The element values of each dimension, where N is the number of samples and D is the dimension.
[0070] S214. Normalize the standardized matrix Z and calculate each feature dimension. new minimum value and maximum value The normalized data matrix is obtained by performing transformations. ; The calculation formula is as follows:
[0071]
[0072]
[0073] S215. The normalized dataset Divide the sequence into long and short sequences; Normalized dataset Split into long sequence datasets and short sequence datasets The specific operation method is as follows, assuming the current time is , using length The predicted sequence length is For sequences, then long sequence datasets Lag characteristic Forecast future cooling load Short sequence dataset Lag characteristic Forecast future cooling load ,in This indicates that the short sequence dataset takes the last element of the long sequence dataset. The training dataset is constructed using the lag feature of length, then the short sequence dataset... In long sequence datasets Based on this, we pay more attention to local temporal characteristics.
[0074] S216. Dataset Partitioning: Partitioning the processed dataset... and the corresponding tag set The dataset is divided into a training set and a test set according to a certain ratio, with the training set being... 80% of the test set is 20% , Indicates features, Indicates a label.
[0075] S220: Construct a parallel hybrid model based on GRU and Transformer architecture, combining the advantages of both in short-term and long-term forecasting to improve the model's forecasting accuracy.
[0076] The overall process of building a hybrid model is as follows: Figure 8 As shown, it can be divided into three core stages: branch feature extraction, attention fusion, feature concatenation and final prediction. The data preprocessed by S210 is used as the input of the hybrid model. Each stage is closely connected to achieve complementary advantages.
[0077] S221. Perform feature extraction for GRU and Transformer branches; GRU branch: Captures short-term temporal dependencies by dynamically controlling information flow through update and reset gates for short sequences. Perform time-step encoding and output the hidden state at each time step:
[0078] in These are the learnable parameters of the GRU (including gating weights and biases). For short sequence length, The hidden layer dimension is used. Since the hidden states of GRU contain accumulated historical information, the output of the last time step is taken as the branch feature, i.e.:
[0079] This feature It condenses the recent key information of short sequences, making it suitable for capturing local time series patterns.
[0080] Transformer branch: Models global associations in long sequences; the encoder uses a multi-layer self-attention mechanism and a feedforward network to process long sequences. Global encoding, at its core, calculates the dependency between any two positions in the sequence using a "query key-value" mechanism, outputting a feature sequence containing the global context.
[0081] in These are the learnable parameters of the Transformer (including self-attention weights, layer normalization parameters, etc.). This refers to the hidden layer dimension of the Transformer, which differs from GRU. Each element in the dataset contains contextual information for a long sequence, making it suitable for capturing long-term dependencies and non-local associations.
[0082] S222. Attention mechanism fusion is applied to GRU and Transformer branch features to dynamically focus on key information; To achieve effective fusion of features from the two branches, a "GRU query-Transformer response" attention mechanism is adopted: using short-term features of GRU... For the "query", from the long sequence features of the Transformer The process involves filtering out global information relevant to short-term patterns. Specific steps include: Linear mapping: Mapped to the dimension matching the Transformer hidden layer, as the query vector Q; simultaneously... By performing the mapping, we obtain the key vector K and the value vector V:
[0083] in ∈ , ∈ , ∈ It is a learnable mapping matrix.
[0084] Attention Calculation: The similarity scores between Q and K are calculated using the scaled dot product attention formula. After softmax normalization, the weight distribution is obtained, and then the weighted sum with V yields the attention output.
[0085]
[0086]
[0087] This process enables the model to dynamically focus on the parts of the long sequence that are most relevant to the current short-term pattern, enhancing the targeting of the fused features.
[0088] S223. Preserve the complete information after the fusion of GRU and Transformer branch feature mechanisms through feature concatenation; To preserve the feature information of the two branches to the greatest extent, a concatenation method is used instead of simple weighting to fuse the features:
[0089] Features after splicing It simultaneously incorporates the short-term fine-grained mode of GRU and the global correlation information of Transformer, and finally maps the fused features to the prediction target space through a fully connected layer:
[0090] in ∈ and represents the output layer parameters, and m represents the dimension of the prediction target.
[0091] S230: Input the dataset suitable for training the load prediction model into the fusion model built in S220, train it on the PyTorch 2.7.1 framework to obtain the final trained model, and export it as a .pth model file, which is called the prediction base model. .
[0092] S300: Perform fine-tuning training on the cloud platform for the trained simulation model; S310: Historical cooling load is obtained by collecting equipment operating parameters through the IoT acquisition module, and historical weather data such as temperature and humidity are obtained by uploading weather data from the local weather station set up on the project to the cloud. Based on this data, a real-world dataset is constructed. The collected real-world data constitutes the project dataset. (Integrated hourly, temperature, humidity, and load characteristics), expressed as follows:
[0093] in, This indicates the number of features, which is 4 here, representing the number of feature values for hourly, temperature, humidity, and load values. This refers to the number of samples, specifically the number of data entries collected and combined by the system after the project has been running for a period of time. Refer to the steps in S210 for the project dataset. Cleaning is performed to obtain the actual training dataset. and the actual test dataset
[0094] S320: Load the training base model obtained in S230. The model file, model fine-tuning training; like Figure 8 As shown, the model fine-tuning training method is as follows: A gradual parameter unfreezing strategy is adopted, using the actual training dataset in S310. To fine-tune the base model, use the actual test dataset. Test the performance of predictions to improve predictive capabilities in real-world projects.
[0095] like Figure 9As shown, the hybrid model consists of the following layers in order: Transformer layer, GRU layer, Attention layer, and fully connected layer. The fine-tuning process includes... Each stage. From stage 1 to stage 2. The process involves several phases, progressively releasing the fully connected layer, attention layer, GRU layer, and Transformer layer from back to front. Each phase involves training for a specific number of epochs, with a total of 20 epochs and an initial learning rate of... , No. Model parameters at each stage The update is as follows:
[0096] Among them, the The learning rate at each stage ,in This is the attenuation coefficient, with a value of 0.1. The gradient of the loss function with respect to the parameters is given, and the loss function is chosen as MSE (mean squared error). , Representing vectors Norm (Euclidean distance). This parameter is used to update the strategy at each stage. After completion, evaluate the model's performance on the actual test dataset. MAPE Training is stopped once the mean absolute percentage error (MASE) drops below 10%.
[0097] S400 performs load forecasting using a prediction model finely tuned through a cloud platform. S410, Deploy the previously fine-tuned model via the cloud platform.
[0098] The model is loaded using the lightweight Flask web framework and exposed as an API service. The developed API service is used by backend systems such as load forecasting dashboards to display future load forecasts, or by energy management platforms and other systems in conjunction with frameworks like MPC for energy consumption optimization and control of equipment.
[0099] S420. After the project has been running for a year or more, all model parameters will be released. All actual operational data will be used for data cleaning and model training. Once the model reaches a good prediction accuracy, it will be replaced and deployed online. Alternatively, the model can be updated gradually on a weekly basis using online learning and other technologies. A cloud platform will be used for model version management, automated deployment, and monitoring to achieve online model updates and prevent the impact of weathering of building structures and climate change on prediction accuracy over time.
[0100] In summary, this invention presents a complete method and system for predicting building cooling load. This system is trained using simulation data obtained from OpenStudio model simulation to build a basic model. Simultaneously, a model fusion method is designed: parallel training of GRU and Transformer models, followed by fusion of their results through an attention mechanism, thereby improving prediction accuracy. After the project goes live and obtains actual weather and equipment operation data, the basic model will be fine-tuned using transfer learning based on actual project data until the model accuracy meets the requirements before deployment and application. Traditional methods typically use prediction models of similar buildings for transfer learning to address the cold start problem, while this invention, based on actual physical building simulation, training, and transfer learning, ensures higher accuracy. This method has the following advantages: 1. This method innovatively adopts model fusion technology, combining the advantages of GRU in short-term feature capture and Transformer in long-term feature capture. Compared with using GRU or Transformer models alone, this method has higher accuracy.
[0101] 2. Within the overall framework, OpenStudio software is used to perform cold load simulations on buildings, acquire simulation data, and train models based on this data to extract the physical characteristics of the buildings. This method effectively solves the problems of low prediction accuracy and difficulty in cold start-up caused by the lack of historical data in the early stages of new projects by fusing simulation data with physical characteristics.
[0102] 3. In addition, the simulation data of buildings itself contains the physical characteristics of the buildings. The method of training models through simulation data to integrate the physical characteristics of buildings is simpler to operate than the currently popular methods such as PINN. It does not require fitting and solving parameters such as heat transfer coefficients, and the feature acquisition is more direct and the feature extraction is more comprehensive.
[0103] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0104] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0105] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting building cooling load based on physical simulation and hybrid neural networks, characterized in that, Perform the following steps using a computer device: S100: Collect target data and information, and construct a 3D simulation model of the building; S200. Train the 3D simulation model of the building; S300: Perform fine-tuning training on the cloud platform for the trained simulation model; S400 uses a forecasting model finely tuned through a cloud platform to perform load forecasting. The method for training the 3D simulation model of the building in step S200 includes: The data is cleaned to construct a dataset suitable for training the load prediction model; Dataset Split into long sequence datasets and short sequence datasets ; S221. Perform feature extraction for GRU and Transformer branches; GRU branch: Captures short-term temporal dependencies by dynamically controlling information flow through update and reset gates for short sequences. Perform time-step encoding and output the hidden state at each time step: in The hidden state sequence at each time step is the output of the GRU network. OK A matrix of real numbers in columns; These are the learnable parameters of the GRU; For short sequence time steps; The hidden layer feature dimension; For dataset The split short sequence dataset; The output of the last time step of the GRU is taken as the branch feature, that is: Transformer branch: Models global associations in long sequences; the encoder uses a multi-layer self-attention mechanism and a feedforward network to process long sequences. Global encoding, at its core, calculates the dependency between any two positions in the sequence using a "query key-value" mechanism, outputting a feature sequence containing the global context. in, These are the learnable parameters of the Transformer; The hidden layer dimension of the Transformer; S222. Attention mechanism fusion is applied to GRU and Transformer branch features to dynamically focus on key information; Employing a "GRU query-Transformer response" attention mechanism: leveraging the short-term features of GRU For the "query", from the long sequence features of the Transformer Filter out global information related to short-term patterns; Specific steps: Linear mapping: Mapped to the dimension matching the Transformer hidden layer, as the query vector Q; simultaneously... By performing the mapping, we obtain the key vector K and the value vector V: in For query vector, It is a sequence of key vectors. It is a sequence of value vectors; ∈ , ∈ , ∈ It is a learnable mapping matrix; Attention Calculation: The similarity scores between Q and K are calculated using the scaled dot product attention formula. After softmax normalization, the weight distribution is obtained, and then the weighted sum with V yields the attention output. S223. Preserve the complete information after the fusion of GRU and Transformer branch feature mechanisms through feature concatenation; To preserve the feature information of the two branches to the greatest extent, a concatenation method is used instead of simple weighting to fuse the features: Among them, the spliced features It simultaneously incorporates the short-term fine-grained mode of GRU and the global correlation information of Transformer, and finally maps the fused features to the prediction target space through a fully connected layer: in, ∈ and These are the output layer parameters; To predict the target dimension.
2. The building cooling load prediction method based on physical simulation and hybrid neural networks according to claim 1, characterized in that, The method for constructing a 3D simulation model of a building in step S100 includes: S110: Obtain the physical structure and location information of the project; Collect the architectural structural CAD drawings of the project buildings to prepare for subsequent simulation modeling of the buildings; S120: Simplify the two-dimensional structural diagram of a building by combining the building's structural CAD drawings; Draw the two-dimensional outline of the room using the center lines of the room's walls, and then import the simplified two-dimensional outline CAD drawing of the building into SketchUp software. S130: Import the 2D structural diagram of the building and generate a 3D building simulation model; S140. Combine the internal and external wall structures of the building rooms and perform heat transfer simulation calculations through model simulation. S150. Gradually optimize the simulation calculation results of the model to prepare for subsequent training of the 3D building simulation model.
3. The building cooling load prediction method based on physical simulation and hybrid neural networks according to claim 2, characterized in that, The training method for the 3D building simulation model in step S150 includes: S210: Clean the simulation data in S150 and construct a dataset suitable for training the load prediction model; S220: Construct a parallel hybrid model based on GRU and Transformer architecture, combining the advantages of both in short-term and long-term forecasting to improve the model's forecasting accuracy. S230: Input the dataset suitable for training the load prediction model into the fusion model built in S220, and train it on the PyTorch framework to obtain the final trained prediction base model. ; in This is a basic model for predicting cold load, pre-trained based on simulation data, which will be used for fine-tuning training with actual data from the cloud platform.
4. The building cooling load prediction method based on physical simulation and hybrid neural networks according to claim 3, characterized in that, The methods for constructing a dataset suitable for training the load prediction model in step S210 include: S211. Based on isolated forest outlier detection, the simulation training dataset... Detect outliers; Through each sample point Calculate an outlier score And generate a binary exception identifier. : in, For the sample Path length on an isolated tree; Let be the expectation function, representing the average path length across all isolated trees; Given a number of samples The path length standardization factor is as follows; The preset anomaly detection threshold; S212. Replace outliers using the sliding window mean to generate the interpolation matrix. ; For those identified as abnormal sample points Use its adjacent front and back The arithmetic mean of each normal sample point is used to replace the original value, thereby generating the processed interpolation matrix. For the samples The processing method is as follows: Among them, the definition is based on the first Centered on a sample point, with a size of [number] points... sliding window The set of indices for all normal samples within the sliding window is ; S213. The interpolated matrix Standardize the data according to the characteristic columns to eliminate the influence of dimensions; Calculate each feature dimension mean and standard deviation The standardized matrix is obtained. : Defined as the first after interpolation The nth sample, the th The element values of each dimension, where N is the number of samples and D is the dimension; S214. Normalize the standardized matrix Z and calculate each feature dimension. new minimum value and maximum value The normalized data matrix is obtained by performing the transformation. : The calculation formula is as follows: S215. The normalized dataset Divide the sequence into long and short sequences; S216. For the processed dataset and the corresponding tag set The dataset is divided into training and testing sets according to a set ratio. The training set is 80% of the test set is 20% , Indicates features, Indicates a label.
5. The building cooling load prediction method based on physical simulation and hybrid neural networks according to claim 1, characterized in that, In step S215, the normalized dataset is processed. Methods for partitioning long and short sequences include: The specific operation method is as follows, assuming the current time is , using length The predicted sequence length is For sequences, then long sequence datasets Lag characteristic Forecast future cooling load Short sequence dataset Lag characteristic Forecast future cooling load ,in This indicates that the short sequence dataset takes the last element of the long sequence dataset. The training dataset is constructed using the lag feature of length, then the short sequence dataset... In long sequence datasets Based on this, we pay more attention to local temporal characteristics.
6. The building cooling load prediction method based on physical simulation and hybrid neural networks according to claim 1, characterized in that, The cloud platform fine-tuning training method in step S300 includes: S310: Collects equipment operating parameters through the Internet of Things acquisition module to obtain historical cooling load, and obtains historical weather data such as temperature and humidity by uploading weather data from the local weather station set up in the project to the cloud; Based on this data, an actual dataset was constructed; the collected actual data became the project dataset. Its expression is as follows: in, This indicates the number of features, specifically the number of feature values for hourly, temperature, humidity, and load values. To determine the number of samples, refer to the steps in S210 for the project dataset. Cleaning is performed to obtain the actual training dataset. and the actual test dataset ; S320: Load the training base model obtained in S230. The model file is used for fine-tuning and training of the model; The model fine-tuning training method is as follows: A gradual parameter unfreezing strategy is adopted, using the actual training dataset in S310. To fine-tune the base model, use the actual test dataset. Test the predicted performance; The hybrid model consists of the following layers in order: Transformer layer, GRU layer, Attention layer, and fully connected layer; the fine-tuning process includes... Each stage; From number 1 to number The process involves several phases, progressively releasing the fully connected layer, attention layer, GRU layer, and Transformer layer from back to front. Each phase involves training for a specific number of epochs, with a total of 20 epochs and an initial learning rate of... , No. Model parameters for each stage The update is as follows: No. The learning rate at each stage ,in This is the attenuation coefficient, with a value of 0.
1. The gradient of the loss function with respect to the parameters is given, and the mean squared error (MSE) is chosen as the loss function. in, The mean squared error loss value is the optimization objective for model training. Representing vectors Norm; use this parameter to update the strategy, at each stage. After completion, evaluate the model's performance on the actual test dataset, using the mean absolute percentage error. MAPE Stop training once the percentage drops below 10%.