A method and apparatus for predicting building energy demand response

By acquiring historical operational data from multiple building sites, filtering similar building sites, constructing a high-dimensional feature vector library, and using classification and dual-path regression models, the problem of low prediction accuracy in scenarios involving newly constructed buildings or scarce data was solved, achieving high-precision and robust prediction of building energy demand response.

CN121480885BActive Publication Date: 2026-05-26SHENZHEN UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN UNIV
Filing Date
2026-01-07
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing building demand response forecasting methods lack generalization ability in new building construction or data-scarce scenarios, and lack in-depth quantitative characterization of building operation context and cross-building common patterns, resulting in low forecast accuracy.

Method used

By acquiring historical operational data from multiple building sites, we can filter out building sites similar to the target building site, construct a high-dimensional feature vector library, and use classification models and dual-path regression models for prediction. Combined with a similarity transfer learning strategy, we can achieve accurate prediction of cross-building energy demand response.

Benefits of technology

It improves the accuracy of predicting building demand response behavior and intensity, provides efficient and reliable technical solutions, and supports building energy conservation and flexible grid regulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121480885B_ABST
    Figure CN121480885B_ABST
Patent Text Reader

Abstract

This application relates to the field of building energy technology, and provides a method and apparatus for predicting building energy demand response. The method includes: acquiring historical operating data of multiple building sites; selecting multiple third building sites similar to the first building site from multiple second building sites based on the historical operating data; wherein the historical operating data of the third building sites is used to pre-train a classification model and a dual-path regression model. High-dimensional feature vectors corresponding to the first building site at the time to be predicted are extracted from a high-dimensional feature vector library of the first building site. Based on the real-time operating data and high-dimensional feature vectors of the first building site, the demand response prediction result of the first building site at the time to be predicted is obtained through the classification model and the dual-path regression model. By using a similarity-based transfer learning strategy and a dual-path regression model, the accuracy of predicting building demand response behavior and response intensity is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of building energy technology, and in particular relates to a method and apparatus for predicting building energy demand response. Background Technology

[0002] With the rapid development of the energy internet, building demand response (DRT) is playing an increasingly important role in balancing grid load and improving energy efficiency as a crucial demand management tool. Building demand response refers to adjusting the operating status of building electrical equipment in response to grid dispatch instructions, thereby achieving peak shaving and load balancing. Accurately predicting building demand response capabilities is of great significance for grid dispatch and energy management.

[0003] Currently, existing building demand response prediction methods are mainly based on single-task prediction models using machine learning on surface feature engineering data of individual buildings, which have significant technical limitations. On the one hand, model training heavily relies on complete labeled data of specific buildings, and the model's generalization ability is significantly insufficient when facing newly constructed buildings or data-scarce scenarios. On the other hand, the feature engineering they rely on is usually limited to raw observations or simple statistics, lacking in-depth quantitative representation of the building's operational context and common patterns across buildings, making it difficult to support effective cross-building knowledge transfer.

[0004] Therefore, there is an urgent need for a building energy demand response prediction method that can solve the above problems and achieve accurate prediction of building energy demand response. Summary of the Invention

[0005] This application provides a method and apparatus for predicting building energy demand response, which can solve the technical problems of low accuracy in predicting building demand response behavior and intensity due to insufficient model generalization ability and extreme class imbalance in existing building demand response prediction technologies.

[0006] In a first aspect, embodiments of this application provide a method for predicting building energy demand response, the method comprising:

[0007] Historical operational data of multiple building sites are acquired; wherein, the multiple building sites include a first building site and multiple second building sites located in the surrounding area of ​​the first building site;

[0008] Based on the historical operating data, multiple third building sites similar to the first building site are selected from multiple second building sites; wherein, the historical operating data of the third building sites is used to pre-train the classification model and the dual-path regression model;

[0009] The high-dimensional feature vector of the first building site at the time to be predicted is extracted from the high-dimensional feature vector library of the first building site; wherein, the high-dimensional feature vector library is a feature vector library pre-constructed based on the historical operation data of the building site;

[0010] Based on the real-time operation data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, the demand response prediction result of the first building site at the time to be predicted is obtained by using a classification model and a dual-path regression model; wherein, the classification model and the dual-path regression model are models for predicting the demand response prediction result obtained by pre-training based on the historical operation data of the multiple third building sites and the high-dimensional feature vectors of the multiple third building sites.

[0011] Secondly, embodiments of this application provide a predictive device for building energy demand response, comprising:

[0012] The acquisition module is used to acquire historical operational data of multiple building sites; wherein, the multiple building sites include a first building site and multiple second building sites located in the surrounding area of ​​the first building site;

[0013] The filtering module is used to filter out multiple third building sites that are similar to the first building site from multiple second building sites based on the historical operation data; wherein the historical operation data of the third building sites is used to pre-train the classification model and the dual-path regression model.

[0014] The extraction module extracts the high-dimensional feature vector of the first building site at the time to be predicted from the high-dimensional feature vector library of the first building site; wherein, the high-dimensional feature vector library is a feature vector library pre-constructed based on the historical operation data of the multiple building sites;

[0015] The prediction module is used to predict the demand response prediction result of the first building site at the time to be predicted by using a classification model and a dual-path regression model, based on the real-time operation data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted; wherein, the classification model and the dual-path regression model are models for predicting the demand response prediction result obtained by pre-training based on the historical operation data of the multiple third building sites and the high-dimensional feature vectors of the multiple third building sites.

[0016] Thirdly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the building energy demand response prediction method described in any of the above claims.

[0017] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the building energy demand response prediction method described in any of the preceding claims.

[0018] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the building energy demand response prediction method described in any one of the first aspects.

[0019] The beneficial effects of the embodiments in this application compared with the prior art are:

[0020] This application provides a method for predicting building energy demand response. The method includes: First, acquiring historical operational data from multiple building sites; wherein the multiple building sites include a first building site and multiple second building sites located in the surrounding area of ​​the first building site. Then, based on the historical operational data, selecting multiple third building sites similar to the first building site from the multiple second building sites; wherein the historical operational data of the third building sites is used to pre-train a classification model and a two-path regression model. Extracting a high-dimensional feature vector of the first building site at the time to be predicted from a high-dimensional feature vector library; wherein the high-dimensional feature vector library is a feature vector library pre-constructed based on the historical operational data of the building sites. Finally, based on the real-time operational data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, predicting the demand response of the first building site at the time to be predicted using the classification model and the two-path regression model. The classification model and the two-path regression model are models pre-trained based on the historical operational data and high-dimensional feature vectors of the multiple third building sites for predicting the demand response prediction results. This method demonstrates excellent generalization performance in cross-building energy demand response prediction tasks through a similarity-based transfer learning strategy. It effectively solves the modeling challenge under the scarcity of target building data and achieves high-precision and robust quantitative prediction of response intensity through a dual-path regression model. This improves the accuracy of building demand response behavior and response intensity prediction, and provides an efficient and reliable technical solution for building energy conservation and grid flexible regulation. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart illustrating a method for predicting building energy demand response according to an embodiment of this application;

[0023] Figure 2 This is a schematic diagram of a classification process based on a classification model provided in one embodiment of this application;

[0024] Figure 3 This is a schematic diagram of the prediction process of a dual-path regression model provided in an embodiment of this application;

[0025] Figure 4 This is a schematic diagram of the structure of a building energy demand response prediction device provided in an embodiment of this application;

[0026] Figure 5 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0027] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

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

[0029] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0030] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0031] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0032] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0033] Building demand response is a key technology for improving grid flexibility and promoting the consumption of renewable energy. Its core lies in accurately identifying the response behavior of buildings and quantifying their adjustment potential.

[0034] With the widespread adoption of smart meters and building automation systems, a vast amount of building operation data is continuously collected, including multi-dimensional information such as energy consumption data, user behavior patterns, and indoor and outdoor environmental parameters. This massive amount of building operation data provides the foundation for data-driven demand response forecasting. Commercial buildings, as significant electricity loads, can proactively adjust their electricity consumption behavior during peak grid periods by participating in demand response projects, providing crucial flexibility resources to the grid. Accurately identifying building energy response patterns and quantifying their response intensity is of great value for improving grid regulation capabilities and promoting the integration of renewable energy.

