Building energy consumption prediction method and system based on LightGBM

By training the building energy consumption prediction model through the LightGBM algorithm, the problems of insufficient accuracy and high computational complexity of traditional methods in nonlinear data processing are solved, efficient and accurate energy consumption prediction is achieved, and precise energy management of buildings is supported.

CN120781040APending Publication Date: 2025-10-14BEIJING QINGYUAN INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410389830.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-01
Publication Date
2025-10-14

AI Technical Summary

Technical Problem

Traditional building energy consumption prediction methods lack prediction accuracy and generalization capabilities when processing nonlinear and non-stationary time series data. Existing machine learning methods have high computational complexity or low training efficiency when processing large-scale data, making it difficult to meet the needs of building energy efficiency management.

Method used

The LightGBM algorithm is used to predict building energy consumption. By obtaining feature data, calling the trained energy consumption prediction model, and using the minimization loss function to fine-tune the model training, the model performance is optimized by combining gradient boosting and feature bundling techniques.

Benefits of technology

It improves the accuracy and applicability of building energy consumption forecasts, helps achieve precise energy management, reduces energy costs and improves energy efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120781040A_ABST
    Figure CN120781040A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of building technology and data analysis, in particular to a building energy consumption prediction method and system based on LightGBM. The method comprises the following steps: acquiring to-be-detected feature data; calling a trained energy consumption prediction model, taking the to-be-detected feature data as input of the energy consumption prediction model, and outputting a prediction result of the to-be-detected feature data; and determining the building energy consumption according to the prediction result. The method comprises the steps of data collection, preprocessing, feature engineering, model training, prediction and the like, and an accurate and flexible energy consumption prediction method is provided. The invention aims to improve the accuracy and applicability of energy consumption prediction and help a building to realize more accurate energy management and planning, so that the energy consumption cost is reduced and the energy efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure belongs to the technical field of building technology and data analysis, and particularly relates to a building energy consumption prediction method and system based on LightGBM. BACKGROUND

[0002] In the building industry, energy efficiency management is a key link to improve energy utilization efficiency, reduce energy consumption, and lower operating costs. Building energy consumption prediction plays a crucial role in energy efficiency management, which involves predicting the energy consumption of buildings in the future, such as the demand for various energy sources such as electricity, heat, and water. Accurate energy consumption prediction can not only help building managers efficiently allocate resources, but also provide decision support for urban energy planning and the operation of smart grids.

[0003] Traditional building energy consumption prediction methods mostly rely on statistical methods, such as autoregressive moving average (ARMA) models, autoregressive integrated moving average (ARIMA) models, etc. However, these models often perform poorly when dealing with nonlinear, non-stationary time series data, especially when faced with large-scale, complex building energy consumption data, their prediction accuracy and generalization ability are difficult to meet actual needs.

[0004] With the development of machine learning technology, some data-driven prediction models have been introduced into building energy consumption prediction, such as support vector machines (SVM), artificial neural networks (ANN), and random forests (RF), etc. These methods can better capture the complex patterns and relationships in the data, improving the accuracy of the prediction results. However, these methods still have shortcomings: support vector machines have low training efficiency on large data sets; artificial neural networks are prone to overfitting and their internal parameters are difficult to interpret; although random forests have strong interpretability, the computational complexity is still high when dealing with extremely large-scale data.

[0005] LightGBM, as a new gradient boosting decision tree (GBDT) algorithm, has shown significant advantages in prediction accuracy, training efficiency, and handling large-scale data. Compared with traditional GBDT algorithms, LightGBM uses gradient-based one-sided sampling (GOSS) and exclusive feature binding (EFB) to improve training efficiency and memory consumption. In addition, it can automatically handle missing values and support categorical features, making it easier to handle various data in the preprocessing step. These advantages make LightGBM have great application potential in building energy consumption prediction, especially when facing rapidly changing energy consumption patterns and large amounts of historical data, LightGBM can provide more rapid and accurate prediction results for building energy consumption management. Therefore, developing a building energy consumption prediction method based on LightGBM is not only the need of technology development, but also the demand of the market and environmental protection. SUMMARY

[0006] To solve the above problems, the disclosure provides a building energy consumption prediction method based on LightGBM, which comprises:

[0007] Obtaining the to-be-tested feature data;

[0008] Calling the trained energy consumption prediction model and inputting the to-be-tested feature data into the energy consumption prediction model, and outputting the prediction result of the to-be-tested feature data;

[0009] Determining the building energy consumption according to the prediction result.

