Building energy consumption prediction method, device, terminal equipment and storage medium

By using decision tree model and automatic hyperparameter optimization mechanism in building energy consumption prediction, the existing methods are solved in terms of flexibility, parameter adjustment, computing efficiency, data requirements and interpretability, and more efficient and automated and explainable energy consumption prediction.

CN119026759BActive Publication Date: 2025-02-11SHENZHEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411505509.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-02-11
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

The existing building energy consumption prediction methods have problems in insufficient flexibility, complex parameter adjustment, low computing efficiency, large data demand and poor interpretability, and it is difficult to dynamically adapt to the influence of multiple factors.

Method used

The decision tree model is introduced, and the decision tree model is trained through the historical data set to identify the key factors affecting building energy consumption, and the automatic parameter adjustment is achieved using the automatic hyperparameter optimization mechanism.

Benefits of technology

It improves the flexibility and automation of building energy consumption prediction, reduces the dependence on data volume, and enhances the accuracy and interpretability of predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026759B_ABST
    Figure CN119026759B_ABST
Patent Text Reader

Abstract

The present application is applicable to the technical field of building energy consumption prediction, and provides a building energy consumption prediction method, device, terminal equipment and storage medium. The prediction method includes: obtaining the meteorological data of the prediction day, the meteorological data of the historical day and the energy consumption data of the target building, and the prediction day and the historical day have date attributes; obtaining a decision tree model according to the historical data set training; the historical data set is composed of the energy consumption data, meteorological data and date attributes of the historical day; based on the meteorological data of the prediction day and the decision tree model, the historical data set is divided into multiple historical data subsets; the target historical data subset is determined from the multiple historical data subsets; the target historical day is determined from the target historical data subset, and the energy consumption generated by the target building on the prediction day is predicted according to the energy consumption data of the determined target historical day. The building energy consumption prediction method provided by the present application integrates the decision tree model and the similar day selection strategy to achieve accurate prediction of building energy consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of building energy consumption prediction, and in particular, relates to a building energy consumption prediction method, device, terminal equipment and storage medium. Background Art

[0002] Building energy consumption prediction is one of the key technologies to achieve building energy conservation and intelligent management. As global energy consumption and environmental protection issues become increasingly prominent, accurate building energy consumption prediction becomes particularly important for optimizing energy use, reducing operating costs and reducing carbon emissions. Building energy consumption prediction technology not only provides data support for improving building energy efficiency, but also provides a basis for the optimization strategy of intelligent control systems.

[0003] There are many types of existing building energy consumption prediction methods, including physics-based methods and data-driven methods. Physics-based methods rely on the physical properties of buildings and thermodynamic principles and require a large amount of input data and parameters. These models may be limited in practical applications. Data-driven methods predict future energy consumption by analyzing historical energy consumption data and other related data (such as meteorological data, building usage patterns, etc.). Common methods include similar day methods, time series analysis, artificial neural networks, etc. These methods are faster and more flexible than physical models and are widely used in the field of building energy consumption prediction. However, there are also some problems with existing data-driven methods. Similar day energy consumption prediction methods have limited performance in dealing with multiple factors such as meteorological conditions and personnel activities, and rely on manual adjustment of parameters, making it difficult to achieve automation. At the same time, although machine learning and deep learning methods can handle complex nonlinear problems, they rely heavily on large-scale data, take a long time to train models, and are prone to overfitting. In addition, these methods are black box models and it is difficult to explain the principles. Summary of the invention

[0004] The embodiments of the present application provide a building energy consumption prediction method, device, terminal device and storage medium, which can solve the problems of insufficient flexibility, complex parameter adjustment, low computational efficiency, large data demand, poor interpretability and weak dynamic adaptability in existing similar day energy consumption prediction technologies. The method introduces a decision tree model to identify the degree of influence of factors such as meteorological conditions and human activities on energy consumption, and realizes automatic parameter adjustment through an automatic hyperparameter optimization mechanism.

[0005] In a first aspect, an embodiment of the present application provides a method for predicting building energy consumption, comprising:

[0006] Acquire meteorological data of a forecast day, meteorological data of a historical day, and energy consumption data of a historical day of a target building, wherein the forecast day and the historical day have date attributes;

[0007] Based on the meteorological data of the forecast day and the decision tree model, the historical data set is divided into a plurality of historical data subsets; wherein the decision tree model is trained based on the historical data set, and the segmentation nodes of the decision tree model are used to characterize the key factors affecting the energy consumption of the target building; the historical data set is composed of the energy consumption data of the historical day, the meteorological data of the historical day and the date attribute of the historical day;

[0008] Determining a target historical data subset from the plurality of historical data subsets;

[0009] A target historical day is determined from the target historical data subset, and the energy consumption of the target building on the predicted day is predicted based on the energy consumption data of the determined target historical day.

[0010] In a possible implementation manner of the first aspect, before dividing the historical data set into a plurality of historical data subsets based on the meteorological data of the forecast day and the decision tree model, the method further includes:

[0011] Extracting the average temperature of multiple different time periods of each historical day, the average energy consumption data of the corresponding time period, and the date attribute of each historical day from the historical data set;

[0012] The average temperature of multiple different time periods of each historical day and the date attributes of each historical day are used as input features of the decision tree model, and the energy consumption data corresponding to multiple different time periods of each historical day are used as output features of the decision tree model. The decision tree model is trained, and when the decision tree model meets the preset training stop condition, the trained decision tree model is obtained.

[0013] In a possible implementation manner of the first aspect, the historical data set is divided into a plurality of historical data subsets based on the meteorological data of the forecast day and the decision tree model, including:

[0014] Extracting the average temperature of multiple different time periods of the forecast day and the date attribute of the forecast day from the meteorological data of the forecast day;

[0015] Inputting the average temperatures of a plurality of different time periods of the predicted day and the date attribute of the predicted day into the decision tree model to obtain a segmentation result of the decision tree model;

[0016] If the segmentation result of the decision tree model is to use meteorological data as the segmentation node of the decision tree model, the historical data set is divided into two historical data subsets, namely a first historical data subset and a second historical data subset; wherein the date attribute includes a classification label, and the classification label includes a working day and a non-working day; the first historical data subset is a data set corresponding to a historical day selected from the historical data set when it is a working day; the second historical data subset is a data set corresponding to a historical day selected from the historical data set when it is a non-working day.

[0017] In a possible implementation manner of the first aspect, determining a target historical data subset from the multiple historical data subsets includes:

[0018] When the classification label of the predicted day is a working day, the target historical data subset is determined to be the first historical data subset from the first historical data subset and the second historical data subset; when the classification label of the predicted day is a non-working day, the target historical data subset is determined to be the second historical data subset from the first historical data subset and the second historical data subset.

[0019] In a possible implementation manner of the first aspect, the dividing the historical data set into a plurality of historical data subsets based on the meteorological data of the forecast day and the decision tree model further includes:

[0020] If the segmentation result of the decision tree model is to use the date type as the segmentation node of the decision tree model, when the classification label of the predicted day is a working day, the historical data set is divided into three historical data subsets, namely the third historical data subset, the fourth historical data subset, and the second historical data subset; when the classification label of the predicted day is a non-working day, the historical data set is divided into three historical data subsets, namely the first historical data subset, the fifth historical data subset, and the sixth historical data subset;