[0035] Existing building demand response prediction methods are mainly based on single-task prediction models using machine learning on surface feature engineering data of individual buildings, which have significant technical limitations. On the one hand, model training heavily relies on complete labeled data of specific buildings, and the model's generalization ability is significantly insufficient when facing newly constructed buildings or data-scarce scenarios. On the other hand, the feature engineering they rely on is usually limited to raw observations or simple statistics, lacking in-depth quantitative representation of the building's operational context and common patterns across buildings, resulting in poor model transferability and difficulty in supporting effective cross-building knowledge transfer.

[0036] To address the aforementioned issues, advanced machine learning paradigms such as ensemble learning have been introduced into this field to improve predictive performance. Ensemble learning methods enhance the stability and robustness of the prediction system by constructing combinations of multiple base models, and mitigate the performance fluctuations of individual models to some extent through model voting or averaging mechanisms. However, existing solutions still have significant shortcomings when addressing practical engineering challenges. First, at the feature engineering level, they lack quantitative representations of common patterns across buildings, failing to effectively establish a transferable feature system. Second, at the training strategy level, existing solutions fail to effectively utilize the similarities between buildings, either using only single-building data or simply merging all available building data, failing to accurately select and provide the most relevant training samples for the target building. Furthermore, existing methods generally lack mechanisms to integrate domain knowledge into the prediction process, and their outputs often ignore the basic physical laws of building operation and actual operational constraints, limiting the engineering application value of the technology. These shortcomings collectively restrict the practical application effectiveness of existing technologies in building energy response analysis.

[0037] In summary, to address the shortcomings of existing technologies, such as extreme class imbalance, limited response patterns, heterogeneous building features, and insufficient model generalization ability, this application proposes a method for predicting building energy demand response. This method aims to achieve more accurate, reliable, and realistic predictions of building response behavior through innovative feature engineering, model architecture, and multi-stage post-processing mechanisms.

[0038] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for predicting building energy demand response according to an embodiment of this application. As an example and not a limitation, this method can be applied to or run in a terminal device. The method includes:

[0039] S11. Obtain historical operational data for multiple building sites.

[0040] The multiple building sites include a first building site and multiple second building sites located in the area surrounding the first building site.

[0041] Building sites can be understood as the main objects of energy demand response forecasting. They can be places with specific building functions that consume energy, such as office buildings, shopping malls, and residential communities. Historical operational data for building sites records various operating states and parameters of the site over a past period. This data may include building characteristics (such as timestamps, building power, dry-bulb temperature, solar radiation intensity, etc.) and labeled data of demand response events (such as demand response indicators, demand response capacity values, etc.). This historical operational data reflects the operational status and demand response of building sites at different times.

[0042] The first building site is the target building site for which demand response forecasting is currently required. The second building sites are building sites located in the surrounding area of ​​the first building site. These second building sites are geographically close to the first building site and may have some correlation with it.

[0043] It should be noted that in this embodiment, during the acquisition of historical operational data for building sites, the time resolution of the data can be set to 15 minutes, with a time span of approximately one year. Each acquired sample data may include building characteristic data such as timestamps, building power, dry-bulb temperature, and solar radiation intensity, as well as labeled data of demand response events such as demand response indicators and demand response capability values. Furthermore, data preprocessing is required for the acquired historical operational data from different building sites. For example, station-level max-min normalization processing can be performed on the temperature, solar radiation, and power data for each building site to eliminate the influence of climate and scale differences between different sites and ensure the model's cross-building applicability.

[0044] It should be understood that rich and comprehensive historical operational data can provide data support for accurate demand response forecasting. At the same time, considering data from surrounding building sites helps to uncover potential correlation factors, making the forecast results more consistent with the actual situation, thereby improving the comprehensiveness and accuracy of the forecast.

[0045] S12. Based on historical operation data, select multiple third building sites that are similar to the first building site from multiple second building sites.

[0046] The historical operational data of the third building site was used to pre-train the classification model and the dual-path regression model.

[0047] The third building site is selected from these second building sites and is similar to the first building site in terms of operational characteristics, and is of reference value for demand response prediction of the first building site. In other words, the operating mode of the third building site is most similar to that of the first building site.

[0048] In some examples, data analysis methods (such as similarity analysis) are used to process the historical operational data of each building site, analyzing the similarity of each building site to each other in terms of operational patterns. This allows for the selection of building sites from the second set of sites that are highly similar to the first site, which are then designated as the third building site. The historical operational data of this third building site can then serve as training data for subsequent classification and dual-path regression models.

[0049] In one possible implementation, based on historical operational data, multiple third building sites similar to the first building site are selected from a pool of second building sites, including:

[0050] Based on historical operating data, the Wasserstein distance between the normalized power distributions of any two building sites is calculated, and the distance matrix is ​​obtained.

[0051] Based on the distance matrix, multiple third building sites that are similar to the first building site are selected from multiple second building sites.

[0052] Specifically, firstly, power data for each building site is extracted from historical operational data. This data may include power measurements at different times (e.g., hourly, minutely). The power data for each building site is then normalized, such as using a max-min normalization method, scaling the power values ​​to the [0,1] interval. Normalization involves scaling the data proportionally to fit it into a small, specific interval (e.g., [0,1]), aiming to eliminate the influence of differences in power dimensions and numerical values ​​between different building sites and to make the power distributions of different sites comparable.

[0053] Next, for any two building sites, the Wasserstein distance between their normalized power distributions is calculated. The normalized power distribution is the power distribution obtained after normalizing the power data of the building sites. The normalized power distribution reflects the relative power changes of the building sites at different times. The Wasserstein distance, also known as the Earth Mover's distance, is a metric for measuring the difference between two probability distributions. When dealing with normalized power distributions, the minimum "work" required to transform one distribution into another is used as the distance metric. The Wasserstein distance better captures the shape and location differences between distributions and is more advantageous than other distance metrics (such as Euclidean distance) when dealing with distributions with complex shapes or little overlap. Calculating the Wasserstein distance requires constructing an optimal transmission plan between the two normalized power distributions. An optimization algorithm (such as linear programming) is used to find the scheme that minimizes the transmission cost, thus obtaining the distance value.

[0054] Then, the Wasserstein distances between all pairwise building sites are organized into a rectangular shape to obtain a distance matrix. This distance matrix is ​​a square matrix, where the rows and columns correspond to multiple building sites (including the first building site and multiple second building sites). Each element in the distance matrix represents the Wasserstein distance of the normalized power distribution between the corresponding two building sites. For example, if there are n building sites, the distance matrix will be an n×n square matrix, and the elements in the matrix... Let represent the Wasserstein distance between the normalized power distributions of the i-th and j-th building sites. The distance matrix can intuitively show the degree of similarity between all building sites; the smaller the distance, the more similar the normalized power distributions of the two building sites, that is, the more similar their power behavior patterns.

[0055] Finally, based on the calculated distance matrix, the distances between the first building site and each of the second building sites in the distance matrix are compared with a set distance threshold. The second building sites whose distances are less than or equal to the distance threshold are selected as the third building sites most similar to the first building site, serving as the source of training data for subsequent transfer learning. This distance threshold can be determined based on actual needs and experience, or a reasonable value can be determined through data analysis methods (such as cluster analysis, statistical tests, etc.).

[0056] It should be understood that by selecting the third building site with high similarity, data from irrelevant or weakly similar building sites are removed, reducing data noise and lowering the complexity of subsequent model calculations, while improving the relevance and accuracy of demand response prediction for the first building site.

[0057] S13. Extract the high-dimensional feature vector of the first building site at the time to be predicted from the high-dimensional feature vector library of the first building site.

[0058] Among them, the high-dimensional feature vector library is a feature vector library pre-built based on the historical operation data of building sites.

[0059] The time to be predicted is the specific point in time or time period for which a certain variable is expected to be predicted. In this embodiment, the time to be predicted can be understood as the point in time or time period for predicting the energy demand response of the first building site. The time to be predicted can be a specific point in time. For example, when predicting the hourly energy demand response of the building site on the next day, the time to be predicted is a specific hour such as 0:00, 1:00, ..., 23:00 on the next day.

[0060] In some examples, based on the time type of the sample points (such as weekday, hour, or minute), sample points with the same time type background are retrieved from the historical operational data of the building site. Sample features potentially related to the building site are extracted from these sample points. These sample features are then combined into a high-dimensional feature vector according to certain rules. The high-dimensional feature vector, formed by combining multiple extracted sample features, contains multi-dimensional feature information and can more comprehensively describe the operational status of the building site at a specific time (such as the time to be predicted). In other words, the high-dimensional feature vector is information extracted from a high-dimensional feature vector library that reflects the operational characteristics and patterns of the building site. The high-dimensional feature vector library is a pre-built feature vector library based on the historical operational data of the building sites.

