Building energy consumption prediction method based on large language model

By employing a building energy consumption prediction method based on a large language model, and combining time and space text prompts with time series coding and cross-modal alignment techniques, the problem of universality in energy consumption prediction for buildings in different regions and of different types is solved, and efficient energy consumption prediction is achieved.

CN120296530BActive Publication Date: 2026-02-03BEIJING UNIV OF CIVIL ENG & ARCHITECTURE
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510782722.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2026-02-03
Estimated Expiration
2045-06-12

AI Technical Summary

Technical Problem

Existing building energy consumption prediction methods cannot achieve universal prediction for different regions and building types, resulting in a waste of computing and human resources, and are difficult to meet the large-scale needs of energy efficiency management for city-level building clusters.

Method used

A building energy consumption prediction method based on a large language model is adopted. By acquiring the energy consumption time series data, metadata and environmental data of the building to be measured, time and space text prompts are constructed. Energy consumption is predicted by using time series encoding submodule, text prompt encoding submodule, cross-modal alignment module and time series prediction module to achieve correlation and consistency of cross-modal data.

Benefits of technology

It enables energy consumption prediction for different regions and building types, improving the accuracy and versatility of predictions while reducing the investment of computing and human resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120296530B_ABST
    Figure CN120296530B_ABST
Patent Text Reader

Abstract

The application provides a building energy consumption prediction method based on a large language model, and relates to the technical field of building energy consumption prediction.The method comprises the following steps: obtaining data of a building to be measured; constructing a text prompt based on the data of the building to be measured; inputting energy consumption time series data of the building to be measured and the text prompt into a trained energy consumption prediction model to obtain a future energy consumption prediction value of the building to be measured; wherein a text prompt encoding submodule in the energy consumption prediction model comprises a large language model.The application aligns time series embedding and text prompt embedding based on a cross-modal alignment module in the energy consumption prediction model, fuses the energy consumption time series data of the building to be measured and the text prompt, and finally obtains the future energy consumption prediction value of the building to be measured through the aligned time series embedding.The method has universality in the energy consumption prediction process and realizes energy consumption prediction of buildings of different regions and different types.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of building energy consumption prediction technology, and more specifically, to a building energy consumption prediction method based on a large language model. Background Technology

[0002] With the rapid development of the social economy and the acceleration of urbanization, modern buildings are characterized by diverse types (such as residential buildings, commercial complexes, and public buildings) and wide geographical distribution. Due to the functional differences of various building types and the different climates of the regions where buildings are located, building energy consumption data exhibits significant spatiotemporal heterogeneity, posing a severe challenge to traditional prediction methods. Existing building energy consumption prediction methods generally adopt a "one building, one model" approach, that is, data needs to be collected independently for each building and the model needs to be retrained. This repetitive modeling approach not only requires a large investment of computing resources and professional human resources, but also makes it difficult to meet the large-scale needs of energy efficiency management for urban building clusters. Therefore, there is an urgent need for a universal building energy consumption prediction method to achieve energy consumption prediction for different regions and different types of buildings. Summary of the Invention

[0003] In view of this, the purpose of this invention is to provide a building energy consumption prediction method based on a large language model, which can solve the technical problem that existing building energy consumption prediction methods are not universal and cannot achieve energy consumption prediction for different regions and different types of buildings.

[0004] In a first aspect, embodiments of the present invention provide a building energy consumption prediction method based on a large language model, comprising:

[0005] Acquire data about the building to be tested; wherein, the data about the building to be tested includes: time-series energy consumption data of the building to be tested, metadata of the building's characteristics, and environmental data of the area where the building to be tested is located;

[0006] Text prompts are constructed based on the data of the building to be tested; wherein, the text prompts include: time-based text prompts and spatial text prompts;

[0007] The energy consumption time-series data of the building under test and the text prompt are input into the trained energy consumption prediction model to obtain the future energy consumption prediction value of the building under test. The energy consumption prediction model is trained on a training dataset of buildings labeled 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 calculations based on the aligned time-series embedding to obtain the future energy consumption prediction value of the building under test. The text prompt encoding submodule includes a large language model.

[0008] Furthermore, this embodiment of the invention provides a first possible implementation of the first aspect, wherein the step of constructing a text prompt based on the data of the building under test includes:

[0009] The time-based text prompt is constructed based on the energy consumption time-series data of the building under test;

[0010] The spatial text prompt is constructed based on the metadata of the building features to be tested and the environmental data of the area where the building is located; wherein, the metadata of the building features to be tested includes: the type, area and latitude and longitude of the building.

[0011] Furthermore, this embodiment of the invention provides a second possible implementation of the first aspect, wherein the step of constructing the time-based text prompt based on the energy consumption time-series data of the building under test includes:

[0012] The energy consumption time series data of the building under test is evenly divided into multiple sequence data segments according to time, and the energy consumption value of the building under test in each sequence data segment is determined.

[0013] Based on the energy consumption value of the building under test in each of the sequence data segments, the energy consumption trend of the building under test is determined.

[0014] The time-based text prompt is constructed based on the start and end times of the energy consumption time-series data of the building under test, the energy consumption value of the building under test in each segment of the sequence data, and the energy consumption trend of the building under test.

[0015] Furthermore, this embodiment of the invention provides a third possible implementation of the first aspect, wherein determining the time series embedding based on the energy consumption time series data includes:

[0016] The time series encoding submodule performs reversible instance normalization on the energy consumption time series data of the building under test to obtain normalized sequence data.

[0017] The normalized sequence data is then converted into a time series learnable matrix.

[0018] The time series learnable matrix is ​​input into the time series encoder to obtain the time series embedding.

[0019] Furthermore, this embodiment of the invention provides a fourth possible implementation of the first aspect, wherein determining the text prompt embedding based on the text prompt includes:

[0020] The text prompt is tokenized using the token parser in the text prompt encoding submodule to obtain multiple tokens;

[0021] Each of the aforementioned tags is input into a large language model to obtain the output of the last hidden layer of the large language model, and the output of the last hidden layer is input into a text prompt encoder to obtain the text prompt embedding.

[0022] Furthermore, this embodiment of the invention provides a fifth possible implementation of the first aspect, wherein cross-modal alignment based on the time series embedding and the text cue embedding to obtain the aligned time series embedding includes:

[0023] Based on the cross-modal alignment module, linear transformations are performed on the time series embedding and the text prompt embedding, respectively. Matrix multiplication and normalization calculations are then performed 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.

[0024] The aligned time series embedding is obtained by performing linear transformation and matrix addition on the channel similarity matrix.

[0025] Furthermore, this embodiment of the invention provides a sixth possible implementation of the first aspect, wherein the prediction calculation based on the aligned time series embedding to obtain the predicted future energy consumption value of the building under test includes:

[0026] The time series prediction module performs mapping variable processing on the aligned time series embedding and then performs prediction calculations to obtain the predicted future energy consumption value of the building under test.

[0027] Furthermore, this embodiment of the invention provides a seventh possible implementation of the first aspect, wherein the training step of the energy consumption prediction model includes:

[0028] Acquire time-series data on building energy consumption, metadata on building characteristics, and environmental data of the area where the building is located;

[0029] A text prompt is constructed based on the data of the building to be tested;

[0030] The text prompts for each of the buildings and the corresponding future energy consumption values ​​of the energy consumption change over time are labeled, and a sample dataset is established based on the labeled text prompts for each of the buildings and the energy consumption change over time; wherein, the sample dataset includes a training dataset.

[0031] The training dataset is input into the energy consumption prediction model to train the energy consumption prediction model, thereby obtaining the trained energy consumption prediction model.

[0032] Furthermore, this embodiment of the invention provides an eighth possible implementation of the first aspect, wherein the sample dataset further includes a validation dataset;

[0033] The building energy consumption prediction method also includes:

[0034] After each round of training of the energy consumption prediction model using the training dataset, the validation dataset is input into the energy consumption prediction model for validation, and the mean squared error is used as the loss function. If the mean squared error of the current training round is less than the mean squared error of the previous training round, the loss function is updated and the next round of model training is performed.

[0035] If the loss function is not updated for a preset number of consecutive training epochs, then the total number of training epochs is checked to see if it is greater than the preset epoch threshold. If the total number of training epochs is less than the preset epoch threshold, then the next round of model training is performed. If the total number of training epochs is not less than the preset epoch threshold, then the model training is terminated.

[0036] Furthermore, this embodiment of the invention provides a ninth possible implementation of the first aspect, wherein the sample dataset further includes a test dataset;

[0037] The building energy consumption prediction method also includes:

[0038] Based on the test dataset, determine the actual future energy consumption of each of the buildings;

[0039] The test dataset is input into the trained energy consumption prediction model to obtain the future energy consumption prediction value of each building.

[0040] The performance of the trained energy consumption prediction model is evaluated based on the actual and predicted future energy consumption values ​​of each building; wherein the performance evaluation indicators include: mean absolute error, root mean square error, and coefficient of determination.

[0041] This invention provides a method for predicting building energy consumption based on a large language model. The method includes: acquiring data of a building to be tested; wherein the data includes: time-series energy consumption data of the building, metadata of the building's features, and environmental data of the area where the building is located; constructing text prompts based on the data of the building to be tested; wherein the text prompts include: time-based text prompts and spatial text prompts; inputting the time-series energy consumption data and text prompts of the building to be tested into a trained energy consumption prediction model to obtain the predicted future energy consumption value of the building to be tested; wherein the energy consumption prediction model is based on a training dataset of buildings labeled with actual future energy consumption values. The trained 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 energy consumption time series data; the text prompt encoding submodule is used to determine the text prompt embedding based on text prompts; 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 calculations based on the aligned time series embedding to obtain the predicted future energy consumption value of the building under test; the text prompt encoding submodule includes a large language model. This invention collects data on the building under test and constructs text prompts based on this data, enabling the text prompts to reflect the region and type of the building. The energy consumption time-series data of the building under test and the constructed text prompts are fed into a trained energy consumption prediction model. Time-series embeddings and text prompt embeddings are determined, and a cross-modal alignment module aligns the time-series embeddings and text prompt embeddings. This process uncovers the potential correlation between the energy consumption time-series data of the building under test and the text prompts, fusing the energy consumption time-series data of the building under test with the text prompts. This transfers knowledge from the text prompt embeddings to the time-series embeddings, achieving cross-modal data correlation and consistency, making the building energy consumption prediction method universal. Finally, the future energy consumption prediction value of the building under test is obtained through the aligned time-series embeddings, enabling energy consumption prediction for buildings in different regions and of different types.

[0042] Other features and advantages of the embodiments of the present invention will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above in the embodiments of the present invention.

[0043] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0044] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0045] Figure 1 The diagram illustrates a flowchart of a building energy consumption prediction method based on a large language model provided by an embodiment of the present invention.

[0046] Figure 2 This diagram illustrates a flowchart of a trained energy consumption prediction model for energy consumption prediction, as provided in an embodiment of the present invention.

[0047] Figure 3 This diagram illustrates a process for predicting building energy consumption based on an energy consumption prediction model, as provided in an embodiment of the present invention. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0049] Currently, to address the lack of universality in existing building energy consumption prediction methods and their inability to predict energy consumption for different regions and building types, efforts have begun to explore the application of Large Language Models (LLMs), represented by ChatGPT, to building energy management. This includes: on the one hand, research has constructed expert systems integrating digital twin technology and LLMs, achieving real-time response functions such as equipment control and data retrieval through multimodal interaction. The core LLM of these systems primarily handles natural language interaction tasks and does not involve predicting or analyzing building energy consumption. On the other hand, attempts are being made to expand the building energy modeling capabilities of LLMs, such as using fine-tuned LLMs to generate IDF format modeling files suitable for EnergyPlus building energy consumption simulation software.