[0021] Among them, the date attribute also includes date type; the date type includes Monday to Sunday; among them, Monday to Friday are working days; Saturday and Sunday are non-working days; the third historical data subset is the data set corresponding to the historical day selected from the first historical data subset is the same date type as the date type of the predicted day; the fourth historical data subset is the other data sets of the first historical data subset excluding the third historical data subset; the fifth historical data subset is the data set corresponding to the historical day selected from the second historical data subset is the same date type as the date type of the predicted day; the sixth historical data subset is the other data sets of the second historical data subset excluding the fifth historical data subset.

[0022] In a possible implementation manner of the first aspect, determining a target historical data subset from the multiple historical data subsets further includes:

[0023] When the date type of the predicted day is a working day, the target historical data subset is determined to be the third historical data subset from the third historical data subset, the fourth historical data subset and the second historical data subset; when the date type of the predicted day is a non-working day, the target historical data subset is determined to be the fifth historical data subset from the first historical data subset, the fifth historical data subset and the sixth historical data subset.

[0024] In a possible implementation manner of the first aspect, determining a target historical day from the target historical data subset, and predicting the energy consumption of the target building on the predicted day according to the energy consumption data of the determined target historical day, includes:

[0025] Obtain a preset maximum historical day set, a maximum historical time window set, and a similarity percentage set; wherein the maximum historical day set is used to select historical day data of different lengths from the target historical data subset; the maximum historical time window set is used to correspond the time of the forecast day to the time window length of the historical day before and after the corresponding time when comparing the meteorological data of the forecast day and the historical day; the similarity percentage set is used to determine the length of the similarity ranking between the meteorological data of the historical day and the meteorological data of the forecast day;

[0026] Based on the energy consumption data and meteorological data of the historical day A that is closest to the predicted day, each parameter combination in the maximum historical day set, the maximum historical time window set and the similarity percentage set is optimized, and for each day in the A days, an optimal parameter combination (X, Y, Z) is determined, where X represents the length of the determined target historical day, Y represents the determined time window length, and Z represents the determined similarity ranking value;

[0027] According to the frequency of occurrence of each optimal parameter combination in day A, the weight corresponding to each optimal parameter combination is calculated;

[0028] According to each optimal parameter combination and the meteorological data of the forecast day, the energy consumption under each optimal parameter combination is calculated respectively; according to the weight of each optimal parameter combination, the calculated energy consumption under each optimal parameter combination is weighted averaged to obtain the energy consumption forecast value of the target building on the forecast day.

[0029] In a second aspect, an embodiment of the present application provides a building energy consumption prediction device, comprising:

[0030] An acquisition module, used to acquire the meteorological data of the forecast day, the meteorological data of the historical day, and the energy consumption data of the historical day of the target building, wherein the forecast day and the historical day have date attributes;

[0031] A partitioning module, for partitioning the historical data set into a plurality of historical data subsets based on the meteorological data of the forecast day and a decision tree model; wherein the decision tree model is trained based on the historical data set, and the partitioning nodes of the decision tree model are used to characterize key factors affecting the energy consumption of the target building; and the historical data set is composed of the energy consumption data of the historical day, the meteorological data of the historical day, and the date attribute of the historical day;

[0032] A determination module, used to determine a target historical data subset from a plurality of the historical data subsets;

[0033] The prediction module is used to determine a target historical day from the target historical data subset, and predict the energy consumption of the target building on the predicted day based on the energy consumption data of the determined target historical day.

[0034] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a building energy consumption prediction method as described in any one of the first aspects above is implemented.

[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the building energy consumption prediction method as described in any one of the above-mentioned first aspects is implemented.

[0036] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the building energy consumption prediction method described in any one of the first aspects above.

[0037] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0038] The building energy consumption prediction method provided in the embodiment of the present application firstly introduces a decision tree model and uses historical data sets for training, so that the decision tree model can identify and capture the key factors affecting building energy consumption. The split nodes of the decision tree model are divided based on these key factors, which can determine whether the building energy consumption is dominated by human settlement information or outdoor temperature, effectively solving the problem that the existing similar day method is difficult to cope with the complex influence of multiple factors (such as meteorological conditions and personnel activities), and thereby reasonably dividing the historical data set. Secondly, according to the date attributes of the predicted day and the dominant factors of building energy consumption, the target historical data subset is determined from the divided multiple historical data subsets. After determining the target historical data subset, the historical day that is most similar to the meteorological data of the predicted day is further sought. The relevant hyperparameters are adjusted by hyperparameter optimization through grid search, and are rolled out according to the predicted day, so that the prediction process does not require manual adjustment of parameters. Compared with the traditional similar day method, this method automatically adjusts parameters and dynamically updates parameters for each prediction, without the need for manual adjustment by professionals. It identifies and captures the dominant factors of building energy consumption through decision trees, enhancing the effect of similar days in dealing with complex multi-factor influencing scenarios. Compared with machine learning methods, this method not only improves computational efficiency, but also reduces dependence on data volume, and is suitable for scenarios with less data. This method can accurately predict the energy consumption of the target building on the prediction day, and is highly interpretable, easy to understand and apply in engineering practice.

[0039] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0041] Figure 1 It is a flow chart of a building energy consumption prediction method provided by an embodiment of the present application;

[0042] Figure 2 It is a flowchart of the steps of obtaining a decision tree model based on historical data set training provided by an embodiment of the present application;

[0043] Figure 3 It is a flowchart of a sub-step of step 102 provided in an embodiment of the present application;

[0044] Figure 4 It is a schematic diagram of the segmentation result of the decision tree model of the energy consumption of the supply and exhaust fans provided in one embodiment of the present application;

[0045] Figure 5 It is a flowchart of another sub-step of step 102 provided in an embodiment of the present application;

[0046] Figure 6 is a schematic diagram of the segmentation results of the decision tree model for outdoor lighting sub-item energy consumption provided by an embodiment of the present application;

[0047] Figure 7 is a flowchart of the sub-steps of step 102 provided in an embodiment of the present application;

[0048] Figure 8 This is a schematic diagram of the optimal combination parameters seven days before the forecast date found using a network search method provided by an embodiment of the present application;

[0049] Fig. 9 It is a schematic diagram of the prediction error obtained by the applicant through experimental calculation provided by an embodiment of the present application;

[0050] Fig.10 It is a structural schematic diagram of a building energy consumption prediction device provided in one embodiment of the present application;

[0051] Fig.11 It is a structural diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0052] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0053] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0054] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0055] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0056] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0057] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.

[0058] As a key technology for achieving building energy conservation and intelligent management, the importance of building energy consumption prediction is becoming more and more prominent in the context of increasingly severe energy consumption and environmental protection issues. There are many types of existing building energy consumption prediction methods, among which data-driven methods mainly include technologies based on similar day selection, time series analysis, machine learning and deep learning. Each method has its advantages in specific scenarios, but also has its own limitations:

[0059] Similar day prediction method: Similar day prediction uses the actual energy consumption data of similar days to find dates with similar meteorological characteristics and day types as the target prediction day in historical data to estimate future energy consumption. This method has low data volume requirements and is easy to operate. It is particularly effective when data is limited. However, since building energy consumption is affected by multiple factors (such as weather and human activities), the similar day method has limited flexibility in dealing with dynamic changes and nonlinear relationships. Although the similar day parameter setting is relatively simple, it still relies on the professional knowledge of professionals to set relevant parameters, which reduces the automation and scalability of the model.

[0060] Time Series Forecasting Methods:

[0061] Time series analysis predicts future energy consumption by mining the time dependency of historical data (such as ARIMA and SARIMA models). This method performs well in dealing with linear relationships, but it does not perform as expected in multivariate, nonlinear scenarios such as building energy consumption, especially when data is missing. Time series models require complete data, otherwise data interpolation is required, which increases the complexity of data processing, and the interpolation method may reduce the prediction accuracy. When faced with external uncertainties such as the environment and meteorology, the adaptability of time series is weak.