[0061] It should be understood that by extracting sample features from the historical operational data of the first construction site, key factors affecting the demand response of the first construction site can be captured. By combining these key factors through high-dimensional feature vectors, richer and more accurate information input is provided for subsequent models, which helps the models to better learn data patterns and improve prediction accuracy.

[0062] S14. Based on the real-time operational data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, the demand response prediction result of the first building site at the time to be predicted is obtained through a classification model and a dual-path regression model. The classification model and the dual-path regression model are models pre-trained based on historical operational data and high-dimensional feature vectors of multiple third building sites to predict the demand response prediction result.

[0063] In some examples, the classification model and the two-path regression model are pre-trained models for predicting demand response results, based on historical operational data and high-dimensional feature vectors from multiple third-party building sites. Real-time operational data from the first-party building site and its high-dimensional feature vector at the time of prediction are input into the pre-trained classification and two-path regression models. The classification model first categorizes the demand response of the first-party building site at the time of prediction, determining its category. The real-time operational data includes the operating status and parameters of the first-party building site at the time of prediction, potentially including building features (such as timestamps, building power, dry-bulb temperature, solar radiation intensity, etc.). Then, based on the classification, the two-path regression model further accurately predicts the specific capacity value of the first-party building site's demand response at the time of prediction, ultimately obtaining a comprehensive demand response prediction result. The demand response prediction result is a predicted value of the first-party building site's ability or degree to respond to changes in energy demand at the time of prediction, such as predicting the increase or decrease in energy demand or the response capacity value at a specific time.

[0064] The classification model is a machine learning model that divides input data into different categories. In this embodiment, the classification model can perform a preliminary classification of the demand response of the first building site, such as determining whether its demand response is positive, non-responsive, or negative. The two-path regression model is a special regression model that processes and analyzes data through two different paths to predict continuous target variables. In this embodiment, the two-path regression model can be used to predict the demand response capacity of the first building site at the time to be predicted.

[0065] It should be understood that the combination of classification and dual-path regression models, with classification followed by regression, fully leverages the advantages of both models. The classification model can quickly make a preliminary judgment on demand response and narrow down the prediction range; the dual-path regression model can then make accurate predictions based on this, improving the accuracy and reliability of the prediction results and providing strong support for the rational planning and decision-making of building energy demand response.

[0066] It is understood that this application provides a method for predicting building energy demand response. The method includes: first, acquiring historical operational data from multiple building sites; wherein the multiple building sites include a first building site and multiple second building sites located in the surrounding area of ​​the first building site. Then, based on the historical operational data, selecting multiple third building sites similar to the first building site from the multiple second building sites. The historical operational data of the third building sites is used to pre-train a classification model and a two-path regression model. High-dimensional feature vectors of the first building site at the time to be predicted are extracted from a high-dimensional feature vector library of the first building site; wherein the high-dimensional feature vector library is a feature vector library pre-constructed based on the historical operational data of the building sites. Finally, based on the real-time operational data of the first building site and the high-dimensional feature vector of the first building site at the prediction time, the demand response prediction result of the first building site at the time to be predicted is obtained through the classification model and the two-path regression model. The classification model and the two-path regression model are models pre-trained based on the historical operational data and high-dimensional feature vectors of the multiple third building sites for predicting the demand response prediction result. This method demonstrates excellent generalization performance in cross-building energy demand response prediction tasks through a similarity-based transfer learning strategy. It effectively solves the modeling challenge under the scarcity of target building data and achieves high-precision and robust quantitative prediction of response intensity through a dual-path regression model. This improves the accuracy of building demand response behavior and response intensity prediction, and provides an efficient and reliable technical solution for building energy conservation and grid flexible regulation.

[0067] In one possible implementation, the construction process of the high-dimensional feature vector library includes:

[0068] Based on the weekday, hour, and minute types of the current sample point, select multiple candidate sample points from the historical operation data of each building site that have the same time type as the current sample point and whose timestamps are located within one time step before or after the current sample point.

[0069] Calculate the Euclidean distance between each candidate sample point and the current sample point in the normalized temperature-radiation two-dimensional space.

[0070] Based on the Euclidean distance, a preset number of target sample points are selected from multiple candidate sample points to obtain the similar context set of the current sample point.

[0071] Based on a set of similar contexts, multiple high-dimensional feature vectors are constructed for each current sample point to obtain a high-dimensional feature vector library.

[0072] In some examples, the construction process of the high-dimensional feature vector library is as follows: First, determine the weekday type (weekday or weekend), hour type (peak, off-peak, or trough), and minute type (specific number of minutes) of the current sample point, as well as the adjacent time steps of the current sample point. Adjacent time steps are time points or time periods that are adjacent to the current sample point in time, i.e., the previous time step and the next time step. For example, if a time step is 15 minutes, the previous and next time steps are the 15 minutes before and after the current sample point. Then, based on the weekday type, hour type, and minute type of the current sample point, candidate sample points with the same time type background and located within the previous and next time steps of the current sample point are selected from the historical operational data of each building site. The system offers several sub-categories: Weekday type divides the seven days of the week into different types, such as weekdays (Monday to Friday) and rest days (Saturday and Sunday); Hour type divides the 24 hours of the day into different time periods, such as peak hours (e.g., 8:00 AM to 10:00 AM, 6:00 PM to 8:00 PM), off-peak hours, and low-peak hours; Minute type further subdivides the hour into minutes, allowing for more precise capture of operational power variations at building sites. The operational patterns of building sites may differ under different weekday types, time types, or minute types. For example, if the current sample point is Monday at 10:00 AM, and one time step is one hour, then multiple candidate sample points between 9:00 AM and 11:00 AM Monday will be selected from the historical operational data of each building site.

[0073] Next, the temperature and radiation data of the candidate sample points are normalized, scaling them to the [0,1] interval. Then, using the historical temperature and radiation values ​​corresponding to the current sample point as reference points, the Euclidean distance between each candidate sample point and the reference point in the normalized temperature-radiation two-dimensional space is calculated. The normalized temperature-radiation two-dimensional space is a two-dimensional space constructed after normalizing the temperature and radiation data. Normalization eliminates the influence of different dimensions and numerical ranges, allowing temperature and radiation data to be compared and analyzed on the same scale. Euclidean distance is the straight-line distance between two points in two-dimensional space. Calculating the Euclidean distance between the candidate sample point and the reference point (i.e., the current sample point) in the normalized temperature-radiation two-dimensional space measures their similarity in terms of temperature and radiation. The formula for calculating the Euclidean distance is:

[0074] ;

[0075] Where d represents the Euclidean distance between the candidate sample point and the current sample point in the normalized temperature-radiation two-dimensional space. The normalized temperature values ​​for the candidate sample points. The normalized radiance values ​​for the candidate sample points. This is the normalized temperature value for the current sample point. This is the normalized radiance value for the current sample point.

[0076] After obtaining the Euclidean distance between each candidate sample point and the current sample point in the normalized temperature-radiation two-dimensional space, the candidate sample points are sorted in ascending order of Euclidean distance. The K sample points with the smallest Euclidean distance (K is a preset number) are selected as target sample points. Target sample points are those selected from the candidate sample points that have a high similarity to the current sample point in terms of temperature and radiation. The preset number is the number of target sample points pre-set according to actual needs and prediction accuracy requirements. This number can be adjusted according to factors such as data volume, model complexity, or the importance of the prediction task; for example, K can be set to 10 or 20.

[0077] Then, the set of data from the K target sample points constitutes the similarity context set for the current sample point. This similarity context set provides contextual information about the current sample point in the time dimension, more comprehensively reflecting the changes in the operational status of the building site, aiming to establish a reference benchmark for the current sample point based on its operational status under similar historical weather conditions. It should be understood that the operation of a building site is a continuous process, and data from adjacent time steps can capture the gradual changes and trends in the operational status, helping the model to better understand the dynamic behavior of the building site and improve the accuracy and stability of predictions.

[0078] Finally, based on the historical operational data of the building sites corresponding to each target sample point in the similar context set, a high-dimensional feature vector is constructed for the current sample point. This allows for the aggregation of multiple high-dimensional feature vectors for each current sample point, resulting in a high-dimensional feature vector library for each building site. These high-dimensional feature vectors include features such as environmental quantile differences, static reference point power differences, dynamic neighboring reference point power differences, and context power differences. Combining these features forms the high-dimensional feature vector for each building site at the current sample point.