[0010] Preferably, the building energy consumption feature data comprises outdoor temperature, historical energy consumption, building area, passenger flow and building use time.

[0011] Preferably, training the energy consumption prediction model comprises:

[0012] Obtaining an initial energy consumption prediction model and sample data; the sample data comprises sample feature data and sample energy consumption results corresponding to the sample feature data;

[0013] Training and fine-tuning the initial energy consumption prediction model using the sample data to minimize the loss function, to obtain the energy consumption prediction model.

[0014] Preferably, before training and fine-tuning the initial energy consumption prediction model using the sample data, it comprises:

[0015] Dividing the sample feature data into a plurality of sample feature sets;

[0016] Dividing the sample energy consumption results into a plurality of sample result sets, and setting the initial prediction value of each sample feature set as the average value of the corresponding sample result set.

[0017] Preferably, training and fine-tuning the initial energy consumption prediction model using the sample data to obtain the energy consumption prediction model comprises:

[0018] Using the sample feature set as input and the sample result set corresponding to the sample feature set as label, iteratively updating the initial energy consumption model to obtain the energy consumption prediction model.

[0019] Preferably, iteratively updating the initial energy consumption model comprises:

[0020] Determining the current residual error according to the prediction value of the initial energy consumption model of the last round; when the current round is 1, the prediction value of the initial energy consumption model of the last round is a preset constant value;

[0021] fitting a current residual according to the current decision tree;

[0022] updating the initial energy consumption model of the previous iteration according to the predicted value of the initial energy consumption model of the previous iteration, the current decision tree and a preset scaling factor.

[0023] Preferably, the expression for determining the current residual according to the predicted value of the initial energy consumption model of the previous iteration is as follows:

[0024] γ j = E i - F j-1 (x);

[0025] wherein γ j is the current residual, j is the iteration round, E i is the sample result set input in the jth iteration round, F j-1 (x) is the predicted value of the initial energy consumption model of the previous iteration, and F0(x) is a preset constant value.

[0026] Preferably, the expression for updating the initial energy consumption model of the previous iteration according to the predicted value of the initial energy consumption model of the previous iteration, the current decision tree and a preset scaling factor is as follows:

[0027] F j (x) = F j-1 (x) + γh j (x);

[0028] wherein F j (x) is the initial energy consumption model updated in the jth iteration round, F j-1 (x) is the predicted value of the initial energy consumption model of the previous iteration, F0(x) is a preset constant value, γ is the scaling factor, and h j is the current decision tree of the jth iteration round.

[0029] The present disclosure also proposes a building energy consumption prediction system based on LightGBM, which comprises:

[0030] an acquisition module configured to acquire feature data to be measured;

[0031] a calling module configured to call a trained energy consumption prediction model, input the feature data to be measured into the energy consumption prediction model as an input, and output a prediction result of the feature data to be measured;

[0032] a determination module configured to determine building energy consumption according to the prediction result.

[0033] The present disclosure also proposes an electronic device, which comprises:

[0034] processor and memory;

[0035] The processor calls the computer program stored in the memory to execute any of the above-mentioned LightGBM-based building energy consumption prediction methods.

[0036] The present disclosure also provides a computer-readable storage medium,

[0037] The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to execute any of the above-mentioned LightGBM-based building energy consumption prediction methods.

[0038] The present disclosure has the following beneficial effects:

[0039] This paper covers steps including data collection, preprocessing, feature engineering, model training, and prediction, providing an accurate and flexible energy consumption forecasting method. It aims to improve the accuracy and applicability of energy consumption forecasts, enabling more precise energy management and planning in buildings, thereby reducing energy costs and improving energy efficiency.

[0040] Other features and advantages of the present disclosure will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be achieved and obtained through the structures indicated in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0042] Figure 1 A diagram showing a method for predicting building energy consumption based on LightGBM in an embodiment of the present disclosure is shown;

[0043] Figure 2 A diagram of a building energy consumption prediction system based on LightGBM in an embodiment of the present disclosure is shown;

[0044] Figure 3 A diagram of a building energy consumption prediction device based on LightGBM in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0045] Example implementations are now described with reference to the drawings. Example implementations can, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the inventive aspects of the example implementations to those skilled in the art. The features, structures, or characteristics described can be combined in one or more implementations. In the following description, numerous specific details are recited to provide a thorough understanding of implementations of the disclosure. One skilled in the relevant art, however, will recognize that the implementations can be practiced without one or more of the specific details, or with other methods, components, materials, and so forth. In other instances, well-known structures have not been described in detail to avoid obscuring aspects of the disclosure.