[0050] However, applying LLM models to the field of building energy consumption prediction still faces the following challenges in the current technology. On the one hand, there is insufficient deep modeling of energy consumption time-series characteristics. Although some general LLM models have mastered some knowledge of the building domain (such as the basic principles of HVAC systems), they lack a deep understanding of energy consumption time-series characteristics and are difficult to accurately capture professional laws such as building thermodynamic response. On the other hand, there is the problem of semantic alignment defects in cross-modal data fusion. Multimodal data fusion has inherent challenges. When structured energy consumption data (time series data) and unstructured text prompts (domain knowledge) are input together, insufficient cross-modal feature alignment can easily lead to information entanglement, which directly affects the prediction accuracy. Existing LLM models still cannot completely 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 to the field of building energy consumption prediction still cannot solve the technical problem that existing building energy consumption prediction methods are not universal and cannot achieve energy consumption prediction for different regions and different types of buildings.

[0051] To address the aforementioned issues, this invention provides a building energy consumption prediction method based on a large language model. The following provides a detailed description of this invention.

[0052] 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. See [link to documentation]. Figure 1 The diagram shows a flowchart of a building energy consumption prediction method based on a large language model. The method mainly includes the following steps:

[0053] Step S102: Obtain data of the building to be tested; wherein, the data of the building to be tested includes: energy consumption time series data of the building to be tested, metadata of the characteristics of the building to be tested, and environmental data of the area where the building to be tested is located;

[0054] The system collects time-series energy consumption data of the building under test, metadata about the building's characteristics, and environmental data of the area where the building is located. The metadata about the building's characteristics includes its area, type, latitude and longitude. The type of the building can be divided into the following categories according to its use: public, education, lodging, office, industrial, parking, retail, and other. The environmental data of the area where the building is located is collected from the nearest weather station and mainly includes air temperature, dew point, wind direction, and wind speed.

[0055] Step S104: Construct text prompts based on the data of the building to be measured; wherein, the text prompts include: time text prompts and spatial text prompts;

[0056] Based on the energy consumption time-series data of the building under test, a temporal text prompt containing temporal information is constructed. Based on the metadata of the building under test's characteristics and the environmental data of the area where the building is located, a spatial text prompt containing spatial information is constructed. In the process of predicting the energy consumption of the building under test, the temporal information contained in the energy consumption time-series data of the building under test will affect the prediction result of the building's energy consumption value. At the same time, the different spatial information of the building under test of different types and different regions will also result in different predicted values ​​of building energy consumption. Therefore, the temporal and spatial information of the building under test both contain highly valuable semantic details. These details can help large language models to deeply understand the spatiotemporal patterns in specific contexts.

[0057] Step S106: Input the energy consumption time series data and text prompts of the building to be tested into the trained energy consumption prediction model to obtain the future energy consumption prediction value of the building to be tested.

[0058] The energy consumption prediction model is trained using a building training dataset labeled with actual future energy consumption values. The building training dataset includes time-series energy consumption data, metadata, and environmental data of different types of buildings in different regions.

[0059] 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 energy consumption time series data. The text prompt encoding submodule is used to determine the text prompt embedding based on text prompts. 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 calculations based on the aligned time series embedding to obtain the predicted future energy consumption value of the building under test. The text prompt encoding submodule includes a large language model.

[0060] In the above steps, the large language model is used as an important component of the text prompt encoding submodule in the energy consumption prediction model. The energy consumption prediction model includes a bimodal encoding module, a cross-modal alignment module, and a time series prediction module. The bimodal encoding module consists of a time series encoding submodule and a text prompt encoding submodule. The bimodal encoding module processes the energy consumption time series data and text prompts of the building under test without entanglement, obtaining time series embeddings and text prompt embeddings respectively. The cross-modal alignment module based on channel similarity retrieval performs cross-modal alignment of the time series embeddings and text prompt embeddings. It filters out time series embeddings without information entanglement from the text prompt embeddings with information entanglement, explores the potential correlation between the energy consumption time series data of the building under test and the text prompts, and fuses the energy consumption time series data of the building under test and the text prompts to obtain aligned time series embeddings. Finally, the aligned time series embeddings are input into the time series prediction module for prediction calculation to obtain the future energy consumption prediction value of the building under test.

[0061] The building energy consumption prediction method provided in this embodiment of the invention collects data of the building to be tested and constructs text prompts based on the data, so that the text prompts can reflect the region and type of the building to be tested. By feeding the energy consumption time series data of the building to be tested and the constructed text prompts into the trained energy consumption prediction model, the time series embedding and the text prompt embedding are determined. The time series embedding and the text prompt embedding are aligned through a cross-modal alignment module to explore the potential correlation between the energy consumption time series data of the building to be tested and the text prompts. The energy consumption time series data of the building to be tested and the text prompts are fused, so that the knowledge obtained from the text prompt embedding is transferred to the time series embedding, realizing the correlation and consistency of cross-modal data, making the building energy consumption prediction method universal. Finally, the future energy consumption prediction value of the building to be tested is obtained through the aligned time series embedding, realizing the energy consumption prediction of buildings in different regions and of different types.

[0062] In one embodiment, this embodiment provides a specific implementation method for constructing text prompts based on data of the building under test, including:

[0063] Construct time-based text prompts based on the energy consumption time-series data of the building under test;

[0064] The above steps require determining the start time of the sequence data based on the energy consumption time-series data of the building under test. End time Energy consumption value and energy consumption trend.

[0065] Spatial text prompts are constructed based on the metadata of the building's features and the environmental data of the area where the building is located; the metadata of the building's features includes: the type, area, and latitude and longitude of the building.