[0079] In one possible implementation, based on a set of similar contexts, multiple high-dimensional feature vectors are constructed for each current sample point, resulting in a high-dimensional feature vector library, including:

[0080] Calculate the 25th, 50th, and 75th percentiles of the temperature, radiation, and power values ​​of all target sample points in the similar context set.

[0081] Based on the temperature, radiation, and power observations of each building site at the current sample point, and the 25th, 50th, and 75th percentiles of the temperature, radiation, and power values ​​of all target sample points in the similar context set, multiple environmental quantile difference characteristics are determined.

[0082] Based on the power observation value of each building site at the current sample point, the historical average power value of each building site at the first preset reference time, and the historical average power value of each building site at the second preset reference time, the power difference characteristics of multiple static reference points are determined.

[0083] Based on the power observation value of each building site at the current sample point, the historical average power value of each building site at the previous time step at the current sample point, and the historical average power value of each building site at the next time step at the current sample point, the power difference characteristics of multiple dynamic adjacent reference points are determined.

[0084] Based on the calculated historical average power values ​​of all target sample points in the similar context set, the historical average power values ​​of all target sample points in the similar context set at the first preset reference time, the historical average power values ​​of all target sample points in the similar context set at the second preset reference time, the historical average power values ​​of all target sample points in the similar context set at the previous time step of the current sample point, and the historical average power values ​​of all target sample points in the similar context set at the next time step of the current sample point, multiple context power difference features are determined.

[0085] By integrating multiple environmental quantile difference features, multiple static reference point power difference features, multiple dynamic adjacent reference point power difference features, and multiple context power difference features, multiple high-dimensional feature vectors for each building site at the current sample point are obtained.

[0086] A high-dimensional feature vector library for each building site is constructed based on multiple high-dimensional feature vectors of each building site at multiple current sample points.

[0087] In some examples, a feature vector is constructed for each current sample point to obtain multiple high-dimensional feature vectors for each building site at the current sample point, thus obtaining a high-dimensional feature vector library for each building site. The high-dimensional feature vectors are composed as follows:

[0088] (1) Environmental quantile differences.

[0089] Temperature is a numerical value reflecting ambient temperature, measured by temperature sensors, and has a significant impact on the energy consumption of a building site. Radiation is the intensity of solar radiation measured by radiation sensors, which can affect the building site's solar energy utilization and indoor thermal environment. Power is the power consumed or generated by the building site during operation, directly reflecting the building site's energy usage.

[0090] First, calculate the 25th, 50th, and 75th percentiles of the temperature, radiation, and power values ​​for all target sample points in the similar context set. This means calculating the values ​​at different positions after sorting the temperature, radiation, and power values ​​of all target sample points in the similar context set from smallest to largest. The 25th percentile indicates that 25% of the data are less than this value; the 50th percentile is the median, dividing the data into upper and lower halves; and the 75th percentile indicates that 75% of the data are less than this value. These quantiles reflect the distribution characteristics of the data.

[0091] Then, the differences between the current sample point's temperature, radiation, and power observations and these quantiles are calculated, constructing a total of 9 environmental quantile difference features, namely: , , , , , , , , ;in, This is the temperature observation value for the current sample point. The radiation observation value for the current sample point. This represents the power observation value for the current sample point. The 25th percentile of the temperature values ​​at the target sample point. The 50th percentile of the temperature values ​​at the target sample point. The 75th percentile of the temperature value at the target sample point; The 25th percentile of the radiation values ​​at the target sample point. The 50th percentile of the radiance values ​​at the target sample point. The 75th percentile of the radiation values ​​at the target sample point; The 25th percentile of the power values ​​of the target sample points. The 50th percentile of the power values ​​of the target sample points. The 75th percentile of the power value of the target sample point.

[0092] It should be understood that these environmental quantile difference features are used to quantify the degree of statistical deviation in similar environments by comparing the current value with historical quantiles, thereby guiding the model’s attention from absolute values ​​to relative anomalies, which can effectively improve the feature’s adaptability to buildings of different sizes.

[0093] (2) Characteristics of power difference at static reference point.

[0094] The first and second preset reference times are pre-set time points for reference on the current day, representing the start and end times of the effective hour interval for the main electricity consumption period, respectively. For example, the first preset reference time is 10:00 and the second preset reference time is 17:00.

[0095] Calculate the difference between the observed power value of the first building site at the current sample point and the historical average power value at the first preset reference time, and calculate the difference between the observed power value of the first building site at the current sample point and the historical average power value at the second preset reference time, constructing power difference characteristics between two static reference points, as follows: , ;in, This represents the power observation value for the current sample point. The historical average power value at the first preset reference time. The historical average power value at the second preset reference time.

[0096] It should be understood that these static reference point power difference characteristics are used to capture the macroscopic deviation of current power relative to the load level at a fixed reference time of the day. These reference times typically represent the building's typical baseline power consumption under no-response event disturbances. By calculating the difference from these reference points, it is possible to effectively identify persistent systematic increases or decreases in load levels caused by demand response events, providing an important basis for the model to determine the overall response tone throughout the day.

[0097] (3) Dynamic power difference characteristics between adjacent reference points.

[0098] The previous time step is the previous time point or time period adjacent to the current sample point, and the next time step is the next time point or time period adjacent to the current sample point. This can be used to extract the power difference features of dynamically adjacent reference points.

[0099] The power difference between the current sample point's observed power value and the historical average power value at the previous time step is calculated, and the power difference between the current sample point's observed power value and the historical average power value at the next time step is also calculated. This constructs two dynamic adjacent reference point power difference features, which are as follows: , ;in, This represents the historical average power value corresponding to the previous time step. This represents the historical average power value corresponding to the next time step.

[0100] It should be understood that these dynamic neighboring reference point power difference features are used to perceive transient power fluctuations and short-term trends. Complementing the static reference point power difference features, they are used to capture sharp power transitions that occur when a response event is triggered or terminated. These transient signals are key clues for determining the precise start and end times of a response event, greatly enhancing the model's positioning accuracy in the time dimension and avoiding overestimating or underestimating the duration of the response event.

[0101] (4) Context power difference characteristics.

[0102] Four context power difference features are constructed by calculating the differences between the historical average power values ​​of all target sample points in the similar context set and the static reference average power values ​​of all target sample points, as well as the differences between the historical average power values ​​of all target sample points in the similar context set and the dynamic neighbor average power values ​​of all target sample points. The static reference average power refers to the historical average power values ​​at the first and second preset reference times, and the dynamic neighbor average power values ​​refer to the historical average power values ​​at the previous and next time steps. The four context power difference features are as follows: , , , ;in, This represents the historical average power value of all target sample points in the similar context set. The historical average power value of all target sample points in the similar context set at the first preset reference time. The historical average power value of all target sample points in the similar context set at the second preset reference time. This represents the historical average power value of all target sample points in the similar context set at the time step preceding the current sample point. This represents the historical average power value of all target sample points in the similar context set at the time step following the current sample point.

[0103] It should be understood that these contextual power difference features can dynamically characterize the relative position and behavioral patterns of the current sample point within its similar historical contexts, providing background information on the overall behavior under similar historical situations to improve the robustness of the model's decisions. These contextual power difference features do not describe the current sample point itself, but rather the overall behavioral pattern of its historical similar set. When making decisions, the model integrates the instantaneous signal of the current sample point with historical background information. Even if the power of the current sample point decreases, if the overall power in similar historical situations is already low, the degree of anomalousness of this decrease is relatively low. By introducing this comparison of group behavior, overfitting to single, random fluctuations can be effectively suppressed, making the model more inclined to output predictions that are consistent with typical historical patterns and more continuous in time.

[0104] Finally, the environmental quantile difference features, static reference point power difference features, dynamic neighboring reference point power difference features, and context power difference features obtained in the above steps are combined to form a feature vector containing multiple dimensions, i.e., a high-dimensional feature vector. Then, the high-dimensional feature vectors of each current sample point are summarized to obtain the high-dimensional feature vector library of building sites.

[0105] It should be understood that the above steps extract features from multiple dimensions, including environmental quantiles, static reference points, dynamic neighboring reference points, and context, comprehensively considering various factors affecting building site power, including environmental conditions, historical power trends, and dynamic changes. This provides rich information for the prediction model and helps improve prediction accuracy. Furthermore, by introducing a set of similar contexts for the target sample points, the dynamic continuity and contextual information of building site operation are considered, enabling a better capture of power change trends and patterns, and enhancing the model's generalization ability.