[0046] Furthermore, the accompanying drawings are only schematic and are non-limiting detailed descriptions of implementations, and do not purport to be to scale. Identical reference signs in different drawings represent the same or similar elements.

[0047] The flow diagrams depicted in the accompanying drawings are merely illustrative examples, and do not necessarily include all steps. For example, some steps can be combined or partially combined, and some steps can be omitted, so the actual order of execution can vary from the one depicted.

[0048] The terms "first", "second", third", etc. and the like in the description and in the claims, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of these terms are to be interpreted broadly to encompass distinguishing between similar elements, for example, in a single embodiment or in different embodiments.

[0049] Furthermore, the terms "comprise", "comprising", "include", "including", and the like, if used in the specification and / or claims, are used in their open-ended sense, for example, that "comprising" means the process, method, article, or apparatus that includes the recited elements, but not excluding other elements. "Comprising" is to be interpreted as including the more restrictive terms "consisting of" and "consisting essentially of".

[0050] As Figure 1 The present disclosure proposes a building energy consumption prediction method based on LightGBM, which comprises:

[0051] S1 obtaining to-be-measured feature data;

[0052] S2 calling a trained energy consumption prediction model and inputting the to-be-measured feature data into the energy consumption prediction model, and outputting a prediction result of the to-be-measured feature data;

[0053] S3 determining building energy consumption according to the prediction result.

[0054] Specifically, the building energy consumption feature data comprises outdoor temperature, historical energy consumption, building area, passenger flow, and building use time.

[0055] Specifically, training the energy consumption prediction model comprises:

[0056] obtaining an initial energy consumption prediction model and sample data; the sample data comprises sample feature data and sample energy consumption results corresponding to the sample feature data;

[0057] training and fine-tuning the initial energy consumption prediction model by using the sample data as a target of minimizing a loss function, to obtain the energy consumption prediction model.

[0058] Specifically, before training and fine-tuning the initial energy consumption prediction model by using the sample data, the method comprises:

[0059] dividing the sample feature data into a plurality of sample feature sets;

[0060] dividing the sample energy consumption results into a plurality of sample result sets, and setting an initial prediction value of each sample feature set as an average value of a corresponding sample result set.

[0061] Specifically, training and fine-tuning the initial energy consumption prediction model by using the sample data to obtain the energy consumption prediction model comprises:

[0062] using the sample feature sets as inputs and using sample result sets corresponding to the sample feature sets as labels to iteratively update the initial energy consumption model, to obtain the energy consumption prediction model.

[0063] Specifically, iteratively updating the initial energy consumption model comprises:

[0064] determining a current residual error according to a prediction value of an initial energy consumption model of a previous round; when the current round is 1, the prediction value of the initial energy consumption model of the previous round is a preset constant value;

[0065] fitting a current decision tree according to the current residual error;

[0066] updating the initial energy consumption model of the previous round according to the prediction value of the initial energy consumption model of the previous round, the current decision tree, and a preset scaling factor.

[0067] Specifically, the expression for determining the current residual according to the prediction value of the initial energy consumption model of the previous iteration is as follows:

[0068] γ j = E i - F j-1 (x);

[0069] wherein γ j is the current residual, j is the iteration round, E i is the sample result set input in the jth iteration round, F j-1 (x) is the prediction value of the initial energy consumption model of the previous iteration, and F0(x) is a preset constant value, which is the initial prediction value of the set.

[0070] Specifically, the expression for updating the initial energy consumption model of the previous iteration according to the prediction value of the initial energy consumption model of the previous iteration, the current decision tree, and the preset scaling factor is as follows:

[0071] F j (x) = F j-1 (x) + γh j (x);

[0072] wherein F j (x) is the initial energy consumption model updated in the jth iteration round, F j-1 (x) is the prediction value of the initial energy consumption model of the previous iteration, F0(x) is a preset constant value, γ is a scaling factor, and h j is the current decision tree in the jth iteration round.

[0073] The detailed technical content is as follows:

[0074] 1. Data preparation

[0075] First, collect relevant historical data of building energy consumption, including but not limited to building energy consumption data such as electricity, heat, and water. At the same time, collect external factor data that may affect building energy consumption, such as weather conditions, temperature, humidity, and building usage (traffic volume, facility usage, etc.). After preprocessing, the data set is used as input data for subsequent prediction.

[0076] 2. LightGBM model

[0077] LightGBM is a gradient boosting framework that uses tree-based machine learning algorithms. It is proposed by Microsoft to optimize speed and performance while reducing memory usage.

[0078] The core of LightGBM lies in its two main innovations: Gradient-based One-Side Sampling (Goss) and Exclusive Feature Bundling (EFB).

