Building energy consumption optimization method based on Decision Transform model

By defining the Markov decision process and reconstructing the input trajectory sequence in the Decision Transformer model, and modifying the attention mechanism, the problem of insufficient joint state and action modeling capabilities in multi-agent systems is solved, and the problem of building energy consumption is realized. Efficient energy management and migration generalization capabilities in management scenarios reduce power costs.

CN118569313AInactive Publication Date: 2024-08-30NANJING UNIV OF SCI & TECH

Patent Information

Application Number
CN202410637921.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The traditional Decision Transformer model lacks the ability to model joint states and joint actions in multi-agent systems under multi-task conditions, making it difficult to adapt to dynamic changes in different building environments in building energy consumption management scenarios.

Method used

By defining the elements of the Markov decision process in the building energy consumption management scenario, reconstructing the input trajectory sequence, performing causal mask correction on the attention mechanism of the Decision Transformer model, designing the corresponding loss function for multiple rounds of training, and optimizing the model in Performance under multitasking.

Benefits of technology

It improves the model's migration generalization performance and energy management efficiency under new tasks, and can provide optimization strategies under different building numbers and environments to reduce power costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569313A
    Figure CN118569313A
Patent Text Reader

Abstract

The invention discloses a building energy consumption optimization method based on a Decision Transform model, and belongs to the technical field of building energy consumption management.The method comprises the steps that Markov decision process elements including states, actions and reward mechanisms in a building energy consumption management scene are defined firstly, and corresponding expert decision data are collected; then remarking the rewards, representing the accumulated rewards behind each decision point as track return R, reconstructing an input track sequence, and providing a pre-training data set for the decision model; and finally, training and reconstructing an input trajectory sequence through a Decision Transform model, performing causal mask correction on an attention mechanism in the Decision Transform, designing a corresponding loss function for continuous actions, performing multi-round training on the model by using the modeled trajectory sequence until convergence, obtaining an optimal building energy consumption management strategy, and performing testing under a new task. The method provided by the invention has strong migration and generalization performance under a new task, and provides a new solution thought and scheme for improving the building energy consumption management quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of building energy consumption management, and in particular relates to a building energy consumption optimization method based on a Decision Transformer model. Background Art

[0002] With the rapid development and widespread application of science and technology, the number and energy consumption of urban buildings are also increasing rapidly, becoming an important challenge for sustainable development. Effective management of urban building energy consumption is crucial to reducing electricity costs, improving energy efficiency and reducing environmental impact. Traditional building energy consumption management methods usually rely on fixed energy-saving strategies or manual experience, which are difficult to adapt to the dynamically changing factors and needs in the building environment.

[0003] In recent years, reinforcement learning, as an artificial intelligence method, has made significant progress in the field of intelligent decision-making. However, traditional reinforcement learning faces challenges in migration and generalization when facing building energy management. This may be due to the overfitting of the algorithm to the training environment and the lack of the ability to effectively explore and adapt to the new building environment, resulting in the inability of the learned strategy to generalize well to new scenarios with different dynamic characteristics.

[0004] As a new type of offline reinforcement learning algorithm, the Decision Transformer model can effectively handle long-sequence decision problems by adopting a self-attention mechanism. It can autonomously learn and adjust decision strategies by learning long-term dependencies in historical data, adapt to different building environments, and provide more efficient energy management quality. The Decision Transformer model is superior to traditional reinforcement learning algorithms in terms of transfer generalization performance. It can use historical data from multiple tasks or environments to learn a general strategy, so it can still maintain good performance when facing new and unseen building environments. It is expected to overcome the challenges faced by traditional reinforcement learning and provide more intelligent and adaptive energy-saving strategies for building energy consumption management.

[0005] However, the Decision Transformer model still has some limitations when applied to building energy management scenarios. These limitations include insufficient ability to model joint states and joint actions in multi-agent systems under multiple tasks. Therefore, it is necessary to develop new training methods to improve the effect of the Decision Transformer model in building energy management applications to further improve energy management efficiency. Summary of the invention

[0006] The purpose of the present invention is to provide a building energy consumption optimization method based on a Decision Transformer model to solve the problem that the traditional Decision Transformer model in the prior art is insufficient in modeling the joint state and joint action in a multi-agent system when applied to a building energy consumption management scenario under multiple tasks.

