A method for automatically generating an architectural energy consumption prediction model based on a large model and a template

By combining large models with templates, a natural language interactive model for generating building energy consumption prediction models was achieved without programming. The hyperparameters were optimized using the Crown Pig optimization algorithm, which solved the problems of high user threshold and long tuning cycle in existing technologies, and achieved efficient and accurate building energy consumption prediction.

CN122366079APending Publication Date: 2026-07-10BEIJING UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING UNIV OF TECH
Filing Date
2026-03-10
Publication Date
2026-07-10

Smart Images

  • Figure CN122366079A_ABST
    Figure CN122366079A_ABST
Patent Text Reader

Abstract

This invention discloses a method for automatically generating building energy consumption prediction models based on large models and templates, belonging to the fields of building energy management and artificial intelligence technology. The method includes: receiving a user's building energy consumption prediction request described in natural language; using a pre-trained large model for semantic understanding and intent parsing to extract key task elements; retrieving and loading the corresponding model template from a predefined template registry based on the parsing results; automatically optimizing the hyperparameters in the template using the Crown Pig optimization algorithm to obtain the optimal hyperparameter combination; instantiating the model template based on the optimal hyperparameters, completing model training and prediction, and outputting prediction results and performance evaluation indicators. This invention eliminates the need for user coding, enabling rapid generation of high-performance building energy consumption prediction models through natural language interaction, significantly reducing the technical threshold, improving modeling efficiency and prediction accuracy, and exhibiting good flexibility and scalability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of building energy management and artificial intelligence technology, and in particular to a method and system for automatically generating and optimizing building energy consumption prediction models by combining large models with predefined templates. Background Technology

[0002] Building energy consumption prediction is a core issue in building design, operation, and management. Against the backdrop of increasing global energy shortages and environmental pressures, improving building energy efficiency and reducing energy consumption have become critical issues that urgently need to be addressed. Traditional building energy consumption prediction methods mainly rely on physical modeling tools, such as EnergyPlus and TRNSYS, to achieve energy consumption analysis through detailed simulations of building physical processes. However, these methods have high computational complexity, strict requirements for the accuracy of input data, and significant limitations in model adaptability and computational efficiency.

[0003] With the improvement of computing power, building energy consumption prediction methods based on machine learning and deep learning have gradually attracted widespread attention. Models such as convolutional neural networks and long short-term memory networks can effectively handle complex data structures and time-series information, significantly improving prediction capabilities. In recent years, large-scale pre-trained models, represented by the GPT series and BERT, have been gradually introduced into the field of building energy efficiency management due to their advantages in large-scale data feature extraction and pattern recognition, providing greater flexibility and customization capabilities for energy consumption prediction.

[0004] While deep learning-based methods reduce the complexity of manual modeling, they still rely on large amounts of training data and computational resources, and require significant expertise in areas such as model selection and data preprocessing. To improve prediction accuracy and modeling efficiency, ensemble learning and hybrid models have been introduced to combine the advantages of multiple models, achieving higher accuracy while controlling computational burden.

[0005] Automated modeling, as a cutting-edge field in building energy consumption prediction, incorporates natural language processing and meta-learning techniques, enabling users to automatically generate models through concise commands or interactive interfaces. However, existing methods still fall short in terms of flexibility and adaptability. Furthermore, emerging technologies such as deep reinforcement learning, combined with environmental feedback and continuous learning mechanisms, can dynamically adjust prediction strategies based on the building environment and climate conditions, thereby further improving the accuracy and practicality of the models.

[0006] In summary, while existing building energy consumption prediction methods have made some progress in terms of accuracy and efficiency, they still face many challenges: traditional modeling methods have a high barrier to entry for non-expert users, and the training and optimization cycles are long; although large models can generate modeling programs based on user intent, the correctness of execution is difficult to guarantee. Therefore, how to combine large model technology with flexible template systems to achieve personalized and efficient building energy consumption prediction based on natural language interaction has become a key issue that urgently needs to be addressed. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a method and system for automatically generating building energy consumption prediction models that requires no programming and supports natural language interaction. This method can quickly and accurately build and optimize prediction models based on user instructions, significantly reducing the technical threshold and improving modeling efficiency and prediction accuracy.

[0008] To achieve the above objectives, the present invention adopts the following technical solution: a building energy consumption prediction method based on automatic generation of large models and templates.

[0009] The specific technical implementation of this invention targets building energy consumption prediction. It involves sending modeling requirements as text to an intelligent agent, which then parses the requirements, calls specific templates for combination and execution, and finally returns the trained building energy consumption prediction model to the user. The detailed steps are as follows:

[0010] The first step is intent parsing. Users describe their building energy consumption forecasting needs in natural language, for example: "Based on the outdoor temperature, humidity, solar radiation, and historical load data of an office building, predict the building's cooling load for the next 24 hours." After receiving this input, the system uses a pre-trained large model (such as DeepSeek or the GPT series) for semantic understanding and intent parsing, extracting key task elements, including:

[0011] (1) Data set: such as "historical load data of an office building";

[0012] (2) Characteristic variables: such as "outdoor temperature, humidity, solar radiation";