[0079] Gradient-based One-Side Sampling down-samples the data, which can improve efficiency, but focuses on preserving instances with larger gradients, as these instances are more important for the learning of the gradient boosting algorithm.

[0080] Exclusive Feature Bundling bundles multiple exclusive features into a single feature, which can reduce the number of features that need to be processed, thus reducing the complexity of the model.

[0081] The model training of LightGBM involves the following steps:

[0082] (1) Initialize the model F0(x) as a constant value, such as the average value of the target variable.

[0083] (2) For each iteration i = 1 to N, perform the following operations:

[0084] a) Calculate the residual r i

[0085] r i = y - F i-1 (x) # (1);

[0086] where y is the target value, F i-1 (x) is the predicted value of the previous round of the model.

[0087] b) Fit a new decision tree h i (x) to the residual.

[0088] c) Use line search to find the optimal scaling factor γ, which will minimize the loss function L.

[0089] d) Update the model F i (x) = F i-1 (x) + γh i (x).

[0090] (3) After the model training is completed, the final model is

[0091]

[0092] LightGBM supports a variety of loss functions, including squared error, log loss, and other functions for regression and classification. For example, the squared error loss for a regression problem can be expressed as:

[0093]

[0094] Among them, y i is the true value, F(x i ) is the predicted value, and n is the number of iterations.

[0095] 3. Building energy consumption forecast

[0096] Using the prepared data, we train a LightGBM model and use the trained model to predict future building energy consumption. The prediction results can be used for building energy management and planning to achieve efficient energy use. Furthermore, this method can help building managers better understand and control energy consumption, leading to more efficient energy management.

[0097] Here is a concrete example:

[0098] Suppose we need to predict the electricity consumption of a building. We already have several feature data of length N, namely outdoor temperature (T), historical energy consumption (H), building area (A), passenger flow (P), and building occupancy time (U). We use this method to predict the energy consumption (E) of the building with a step length of m. The principle and steps are as follows:

[0099] (1) Initialize the model: First, initialize the LightGBM model and divide the feature data into several sets of length n, denoted as T i , H i , A i , P i , U i , divide the target variable, i.e., energy consumption (E), into sets of length m and record them as E i . Set the initial prediction value of each subset of feature data to the corresponding E i Average value Denoted as F i0 (x). Typically, 365 days or 180 days can be used as input to predict energy consumption data for the next 365 days, that is, n∈365,180, m=365. The choice of n and m is related to the prediction time length and time granularity.

[0100] (2) Iterative training: For each round of iterative training (assuming the current round is the jth round), perform the following operations:

[0101] a) Calculate the residual: Calculate the residual γ of the current model j :

[0102] γ j =E i -F j-1 (x)#(4);

[0103] Among them, E i is the target value (future energy consumption of length m), F j-1 (x) is the predicted value of the model in the previous round.

[0104] b) Fitting a new decision tree: using the residual γ j Fit a new decision tree h j (x), the decision tree will try to find the feature (T i ,H i ,A i ,P i ,U i ) and the residual γ j The relationship between them.

[0105] c) Find the optimal scaling factor: Use line search to find the optimal scaling factor γ that will minimize the loss function L.

[0106] d) Update the model: The model becomes:

[0107] F j (x) = F j-1 (x)+γh j (x)#(5);

[0108] (3) Final model: After the model training is completed, the final model is:

[0109]

[0110] (4) Using the model: When there are new observations (i.e., new energy consumption data for the past n time units), they can be input into the final model (6) to predict the energy consumption for the next m time units.

[0111] like Figure 2 As shown, the present disclosure also proposes a building energy consumption prediction system based on LightGBM, the system comprising:

[0112] An acquisition module 10 is used to acquire characteristic data to be measured;

[0113] The calling module 20 is used to call the trained energy consumption prediction model, and use the characteristic data to be measured as the input of the energy consumption prediction model, and output the prediction result of the characteristic data to be measured;

[0114] The determination module 30 is configured to determine the building energy consumption according to the prediction result.

[0115] like Figure 3As shown, the present disclosure also provides a LightGBM-based building energy consumption prediction device corresponding to the above-provided LightGBM-based building energy consumption prediction method. Since the embodiments of the device are similar to the above method embodiments, they are described relatively simply, and the relevant parts are described in the above method embodiment part. The device described below is only illustrative. The device can include a processor 1, a memory 2, a communication bus (i.e., the above device bus), and a lookup engine. The processor 1 and the memory 2 communicate with each other through the communication bus and communicate with the outside through the communication interface. The processor 1 can call the logical instructions in the memory 2 to execute the LightGBM-based building energy consumption prediction method.

