Building energy consumption optimization method based on demand response
By combining the LSTM model with the real-time electricity price and comfort threshold, the building energy consumption optimization method solves the problems of insufficient real-time performance and user comfort of demand response technology, realizes intelligent and flexible management of building energy consumption, and improves grid stability and user experience.
Patent Information
- Application Number
- CN202510883014.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-28
- Publication Date
- 2025-09-16
AI Technical Summary
Existing demand response technologies have shortcomings in terms of real-time performance and user comfort. They are unable to quickly adapt to dynamic changes in user behavior and the external environment, and lack intelligence and flexibility, resulting in decreased grid stability and user experience.
The LSTM model is combined with real-time electricity prices, historical energy consumption and comfort thresholds to predict building energy consumption. Flexible control strategies are used for demand response scheduling, and equipment status is adaptively adjusted to optimize energy consumption and comfort.
It realizes intelligent and flexible management of building energy consumption, improves grid stability and user experience, reduces energy waste, and optimizes energy consumption management.
Smart Images

Figure CN120655048A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of building energy consumption optimization, and in particular to a building energy consumption optimization method based on demand response. Background Art
[0002] With the continuous growth of global energy demand, the contradiction between energy supply and demand has become increasingly prominent, especially during peak power consumption periods. The power system often faces severe power supply pressure, which not only affects the stable operation of the power system, but also increases the operating costs of energy suppliers. In order to solve this problem, demand response technology has begun to emerge. Demand response is a strategy that guides users to adjust their electricity consumption behavior through incentives or electricity price signals, aiming to achieve peak shaving and valley filling of loads, thereby improving the stability of the power grid and energy utilization efficiency.
[0003] Demand response technology encourages users to actively adjust their electricity usage behavior by sending incentives or electricity price signals to users. It aims to achieve peak shaving and valley filling of electricity load, that is, reducing peak load demand and increasing electricity consumption during off-peak periods, thereby achieving power grid supply and demand balance and optimal resource utilization, alleviating power supply pressure during peak periods, and improving power grid operation stability and energy utilization efficiency. The core of this technology is to transform users from passive electricity users in traditional power systems to important players who actively participate in power regulation, and to achieve the goal of matching load demand with power supply capacity by dynamically adjusting load demand.
[0004] However, current demand response technology still has some limitations. For example, the real-time response capability of demand response is insufficient, and it is difficult to quickly adapt to the dynamic changes of user behavior and the external environment. In addition, existing methods often focus on a single goal and ignore the trade-off between user comfort and energy-saving needs. These problems restrict the effectiveness and promotion of demand response technology in practical applications.
[0005] While existing technologies enable demand-side personnel to proactively adjust electricity demand based on their own circumstances, addressing the problem of inaccurate overall electricity consumption forecasts caused by sudden changes in electricity demand in unpredictable scenarios, significant shortcomings remain. Existing methods typically require manual recording and adjustment of electricity demand during the power dispatch cycle, relying heavily on demand-side managers and lacking sufficient intelligence and flexibility.
[0006] In addition, existing technologies usually rely on power supply scheduling models to predict the total power demand in the next cycle. This prediction is usually based on historical data or a relatively static algorithm. The model is not updated in real time, but is carried out according to a fixed cycle. Although this method can provide a certain degree of power scheduling reference, it has a significant lag problem. On the one hand, the system lacks the ability to respond quickly to these real-time changes and cannot flexibly adjust the scheduling plan to adapt to sudden changes in actual demand. On the other hand, it can comprehensively consider the feedback and adjustment of user comfort and is only guided by power demand, which may reduce the user experience. Summary of the Invention
[0007] To solve the above problems, the present invention starts from the dynamic correlation between user comfort and energy efficiency, introduces an LSTM network, and performs real-time prediction of energy consumption demand based on historical energy consumption data, real-time electricity price data, user comfort threshold, and equipment status data. On this basis, combined with a flexible control strategy, timely response scheduling to real-time demand and adaptive adjustment of comfort threshold are achieved. Based on this, the present invention proposes a building energy consumption optimization method based on demand response.
[0008] To this end, the technical solution adopted in the present invention is as follows:
[0009] S1. Collect a building energy consumption dataset including historical energy consumption data, real-time electricity price data, comfort thresholds, and equipment status data. After normalizing the building energy consumption dataset, input it into an LSTM model. The model outputs a predicted value including the predicted energy consumption demand at the next moment and the predicted operating time of each device. The model is trained using the mean square error in the loss function to minimize the error between the predicted value and the actual value, outputs the predicted value, and converts the predicted energy consumption demand into a maximum power threshold.
[0010] S2. Calculate the total power demand within a fixed time period based on the status timetable of all devices, and compare it with the maximum power threshold predicted by the LSTM model to determine whether demand response scheduling is required;
[0011] S3. When the total power demand is greater than the predicted maximum power threshold, demand response scheduling is required. The demand response scheduling calculates the acceptable operating time range of each device based on the flexibility level, comfort threshold, and current operating time requirement of each device, and generates a device status table. Devices are selected to be shut down according to the device status table corresponding to each device until the total power demand is lower than the predicted maximum power threshold.
[0012] S5. After each scheduling cycle ends, the demand response scheduling calculates the comfort distance and compares it with the comfort distance threshold, thereby adaptively adjusting the user comfort threshold.
[0013] Furthermore, the historical energy consumption data, real-time electricity price data, comfort threshold, and equipment status data collected in step S1 are specifically as follows:
[0014] Historical energy consumption data: , indicating that from arrive Hourly historical energy consumption data,
[0015] Real-time electricity price data: ,express arrive Hourly real-time electricity price data,
[0016] Comfort threshold: It represents the maximum allowable comfort range of the customer at time t,
[0017] Device status data: , indicating the working status of m devices in the past n hours,
[0018] The data input and normalization process of step S1 is specifically as follows:
[0019] Time series data of the building energy consumption dataset for:
[0020]
[0021] The time series data Normalization is performed to improve the training effect of LSTM. The formula is:
[0022]
[0023] in, is the minimum value of the time series data, is the maximum value of the time series data,
[0024] The normalized time series data Input the LSTM model, and the LSTM model outputs the predicted energy consumption demand at the next moment And the predicted working hours of each device .
[0025] Furthermore, the LSTM model output is :
[0026]
[0027] in represents the LSTM model, are model parameters,
[0028] The mean square error in the loss function is:
[0029] The loss function is a function used to measure the gap between the model prediction result and the actual target value. The mean square error in the loss function is used to minimize the error between the predicted value and the actual value. The formula is:
[0030]
[0031] Where T is the total number of time steps, m is the total number of devices, is the actual energy consumption, To predict energy consumption, is the predicted working time of device i, is the actual working time of device i, α and β are loss weight parameters, which are used to balance the weights of energy consumption prediction and device working time prediction.
[0032] The model training is as follows: the input time series data and target output The dataset is divided into training and test sets in a ratio of 8:2, and then the parameters are trained using the LSTM model. , minimize the loss function Finally, the trained model is used to predict the energy consumption demand at the next moment based on the real-time electricity price data, historical energy consumption data and comfort threshold. And the predicted working hours of each device ,
[0033] The maximum power threshold is the predicted hourly energy demand Convert to maximum power threshold using power formula :
[0034]
[0035] in, is the maximum acceptable power threshold set by the user, is the time interval, is the hourly maximum power threshold predicted by the LSTM model, reflecting the maximum power demand of the building at time t under the given historical energy consumption pattern and real-time electricity price.
[0036] Furthermore, the total power demand calculation in step S2 is to monitor the status of all running devices in the building in real time according to the status timetable of all devices, calculate the total power demand at time t, and compare it with the maximum power threshold predicted by LSTM. Compare and determine whether demand response scheduling is needed. The total power demand formula is:
[0037]
[0038] in, Indicates the power of non-dispatchable equipment, represents the power demand of the dispatchable equipment at time t, Indicates unschedulable equipment. represents the number of dispatchable devices, represents the total power demand,
[0039] The specific steps of comparing the total power demand with the maximum power threshold predicted by the LSTM model to determine whether demand response scheduling is required are as follows:
[0040] The total power demand of all devices that need to be operated at time t and the maximum power threshold for LSTM prediction Calculate the total power excess , the formula is:
[0041]
[0042] like > 0, indicating that the total power demand exceeds the maximum power threshold predicted by LSTM , scheduling optimization is needed.
[0043] like ≤ 0, indicating that the total power demand does not exceed the maximum power threshold predicted by LSTM , no scheduling optimization is required.
[0044] Furthermore, the acceptable operating time range of each device in step S3 is calculated as follows: the demand response scheduling calculates the acceptable operating time range AWT of each device based on the flexibility level, comfort threshold α and current operating time demand of each device. The flexibility level of the device determines the width of the operating time range that the device can tolerate during scheduling. The flexibility level can be divided into: strong flexibility (SFSA) and weak flexibility (WFSA).
[0045] Among them, the flexibility level of device i is , The value range of is [0, 1], Indicates that device i has the greatest flexibility, Indicates that device i has no flexibility, i.e., it is a non-schedulable device.
[0046] The comfort threshold α ranges from [0, 1] and determines the width of the working time range of device i. When α is smaller, the width of the working time range increases, and when α is larger, the width of the working time range decreases.
[0047] Acceptable operating time range for equipment i The calculation formula is:
[0048]
[0049] in, is the flexibility level of device i, α is the comfort threshold, is the current runtime requirement of device i Acceptable working hours,
[0050] Acceptable operating time range for equipment i Calculated by the following formula:
[0051]
[0052]
[0053] in, is the earliest time that device i can start working, is the latest time that device i can start working, It is the present moment. is the earliest possible start time for device i, is the latest end time of device i,
[0054] According to the above formula, the acceptable working time range AWT corresponding to each device is generated, and a device state table DST is generated for all devices at the current time point.
[0055] Furthermore, the device status table DST, the device status table of device i The information includes the following fields:
[0056]
[0057] Device name id: uniquely identifies each device,
[0058] Flexible Level : The scheduling flexibility level of device i, the value range is [0, 1],
[0059] Current runtime requirements : The length of time that device i currently needs to run,
[0060] Acceptable working hours : The acceptable working time range length of device i,
[0061] Current working status WS: Indicates the current operating status of the device, with a value of [0, 1], where 0 means off and 1 means on.
[0062] Based on the DST corresponding to each device, the demand response scheduling will calculate the devices that need to be shut down and select the devices that need to be shut down based on the device's flexibility and total power demand. The specific steps are as follows:
[0063] (1) Calculate the current power requirements of each device ,
[0064] (2) Sort the equipment according to the size of the acceptable working time range (AWT) from large to small.
[0065] (3) Start with the device with the largest acceptable operating time range and gradually shut down the devices until the total power demand is Reduce to a value not exceeding the maximum power threshold ,Right now .
[0066] Furthermore, the comfort distance in step S4 is calculated by calculating the difference between the current scheduling scheme and the historical comfort level after each scheduling cycle, i.e., the comfort distance ACD:
[0067]
[0068] in, is the predicted working time of device i, is the historical working time of device i, is the working time of device i,
[0069] ACD measures the difference in comfort between the current scheduling plan and the historical scheduling plan, and dynamically adjusts α according to this difference, Distance threshold from comfort level Compare and update the comfort threshold α. The specific formula is as follows:
[0070]
[0071] in, is the adjustment step size, the value is 0.01,
[0072] like , indicating that equipment scheduling has a greater impact on user comfort, and it is necessary to increase α and narrow the acceptable working time range. ,
[0073] like , indicating that the current comfort level has met the user's needs, and α should be appropriately reduced.
[0074] Compared with the prior art, the advantages of the present invention are:
[0075] 1. This paper proposes a method for predicting the hourly maximum power threshold based on an LSTM model. Based on historical energy consumption data, real-time electricity price data, device status data, and comfort thresholds, the LSTM model can learn the time series characteristics of historical energy consumption data and real-time electricity price data to predict the energy consumption demand in the next stage. This processing enables the model to more accurately reflect the dynamic changes in energy consumption demand.
[0076] 2. This invention utilizes the LSTM model to dynamically predict building energy consumption, combined with adaptive adjustment of comfort thresholds and flexible equipment scheduling strategies, to improve the intelligence and flexibility of energy management. It can also make real-time adjustments based on actual needs, avoiding the rigid limitations and energy waste existing in existing technologies, thereby achieving more efficient and economical energy management goals.
[0077] 3. The present invention designs a method for adjusting the comfort distance, which can comprehensively consider the user's comfort and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0079] Figure 1 This is a flow chart of the adaptive demand response algorithm of the present invention;
[0080] Figure 2 It is a framework flow chart of the present invention. DETAILED DESCRIPTION
[0081] To achieve the above objectives, the present invention is implemented through the following technical solutions. The present invention provides a building energy consumption optimization method based on demand response, which includes:
[0082] S1. Collection and normalization of building energy consumption data sets, data input into LSTM model. After training, the model outputs the predicted value and converts it into the maximum strategy threshold.
[0083] Collect building energy consumption data sets including historical energy consumption data, real-time electricity price data, comfort thresholds, and equipment status data.
[0084] Historical energy consumption data: , indicating that from arrive Hourly historical energy consumption data,
[0085] Real-time electricity price data: ,express arrive Hourly real-time electricity price data,
[0086] Comfort threshold: It represents the maximum allowable comfort range of the customer at time t,
[0087] Device status data: , indicating the working status of m devices in the past n hours,
[0088] Time series data of the building energy consumption dataset for:
[0089]
[0090] The time series data Normalization is performed to improve the training effect of LSTM. The formula is:
[0091]
[0092] in, is the minimum value of the time series data, is the maximum value of the time series data,
[0093] The normalized time series data Input the LSTM model, and the LSTM model outputs the predicted energy consumption demand at the next moment And the predicted working hours of each device The model is trained through the mean square error in the loss function to minimize the error between the predicted value and the actual value, output a high-precision predicted value, and convert the maximum power threshold through the predicted energy consumption demand.
[0094] After data preprocessing is completed, the LSTM model outputs the predicted energy consumption demand at the next moment And the predicted working hours of each device , model output for:
[0095]
[0096] in represents the LSTM model, are model parameters,
[0097] The mean square error in the loss function is used to minimize the error between the predicted value and the actual value. The loss function is a function used to measure the gap between the model's prediction results and the actual target value. By minimizing the loss function, the model can optimize its parameters, thereby improving the prediction accuracy. The formula is:
[0098]
[0099] Where T is the total number of time steps, m is the total number of devices, is the actual energy consumption, To predict energy consumption, is the predicted working time of device i, is the actual working time of device i, α and β are loss weight parameters, which are used to balance the weights of energy consumption prediction and device working time prediction.
[0100] Model training: Input time series data and target output The dataset is divided into training and test sets in a ratio of 8:2, and then the parameters are trained using the LSTM model. , minimize the loss function Finally, the trained model is used to predict the energy consumption demand at the next moment based on the real-time electricity price data, historical energy consumption data and comfort threshold. And the predicted working hours of each device .
[0101] Maximum power threshold: predicted hourly energy demand Convert to maximum power threshold using power formula :
[0102]
[0103] in, is the maximum acceptable power threshold set by the user, is the time interval, is the hourly maximum power threshold predicted by the LSTM model, reflecting the maximum power demand of the building at time t under the given historical energy consumption pattern and real-time electricity price.
[0104] S2. Calculate the total power requirement and compare it with the maximum power threshold predicted by the LSTM model.
[0105] Monitor the status of all running devices in the building in real time according to the status timetable of all devices, calculate the total power demand at time t, and compare it with the maximum power threshold predicted by LSTM Compare and determine whether demand response scheduling is needed. The total power demand formula is:
[0106]
[0107] in, Indicates the power of non-dispatchable equipment, represents the power demand of the dispatchable equipment at time t, Indicates unschedulable equipment. represents the number of dispatchable devices, represents the total power demand,
[0108] The specific steps for comparing the total power demand with the maximum power threshold predicted by the LSTM model to determine whether demand response scheduling is needed are as follows:
[0109] The total power demand of all devices that need to be operated at time t and the maximum power threshold for LSTM prediction Calculate the total power excess , the formula is:
[0110]
[0111] like > 0, indicating that the total power demand exceeds the maximum power threshold predicted by LSTM , scheduling optimization is required,
[0112] like ≤ 0, indicating that the total power demand does not exceed the maximum power threshold predicted by LSTM , no scheduling optimization is required.
[0113] S3. Calculate the acceptable working time range of each device, generate a device status table, and optimize scheduling based on the device status table corresponding to each device.
[0114] When the total power demand Exceeding the maximum power threshold for LSTM predictions When the demand response scheduling enters the optimization scheduling stage, the building energy consumption does not exceed the predicted power threshold.
[0115] In this step, the demand response scheduling calculates the acceptable working time range of each device based on the flexibility level, comfort threshold α and current operating time requirement of each device. Then, based on this information, a device state table DST is generated for all devices at the current time point. The AWT is the acceptable working time range of each dispatchable device at the current moment. This range is determined by the device's scheduling flexibility level, comfort threshold α and the device's operating time requirement. The device's flexibility level determines the width of the working time range that the device can tolerate during scheduling. The flexibility level can be divided into: strong flexibility (SFSA) and weak flexibility (WFSA).
[0116] Among them, the flexibility level of device i is , The value range of is [0, 1], Indicates that device i has the greatest flexibility, Indicates that device i has no flexibility, that is, it is not schedulable.
[0117] The comfort threshold α ranges from [0, 1] and determines the width of the working time range of device i. When α is smaller, the width of the working time range increases, and when α is larger, the width of the working time range decreases.
[0118] The acceptable working time range of device i is calculated from this :
[0119] Flexible level according to device i , comfort threshold α and current runtime requirement Calculate acceptable working hours :
[0120] Acceptable operating time range for equipment i Calculated by the following formula:
[0121]
[0122]
[0123] in, is the earliest time that device i can start working, is the latest time that device i can start working, It is the present moment. is the earliest possible start time for device i, is the latest time that device i can end.
[0124] According to the above calculation formula, the corresponding acceptable working time range AWT can be generated for each device, and a device state table DST can be generated for all devices at the current time point.
[0125] Device status table for device i The information includes the following fields:
[0126]
[0127] Device name id: uniquely identifies each device,
[0128] Flexible Level : The scheduling flexibility level of device i, the value range is [0, 1],
[0129] Current runtime requirements : The length of time that device i currently needs to run,
[0130] Acceptable working hours : The acceptable working time range length of device i,
[0131] Current working status WS: indicates the current operating status of the device. The value is [0, 1], where 0 means off and 1 means on.
[0132] Based on the DST corresponding to each device, the demand response scheduling will calculate the devices that need to be shut down and select the devices that need to be shut down based on the device's flexibility and total power demand. The specific steps are as follows:
[0133] (1) Calculate the current power requirements of each device ,
[0134] (2) Sort the equipment according to the size of the acceptable working time range (AWT) from large to small.
[0135] (3) Start with the device with the largest acceptable operating time range and gradually shut down the devices until the total power demand is Reduce to a value not exceeding the maximum power threshold ,Right now .
[0136] The demand response scheduling will give priority to shutting down devices with larger AWT. These devices are usually more flexible and have a large adjustable range of working hours. The operating time can be adjusted within a wider time range, so that energy consumption distribution can be optimized without affecting comfort.
[0137] S4. Calculate the comfort distance and compare it with the comfort distance threshold.
[0138] In this step, the demand response scheduling will adaptively adjust the user comfort threshold α based on the comfort distance ACD. ACD measures the comfort difference between the current scheduling plan and the historical scheduling plan, and dynamically adjusts α based on this difference to optimize the balance between comfort and energy efficiency.
[0139] After each scheduling cycle, the demand response scheduling calculates the difference between the current scheduling plan and the historical comfort level, namely the comfort distance ACD:
[0140]
[0141] in, is the predicted working time of device i, is the historical working time of device i, is the working time of device i.
[0142] After calculating the comfort distance, the comfort distance Distance threshold from comfort level Compare and update the comfort threshold α. The specific formula is as follows:
[0143]
[0144] in, is the adjustment step size, the value is 0.01,
[0145] like , indicating that equipment scheduling has a greater impact on user comfort, and it is necessary to increase α and narrow the acceptable working time range. , to improve comfort,
[0146] like , indicating that the current comfort level has met user needs, and α can be appropriately reduced to increase scheduling flexibility and optimize energy efficiency.
[0147] This demand-responsive building energy optimization method, proposed in this paper, achieves comprehensive optimization of building energy efficiency and user comfort through multi-layered technical approaches. Its core concept is to leverage the LSTM model for dynamic prediction, adaptive adjustment of comfort thresholds, and flexible equipment scheduling, ultimately achieving intelligent scheduling of building energy consumption.
[0148] First, the present invention uses the LSTM model to predict building energy consumption. The LSTM model can learn the time series characteristics of historical energy consumption data and real-time electricity price data, and then predict the maximum power threshold per hour. Secondly, the present invention proposes an adaptive adjustment mechanism based on comfort feedback, which dynamically adjusts the user's comfort threshold by calculating the comfort distance ACD in real time. Specifically, when the equipment scheduling has a greater impact on comfort, the system will automatically increase the comfort threshold and narrow the acceptable range of the equipment's working time to ensure that the user's comfort requirements are met. When the comfort requirements are lower, the system can flexibly adjust the comfort threshold to better balance energy consumption and cost. In addition, the present invention further proposes a scheduling optimization strategy based on the equipment flexibility level, which gives priority to shutting down those devices with strong flexibility and a larger acceptable working time range. These devices can usually adjust their working periods within a wider time window, so shutting them down first can effectively reduce the total power demand of the building.
[0149] In summary, the advantages of the present invention lie in its intelligence and flexibility. These advantages work together to provide an innovative and reliable technical support for the field of building energy optimization, which helps to improve the efficiency of energy optimization and enhance intelligent scheduling and user experience.
[0150] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A building energy consumption optimization method based on demand response, characterized in that: The method includes: S1. Collect a building energy consumption dataset including historical energy consumption data, real-time electricity price data, comfort thresholds, and equipment status data. After normalizing the building energy consumption dataset, input it into an LSTM model. The model outputs a predicted value including the predicted energy consumption demand at the next moment and the predicted operating time of each device. The model is trained using the mean square error in the loss function to minimize the error between the predicted value and the actual value, outputs the predicted value, and converts the predicted energy consumption demand into a maximum power threshold. S2. Calculate the total power demand within a fixed time period based on the status timetable of all devices, and compare it with the maximum power threshold predicted by the LSTM model to determine whether demand response scheduling is required; S3. When the total power demand is greater than the predicted maximum power threshold, demand response scheduling is required. The demand response scheduling calculates the acceptable operating time range of each device based on the flexibility level, comfort threshold, and current operating time requirement of each device, and generates a device status table. Devices are selected to be shut down according to the device status table corresponding to each device until the total power demand is lower than the predicted maximum power threshold. S4. After each scheduling cycle, the demand response scheduling calculates the comfort distance and compares it with the comfort distance threshold, thereby adaptively adjusting the user comfort threshold.
2. The building energy consumption optimization method based on demand response according to claim 1 is characterized in that: The historical energy consumption data, real-time electricity price data, comfort threshold, and equipment status data collected in step S1 are specifically as follows: Historical energy consumption data: , indicating that from arrive Hourly historical energy consumption data, Real-time electricity price data: ,express arrive Hourly real-time electricity price data, Comfort threshold: It represents the maximum allowable comfort range of the customer at time t, Device status data: , indicating the working status of m devices in the past n hours, The data input and normalization process of step S1 is specifically as follows: Time series data of the building energy consumption dataset for: The time series data Normalization is performed to improve the training effect of LSTM. The formula is: in, is the minimum value of the time series data, is the maximum value of the time series data, The normalized time series data Input the LSTM model, and the LSTM model outputs the predicted energy consumption demand at the next moment And the predicted working hours of each device .
3. The building energy consumption optimization method based on demand response according to claim 2 is characterized in that: The LSTM model output for: in represents the LSTM model, are model parameters, The mean square error in the loss function is: The loss function is a function used to measure the gap between the model prediction result and the actual target value. The mean square error in the loss function is used to minimize the error between the predicted value and the actual value. The formula is: Where T is the total number of time steps, m is the total number of devices, is the actual energy consumption, To predict energy consumption, is the predicted working time of device i, is the actual working time of device i, α and β are loss weight parameters, which are used to balance the weights of energy consumption prediction and device working time prediction. The model training is as follows: the input time series data and target output The dataset is divided into training and test sets in a ratio of 8:2, and then the parameters are trained using the LSTM model. , minimize the loss function Finally, the trained model is used to predict the energy consumption demand at the next moment based on the real-time electricity price data, historical energy consumption data and comfort threshold. And the predicted working hours of each device , The maximum power threshold is the predicted hourly energy demand Convert to maximum power threshold using power formula : in, is the maximum acceptable power threshold set by the user, is the time interval, is the hourly maximum power threshold predicted by the LSTM model, reflecting the maximum power demand of the building at time t under the given historical energy consumption pattern and real-time electricity price.
4. The building energy consumption optimization method based on demand response according to claim 1 is characterized in that: The total power demand calculation in step S2 is to monitor the status of all running devices in the building in real time according to the status timetable of all devices, calculate the total power demand at time t, and compare it with the maximum power threshold predicted by LSTM. Compare and determine whether demand response scheduling is needed. The total power demand formula is: in, Indicates the power of non-dispatchable equipment, represents the power demand of the dispatchable equipment at time t, Indicates unschedulable equipment. represents the number of dispatchable devices, represents the total power demand, The specific steps of comparing the total power demand with the maximum power threshold predicted by the LSTM model to determine whether demand response scheduling is required are as follows: The total power demand of all devices that need to be operated at time t and the maximum power threshold for LSTM prediction Calculate the total power excess , the formula is: like > 0, indicating that the total power demand exceeds the maximum power threshold predicted by LSTM , scheduling optimization is required, like ≤ 0, indicating that the total power demand does not exceed the maximum power threshold predicted by LSTM , no scheduling optimization is required.
5. The building energy consumption optimization method based on demand response according to claim 1 is characterized in that: The acceptable operating time range of each device in step S3 is calculated as follows: the demand response scheduling calculates the acceptable operating time range AWT of each device based on the flexibility level, comfort threshold α and current operating time demand of each device. The flexibility level of the device determines the width of the operating time range that the device can tolerate during scheduling. The flexibility level can be divided into strong flexibility (SFSA) and weak flexibility (WFSA). Among them, the flexibility level of device i is , The value range of is [0, 1], Indicates that device i has the greatest flexibility, Indicates that device i has no flexibility, i.e., it is a non-schedulable device. The comfort threshold α ranges from [0, 1] and determines the width of the working time range of device i. When α is smaller, the width of the working time range increases, and when α is larger, the width of the working time range decreases. Acceptable operating time range for equipment i The calculation formula is: in, is the flexibility level of device i, α is the comfort threshold, is the current runtime requirement of device i Acceptable working hours, Acceptable operating time range for equipment i Calculated by the following formula: in, is the earliest time that device i can start working, is the latest time that device i can start working, It is the present moment, is the earliest possible start time for device i, is the latest possible end time for device i, According to the above formula, the acceptable working time range AWT corresponding to each device is generated, and a device state table DST is generated for all devices at the current time point.
6. The building energy consumption optimization method based on demand response according to claim 5 is characterized in that: The device status table DST, the device status table of device i The information includes the following fields: Device name id: uniquely identifies each device, Flexible Level : The scheduling flexibility level of device i, the value range is [0, 1], Current runtime requirements : The length of time that device i currently needs to run, Acceptable working hours : The acceptable working time range length of device i, Current working status WS: Indicates the current operating status of the device, with a value of [0, 1], where 0 means off and 1 means on. Based on the DST corresponding to each device, the demand response scheduling will calculate the devices that need to be shut down and select the devices that need to be shut down based on the device's flexibility and total power demand. The specific steps are as follows: (1) Calculate the current power requirements of each device , (2) Sort the equipment according to the size of the acceptable working time range (AWT) from large to small. (3) Start with the device with the largest acceptable operating time range and gradually shut down the devices until the total power demand is Reduce to a value not exceeding the maximum power threshold ,Right now .
7. The building energy consumption optimization method based on demand response according to claim 1 is characterized in that: The comfort distance in step S4 is calculated after each scheduling cycle by the demand response scheduling to calculate the difference between the current scheduling scheme and the historical comfort, i.e., the comfort distance ACD: in, is the predicted working time of device i, is the historical working time of device i, is the working time of device i, ACD measures the difference in comfort between the current scheduling plan and the historical scheduling plan, and dynamically adjusts α according to this difference, Distance threshold from comfort level Compare and update the comfort threshold α. The specific formula is as follows: in, is the adjustment step size, the value is 0.01, like , indicating that equipment scheduling has a greater impact on user comfort, and it is necessary to increase α and narrow the acceptable working time range. , like , indicating that the current comfort level has met the user's needs, and α should be appropriately reduced.