[0106] In one possible implementation, the demand response forecast results include demand response forecast indicators and demand response capacity forecast values.

[0107] Based on the real-time operational data of the first building site and its high-dimensional feature vector at the time to be predicted, the demand response prediction results for the first building site at the time to be predicted are obtained through a classification model and a dual-path regression model, including:

[0108] Based on the real-time operational data of the first building site and its high-dimensional feature vector at the time to be predicted, a classification model is used to predict the demand response forecast indicators for the first building site at the time to be predicted. These demand response forecast indicators include negative response indicators, no response indicators, and positive response indicators.

[0109] Based on the real-time operation data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, the predicted value of the demand response capacity of the first building site at the time to be predicted is obtained by using a dual-path regression model.

[0110] Demand response forecasting results are projected outputs of how a building site will respond to changes in energy demand at the predicted time. Demand response forecasting results provide a comprehensive assessment of a building site's demand response capacity, and include two pieces of information: demand response forecast indicators and predicted demand response capacity values.

[0111] The demand response forecast indicator is a qualitative marker indicating the direction of demand response at the first building site at the predicted time. The demand response forecast indicator can include a negative response indicator, a no-response indicator, and a positive response indicator. A negative response indicator indicates that the energy demand at the building site may decrease; a no-response indicator indicates that the energy demand at the building site remains essentially unchanged; and a positive response indicator indicates that the energy demand at the building site may increase. The demand response capacity forecast value is a quantitative prediction of the change in energy demand at the first building site at the predicted time, i.e., the specific increase or decrease in capacity.

[0112] In some examples, the real-time operational data and high-dimensional feature vector of the first building site are input into a pre-trained classification model. The model can analyze the correlation between the real-time operational data and the demand response direction of the first building site based on learned data patterns and rules. Then, the classification model outputs a demand response prediction indicator for the first building site at the predicted time, determining whether the demand response event is a negative response, no response, or a positive response.

[0113] In some examples, the process of building and training a classification model is as follows:

[0114] S201: Construct an initial classification model based on the distributed gradient boosting algorithm. This initial classification model is used to output a demand response prediction label.

[0115] In this embodiment, the distributed gradient boosting algorithm LightGBM can be used to construct the initial classification model. The model outputs a ternary classification result (i.e., the demand response prediction flag), which corresponds to three demand response states of the building site, namely: (1) negative response state, corresponding to the demand response prediction flag of -1, indicating that the electricity load demand needs to be reduced; (2) no response state, corresponding to the demand response prediction flag of 0, indicating that the energy demand of the building site remains basically unchanged; (3) positive response state, corresponding to the demand response prediction flag of 1, indicating that the electricity load demand needs to be increased.

[0116] Among them, the distributed gradient boosting algorithm is an ensemble learning algorithm that trains multiple decision trees (base classifiers) in parallel on multiple nodes through a distributed computing framework, and gradually optimizes the model performance using a gradient boosting strategy. It can handle large-scale data and improve training efficiency. The initial classification model is a preliminary model built based on the distributed gradient boosting algorithm, which has the ability to output demand response prediction labels, but its performance may not yet be optimal and requires further adjustment and optimization.

[0117] S202: Randomly downsample the non-response category samples from the historical operational data of multiple third-party building sites to obtain the first training dataset. The first training dataset includes multiple first training data samples; each first training data sample includes historical operational data, high-dimensional feature vectors, and demand response indicators.

[0118] A transfer learning strategy based on site similarity is used to construct the first training dataset. In this embodiment, based on the site similarity analysis results obtained in the above steps, the historical operating data and its high-dimensional feature vector of the third building site with the most similar power distribution are selected as the training data source. The initial classification model is trained using the historical operating data and high-dimensional feature vector of the third building site as the training dataset to obtain the final classification model. The historical operating data may include building features (such as timestamps, building power, dry-bulb temperature, solar radiation intensity, etc.), and the high-dimensional feature vector may include features such as environmental quantile difference features, static reference point power difference features, dynamic adjacent reference point power difference features, and context power difference features.

[0119] To address the extreme class imbalance caused by the very low proportion of demand response events in the time series, a strategic downsampling of the training dataset is implemented. Specifically, the majority of samples (marked as 0, representing the non-response category) are randomly downsampled to maintain a preset ratio between their size and the minimum number of samples from the minority categories, thus obtaining the first training dataset. The first training data sample can be understood as a single data record with complete feature information and belonging to a specific category, selected from the original historical data after random downsampling. Each first training data sample contains a high-dimensional feature vector, demand response indicators, and other data; multiple first training data samples constitute the first training dataset. For example, the original historical operational data of the third building site contains 1000 non-response samples and 200 response samples. Before downsampling, the class ratio is 5:1. The model may be more inclined to predict all samples as "non-response". By randomly downsampling the non-response samples, that is, randomly selecting 400 non-response samples from the 1000 non-response samples as samples in the first training dataset, and merging them with the 200 response samples, a first training dataset of 600 samples is formed. At this time, the class ratio is 2:1, which makes the sample ratio more balanced, so that the trained classification model can more accurately distinguish between response behavior and non-response behavior.

[0120] S203: Using historical running data and high-dimensional feature vectors from the first training data sample as input data, and demand response flags corresponding to the first training data sample as labels for input data, train multiple base classifiers in the initial classification model to obtain the classification model.

[0121] Using the first training dataset processed through the above steps, multiple base classifiers are trained in parallel to form the final classification model. Each base classifier is a single decision tree model in an ensemble learning algorithm. In this embodiment, the classification model can consist of multiple base classifiers, each classifying and predicting samples from different perspectives based on different algorithms. The distributed gradient boosting algorithm, composed of multiple base classifiers (decision trees), improves the overall model performance by integrating the prediction results of these base classifiers.

[0122] Specifically, each first training data sample (containing historical running data and high-dimensional feature vectors) in the first training dataset is input into the initial classification model, along with its corresponding demand response label. When using the initial classification model for prediction, for each first training data sample, all relevant base classifiers make independent predictions. The prediction results of each base classifier are then aggregated, and a majority voting method is used to determine the final demand response label, i.e., the prediction result, for that first training data sample. This effectively smooths out any random errors or biases that might arise from a single base classifier, significantly improving the stability and reliability of the final classification decision. Afterward, the initial classification model calculates a loss function based on the label and prediction results. Then, optimization algorithms such as gradient descent are used to adjust the parameters of multiple base classifiers (decision trees) in the initial classification model, making the model's prediction results closer to the true labels. After multiple rounds of iterative adjustments, the final classification model is obtained. During model training, automated hyperparameter optimization strategies can be employed, and cross-validation can be used to evaluate model performance to determine the final parameter configuration of each base classifier. An early stopping mechanism is also used to prevent overfitting.

[0123] It should be understood that in this embodiment, the distributed gradient boosting algorithm can process large-scale data in parallel, improving training efficiency and shortening training time. Simultaneously, the random downsampling method can balance the number of response and non-response category samples in the training dataset, avoiding bias caused by data imbalance and improving the model's ability to identify the minority response categories. Furthermore, iteratively adjusting the parameters of the base classifier allows the model to better fit the data, capture patterns and regularities within the data, and thus more reliably predict demand response at building sites in practical applications.

[0124] like Figure 2 As shown, Figure 2 This is a schematic diagram of a classification process for a classification model provided in one embodiment of this application. In one possible implementation, based on the real-time operating data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, a demand response prediction indicator of the first building site at the time to be predicted is predicted by a classification model, including:

[0125] The real-time operation data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted are input into the classification model. Through multiple base classifiers in the classification model, the demand response indicators of the first building site at the time to be predicted are predicted respectively, and the demand response indicator results of each base classifier are obtained.

[0126] The demand response flag results of multiple base classifiers are statistically analyzed, and the demand response flag category with the highest frequency of occurrence is selected as the demand response prediction flag for the first building site at the time to be predicted by majority voting.

[0127] In this embodiment, as Figure 2 As shown, firstly, the real-time operating data of the first building site represents its current operating status. Multiple base classifiers in the classification model, based on their own model parameters, independently predict the demand response label of the first building site at the time to be predicted, according to the real-time operating data and the high-dimensional feature vector at the time to be predicted. This yields the predicted demand response label for each base classifier, i.e., the predicted category label: negative response prediction label, no response prediction label, or positive response prediction label.