[0062] Machine learning and deep learning methods: In recent years, machine learning algorithms such as support vector machines and random forests, as well as deep learning algorithms such as neural networks and long short-term memory (LSTM) have been widely used in building energy consumption prediction. Machine learning and deep learning methods can effectively handle complex nonlinear relationships and perform well on large-scale data sets. However, these methods are highly dependent on the amount of data, the model training time is long, and it is easy to overfit. In particular, in scenarios where data is scarce or incomplete, deep learning models perform unstably. In addition, the physical interpretability of deep learning models is poor, which is not conducive to decision support.

[0063] Other optimization methods: Heuristic algorithms such as genetic algorithms and particle swarm algorithms are also used for parameter optimization in energy consumption prediction. These algorithms are suitable for complex optimization problems, but the computational overhead is large, and the solution process cannot guarantee the global optimal solution. Usually only approximate solutions can be obtained, which is not suitable for real-time energy consumption prediction.

[0064] In summary, although data-driven prediction technology shows certain potential in the field of building energy consumption prediction, existing methods have significant shortcomings in terms of technical maturity, flexibility, computational efficiency, interpretability, and dynamic adaptability.

[0065] In order to solve the above technical problems, the embodiment of the present application provides a method for predicting building energy consumption. First, by obtaining a historical data set and using the historical data set to train a decision tree model, the decision tree model can identify and capture the key factors affecting building energy consumption. The segmentation nodes of the decision tree model are divided based on these key factors, which can determine whether the building energy consumption is dominated by human settlement information or meteorological conditions, and thereby reasonably divide the historical data set. Secondly, according to the date attributes of the forecast day and the dominant factors of building energy consumption, the target historical data subset is determined from the divided multiple historical data subsets. After determining the target historical data subset, the historical day most similar to the meteorological data of the forecast day is further sought. This method utilizes the close relationship between meteorological data and building energy consumption, and integrates the decision tree model and the similar day selection strategy. Through similarity matching, the energy consumption of the target building on the forecast day can be more accurately predicted. In addition, the method also has the ability to automatically adjust parameters. By introducing a hyperparameter optimization mechanism, the parameters can be dynamically adjusted during the prediction process without manual intervention, further improving the flexibility and prediction accuracy of the model. This feature enables the method to automatically adapt to different buildings and environmental conditions, greatly improving its applicability and practicality.

[0066] See also Figure 1 , is a flow chart of a building energy consumption prediction method provided in an embodiment of the present application. As an example but not a limitation, the method may include the following steps:

[0067] Step S101: Acquire the meteorological data of the target building on the forecast day, the meteorological data of the historical day, and the energy consumption data of the historical day, wherein the forecast day and the historical day have date attributes.

[0068] Among them, different types of buildings, such as residential buildings, office buildings and public buildings, have significantly different energy consumption under different date classifications (such as working days or non-working days) due to their unique uses, structural characteristics, operating modes and different patterns of personnel activities. Specifically, for residential buildings, the difference in energy consumption between working days and non-working days is mainly affected by the activity patterns of residents. On working days, since most residents need to go out to work, study or carry out other daily activities during the day, the density and activity level of people in the residence are relatively low. On non-working days (including weekends and holidays), most residents choose home activities such as rest, entertainment, cooking, etc. These activities will increase the electricity and water consumption in the residence. Therefore, the energy consumption generated by residential buildings on working days will be lower than that generated on non-working days. For office buildings, the difference in energy consumption between working days and non-working days is affected by the operating time of lighting systems, heating / cooling systems, ventilation systems, elevator systems and various office equipment (such as computers, printers, copiers, telephones, etc.). On weekdays, the lighting system, heating / cooling system, ventilation system, elevator system and various office equipment in office buildings need to run for a long time to meet the work needs of employees and visitors, and the operation of these equipment consumes a lot of energy. On non-working days (including weekends and holidays), due to the significant reduction in the number of employees and visitors, the activity level in office buildings is also reduced accordingly. Therefore, the energy consumption generated by office buildings on weekdays is significantly higher than that on non-working days.

[0069] In this embodiment, considering the impact of meteorology (i.e., factors highly correlated with outdoor environmental conditions, such as outdoor dry-bulb temperature) on building energy consumption, and the impact of human activities (reflected by date type and classification label) on building energy consumption, before predicting building energy consumption, it is first necessary to obtain the meteorological data of the predicted day, the energy consumption data of the historical day, and the meteorological data of the historical day of the building. Among them, the predicted day and the historical day have date attributes, and the date attribute includes a date type and a classification label. The date type refers to a specific day of the week, i.e., Monday to Sunday. This is a cyclical classification based on the week, which is used to reflect the cyclical changes in daily activities. For example, some business activities may decrease on weekends and increase on weekdays, and this cyclical change can be captured by the date type. The classification label is a category further divided according to the date type, such as working day or non-working day. Working days usually include Monday to Friday (unless there is a specific public holiday arrangement), while non-working days include Saturday, Sunday, and any public holiday that is identified as a non-working day.

[0070] Specifically, the meteorological data of the forecast day is, for example, the outdoor dry-bulb temperature of the forecast day. The meteorological data of the forecast day usually comes from a meteorological forecast agency or a professional meteorological data service provider, or on the forecast day, the outdoor dry-bulb temperature and other meteorological data are obtained hourly by sensors installed in the building or the surrounding environment. The energy consumption data of the historical day is, for example, the total energy consumption data of the building on the historical day or the sub-item energy consumption data of each electric meter set in the building. The energy consumption data of the historical day usually comes from the energy management system (EMS) of the building, the energy bill or the special energy consumption monitoring record of the building in the past period of time, wherein the energy consumption includes the overall energy consumption and the sub-item energy consumption of each device or system (such as lighting, air conditioning, elevators, sockets and other equipment or systems). The meteorological data of the historical day is, for example, the outdoor dry-bulb temperature of the historical day. The meteorological data of the historical day usually comes from the meteorological data of the building in the past period of time provided by multiple channels such as the meteorological data platform, the National Meteorological Science Data Center and the online meteorological service.

[0071] In a specific example, the meteorological data of the historical day is the meteorological data of a certain office building for one year, the energy consumption data of the historical day is the electricity consumption data of a certain office building for one year, and the meteorological data of the predicted day is the meteorological data of the office building on the current day, wherein the meteorological data of the predicted day, the energy consumption data of the historical day, and the meteorological data of the historical day obtained for the building are all 5-minute time series data. After obtaining the meteorological data of the predicted day, the energy consumption data of the historical day, and the meteorological data of the historical day of the building, the obtained data is preprocessed, including data cleaning, removal of outliers and missing values, etc., to remove noise, irrelevant information, erroneous data, and values ​​that are obviously deviated from the normal data distribution range in the data, and fill in the missing values ​​corresponding to the unrecorded data, thereby improving the quality of the data.

[0072] It should be noted that acquiring data every 5 minutes is only a specific example. This embodiment can determine whether to acquire the forecast day's meteorological data, historical day's energy consumption data, and historical day's meteorological data of the building in real time or over a period of time according to the specific situation.

[0073] Step S102: Based on the meteorological data of the forecast day and the decision tree model, the historical data set is divided into a plurality of historical data subsets.

[0074] Among them, the decision tree model is trained based on the historical data set, and the segmentation nodes of the decision tree model are used to characterize the key factors affecting the energy consumption of the target building; the historical data set consists of energy consumption data of historical days, meteorological data of historical days and date attributes of historical days.

