Building energy consumption prediction method based on large language model
Through the large language model combined with time and spatial text prompts, the problem that existing building energy consumption prediction methods are not universal is solved, and energy consumption prediction for different regions and types of buildings is realized, prediction accuracy and model adaptability are improved, and energy efficiency management of urban-level building complexes is suitable.
Patent Information
- Application Number
- CN202510782722.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-06-12
AI Technical Summary
The existing building energy consumption prediction methods cannot achieve general predictions for different regions and different types of buildings, and there is a problem that there is a large investment in computing resources and human resources, which is difficult to meet the scale needs of urban-level building complex energy efficiency management.
The building energy consumption prediction method based on a large language model is adopted, and the time and space text prompts are constructed by obtaining the energy consumption time series data, metadata and environmental data of the building to be tested, and the energy consumption prediction is predicted using the time series coding submodule, the text prompt coding submodule, the cross-modal alignment module and the time series prediction module to achieve the correlation and consistency of the cross-modal data.
Energy consumption prediction for different regions and different types of buildings is realized, the universality and accuracy of the prediction model is improved, the demand for computing resources and human resources is reduced, and the energy efficiency management of urban-level building complexes is adapted to.
Smart Images

Figure CN120296530A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of building energy consumption prediction. Specifically, it relates to a building energy consumption prediction method based on a large language model. Background Art
[0002] With the acceleration of social and economic development and urbanization, modern buildings have the characteristics of diverse types (such as including: residential, commercial complexes, public buildings, etc.) and wide geographical distribution. Due to the functional differences of each building type and the different climates of the regions where each building is located, building energy consumption data shows significant spatio-temporal heterogeneity, resulting in severe challenges for traditional prediction methods. Existing building energy consumption prediction methods generally adopt the method of "one building, one model", that is, data needs to be independently collected and the model needs to be retrained for each building. This repetitive modeling method not only requires a large amount of computing resources and professional human resources, but also is difficult to meet the large-scale demand for energy efficiency management of urban-level building clusters. Therefore, there is an urgent need for a general building energy consumption prediction method to achieve energy consumption prediction for buildings in different regions and of different types. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a building energy consumption prediction method based on a large language model, which can solve the technical problem that the existing building energy consumption prediction method is not general and cannot achieve energy consumption prediction for buildings in different regions and of different types.
[0004] In a first aspect, an embodiment of the present invention provides a building energy consumption prediction method based on a large language model, including: Obtaining data of a building to be measured; wherein, the data of the building to be measured includes: energy consumption time series data of the building to be measured, metadata of the characteristics of the building to be measured, and environmental data of the area where the building to be measured is located; Constructing a text prompt based on the data of the building to be measured; wherein, the text prompt includes: a time text prompt and a space text prompt; Input the energy consumption time series data of the building to be measured and the text prompt into the trained energy consumption prediction model to obtain the future energy consumption prediction value of the building to be measured; wherein, the energy consumption prediction model is trained by a building training data set marked with the actual future energy consumption value; the energy consumption prediction model includes: a time series encoding sub-module, a text prompt encoding sub-module, a cross-modal alignment module, and a time series prediction module; the time series encoding sub-module is used to determine a time series embedding based on the energy consumption time series data; the text prompt encoding sub-module is used to determine a text prompt embedding based on the text prompt; the cross-modal alignment module is used to perform cross-modal alignment based on the time series embedding and the text prompt embedding to obtain an aligned time series embedding; the time series prediction module is used to perform prediction calculations based on the aligned time series embedding to obtain the future energy consumption prediction value of the building to be measured; the text prompt encoding sub-module includes a large language model.
[0005] Further, an embodiment of the present invention provides a first possible implementation manner of the first aspect, wherein the step of constructing a text prompt based on the data of the building to be measured includes: Construct the time text prompt based on the energy consumption time series data of the building to be measured; Construct the space text prompt based on the metadata of the characteristics of the building to be measured and the environmental data of the area where the building to be measured is located; wherein, the metadata of the characteristics of the building to be measured includes: the type, area, and longitude and latitude of the location of the building to be measured.
[0006] Further, an embodiment of the present invention provides a second possible implementation manner of the first aspect, wherein the step of constructing the time text prompt based on the energy consumption time series data of the building to be measured includes: Divide the energy consumption time series data of the building to be measured into multiple sequence data segments evenly according to time, and determine the energy consumption value of the building to be measured in each sequence data segment; Based on the energy consumption value of the building to be measured in each sequence data segment, determine the energy consumption trend of the building to be measured; Construct the time text prompt based on the start time, end time of the energy consumption time series data of the building to be measured, the energy consumption value of the building to be measured in each sequence data segment, and the energy consumption trend of the building to be measured.
[0007] Further, an embodiment of the present invention provides a third possible implementation manner of the first aspect, wherein determining a time series embedding based on the energy consumption time series data includes: Perform reversible instance normalization processing on the energy consumption time series data of the building to be measured through the time series encoding sub-module to obtain normalized sequence data; Convert the normalized sequence data into a time series learnable matrix; Input the time series learnable matrix into a time series encoder to obtain a time series embedding.
[0008] Furthermore, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, wherein determining the text prompt embedding based on the text prompt includes: Perform tokenization processing on the text prompt based on the token parser in the text prompt encoding sub-module to obtain a plurality of tokens; Input each of the tokens into a large language model, obtain the output of the last hidden layer of the large language model, and input the output of the last hidden layer into a text prompt encoder to obtain the text prompt embedding.
[0009] Furthermore, an embodiment of the present invention provides a fifth possible implementation manner of the first aspect, wherein performing cross-modal alignment based on the time series embedding and the text prompt embedding to obtain an aligned time series embedding includes: Perform linear transformation on the time series embedding and the text prompt embedding respectively based on the cross-modal alignment module, and perform matrix multiplication calculation and normalization calculation based on the linear transformation results of the time series embedding and the linear transformation results of the text prompt embedding to obtain a channel similarity matrix of the time series embedding and the text prompt embedding; Perform linear transformation processing and matrix addition processing on the channel similarity matrix to obtain the aligned time series embedding.
[0010] Furthermore, an embodiment of the present invention provides a sixth possible implementation manner of the first aspect, wherein performing prediction calculation based on the aligned time series embedding to obtain a future energy consumption prediction value of the building to be measured includes: Perform mapping variable processing on the aligned time series embedding through the time series prediction module and then perform prediction calculation to obtain a future energy consumption prediction value of the building to be measured.
[0011] Furthermore, an embodiment of the present invention provides a seventh possible implementation manner of the first aspect, wherein the training steps of the energy consumption prediction model include: Obtain the energy consumption time series data of the building, the metadata of the building characteristics, and the environmental data of the area where the building is located; Construct a text prompt based on the data of the building to be measured; Mark the text prompt of each building with the actual future energy consumption value corresponding to the sequence of energy consumption changing over time, and establish a sample data set according to the marked text prompt of each building and the sequence of energy consumption changing over time; wherein, the sample data set includes a training data set; Input the training data set into the energy consumption prediction model, and perform model training on the energy consumption prediction model to obtain the trained energy consumption prediction model.
[0012] Further, an eighth possible implementation manner of the first aspect is provided in the embodiment of the present invention, where the sample data set further includes a verification data set; The building energy consumption prediction method further includes: After each round of training of the energy consumption prediction model with the training data set, input the verification data set into the energy consumption prediction model for verification, obtain the mean square error as the loss function. If the mean square error of this round of training is less than the mean square error of the previous round of training, update the loss function and perform the next round of model training; If the loss function has not been updated for a preset number of training rounds continuously, verify whether the total number of training rounds is greater than the preset round threshold. If the total number of training rounds is less than the preset round threshold, perform the next round of model training; if the total number of training rounds is not less than the preset round threshold, end the model training.
[0013] Further, a ninth possible implementation manner of the first aspect is provided in the embodiment of the present invention, where the sample data set further includes a test data set; The building energy consumption prediction method further includes: Based on the test data set corresponding to each building, determine the actual future energy consumption value of each building; Input the test data set into the trained energy consumption prediction model to obtain the predicted future energy consumption value of each building; Based on the actual value and the predicted value of the future energy consumption of each building, obtain a performance evaluation index to evaluate the performance of the trained energy consumption prediction model; wherein, the performance evaluation index includes: mean absolute error, root mean square error, and coefficient of determination.
[0014] The embodiment of the present invention provides a method for predicting building energy consumption based on a large language model, the method comprising: obtaining data of a building to be tested; wherein the data of the building to be tested comprises: time series data of energy consumption of the building to be tested, metadata of features of the building to be tested, and environmental data of the area where the building to be tested is located; constructing a text prompt based on the data of the building to be tested; wherein the text prompt comprises: a time text prompt and a space text prompt; inputting the time series data of energy consumption of the building to be tested and the text prompt into a trained energy consumption prediction model to obtain a predicted value of future energy consumption of the building to be tested; wherein the energy consumption prediction model is composed of a building training data set marked with actual future energy consumption values The energy consumption prediction model includes: a time series encoding submodule, a text prompt encoding submodule, a cross-modal alignment module and a time series prediction module; the time series encoding submodule is used to determine the time series embedding based on the energy consumption time series data; the text prompt encoding submodule is used to determine the text prompt embedding based on the text prompt; the cross-modal alignment module is used to perform cross-modal alignment based on the time series embedding and the text prompt embedding to obtain the aligned time series embedding; the time series prediction module is used to perform prediction calculation based on the aligned time series embedding to obtain the future energy consumption prediction value of the building to be tested; the text prompt encoding submodule includes a large language model. The present invention collects data of the building to be tested, and constructs text prompts according to the data of the building to be tested, so that the text prompts can reflect the region and type of the building to be tested. The energy consumption time series data of the building to be tested and the constructed text prompts are transmitted to the trained energy consumption prediction model to determine the time series embedding and the text prompt embedding. The time series embedding and the text prompt embedding are aligned through a cross-modal alignment module, and the potential association between the energy consumption time series data of the building to be tested and the text prompts is mined. The energy consumption time series data of the building to be tested and the text prompts are integrated, so that the knowledge obtained from the text prompt embedding is transferred to the time series embedding, and the correlation and consistency of the cross-modal data are realized, so that the building energy consumption prediction method has universality, and finally the future energy consumption prediction value of the building to be tested is obtained through the aligned time series embedding, and the energy consumption prediction of buildings of different regions and types is realized.
[0015] Other features and advantages of the embodiments of the present invention will be described in the following description, or some features and advantages can be inferred or determined without doubt from the description, or can be learned by implementing the above-mentioned techniques of the embodiments of the present invention.
[0016] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0018] Figure 1 It shows a schematic flowchart of a building energy consumption prediction method based on a large language model provided by an embodiment of the present invention; Figure 2 It shows a schematic flowchart of energy consumption prediction using a trained energy consumption prediction model provided by an embodiment of the present invention; Figure 3 It shows a schematic flowchart of building energy consumption prediction based on an energy consumption prediction model provided by an embodiment of the present invention. Specific Embodiments
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will describe the technical solutions of the present invention in conjunction with the drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention.
[0020] Currently, in order to solve the problem that the building energy consumption prediction methods in the prior art are not universal and cannot achieve energy consumption prediction for different regions and different types of buildings, attempts have been made to apply large language models (LLMs) represented by ChatGPT to building energy management, including: on the one hand, some studies have constructed an expert system integrating digital twin technology and LLMs to achieve real-time response functions such as device control and data retrieval through multimodal interaction. The core LLM of this system mainly undertakes natural language interaction tasks and does not involve the prediction and analysis of building energy consumption; on the other hand, attempts have been made to expand the building energy modeling ability of LLMs, such as using a fine-tuned LLM to generate IDF-format modeling files suitable for the EnergyPlus building energy consumption simulation software.
[0021] However, when applying LLM models to the field of building energy consumption prediction in the existing technology, the following challenges still exist. On the one hand, the in-depth modeling of energy consumption time series features is insufficient. Although some general LLM models have mastered some building domain knowledge (such as the basic principles of HVAC systems), they lack a deep understanding of the time series characteristics of energy consumption and are difficult to accurately capture professional laws such as building thermodynamic responses. On the other hand, there are semantic alignment defects in cross-modal data fusion. There are inherent challenges in multi-modal data fusion - when structured energy consumption data (time series data) and unstructured text prompts (domain knowledge) are jointly input, insufficient cross-modal feature alignment easily leads to information entanglement, directly affecting the prediction accuracy. Existing LLM models still cannot fully solve the semantic association problem between time series data and text prompts when performing time series prediction tasks. From the above analysis, it can be seen that combining large language models into the field of building energy consumption prediction still cannot solve the technical problems that existing building energy consumption prediction methods are not general and cannot achieve energy consumption prediction for different regions and different types of buildings.
[0022] To address the above issues, an embodiment of the present invention provides a building energy consumption prediction method based on a large language model. The following provides a detailed introduction to the embodiments of the present invention.
[0023] This embodiment provides a building energy consumption prediction method based on a large language model. This method can be applied to electronic devices such as computers. Refer to Figure 1 the flowchart of a building energy consumption prediction method based on a large language model shown in Step S102, obtain data of the building to be measured; wherein, the data of the building to be measured includes: energy consumption time series data of the building to be measured, metadata of the characteristics of the building to be measured, and environmental data of the area where the building to be measured is located; Collect the energy consumption time series data of the building to be measured, the metadata of the characteristics of the building to be measured, and the environmental data of the area where the building to be measured is located. Among them, the metadata of the characteristics of the building to be measured includes the area, type, longitude and latitude, etc. of the building to be measured. The type of the building to be measured can be divided into the following types according to its use: public, education, lodging, office, industrial, parking, retail, and other; the environmental data of the area where the building to be measured is located is collected from the meteorological station closest to the building to be measured, and mainly includes the air temperature, dew point, wind direction, wind speed, etc. of the area where the building to be measured is located.
[0024] Step S104, construct a text prompt based on the data of the building to be measured; wherein, the text prompt includes: a time text prompt and a space text prompt; Construct a temporal text prompt containing temporal information based on the energy consumption time series data of the building to be measured, and construct a spatial text prompt containing spatial information based on the metadata of the characteristics of the building to be measured and the environmental data of the area where the building to be measured is located. During the process of predicting the energy consumption of the building to be measured, the temporal information contained in the energy consumption time series data of the building to be measured will affect the prediction result of the energy consumption value of the building to be measured. At the same time, the different spatial information of buildings to be measured of different types and in different regions will also make the predicted values of building energy consumption different. Therefore, the temporal information and spatial information of the building to be measured both cover extremely valuable semantic details, and these details can subsequently help the large language model deeply understand the spatio-temporal patterns in specific scenarios.
[0025] Step S106, input the energy consumption time series data and text prompt of the building to be measured into the trained energy consumption prediction model to obtain the future energy consumption prediction value of the building to be measured; Among them, the energy consumption prediction model is trained by a building training data set marked with the actual future energy consumption value; the above-mentioned building training data set includes the energy consumption time series data, metadata, and environmental data of buildings of different types in different regions; The energy consumption prediction model includes: a time series encoding sub-module, a text prompt encoding sub-module, a cross-modal alignment module, and a time series prediction module; the time series encoding sub-module is used to determine a time series embedding based on the energy consumption time series data; the text prompt encoding sub-module is used to determine a text prompt embedding based on the text prompt; the cross-modal alignment module is used to perform cross-modal alignment based on the time series embedding and the text prompt embedding to obtain an aligned time series embedding; the time series prediction module is used to perform prediction calculations based on the aligned time series embedding to obtain the future energy consumption prediction value of the building to be measured; the text prompt encoding sub-module includes a large language model; In the above steps, the large language model is used as an important component of the text prompt encoding sub-module in the energy consumption prediction model. Among them, the energy consumption prediction model includes a dual-modal encoding module, a cross-modal alignment module, and a time series prediction module. The dual-modal encoding module is composed of a time series encoding sub-module and a text prompt encoding sub-module. The energy consumption time series data and text prompt of the building to be measured are processed without entanglement through the dual-modal encoding module to obtain a time series embedding and a text prompt embedding respectively; the cross-modal alignment module based on channel similarity retrieval performs cross-modal alignment on the time series embedding and the text prompt embedding, screens out the time series embedding without information entanglement from the text prompt embedding with information entanglement, mines the potential association between the energy consumption time series data and the text prompt of the building to be measured, fuses the energy consumption time series data and the text prompt of the building to be measured to obtain an aligned time series embedding, and finally inputs the aligned time series embedding into the time series prediction module for prediction calculation to obtain the future energy consumption prediction value of the building to be measured.
[0026] The above-mentioned building energy consumption prediction method provided by the embodiment of the present invention collects data of the building to be tested, and constructs text prompts according to the data of the building to be tested, so that the text prompts can reflect the region and type of the building to be tested, and transmits the energy consumption time series data of the building to be tested and the constructed text prompts to the trained energy consumption prediction model, determines the time series embedding and the text prompt embedding, and aligns the time series embedding with the text prompt embedding through a cross-modal alignment module, explores the potential association between the energy consumption time series data of the building to be tested and the text prompts, and fuses the energy consumption time series data of the building to be tested with the text prompts, so that the knowledge obtained from the text prompt embedding is transferred to the time series embedding, and the correlation and consistency of cross-modal data are realized, so that the building energy consumption prediction method has universality, and finally obtains the future energy consumption prediction value of the building to be tested through the aligned time series embedding, realizing the energy consumption prediction of buildings in different regions and types.
[0027] In one embodiment, this embodiment provides a specific implementation method of constructing a text prompt based on the data of the building to be tested, including: Construct time text prompts based on the energy consumption time series data of the building to be tested; In the above steps, the starting time of the sequence data needs to be determined based on the energy consumption time series data of the building to be tested. , End time , energy consumption values and energy consumption trends.
[0028] Constructing a spatial text prompt based on metadata of the building features to be measured and environmental data of the area where the building to be measured is located; wherein the metadata of the building features to be measured includes: the type, area and longitude and latitude of the location of the building to be measured; In the above steps, a unique label of the building to be tested is constructed as a spatial text prompt based on the latitude and longitude, area, type of the building to be tested and the environmental data of the area where the building to be tested is located.
[0029] In one embodiment, this embodiment provides a specific implementation method of constructing a time text prompt based on the energy consumption time series data of the building to be tested, including: The energy consumption time series data of the building to be tested is evenly divided into multiple sequence data segments according to time, and the energy consumption value of the building to be tested in each sequence data segment is determined; Format the energy consumption time series data of the building to be tested into a date string , and to the start time and end time Assign values and divide the energy consumption time series data of the building to be tested into multiple sequence data segments evenly according to time. Specifically, the starting time can be and end time Evenly divide the energy consumption time series data of the building to be measured into n segments of sequence data fragments, and determine the energy consumption value of the building to be measured in each segment of sequence data. Based on the energy consumption value of the building to be measured in each segment of sequence data, establish an energy consumption string .
[0030] Based on the energy consumption value of the building to be measured in each segment of sequence data fragment, determine the energy consumption trend of the building to be measured; Based on the energy consumption value of the building to be measured in each segment of sequence data fragment, the energy consumption trend of the building to be measured is determined as: ; ; Wherein, is the energy consumption trend (i.e., [Trends]), is the energy consumption value of the i-th segment of sequence data fragment, is the energy consumption value of the (i + 1)-th segment of sequence data fragment, is the energy consumption change value of the i-th segment of sequence data fragment, i = 1,..., n - 1.
[0031] Construct a time text prompt based on the start time, end time, energy consumption value of the building to be measured in each segment of sequence data fragment, and energy consumption trend of the energy consumption time series data of the building to be measured; In one embodiment, the format of each character in the formatted date string is hour / day / month / year. The start time of the energy consumption time series data of the building to be measured collected is 0:00 / 01 / 01 / 2016, and the end time is 0:00 / 01 / 02 / 2016. The energy consumption time series data of the building to be measured is evenly divided into 24 segments of sequence data fragments according to hours, and the energy consumption values of each segment of sequence data fragment are determined as: = 75.2022, = 84.1075, = 79.9268, = 76.54, = 75.9115, = 78.0892, = 79.1928, = 78.4508, = 81.753, = 82.124, = 85.7882, = 86.5313, = 81.8598, = 83.365, = 83.5273, = 85.3047, = 90.0402, = 90.4505, = 87.8892, = 85.7845, = 78.8597, = 77.2307, = 75.3175, = 74.4603. Determine the energy consumption trend based on the energy consumption values of each segment of sequence data .
[0032] In one embodiment, the specific implementation manner provided in this embodiment for determining the time series embedding based on the energy consumption time series data includes: Perform reversible instance normalization processing on the energy consumption time series data of the building to be measured through the time series encoding sub-module, and obtain the normalized sequence data; Refer to the flow chart of energy consumption prediction using a trained energy consumption prediction model as shown in Figure 2 . The time series encoding sub-module 21 is composed of a reverse embedding layer and a time series encoder. By performing reversible instance normalization processing on the energy consumption time series data of the building to be measured through the time series encoding sub-module 21, the problem of distribution drift of the energy consumption time series data of the building to be measured is solved, and the performance and accuracy of the energy consumption prediction model are improved. The obtained normalized sequence data is: ; Among them, is the normalized sequence data, T is the time step of the sequence data, R is the set of real numbers, and N is the number of variables in the sequence data.
[0033] Convert the normalized sequence data into a time series learnable matrix; Through the reverse embedding layer in the time series encoding sub-module 21, the normalized sequence data is converted into a time series learnable matrix as: ; Among them, is the time series learnable matrix, C is the dimension of the reverse embedding layer, and the time dependence of the variables in the sequence data is captured through the reverse embedding layer.
[0034] Input the time series learnable matrix into the time series encoder to obtain the time series embedding; The time series encoder (denoted as TSEncoder(·)) can effectively capture the complex temporal dependencies among the tokens in the learnable matrix of the time series. Specifically, the Pre-LN Transformer can be used as the time series encoder in the time series encoding sub-module 21. This encoder has the advantages of being more stable and converging faster. The learnable matrix of the time series is input into the time series encoder to obtain the time series embedding as follows: ; where, is the time series embedding.
[0035] In one embodiment, the Pre-LN Transformer is selected as the time series encoder in the time series encoding sub-module 21. The specific structure of the Pre-LN Transformer is set as follows: the feature dimensions of the input and output in the Pre-LN Transformer are set to 12; the number of heads in the self-attention mechanism in the Pre-LN Transformer is set to 8; the proportion of the dropout layer in the Pre-LN Transformer is set to 0.2; the number of encoders in the Pre-LN Transformer is set to 2.
[0036] In one embodiment, the specific implementation manner for determining the text prompt embedding based on the text prompt provided in this embodiment includes: Tokenizing the text prompt by the text prompt encoding sub-module to obtain multiple tokens; The text prompt encoding sub-module 22 includes a frozen large language model and a text prompt encoder with the same structure as the time series encoder. As Figure 2 shown, in order to convert the text prompt into a format that the large language model can understand, the text prompt is input into the tokenizer in the text prompt encoding sub-module 22. The statements in the text prompt are split into individual words (i.e., words, or parts of words, or punctuation marks) by the tokenizer, and these split words are denoted as tokens; each token is mapped to a pre-set pre-trained vocabulary to obtain the unique number (i.e., unique ID, also denoted as tokens_id) corresponding to each token, and the unique number corresponding to each token is converted into a high-dimensional vector representation to obtain the token: ; where, is the token, and G is the unique ID number corresponding to this token.
[0037] Input each token into the natural language processing module, obtain the output of the last hidden layer of the natural language processing module, and input the output of the last hidden layer into the text prompt encoder to obtain the text prompt embedding; Input each token into the natural language processing module (using the Bert-base model), and extract the output of the last hidden layer of the natural language processing module by calling model(tokenized_prompt).last_hidden_state to obtain the tokens after natural language processing, denoted as: ; where E is the dimension of the hidden layer of the Bert-base model; After that, input the tokens after natural language processing into the text prompt encoder to obtain the text prompt embedding, denoted as: ; The above token parser is constructed by calling the BertTokenizer.from_pretrained method in the python package named transformer; the pre-trained vocabulary is constructed during the pre-training stage of the Bert-base model, which contains a large number of common words, sub-words, etc., and also contains the corresponding ones for each word, word, etc. Each token has a unique integer ID corresponding to it, so as to convert the text prompt into a mode that the large language model can understand.
[0038] In one embodiment, this embodiment provides a specific implementation manner for cross-modal alignment based on time series embedding and text prompt embedding to obtain aligned time series embedding, including: Perform linear transformation on the time series embedding and the text prompt embedding respectively based on the cross-modal alignment module, and perform matrix multiplication calculation and normalization calculation based on the linear transformation results of the time series embedding and the text prompt embedding to obtain the channel similarity matrix of the time series embedding and the text prompt embedding; As Figure 2 shown, the cross-modal alignment module 23 with channel similarity retrieval function uses the unentangled weak time series embedding to retrieve the unentangled robust time series embedding from the entangled and robust text prompt embedding ; the cross-modal alignment module 23 includes three linear layers, namely , v, k, input into the linear layer to perform linear transformation to obtain , input Input into the linear layer separately v and k for linear transformation to obtain v and k ; then perform matrix multiplication calculation and normalization calculation (select softmax as the normalization function) on the results obtained from the linear transformation to get the channel similarity matrix as follows: 、 v and k ; where ; wherein is the channel similarity matrix.
[0039] Perform linear transformation processing and matrix addition processing on the channel similarity matrix to obtain the aligned time series embedding; The cross-modal alignment module 23 further includes a linear layer . Input the channel similarity matrix into the linear layer for linear transformation processing and then perform matrix addition calculation to obtain the aligned time series embedding . The above steps transfer the knowledge in the text prompt embedding to the time series embedding through the cross-modal alignment module 23, thereby improving the performance of the energy consumption prediction model.
[0040] In one embodiment, this embodiment provides a specific implementation manner for performing prediction calculation based on the aligned time series embedding to obtain the future energy consumption prediction value of the building to be measured, including: Perform mapping variable processing on the aligned time series embedding through the time series prediction module and then perform prediction calculation to obtain the future energy consumption prediction value of the building to be measured; As Figure 2 shown, the time series prediction module 24 includes a multi-variable Transformer decoder (MTDecoder(·)) and a prediction linear layer. Input the aligned time series embedding into the multi-variable Transformer decoder for mapping variable processing to map the dependency relationship between the variables. Finally, input the time series embedding after mapping variable processing into the prediction linear layer for prediction calculation to obtain the future energy consumption prediction value of the building to be measured.
[0041] In one embodiment, this embodiment provides a specific implementation manner for the training steps of the energy consumption prediction model, including: Obtain the energy consumption time series data of the building, the metadata of the building features, and the environmental data of the area where the building is located; The above steps collect the time-series energy consumption data of various types of buildings in various regions, the metadata of building characteristics, and the environmental data of the regions where the buildings are located. By searching for existing publicly available real data, finally, the time-series energy consumption data of buildings, the metadata of building characteristics, and the environmental data of the regions where the buildings are located are extracted from the Building DataGenome Project2 (abbreviated as BDG2) dataset. The BDG2 dataset includes the time-series energy consumption data of 1,636 real buildings in North America and Europe (recording the hourly energy consumption values of each building from 2016 to 2017), the metadata of building characteristics (including building area, type, longitude, latitude, etc.), and the environmental data of the regions where the buildings are located (weather data collected from the meteorological stations closest to each building, including air temperature, dew point, wind direction, wind speed, etc.). Specifically, 10 public buildings, 10 educational buildings, and 10 residential buildings are selected from the BDG2 dataset, and the time-series energy consumption data, the metadata of building characteristics, and the environmental data of the regions where each building is located are determined.
[0042] Construct a text prompt based on the time-series energy consumption data of the building, the metadata of building characteristics, and the environmental data of the region where the building is located; Traverse the time-series energy consumption data of each building, the metadata of building characteristics, and the environmental data of the region where the building is located, and construct the Building_ID of each building. Among them, the Building_ID of each building contains the information in the time text prompt of the building (i.e., start time, end time, energy consumption values of each sequence data segment, and energy consumption trend), and the information in the space text prompt (longitude and latitude, area, type, environmental data of the regions where each building is located); Before training the energy consumption prediction model, a task description also needs to be established. The task description includes the duration of energy consumption prediction for each building, the type of each building, and the tasks expected to be performed by the energy consumption prediction model (for example, the task description can be set as: want to predict the energy consumption of [public] buildings per hour within the next
[24] hours). Finally, the text prompt and task description are dynamically adjusted by python to make them more in line with the training requirements of the energy consumption prediction model.
[0043] In one embodiment, it is necessary to predict the energy consumption values of each building for the next 24 hours, 96 hours, and 720 hours respectively. Therefore, before each training, the duration of energy consumption prediction for each building in the task description needs to be changed, and the type of each building in the task description is modified based on the Building_ID of each building; Set the expected large language model to encode the text prompt using text understanding ability, so as to provide strong support for subsequent prediction of the future energy consumption of buildings.
[0044] Mark the text prompts of each building with the actual future energy consumption values corresponding to the time-series energy consumption data, and establish a sample data set based on the text prompts of each building and the sequence of energy consumption changing over time after marking; among them, the sample data set includes a training data set. Mark the text prompts of each building and the time-series energy consumption data corresponding to the actual future energy consumption values of each building, and establish a sample data set, among which the sample data set includes a training data set. Specifically, select fifteen buildings and their corresponding data from thirty buildings as the training data set. The first five buildings in the training data set are of the education type, the middle five buildings are of the lodging type, and the last five buildings are of the public type.
[0045] Input the training data set into the energy consumption prediction model, perform model training on the energy consumption prediction model, and obtain the trained energy consumption prediction model. Input the training data set into the energy consumption prediction model, and perform model training on the energy consumption prediction model. Specifically, input the text prompts of each building in the training data set into the text prompt encoding sub-module 22 of the energy consumption prediction model, perform tokenization processing through a tokenizer, map a series of discrete tokens to a continuous vector space so that the energy consumption prediction model can process the text prompts in the vector space, obtain a series of tokens, denoted as tokenized_prompt, and then convert the series of tokens into a high-dimensional vector representation. In the embodiments of the present invention, the energy consumption prediction model uses a large language model. It is known from existing research that not all of the series of tokens obtained based on the token parser play a role in the training of the large language model. Due to the hidden multi-head self-attention mechanism in the large language model, the output result of the last hidden layer in the large language model is the most comprehensive. Therefore, a series of tokens are input into the natural language processing module in the large language model for processing, and the output of the last hidden layer of the large language model (i.e., the Bert-base model) is extracted by calling model(tokenized_prompt).last_hidden_state to obtain the text prompt embedding, denoted as prompt_embeddings. To avoid repeated processing of the large language model and accelerate the inference speed, the prompt_embeddings are saved as a.h5 file in the Hierarchical Data Format 5 (HDF5) file format for subsequent extraction at any time, reducing the computational cost. Subsequently, the HDF5 file is read and written through the create_dataset method in the h5py library of Python. This method defines the name of the training dataset as "embedding" and the data type as a NumPy array. Then, by aligning the prompt_embeddings in the.h5 file with the time series, the alignment part will be introduced in S4; The time series energy consumption data of each building in the training dataset is input into the time series encoding sub-module of the energy consumption prediction model to obtain the time series embedding; The text prompt embedding in the.h5 file in the text prompt encoding sub-module 22 is extracted, and the time series embedding and the text prompt embedding are input into the cross-modal alignment module 23 for alignment to obtain the aligned time series embedding; The aligned time series embedding is input into the time series prediction module for prediction calculation to obtain the future energy consumption prediction value of the building in the training dataset. The text prompt and the energy consumption time series data of each building are repeatedly input into the energy consumption prediction model, and finally the training of the energy consumption prediction model is completed to obtain the trained energy consumption prediction model.
[0046] In one embodiment, the sample dataset provided in this embodiment further includes a validation dataset; the specific implementation manner of the building energy consumption prediction method further includes: After each round of training of the energy consumption prediction model with the training dataset, the validation dataset is input into the energy consumption prediction model for validation, and the mean squared error is obtained as the loss function. If the mean squared error of this round of training is less than the mean squared error of the previous round of training, the loss function is updated and the next round of model training is performed; Since the energy consumption data of each building is relatively large, in order to better process the large amount of energy consumption data and to achieve the future energy consumption prediction of different types of buildings in different regions, it is necessary to update the parameters of the large language model in the text prompt encoding sub-module of the energy consumption prediction model, so that the model can better complete the future energy consumption prediction of the building to be measured. During the parameter update process, the equipment and time required for training depend on the number of parameters of the large language model. Therefore, in actual training, it is necessary to balance the equipment and time factors to determine the number of parameters of the large language model. Specifically, during the parameter update process, due to the huge number of parameters of the large language model, a low-rank adaptation technology for fine-tuning the large language model is usually adopted, that is, the low-rank adaptation (Low-Rank Adaptation of Large Language Models, LoRA) technology of the large language model is used to fine-tune the parameters in the large language model. This method can optimize specific parameters by adding low-rank decomposition matrices to update some parameters in specific layers of the Transformer without changing the structure of the large language model. At the same time, this method can not only leverage the powerful capabilities during the pre-training of the large language model, but also avoid the huge resource consumption caused by full-scale fine-tuning of all parameters, and can better control memory occupancy, computing time consumption and human input; In a specific implementation, denote the original pre-trained number of parameters of the large language model as , after updating the parameters of the large language model through the training and verification stage, the pre-trained number of parameters becomes W, and the change in the pre-trained number of parameters is
[0047] ; Therefore, during the training and verification of the large language model, freeze the original parameters of the backbone model in the large language model and only update to achieve parameter optimization of the large language model; The settings of each parameter during the training and verification of the large language model are as follows: Learning rate: 1e-4; batch size: 32; input time series length: 96; predicted time series lengths: 24, 96, 720; optimizer: AdamW; weight decay: 1e-3; During the training and verification of the energy consumption prediction model, MSE (mean squared error) is selected as the loss function (Loss), which is: ; where m represents the amount of data, represents the predicted future energy consumption value of the building obtained, represents the actual future energy consumption value of the building; After each round of training the large language model on the training dataset, calculate the training loss function of this training, denoted as train_Loss. Then input the validation dataset into the large language model after each round of training, and calculate the validation loss function of this training, denoted as valid_Loss. If the valid_Loss of this round of training is smaller than that of the previous round, then update valid_Loss, and denote the large language model obtained from this round of training as: "best model".
[0048] If the loss function has not been updated for a preset number of training rounds continuously, then verify whether the total number of training rounds is greater than the preset round threshold. If the total number of training rounds is less than the preset round threshold, then proceed to the next round of model training; if the total number of training rounds is not less than the preset round threshold, then end the model training; In a specific implementation manner, if the valid_Loss of this round of training is not less than that of the previous round, then do not update valid_Loss. After not updating valid_Loss, it is necessary to verify how many consecutive rounds of training have not updated valid_Loss. If there are 10 consecutive rounds of training that have not updated valid_Loss, then it is necessary to verify whether the total number of training rounds is less than 100 rounds. If the total number of training rounds is less than 100 rounds, then proceed to the next round of training and validation of the large language model; if the total number of training rounds is not less than 100 rounds, then end the training and validation of the large language model.
[0049] In one embodiment, the sample dataset provided in this embodiment further includes a test dataset; the specific implementation manner of the building energy consumption prediction method further includes: The building energy consumption prediction method further includes: Determine the actual future energy consumption values of each building based on the test dataset corresponding to each building; Input the test dataset into the trained energy consumption prediction model to obtain the predicted future energy consumption values of each building; Based on the actual values and predicted values of the future energy consumption of each building, obtain performance evaluation indicators to evaluate the performance of the trained energy consumption prediction model; among them, the performance evaluation indicators include: mean absolute error, root mean square error, and coefficient of determination; Select a test data set from the training data set, and input the text prompts and energy consumption time series data of each building in different regions and of different types in the test data set into the trained energy consumption prediction model. Use the trained energy consumption prediction model to predict the energy consumption values of each building for the next 24 hours, 96 hours, and 720 hours, and obtain the future energy consumption prediction values of each building. Determine the performance evaluation indicators based on the obtained future energy consumption prediction values and the actual future energy consumption values of each building, and determine the accuracy of the trained energy consumption prediction model based on the performance evaluation indicators. Among them, the performance evaluation indicators include: mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination ( )
[0050] Based on the foregoing embodiments, this embodiment provides an example of using the foregoing building energy consumption prediction method based on a large language model to predict the future energy consumption of a building. The specific steps can be executed as follows: Refer to Figure 3 the flowchart of building energy consumption prediction shown in Step S302, obtain the energy consumption time series data of each building, the characteristic metadata of each building, and the environmental data of the area where each building is located; Based on the building energy consumption data set of Building Data Genome Project2 (BDG2), obtain the energy consumption time series data of 30 buildings and the metadata of the characteristics of 30 buildings (including building area, type, longitude, latitude, etc.). Among the 30 buildings, there are 10 public buildings, 10 educational buildings, and 10 residential buildings. At the same time, the environmental data of the areas where the 30 buildings are located (including air temperature, dew point, wind direction, wind speed, etc.) is also obtained; Step S304, construct text prompts based on the energy consumption time series data of each building, the characteristic metadata of each building, and the environmental data of the area where each building is located; Construct time text prompts and space text prompts based on the energy consumption time series data, the metadata of building characteristics, and the environmental data of the areas where the 30 buildings are located. At the same time, in order to guide the energy consumption prediction model to understand and execute the energy consumption prediction task in the future, construct a task description. Based on the space text prompt containing spatial information, the time text prompt containing time information, and the task description containing task guidance, construct the text prompt corresponding to each building. This text prompt is applicable to the energy consumption prediction tasks of different types of buildings in different regions; Step S306, construct a training data set, a validation data set, and a test data set based on the sample data set; Mark the text prompts of each building with the actual future energy consumption values corresponding to the energy consumption time series data, and establish a sample data set based on the text prompts of each building and the sequence of energy consumption changing over time after marking. Select the data of 5 buildings from each type of building in the sample data set to form a training data set, select the data of 3 buildings of each type of building to form a validation data set, and select the data of 2 buildings of each type of building to form a test data set; Step S308: Input the training data set and the validation data set into the energy consumption prediction model for training and validation to obtain the future energy consumption prediction values of each building in the training data set and the validation data set; Input the training data set and the validation data set into the energy consumption prediction model for training and validation. Process the energy consumption time series data of each building based on the time series encoding sub-module 21 (i.e., the time series encoding branch) in the dual-modal encoding module of the energy consumption prediction model to obtain time series embeddings; process the text prompts of each building based on the text prompt encoding sub-module 22 (i.e., the text prompt encoding branch) in the dual-modal encoding module of the energy consumption prediction model to obtain text prompt embeddings; align the text prompt embeddings with the time series embeddings based on the cross-modal alignment module 23 in the energy consumption prediction model to obtain aligned time series embeddings; perform prediction calculations on the aligned time series embeddings based on the time series prediction module 24 in the energy consumption prediction model to obtain the future energy consumption prediction values of each building in the training data set and the validation data set; Step S310: Determine a loss function based on the future energy consumption prediction values of each building in the training data set and the validation data set and the actual future energy consumption values of each building, and determine whether to end the training and validation of the energy consumption prediction model based on the validation loss function and the total number of training rounds; Determine a loss function (mean squared error) based on the future energy consumption prediction values of each building in the training data set and the validation data set and the actual future energy consumption values of each building. If the validation loss function valid_Loss in this round of training is smaller than that of the previous round, update the validation loss function valid_Loss, and record the energy consumption prediction model obtained in this round of training as: "bestmodel". If the valid_Loss in this round of training is not less than the valid_Loss of the previous round, do not update valid_Loss. After not updating valid_Loss, it is necessary to verify how many consecutive rounds of training have not updated valid_Loss. If there are 10 consecutive rounds of training that have not updated valid_Loss, it is necessary to verify whether the total number of training rounds is less than 100 rounds. If the total number of training rounds is less than 100 rounds, perform the next round of training and validation of the energy consumption prediction model; if the total number of training rounds is not less than 100 rounds, end the training and validation of the energy consumption prediction model to obtain the trained energy consumption prediction model; Step S312: Evaluate the performance of the trained energy consumption prediction model according to the test data set; Input the test data set into the trained energy consumption prediction model to obtain the future energy consumption prediction values of each building in the test data set, and obtain performance evaluation indicators based on the actual values and prediction values of the future energy consumption of each building in the test data set to evaluate the performance of the trained energy consumption prediction model; wherein, the performance evaluation indicators include: mean absolute error, root mean square error, and coefficient of determination; Step S314, input the text prompt and energy consumption time series data of the building to be measured into the trained energy consumption prediction model to obtain the future energy consumption prediction value of the building to be measured; Input the text prompt and energy consumption time series data of the building to be measured into the trained energy consumption prediction model, predict the energy consumption of the building to be measured in the next 24 hours, 96 hours, and 720 hours, and obtain the prediction results.
[0051] For the method provided in the embodiment of the present invention, in order to make up for the problem that the energy consumption time series data of the building cannot reflect information such as the geographical location of the building, text prompts applicable to energy consumption prediction tasks of different regions and different types of buildings are constructed for the energy consumption time series data of the building, the metadata of building characteristics, and the environmental data of the area where the building is located. By constructing a time series encoding sub-module and a text prompt encoding sub-module, the energy consumption time series data and text prompts of the building are processed without entanglement; By studying the cross-modal data alignment and distribution matching algorithm, a cross-modal alignment module driven by channel-level similarity is designed to screen out the time series embeddings without information entanglement from the text prompt embeddings with information entanglement, mine the potential association between the time series data and text prompts, fuse the energy consumption time series data and text prompts of the building, realize the relevance and consistency of cross-modal data, improve the generalization ability of the large language model in the energy consumption prediction model in the absence of annotation scenarios, enable the large language model to have the ability to predict the future energy consumption of different thermal zones and different types of buildings, realize the deep interaction between the energy consumption time series data and text prompts of the building, complete feature decoupling, and effectively eliminate information redundancy; By adopting a distributed computing architecture and self-supervised learning methods, the representation ability of large language models is enhanced. In the fine-tuning stage, the large language model fine-tuning method (i.e., LoRA technology) is used to reduce the computational cost of large language model parameter updates, significantly reducing the time cost of predicting the energy consumption of buildings, maintaining the high adaptability of large language models to energy consumption prediction tasks, thereby further improving the prediction accuracy of the models, enabling more accurate prediction of the future energy consumption of the buildings to be measured. Using the method provided in the embodiments of the present invention, personnel can achieve energy consumption prediction for buildings of specific building types in specific regions, obtain more accurate energy consumption prediction results, and thus better observe the trend of building energy consumption values, helping to formulate highly targeted energy-saving strategies for each building, achieving efficient energy management, promoting the coordinated development of building energy consumption research and practice in terms of accuracy and efficiency, breaking through the adaptability limitations of traditional large language models in time series prediction tasks, providing a new technical path for the intelligent transformation of building energy management, and having a wide range of application prospects in the field of building energy consumption prediction.
[0052] The embodiments of the present invention provide a computer-readable medium, wherein the computer-readable medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the method described in the above embodiments.
[0053] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0054] Finally, it should be noted that the above embodiments are only specific embodiments of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting them. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed by the present invention can still modify the technical solutions recorded in the foregoing embodiments, or can easily think of changes, or make equivalent replacements for some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A building energy consumption prediction method based on large language models, characterized in that, Including: Obtain data of the building to be measured; wherein, the data of the building to be measured includes: energy consumption time series data of the building to be measured, metadata of the characteristics of the building to be measured, and environmental data of the area where the building to be measured is located; Construct a text prompt based on the data of the building to be measured; wherein, the text prompt includes: a time text prompt and a space text prompt; Input the energy consumption time series data of the building to be measured and the text prompt into the trained energy consumption prediction model to obtain the future energy consumption prediction value of the building to be measured; wherein, the energy consumption prediction model is trained by a building training data set marked with the actual future energy consumption value; the energy consumption prediction model includes: a time series encoding sub-module, a text prompt encoding sub-module, a cross-modal alignment module, and a time series prediction module; the time series encoding sub-module is used to determine a time series embedding based on the energy consumption time series data; the text prompt encoding sub-module is used to determine a text prompt embedding based on the text prompt; the cross-modal alignment module is used to perform cross-modal alignment based on the time series embedding and the text prompt embedding to obtain an aligned time series embedding; the time series prediction module is used to perform prediction calculations based on the aligned time series embedding to obtain the future energy consumption prediction value of the building to be measured; the text prompt encoding sub-module includes a large language model.
2. The building energy consumption prediction method according to claim 1, wherein The constructing the text prompt based on the data of the building to be measured includes: Construct the time text prompt based on the energy consumption time series data of the building to be measured; Construct the space text prompt based on the metadata of the characteristics of the building to be measured and the environmental data of the area where the building to be measured is located; wherein, the metadata of the characteristics of the building to be measured includes: the type, area, and longitude and latitude of the location of the building to be measured.
3. The building energy consumption prediction method according to claim 2, characterized in that, The step of constructing the time text prompt based on the energy consumption time series data of the building to be measured includes: Uniformly divide the energy consumption time series data of the building to be measured into multiple sequence data segments according to time, and determine the energy consumption value of the building to be measured in each sequence data segment; Determine the energy consumption trend of the building to be measured based on the energy consumption value of the building to be measured in each sequence data segment; Construct the time text prompt based on the start time, end time, energy consumption value of the building to be measured in each sequence data segment, and the energy consumption trend of the energy consumption time series data of the building to be measured.
4. The building energy consumption prediction method according to claim 1, characterized in that The determining the time series embedding based on the energy consumption time series data includes: Perform reversible instance normalization processing on the energy consumption time series data of the building to be measured through the time series encoding sub-module to obtain normalized sequence data; Convert the normalized sequence data into a time series learnable matrix; Input the time series learnable matrix into a time series encoder to obtain a time series embedding.
5. The building energy consumption prediction method according to claim 1, characterized in that The determining the text prompt embedding based on the text prompt includes: Perform tokenization processing on the text prompt based on a token parser in the text prompt encoding sub-module to obtain multiple tokens; Input each of the said markers into a large language model, obtain the output of the last hidden layer of the large language model, and input the output of the last hidden layer into a text prompt encoder to obtain the text prompt embedding.
6. The building energy consumption prediction method according to claim 1, characterized in that The cross-modal alignment based on the time series embedding and the text prompt embedding to obtain the aligned time series embedding includes: Perform linear transformations on the time series embedding and the text prompt embedding respectively based on the cross-modal alignment module, and perform matrix multiplication calculation and normalization calculation based on the linear transformation results of the time series embedding and the text prompt embedding to obtain the channel similarity matrix of the time series embedding and the text prompt embedding; Perform linear transformation processing and matrix addition processing on the channel similarity matrix to obtain the aligned time series embedding.
7. The building energy consumption prediction method according to claim 1, characterized in that, The prediction calculation based on the aligned time series embedding to obtain the future energy consumption prediction value of the building to be measured includes: Perform mapping variable processing on the aligned time series embedding through the time series prediction module and then perform prediction calculation to obtain the future energy consumption prediction value of the building to be measured.
8. The building energy consumption prediction method according to claim 1, characterized in that The training steps of the energy consumption prediction model include: Obtain the energy consumption time series data of the building, the metadata of the building features, and the environmental data of the area where the building is located; Construct a text prompt based on the energy consumption time series data of the building, the metadata of the building features, and the environmental data of the area where the building is located; Mark the text prompts of each building with the actual future energy consumption values corresponding to the energy consumption time-varying sequences, and establish a sample data set according to the text prompts of each marked building and the energy consumption time-varying sequences; wherein, the sample data set includes a training data set; Input the training data set into the energy consumption prediction model, perform model training on the energy consumption prediction model, and obtain the trained energy consumption prediction model.
9. The building energy consumption prediction method according to claim 8, wherein The sample data set further includes a validation data set; The building energy consumption prediction method further includes: After each round of training of the energy consumption prediction model with the training data set, input the validation data set into the energy consumption prediction model for validation to obtain the mean square error as the loss function. If the mean square error of this round of training is less than the mean square error of the previous round of training, update the loss function and perform the next round of model training; If the loss function has not been updated for a preset number of training rounds continuously, verify whether the total number of training rounds is greater than the preset round threshold. If the total number of training rounds is less than the preset round threshold, perform the next round of model training; if the total number of training rounds is not less than the preset round threshold, end the model training.
10. The building energy consumption prediction method according to claim 8, characterized in that, The sample data set further includes a test data set; The building energy consumption prediction method further includes: Determine the actual future energy consumption values of each building based on the test data set corresponding to each building; Input the test data set into the trained energy consumption prediction model to obtain the future energy consumption prediction values of each building; The performance of the trained energy consumption prediction model is evaluated by obtaining performance evaluation metrics based on the actual values and predicted values of the future energy consumption of each of the buildings; wherein, the performance evaluation metrics include: mean absolute error, root mean square error, and coefficient of determination.
Citation Information
Patent Citations
Cross-modal video clip retrieval method based on pre-training language model adaptation network
CN116662609A
Energy conservation and emission reduction management method and device, electronic equipment and storage medium
CN118429162A
Energy consumption prediction method and device, electronic equipment, storage medium and program product
CN119975388A
Automatic building energy consumption modeling method based on large language model
CN120086954A
Explanatable building energy consumption prediction method and system based on large language model
CN120124792A
Cited By
Self-supervised seismic wave screening method
CN121091355A
A self-supervised seismic wave screening method
CN121091355B
Time sequence prediction method and device for performing multi-level text alignment by using large model
CN121117525A
Time series prediction method and device for multi-level text alignment using large models
CN121117525B
Power load prediction method, device, equipment and medium
CN121886366A