[0128] Next, the demand response indicators output by all base classifiers are statistically analyzed, counting the frequency of each category (negative response, no response, positive response). Then, a majority voting method is used to select the category with the most frequent occurrences as the demand response prediction indicator for the first building site at the predicted time. For example, assuming the classification model has 5 base classifiers, with 3 predicting a positive response, 1 predicting a negative response, and 1 predicting no response, then the final classification model outputs a positive response as the demand response prediction indicator for the predicted time.

[0129] It should be understood that this embodiment employs base classifier ensemble and majority voting in ensemble learning to predict demand response indicators. By constructing a classification model containing multiple base classifiers, each base classifier makes predictions independently, and then combining the multiple prediction results to obtain the final demand response prediction indicator, the aim is to improve the accuracy, robustness, and reliability of the prediction.

[0130] Furthermore, in some examples, the real-time operational data of the first building site and its high-dimensional feature vector at the time to be predicted are input into a pre-trained dual-path regression model. The two paths of the dual-path regression model process and analyze the features from different perspectives; for example, one path performs direct prediction, and the other performs indirect prediction. Then, the outputs of these two paths are fused. Finally, the dual-path regression model outputs the predicted demand response capacity of the first building site at the time to be predicted, i.e., the specific value of the change in energy demand.

[0131] like Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the prediction process of a two-path regression model according to an embodiment of this application. In some examples, the construction process of the two-path regression model is as follows:

[0132] S301: Model selection and training dataset construction for the dual-path regression model.

[0133] In this embodiment, the LightGBM regression algorithm is selected to construct a dual-path regression model. The historical operational data and its high-dimensional feature vector of the third building site are still used as the training data source. To ensure the model focuses on learning the power regulation patterns when demand response events occur, the training dataset is set to historical data samples from the third building site with demand response indicators of negative or positive (i.e., indicators of -1 or 1), excluding all samples with no response events (indicating 0). This training dataset is then the second training dataset, which includes multiple second training data samples. Each second training data sample includes historical operational data, high-dimensional feature vectors, original capacity, and original power.

[0134] S302: Construction of a dual-path regression model.

[0135] To eliminate inherent differences in power consumption among different buildings, the target variable for regression prediction is normalized. The dual-path regression model includes a direct regression model and an indirect regression model. The direct regression model consists of multiple first-basis regressors, while the indirect regression model consists of multiple second-basis regressors. The target variable for the direct regression model is the normalized demand response capacity, while the target variable for the indirect regression model is the normalized raw power.

[0136] The system employs a direct regression model consisting of multiple LightGBM regressors (i.e., first-base regressors). Each first-base regressor uses historical operational data and high-dimensional feature vectors from the third building site as input to directly predict the normalized demand response capacity. Simultaneously, an indirect regression model consisting of multiple LightGBM regressors (i.e., second-base regressors) is constructed in parallel. Each second-base regressor also uses historical operational data and high-dimensional feature vectors from the third building site as input to predict the normalized theoretical raw power. During the inference phase, the demand response capacity is indirectly derived through power balance relationships.

[0137] It should be noted that during the training of the direct regression model, each second training data sample (containing historical running data and high-dimensional feature vectors) from the second training dataset is input into the initial direct regression model, and the corresponding original capacity is used as the label. When using the initial direct regression model for prediction, for each second training data sample, all relevant first basis regressors make independent predictions, and then the prediction results of each first basis regressor are obtained. Afterwards, the loss function is calculated based on the label (original capacity) and the prediction results (predicted values ​​of the original capacity), and then the parameters of multiple first basis regressors (decision trees) in the initial direct regression model are adjusted using optimization algorithms such as gradient descent to make the model's prediction results closer to the true labels. After multiple rounds of iterative adjustments, the final direct regression model is obtained. During model training, the same hyperparameter optimization strategy as for classification models can be used to determine the final parameter configuration of each first basis regressor, and an early stopping mechanism can be used to prevent overfitting.

[0138] Similarly, the initial indirect regression model can be trained using the same method to obtain a trained indirect regression model. Specifically, during the training of the indirect regression model, each second training data sample (containing historical running data and high-dimensional feature vectors) from the second training dataset is input into the initial indirect regression model, along with the corresponding original power as the label. When using the initial indirect regression model for prediction, for each second training data sample, all relevant second-basis regressors make independent predictions, yielding the prediction result for each second-basis regressor. Then, the loss function is calculated based on the label (original power) and the prediction result (predicted original power value). Finally, optimization algorithms such as gradient descent are used to adjust the parameters of multiple second-basis regressors (decision trees) in the initial indirect regression model, making the model's prediction results closer to the true labels. After multiple rounds of iterative adjustments, the final indirect regression model is obtained.

[0139] S303: A dual-path ensemble forecasting method integrating direct and indirect regression models outputs a predicted demand response capacity value. Specifically:

[0140] (1) Input the historical operation data and high-dimensional feature vector of the third building site into the direct regression model and the indirect regression model respectively.

[0141] (2) By using the direct regression model, the normalized raw capacity predictions output by multiple first-base regressors in the direct regression model are arithmetically averaged to obtain the normalized capacity predictions. .

[0142] Then, based on the normalized capacity prediction values Historical average power value of the first building site Using a preset inverse normalization formula, the predicted value of the direct predicted response capacity is calculated. The pre-defined inverse normalization formula is: .

[0143] (3) By using the indirect regression model, the normalized raw power prediction values ​​output by multiple second-base regressors in the indirect regression model are arithmetically averaged and integrated to obtain the normalized power prediction value. .

[0144] Then, based on the normalized power prediction values Actual power value at the time to be predicted Historical average power value of the first building site The indirect predicted response capacity is calculated. The calculation formula is: .

[0145] (4) The direct and indirect predicted response capacity values ​​are combined by equal weighting to obtain the demand response capacity forecast. ,Right now: .

[0146] It should be understood that the design of the dual-path regression model can make full use of the characteristics of different types of features. Through the collaborative work of the two paths, the model's ability to learn complex data patterns is improved, thereby enabling more accurate prediction of demand response capacity and providing precise basis for the rational allocation and optimized operation of building energy.

[0147] In one possible implementation, after obtaining the demand response forecast at the time to be predicted, the method further includes:

[0148] The demand response forecast results are post-processed and optimized in multiple stages based on multiple preset processing mechanisms to obtain optimized demand response forecast results.

[0149] Among them, the multiple preset processing mechanisms include at least one of the following: capacity threshold filtering mechanism, spatiotemporal rule constraint mechanism, symbol consistency constraint mechanism, minimum duration constraint mechanism, and time sequence pattern matching optimization mechanism.

[0150] After obtaining the demand response prediction results at the predicted time, in order to improve the physical rationality, temporal consistency, and engineering practicality of the prediction results, this embodiment also performs multi-stage and multi-dimensional post-processing and optimization on the prediction results output by the model according to a preset processing mechanism. This process sequentially applies a series of constraint and correction strategies from numerical to logical and from point to surface. Among them, the preset processing mechanisms include at least one of the following: capacity threshold filtering mechanism, spatiotemporal rule constraint mechanism, symbol consistency constraint mechanism, minimum duration constraint mechanism, and temporal pattern matching optimization mechanism. Specifically:

[0151] (1) Capacity threshold filtering mechanism.

[0152] Based on the capacity of the building site, a threshold is set to filter the prediction results, excluding demand response predictions that are impossible to achieve in terms of capacity. For example, if the capacity threshold is set to C=1.0kW, all prediction samples are iterated. For samples predicted as response events by the classification model (i.e., marked as -1 or 1), if the absolute value of the direct predicted response capacity value predicted by the corresponding direct regression model is lower than the preset threshold, then the final label of the sample is set to 0.

[0153] (2) Spatiotemporal rule constraint mechanism.

[0154] The prediction results are constrained and adjusted by considering time and space factors. Based on historical response events in the historical operation data of building sites, and the objective spatiotemporal distribution patterns in the training data, hard constraint rules are constructed. The effective time domain for the occurrence of response events is defined as: effective month set = {1,2,6,7,8,12}, and effective hour interval = {10,11,12,13,14,15,16,17}.

[0155] For any prediction point that falls outside the above effective time domain, regardless of the original model prediction result, its demand response flag is forcibly set to 0.

[0156] (3) Symbol consistency constraint mechanism.

[0157] Ensure that the signs of the forecasts (e.g., positive or negative) are consistent with actual or expected results. Verify that the forecast sign for each sample matches the final demand response capacity forecast. The sign of the response. If a negative response occurs and or positive response and In case of contradictions, then set =0.

