arrow
Return

Large Language Model-Based Method for HVAC System Control Code Automatic Generation

delete2026-04-27
delete0
delete
OA
AI
R
Ruiqin Jiang
K
Ke Xia
J
Jiahua Huang
J
Jie Lu *
DOI:10.3390/buildings16091722delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En
Keywords:
large language model
HVAC
control code
RAG
simulation
multi-agent

AI Summary

Brief Overview

In April 2026, Ruiqin Jiang, Ke Xia, Jiahua Huang, and Jie Lu published the paper "Large Language Model-Based Method for HVAC System Control Code Automatic Generation" online in Buildings. This study developed a method for automatically generating control code for HVAC systems based on large language models, overcoming the challenges of low efficiency, error-proneness, and difficulty in adapting to different building projects associated with traditional manual coding. By introducing retrieval-augmented generation (RAG), a multi-agent collaborative framework, and a virtual simulation validation mechanism, the study achieved an integrated closed loop for control logic understanding, personalized equipment adaptation, and safety verification. It significantly improved the accuracy and versatility of control program generation, providing a viable new paradigm for intelligent energy-saving control in buildings.

Research Abstract

Nearly 36% of building energy consumption comes from HVAC systems, and precise control relies on a large amount of customized control code, which in the past required engineers to write line by line, a process that is time-consuming, labor-intensive, and error-prone. Existing automatic generation methods either rely on fixed templates (with poor flexibility) or require the construction of complex mathematical models (high cost). This study takes a different approach, enabling large language models to "understand" equipment parameters, safety rules, and historical cases. By combining retrieval-augmented technology to accurately retrieve knowledge, simulation environments for repeated logic verification, and multiple AI roles collaborating on distinct tasks (reading materials, writing code, identifying issues, and fixing bugs), it achieves a workflow where inputting room information yields a usable control program in five minutes. In a real-world scenario involving 173 laboratories, the one-time generation accuracy reached 97.1%, and the system has been deployed in 381 ventilation subsystems where it operates stably.

Background

The core advantage of intelligent HVAC control lies in energy conservation and efficiency, making it widely applied in various building types such as office buildings, hospitals, and laboratories. However, equipment brands, quantities, and communication protocols vary from building to building. Much like each piece of furniture differs in size and material, this variability prevents control code from being reused; engineers are forced to rewrite code for each room, taking an average of 15 minutes and often leading to safety incidents such as frozen pipes or equipment collisions due to oversight. Although the template method is fast, it is like a "universal key" that fails to work with new equipment. The model-driven method is rigorous but resembles "designing a blueprint before building the house," where modeling takes far longer than the coding itself. Therefore, enabling AI to understand general rules while flexibly handling diverse on-site requirements has become a critical contradiction that the industry urgently needs to resolve.

Key Highlights

  1. Intelligent "blueprint reading plus manual checking": Using retrieval-augmented technology helps large models quickly locate equipment parameters and safety rules, akin to an experienced engineer consulting blueprints for basis. This avoids fabricating information and increases code compliance to 97.1%.

  2. Multi-AI role collaborative error correction: Tasks are divided among four AI roles—"documentarian," "programmer," "quality inspector," and "repairman," who each perform their specific duties. This coordination, similar to a construction crew, reduces the single-generation error rate by more than 60%.

  3. Virtual "stress testing" for safety: Before generating code, the system simulates more than 20 extreme conditions, such as freezing pipes in winter and restarts after power outages, in a digital twin environment. This is equivalent to conducting a "safety checkup" on the program, eliminating the risk of improper operation on real equipment.

Summary and Outlook

Based on a large language model-driven multi-agent collaborative framework, the use of retrieval-augmented knowledge injection, simulation closed-loop verification, and task-decoupled execution achieved highly reliable automatic generation of HVAC control code. This technology possesses the dual advantages of strong generalization and high safety. The results show that in 173 differentiated laboratories, the one-time generation accuracy was 97.1%, and in 381 real-world ventilation subsystems, the system achieved stable operation with zero failures. This research not only addresses the industry pain points of control code in building intelligence that is "hard to write and unsafe to use" but also, through a methodological innovation integrating "domain knowledge, AI reasoning, and virtual verification," provides a transferable technical paradigm for software-defined hardware in fields such as industrial automation, smart energy, and smart manufacturing.

errShare
errSave
Room thermal modelling adapted to the test of HVAC control systems
err2002-08-01
err48
PREAI
errRiederer, P; Marchio, D; Visier, JC; Husaunndee, A; Lahrech, R
errShare
errSave
Development of a testing method for control HVAC systems by emulation
err2002-10-01
err17
PREAI
errLahrech, R; Gruber, P; Riederer, P; Tessier, P; Visier, JC
errShare
errSave
errShare
errSave

Journal

Buildings cover
Buildings
IF:
3.1
Papers:
1.9W
Citations:
4.0W

Organization

zhe jiang university cover
zhe jiang university
Scholars:
1.5K
Papers: 463
Citations: 9.6W
H
hangzhou
Scholars:
1
Papers: 1
Citations: 0
researcher View more organizations
Cited Papers

Cited Papers

No cited papers available