[0013] (3) Predicted targets: such as "building cooling load";

[0014] (4) Forecast range: such as "the next 24 hours";

[0015] (5) Model type preference: such as "XGBoost" or "LSTM", etc.

[0016] The output of this step is a structured task description object, which is used for template matching in the next step.

[0017] The second step is template matching. Based on the model type parsed in the first step, the system retrieves and loads the corresponding model template from a predefined model template registry. This registry is stored in key-value pairs and contains the following information:

[0018] (1) Model name: such as "XGBoost";

[0019] (2) Template file path: such as " / templates / xgboost_template.py";

[0020] (3) List of hyperparameters to be optimized: such as learning rate, maximum tree depth, subsampling ratio, etc.

[0021] The template file contains the complete structure definition of the model, the training process, and the evaluation logic. The system uses a dynamic loading mechanism to instantiate the template into an executable object and prepares it for hyperparameter optimization. This step automates the mapping from user intent to the specific modeling process.

[0022] The third step is hyperparameter optimization. To improve the model's accuracy and generalization ability in building energy consumption prediction tasks, this invention introduces the Crested Porcupine Optimizer (CPO) algorithm to automatically optimize the hyperparameters in the model template. CPO is a swarm intelligence-based global optimization algorithm that simulates the behavior of crested porcupines during foraging and defense. It has strong global search capabilities and convergence speed, and is suitable for high-dimensional, non-convex hyperparameter optimization problems. The hyperparameter set of the model is set as follows: ,in Representing the There are several hyperparameters, such as learning rate, batch size, and number of network layers. The optimization objective is to minimize the model's loss function on the training set by adjusting these hyperparameters. .in, The model is based on hyperparameters For the first The predicted value for each sample, It is the actual value. It represents the total number of samples.

[0023]

[0024]

[0025] In the CPO algorithm, each hyperparameter combination is treated as an individual "crested porcupine." Through population iterative updates, combined with local perturbation and global exploration mechanisms, the algorithm gradually approaches the optimal hyperparameter combination. In each iteration, the algorithm evaluates the individual's performance on the validation set and updates the individual's position based on its fitness value. This method is particularly suitable for building energy consumption prediction scenarios, where the high sensitivity of hyperparameters is caused by complex data distribution and diverse features. After optimization, the system records the optimal hyperparameter combination and passes it to the next step.

[0026] The fourth step is model generation and execution. Based on the optimal hyperparameters obtained in the third step, the system instantiates a model template and trains the model using the training set data. After training, the model predicts the user-specified test data and outputs the prediction results, such as the building's cooling load value for the next 24 hours. Simultaneously, the system automatically calculates model performance evaluation metrics, such as mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²), and returns them to the user in visual or tabular form.

[0027] The entire process is fully automated from user requirements to model generation. Users can obtain high-performance building energy consumption prediction models without writing code or manually adjusting parameters.

[0028] Compared with the prior art, the beneficial effects of the present invention are: (1) Low threshold for use: users do not need to write any code and can generate customized high-performance prediction models through natural language description; (2) Efficient modeling process: automated template matching and CPO optimization algorithm greatly shorten the model development and tuning cycle; (3) Excellent prediction accuracy: through the accurate intent parsing of large models and the global optimization of CPO algorithm, the generated model has higher prediction accuracy on multiple real datasets; (4) Good flexibility and scalability: by maintaining and expanding the model template registry, the system can easily adapt to new prediction algorithms and building energy consumption scenarios. Attached Figure Description

[0029] Figure 1 This is the experimental configuration for this invention.

[0030] Figure 2 This is a flowchart illustrating the overall operation of generating prediction models based on large models and templates.

[0031] Figure 3 Comparison of prediction performance curves of different methods (expert baseline, Auto-Sklearn, and this invention) on the test set.

[0032] Figure 4 Residual analysis plots for predictions using different methods, including residual distribution and cumulative error distribution.

[0033] Figure 5A schematic diagram of the interface of the intelligent platform system for building energy consumption prediction model implemented in this invention. Detailed Implementation

[0034] The following description is only a preferred embodiment of the present invention and does not limit the scope of protection of the present invention.

[0035] This invention proposes a method for automatically generating building energy consumption prediction models based on large models and templates, achieving simple and rapid generation of building energy consumption prediction models. The implementation process of this invention will be further described in detail below with reference to the accompanying drawings.

[0036] (1) Figure 1 The experiment was conducted using heat and cooling load, indoor temperature, indoor humidity data from the Green Building at Beijing University of Technology, as well as weather data (including temperature, humidity, and solar radiation). One year's worth of hourly data was used to predict the load for the next 24 hours using weather data and historical weekly load data. The dataset was divided chronologically into a training set (70%), a validation set (15%), and a test set (15%). The validation set was used for hyperparameter optimization, and the test set was used for final performance evaluation. For the same XGBoost prediction model, comparative experiments were conducted using expert baselines, Auto-Sklearn baselines, and the method of this invention. The performance of each method in building the model was comprehensively evaluated using mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²).