[0066] In the above steps, a unique label for the building to be tested is constructed based on the building's latitude and longitude, area, type, and environmental data of the area where the building is located, serving as a spatial text prompt.

[0067] In one embodiment, this embodiment provides a specific implementation method for constructing time-based text prompts based on the energy consumption time-series data of the building under test, including:

[0068] The energy consumption time series data of the building under test is evenly divided into multiple sequence data segments according to time, and the energy consumption value of the building under test in each sequence data segment is determined.

[0069] Format the energy consumption time-series data of the building under test as a date string. and to the start time and end time The energy consumption time-series data of the building under test is assigned values ​​by dividing it evenly into multiple data segments based on time. Specifically, this can be done according to the start time. and end time The energy consumption time-series data of the building under test is evenly divided into n data segments, and the energy consumption value of the building under test in each data segment is determined. An energy consumption string is then created based on the energy consumption value of the building under test in each data segment. .

[0070] Based on the energy consumption value of the building under test in each sequence data segment, the energy consumption trend of the building under test is determined.

[0071] Based on the energy consumption values ​​of the building under test in each sequence data segment, the energy consumption trend of the building under test is determined as follows:

[0072] ;

[0073] ;

[0074] in, This represents energy consumption trends (i.e., [Trends]). Let be the energy consumption value of the i-th sequence data segment. Let be the energy consumption value of the (i+1)th segment of the sequence data. Let be the energy consumption change value of the i-th data segment of the sequence, i=1,...,n-1.

[0075] The time-series data of the building under test includes the start time, end time, energy consumption value of the building under test in each data segment, and energy consumption trend of the building under test.

[0076] In one embodiment, the format of each character in the formatted date string is hour / day / month / year. The start time of the collected energy consumption time series data of the building under test 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 under test is evenly divided into 24 sequence data segments according to hours, and the energy consumption value of each sequence data segment is determined as follows: =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 sequence data segment. .

[0077] In one embodiment, this embodiment provides a specific implementation method for determining time series embedding based on energy consumption time series data, including:

[0078] The energy consumption time series data of the building under test is reversibly instantiated and normalized by the time series coding submodule to obtain normalized sequence data.

[0079] See also Figure 2The diagram illustrates a process for a trained energy consumption prediction model to predict energy consumption. The time series encoding submodule 21 consists of an inverse embedding layer and a time series encoder. Through the time series encoding submodule 21, the energy consumption time series data of the building under test is reversibly normalized, solving the problem of distribution drift in the energy consumption time series data of the building under test, improving the performance and accuracy of the energy consumption prediction model, and obtaining the normalized sequence data as follows:

[0080] ;

[0081] in, For 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.

[0082] The normalized sequence data is transformed into a time series learnable matrix;

[0083] The normalized sequence data is processed by the inverse embedding layer in the time series encoding submodule 21. The learnable matrix after conversion to time series is:

[0084] ;

[0085] in, Let C be the time series learnable matrix, and let C be the dimension of the inverse embedding layer. The inverse embedding layer captures the time dependencies of variables in the sequence data.

[0086] The time series learnable matrix is ​​input into the time series encoder to obtain the time series embedding;

[0087] The time series encoder (denoted as TSEncoder(·)) can effectively capture the complex temporal dependencies between tokens in the time series learnable matrix. Specifically, a Pre-LN Transformer can be used as the time series encoder in the time series encoding submodule 21. This encoder has the advantages of being more stable and converging faster. The time series learnable matrix is ​​input into the time series encoder to obtain the time series embedding as follows:

[0088] ;

[0089] in, Embedded for time series.

[0090] In one embodiment, the Pre-LN Transformer is selected as the time series encoder in the time series encoding submodule 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 ratio of the dropout layer in the Pre-LN Transformer is set to 0.2; and the number of encoders in the Pre-LN Transformer is set to 2.

[0091] In one embodiment, this embodiment provides a specific implementation method for determining the text prompt embedding based on the text prompt, including:

[0092] The text prompt encoding submodule performs tokenization processing on the text prompt to obtain multiple tokens;

[0093] Text prompt encoding submodule 22 includes a frozen large language model and a text prompt encoder with the same structure as the time series encoder, such as Figure 2 As shown, to convert the text prompts into a format that the large language model can understand, the text prompts are input into the tokenizer in the text prompt encoding submodule 22. The tokenizer splits the sentences in the text prompts into individual words (i.e., words, parts of words, or punctuation marks), and these split words are denoted as tokens. Each token is mapped to a pre-set pre-trained vocabulary to obtain a unique number (i.e., a unique ID, also denoted as tokens_id) corresponding to each token. The unique number corresponding to each token is converted into a high-dimensional vector representation to obtain the tag.

[0094] ;

[0095] in, G is a marker, and G is the unique ID number corresponding to this marker.

[0096] Each tag is input into the natural language processing module, the output of the last hidden layer of the natural language processing module is obtained, and the output of the last hidden layer is input into the text prompt encoder to obtain the text prompt embedding;

[0097] Each token is input into the natural language processing module (using the Bert-base model). The output of the last hidden layer of the natural language processing module is extracted by calling `model(tokenized_prompt).last_hidden_state`, resulting in the processed tokens, denoted as:

[0098] ;

[0099] Where E is the dimension of the hidden layers in the Bert-base model;

[0100] Then the tags after natural language processing The input is fed into the text prompt encoder to obtain the text prompt embedding, denoted as:

[0101] ;

[0102] The aforementioned 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 phase of the Bert-base model. It contains a large number of common words, sub-words, etc., as well as the corresponding tokens. Each token has a unique integer ID, thereby converting the text prompts into a pattern that can be understood by a large language model.

[0103] In one embodiment, this embodiment provides a specific implementation method for cross-modal alignment based on time series embedding and text cue embedding to obtain aligned time series embeddings, including:

[0104] Linear transformations are performed on time series embeddings and text cue embeddings based on the cross-modal alignment module. Matrix multiplication and normalization are then performed on the linear transformation results of the time series embeddings and the text cue embeddings to obtain the channel similarity matrices of the time series embeddings and text cue embeddings.

[0105] like Figure 2 As shown, the cross-modal alignment module 23 with channel similarity retrieval function utilizes entanglement-free weak time series embedding. Embedding from entangled, robust text hints Retrieve entanglement-free robust time series embeddings; the cross-modal alignment module 23 includes three linear layers, namely... , v, k, will Input to linear layer Perform a linear transformation to obtain ,Will Input to linear layer respectively v and Perform a linear transformation on k to obtain v and k The result obtained by linear transformation , v and k Performing matrix multiplication and normalization calculations (choosing softmax as the normalization function), the channel similarity matrix is ​​obtained as follows:

[0106] ;

[0107] in, This is the channel similarity matrix.

[0108] Linear transformation and matrix addition are performed on the channel similarity matrix to obtain aligned time series embeddings;

[0109] Cross-modal alignment module 23 also includes a linear layer Channel similarity matrix Input to linear layer After performing linear transformation, matrix addition is used to calculate the aligned time series embedding. The above steps transfer the knowledge from 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.

[0110] In one embodiment, this embodiment provides a specific implementation method for obtaining the predicted future energy consumption value of a building under test by performing prediction calculations based on aligned time series embeddings, including:

[0111] The time series prediction module performs mapping variable processing on the aligned time series embedding and then performs prediction calculations to obtain the predicted future energy consumption of the building under test.

[0112] like Figure 2 As shown, the time series prediction module 24 includes a multivariate Transformer decoder (MTDecoder(·)) and a prediction linear layer to embed the aligned time series data. The input is fed into a multivariate Transformer decoder for mapping variable processing to determine the dependencies between variables. Finally, the time series data after mapping variable processing is embedded into the prediction linear layer for prediction calculation to obtain the predicted future energy consumption of the building under test.

[0113] In one embodiment, this embodiment provides a specific implementation method for the training steps of the energy consumption prediction model, including:

[0114] Acquire time-series data on building energy consumption, metadata on building characteristics, and environmental data of the area where the building is located;

[0115] The above steps collect time-series energy consumption data, metadata of building characteristics, and environmental data of the areas where the buildings are located for various types of buildings in various regions. By searching for existing publicly available real data, the final selection is to extract time-series energy consumption data, metadata of building characteristics, and environmental data of the areas where the buildings are located from the Building Data Genome Project 2 (BDG2) dataset. The BDG2 dataset includes time-series energy consumption data (recording the energy consumption value of each building every hour from 2016 to 2017), metadata of building characteristics (including building area, type, longitude, latitude, etc.), and environmental data of the areas where the buildings are located (weather data collected from the weather station closest to each building, including air temperature, dew point, wind direction, wind speed, etc.) from the BDG2 dataset. Specifically, 10 buildings of the public type, 10 buildings of the educational type, and 10 buildings of the residential type are selected from the BDG2 dataset, and the time-series energy consumption data, metadata of building characteristics, and environmental data of the areas where the buildings are located are determined for each building.

[0116] Text prompts are constructed based on the building's energy consumption time-series data, building feature metadata, and environmental data of the area where the building is located.

[0117] The energy consumption time series data, building feature metadata, and environmental data of the area where the building is located are traversed to construct the Building_ID of each building. 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 value of each sequence data segment and energy consumption trend), and the information in the spatial text prompt (latitude and longitude, area, type, and environmental data of the area where each building is located). Before training the energy consumption prediction model, it is also necessary to establish a task description. The task description contains the duration for which energy consumption prediction of each building is required, the type of each building, and the task that the energy consumption prediction model is expected to perform (for example, the task description can be set as: want to predict the energy consumption of the [public] class buildings per hour in the next

[24] hours). Finally, the text prompt and task description are dynamically adjusted by Python to better meet the training requirements of the energy consumption prediction model.

[0118] In one embodiment, it is necessary to predict the energy consumption 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 needs to be modified based on the Building_ID of each building. The expected large language model is set to encode the text prompts using text understanding capabilities, thereby providing strong support for subsequent prediction of the building's future energy consumption.

[0119] The text prompts for each building are labeled with the actual future energy consumption values ​​corresponding to the time series data of energy consumption, and a sample dataset is established based on the labeled text prompts for each building and the sequence of energy consumption changes over time; the sample dataset includes the training dataset.

[0120] Based on the actual future energy consumption values ​​of each building, the corresponding text prompts and energy consumption time series data of each building are labeled to establish a sample dataset. The sample dataset includes a training dataset. Specifically, fifteen buildings and their corresponding data are selected from thirty buildings as the training dataset. In the training dataset, the first five buildings are of the education type, the middle five buildings are of the lodging type, and the last five buildings are of the public type.

[0121] Input the training dataset into the energy consumption prediction model, train the energy consumption prediction model, and obtain the trained energy consumption prediction model.

[0122] The training dataset is input into the energy consumption prediction model to train the model. Specifically, the text prompts of each building in the training dataset are input into the text prompt encoding submodule 22 of the energy consumption prediction model. The tokenizer performs tokenization processing, mapping 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, resulting in a series of tokens, denoted as tokenized_prompt. Then, the series of tokens are converted into a high-dimensional vector representation.