[0075] In this embodiment, a decision tree model is trained based on a historical data set consisting of energy consumption data of historical days, meteorological data of historical days and date attributes of historical days. After the training of the decision tree model is completed, the trained decision tree model can be applied, and the meteorological data of the predicted day and the date attributes of the predicted day are input into the trained decision tree model, so that the trained decision tree model gives a segmentation result for the predicted day, and the segmentation result can be displayed with segmentation nodes, which are used to characterize the key factors affecting the energy consumption of the target building.

[0076] In some embodiments, Figure 2 A flowchart showing the steps of training a decision tree model based on a historical data set is shown. Figure 2 As shown, the step of obtaining a decision tree model based on historical data set training includes step S201 and step S202, wherein step S201 and step S201 are obtained before step S101 and before step S102.

[0077] Step S201: extracting the average temperature of multiple different time periods of each historical day, the average energy consumption data of the corresponding time periods, and the date attribute of each historical day from the historical data set.

[0078] In this embodiment, the 24 hours of a historical day are divided into a plurality of different time periods. For example, the 24-hour outdoor temperature data of a historical day is divided into four time periods T1 (morning), T2 (afternoon), T3 (evening), and T4 (early morning), wherein T1 corresponds to the 8:00-12:59 time period, T2 corresponds to the 13:00-18:59 time period, T3 corresponds to the 19:00-22:59 time period, and T4 corresponds to the 23:00-7:59 time period. The average temperature of different time periods of each historical day in the historical data set and the average energy consumption data of the corresponding time period are extracted to generate the average temperature of the historical day ( , , , ) and the average energy consumption data for the corresponding time period ( , , , ), and extract the date type (Monday / Tuesday / Wednesday / Thursday / Friday / Saturday / Sunday) and category label (working day / non-working day) of each historical day.

[0079] Step S202: The average temperature of multiple different time periods of each historical day and the date attributes of each historical day are used as input features of the decision tree model, and the energy consumption data corresponding to multiple different time periods of each historical day are used as output features of the decision tree model. The decision tree model is trained, and when the decision tree model meets the preset training stop condition, a trained decision tree model is obtained.

[0080] Among them, the decision tree algorithm is a supervised learning algorithm that is widely used in classification and regression problems. The core principle of the decision tree algorithm is to recursively split the data into smaller subsets so that the purity of each subset on the target variable is maximized. This is usually achieved by selecting the best feature (attribute) as the split point.

[0081] The decision tree construction process mainly includes two steps: feature selection and decision tree generation. In the feature selection stage, the goal is to find a feature from all available features that can most effectively divide the data set into multiple subsets, so that the sample category purity in each subset is higher. In order to achieve this goal, information gain is used as an evaluation criterion. Information gain is a measure of the uncertainty of a data set based on information entropy. Selecting the feature with the largest information gain means that after using this feature to split the data set, the uncertainty of the data can be minimized (that is, the purity is increased).

[0082] For data set D, the calculation formula of information entropy H(D) is as follows:

[0083]

[0084] Where H(D) is the information entropy of the data set D, c is the number of categories, It is the proportion of samples belonging to the i-th category in the data set. The lower the information entropy, the purer the data set, that is, most of the samples in the data belong to the same category.

[0085] For a feature A, the information gain is calculated as follows:

[0086]

[0087] Among them, IG(D,A) is the information gain of feature A, H(D) is the information entropy of data set D, and Values(A) is the possible value of feature A. It is the subset when feature A takes value v, |D| represents the size of data set D, Representing a subset of data The larger the information gain, the greater the improvement in the purity of the subset after segmentation using feature A.

[0088] In the decision tree generation phase, the algorithm starts from the root node and recursively selects the feature with the largest information gain for segmentation until the stopping condition is met (such as the samples in the node all belong to the same category, the information gain is less than the threshold, the preset tree depth is reached, etc.). Through this process, the algorithm generates a tree structure, where each non-leaf node represents a feature and each leaf node represents a category.

[0089] In this embodiment, the average temperature of the four time periods of the historical day ( , , , ) and the date type of each historical day (Monday / Tuesday / Wednesday / Thursday / Friday / Saturday / Sunday) and the corresponding classification label (working day / non-working day) are used as the input features of the decision tree model, and the average energy consumption data of the four time periods of the historical day ( , , , ) is used as the output feature of the decision tree model. During the training process, the split nodes of the decision tree model are continuously adjusted to find the best split nodes. When the best split nodes found no longer change during the iteration process, the training process of the decision tree model is completed. At this time, the decision tree model after training is obtained.

[0090] In some embodiments, Figure 3 FIG. 1 is a flow chart showing a sub-step of step 102. Figure 3 As shown, step S102 further includes step S1021 and step S1023.

[0091] Step S1021: extracting the average temperatures of multiple different time periods of the forecast day and the date attributes of the forecast day from the meteorological data of the forecast day.

[0092] In this embodiment, the prediction day is, for example, today, and the 24 hours of the day are divided into multiple different time periods. For example, the 24-hour outdoor temperature data of the day is divided into four time periods T1 (morning), T2 (afternoon), T3 (evening), and T4 (early morning), wherein T1 corresponds to the 8:00-12:59 time period, T2 corresponds to the 13:00-18:59 time period, T3 corresponds to the 19:00-22:59 time period, and T4 corresponds to the 23:00-7:59 time period. The average temperature of different time periods of the day is extracted, and the date type (Monday / Tuesday / Wednesday / Thursday / Friday / Saturday / Sunday) and classification label (working day / non-working day) of the day are also extracted.

[0093] Step S1022: input the average temperatures of multiple different time periods of the forecast day and the date attribute of the forecast day into the decision tree model to obtain the segmentation result of the decision tree model.

[0094] In a specific example, if the energy consumption data of historical days in the historical data set is the sub-item energy consumption of the target building, such as the sub-item energy consumption of the supply and exhaust fans, the average temperature of multiple different time periods of the predicted day and the date attributes of the predicted day are input into the decision tree model trained by the historical data set composed of the historical sub-item energy consumption of the supply and exhaust fans, the meteorological data of historical days and the date attributes of historical days, and the segmentation result for the current predicted day given by the decision tree model is obtained.

[0095] Step S1023: If the segmentation result of the decision tree model is to use meteorological data as the segmentation node of the decision tree model, the historical data set is divided into two historical data subsets, namely the first historical data subset and the second historical data subset; wherein the date attribute includes classification labels, and the classification labels include working days and non-working days; the first historical data subset is a data set corresponding to the historical day selected from the historical data set when it is a working day; the second historical data subset is a data set corresponding to the historical day selected from the historical data set when it is a non-working day.

[0096] In a specific example, assuming that the average temperature of the four time periods on the forecast day is (23℃, 26℃, 22℃, 19℃), and the forecast day is Monday, a weekday, the average temperature of the four time periods on the forecast day (23℃, 26℃, 22℃, 19℃) and the date attribute (Daytype=(1 (weekday))) are input into the trained decision tree model. The segmentation result for the current forecast day given by the decision tree model is as follows: Figure 4 As shown, the split nodes of the decision tree model are divided by temperature. At this time, temperature is selected as the split condition of the decision tree model, which means that temperature has a great impact on the energy consumption of the target building. Since there are significant differences in the building energy consumption patterns on working days and non-working days, it is necessary to determine whether the predicted day belongs to a working day or a non-working day, so as to determine whether the historical data related to the predicted day in the historical data set is all the data of the historical day belonging to the working day, or all the data of the historical day belonging to the non-working day. Therefore, regardless of whether the predicted day belongs to a working day or a non-working day, at this time, the historical data set needs to be divided into two historical data subsets based on working days and non-working days, namely the first historical data subset and the second historical data subset. Among them, the first historical data subset is the data set corresponding to the historical day selected from the historical data set when it is a working day; the second historical data subset is the data set corresponding to the historical day selected from the historical data set when it is a non-working day.