[0007] To achieve the above object, the present invention provides a building energy consumption optimization method based on a Decision Transformer model, comprising the following steps:

[0008] Step 1: Define the elements of the Markov decision process in the building energy management scenario, including states, actions, and reward mechanisms, and collect corresponding expert decision data;

[0009] Step 2: Re-label the rewards, represent the cumulative rewards after each decision point as the trajectory reward R, reconstruct the input trajectory sequence τ, and provide a pre-training data set for the decision model;

[0010] Step 3: Use the reconstructed input trajectory sequence τ in step 2 to train the Decision Transformer model, modify the causal mask of the attention mechanism in the Decision Transformer, design the corresponding loss function for continuous actions, and use the modeled trajectory sequence to train the model for multiple rounds until convergence. The optimal building energy management strategy is obtained and tested under the new task.

[0011] Preferably, in step 1, by modeling the environment, states, actions and reward mechanisms closely related to building energy consumption management are defined; wherein the states include date, hour, regional temperature, regional humidity, regional solar radiation, electricity price, solar power generation of different buildings, and net power consumption; actions include adjusting the power storage state of batteries configured in different buildings; the reward mechanism is determined based on the total net power consumption and price of all buildings, with the goal of reducing electricity costs; and an expert decision data set for building energy consumption management is generated using reinforcement learning or mathematical solution methods.

[0012] Preferably, the specific expression of the trajectory return R in step 2 is as follows:

[0013]

[0014] Among them, r t' Represents the reward obtained after decision point t'.

[0015] Preferably, the specific expression for reconstructing the input trajectory sequence τ in step 2 is as follows:

[0016]

[0017] in, Represents the state of the 0th to mth buildings from time step 0 to T, represents the actions of the 0th to mth buildings from time step 0 to T, (R0,…,R T ) represents the trajectory return from time steps 0 to T.

[0018] Preferably, the causal masking modification of the attention mechanism in the Decision Transformer is as follows: each element in the input sequence in the attention mechanism can only observe the sequence information of the current position and its previous position, so that the state of each agent in the input sequence Not only can we observe the current position and its previous sequence information, but we can also observe the state of all agents at time step t. information.

[0019] Preferably, in step 3, the specific expression of the corresponding loss function designed for the continuous action is as follows:

[0020]

[0021] Among them, a t is the real action at time step t, is the action predicted by the model at time step t, K is the size of the action space. When training the Decision Transformer model, the model observes the state information of all buildings at the current time step t and the previous trajectory sequence information, and uses the state Predict the action of the corresponding building at time step t pass The loss function performs gradient backpropagation to update the model parameters. After training, the migration and generalization performance of the model is tested in new tasks.

[0022] Therefore, the present invention adopts the above-mentioned building energy consumption optimization method based on the Decision Transformer model, which has the following beneficial effects:

[0023] (1) Innovatively apply the Decision Transformer model to the building energy management environment;

[0024] (2) The input sequence format in model training was reconstructed, and the causal mask in the attention mechanism was corrected, so that the model can be jointly trained in multiple tasks with different numbers of buildings, solving the problem of inconsistent input dimensions caused by different numbers of buildings;

[0025] (3) The Decision Transformer model trained by the present invention can perform well under new tasks without the need to retrain a new model.

[0026] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is an overall flow chart of a building energy consumption optimization method based on a Decision Transformer model of the present invention;

[0028] Figure 2 This is the architecture diagram of the Decision Transformer model;

[0029] Figure 3 This is a diagram of the attention mask mechanism in the Decision Transformer model;

[0030] Figure 4 1 is a diagram of the training and testing results of the Decision Transformer in the example of the present invention; wherein (a) is a graph of the training loss convergence curve of the model, and (b) is a histogram of the test of the model under a new task. DETAILED DESCRIPTION

[0031] The following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] Example

[0033] See also Figure 1-4 , a building energy consumption optimization method based on the Decision Transformer model, comprising the following steps:

[0034] Step 1, define the elements of the Markov decision process in the building energy consumption management scenario, including states, actions and reward mechanisms, and collect corresponding expert decision data; wherein, by modeling the environment, define the states, actions and reward mechanisms closely related to building energy consumption management; wherein the states include date, hour, regional temperature, regional humidity, regional solar radiation, electricity price, solar power generation of different buildings, and net power consumption; actions include adjusting the power storage state of batteries configured in different buildings; the reward mechanism is determined based on the total net power consumption and price of all buildings, with the goal of reducing power costs; generate expert decision data sets for building energy consumption management using reinforcement learning or mathematical solution methods. In this embodiment, we simulate a virtual regional building complex model, including residential units and commercial buildings, which have their own energy storage systems, cooling and heating power requirements, photovoltaic systems, etc. The photovoltaic system, as one of the building energy sources, can offset part of the power consumption from the power grid. The entire system needs to optimize power consumption by controlling battery charging and discharging. Define the states, actions and reward mechanisms closely related to building energy consumption management. The states include date, hour, regional temperature, regional humidity, regional solar radiation, electricity price, solar power generation of different buildings, net power consumption, battery status information, etc. States such as regional temperature, regional humidity, regional solar radiation, electricity price, power consumption, etc. can use the data generated by the simulator. All buildings are set to be equipped with energy storage systems of the same specifications, and the simulation time interval is set to every hour. A complete trajectory sequence contains 8760 time steps, which is equivalent to a time span of one year. The actions include adjusting the power storage state of batteries configured in different buildings. The reward mechanism is determined based on the total net power consumption and price of all buildings, with the goal of reducing electricity costs. Generate expert decision data for building energy management using reinforcement learning or mathematical solution methods. Standardize the states in the generated data set and normalize the actions.

[0035] Step 2: Relabel the rewards, express the cumulative rewards after each decision point as the trajectory reward R, reconstruct the input trajectory sequence τ, and provide a pre-training data set for the decision model; specifically, relabel the rewards in the data set, and the specific trajectory reward R is the cumulative reward after each decision point. The specific expression of the trajectory reward R is as follows:

[0036]

[0037] Among them, r t' Represents the reward obtained after decision point t'.

[0038] The decision data is sampled to generate pre-training data for the model. In order to solve the problem of inconsistent state and action dimensions during joint training caused by the inconsistent number of buildings under different tasks, the state and action space of each building are decoupled, the maximum context length in the Decision Transformer model is set to 20, and the input trajectory sequence τ is reconstructed. The specific expression is as follows:

[0039]

[0040] in, Represents the state of the 0th to mth buildings from time step 0 to T, represents the actions of the 0th to mth buildings from time step 0 to T, (R0,…,R T ) represents the trajectory return from time steps 0 to T.

[0041] Step 3: Use the reconstructed input trajectory sequence τ in step 2 of the Decision Transformer model training to correct the causal mask of the attention mechanism in the Decision Transformer, design the corresponding loss function for continuous actions, use the modeled trajectory sequence to train the model for multiple rounds until convergence, obtain the optimal building energy management strategy, and test it under the new task. The specific method of correcting the causal mask of the attention mechanism in the Decision Transformer is as follows: initialize the Decision Transformer model parameters, and before starting training, correct each element in the input sequence in the attention mechanism to only observe the current position and the previous sequence information, so that the state of each agent in the input sequence Not only can we observe the current position and its previous sequence information, but we can also observe the state of all agents at time step t. Information. The specific expression of the corresponding loss function designed for continuous actions is as follows:

[0042]

[0043] Among them, a t is the real action at time step t, is the action predicted by the model at time step t, K is the size of the action space. When training the Decision Transformer model, the model observes the state information of all buildings at the current time step t and the previous trajectory sequence information, and uses the state Predict the action of the corresponding building at time step t pass The loss function performs gradient back propagation to update the model parameters. After training, the model's migration and generalization performance is tested in new tasks. Specifically, when training the Decision Transformer model, the output dimension of the embedding layer of the Decision Transformer model is set to 256, the number of decoder layers is 5, the number of attention heads in the multi-head attention is 1, and the learning rate is 0.0005.

[0044] After training, the transfer generalization performance of the model is tested in new tasks to evaluate the performance of the model under new tasks. Different buildings have different state variables such as solar power generation and net power consumption. The new task is defined as selecting different buildings or the number of buildings to form a new whole for joint decision-making. By comparing the normalized total cumulative returns, Figure 4 (b) shows the performance of the Decision Transformer model and the SAC (Soft Actor-Critic) reinforcement learning algorithm on new tasks. DT is the pre-trained Decision Transformer model and SAC is the Soft Actor-Critic reinforcement learning algorithm. Both are tested on the same new task. The results show that the return of the Decision Transformer model in the new task is no less than that of the current advanced SAC reinforcement learning algorithm. Therefore, it shows that the Decision Transformer model has a strong transfer and generalization ability.