[0116] In addition, the logical instructions in the above memory 2 can be implemented in the form of a software functional unit and sold or used as a separate product, which can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present disclosure essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present disclosure. The aforementioned storage medium includes a storage chip, a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0117] On the other hand, the present disclosure also provides a processor-readable storage medium, which stores a computer program 3 that is executed by the processor 1 to implement the LightGBM-based building energy consumption prediction method provided by the above embodiments.

[0118] The processor-readable storage medium can be any available medium or data storage device that the processor 1 can access, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state hard disk (SSD), etc.).

[0119] Those skilled in the art should understand: although the foregoing detailed description of the present disclosure is made with reference to the foregoing embodiments, the technical solutions described in the foregoing embodiments can be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure.

Claims

1. A building energy consumption prediction method based on LightGBM, characterized in that: The method comprises: Obtaining feature data to be measured; Calling a trained energy consumption prediction model, taking the feature data to be measured as input of the energy consumption prediction model, and outputting a prediction result of the feature data to be measured; The building energy consumption is determined according to the prediction result.

2. The building energy consumption prediction method based on LightGBM according to claim 1 is characterized in that: The building energy consumption characteristic data includes: outdoor temperature, historical energy consumption, building area, pedestrian flow and building usage time.

3. The building energy consumption prediction method based on LightGBM according to claim 1 is characterized in that: Training the energy consumption prediction model includes: Acquire an initial energy consumption prediction model and sample data; the sample data includes sample feature data and sample energy consumption results corresponding to the sample feature data; With the goal of minimizing the loss function, the initial energy consumption prediction model is trained and fine-tuned using the sample data to obtain the energy consumption prediction model.

4. The building energy consumption prediction method based on LightGBM according to claim 3 is characterized in that: Before training and fine-tuning the initial energy consumption prediction model using the sample data, the method includes: Dividing the sample feature data into multiple sample feature sets; The sample energy consumption results are divided into a plurality of sample result sets, and the initial prediction value of each sample feature set is set to the average value of the corresponding sample result set.

5. The building energy consumption prediction method based on LightGBM according to claim 3 is characterized in that: The initial energy consumption prediction model is trained and fine-tuned using the sample data to obtain the energy consumption prediction model, including: The sample feature set is used as input, and the sample result set corresponding to the sample feature set is used as a label to iteratively update the initial energy consumption model to obtain the energy consumption prediction model.

6. The building energy consumption prediction method based on LightGBM according to claim 5 is characterized in that: Iteratively updating the initial energy consumption model includes: The current residual is determined based on the predicted value of the initial energy consumption model in the previous round; when the current round is 1, the predicted value of the initial energy consumption model in the previous round is a preset constant value; fitting a current decision tree according to the current residual; The initial energy consumption model of the previous round is updated according to the predicted value of the initial energy consumption model of the previous round, the current decision tree and the preset scaling factor.

7. The building energy consumption prediction method based on LightGBM according to claim 6 is characterized in that: The expression for determining the current residual based on the predicted value of the initial energy consumption model in the previous round is as follows: c j =E i -F j-1 (x); Among them, γ j is the current residual, j is the iteration round, E i is the sample result set input in the jth iteration round, F j-1 (x) is the predicted value of the initial energy consumption model in the previous round, and F0(x) is the preset constant value.

8. The building energy consumption prediction method based on LightGBM according to claim 6 is characterized in that: The expression for updating the initial energy consumption model of the previous round according to the predicted value of the initial energy consumption model of the previous round, the current decision tree and the preset scaling factor is as follows: F j (x)=F j-1 (x)+γh j (x); Among them, F j (x) is the initial energy consumption model after the jth iteration update, F j-1 (x) is the predicted value of the initial energy consumption model in the previous round, F0(x) is the preset constant value, γ is the scaling factor, and h j is the current decision tree of the jth iteration round.

9. A building energy consumption prediction system based on LightGBM, characterized in that: The system comprises: An acquisition module is used to obtain the characteristic data to be tested; A calling module is used to call the trained energy consumption prediction model, and use the characteristic data to be measured as the input of the energy consumption prediction model, and output the prediction result of the characteristic data to be measured; The determination module is used to determine the building energy consumption according to the prediction result.

10. An electronic device, characterized in that: include: processor and memory; The processor calls the computer program stored in the memory to execute the LightGBM-based building energy consumption prediction method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to execute the LightGBM-based building energy consumption prediction method according to any one of claims 1 to 8.