[0097] Step S103: determining a target historical data subset from multiple historical data subsets.

[0098] Continuing with the above example, if the split node of the decision tree model is meteorological data, it means that the influencing factor of building energy consumption is affected by temperature. Since similar weather on historical days and forecast days will be considered when predicting the energy consumption of the target building on the forecast day in the subsequent steps, and since there are significant differences in the building energy consumption patterns on working days and non-working days, it is necessary to first divide the historical data set into two historical data subsets based on working days and non-working days. When the classification label of the forecast day is a working day, only the historical data subset divided by working days needs to be extracted as historical data related to the energy consumption data of the forecast day, and the historical data subset divided by non-working days is removed as irrelevant data. When the forecast day is a non-working day, only the historical data subset divided by non-working days needs to be extracted as historical data related to the energy consumption data of the forecast day, and the historical data subset divided by working days is removed as irrelevant data.

[0099] In some embodiments, step S103 may further include step S1031.

[0100] Step S1031: When the classification label of the predicted day is a working day, the target historical data subset is determined to be the first historical data subset from the first historical data subset and the second historical data subset; when the classification label of the predicted day is a non-working day, the target historical data subset is determined to be the second historical data subset from the first historical data subset and the second historical data subset.

[0101] In this embodiment, if the split node of the decision tree model is meteorological data, the historical data set is divided into two historical data subsets based on working days and non-working days, namely, the first historical data subset and the second historical data subset. In the case where the classification label of the predicted day is working day, Monday / Tuesday / Wednesday / Thursday / Friday, the target historical data subset is determined to be the first historical data subset divided by working days. In the case where the classification label of the predicted day is non-working day, Saturday / Sunday, the target historical data subset is determined to be the second historical data subset divided by non-working days.

[0102] In yet another embodiment, Figure 5 FIG. 1 is a flow chart showing another sub-step of step 102. Figure 5 As shown, step S102 further includes step S1021, step S1022 and step S1024.

[0103] Step S1024: If the segmentation result of the decision tree model is to use the date type as the segmentation node of the decision tree model, when the classification label of the predicted day is a working day, the historical data set is divided into three historical data subsets, namely the third historical data subset, the fourth historical data subset and the second historical data subset; when the classification label of the predicted day is a non-working day, the historical data set is divided into three historical data subsets, namely the first historical data subset, the fifth historical data subset and the sixth historical data subset.

[0104] Among them, the date attribute also includes the date type; the date type includes Monday to Sunday; among them, Monday to Friday are working days; Saturday and Sunday are non-working days; the third historical data subset is the data set corresponding to the historical day selected from the first historical data subset is the same date type as the date type of the predicted day; the fourth historical data subset is the other data sets of the first historical data subset excluding the third historical data subset; the fifth historical data subset is the data set corresponding to the historical day selected from the second historical data subset is the same date type as the date type of the predicted day; the sixth historical data subset is the other data sets of the second historical data subset excluding the fifth historical data subset.

[0105] In a specific example, if the energy consumption data of the historical day in the historical data set is the sub-item energy consumption of the target building, such as the sub-item energy consumption of outdoor lighting, the average temperature of multiple different time periods of the prediction day and the date attribute of the prediction day are input into the decision tree model trained by the historical data set composed of the historical sub-item energy consumption of outdoor lighting, the meteorological data of the historical day and the date attribute of the historical day, and the segmentation result for the current prediction day given by the decision tree model is obtained. Assuming that the average temperature of the four time periods of the prediction day is (20℃, 23℃, 19℃, 17℃), and the prediction day is Tuesday, a working day, the average temperature of the four time periods of the prediction day (20℃, 23℃, 19℃, 17℃) and the date attribute (Daytype=(2 (working day))) are input into the trained decision tree model, and the segmentation result for the current prediction day given by the decision tree model is as follows: Figure 6As shown, the split nodes of the decision tree model are divided by date type. At this time, the date type is selected as the split condition of the decision tree model, which means that the date type has a great impact on the energy consumption of the target building. At this time, in addition to the significant difference in the building energy consumption patterns of working days and non-working days, the building energy consumption patterns of historical days with the same date type as the predicted day and the building energy consumption patterns of historical days with other date types will also be significantly different. At this time, it is necessary to determine which day of the week the predicted day is. For example, in this example, when it is determined that the predicted day is Tuesday, a working day, the historical data set is divided into three historical data subsets on Tuesday (the same date type as the predicted day), Monday and Wednesday to Friday (the other working days except the same date type as the predicted day), Saturday and Sunday (non-working days), which are the third historical data subset, the fourth historical data subset, and the second historical data subset. Among them, the third historical data subset is the corresponding data set when the historical day selected from the first historical data subset is the same date type as the predicted day; the fourth historical data subset is the other data sets of the first historical data subset except the third historical data subset.

[0106] In another specific example, when it is determined that the predicted day is Saturday, a non-working day, the historical data set is divided into three historical data subsets based on Monday to Friday (working days), Saturday (the same date type as the predicted day), and Sunday (non-working days other than the same date type as the predicted day). They are the first historical data subset, the fifth historical data subset, and the sixth historical data subset. Among them, the fifth historical data subset is a data set corresponding to the historical day selected from the second historical data subset being the same date type as the predicted day; the sixth historical data subset is the other data sets of the second historical data subset excluding the fifth historical data subset.

[0107] In yet another embodiment, step S103 further includes step S1032.

[0108] Step S1032: When the date attribute of the predicted day is a working day, the target historical data subset is determined to be the third historical data subset from the third historical data subset, the fourth historical data subset, and the second historical data subset; when the date attribute of the predicted day is a non-working day, the target historical data subset is determined to be the fifth historical data subset from the first historical data subset, the fifth historical data subset, and the sixth historical data subset.

[0109] In this embodiment, if the split node of the decision tree model is a date type, when the date attribute of the predicted day is a working day, the historical data set is divided into three historical data subsets according to the same date type as the predicted day, the other working days and non-working days among the working days except the same date type as the predicted day, which are respectively the third historical data subset, the fourth historical data subset and the second historical data subset. When the predicted day is Tuesday, the target historical data subset is determined to be the third historical data subset, that is, all the historical data on Tuesday in the historical data set. Similarly, when the predicted day is Monday / Wednesday / Thursday / Friday, the target historical data subset is determined to be the third historical data subset, that is, all the historical data on Monday / Wednesday / Thursday / Friday in the historical data set. When the date attribute of the predicted day is a non-working day, the historical data set is divided into three historical data subsets according to the working day, the same date type as the predicted day, and the other non-working days among the non-working days except the same date type as the predicted day, which are respectively the first historical data subset, the fifth historical data subset and the sixth historical data subset. When the forecast day is Saturday, the target historical data subset is determined to be the fifth historical data subset, that is, all Saturday historical data in the historical data set. Similarly, when the forecast day is Sunday, the target historical data subset is determined to be the fifth historical data subset, that is, all Sunday historical data in the historical data set.

[0110] Step S104: determine a target historical day from the target historical data subset, and predict the energy consumption of the target building on the predicted day based on the energy consumption data of the determined target historical day, wherein the target historical day is the historical day in the target historical data subset that has the most similar meteorological data to the predicted day.