[0037] (2) Figure 2 The system operates as follows: Users describe their building energy consumption forecasting needs in natural language, including data types, forecast ranges, and optimization objectives. The system performs semantic analysis on the input needs, mapping them to specific forecasting tasks. A pre-trained language model is used to semantically understand the user input and identify key information (such as model type and optimization objectives). This process is implemented through a deep neural network, outputting structured forecasting tasks, automatically executing the forecasting process, and ultimately returning the trained forecasting model.

[0038] (3) Figure 3For predictive performance analysis, experimental results show that all methods can capture the daily cyclical characteristics of building loads well, but the method of this invention is more accurate in predicting peak and trough values. The weekend periods marked in the figure (light yellow background) indicate that the method of this invention adapts better to the weekend load reduction pattern, while the expert baseline method shows a significant prediction lag during the weekend transition. Throughout the entire prediction period, the prediction curve of the method of this invention is the smoothest and has the least fluctuation, showing that the model has better stability. The residual time series plot shows that the expert baseline residuals fluctuate greatly, especially during periods of drastic load changes; Auto-Sklearn is generally better than the expert baseline, but still has systematic errors; the residuals of the method of this invention are closest to zero, with the smallest fluctuation range, and the error has no obvious temporal clustering, indicating that the model can effectively handle time series dependencies.

[0039] (4) Figure 4 The experimental results were quantitatively analyzed. The method of this invention shows significant advantages in prediction accuracy, stability, and practicality. Quantitative indicators show that the MAE of the method of this invention is 0.945 kW, the RMSE is 1.210 kW, and the R² reaches 0.994, which is a significant improvement compared with traditional methods.

[0040] (5) Figure 5 For system implementation. Based on the method of this invention, an intelligent platform for building energy consumption prediction models was developed using the Flask framework and DeepSeek-R1, providing a user-friendly interactive interface.

[0041] Experimental results show that the method of the present invention is significantly better than existing comparative methods in terms of both prediction accuracy and modeling efficiency.

Claims

1. A method for predicting building energy consumption based on large models and templates for automatic generation, characterized in that, Includes the following steps: Step S1: Receive the building energy consumption prediction demand described by the user in natural language, use a pre-trained large model to perform semantic understanding and intent parsing on the demand, extract key task elements, and generate a structured task description object. Step S2: Based on the model type preference in the structured task description object, retrieve and load the corresponding model template from the predefined model template registry. The model template includes model structure definition, training process and evaluation logic. Step S3: The hyperparameters in the model template are automatically optimized using the porcupine optimization algorithm to minimize the loss function of the model on the training set and obtain the optimal combination of hyperparameters. Step S4: Instantiate the model template based on the optimal hyperparameter combination, train the model using the training set, predict the test data specified by the user, and output the prediction results and model performance evaluation indicators.

2. The building energy consumption prediction model method based on large model and template automatic generation according to claim 1, characterized in that, The key task elements in step S1 include one or more of the following: dataset information, feature variables, prediction target, prediction range, and model type preference.

3. The building energy consumption prediction model method based on large model and template automatic generation according to claim 1, characterized in that, The model template registry in step S2 is stored in key-value pairs, including the model name, template file path, and list of hyperparameters to be optimized.

4. The building energy consumption prediction model method based on large model and template automatic generation according to claim 1, characterized in that, The hog optimization algorithm in step S3 is based on a swarm intelligence mechanism. By simulating the foraging and defense behaviors of hogs, it performs global search and local perturbation iterative optimization of hyperparameter combinations.

5. The building energy consumption prediction model method based on large model and template automatic generation according to claim 1, characterized in that, The model performance evaluation metrics in step S4 include one or more of the following: mean absolute error, root mean square error, and coefficient of determination, and are presented to the user in a visual or tabular format.

6. A building energy consumption prediction system based on large model and template automatic generation, characterized in that, include: Intent parsing module: Used to receive user natural language input, perform semantic understanding and intent parsing using a pre-trained large model, and generate structured task description objects; Template matching module: used to retrieve and load the corresponding model template from the predefined template registry based on the structured task description object; Hyperparameter optimization module: Used to automatically optimize the hyperparameters in the model template using the Crowned Porcupine optimization algorithm, and output the optimal combination of hyperparameters; Model generation and execution module: used to instantiate model templates based on optimal hyperparameters, perform model training and prediction, and output prediction results and performance evaluation metrics.

7. The building energy consumption prediction system based on large model and template automatic generation according to claim 6, characterized in that, The intent parsing module is also used to extract key task elements, including dataset, feature variables, prediction target, prediction range, and model type.

8. The building energy consumption prediction system based on large model and template automatic generation according to claim 6, characterized in that, The model template registry in the template matching module contains the model name, template file path, and a list of hyperparameters to be optimized, and supports dynamic loading and instantiation.

9. The building energy consumption prediction system based on large model and template automatic generation according to claim 6, characterized in that, The hog optimization algorithm in the hyperparameter optimization module is based on swarm intelligence and minimizes the model loss function by iteratively updating the hyperparameter combination.

10. A computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the building energy consumption prediction model method based on large models and templates automatically generated as described in any one of claims 1 to 5.