[0158] (4) Minimum duration constraint mechanism.

[0159] A minimum threshold is set for the duration of demand response to exclude forecasts with excessively short durations. Based on the duration patterns of historical response events in the historical operational data of building sites, a daily-level persistence constraint is established. For example, for forecast results within the effective time period of 10:00 to 17:59 on a single day (a total of 32 time points), the persistence ratios of negative and positive response indicators are statistically analyzed. A minimum persistence ratio threshold of 62.5% is set for negative response indicators (20 out of 32 time points), and a minimum persistence ratio threshold of 12.5% ​​is set for positive response indicators (4 out of 32 time points). If the proportion of negative or positive response indicators on a given day is less than its minimum persistence ratio threshold, the response event for that day is deemed invalid, and all corresponding response indicators for that day are reset to 0.

[0160] (5) Timing pattern matching optimization mechanism.

[0161] This study aims to address the potential fragmentation and physical inconsistencies in the original model output over time. First, it extracts all occurrences of demand response indicator sequences for the effective time period from 10:00 to 17:59 within a single day from the training data of the third building site, constructing a historical response pattern library. Second, it compares the daily response indicator sequences of the first building site point-by-point with each historical pattern in the pattern library, calculating the sum of their absolute distances. Finally, it selects the historical pattern with the smallest distance as the basis for correction, replacing the original prediction sequence with this typical pattern. By analyzing the temporal patterns in the historical data, the prediction results are optimized and adjusted.

[0162] It should be understood that the above steps, through a combination of hard constraints (such as capacity thresholds) and soft optimization (such as pattern matching), ensure the physical feasibility of the prediction results while improving the smoothness and pattern rationality of the time-series predictions. In scenarios such as power grid demand response forecasting, this can significantly reduce prediction errors and improve the robustness of dispatching decisions.

[0163] It is understood that the building energy demand response prediction method provided in this application has been validated on real-world datasets of multiple commercial buildings. Compared with existing technologies, this prediction method has the following advantages:

[0164] (1) Context feature engineering method based on similarity calculation: Unlike the existing technology that mainly uses original observations or simple statistics as features, this application systematically constructs a high-dimensional feature vector containing quantile differences and various relative power differences by calculating the environmental context of historical similar time points, dynamically characterizing the relative position of each data point in historical similar patterns, and solving the problem of poor adaptability of traditional features to cross-building and cross-climate scenarios.

[0165] (2) Transfer learning strategy based on power distribution similarity: Unlike existing strategies that rely on all available data or randomly select source buildings, this application quantifies the similarity of behavioral patterns between buildings by calculating the Wasserstein distance of the normalized power sequence, and accurately selects the most similar source building data as the training set for the target building. This strategy significantly reduces the dependence of newly built or data-scarce buildings on a large amount of labeled data, and effectively solves the core bottleneck of insufficient generalization ability of the model in new scenarios.

[0166] (3) Strategic Downsampling Mechanism: To address the extreme class imbalance caused by the very low proportion of demand response events in the time series, this application proposes an innovative downsampling strategy. Unlike traditional random oversampling or undersampling methods, this application employs a multi-model independent downsampling method based on an ensemble learning framework. During the training of each base classifier, the majority class samples are downsampled proportionally to maintain a preset ratio with the minority class samples. Simultaneously, different random seeds are set to ensure the diversity of training data for each base classifier. This mechanism effectively alleviates the model bias problem caused by class imbalance and maintains the model's generalization ability through ensemble learning.

[0167] (4) Dual-path regression model for demand response capacity prediction: Unlike the single regression modeling approach, this application proposes a parallel dual-path regression framework. The direct regression model learns the mapping between response capacity and features, while the indirect regression model learns the theoretical raw power and then indirectly derives the capacity using the physical relationship between "actual power - predicted raw power". Finally, the integrated results of the two paths are weighted and fused. This design integrates the dual perspectives of direct learning and physical derivation, effectively reducing the systematic bias of a single model and significantly improving the accuracy and robustness of capacity prediction.

[0168] (5) Multi-stage post-processing mechanism integrating domain knowledge: To address potential physical inconsistencies in the original model output, this application introduces a systematic post-processing workflow, sequentially executing capacity threshold filtering, spatiotemporal rule constraints, symbol consistency verification, minimum duration constraints, and temporal pattern matching. This mechanism deeply integrates data-driven prediction with domain knowledge and physical laws, resolving issues such as fragmented prediction results, logical contradictions, and non-compliance with operational practices, thereby greatly improving the engineering practicality and operational reliability of the output results.

[0169] It should be understood that the sequence number of each step in the above embodiments does not imply 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 this application.

[0170] A method for predicting building energy demand response, corresponding to the above embodiment, Figure 4A schematic diagram of a building energy demand response prediction device according to an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown.

[0171] Reference Figure 4 The building energy demand response prediction device 3 in this embodiment includes:

[0172] The acquisition module 31 is used to acquire historical operational data from multiple building sites. These multiple building sites include a first building site and multiple second building sites located in the surrounding area of ​​the first building site.

[0173] The filtering module 32 is used to filter out multiple third building sites that are similar to the first building site from multiple second building sites based on historical operating data. The historical operating data of the third building sites is used to pre-train the classification model and the dual-path regression model.

[0174] Extraction module 33 is used to extract the high-dimensional feature vector of the first building site at the time to be predicted from the high-dimensional feature vector library of the first building site. The high-dimensional feature vector library is a feature vector library pre-constructed based on the historical operation data of multiple building sites.

[0175] The prediction module 34 is used to predict the demand response of the first building site at the time to be predicted, based on the real-time operation data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, through a classification model and a dual-path regression model. The classification model and the dual-path regression model are models pre-trained based on historical operation data and high-dimensional feature vectors of multiple third building sites for predicting the demand response.

[0176] It is understood that this application embodiment provides a building energy demand response prediction device 3. This device 3 can acquire historical operating data from multiple building sites via an acquisition module 31. These multiple building sites include a first building site and multiple second building sites located in the surrounding area of ​​the first building site. Then, a filtering module 32, based on the historical operating data, filters out multiple third building sites similar to the first building site from among the multiple second building sites. The historical operating data of the third building sites is used to pre-train a classification model and a dual-path regression model. An extraction module 33 extracts the high-dimensional feature vector of the first building site at the time to be predicted from a high-dimensional feature vector library of the first building site. The high-dimensional feature vector library is a feature vector library pre-constructed based on the historical operating data of multiple building sites. Finally, a prediction module 34, based on the real-time operating data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, predicts the demand response prediction result of the first building site at the time to be predicted using a classification model and a dual-path regression model. The classification model and the dual-path regression model are pre-trained models used to predict demand response results based on historical operational data and high-dimensional feature vectors from multiple third-party building sites. This building energy demand response prediction device 3, through a similarity-based transfer learning strategy, demonstrates excellent generalization performance in cross-building energy demand response prediction tasks, effectively solving the modeling challenge under conditions of scarce target building data. Furthermore, the dual-path regression model achieves high-precision and robust quantitative prediction of response intensity, thereby improving the accuracy of building demand response behavior and intensity prediction. This provides an efficient and reliable technical solution for building energy conservation and flexible grid regulation.

[0177] It should be noted that the information interaction and execution process between the modules in the above-mentioned building energy demand response prediction device 3 are based on the same concept as the method embodiment of this application. For details on their specific functions and technical effects, please refer to the method embodiment section, and they will not be repeated here.

[0178] This application also provides a terminal device, such as... Figure 5 As shown, Figure 5 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. (Refer to...) Figure 5 The terminal device 4 in this embodiment includes a memory 41, a processor 42, and a computer program stored in the memory 41 and executable on the processor 42. When the processor 42 executes the computer program, it implements the steps in the above-mentioned building energy demand response prediction method embodiment.

[0179] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps described in the various method embodiments above.

[0180] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the above-described method embodiments.

[0181] If the integrated unit is implemented as 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, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a photographic device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0182] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0183] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0184] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

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