[0111] In some embodiments, Figure 7 FIG. 1 is a flow chart showing the sub-steps of step 104. Figure 7 As shown, step S104 further includes steps S1041 to S1044.

[0112] Step S1041: Obtain a preset maximum historical number of days X set, a maximum historical time window Y set and a similarity percentage Z set.

[0113] Among them, the maximum historical days set is used to select historical daily data of different lengths from the target historical data subset; the maximum historical time window set is used to correspond the moment of the forecast day to the time window length of the historical day before and after the corresponding moment when comparing the meteorological data of the forecast day and the historical day; the similarity percentage set is used to determine the length of the similarity ranking between the meteorological data of the historical day and the meteorological data of the forecast day.

[0114] In this embodiment, after determining the target historical data subset, it is necessary to select the maximum number of historical days X from the target historical data subset. At the same time, it is necessary to calculate the point-by-point similarity between the meteorological data of the predicted day and the historical day. At this time, it is necessary to select the maximum historical time window Y and the similarity percentage Z to make data processing more convenient.

[0115] The maximum historical days X set represents a set of historical days of different lengths that can be selected from the target historical data subset. For example, the X set can be [30, 60, 90], which means that when searching for similar historical days for prediction, the historical data of the past 30 days, 60 days, or 90 days can be considered respectively. In a specific example, the maximum historical days X set is, for example, [30, 60].

[0116] The maximum historical time window Y set means that when comparing the meteorological data of the historical day and the forecast day hour by hour, the meteorological data within the Y time period before and after the time point of each historical day will be considered. The Y set defines the length of this time period, such as [1 hour, 2 hours], which means that the meteorological data within 1 hour or 2 hours before and after the time point of each historical day will be considered during the comparison. That is, the meteorological data corresponding to the time point in the historical data set changes from T to [T-Ymin, T+Ymin]. In a specific example, the maximum historical time window Y set is, for example, [30, 60, 90, 120]. The unit of Y is minutes (min).

[0117] The embodiment of the present application introduces the maximum historical time window Y to accurately locate the point with the most similar meteorological conditions in the time period before and after the predicted point. The method of finding similar points point by point in the embodiment of the present application is more accurate than the traditional overall matching method of similar days, and can better capture the subtle differences in energy consumption or energy consumption changes, thereby improving the accuracy of the prediction.

[0118] The similarity percentage Z set is used to measure the similarity between the meteorological data of the historical day and the meteorological data of the forecast day. In order to avoid processing too much data, the similarity between the meteorological data of the historical day and the meteorological data of the forecast day is usually sorted in descending order of similarity, and the top Z% of data is selected as the processing data. In a specific example, the similarity percentage Z set is, for example, [0.05, 0.10, 0.20, 0.30].

[0119] Step S1042: Based on the energy consumption data and meteorological data of the historical day A which is closest to the predicted day, each parameter combination in the maximum historical day set, the maximum historical time window set and the similarity percentage set is optimized, and for each day in the A days, an optimal parameter combination (X, Y, Z) is determined, where X represents the length of the determined target historical day, Y represents the determined time window length, and Z represents the determined similarity ranking value.

[0120] In this embodiment, assuming that A is 7 days, if the prediction day is today, the 7 historical days closest to the prediction day are yesterday, the day before yesterday, the three days before today, the four days before today, the five days before today, the six days before today, and the seven days before today. Assuming that the optimal day to be found is yesterday, the process of using the optimal day to be found to predict the energy consumption of the prediction day is:

[0121] Select historical days. When the maximum number of historical days X is set X=[30, 60], there are two ways to select historical days. One way is to select the 30 days before the day to be optimized from the target historical data subset as the historical days with the meteorological data most similar to the forecast day. The other way is to select the 60 days before the day to be optimized from the target historical data subset as the historical days with the meteorological data most similar to the forecast day.

[0122] Get the hourly data of outdoor temperature of yesterday, the day to be optimized, and calculate the Euclidean distance with the outdoor temperature of the most similar historical day [T-Ymin, T+Ymin]. The reciprocal of the Euclidean distance is used to get the similarity. The calculation formula of the similarity is:

[0123]

[0124] in, For History Day The outdoor dry-bulb temperature value during the time period, It is the outdoor dry-bulb temperature at that time on the day to be optimized.

[0125] When the maximum historical time window Y set Y=[30, 60, 90, 120], the Euclidean distance between the meteorological temperature at time T on the day to be optimized and the average meteorological data of the historical days in the time periods [T-30min, T+30min], [T-60min, T+60min], [T-90min, T+90min] and [T-120min, T+120min] is calculated respectively, and the reciprocal of the Euclidean distance is taken to obtain the similarity, and then the similarities are sorted in descending order.

[0126] After the calculated similarities are sorted in descending order, the first Z% of the points are selected as set B. Based on the energy consumption values ​​in set B, the predicted energy consumption value of the predicted day is obtained by taking the average.

[0127] Using CV-RMSE as the evaluation indicator, the grid search method is used to calculate the maximum number of historical days. , maximum historical time window , similarity percentage These three hyperparameters are optimized to find the optimal parameter combination that performs best when predicting energy consumption data on the day to be optimized.

[0128] The embodiment of the present application uses a grid search method to perform system optimization on multiple hyperparameters (such as the maximum number of historical days X, the maximum historical time window Y, and the similarity percentage Z), and calculates the combination weight according to the frequency of occurrence of each hyperparameter combination, which can automatically adjust the hyperparameters in the similar day forecast, reducing the reliance on the operator to manually adjust the hyperparameters, thereby making the final energy consumption forecast result more stable and accurate. Especially in the case of poor data quality, the embodiment of the present application shows excellent robustness.

[0129] Step S1043: Calculate the weight corresponding to each optimal parameter combination according to the frequency of occurrence of each optimal parameter combination in day A.

[0130] In this embodiment, if Figure 8 As shown, the optimal parameter combination (0.3, 60, 30) appears three times, the optimal parameter combination (0.1, 30, 30), the optimal parameter combination (0.3, 30, 30), the optimal parameter combination (0.1, 60, 30), and the optimal parameter combination (0.2, 60, 30) each appear once. Therefore, the weight corresponding to the optimal parameter combination (0.3, 60, 30) is three-sevenths, and the optimal parameter combination (0.1, 30, 30), the optimal parameter combination (0.3, 30, 30), the optimal parameter combination (0.1, 60, 30), and the optimal parameter combination (0.2, 60, 30) are all one-seventh.

[0131] Step S1044: Calculate the energy consumption of each optimal parameter combination according to the meteorological data of each optimal parameter combination and the forecast day; and perform weighted average of the calculated energy consumption of each optimal parameter combination according to the weight of each optimal parameter combination to obtain the predicted energy consumption value of the target building on the forecast day.

[0132] In this embodiment, the predicted energy consumption under the hyperparameter combinations of (0.3, 60, 30), (0.1, 30, 30), (0.3, 30, 30), (0.1, 60, 30), and (0.2, 60, 30) are predicted respectively, multiplied by their weights, and added to obtain the final predicted daily energy consumption.

[0133]

[0134] in, To finally predict energy consumption, is the number of hyperparameter combinations, predicting energy consumption It is The predicted daily energy consumption calculated under the hyperparameter combination, the combined weight It is The weights corresponding to the hyperparameter combinations.

[0135] like Fig. 9As shown, the applicant conducted an experiment using the building energy consumption prediction method provided in the embodiment of the present application and obtained the prediction error. Through implementation, it was found that the building energy consumption prediction method provided in the embodiment of the present application has less demand for historical data, and only 2 weeks to 2 months of historical data are needed to make an accurate prediction. Compared with the traditional similar day prediction method which usually requires longer historical data, the building energy consumption prediction method provided in the embodiment of the present application can predict building energy consumption more quickly, and is suitable for situations with less data accumulation or newly built buildings.

