LSTM-based load forecasting and dynamic scheduling method for green building microgrid
By adjusting the LSTM input sequence and combining it with energy storage device records in green building microgrids, the problem of temperature lag in air conditioning systems was solved, enabling more accurate load forecasting and dynamic scheduling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU FUDAN AUTO SCI & TECH
- Filing Date
- 2026-02-02
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies in green building microgrids fail to effectively distinguish the spatial and functional differences in the operating data of different devices. The lag in indoor temperature changes caused by air conditioning systems fails to establish a direct correspondence with changes in equipment load, leading to deviations in prediction results. Furthermore, static load prediction results are difficult to reflect the real-time scheduling needs of energy storage devices, affecting the accuracy and stability of scheduling execution.
By acquiring operational data of lighting, air conditioning, and charging piles in green building microgrids, power change values are extracted and load trend sample sequences are formed. Thermal inertia-related load periods are identified, the LSTM input sequence is adjusted, and the prediction results are corrected by combining the operation records of energy storage devices to enhance dynamic scheduling constraints.
It enhances the consistency of load curves and the matching of scheduling periods, thereby improving the accuracy of load forecasting and the real-time adaptability of scheduling.
Smart Images

Figure CN122178279A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of load forecasting technology, and in particular to a method for load forecasting and dynamic scheduling of green building microgrids based on LSTM. Background Technology
[0002] The field of load forecasting technology involves analyzing and predicting load changes in power systems within a given time frame. Core aspects include load data acquisition and processing, time series modeling, multi-factor feature construction, and the application of forecast results in power dispatching. Its methodological content is usually based on historical load curves, combined with meteorological parameters such as temperature, humidity, and light intensity, electricity price information, and building operating conditions. By establishing mathematical models or learning models, future loads are quantitatively estimated, providing a basis for power distribution operation and energy dispatching. Traditional LSTM-based load forecasting and dynamic scheduling methods for green building microgrids refer to a technical approach that uses historical load data and external environmental data to construct a time-series forecasting model with a long short-term memory network as its core in the context of green building microgrids. This model predicts future load changes and formulates scheduling schemes based on the prediction results. Such methods typically input continuous data such as load power, temperature, and light intensity in a time-step sequence manner. By updating historical states through a gating structure, the predicted load values for future periods are generated. Combined with preset scheduling rules or optimization objectives, the output of photovoltaic power generation, the charging and discharging power of energy storage, and the timing of energy consumption on the load side are arranged to complete the load forecasting and scheduling processing in green building microgrids.
[0003] Existing technologies rely on continuous time steps to construct input sequences, failing to distinguish the spatial and functional differences in the operating data of different devices. The lag in indoor temperature changes caused by air conditioning systems fails to establish a direct correspondence with changes in equipment load, leading to deviations in prediction results during periods of significant thermal inertia. Furthermore, load prediction results, used as a static basis for scheduling, lack a correlation channel with the energy storage response status. Under conditions of frequent charging and discharging of energy storage devices or drastic load changes, static prediction outputs are difficult to reflect the real-time adaptability of scheduling needs, affecting the accuracy and stability of scheduling execution. Summary of the Invention
[0004] To address the technical problems existing in the prior art, this invention provides a method for load forecasting and dynamic scheduling of green building microgrids based on LSTM. To achieve the above objectives, the present invention adopts the following technical solution: a load forecasting and dynamic scheduling method for green building microgrids based on LSTM, comprising the following steps: S1: Obtain the operation data of lighting, air conditioning and charging piles in the green building microgrid, extract the power change value, and merge the equipment data corresponding to the building zone into the target data column to obtain the load trend sample sequence set; S2: Based on the power change content of the centralized air conditioning equipment in the load trend sample sequence, extract the start time point and compare it with the room temperature change time, identify the lag time segment, and associate it with the area where the equipment is located to obtain the set of thermal inertia-related load time periods; S3: Based on the set of thermal inertia-related load time periods, find the corresponding time period in the original LSTM input sequence, move the segment data to the beginning of the sequence, update the time period order of the input sequence, and obtain the input time period order structure table. S4: Based on the input time period sequence structure table, extract the predicted output results and compare them with the measured power values of the same time period, locate the predicted value offset position, check the section energy storage operation record, and obtain the set of correctable time sections. S5: Based on the set of correctable time segments, extract the power value of the corresponding energy storage behavior record to replace the original predicted value of the time segment, and incorporate the data of the time segment that was not extracted into the correction structure to obtain the dynamic scheduling constraint load prediction result.
[0005] As a further embodiment of the present invention, the load trend sample sequence set includes a lighting load trend sub-sequence, an air conditioning load trend sub-sequence, a charging pile load trend sub-sequence, a sampling timestamp sequence, and a load set index key. The thermal inertia-related load time period set includes a temperature lag time period identifier, lag duration, thermal inertia intensity level, hot zone code, and start-stop association pair. The input time period sequence structure table includes a time period number chain, an inter-segment sequence relationship matrix, a shift offset field, a preceding segment marker, and a sequence consistency check item. The correctable time segment set includes an offset type identifier, an offset amplitude parameter, an energy storage response association marker, a charging / discharging status code, and a correction priority. The dynamic scheduling constraint load prediction result includes a replacement predicted power sequence, a scheduling constraint flag, an energy storage coupling prediction component, a prediction period time axis, and a time period correction record table.
[0006] As a further aspect of the present invention, the target data column refers to the load trend sample sequence after regional integration; The lag time interval refers to the time interval during which the change in air conditioning power precedes the temperature response.
[0007] As a further aspect of the present invention, the predicted numerical offset position refers to the time period during which the predicted result is inconsistent with the measured data; The correction structure refers to the load forecast output structure generated after adjusting the offset prediction value using energy storage data.
[0008] As a further aspect of the present invention, the specific steps of S1 are as follows: S101: Obtain power data of lighting equipment, air conditioning equipment and charging piles in the green building microgrid, set a uniform time sampling interval, number each type of power data in time sequence, and match time items with power values to obtain data entries of the three types of equipment distributed in time sequence. S102: Based on the equipment number information in the data entries of the three types of equipment distributed in time sequence, retrieve the deployment area with the corresponding number in the building area deployment list, and group the data entries of the same type of equipment belonging to the same area according to the equipment category to obtain the equipment power distribution structure dataset of the region. S103: Based on the device power distribution structure dataset of the sub-regions, the time field in the power data is horizontally aligned, and according to the device category information and deployment area, it is decomposed and assigned into corresponding time series data content to obtain the load trend sample sequence set.
[0009] As a further aspect of the present invention, the specific steps of S2 are as follows: S201: Based on the power data of the air conditioning equipment in the load trend sample sequence set, monitor the time index position where the power value changes from static to fluctuating, verify the direction of change of continuous power sampling points, and obtain the set of power change start times; S202: Based on the time range corresponding to the set of power change start times, extract the indoor temperature sampling data within the time period, analyze the trend segment of decreasing temperature change rate under continuous time index, and obtain the set of temperature change lag time. S203: Based on the set of power change start times and the set of temperature change delay times, and by analyzing the temporal distribution relationship, identify the time period before the temperature response, and extract the deployment area information of the associated air conditioning equipment, to obtain the set of thermal inertia associated load time periods.
[0010] As a further aspect of the present invention, during the process of monitoring the power value of the air conditioning equipment power data content from static to fluctuating time index position: it is determined that the power change amplitude under continuous time index remains fluctuating and shows continuous offset in the same direction, and the start time of power change is verified. In the process of verifying the direction of change of continuous power sampling points: analyze the trend of increase and decrease of power sampling values under adjacent time indices, and identify segments with continuous upward and downward changes; In the process of analyzing the decreasing trend segment of temperature change rate under continuous time index: compare the change rate of adjacent temperature sampling points, identify the segment where the second derivative of the change rate is less than a preset threshold and slows down and continues for no less than a preset minimum duration.
[0011] As a further aspect of the present invention, the specific steps of S3 are as follows: S301: Based on the thermal inertia-related load time period set, retrieve the data index position that matches the time period range from the original LSTM input sequence, locate the corresponding time period data frame content and map the index to obtain the original time period mapping structure table; S302: Based on the data index in the original time period mapping structure table, the corresponding data frame is moved sequentially along the original sequence direction to the segment at the starting position to obtain the time period sequence reconstruction structure table; S303: Based on the data frame index structure and adjustment order information in the time period sequence reconstruction structure table, update the input sequence of the LSTM model, restore the data frame in the sequence structure position and connect the content to obtain the input time period sequence structure table.
[0012] As a further aspect of the present invention, the specific steps of S4 are as follows: S401: Based on the time period content listed in the input time period sequence structure table, extract the load prediction output data frame and the corresponding actual power change data frame within the time period, and compare the trend on the time index to obtain the prediction offset time period index set. S402: Based on the time index of the predicted offset time period index set, extract the power change data frames of the associated energy storage devices in the corresponding time period, determine the continuity and response direction of the power value change of the data frames, and obtain the power response associated index set; S403: Based on the time index in the power response association index set, locate the time segment to which the power response belongs within the predicted offset period, and group the continuous time indexes with continuous time intervals and consistent power response directions into the same time segment to obtain a set of correctable time segments.
[0013] As a further aspect of the present invention, the specific steps of S5 are as follows: S501: Based on the set of correctable time segments, retrieve the load change data frame corresponding to the time period from the load forecast output result, extract the power value field in the data frame segment by segment, and obtain the corrected target load data sequence; S502: Based on the time index in the modified target load data sequence, retrieve the power change data frame of the energy storage response behavior in the corresponding time period, and replace the power value in the original data frame with the extracted power data point by point to obtain the response replacement load data sequence. S503: Based on the response replacement load data sequence and the unextracted data frames in the load prediction output results, locate them according to the original time index sequence, merge and sort the data frames into the prediction period segment, and obtain the dynamic scheduling constraint load prediction result.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by uniformly aggregating the operation data of lighting, air conditioning and charging piles within building zones, a load trend sample sequence with regional correspondence is formed. The time difference between air conditioning start-up and room temperature slowdown is extracted to construct a thermal response lag period marker, thereby enhancing the influence of thermal inertia in the prediction input. Prediction offset segments are identified and associated with energy storage charging and discharging records. A set of correctable time segments is constructed and the corresponding prediction values are replaced. The output is a load prediction result with dynamic scheduling constraints, which enhances the consistency of the load curve and the matching of scheduling periods. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 This is a detailed schematic diagram of S1 of the present invention; Figure 3 This is a detailed schematic diagram of S2 of the present invention; Figure 4 This is a detailed schematic diagram of S3 of the present invention; Figure 5 This is a detailed schematic diagram of S4 of the present invention; Figure 6 This is a detailed schematic diagram of S5 of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0018] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0019] Please see Figure 1 This invention provides a method for load forecasting and dynamic scheduling of green building microgrids based on LSTM, including the following steps: S1: Obtain the operating status data of lighting, air conditioning and charging piles in the green building microgrid. Collect the changes in power data of lighting equipment, air conditioning equipment and charging piles during operation by setting time intervals. Unify the collected data according to the sampling time order. According to the installation location of each type of equipment in the building area, put the corresponding data into the corresponding load data set to obtain the load trend sample sequence set. S2: Based on the power change content corresponding to the centralized air conditioning equipment operation status data of the load trend sample sequence, extract the time point when the air conditioning equipment starts to operate, analyze the chronological relationship between the time point when the indoor temperature change gradually slows down in the corresponding time period, identify the time period range of temperature response lag in continuous comparison, and correspond the data associated with the range to the area where the building equipment is located to obtain the set of thermal inertia associated load time periods. S3: Based on the time segments listed in the thermal inertia-related load time period set, find the corresponding time period in the original LSTM input sequence, move the data content corresponding to the time period to the beginning of the input sequence, and keep the unshifted data in the original order. Update the time period order of the input sequence to obtain the input time period order structure table. S4: Based on the time period corresponding to the input time period sequence structure table, obtain the load forecast output result and compare it with the actual power change trend in the same time period. Identify the time period where there is a deviation between the predicted value and the measured value, check the energy storage operation record associated with the time period, analyze whether overcharging and discharging operations occurred during the period when the deviation occurred, identify the predicted time period associated with response behavior, and obtain the set of correctable time periods. S5: Based on the set of correctable time segments, extract the load change data for the corresponding time period in the load forecast output results, refer to the power change content recorded in the energy storage response behavior, replace the extracted load change data, and arrange the replaced data and the unextracted data into the forecast period according to the original time order to obtain the dynamic scheduling constraint load forecast results.
[0020] The load trend sample sequence set includes lighting load trend subsequence, air conditioning load trend subsequence, charging pile load trend subsequence, sampling timestamp sequence, and load set index key. The thermal inertia-related load time period set includes temperature lag time period identifier, lag duration, thermal inertia intensity level, hot zone code, and start-stop association pair. The input time period sequence structure table includes time period number chain, inter-segment sequence relationship matrix, shift offset field, preceding segment mark, and sequence consistency check item. The correctable time segment set includes offset type identifier, offset amplitude parameter, energy storage response association mark, charging and discharging status code, and correction priority. The dynamic scheduling constraint load prediction results include the replaced predicted power sequence, scheduling constraint flag, energy storage coupling prediction component, prediction period time axis, and time period correction record table.
[0021] Please see Figure 2 The specific steps of S1 are as follows: S101: Obtain power data of lighting equipment, air conditioning equipment and charging piles in the green building microgrid, set a uniform time sampling interval, number each type of power data in time sequence, and match time items with power values to obtain data entries of the three types of equipment distributed in time sequence. First, the smart gateway interface, via Modbus TCP or BACnetIP communication protocols, connects to the underlying sensor network of the green building microgrid. It reads the three-phase current and voltage readings of the lighting circuit, the compressor operating power reading of the central air conditioning unit, and the instantaneous charging power reading of the electric vehicle charging pile in real time at a frequency of 100 milliseconds. It then calls a network time protocol server to calibrate the clocks of each acquisition terminal to control the time error within ±50 milliseconds. Subsequently, a uniform time sampling interval of 15 minutes is set, and all raw high-frequency data streams are downsampled according to this interval. The arithmetic mean method is used to calculate the time difference for each 15-minute interval. For the average power value within the window, for missing data points caused by communication packet loss, cubic spline interpolation is used to construct a piecewise smooth polynomial function based on two valid data points before and after the missing point to complete the data. On this basis, a global device indexing mechanism is established, assigning each device a unique Arabic numeral number starting from 1001 and incrementing according to the order of the physical port of the device connected to the power grid. Three independent data matrices are constructed to correspond to the three types of devices: lighting, air conditioning, and charging piles. The aligned Unix timestamps are paired with the power values of the corresponding numbered devices and filled in. All acquisition channels are traversed to finally obtain the data entries of the three types of devices distributed in time sequence.
[0022] S102: Based on the equipment number information in the data entries of the three types of equipment distributed in time sequence, retrieve the deployment area with the corresponding number in the building area deployment list, and group the data entries of the same type of equipment belonging to the same area according to the equipment category to obtain the equipment power distribution structure dataset of the region. First, the building area deployment list stored in the relational database is loaded. The three generated equipment power data matrices are read, and the equipment number information in the column header is extracted row by row as the index key. The corresponding building physical space identifier is retrieved in the deployment list using a hash lookup algorithm. Then, a multidimensional data tensor structure is initialized. The power data entries are grouped and aggregated according to the area identifier and equipment category (e.g., all are air conditioning equipment in area A). During the aggregation process, if there are multiple similar devices in the same area, their independence in the tensor feature dimension is maintained. That is, a submatrix with the shape of time step multiplied by the number of devices is constructed instead of simple numerical accumulation, so as to retain the characteristics of single-machine operation. This forms a structured dataset containing time stamps, area labels, equipment categories and specific power values, and finally, a regional equipment power distribution structure dataset is obtained.
[0023] S103: Based on the regional device power distribution structure dataset, the time field in the power data is horizontally aligned, and according to the device category information and deployment area, it is decomposed and assigned into corresponding time series data content to obtain the load trend sample sequence set; First, based on the regional device power distribution structure dataset, the time field in the power data is locked as the main axis. The data of all regions and device categories are horizontally aligned along the time axis to ensure that the start and end times are consistent. Then, the disassembly and assignment operation is performed. For each specific deployment area, the power reading sequence of three types of devices, namely lighting, air conditioning and charging piles, is extracted within a continuous time window. The sliding window step size is set to 1 time step and the window size is 96 time steps. Data is extracted from the start time point. The power values of all devices in the area are used as feature vectors to fill the feature dimension of the target tensor. The disassembled time series fragments are stacked in sequence to construct a sequence set with the shape of the number of samples multiplied by 96 multiplied by the number of features. Finally, the load trend sample sequence set is obtained.
[0024] Please see Figure 3 The specific steps of S2 are as follows: S201: Based on the power data of air conditioning equipment in the load trend sample sequence set, monitor the time index position where the power value changes from static to fluctuating, verify the direction of change of continuous power sampling points, and obtain the set of power change start times; First, a subset of power data from air conditioning equipment is extracted from the load trend sample sequence set. A sliding detection window of length 5 is defined, and the standard deviation of the power value within the window and the sum of the absolute values of the differences between adjacent points are calculated point by point. The power fluctuation threshold is set to 5% of the rated power of the equipment. For example, for equipment with a rated power of 10 kW, the threshold is set to 0.5 kW. When the power standard deviation within the detection window is greater than 0.2 kW and the power increment direction of three consecutive sampling points is consistent and the cumulative change exceeds 0.5 kW, the position is determined to be the critical point where the power changes from static to fluctuating. The entire sequence set is traversed to collect all index values that meet the conditions, and finally the set of power change start times is obtained.
[0025] S202: Based on the time range corresponding to the power change start time set, extract the indoor temperature sampling data within the time period, analyze the trend segment of decreasing temperature change rate under continuous time index, and obtain the temperature change lag time set. First, based on the time points recorded in the power change start time set, the historical sampling data of temperature sensors deployed in the same building area are queried backward. The query range is set from the start time point to 60 minutes after the start time point. The first derivative of the temperature sequence with respect to time, i.e. the temperature change rate, is calculated. The segment where the temperature change rate shows a continuously decreasing trend is found. The temperature response judgment threshold is set to a change of 0.5 degrees Celsius every 15 minutes. Starting from the start time point, the temperature data is traversed. When the absolute value of the temperature difference between two consecutive time steps is greater than 0.1 degrees Celsius and the direction of change is consistent with the expected air conditioning operation mode, this moment is recorded as the temperature response moment. The delay time is determined by calculating the difference between the temperature response moment and the start time point, and finally the temperature change delay time set is obtained.
[0026] S203: Based on the set of power change start time and the set of temperature change delay time, and by analyzing the temporal distribution relationship, identify the time period before the temperature response of power change, and extract the deployment area information of associated air conditioning equipment, to obtain the set of thermal inertia associated load time periods; First, the set of power change start times and temperature change delay times are read. Then, a topological analysis of the time distribution is performed to filter out time intervals that satisfy the condition that the power action time is less than the current time and the current time is less than the temperature response time. This interval physically represents the latent heat storage and thermal inertia stage where the air conditioning equipment has done work and input energy but the indoor ambient temperature has not changed significantly. Then, the air conditioning equipment ID corresponding to this time period is associated and the deployment list is queried in reverse to obtain the specific deployment area information of the equipment. The time period range and spatial location information are packaged into tuples and the tuple is determined to be the thermal inertia action period of a specific area. Finally, the set of thermal inertia-related load time periods is obtained.
[0027] Please see Figure 4 The specific steps of S3 are as follows: S301: Based on the thermal inertia-related load time period set, retrieve the data index position that matches the time period range from the original LSTM input sequence, locate the corresponding time period data frame content and map the index to obtain the original time period mapping structure table; First, the time range information in the thermal inertia-related load period set is used as the query key. The search is performed on the corresponding time axis of the original LSTM input sequence. Each period in the set is traversed, and the row index number corresponding to the start and end timestamps of that period in the original sequence is calculated. The calculation logic is that the start index is equal to the start timestamp minus the sequence base time and divided by the time interval, where the time interval is 15 minutes or 900 seconds. For example, when the start timestamp is offset by 7200 seconds from the base time, the index is calculated to be 8. These calculated index intervals and their corresponding data frame contents are marked and extracted to establish a hash mapping table containing index positions, time ranges, and data content references. Finally, the original time period mapping structure table is obtained.
[0028] S302: Based on the data index in the original time period mapping structure table, move the corresponding data frame sequentially along the original sequence direction to the segment at the starting position to obtain the time period sequence reconstruction structure table; First, the original time-segment mapping structure table is manipulated. The data arrangement order of the original LSTM input sequence is non-linearly labeled. Based on the determined data indices, priority weight labels or position index mappings are added to the thermally inertial correlated data frames without changing the original time order. This guides the model to pay more attention to these time segments during training. Specific operations include labeling the matrix slice range, recording the start and end indices of the thermally inertial segments, and their offset positions relative to the sequence, ultimately obtaining the time-segment sequence reconstruction structure table.
[0029] S303: Based on the time period sequence, reconstruct the data frame index structure and adjust the order information in the structure table, update the input sequence of the LSTM model, restore the data frame in the sequence structure position and connect the content to obtain the input time period sequence structure table; First, the input layer data of the original LSTM model is replaced with the reconstructed data sequence. The network structure containing an input layer, two hidden layers, and an output layer is used for training. The operation logic of the forget gate, input gate, and output gate is defined inside the hidden layer. For example, the forget gate uses the Sigmoid function to process the weighted sum of the hidden state at the previous time step and the current input. The Adam optimizer is used to update the parameters and the mean squared error is set as the loss function. The reconstructed sequence is input into the network and the gating mechanism is used to capture the thermal inertia features located at the beginning of the sequence first. After 50 rounds of training, the prediction results are output. According to the adjustment order information, the data frames are restored to their original time positions in reverse order. The data frames are restored to their positions in the sequence structure and the content is matched. Finally, the input time period sequence structure table is obtained.
[0030] Please see Figure 5 The specific steps of S4 are as follows: S401: Based on the time period content listed in the input time period sequence structure table, extract the load forecast output data frame and the corresponding actual power change data frame within the time period, and compare the trend on the time index to obtain the forecast offset time period index set. First, based on the time period content listed in the input time period sequence structure table, the load forecast output data frame and the corresponding actual power change data frame within the time period are extracted. The magnitude and trend of the two are compared step by step. The relative prediction error at each time point is calculated, which is the absolute value of the difference between the predicted value and the actual value divided by the actual value. If the relative error is greater than 10%, it is marked as a potential offset point. The first difference between the prediction curve and the actual curve at that point, i.e., the slope, is further calculated. If the two have opposite signs, it is determined that the trend is diverging. The time period with more than 3 consecutive potential offset points or trend divergence points is defined as the prediction offset time period, and these consecutive time indices are recorded. Finally, the prediction offset time period index set is obtained.
[0031] S402: Based on the time index of the predicted offset time period index set, extract the power change data frames of the associated energy storage devices in the corresponding time period, determine the continuity and response direction of the power value change of the data frames, and obtain the power response associated index set; First, retrieve the battery management unit records of the associated distributed energy storage devices within the corresponding time window. Focus on analyzing the charging and discharging power change data frames of the energy storage devices to determine whether the energy storage devices performed unplanned power regulation actions during the period when the prediction offset occurred. Calculate the rate of change of battery power during this period. If the absolute value of the power change rate exceeds 2% per minute of the rated power and the power response direction is causally related to the load deviation direction (i.e., the energy storage device is in a charging state when the actual load is greater than the predicted value, or in a discharging state when the actual load is less than the predicted value), then extract the time index that satisfies the above continuous change characteristics and response direction matching conditions. Finally, obtain the power response association index set.
[0032] S403: Based on the time index in the power response association index set, locate the time segment to which the prediction offset period belongs, and classify the continuous time indexes with continuous time intervals and consistent power response directions into the same time segment to obtain a set of correctable time segments. First, the power response associated index set is processed. All timestamps in the index set are traversed and the difference between adjacent timestamps is calculated. If the difference between two adjacent timestamps is equal to the sampling interval of 15 minutes, they are considered as continuous segments. If the difference is greater than the sampling interval, they are considered as breakpoints. The index set is cut into several independent time segments based on the breakpoints. Then, the length of each time segment is checked. If the number of time points contained in the segment is less than 3, i.e. the duration is less than 45 minutes, it is discarded. If it is greater than or equal to 3, it is retained. The start and end boundaries of each segment are determined, and continuous time indices with continuous time intervals and consistent power response directions are grouped into the same time segment. Finally, a set of correctable time segments is obtained.
[0033] Please see Figure 6 The specific steps of S5 are as follows: S501: Based on the set of correctable time segments, retrieve the load change data frames for the corresponding time period from the load forecast output results, extract the power value field from the data frames in segments, and obtain the corrected target load data sequence; First, based on the set of correctable time segments, load change data frames for the corresponding time period are retrieved from the load forecast output. For each correction segment, the corresponding time axis index is locked, and the power forecast value within that time period is extracted from the slice of the forecast data sequence. The forecast curve for the entire 24 hours is divided and only the part that needs to be dynamically adjusted is retained. The extracted power values for these specific time periods are serialized and the original time metadata is retained, finally obtaining the corrected target load data sequence.
[0034] S502: Based on the time index in the corrected target load data sequence, retrieve the power change data frame of the energy storage response behavior in the corresponding time period, and replace the power value in the original data frame point by point with the extracted power data to obtain the response replacement load data sequence. First, each time index in the target load data sequence is read, and the power change data frame of the energy storage response behavior in the corresponding time period is retrieved. Then, the response calibration logic is executed. That is, in the posterior analysis scenario where the measured data has been acquired, the principle of calibrating the power equal to the grid-side gate meter reading that includes the influence of energy storage charging and discharging is adopted to construct the constraint load value sequence required for scheduling evaluation. For example, when the predicted value is 45 kW, but the measured power in that time period is 55 kW due to energy storage charging, then 55 kW is used as the load value on which the scheduling analysis is based to restore the actual dynamic load state, and finally the response replacement load data sequence is obtained.
[0035] S503: Based on the response replacement load data sequence and the data frames not extracted from the load forecast output, locate them according to the original time index sequence, merge and sort the data frames into the forecast period segment, and obtain the dynamic scheduling constraint load forecast result. First, create an empty array with the same length as the original forecast period. Fill the array with the response replacement load data sequence according to its corresponding time index. Then, traverse the data frames that have not been extracted in the load forecast output, locate them according to the original time index sequence and fill them into the remaining empty spaces in the array. After all data is filled, perform an ascending sort check based on timestamps to ensure the continuity and monotonically increasing nature of the time axis. This merges and sorts the data frames into the forecast period segment, and finally obtains the dynamic scheduling constraint load forecast result.
[0036] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for load forecasting and dynamic scheduling of green building microgrids based on LSTM, characterized in that, Includes the following steps: S1: Obtain the operation data of lighting, air conditioning and charging piles in the green building microgrid, extract the power change value, and merge the equipment data corresponding to the building zone into the target data column to obtain the load trend sample sequence set; S2: Based on the power change content of the centralized air conditioning equipment in the load trend sample sequence, extract the start time point and compare it with the room temperature change time, identify the lag time segment, and associate it with the area where the equipment is located to obtain the set of thermal inertia-related load time periods; S3: Based on the set of thermal inertia-related load time periods, find the corresponding time period in the original LSTM input sequence, move the segment data to the beginning of the sequence, update the time period order of the input sequence, and obtain the input time period order structure table. S4: Based on the input time period sequence structure table, extract the predicted output results and compare them with the measured power values of the same time period, locate the predicted value offset position, check the section energy storage operation record, and obtain the set of correctable time sections. S5: Based on the set of correctable time segments, extract the power value of the corresponding energy storage behavior record to replace the original predicted value of the time segment, and incorporate the data of the time segment that was not extracted into the correction structure to obtain the dynamic scheduling constraint load prediction result.
2. The method for load forecasting and dynamic scheduling of green building microgrids based on LSTM according to claim 1, characterized in that, The load trend sample sequence set includes lighting load trend subsequence, air conditioning load trend subsequence, charging pile load trend subsequence, sampling timestamp sequence, and load set index key. The thermal inertia-related load time period set includes temperature lag time period identifier, lag duration, thermal inertia intensity level, hot zone code, and start-stop association pair. The input time period sequence structure table includes time period number chain, inter-segment sequence relationship matrix, shift offset field, preceding segment mark, and sequence consistency check item. The correctable time segment set includes offset type identifier, offset amplitude parameter, energy storage response association mark, charging and discharging status code, and correction priority. The dynamic scheduling constraint load prediction result includes the replaced predicted power sequence, scheduling constraint flag, energy storage coupling prediction component, prediction period time axis, and time period correction record table.
3. The method for load forecasting and dynamic scheduling of green building microgrids based on LSTM according to claim 1, characterized in that, The target data column refers to the load trend sample sequence after regional integration; The lag time interval refers to the time interval during which the change in air conditioning power precedes the temperature response.
4. The method for load forecasting and dynamic scheduling of green building microgrids based on LSTM according to claim 1, characterized in that, The predicted numerical offset position refers to the time period during which the predicted result is inconsistent with the measured data; The correction structure refers to the load forecast output structure generated after adjusting the offset prediction value using energy storage data.
5. The method for load forecasting and dynamic scheduling of green building microgrids based on LSTM according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Obtain power data of lighting equipment, air conditioning equipment and charging piles in the green building microgrid, set a uniform time sampling interval, number each type of power data in time sequence, and match time items with power values to obtain data entries of the three types of equipment distributed in time sequence. S102: Based on the equipment number information in the data entries of the three types of equipment distributed in time sequence, retrieve the deployment area with the corresponding number in the building area deployment list, and group the data entries of the same type of equipment belonging to the same area according to the equipment category to obtain the equipment power distribution structure dataset of the region. S103: Based on the device power distribution structure dataset of the sub-regions, the time field in the power data is horizontally aligned, and according to the device category information and deployment area, it is decomposed and assigned into corresponding time series data content to obtain the load trend sample sequence set.
6. The method for load forecasting and dynamic scheduling of green building microgrids based on LSTM according to claim 1, characterized in that, The specific steps of S2 are as follows: S201: Based on the power data of the air conditioning equipment in the load trend sample sequence set, monitor the time index position where the power value changes from static to fluctuating, verify the direction of change of continuous power sampling points, and obtain the set of power change start times; S202: Based on the time range corresponding to the set of power change start times, extract the indoor temperature sampling data within the time period, analyze the trend segment of decreasing temperature change rate under continuous time index, and obtain the set of temperature change lag time. S203: Based on the set of power change start times and the set of temperature change delay times, and by analyzing the temporal distribution relationship, identify the time period before the temperature response, and extract the deployment area information of the associated air conditioning equipment, to obtain the set of thermal inertia associated load time periods.
7. The LSTM-based method for load forecasting and dynamic scheduling of green building microgrids according to claim 6, characterized in that, During the process of monitoring the power data content of the air conditioning equipment, the power value changes from static to fluctuating at the time index position: it is determined that the power change amplitude under the continuous time index remains fluctuating and shows a continuous offset in the same direction, and the start time of the power change is verified. In the process of verifying the direction of change of continuous power sampling points: analyze the trend of increase and decrease of power sampling values under adjacent time indices, and identify segments with continuous upward and downward changes; In the process of analyzing the decreasing trend segment of temperature change rate under continuous time index: compare the change rate of adjacent temperature sampling points, identify the segment where the second derivative of the change rate is less than a preset threshold and slows down and continues for no less than a preset minimum duration.
8. The method for load forecasting and dynamic scheduling of green building microgrids based on LSTM according to claim 1, wherein the specific steps of S3 are as follows: S301: Based on the thermal inertia-related load time period set, retrieve the data index position that matches the time period range from the original LSTM input sequence, locate the corresponding time period data frame content and map the index to obtain the original time period mapping structure table; S302: Based on the data index in the original time period mapping structure table, the corresponding data frame is moved sequentially along the original sequence direction to the segment at the starting position to obtain the time period sequence reconstruction structure table; S303: Based on the data frame index structure and adjustment order information in the time period sequence reconstruction structure table, update the input sequence of the LSTM model, restore the data frame in the sequence structure position and connect the content to obtain the input time period sequence structure table.
9. The method for load forecasting and dynamic scheduling of green building microgrids based on LSTM according to claim 1, characterized in that, The specific steps of S4 are as follows: S401: Based on the time period content listed in the input time period sequence structure table, extract the load prediction output data frame and the corresponding actual power change data frame within the time period, and compare the trend on the time index to obtain the prediction offset time period index set. S402: Based on the time index of the predicted offset time period index set, extract the power change data frames of the associated energy storage devices in the corresponding time period, determine the continuity and response direction of the power value change of the data frames, and obtain the power response associated index set; S403: Based on the time index in the power response association index set, locate the time segment to which the power response belongs within the predicted offset period, and group the continuous time indexes with continuous time intervals and consistent power response directions into the same time segment to obtain a set of correctable time segments.
10. The LSTM-based method for load forecasting and dynamic scheduling of green building microgrids according to claim 1, characterized in that, The specific steps of S5 are as follows: S501: Based on the set of correctable time segments, retrieve the load change data frame corresponding to the time period from the load forecast output result, extract the power value field in the data frame segment by segment, and obtain the corrected target load data sequence; S502: Based on the time index in the modified target load data sequence, retrieve the power change data frame of the energy storage response behavior in the corresponding time period, and replace the power value in the original data frame with the extracted power data point by point to obtain the response replacement load data sequence. S503: Based on the response replacement load data sequence and the unextracted data frames in the load prediction output results, locate them according to the original time index sequence, merge and sort the data frames into the prediction period segment, and obtain the dynamic scheduling constraint load prediction result.