Building energy consumption prediction method and device
By introducing dynamic task weights and domain adversarial loss into the long short-term memory network model, the problems of data dependence and high training cost of deep learning in building energy consumption prediction are solved, and efficient migration and accurate prediction between different building types are achieved.
Patent Information
- Application Number
- CN202510639980.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-09-26
AI Technical Summary
Existing deep learning methods have problems with strong data dependence and high training costs in building energy consumption prediction, especially for new or old buildings that lack historical data, and the prediction effect is poor; the traditional MAML algorithm has poor migration effect between different building types and ignores the unreasonable distribution of task weights and domain differences.
A model-independent meta-learning algorithm is used to train the long short-term memory network model. Dynamic task weights and domain adversarial loss are introduced for global updating. The dynamic task weights are used to adjust the weight distribution of the model between different building types, and the domain adversarial loss is used to reduce the distribution differences between the source and target domains.
The prediction performance in multi-building type tasks has been improved, and the system can quickly adapt to the energy consumption prediction of new buildings, thereby improving the prediction accuracy and efficiency.
Smart Images

Figure CN120706681A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of energy consumption prediction, and in particular to a method and device for predicting building energy consumption. Background Art
[0002] The construction industry is a major source of global energy consumption and carbon emissions. Statistics show that building operations account for approximately 30% to 40% of global energy consumption and contribute significantly to carbon emissions. With the intensification of global climate change and the energy crisis, the pressure on the construction industry to save energy and reduce emissions continues to grow. Therefore, improving building energy management and optimization has become a critical issue for the industry.
[0003] Building energy consumption forecasting, a crucial component of building energy management, can predict future energy consumption trends in advance, providing a scientific basis for energy consumption regulation, equipment optimization and scheduling, energy procurement, and carbon emissions management. Accurate energy consumption forecasting not only helps reduce energy consumption and operating costs, but also effectively improves the efficiency and environmental friendliness of energy systems.
[0004] Currently, building energy consumption prediction methods are primarily categorized into two main categories: physics-based methods and data-driven methods. Physics-based methods primarily simulate physical properties such as building structure, materials, climate conditions, and equipment operating status, using energy simulation software (such as EnergyPlus and TRNSYS) to predict building energy consumption. This approach has the advantages of a solid theoretical foundation and strong model interpretability, but requires a large amount of detailed building physics information and operational data, resulting in a complex modeling process and difficulty adapting to dynamically changing operating environments. Data-driven methods, on the other hand, leverage machine learning and deep learning techniques to model and predict using historical energy consumption data and environmental data. Common methods include regression analysis, support vector machines (SVMs), and random forests (RFs). These methods do not rely on complex building physics models and can automatically learn complex nonlinear relationships from data. In recent years, deep learning methods (such as artificial neural networks (ANNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), and their variants, long short-term memory (LSTM), and gated recurrent units (GRUs)) have garnered widespread attention in building energy prediction. Deep learning does not require complex feature engineering and can process large-scale and high-dimensional data. It has obvious advantages in capturing the long-term dependencies and feature interactions of time series data, and has high prediction accuracy.
[0005] However, despite the superior performance of deep learning methods in building energy consumption prediction, practical applications still face the following challenges: 1) High data dependency: Many newly built buildings or older buildings with inadequate energy management systems often lack sufficient operational data. Deep learning models typically rely on large amounts of historical data for training. For such buildings, this lack of historical data can limit model training and lead to poor prediction results. 2) High training cost: For such building tasks, models often need to be trained from scratch or fine-tuned on a large scale, resulting in long training times and high consumption of computing resources.
[0006] Considering these issues, some researchers have introduced the concept of meta-learning. This involves training a model on multiple tasks to enable it to rapidly learn new tasks. The model learns to optimize itself quickly on new data, allowing it to adapt quickly even with limited data. Model-Agnostic Meta-Learning (MAML) is a classic meta-learning algorithm applicable to various models (such as LSTM and CNN). Its basic idea is to train a general model that can quickly adapt to new tasks with fine-tuning on a small amount of data. However, traditional MAML suffers from the following issues: 1) irrational task weight distribution. MAML assumes that all tasks contribute equally to the model, ignoring the impact of tasks on different building types on model performance. For example, a training set may include office buildings, industrial plants, shopping malls, hotels, and apartments, but the goal is to predict energy consumption for office and industrial buildings. Traditional MAML may average across all tasks, ignoring the fact that data more relevant to office and industrial buildings is more helpful for model transfer. 2) Domain diversity: MAML assumes that the distribution of training and test tasks is similar (task homogeneity). If the data distributions of the source domain (office buildings) and the target domain (production buildings) differ significantly, for example, office buildings have high energy consumption on weekdays and low energy consumption on weekends, and their HVAC systems operate regularly. However, energy consumption fluctuations in production buildings are more closely related to production behavior. When the energy consumption patterns learned by MAML in office buildings are transferred to production buildings, they may not be able to capture the more random energy consumption changes in production buildings. The model gradient update direction may deviate from the optimal direction for the target task, resulting in poor model transfer results. Summary of the Invention
[0007] In order to overcome the above-mentioned defects, the present invention proposes a method and device for predicting building energy consumption.
[0008] In a first aspect, a method for predicting building energy consumption is provided, the method comprising:
[0009] Obtain feature time series prediction data corresponding to the target field;
[0010] The feature time series prediction data corresponding to the target domain is used as the input of the pre-trained long short-term memory network model to obtain the energy consumption time series prediction data corresponding to the target domain output by the pre-trained LSTM model;
[0011] The pre-trained long short-term memory network model is trained using a model-independent meta-learning algorithm, and dynamic task weights and domain adversarial losses are introduced during the training process for global updates.
[0012] Preferably, the characteristics include at least one of the following: building type, environmental characteristics, equipment status and human behavior.
[0013] Preferably, the training process of the pre-trained long short-term memory network model includes:
[0014] The training data corresponding to the source domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the source domain, and the training data corresponding to the target domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the target domain;
[0015] Based on the training data corresponding to the source domain and the training data corresponding to the target domain, a model-independent meta-learning algorithm is used to train the initial long short-term memory network model to obtain a pre-trained long short-term memory network model.
[0016] Furthermore, the target area includes: self-owned office and production buildings, and the source area includes: office buildings and production buildings.
[0017] Furthermore, in the process of introducing dynamic task weights and domain adversarial loss for global update, the global update formula is as follows:
[0018]
[0019] In the above formula, θ is the training parameter of the long short-term memory network model, α out is the outer loop learning rate, ρ i T i The corresponding dynamic task weight, About T i The loss function L task (T i ) is the gradient of θ, λ is a hyperparameter, About T i Field adversarial loss L domain (T i ) with respect to the gradient of θ, T i is the i-th group of sample data in the training data corresponding to the source domain.
[0020] Furthermore, the above-mentionedi The loss function is as follows:
[0021]
[0022] In the above formula, N i T i The number of samples in the support set, is the predicted value of the long short-term memory network model for sample k in the support set, y k_support is the true energy consumption value of sample k in the support set.
[0023] Furthermore, the T i The corresponding dynamic task weights are as follows:
[0024]
[0025] In the above formula, L query (T i ) is T i The loss on the query set, T j is the jth group of sample data in the training data corresponding to the source domain, L query (T j ) is T j The loss on the query set, S i T i The number of samples in the query set, is the predicted value of the long short-term memory network model for sample k in the query set, y k_query is the actual energy consumption value of sample k in the query set.
[0026] Furthermore, the above-mentioned i The domain adversarial loss is as follows:
[0027]
[0028] In the above formula, M is T i The number of all samples in , d m is the domain label of the mth sample, the source domain is marked as 1, and the target domain is marked as 0. is the result of predicting the domain label of the mth sample.
[0029] In a second aspect, a building energy consumption prediction device is provided, the building energy consumption prediction device comprising:
[0030] The acquisition module is used to obtain the characteristic time series prediction data corresponding to the target field;
[0031] The prediction module is used to use the feature time series prediction data corresponding to the target field as the input of the pre-trained long short-term memory network model to obtain the energy consumption time series prediction data corresponding to the target field output by the pre-trained LSTM model;
[0032] The pre-trained long short-term memory network model is trained using a model-independent meta-learning algorithm, and dynamic task weights and domain adversarial losses are introduced during the training process for global updates.
[0033] Preferably, the characteristics include at least one of the following: building type, environmental characteristics, equipment status and human behavior.
[0034] Preferably, the training process of the pre-trained long short-term memory network model includes:
[0035] The training data corresponding to the source domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the source domain, and the training data corresponding to the target domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the target domain;
[0036] Based on the training data corresponding to the source domain and the training data corresponding to the target domain, a model-independent meta-learning algorithm is used to train the initial long short-term memory network model to obtain a pre-trained long short-term memory network model.
[0037] Furthermore, the target area includes: self-owned office and production buildings, and the source area includes: office buildings and production buildings.
[0038] Furthermore, in the process of introducing dynamic task weights and domain adversarial loss for global update, the global update formula is as follows:
[0039]
[0040] In the above formula, θ is the training parameter of the long short-term memory network model, α out is the outer loop learning rate, ρ i T i The corresponding dynamic task weight, About T i The loss function L task (T i ) is the gradient of θ, λ is a hyperparameter, About T i Field adversarial loss L domain (T i ) with respect to the gradient of θ, T i is the i-th group of sample data in the training data corresponding to the source domain.
[0041] Furthermore, the above-mentioned i The loss function is as follows:
[0042]
[0043] In the above formula, N i T i The number of samples in the support set, is the predicted value of the long short-term memory network model for sample k in the support set, y k_support is the true energy consumption value of sample k in the support set.
[0044] Furthermore, the T i The corresponding dynamic task weights are as follows:
[0045]
[0046] In the above formula, L query (T i ) is T i The loss on the query set, T j is the jth group of sample data in the training data corresponding to the source domain, L query (T j ) is T j The loss on the query set, S i T i The number of samples in the query set, is the predicted value of the long short-term memory network model for sample k in the query set, y k_query is the actual energy consumption value of sample k in the query set.
[0047] Furthermore, the above-mentioned i The domain adversarial loss is as follows:
[0048]
[0049] In the above formula, M is T i The number of all samples in , d m is the domain label of the mth sample, the source domain is marked as 1, and the target domain is marked as 0. is the result of predicting the domain label of the mth sample.
[0050] In a third aspect, a computer device is provided, comprising: one or more processors;
[0051] The processor is configured to store one or more programs;
[0052] When the one or more programs are executed by the one or more processors, the building energy consumption prediction method is implemented.
[0053] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed, the building energy consumption prediction method is implemented.
[0054] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:
[0055] The present invention provides a method and device for predicting building energy consumption, comprising: obtaining characteristic time series prediction data corresponding to a target domain; using the characteristic time series prediction data corresponding to the target domain as input to a pre-trained long short-term memory network model, thereby obtaining energy consumption time series prediction data corresponding to the target domain output by the pre-trained LSTM model; wherein the pre-trained long short-term memory network model is trained using a model-independent meta-learning algorithm, and dynamic task weights and domain adversarial loss are introduced during the training process for global updates. The technical solution provided by the present invention, which introduces dynamic task weights and domain adversarial loss for global updates during the model training process, can be more efficient when processing tasks for multiple building types, and can quickly transfer knowledge from data of other building types, thereby improving prediction performance for new buildings. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a flow chart of the main steps of the building energy consumption prediction method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0059] As disclosed in the background, the construction industry is a major source of global energy consumption and carbon emissions. Statistics show that building operations account for approximately 30% to 40% of global energy consumption and contribute significantly to carbon emissions. With the intensification of global climate change and the energy crisis, the pressure on the construction industry to save energy and reduce emissions continues to grow. Therefore, improving building energy management and optimization has become a critical issue for the industry.
[0060] Building energy consumption forecasting, a crucial component of building energy management, can predict future energy consumption trends in advance, providing a scientific basis for energy consumption regulation, equipment optimization and scheduling, energy procurement, and carbon emissions management. Accurate energy consumption forecasting not only helps reduce energy consumption and operating costs, but also effectively improves the efficiency and environmental friendliness of energy systems.
[0061] Currently, building energy consumption prediction methods are primarily categorized into two main categories: physics-based methods and data-driven methods. Physics-based methods primarily simulate physical properties such as building structure, materials, climate conditions, and equipment operating status, using energy simulation software (such as EnergyPlus and TRNSYS) to predict building energy consumption. This approach has the advantages of a solid theoretical foundation and strong model interpretability, but requires a large amount of detailed building physics information and operational data, resulting in a complex modeling process and difficulty adapting to dynamically changing operating environments. Data-driven methods, on the other hand, leverage machine learning and deep learning techniques to model and predict using historical energy consumption data and environmental data. Common methods include regression analysis, support vector machines (SVMs), and random forests (RFs). These methods do not rely on complex building physics models and can automatically learn complex nonlinear relationships from data. In recent years, deep learning methods (such as artificial neural networks (ANNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), and their variants, long short-term memory (LSTM), and gated recurrent units (GRUs)) have garnered widespread attention in building energy prediction. Deep learning does not require complex feature engineering and can process large-scale and high-dimensional data. It has obvious advantages in capturing the long-term dependencies and feature interactions of time series data, and has high prediction accuracy.
[0062] However, despite the superior performance of deep learning methods in building energy consumption prediction, practical applications still face the following challenges: 1) High data dependency: Many newly built buildings or older buildings with inadequate energy management systems often lack sufficient operational data. Deep learning models typically rely on large amounts of historical data for training. For such buildings, this lack of historical data can limit model training and lead to poor prediction results. 2) High training cost: For such building tasks, models often need to be trained from scratch or fine-tuned on a large scale, resulting in long training times and high consumption of computing resources.
[0063] Considering these issues, some researchers have introduced the concept of meta-learning. This involves training a model on multiple tasks to enable it to rapidly learn new tasks. The model learns to optimize itself quickly on new data, allowing it to adapt quickly even with limited data. Model-Agnostic Meta-Learning (MAML) is a classic meta-learning algorithm applicable to various models (such as LSTM and CNN). Its basic idea is to train a general model that can quickly adapt to new tasks with fine-tuning on a small amount of data. However, traditional MAML suffers from the following issues: 1) irrational task weight distribution. MAML assumes that all tasks contribute equally to the model, ignoring the impact of tasks on different building types on model performance. For example, a training set may include office buildings, industrial plants, shopping malls, hotels, and apartments, but the goal is to predict energy consumption for office and industrial buildings. Traditional MAML may average across all tasks, ignoring the fact that data more relevant to office and industrial buildings is more helpful for model transfer. 2) Domain diversity: MAML assumes that the distribution of training and test tasks is similar (task homogeneity). If the data distributions of the source domain (office buildings) and the target domain (production buildings) differ significantly, for example, office buildings have high energy consumption on weekdays and low energy consumption on weekends, and their HVAC systems operate regularly. However, energy consumption fluctuations in production buildings are more closely related to production behavior. When the energy consumption patterns learned by MAML in office buildings are transferred to production buildings, they may not be able to capture the more random energy consumption changes in production buildings. The model gradient update direction may deviate from the optimal direction for the target task, resulting in poor model transfer results.
[0064] To improve the above-mentioned problems, the present invention provides a method and device for predicting building energy consumption, comprising: obtaining feature time series prediction data corresponding to a target domain; using the feature time series prediction data corresponding to the target domain as input to a pre-trained long short-term memory network model, and obtaining energy consumption time series prediction data corresponding to the target domain output by the pre-trained LSTM model; wherein the pre-trained long short-term memory network model is trained using a model-independent meta-learning algorithm, and dynamic task weights and domain adversarial loss are introduced during the training process for global updates. The technical solution provided by the present invention, which introduces dynamic task weights and domain adversarial loss for global updates during the model training process, can be more efficient when processing tasks for multiple building types, and can quickly transfer knowledge from data of other building types, thereby improving prediction performance on new buildings.
[0065] The above scheme is described in detail below.
[0066] Example 1
[0067] See attached Figure 1 , Figure 1 It is a flow chart of the main steps of a building energy consumption prediction method according to an embodiment of the present invention.
[0068] like Figure 1 As shown, the building energy consumption prediction method in the embodiment of the present invention mainly includes the following steps:
[0069] Step S101: Acquire feature time series prediction data corresponding to the target domain;
[0070] Step S102: using the feature time series prediction data corresponding to the target domain as input to a pre-trained long short-term memory network model, and obtaining the energy consumption time series prediction data corresponding to the target domain output by the pre-trained LSTM model;
[0071] The pre-trained long short-term memory network model is trained using a model-independent meta-learning algorithm, and dynamic task weights and domain adversarial losses are introduced during the training process for global updates.
[0072] The main purpose of introducing dynamic task weights is to address the differences in data importance between different building types, especially when data on company-owned office and production buildings is relatively scarce. Different building types (such as office buildings and production buildings) have different characteristics in terms of energy consumption patterns, environmental conditions, and equipment usage, so their contributions to the energy consumption prediction task are also different. Through dynamic weighting, the model can adjust the task weight according to the performance of each task. The better the performance of the task on the query set, the more useful information the model has learned in the task, and the lower the weight should be. The greater the error of the task on the query set, the more the model still needs to be improved on the task, and the higher the weight should be.
[0073] The core goal of introducing the domain adversarial loss is to reduce the distribution difference between the source domain (office buildings, commercial buildings) and the target domain (company-owned office and production buildings). Domain adversarial training introduces a domain discriminator, whose task is to determine whether a given sample comes from the source or target domain. Simultaneously, the model adjusts the feature extractor through backpropagation to make the features indistinguishable between the source and target domains.
[0074] In this embodiment, the characteristics include at least one of the following: building type, environmental characteristics, equipment status, and human behavior.
[0075] In one embodiment, building types include: office buildings, production buildings, environmental characteristics include: temperature, humidity, wind speed, solar radiation, equipment status includes: HVAC operating status, lighting equipment status, and personnel behavior includes: occupancy pattern and number of people in the building.
[0076] In this embodiment, the training process of the pre-trained long short-term memory network model includes:
[0077] The training data corresponding to the source domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the source domain, and the training data corresponding to the target domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the target domain;
[0078] Based on the training data corresponding to the source domain and the training data corresponding to the target domain, a model-independent meta-learning algorithm is used to train the initial long short-term memory network model to obtain a pre-trained long short-term memory network model.
[0079] In one embodiment, the target area includes: owned office and production buildings, and the source area includes: office buildings and production buildings.
[0080] In one embodiment, in the process of introducing dynamic task weights and domain adversarial loss for global update, the global update formula is as follows:
[0081]
[0082] In the above formula, θ is the training parameter of the long short-term memory network model, α out is the outer loop learning rate, ρ i T i The corresponding dynamic task weight, About T i The loss function L task (T i ) is the gradient of θ, λ is a hyperparameter, About T i Field adversarial loss L domain (T i ) with respect to the gradient of θ, T i is the i-th group of sample data in the training data corresponding to the source domain.
[0083] For T i The sampling process, first, samples tasks T from multiple building types (office buildings, production buildings) i Each building type corresponds to an independent task. Secondly, for each task, time series data is sampled from that building type, including environmental data, equipment status, personnel behavior, and other information. Next, based on the sampled time series data, the corresponding label data is extracted, namely the hourly energy consumption value of the building. Finally, the data for each task is divided into a support set and a query set. The specific task data set is divided as follows:
[0084] Office building data (12 months). Support set (used for inner loop updates): data from January to October; query set (used for outer loop optimization): data from November and December.
[0085] Production building data (12 months). Support set (for inner loop updates): data from January to October; query set (for outer loop optimization): data from November and December.
[0086] Proprietary office and production building data (2 months). Adaptation set (for inner loop updates): data from weeks 1 to 3; support set (for fine-tuning): data from weeks 4 to 6; query set (for model evaluation): data from weeks 7-8.
[0087] After the model is pre-trained, it is fine-tuned on the support set data of the company's own office and production buildings. Since the data of the company's own office and production buildings is relatively scarce, the goal of target task fine-tuning is to quickly adjust the model using a small amount of company-owned office and production building data to improve its predictive ability.
[0088] In one embodiment, the T i The loss function is as follows:
[0089]
[0090] In the above formula, N i T i The number of samples in the support set, is the predicted value of the long short-term memory network model for sample k in the support set, y k_support is the true energy consumption value of sample k in the support set.
[0091] In one embodiment, the T i The corresponding dynamic task weights are as follows:
[0092]
[0093] In the above formula, L query (T i ) is T i The loss on the query set, T j is the jth group of sample data in the training data corresponding to the source domain, L query (T j ) is T j The loss on the query set, S i T i The number of samples in the query set, is the predicted value of the long short-term memory network model for sample k in the query set, y k_query is the actual energy consumption value of sample k in the query set.
[0094] In one embodiment, the T i The domain adversarial loss is as follows:
[0095]
[0096] In the above formula, M is T i The number of all samples in , d m is the domain label of the mth sample, the source domain is marked as 1, and the target domain is marked as 0. is the result of predicting the domain label of the mth sample.
[0097] Example 2
[0098] Based on the same inventive concept, the present invention also provides a building energy consumption prediction device, which includes:
[0099] The acquisition module is used to obtain the characteristic time series prediction data corresponding to the target field;
[0100] The prediction module is used to use the feature time series prediction data corresponding to the target field as the input of the pre-trained long short-term memory network model to obtain the energy consumption time series prediction data corresponding to the target field output by the pre-trained LSTM model;
[0101] The pre-trained long short-term memory network model is trained using a model-independent meta-learning algorithm, and dynamic task weights and domain adversarial losses are introduced during the training process for global updates.
[0102] Preferably, the characteristics include at least one of the following: building type, environmental characteristics, equipment status and human behavior.
[0103] Preferably, the training process of the pre-trained long short-term memory network model includes:
[0104] The training data corresponding to the source domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the source domain, and the training data corresponding to the target domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the target domain;
[0105] Based on the training data corresponding to the source domain and the training data corresponding to the target domain, a model-independent meta-learning algorithm is used to train the initial long short-term memory network model to obtain a pre-trained long short-term memory network model.
[0106] Furthermore, the target area includes: self-owned office and production buildings, and the source area includes: office buildings and production buildings.
[0107] Furthermore, in the process of introducing dynamic task weights and domain adversarial loss for global update, the global update formula is as follows:
[0108]
[0109] In the above formula, θ is the training parameter of the long short-term memory network model, α out is the outer loop learning rate, ρ i T i The corresponding dynamic task weight, About T i The loss function L task (T i ) is the gradient of θ, λ is a hyperparameter, About T i Field adversarial loss L domain (T i ) with respect to the gradient of θ, T i is the i-th group of sample data in the training data corresponding to the source domain.
[0110] Furthermore, the above-mentioned i The loss function is as follows:
[0111]
[0112] In the above formula, N i T i The number of samples in the support set, is the predicted value of the long short-term memory network model for sample k in the support set, y k_support is the true energy consumption value of sample k in the support set.
[0113] Furthermore, the T i The corresponding dynamic task weights are as follows:
[0114]
[0115] In the above formula, L query (T i ) is T i The loss on the query set, T j is the jth group of sample data in the training data corresponding to the source domain, L query (T j ) is T j The loss on the query set, S o T o The number of samples in the query set, is the predicted value of the long short-term memory network model for sample k in the query set, y k_qiery is the actual energy consumption value of sample k in the query set.
[0116] Furthermore, the above-mentioned i The domain adversarial loss is as follows:
[0117]
[0118] In the above formula, M is T i The number of all samples in , d m is the domain label of the mth sample, the source domain is marked as 1, and the target domain is marked as 0. is the result of predicting the domain label of the mth sample.
[0119] Example 3
[0120] Based on the same inventive concept, the present invention also provides a computer device, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function, so as to implement the steps of a building energy consumption prediction method in the above embodiment.
[0121] Example 4
[0122] Based on the same inventive concept, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It can be understood that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space. These instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the steps of a building energy consumption prediction method in the above embodiment.
[0123] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0124] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0125] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1The function specified in one or more boxes.
[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A building energy consumption prediction method, characterized in that: The method comprises: Obtain feature time series prediction data corresponding to the target field; The feature time series prediction data corresponding to the target domain is used as the input of the pre-trained long short-term memory network model to obtain the energy consumption time series prediction data corresponding to the target domain output by the pre-trained LSTM model; The pre-trained long short-term memory network model is trained using a model-independent meta-learning algorithm, and dynamic task weights and domain adversarial losses are introduced during the training process for global updates.
2. The method according to claim 1, wherein The characteristics include at least one of the following: building type, environmental characteristics, equipment status and human behavior.
3. The method according to claim 1, wherein The training process of the pre-trained long short-term memory network model includes: The training data corresponding to the source domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the source domain, and the training data corresponding to the target domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the target domain; Based on the training data corresponding to the source domain and the training data corresponding to the target domain, a model-independent meta-learning algorithm is used to train the initial long short-term memory network model to obtain a pre-trained long short-term memory network model.
4. The method according to claim 3, wherein The target area includes: self-owned office and production buildings, and the source area includes: office buildings and production buildings.
5. The method according to claim 3, wherein In the process of introducing dynamic task weights and domain adversarial loss for global update, the global update formula is as follows: In the above formula, θ is the training parameter of the long short-term memory network model, α out is the outer loop learning rate, ρ i T i The corresponding dynamic task weight, About T i The loss function L task (T i ) is the gradient of θ, λ is a hyperparameter, About T i Field adversarial loss L domain (T i ) with respect to the gradient of θ, T i is the i-th group of sample data in the training data corresponding to the source domain.
6. The method according to claim 5, wherein Regarding T i The loss function is as follows: In the above formula, N i T i The number of samples in the support set, is the predicted value of the long short-term memory network model for sample k in the support set, y k_support is the true energy consumption value of sample k in the support set.
7. The method according to claim 6, wherein The T i The corresponding dynamic task weights are as follows: In the above formula, L query (T i ) is T i The loss on the query set, T j is the jth group of sample data in the training data corresponding to the source domain, L query (T j ) is T j The loss on the query set, S i T i The number of samples in the query set, is the predicted value of the long short-term memory network model for sample k in the query set, y k_query is the actual energy consumption value of sample k in the query set.
8. The method according to claim 7, wherein Regarding T i The domain adversarial loss is as follows: In the above formula, M is T i The number of all samples in , d m is the domain label of the mth sample, the source domain is marked as 1, and the target domain is marked as 0. is the result of predicting the domain label of the mth sample.
9. A building energy consumption prediction device, characterized in that: The device comprises: The acquisition module is used to obtain the characteristic time series prediction data corresponding to the target field; The prediction module is used to use the feature time series prediction data corresponding to the target field as the input of the pre-trained long short-term memory network model to obtain the energy consumption time series prediction data corresponding to the target field output by the pre-trained LSTM model; The pre-trained long short-term memory network model is trained using a model-independent meta-learning algorithm, and dynamic task weights and domain adversarial losses are introduced during the training process for global updates.
10. The device according to claim 9, wherein The characteristics include at least one of the following: building type, environmental characteristics, equipment status and human behavior.
11. The device according to claim 9, wherein The training process of the pre-trained long short-term memory network model includes: The training data corresponding to the source domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the source domain, and the training data corresponding to the target domain is constructed using the characteristic time series historical data and energy consumption time series historical data corresponding to the target domain; Based on the training data corresponding to the source domain and the training data corresponding to the target domain, a model-independent meta-learning algorithm is used to train the initial long short-term memory network model to obtain a pre-trained long short-term memory network model.
12. The device according to claim 11, wherein The target area includes: self-owned office and production buildings, and the source area includes: office buildings and production buildings.
13. The device according to claim 11, wherein In the process of introducing dynamic task weights and domain adversarial loss for global update, the global update formula is as follows: In the above formula, θ is the training parameter of the long short-term memory network model, α out is the outer loop learning rate, ρ i T i The corresponding dynamic task weight, About T i The loss function L task (T i ) is the gradient of θ, λ is a hyperparameter, About T i Field adversarial loss L domain (T i ) with respect to the gradient of θ, T i is the i-th group of sample data in the training data corresponding to the source domain.
14. The device according to claim 13, wherein Regarding T i The loss function is as follows: In the above formula, N i T i The number of samples in the support set, is the predicted value of the long short-term memory network model for sample k in the support set, y k_support is the true energy consumption value of sample k in the support set.
15. The device according to claim 14, wherein The T i The corresponding dynamic task weights are as follows: In the above formula, L query (T i ) is T i The loss on the query set, T j is the jth group of sample data in the training data corresponding to the source domain, L query (T j ) is T j The loss on the query set, S i T i The number of samples in the query set, is the predicted value of the long short-term memory network model for sample k in the query set, y k_query is the actual energy consumption value of sample k in the query set.
16. The device according to claim 15, characterized in that Regarding T i The domain adversarial loss is as follows: In the above formula, M is T i The number of all samples in , d m is the domain label of the mth sample, the source domain is marked as 1, and the target domain is marked as 0. is the result of predicting the domain label of the mth sample.
17. A computer device, characterized in that: include: one or more processors; The processor is configured to execute one or more programs; When the one or more programs are executed by the one or more processors, the building energy consumption prediction method according to any one of claims 1 to 8 is implemented.
18. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed, the building energy consumption prediction method according to any one of claims 1 to 8 is implemented.