[0136] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0137] Corresponding to the building energy consumption prediction method described in the above embodiment, Fig.10 This is a structural block diagram of a building energy consumption prediction device provided in an embodiment of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0138] Reference Fig.10 , the building energy consumption prediction device comprises:

[0139] An acquisition module 101 is used to acquire the meteorological data of the forecast day, the meteorological data of the historical day, and the energy consumption data of the historical day of the target building, wherein the forecast day and the historical day have date attributes;

[0140] A partitioning module 102 is used to partition the historical data set into a plurality of historical data subsets based on the meteorological data of the forecast day and a decision tree model; wherein the decision tree model is trained based on the historical data set, and the partitioning nodes of the decision tree model are used to characterize key factors affecting the energy consumption of the target building; and the historical data set is composed of the energy consumption data of the historical day, the meteorological data of the historical day, and the date attribute of the historical day;

[0141] A determination module 103, configured to determine a target historical data subset from the plurality of historical data subsets;

[0142] The prediction module 104 is used to determine a target historical day from the target historical data subset, and predict the energy consumption of the target building on the prediction day based on the energy consumption data of the determined target historical day.

[0143] In some embodiments, the building energy consumption prediction further includes:

[0144] The training module 105 is used to:

[0145] Extracting the average temperature of multiple different time periods of each historical day, the average energy consumption data of the corresponding time period, and the date attribute of each historical day from the historical data set;

[0146] The average temperature of multiple different time periods of each historical day and the date attributes of each historical day are used as input features of the decision tree model, and the energy consumption data corresponding to multiple different time periods of each historical day are used as output features of the decision tree model. The decision tree model is trained, and when the decision tree model meets the preset training stop condition, the trained decision tree model is obtained.

[0147] In some embodiments, the partitioning module 102 is further configured to:

[0148] Extracting the average temperature of multiple different time periods of the forecast day and the date attribute of the forecast day from the meteorological data of the forecast day;

[0149] Inputting the average temperatures of a plurality of different time periods of the predicted day and the date attribute of the predicted day into the decision tree model to obtain a segmentation result of the decision tree model;

[0150] If the segmentation result of the decision tree model is to use meteorological data as the segmentation node of the decision tree model, the historical data set is divided into two historical data subsets, namely a first historical data subset and a second historical data subset; wherein the date attribute includes a classification label, and the classification label includes a working day and a non-working day; the first historical data subset is a data set corresponding to a historical day selected from the historical data set when it is a working day; the second historical data subset is a data set corresponding to a historical day selected from the historical data set when it is a non-working day.

[0151] In some embodiments, the determination module 103 is further configured to:

[0152] When the classification label of the predicted day is a working day, the target historical data subset is determined to be the first historical data subset from the first historical data subset and the second historical data subset; when the classification label of the predicted day is a non-working day, the target historical data subset is determined to be the second historical data subset from the first historical data subset and the second historical data subset.

[0153] In some further embodiments, the partitioning module 102 is further configured to:

[0154] If the segmentation result of the decision tree model is to use the date type as the segmentation node of the decision tree model, when the classification label of the predicted day is a working day, the historical data set is divided into three historical data subsets, namely the third historical data subset, the fourth historical data subset, and the second historical data subset; when the classification label of the predicted day is a non-working day, the historical data set is divided into three historical data subsets, namely the first historical data subset, the fifth historical data subset, and the sixth historical data subset;

[0155] Among them, the date attribute also includes date type; the date type includes Monday to Sunday; among them, Monday to Friday are working days; Saturday and Sunday are non-working days; the third historical data subset is the data set corresponding to the historical day selected from the first historical data subset is the same date type as the date type of the predicted day; the fourth historical data subset is the other data sets of the first historical data subset excluding the third historical data subset; the fifth historical data subset is the data set corresponding to the historical day selected from the second historical data subset is the same date type as the date type of the predicted day; the sixth historical data subset is the other data sets of the second historical data subset excluding the fifth historical data subset.

[0156] In some further embodiments, the determination module 103 is further configured to:

[0157] When the date type of the predicted day is a working day, the target historical data subset is determined to be the third historical data subset from the third historical data subset, the fourth historical data subset and the second historical data subset; when the date type of the predicted day is a non-working day, the target historical data subset is determined to be the fifth historical data subset from the first historical data subset, the fifth historical data subset and the sixth historical data subset.

[0158] In some embodiments, the prediction module 104 is further configured to:

[0159] Obtain a preset maximum historical day set, a maximum historical time window set, and a similarity percentage set; wherein the maximum historical day set is used to select historical day data of different lengths from the target historical data subset; the maximum historical time window set is used to correspond the time of the forecast day to the time window length of the historical day before and after the corresponding time when comparing the meteorological data of the forecast day and the historical day; the similarity percentage set is used to determine the length of the similarity ranking between the meteorological data of the historical day and the meteorological data of the forecast day;

[0160] Based on the energy consumption data and meteorological data of the historical day A that is closest to the predicted day, each parameter combination in the maximum historical day set, the maximum historical time window set and the similarity percentage set is optimized, and for each day in the A days, an optimal parameter combination (X, Y, Z) is determined, where X represents the length of the determined target historical day, Y represents the determined time window length, and Z represents the determined similarity ranking value;

[0161] According to the frequency of occurrence of each optimal parameter combination in day A, the weight corresponding to each optimal parameter combination is calculated;

[0162] According to each optimal parameter combination and the meteorological data of the forecast day, the energy consumption under each optimal parameter combination is calculated respectively; according to the weight of each optimal parameter combination, the calculated energy consumption under each optimal parameter combination is weighted averaged to obtain the energy consumption forecast value of the target building on the forecast day.

[0163] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0164] in addition, Fig.10 The building energy consumption prediction device shown can be a software unit, a hardware unit, or a combination of software and hardware units built into an existing terminal device, or can be integrated into the terminal device as an independent pendant, or can exist as an independent terminal device.

[0165] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0166] Fig.11 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Fig.11 As shown, the terminal device 11 of this embodiment includes: at least one processor 110 ( Fig.11 Only one processor is shown in the figure), a memory 111, and a computer program 112 stored in the memory 111 and executable on the at least one processor 110, wherein the processor 110 implements the steps in any of the above-mentioned building energy consumption prediction method embodiments when executing the computer program 112.

[0167] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Fig.11 It is only an example of the terminal device 11 and does not constitute a limitation on the terminal device 11. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0168] The processor 110 may be a central processing unit (CPU), or 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. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0169] In some embodiments, the memory 111 may be an internal storage unit of the terminal device 11, such as a hard disk or memory of the terminal device 11. In other embodiments, the memory 111 may also be an external storage device of the terminal device 11, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 11. Further, the memory 111 may also include both an internal storage unit of the terminal device 11 and an external storage device. The memory 111 is used to store an operating system, an application program, a boot loader, data, and other programs, such as the program code of the computer program. The memory 111 may also be used to temporarily store data that has been output or is to be output.