[0186] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for predicting building energy demand response, the method comprising: include: Historical operational data of multiple building sites are acquired; wherein, the multiple building sites include a first building site and multiple second building sites located in the surrounding area of ​​the first building site; Based on the historical operating data, multiple third building sites similar to the first building site are selected from multiple second building sites; wherein, the historical operating data of the third building sites is used to pre-train the classification model and the dual-path regression model; The high-dimensional feature vector of the first building site at the time to be predicted is extracted from the high-dimensional feature vector library of the first building site; wherein, the high-dimensional feature vector library is a feature vector library pre-constructed based on the historical operation data of the first building site. Based on the real-time operational data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, the demand response prediction result of the first building site at the time to be predicted is obtained through the classification model and the dual-path regression model; wherein, the demand response prediction result includes a demand response prediction indicator and a demand response capacity prediction value; the classification model and the dual-path regression model are models for predicting demand response prediction results pre-trained based on the historical operational data of the multiple third building sites and the high-dimensional feature vectors of the multiple third building sites; the dual-path regression model includes a direct regression model and an indirect regression model, wherein the direct regression model consists of multiple first basis regressors and the indirect regression model consists of multiple second basis regressors; And, the step of predicting the demand response prediction result of the first building site at the time to be predicted based on the real-time operating data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, through the classification model and the dual-path regression model, includes: Based on the real-time operation data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, the demand response prediction indicator of the first building site at the time to be predicted is predicted by the classification model; wherein, the demand response prediction indicator includes a negative response indicator, a no response indicator, and a positive response indicator. Based on the real-time operating data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, the predicted value of the demand response capacity of the first building site at the time to be predicted is obtained by the dual-path regression model.

2. The method of claim 1, wherein, The method of predicting the demand response prediction label of the first building site at the time to be predicted by the classification model based on the real-time operation data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted includes: The real-time operation data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted are input into the classification model. The demand response indicator of the first building site at the time to be predicted is predicted by multiple base classifiers in the classification model, and the demand response indicator result of each base classifier is obtained. The demand response flag results of multiple base classifiers are statistically analyzed, and the category of the demand response flag with the highest frequency of occurrence is selected as the demand response prediction flag of the first building site at the time to be predicted by majority voting.

3. The method of claim 2, wherein, The training process of the classification model includes: An initial classification model is constructed based on a distributed gradient boosting algorithm; wherein, the initial classification model is used to output a demand response prediction label; Random downsampling is performed on the non-response category samples in the historical operation data of the multiple third building sites to obtain a first training dataset; wherein, the first training dataset includes multiple first training data samples; the first training data samples include historical operation data, high-dimensional feature vectors, and demand response indicators; Using the historical running data and the high-dimensional feature vector in the first training data sample as input data, and the demand response flag corresponding to the first training data sample as the label of the input data, the multiple base classifiers in the initial classification model are trained respectively to obtain the classification model.

4. The method of claim 1, wherein, The method of predicting the demand response capacity of the first building site at the predicted time based on the real-time operational data of the first building site and the high-dimensional feature vector of the first building site at the predicted time using the dual-path regression model includes: The real-time operating data of the first building site and the high-dimensional feature vector are respectively input into the direct regression model and the indirect regression model; By using the direct regression model, the normalized raw capacity prediction values ​​output by multiple first base regressors in the direct regression model are arithmetically averaged and integrated to obtain the normalized capacity prediction value. Based on the normalized capacity prediction value, the historical average power value of the first building site, and the preset inverse normalization formula, the direct prediction response capacity prediction value is calculated. By using the indirect regression model, the normalized raw power prediction values ​​output by multiple second base regressors in the indirect regression model are arithmetically averaged and integrated to obtain the normalized power prediction value. The indirect predicted response capacity is calculated based on the normalized power prediction value, the actual power value at the time to be predicted, and the historical average power value of the first building site. The direct predicted response capacity value and the indirect predicted response capacity value are combined by equal weighting and averaging to obtain the demand response capacity prediction value.

5. The method of claim 1, wherein, The step of selecting multiple third building sites similar to the first building site from multiple second building sites based on the historical operation data includes: Based on the historical operating data, calculate the Wasserstein distance between the normalized power distributions of any two building sites to obtain the distance matrix; Based on the distance matrix, a plurality of third building sites similar to the first building site are selected from a plurality of second building sites.

6. The method of claim 5, wherein, The construction process of the high-dimensional feature vector library includes: Based on the weekday type, hour type, and minute type of the current sample point, multiple candidate sample points with the same time type as the current sample point and whose timestamps are located within one time step before or after the current sample point are selected from the historical operation data of each building site. Calculate the Euclidean distance between each of the candidate sample points and the current sample point in the normalized temperature-radiation two-dimensional space; Based on the Euclidean distance, a preset number of target sample points are selected from the plurality of candidate sample points to obtain the similar context set of the current sample point; Based on the set of similar contexts, multiple high-dimensional feature vectors are constructed for each current sample point to obtain the high-dimensional feature vector library.

7. The method of claim 6, wherein, The step of constructing multiple high-dimensional feature vectors for each current sample point based on the set of similar contexts to obtain the high-dimensional feature vector library includes: Calculate the 25th percentile, 50th percentile, and 75th percentile of the temperature, radiation, and power values ​​of all target sample points in the similar context set, respectively. Based on the temperature, radiation, and power observations of each building site at the current sample point, and the 25th, 50th, and 75th percentiles of the temperature, radiation, and power values ​​of all target sample points in the similar context set, multiple environmental quantile difference features are determined. Based on the power observation value of each building site at the current sample point, the historical average power value of each building site at the first preset reference time, and the historical average power value of each building site at the second preset reference time, multiple static reference point power difference characteristics are determined. Based on the power observation value of each building site at the current sample point, the historical average power value of each building site at the previous time step at the current sample point, and the historical average power value of each building site at the next time step at the current sample point, multiple dynamic adjacent reference point power difference characteristics are determined. Based on the calculated historical average power values ​​of all target sample points in the similar context set, the historical average power values ​​of all target sample points in the similar context set at the first preset reference time, the historical average power values ​​of all target sample points in the similar context set at the second preset reference time, the historical average power values ​​of all target sample points in the similar context set corresponding to the previous time step of the current sample point, and the historical average power values ​​of all target sample points in the similar context set corresponding to the next time step of the current sample point, multiple context power difference features are determined. The multiple environmental quantile difference features, the multiple static reference point power difference features, the multiple dynamic adjacent reference point power difference features, and the multiple context power difference features are integrated to obtain multiple high-dimensional feature vectors for each building site at the current sample point; A high-dimensional feature vector library for each building site is constructed based on multiple high-dimensional feature vectors of each of the current sample points.

8. The method of claim 1, wherein, After obtaining the demand response prediction result at the time to be predicted, the method further includes: The demand response prediction results are post-processed and optimized in multiple stages according to multiple preset processing mechanisms to obtain optimized demand response prediction results. Among them, the multiple preset processing mechanisms include at least one of the following: capacity threshold filtering mechanism, spatiotemporal rule constraint mechanism, symbol consistency constraint mechanism, minimum duration constraint mechanism, and time sequence pattern matching optimization mechanism.

9. A building energy demand response prediction device, characterized by, include: The acquisition module is used to acquire historical operational data of multiple building sites; wherein, the multiple building sites include a first building site and multiple second building sites located in the surrounding area of ​​the first building site; The filtering module is used to filter out multiple third building sites that are similar to the first building site from multiple second building sites based on the historical operation data; wherein the historical operation data of the third building sites is used to pre-train the classification model and the dual-path regression model; The extraction module extracts the high-dimensional feature vector of the first building site at the time to be predicted from the high-dimensional feature vector library of the first building site; wherein, the high-dimensional feature vector library is a feature vector library pre-constructed based on the historical operation data of the first building site; The prediction module is used to predict the demand response forecast result of the first building site at the time to be predicted, based on the real-time operation data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, through a classification model and a dual-path regression model. The demand response forecast result includes a demand response forecast indicator and a predicted demand response capacity value. The classification model and the dual-path regression model are models pre-trained based on the historical operation data of the multiple third building sites and the high-dimensional feature vectors of the multiple third building sites for predicting the demand response forecast result. The dual-path regression model includes a direct regression model and an indirect regression model. The direct regression model consists of multiple first basis regressors, and the indirect regression model consists of multiple second basis regressors. Furthermore, the prediction module is specifically used for: Based on the real-time operation data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, the demand response prediction indicator of the first building site at the time to be predicted is predicted by the classification model; wherein, the demand response prediction indicator includes a negative response indicator, a no response indicator, and a positive response indicator. Based on the real-time operating data of the first building site and the high-dimensional feature vector of the first building site at the time to be predicted, the predicted value of the demand response capacity of the first building site at the time to be predicted is obtained by the dual-path regression model.