[0045] Therefore, the present invention adopts the above-mentioned building energy consumption optimization method based on the Decision Transformer model to reduce the building electricity cost through intelligent decision-making. In the building energy consumption management environment, by introducing the Decision Transformer model and improving the trajectory sequence modeling, it can handle the multi-agent joint decision-making problem under long sequences and multiple tasks, and has strong generalization ability in new tasks, providing a new solution and plan for reducing the building energy consumption cost.

[0046] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.

Claims

1. A building energy consumption optimization method based on the Decision Transformer model, characterized in that: The following steps are involved: Step 1: Define the elements of the Markov decision process in the building energy management scenario, including states, actions, and reward mechanisms, and collect corresponding expert decision data; Step 2: Re-label the rewards, represent the cumulative rewards after each decision point as the trajectory reward R, reconstruct the input trajectory sequence τ, and provide a pre-training data set for the decision model; Step 3: Use the reconstructed input trajectory sequence τ in step 2 to train the Decision Transformer model, modify the causal mask of the attention mechanism in the Decision Transformer, design the corresponding loss function for continuous actions, and use the modeled trajectory sequence to train the model for multiple rounds until convergence. The optimal building energy management strategy is obtained and tested under the new task.

2. The building energy consumption optimization method based on the Decision Transformer model according to claim 1 is characterized in that: In step 1, by modeling the environment, the states, actions, and reward mechanisms closely related to building energy management are defined; the states include date, hour, regional temperature, regional humidity, regional solar radiation, electricity price, solar power generation of different buildings, and net power consumption; the actions include adjusting the power storage state of batteries configured in different buildings; The incentive mechanism is determined based on the total net electricity consumption and price of all buildings, with the goal of reducing electricity costs; Generate expert decision-making datasets for building energy management using reinforcement learning or mathematical solution methods.

3. The building energy consumption optimization method based on the Decision Transformer model according to claim 2 is characterized in that: The specific expression of the trajectory return R in step 2 is as follows: Among them, r t' Represents the reward obtained after decision point t'.

4. The building energy consumption optimization method based on the Decision Transformer model according to claim 3 is characterized by: The specific expression for reconstructing the input trajectory sequence τ in step 2 is as follows: in, Represents the state of the 0th to mth buildings from time step 0 to T, represents the actions of the 0th to mth buildings from time step 0 to T, (R0,…,R T ) represents the trajectory return from time steps 0 to T.

5. The building energy consumption optimization method based on the Decision Transformer model according to claim 4 is characterized in that: The causal mask correction of the attention mechanism in the Decision Transformer is as follows: each element in the input sequence of the correction attention mechanism can only observe the sequence information of the current position and its previous position, so that the state of each agent in the input sequence Not only can we observe the current position and its previous sequence information, but we can also observe the state of all agents at time step t. information.

6. The building energy consumption optimization method based on the Decision Transformer model according to claim 5 is characterized by: In step 3, the specific expression of the corresponding loss function designed for continuous actions is as follows: Among them, a t is the real action at time step t, is the action predicted by the model at time step t, K is the size of the action space. When training the Decision Transformer model, the model observes the state information of all buildings at the current time step t and the previous trajectory sequence information, and uses the state Predict the action of the corresponding building at time step t pass The loss function performs gradient backpropagation to update the model parameters. After training, the migration and generalization performance of the model is tested in new tasks.

Citation Information

Patent Citations

  • Inverse reinforcement learning method and system for enhancing authenticity of traffic simulator

    CN113221469A

  • Reward generation and optimization method for weapon force confrontation reinforcement learning

    CN115238858A

  • Direct current building energy management optimization method

    CN115912424A

  • Transferable decision model generation method and device based on deep reinforcement learning, storable medium and equipment

    CN116977792A

  • Decision-making method based on model reinforcement learning

    CN117953351A

Cited By

  • Path coverage method based on retrieval enhancement mechanism

    CN120258279A

  • Building energy management method and device based on large model

    CN120258330A