[0170] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0171] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0172] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0173] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0174] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0175] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0176] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0177] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for predicting building energy consumption, characterized in that: include: Acquire meteorological data of a forecast day, meteorological data of a historical day, and energy consumption data of a historical day of a target building, wherein the forecast day and the historical day have date attributes; Based on the meteorological data of the forecast day and the decision tree model, the historical data set is divided into a plurality of historical data subsets; wherein the decision tree model is trained based on the historical data set, and the segmentation nodes of the decision tree model are used to characterize the key factors affecting the energy consumption of the target building; the historical data set is composed of the energy consumption data of the historical day, the meteorological data of the historical day and the date attribute of the historical day; Determining a target historical data subset from the plurality of historical data subsets; Determine a target historical day from the target historical data subset, and predict the energy consumption of the target building on the predicted day based on the energy consumption data of the determined target historical day; The step of determining a target historical day from the target historical data subset and predicting the energy consumption of the target building on the predicted day based on the energy consumption data of the determined target historical day includes: Obtain a preset maximum historical day set, a maximum historical time window set and a similarity percentage set; wherein the maximum historical day set is used to select historical day data of different lengths from the target historical data subset; the maximum historical time window set is used to correspond the time of the forecast day to the time window length of the historical day before and after the corresponding time when comparing the meteorological data of the forecast day and the historical day; the similarity percentage set is used to determine the length of the similarity ranking between the meteorological data of the historical day and the meteorological data of the forecast day, Based on the energy consumption data and meteorological data of the historical day A that is closest to the predicted day, a grid search method is used to optimize each parameter combination in the maximum historical day set, the maximum historical time window set and the similarity percentage set, and for each day in the A day, an optimal parameter combination (X, Y, Z) is determined, where X represents the length of the determined target historical day, Y represents the determined time window length, and Z represents the determined similarity ranking value; According to the frequency of occurrence of each optimal parameter combination in day A, calculate the weight corresponding to each optimal parameter combination; According to each optimal parameter combination and the meteorological data of the forecast day, the energy consumption under each optimal parameter combination is calculated respectively; according to the weight of each optimal parameter combination, the calculated energy consumption under each optimal parameter combination is weighted averaged to obtain the energy consumption forecast value of the target building on the forecast day.

2. The building energy consumption prediction method according to claim 1, characterized in that: Before dividing the historical data set into a plurality of historical data subsets based on the meteorological data of the forecast day and the decision tree model, the method further includes: Extracting the average temperature of multiple different time periods of each historical day, the average energy consumption data of the corresponding time period, and the date attribute of each historical day from the historical data set; The average temperature of multiple different time periods of each historical day and the date attributes of each historical day are used as input features of the decision tree model, and the energy consumption data corresponding to multiple different time periods of each historical day are used as output features of the decision tree model. The decision tree model is trained, and when the decision tree model meets the preset training stop condition, the trained decision tree model is obtained.

3. The building energy consumption prediction method according to claim 1, characterized in that: The historical data set is divided into a plurality of historical data subsets based on the meteorological data of the forecast day and the decision tree model, including: Extracting the average temperature of multiple different time periods of the forecast day and the date attribute of the forecast day from the meteorological data of the forecast day; Inputting the average temperatures of a plurality of different time periods of the predicted day and the date attribute of the predicted day into the decision tree model to obtain a segmentation result of the decision tree model; If the segmentation result of the decision tree model is to use meteorological data as the segmentation node of the decision tree model, the historical data set is divided into two historical data subsets, namely a first historical data subset and a second historical data subset; wherein the date attribute includes a classification label, and the classification label includes a working day and a non-working day; the first historical data subset is a data set corresponding to a historical day selected from the historical data set when it is a working day; the second historical data subset is a data set corresponding to a historical day selected from the historical data set when it is a non-working day.

4. The building energy consumption prediction method according to claim 3, characterized in that: The step of determining a target historical data subset from the plurality of historical data subsets comprises: When the classification label of the predicted day is a working day, the target historical data subset is determined to be the first historical data subset from the first historical data subset and the second historical data subset; when the classification label of the predicted day is a non-working day, the target historical data subset is determined to be the second historical data subset from the first historical data subset and the second historical data subset.

5. The building energy consumption prediction method according to claim 3, characterized in that: The method of dividing the historical data set into a plurality of historical data subsets based on the meteorological data of the forecast day and the decision tree model further includes: If the segmentation result of the decision tree model is to use the date type as the segmentation node of the decision tree model, when the classification label of the predicted day is a working day, the historical data set is divided into three historical data subsets, namely the third historical data subset, the fourth historical data subset, and the second historical data subset; when the classification label of the predicted day is a non-working day, the historical data set is divided into three historical data subsets, namely the first historical data subset, the fifth historical data subset, and the sixth historical data subset; Among them, the date attribute also includes date type; the date type includes Monday to Sunday; among them, Monday to Friday are working days; Saturday and Sunday are non-working days; the third historical data subset is the data set corresponding to the historical day selected from the first historical data subset is the same date type as the date type of the predicted day; the fourth historical data subset is the other data sets of the first historical data subset excluding the third historical data subset; the fifth historical data subset is the data set corresponding to the historical day selected from the second historical data subset is the same date type as the date type of the predicted day; the sixth historical data subset is the other data sets of the second historical data subset excluding the fifth historical data subset.

6. The building energy consumption prediction method according to claim 5, characterized in that: The determining of a target historical data subset from the plurality of historical data subsets further comprises: When the date type of the predicted day is a working day, the target historical data subset is determined to be the third historical data subset from the third historical data subset, the fourth historical data subset and the second historical data subset; when the date type of the predicted day is a non-working day, the target historical data subset is determined to be the fifth historical data subset from the first historical data subset, the fifth historical data subset and the sixth historical data subset.

7. A building energy consumption prediction device, characterized in that: include: An acquisition module, used to acquire the meteorological data of the forecast day, the meteorological data of the historical day, and the energy consumption data of the historical day of the target building, wherein the forecast day and the historical day have date attributes; A partitioning module, for partitioning the historical data set into a plurality of historical data subsets based on the meteorological data of the forecast day and a decision tree model; wherein the decision tree model is trained based on the historical data set, and the partitioning nodes of the decision tree model are used to characterize key factors affecting the energy consumption of the target building; and the historical data set is composed of the energy consumption data of the historical day, the meteorological data of the historical day, and the date attribute of the historical day; A determination module, used to determine a target historical data subset from a plurality of the historical data subsets; A prediction module, configured to determine a target historical day from the target historical data subset, and predict the energy consumption of the target building on the prediction day based on the energy consumption data of the determined target historical day; The prediction module is further used for: Obtain a preset maximum historical day set, a maximum historical time window set, and a similarity percentage set; wherein the maximum historical day set is used to select historical day data of different lengths from the target historical data subset; the maximum historical time window set is used to correspond the time of the forecast day to the time window length of the historical day before and after the corresponding time when comparing the meteorological data of the forecast day and the historical day; the similarity percentage set is used to determine the length of the similarity ranking between the meteorological data of the historical day and the meteorological data of the forecast day; Based on the energy consumption data and meteorological data of the historical day A that is closest to the predicted day, a grid search method is used to optimize each parameter combination in the maximum historical day set, the maximum historical time window set and the similarity percentage set, and for each day in the A day, an optimal parameter combination (X, Y, Z) is determined, where X represents the length of the determined target historical day, Y represents the determined time window length, and Z represents the determined similarity ranking value; According to the frequency of occurrence of each optimal parameter combination in day A, calculate the weight corresponding to each optimal parameter combination; According to each optimal parameter combination and the meteorological data of the forecast day, the energy consumption under each optimal parameter combination is calculated respectively; according to the weight of each optimal parameter combination, the calculated energy consumption under each optimal parameter combination is weighted averaged to obtain the energy consumption forecast value of the target building on the forecast day.

8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method for achieving EMS load prediction based on decision tree and linear regression

    CN104732298A

  • Load prediction method

    CN115994314A