[0123] In this embodiment of the invention, the energy consumption prediction model uses a large language model. Existing research shows that not all tags obtained from a series of tags obtained by a tag parser are useful for training the large language model. Due to the multi-head self-attention mechanism hidden in the large language model, the output of the last hidden layer is the most comprehensive. Therefore, a series of tags are input into the natural language processing module of the large language model for processing. 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`, resulting in text prompt embeddings, denoted as `prompt_embeddings`. To avoid repetitive processing by the large language model and to speed up inference, `prompt_embeddings` is saved as a `.h5` file using Hierarchical Data Format 5 (HDF5) for later retrieval, reducing computational costs. Subsequently, the `create_dataset` method in Python's `h5py` library is used to read and write the HDF5 file. This method defines the training dataset as "embedding" and its data type as a NumPy array. Then, by aligning the prompt_embeddings in the .h5 file with the time series, it is possible; the alignment part will be introduced in S4.

[0124] The energy consumption time series data of each building in the training dataset is input into the time series encoding submodule of the energy consumption prediction model to obtain the time series embedding;

[0125] Extract the text prompt embedding from the .h5 file in the text prompt encoding submodule 22, and input the time series embedding and text prompt embedding into the cross-modal alignment module 23 for alignment to obtain the aligned time series embedding;

[0126] The aligned time series data is embedded into the time series prediction module for prediction calculation to obtain the future energy consumption prediction values ​​of buildings in the training dataset. The text prompts and energy consumption time series data of each building are repeatedly input into the energy consumption prediction model to complete the training of the energy consumption prediction model and obtain the trained energy consumption prediction model.

[0127] In one embodiment, the sample dataset provided in this embodiment further includes a validation dataset; the specific implementation of the building energy consumption prediction method further includes:

[0128] After each round of training of the energy consumption prediction model using the training dataset, the validation dataset is input into the energy consumption prediction model for validation, and the mean squared error is used as the loss function. If the mean squared error of the current training round is less than the mean squared error of the previous training round, the loss function is updated and the next round of model training is carried out.

[0129] Due to the massive energy consumption data of various buildings, in order to better process this data and predict future energy consumption for different types of buildings in different regions, it is necessary to update the parameters of the large language model in the text prompt encoding submodule of the energy consumption prediction model. This will enable the model to better predict the future energy consumption of the buildings under test. During the parameter update process, the equipment and time required for training depend on the number of parameters in the large language model. Therefore, in actual training, it is necessary to weigh equipment and time factors to determine the number of parameters in the large language model. Specifically, due to the large number of parameters in the large language model, a low-rank adaptation technique for fine-tuning the large language model is usually adopted during the parameter update process. LoRA (LoRa) technology is used to fine-tune the parameters in large language models. This method can optimize specific parameters by adding low-rank decomposition matrices to specific layers of the Transformer without changing the structure of the large language model. At the same time, this method can not only take advantage of the powerful capabilities of pre-trained large language models, but also avoid the massive resource consumption caused by full fine-tuning of all parameters, and control memory usage, computation time and human resources.

[0130] In one specific implementation, let the original number of pre-trained parameters of the large language model be... After updating the parameters of the large language model during the training and validation phase, the number of pre-trained parameters becomes W, and the change in the number of pre-trained parameters is...

[0131] ;

[0132] Therefore, during the training and validation of the large language model, the original parameters of the backbone model in the large language model are frozen, and only the parameters of the backbone model are updated. This allows for parameter optimization of large language models;

[0133] The parameters are set as follows during the training and validation of the large language model:

[0134] Learning rate: 1e-4; batch size: 32; input time series length: 96; prediction time series length: 24, 96, 720; optimizer: AdamW; weight decay: 1e-3;

[0135] In the process of training and validating the energy consumption prediction model, MSE (mean squared error) was selected as the loss function, which is:

[0136] ;

[0137] Where m represents the amount of data. This represents the predicted future energy consumption of the building. This indicates the actual future energy consumption of the building;

[0138] After each round of training on the large language model using the training dataset, the training loss function for that round is calculated and denoted as train_Loss. Then, the validation set is input into the large language model after each round of training, and the validation loss function for that round is calculated and denoted as valid_Loss. If the valid_Loss of the current round of training is smaller than that of the previous round, then valid_Loss is updated. The large language model obtained from this round of training is denoted as "best model".

[0139] If the loss function is not updated for a preset number of consecutive training epochs, then verify whether the total number of training epochs is greater than the preset number of epochs threshold. If the total number of training epochs is less than the preset number of epochs threshold, then proceed to the next round of model training; if the total number of training epochs is not less than the preset number of epochs threshold, then end the model training.

[0140] In one specific implementation, if the valid_Loss of the current training round is not less than the valid_Loss of the previous round, then valid_Loss is not updated. After not updating valid_Loss, it is necessary to verify how many consecutive training rounds have passed without updating valid_Loss. If valid_Loss has not been updated for 10 consecutive training rounds, 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 the next round of training and validation of the large language model is performed; if the total number of training rounds is not less than 100 rounds, then the training and validation of the large language model is terminated.

[0141] In one embodiment, the sample dataset provided in this embodiment further includes a test dataset; the specific implementation of the building energy consumption prediction method also includes:

[0142] Building energy consumption prediction methods also include:

[0143] The actual future energy consumption of each building is determined based on the test dataset.

[0144] The test dataset is input into the trained energy consumption prediction model to obtain the future energy consumption prediction values ​​for each building.

[0145] The performance of the trained energy consumption prediction model is evaluated based on the actual and predicted future energy consumption values ​​of each building. The performance evaluation indicators include: mean absolute error, root mean square error, and coefficient of determination.

[0146] A test dataset was selected from the training dataset. Text prompts and energy consumption time-series data for different types of buildings in different regions were input into the trained energy consumption prediction model. The model was then used to predict the energy consumption of each building for the next 24, 96, and 720 hours. Based on these predictions and actual future energy consumption values, performance evaluation metrics were determined. The accuracy of the trained energy consumption prediction model was then assessed using these metrics. These metrics included: Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and Coefficient of Determination (CDE). ).

[0147] Based on the foregoing embodiments, this embodiment provides an example of using the aforementioned building energy consumption prediction method based on a large language model to predict the future energy consumption of a building. The specific steps are as follows:

[0148] See also Figure 3 The diagram shows a process for predicting building energy consumption based on an energy consumption prediction model.

[0149] 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;

[0150] Based on the building energy consumption dataset of Building Data Genome Project2 (BDG2), we obtained time-series energy consumption data and metadata (including building area, type, longitude, latitude, etc.) of 30 buildings. Among the 30 buildings, there are 10 public buildings, 10 educational buildings, and 10 residential buildings. At the same time, we also obtained environmental data (including air temperature, dew point, wind direction, wind speed, etc.) of the areas where the 30 buildings are located.

[0151] 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;

[0152] Based on the energy consumption time-series data of each of the 30 buildings, the metadata of building characteristics, and the environmental data of the area where the buildings are located, time-based text prompts and spatial text prompts are constructed. At the same time, in order to guide the energy consumption prediction model to understand and execute the energy consumption prediction task, a task description is constructed. Based on the spatial text prompts containing spatial information, the time-based text prompts containing time information, and the task description containing task guidance, text prompts corresponding to each building are constructed. These text prompts are applicable to energy consumption prediction tasks of different types of buildings in different regions.

[0153] Step S306: Construct training dataset, validation dataset, and test dataset based on the sample dataset;

[0154] The text prompts for each building and the corresponding future energy consumption values ​​of the energy consumption time series data are labeled. A sample dataset is established based on the labeled text prompts for each building and the sequence of energy consumption changes over time. Data from 5 buildings of each type of building in the sample dataset are selected to form a training dataset, data from 3 buildings of each type of building are selected to form a validation dataset, and data from 2 buildings of each type of building are selected to form a test dataset.

[0155] Step S308: Input the training dataset and the validation dataset into the energy consumption prediction model for training and validation, and obtain the future energy consumption prediction values ​​of each building in the training dataset and the validation dataset.

[0156] The training and validation datasets are input into the energy consumption prediction model for training and validation. The energy consumption time-series data of each building is processed using the time-series encoding submodule 21 (i.e., the time-series encoding branch) within the bimodal encoding module of the energy consumption prediction model to obtain time-series embeddings. The text prompt encoding submodule 22 (i.e., the text prompt encoding branch) of each building is processed using text prompts within the bimodal encoding module of the energy consumption prediction model to obtain text prompt embeddings. The text prompt embeddings are aligned with the time-series embeddings using the cross-modal alignment module 23 of the energy consumption prediction model to obtain aligned time-series embeddings. Finally, the aligned time-series embeddings are predicted using the time-series prediction module 24 of the energy consumption prediction model to obtain the predicted future energy consumption values ​​for each building in the training and validation datasets.

[0157] Step S310: Determine the loss function based on the predicted future energy consumption of each building in the training dataset and the actual future energy consumption of each building in the validation dataset; 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.

[0158] The loss function (mean squared error) is determined based on the predicted future energy consumption of each building and the actual future energy consumption of each building in the training and validation datasets. If the validation loss function valid_Loss of the current training round is smaller than that of the previous round, the validation loss function valid_Loss is updated, and the energy consumption prediction model obtained from this round of training is denoted as "bestmodel". If the valid_Loss of the current training round is not less than that of the previous round, valid_Loss is not updated. After not updating valid_Loss, it is necessary to verify how many consecutive training rounds have passed without updating valid_Loss. If valid_Loss has not been updated for 10 consecutive training rounds, 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, the next round of training and validation of the energy consumption prediction model is performed. If the total number of training rounds is not less than 100 rounds, the training and validation of the energy consumption prediction model is terminated, and the trained energy consumption prediction model is obtained.

[0159] Step S312: Evaluate the performance of the trained energy consumption prediction model based on the test dataset;

[0160] The test dataset is input into the trained energy consumption prediction model to obtain the future energy consumption prediction values ​​of each building in the test dataset. Based on the actual and predicted future energy consumption values ​​of each building in the test dataset, performance evaluation metrics are obtained to evaluate the performance of the trained energy consumption prediction model. The performance evaluation metrics include: mean absolute error, root mean square error, and coefficient of determination.

[0161] Step S314: Input the text prompts and energy consumption time series data of the building to be tested into the trained energy consumption prediction model to obtain the future energy consumption prediction value of the building to be tested.

[0162] The text prompts and energy consumption time series data of the building to be tested are input into the trained energy consumption prediction model to predict the energy consumption of the building to be tested in the next 24 hours, 96 hours and 720 hours, and the prediction results are obtained.

[0163] The method provided in this embodiment of the invention aims to address the problem that building energy consumption time series data cannot reflect information such as the building's geographical location. It constructs text prompts suitable for building energy consumption prediction tasks in different regions and of different types based on building energy consumption time series data, building feature metadata, and environmental data of the area where the building is located. By constructing a time series encoding submodule and a text prompt encoding submodule, the energy consumption time series data and text prompts of the building are processed without entanglement.

[0164] By studying cross-modal data alignment and distribution matching algorithms, a channel-level similarity-driven cross-modal alignment module was designed. This module filters out time-series embeddings without information entanglement from text prompt embeddings with information entanglement, explores the potential correlation between time-series data and text prompts, and integrates building energy consumption time-series data with text prompts. This achieves the correlation and consistency of cross-modal data, improves the generalization ability of the large language model in the energy consumption prediction model in unlabeled scenarios, enables the large language model to handle future energy consumption predictions for different thermal zones and different types of buildings, realizes deep interaction between building energy consumption time-series data and text prompts, completes feature decoupling, and effectively eliminates information redundancy.

[0165] By employing a distributed computing architecture and self-supervised learning methods, the representational power of the large language model is enhanced. In the fine-tuning stage, a large language model fine-tuning method (i.e., LoRA technology) is used to reduce the computational load of updating the large language model parameters, significantly reducing the time cost of predicting building energy consumption and maintaining the high adaptability of the large language model to energy consumption prediction tasks. This further improves the model's prediction accuracy, enabling more precise prediction of the future energy consumption of the building under test. Using the method provided in this embodiment, personnel can achieve energy consumption prediction for buildings of specific types in specific regions, obtaining more accurate energy consumption prediction results. This allows for better observation of building energy consumption trends, helping to formulate highly targeted energy-saving strategies for each building, achieving efficient energy management, and promoting the coordinated development of building energy consumption research and practice in terms of accuracy and efficiency. This breaks 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 has broad application prospects in the field of building energy consumption prediction.

[0166] This invention provides a computer-readable medium storing computer-executable instructions. When these computer-executable instructions are invoked and executed by a processor, they cause the processor to implement the methods described in the above embodiments.

[0167] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0168] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A building energy consumption prediction method based on a large language model, characterized in that, include: Acquire data about the building to be tested; wherein, the data about the building to be tested includes: time-series energy consumption data of the building to be tested, metadata of the building's characteristics, and environmental data of the area where the building to be tested is located; Text prompts are constructed based on the data of the building to be tested; wherein, the text prompts include: time-based text prompts and spatial text prompts; The text prompt also includes a task description, which includes the duration of energy consumption prediction for the building under test, the type of building under test, and the task to be performed by the expected energy consumption prediction model. The energy consumption time-series data of the building under test and the text prompt are input into the trained energy consumption prediction model to obtain the future energy consumption prediction value of the building under test. The energy consumption prediction model is trained on a training dataset of buildings labeled 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 calculations based on the aligned time-series embedding to obtain the future energy consumption prediction value of the building under test. The text prompt encoding submodule includes a large language model. The text prompt constructed based on the data of the building under test includes: The time-based text prompt is constructed based on the energy consumption time-series data of the building under test; the spatial text prompt is constructed based on the metadata of the building under test features and the environmental data of the area where the building under test is located; wherein, the metadata of the building under test features includes: the type, area and latitude and longitude of the building under test location; The construction of the time-based text prompt based on the energy consumption time-series data of the building under test includes: The energy consumption time-series data of the building under test is evenly divided into multiple sequence data segments according to time, and the energy consumption value of the building under test in each sequence data segment is determined; based on the energy consumption value of the building under test in each sequence data segment, the energy consumption trend of the building under test is determined; the time text prompt is constructed based on the start time, end time, energy consumption value of the building under test in each sequence data segment, and energy consumption trend of the building under test. The step of determining the time series embedding based on the energy consumption time series data includes: The energy consumption time series data of the building under test is reversibly normalized using the time series encoding submodule to obtain normalized sequence data; the normalized sequence data is then converted into a time series learnable matrix; and the time series learnable matrix is ​​input into the time series encoder to obtain the time series embedding. The cross-modal alignment based on the time series embedding and the text prompt embedding to obtain the aligned time series embedding includes: The time series embedding and the text prompt embedding are linearly transformed based on the cross-modal alignment module. Matrix multiplication and normalization are then performed 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. The aligned time series embedding is then obtained by performing linear transformation and matrix addition on the channel similarity matrix.

2. The building energy consumption prediction method according to claim 1, characterized in that, The step of determining the text prompt embedding based on the text prompt includes: The text prompt is tokenized using the token parser in the text prompt encoding submodule to obtain multiple tokens; Each of the aforementioned tags is input into a large language model to obtain the output of the last hidden layer of the large language model, and the output of the last hidden layer is input into a text prompt encoder to obtain the text prompt embedding.

3. 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 predicted future energy consumption of the building under test includes: The time series prediction module performs mapping variable processing on the aligned time series embedding and then performs prediction calculations to obtain the predicted future energy consumption value of the building under test.

4. The building energy consumption prediction method according to claim 1, characterized in that, The training steps for the energy consumption prediction model include: Acquire time-series data on building energy consumption, metadata on building characteristics, and environmental data of the area where the building is located; Text prompts are constructed based on the building's energy consumption time-series data, building feature metadata, and environmental data of the area where the building is located. The text prompts for each of the buildings and the corresponding future energy consumption values ​​of the energy consumption change over time are labeled, and a sample dataset is established based on the labeled text prompts for each of the buildings and the energy consumption change over time; wherein, the sample dataset includes a training dataset. The training dataset is input into the energy consumption prediction model to train the energy consumption prediction model, thereby obtaining the trained energy consumption prediction model.

5. The building energy consumption prediction method according to claim 4, characterized in that, The sample dataset also includes a validation dataset; The building energy consumption prediction method also includes: After each round of training of the energy consumption prediction model using the training dataset, the validation dataset is input into the energy consumption prediction model for validation, and the mean squared error is used as the loss function. If the mean squared error of the current training round is less than the mean squared error of the previous training round, the loss function is updated and the next round of model training is performed. If the loss function is not updated for a preset number of consecutive training epochs, then the total number of training epochs is checked to see if it is greater than the preset epoch threshold. If the total number of training epochs is less than the preset epoch threshold, then the next round of model training is performed. If the total number of training epochs is not less than the preset epoch threshold, then the model training is terminated.

6. The building energy consumption prediction method according to claim 4, characterized in that, The sample dataset also includes a test dataset; The building energy consumption prediction method also includes: Based on the test dataset, determine the actual future energy consumption of each of the buildings; The test dataset is input into the trained energy consumption prediction model to obtain the future energy consumption prediction value of each building. The performance of the trained energy consumption prediction model is evaluated based on the actual and predicted future energy consumption values ​​of each building; wherein the performance evaluation indicators include: mean absolute error, root mean square error, and coefficient of determination.

Citation Information

Patent Citations

  • 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

  • Explanatable building energy consumption prediction method and system based on large language model

    CN120124792A