Green building micro-grid ems optimal operation method and system based on source network load storage cooperation
By aligning multi-source energy management data, constructing a time synchronization sequence and performing sliding window statistics, and combining communication latency and converter capabilities, a segmented active power reference trajectory for energy storage is generated. This solves the problems of equipment wear and system oscillation caused by timing misalignment in existing technologies, and realizes the efficient and safe operation of green building microgrids.
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-05-29
AI Technical Summary
Existing technologies, when processing multi-source energy management data, neglect the timing misalignment caused by differences in data sampling frequencies between devices and network transmission delays. This results in a lack of strict correspondence between scheduling plans and actual operating data, making it easy for frequent and ineffective power adjustments to be induced by noise in single-point data. Furthermore, the lack of a real-time verification mechanism leads to increased equipment wear and system oscillations.
By acquiring the time-sharing scheduling plan and real-time operation data of the green building microgrid and performing linear interpolation alignment, a time-synchronized operation data sequence is constructed. The SOC deviation sign is statistically analyzed using the sliding window algorithm. An executable time window is constructed by combining communication latency and converter capability. A segmented active power reference trajectory for energy storage is generated. Closed-loop control is then performed through sequence number verification and readback check.
It effectively eliminates timing deviations, shields against fluctuation misjudgments, identifies drift trends, avoids damage to batteries from step impacts, and achieves closed-loop management of the entire power grid, source, load, and energy storage chain, thereby improving the energy efficiency and safety of green building microgrids.
Smart Images

Figure CN122118903A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy management technology, and in particular to a method and system for optimizing the operation of green building microgrids (EMS) through source-grid-load-storage coordination. Background Technology
[0002] Energy management technology refers to a set of technologies surrounding the operation monitoring, energy consumption forecasting, energy dispatching, and emission accounting of buildings and their microgrid energy systems. Its core aspects include data collection and status identification of photovoltaic power generation, energy storage units, building electricity load, charging pile load, and grid-connected power exchange. Based on electricity pricing mechanisms, equipment operating constraints, and supply-demand balance, energy allocation strategies are formulated. This involves a methodological control approach to the entire energy management process, including collecting and comparing electricity metering data and equipment status parameters, predicting and generating daily load curves and photovoltaic output curves, constraining energy storage charging and discharging plans with grid-connected power curves, and statistically calculating building energy consumption and carbon emission factors. Among these, traditional green buildings with coordinated generation, grid, load, and storage systems are a key component. The microgrid EMS optimization operation method refers to the operation and control method for unified scheduling of the power relationship between the source-side distributed power sources, grid-side grid-connected interfaces, load-side adjustable loads, and energy storage units in green building scenarios. It targets the coordinated scheduling of multi-source energy, the location of abnormal energy consumption, and the formulation of operation strategies. Traditional methods rely on threshold comparison and time-series statistics based on the sub-item energy consumption data, inverter output data, energy storage SOC data, and charging pile power data collected by electricity meters. They also formulate daily power plans based on time-of-use electricity prices and equipment operation upper and lower limit constraints. The operation strategy is formed and executed by means of scheduling start-stop of load adjustable periods, scheduling energy storage charging and discharging periods, limiting the grid-connected switching power, and tracing back and locating energy consumption anomalies.
[0003] Existing technologies, when processing multi-source energy management data, rely solely on threshold comparisons using instantaneous data collected from electricity meters and device ports. This ignores the timing discrepancies caused by differences in data sampling frequencies between different devices and network transmission delays. Consequently, scheduling plans and actual operational data lack strict correspondence on the timeline, easily leading to false power deviations calculated at asynchronous points. Traditional control logic triggers actions based solely on single-moment out-of-limit states, lacking statistical identification of long-term error evolution trends. When facing random fluctuations in photovoltaic output due to cloud cover or instantaneous impacts on the load side, it is prone to frequent and ineffective power adjustments induced by single-point data noise, exacerbating mechanical wear and electrical stress on equipment. Because the real-time round-trip delay of the communication network and the dynamic response characteristics of the energy storage converter are not included in the constraints when formulating strategies, dispatch commands often exceed the current physically executable time or power window of the equipment, causing adjustment lags or even system oscillations. The lack of flexible constraints on the rate of change of power commands leads to the direct issuance of step-like target values when correcting large deviations, causing current surges in the battery system and accelerating the aging of energy storage units. Relying solely on periodic data collection for result backtracking lacks a real-time handshake and verification mechanism at the command level. When communication packet loss or execution blockage occurs, the failure status cannot be detected in time, causing the system to operate outside the established strategy for a long time, reducing the overall energy efficiency and safety of green building microgrids. Summary of the Invention
[0004] To address the technical problems existing in the prior art, embodiments of the present invention provide an optimized operation method for a green building microgrid EMS with source-grid-load-storage coordination, comprising the following steps: S1: Obtain the green building microgrid time-sharing scheduling plan and the real-time operation data of the source-grid-load-storage system, and use linear interpolation to align the green building microgrid time-sharing scheduling plan with the real-time operation data of the source-grid-load-storage system to construct a time-synchronized operation data sequence; S2: Calculate the active power tracking error based on the time-synchronized running data sequence, monitor the communication round-trip delay, use the sliding window algorithm to count the SOC deviation sign, and calculate the deviation direction consistency count; S3: When the deviation direction consistency count reaches the preset threshold, compare the active power tracking error with the consistency threshold, determine the execution status based on the communication round-trip delay, and combine the converter regulation capability to retrieve the time slice that meets the limiting, and construct the energy storage executable time window; S4: Calculate the distance from SOC to SOC safety threshold based on the energy storage executable time window, lock the risk point of exceeding the boundary according to the SOC trend, and generate the energy storage segmented active power reference trajectory using the slope limit algorithm and the upper limit of the planned power change rate. S5: The active power reference trajectory of the energy storage segment is encapsulated into a source-grid-load-storage coordinated control command with a serial number and sent out. The serial number of the verification frame is compared and verified. The active power reference trajectory of the energy storage segment is used to check the power back and generate a closed-loop power control deviation state.
[0005] As a further embodiment of the present invention, the time-synchronized operation data sequence includes a unified time scale, interpolated scheduling plan values, and aligned source-grid-load-storage operation parameters; the deviation direction consistency count includes polarity statistics within a sliding window, deviation sign sequence, and cumulative count status; the energy storage executable time window includes adjustment start time, adjustment end time, window duration, and adjustment power range; the energy storage segmented active power reference trajectory includes trajectory segment nodes, power change slope, and target power setpoint; and the closed-loop power control deviation status includes command landing verification identifier, power tracking residual, and closed-loop verification conclusion.
[0006] As a further aspect of the present invention, the active power tracking error is the difference between the planned active power at the grid connection point of the green building microgrid and the active power measured in real time at the grid connection point. The communication round-trip delay is the time difference between the time when the source-grid-load-storage coordinated control command is sent and the time when the readback confirmation frame containing the corresponding sequence number is received. The executability of the control command is determined based on whether the communication round-trip delay is less than a preset delay threshold.
[0007] As a further aspect of the present invention, the sliding window algorithm performs statistical analysis based on the SOC deviation symbol sequence obtained by continuous sampling. When the consistent count of SOC deviation symbols within the window reaches a preset threshold, it is determined that the energy storage SOC deviation direction is persistent and triggers power correction. At the same time, combined with the maximum charging and discharging power limit of the energy storage converter and the power ramp-up rate constraint, a set of time slices that meet the limiting conditions is retrieved, and the set of time slices is used to construct an executable time window for energy storage.
[0008] As a further aspect of the present invention, the specific steps of S1 are as follows: S101: Monitor the edge gateway communication interface to receive the green building microgrid time-sharing scheduling plan issued by the microgrid EMS, synchronously scan the BMS and inverter reporting ports to collect real-time operation data of source, grid, load and storage, parse the discrete instruction time points in the scheduling plan and the continuous sampling timestamps of real-time data, map the power scheduling instructions and operating status parameters to the original time axis, and aggregate to generate heterogeneous source and load original datasets. S102: Call the original dataset of heterogeneous source and load, set the time axis of the scheduling plan as the reference sequence, retrieve the time position that does not coincide with the reference sequence, calculate the ratio of the numerical difference to the time difference of adjacent sampling points before and after the position, calculate the increment in combination with the time interval and add it to the value of the previous sampling point, reconstruct the values of asynchronous sampling points, and obtain the time alignment correction feature set. S103: Based on the time-aligned correction feature set, the reconstructed operating status values and the power command values in the original scheduling plan are concatenated on the same reference time axis to construct a joint feature vector including command dimension and status dimension. The joint feature vector is arranged and encapsulated in a forward ascending order of the time axis to establish a time-synchronized operating data sequence.
[0009] As a further aspect of the present invention, the specific steps of S2 are as follows: S201: Based on the time-synchronized running data sequence, extract the measured active power and planned power values, perform differential operation to quantify the active power tracking error, synchronously send link probe frames and calculate the round-trip time difference of data packets, associate the active power tracking error and communication delay data according to the time index, and generate an active power tracking error and communication delay set. S202: Call the time index associated with the active power tracking error and communication delay set, parse the real-time value and planned value of SOC from the time synchronization operation data sequence, calculate the difference and construct a time sliding window, use the sign function to perform polarity mapping on the difference within the window, convert the value into discrete direction identifier, and generate a sliding window SOC deviation polarity sequence. S203: Based on the sliding window SOC deviation polarity sequence, traverse the discrete direction markers within the window, identify continuous data segments that maintain the same polarity, accumulate the number of times the same deviation direction continuously appears, quantify the unidirectional duration and remove the flip points, calculate the cumulative number of points with constant polarity, and obtain the deviation direction consistency count.
[0010] As a further aspect of the present invention, the specific steps of S3 are as follows: S301: Based on the deviation direction consistency count, compare the cumulative value with the preset threshold. If the condition is met, call the active power tracking error and communication delay set, verify the power error amplitude and detect the communication round-trip delay, determine the logic execution permission based on the delay data, output the trigger flag and link indicator set, and generate the trigger status and link evaluation set. S302: Call the trigger state and link evaluation set, filter the time that meets the error and delay requirements, load the rated parameters of the energy storage converter, calculate the equipment adjustment power margin, match the margin with the command requirements, search for the continuous time interval that meets the physical limit and remove the over-limit points to obtain the power limit constraint time slice. S303: Based on the power limiting constraint time slice, perform time-domain aggregation on discrete intervals that meet the conditions, merge adjacent time intervals to construct a continuous time period, define the start and end boundaries of the time period, map them to the microgrid scheduling plan time axis, establish the effective range of regulation, and establish an executable time window for energy storage.
[0011] As a further aspect of the present invention, the specific steps of S4 are as follows: S401: Based on the energy storage executable time window, retrieve the real-time state of charge of the battery within the window coverage period, obtain the preset safety upper and lower limit thresholds, calculate the absolute difference between the real-time value and the threshold, quantify the remaining capacity space of the battery energy state from the safety boundary, arrange the difference data by time index, and generate the SOC safety boundary remaining distance set. S402: Call the remaining distance set of the SOC safety boundary, perform first-order difference operation to extract the numerical change rate to determine the evolution direction, filter critical data points whose direction points to the safety boundary and whose remaining space is less than the warning value, lock the corresponding moment when the state of charge exceeds the safety threshold, and establish a sequence of SOC over-limit risk anchor points. S403: Based on the SOC over-limit risk anchor point sequence, obtain the maximum power ramp rate of the energy storage converter, perform gradient constraints on the power commands before and after the risk moment, force the power jump amplitude of adjacent moments to meet the rate constraint, and splice the corrected value with the original command on the time axis to generate the energy storage segmented active power reference trajectory.
[0012] As a further aspect of the present invention, the specific steps of S5 are as follows: S501: Based on the energy storage segmented active power reference trajectory, generate a monotonically increasing decimal sequence number, convert the trajectory power parameters into a hexadecimal byte stream, encapsulate the sequence number into the control frame load field, calculate the check code and send it to the inverter via the downlink channel to generate a source-grid-load-storage coordinated control command. S502: Invoke the source-grid-load-storage coordinated control command, capture the verification frame returned by the inverter, extract the feedback sequence number in the frame and compare it with the original sequence number, verify the integrity of the command in the transmission layer and the receiving status at the device end, verify the command is written to the logic flag of success, and obtain the command landing verification feedback. S503: Based on the verification feedback of the command landing, the inverter real-time readback active power is collected and compared with the active power reference trajectory of the energy storage segment at the same time coordinate. The algebraic difference between the measured value and the reference benchmark is calculated, the closed-loop regulation accuracy is quantified, and the closed-loop power control deviation status is established.
[0013] The green building microgrid EMS optimized operation system with source-grid-load-storage coordination includes: The data timing alignment module is used to execute S1: obtain the green building microgrid time-sharing scheduling plan issued by the microgrid EMS through the edge gateway, collect the source-grid-load-storage real-time operation data reported by the BMS and inverter, and use the linear interpolation algorithm to time-align the green building microgrid time-sharing scheduling plan with the source-grid-load-storage real-time operation data to construct a time-synchronized operation data sequence; The deviation feature statistics module is used to perform S2: calculate the active power tracking error between the measured power and the planned power based on the time-synchronized running data sequence, monitor the edge gateway communication round-trip delay during data transmission, call the sliding window algorithm to perform sign statistics on the SOC deviation in the time-synchronized running data sequence, and calculate the deviation direction consistency count. The adjustment window construction module is used to execute S3: when the deviation direction consistency count reaches the preset threshold, the active power tracking error is compared with the consistency threshold, the execution status is determined based on the communication round-trip delay, and the continuous time slice that meets the power limit is retrieved in combination with the converter adjustment capability to construct the energy storage executable time window; The power trajectory generation module is used to execute S4: within the energy storage executable time window, calculate the remaining distance for the measured SOC to reach the SOC safety threshold, lock the risk point of exceeding the boundary based on the SOC change trend direction, and call the slope limit algorithm to generate the energy storage segmented active power reference trajectory based on the upper limit of the planned power change rate. The closed-loop control verification module is used to execute S5: encapsulate the active power reference trajectory of the energy storage segment into a source-grid-load-storage coordinated control command with an incrementing sequence number and send it out; compare the sequence number in the verification frame returned by the inverter to verify the command landing status; perform closed-loop verification based on the active power reference trajectory of the energy storage segment and the real-time readback power to generate the closed-loop power control deviation status.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, linear interpolation is used to eliminate timing deviations and construct a synchronous data sequence. The SOC deviation sign is statistically analyzed using a sliding window to shield against fluctuation misjudgments and identify drift trends. An adjustable window is constructed by combining communication latency and converter capability. A smooth correction trajectory is generated using slope constraints to avoid step impact damage to the battery. Two-way verification and readback check of serial numbers are embedded to eliminate open-loop blind spots and perform closed-loop management of the entire source-grid-load-storage chain. 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; Figure 7 This is a system module diagram 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 an optimized operation method for a green building microgrid EMS with source-grid-load-storage coordination, comprising the following steps: S1: Obtain the green building microgrid time-sharing scheduling plan issued by the microgrid EMS through the edge gateway, collect the real-time operation data of source, grid, load and storage reported by BMS and inverter, and use the linear interpolation algorithm to time-align the green building microgrid time-sharing scheduling plan with the real-time operation data of source, grid, load and storage to construct a time-synchronized operation data sequence; S2: Calculate the active power tracking error between the measured power and the planned power based on the time-synchronized running data sequence, monitor the edge gateway communication round-trip delay during data transmission, call the sliding window algorithm to perform sign statistics on the SOC deviation in the time-synchronized running data sequence, and calculate the deviation direction consistency count. S3: When the deviation direction consistency count reaches the preset threshold, compare the active power tracking error with the consistency threshold, determine the execution status based on the communication round-trip delay, and combine the converter regulation capability to retrieve the continuous time slice that meets the power limit and construct the energy storage executable time window. S4: Calculate the remaining distance for the measured SOC to reach the SOC safety threshold within the energy storage executable time window, lock the risk point of exceeding the limit based on the SOC change trend direction, and call the slope limit algorithm to generate the energy storage segmented active power reference trajectory based on the upper limit of the planned power change rate. S5: Encapsulate the active power reference trajectory of the energy storage segment into the source-grid-load-storage coordinated control command with an incrementing sequence number and send it out. Compare the sequence number in the verification frame returned by the inverter to verify the command landing status. Perform closed-loop verification based on the active power reference trajectory of the energy storage segment and the real-time readback power to generate the closed-loop power control deviation status.
[0020] The time-synchronized operation data sequence includes a unified time scale, interpolated scheduling plan values, and aligned source-grid-load-storage operation parameters. The deviation direction consistency count includes polarity statistics within the sliding window, deviation sign sequence, and cumulative count status. The energy storage executable time window includes the adjustment start time, adjustment end time, window duration, and adjustment power range. The energy storage segmented active power reference trajectory includes trajectory segment nodes, power change slope, and target power setpoint. The closed-loop power control deviation status includes command landing verification flags, power tracking residuals, and closed-loop verification conclusions.
[0021] Please see Figure 2 The specific steps of S1 are as follows: S101: Monitor the edge gateway communication interface to receive the green building microgrid time-sharing scheduling plan issued by the microgrid EMS, synchronously scan the BMS and inverter reporting ports to collect real-time operation data of source, grid, load and storage, parse the discrete instruction time points in the scheduling plan and the continuous sampling timestamps of real-time data, map the power scheduling instructions and operating status parameters to the original time axis, and aggregate to generate heterogeneous source and load original datasets. Upon receiving the time-sharing dispatch plan from the microgrid EMS, the system checks the plan number, start and end times, time granularity, instruction object identifier, and active power setpoint sequence at each time point according to the message field order. If any field is missing or has an abnormal length, the frame is discarded and written to the anomaly index. Subsequently, parallel polling and data acquisition operations are performed between the BMS reporting port and the inverter reporting port, with a polling period of 20 milliseconds. Each poll reads the timestamp, measured active power, AC voltage, AC current, frequency, state of charge, charging / discharging direction, operating mode, and alarm code, while simultaneously recording the received timestamp of this poll. Next, a time-point parsing operation is performed, converting the discrete instruction times of the dispatch plan into millisecond timestamps and writing the continuous sampling timestamps into a buffer queue in arrival order. Then, a time axis mapping operation is performed, constructing an index table with millisecond timestamps as keys. Instruction values and status values are written to the same key position, and a null value marker is written when only instructions or only status values are encountered. Finally, a heterogeneous aggregation write operation is performed, aggregating the source-side status, grid-side status, load-side status, and storage-side status into a single record based on the same timestamp, forming a heterogeneous source-load raw dataset. In the example, timestamp 1705152000000 corresponds to a planned active power of 120.0 kW, an actual measured active power of 118.6 kW, a voltage of 400.8 V, a frequency of 49.98 Hz, and a state of charge of 62.4%. Timestamp 1705152000020 only has status reporting, so the planned active power in that row is marked as null while the status field is retained.
[0022] S102: Call the original dataset of heterogeneous source and load, set the time axis of the scheduling plan as the reference sequence, retrieve the time position that does not coincide with the reference sequence, calculate the ratio of the numerical difference to the time difference of adjacent sampling points before and after the position, calculate the increment in combination with the time interval and add it to the value of the previous sampling point, reconstruct the values of asynchronous sampling points, and obtain the time alignment correction feature set. The scheduling plan timeline is set as the baseline reference sequence, with the baseline point being the set of millisecond timestamps at the boundary of each plan time granularity. Then, the original dataset timestamps are iterated line by line, retrieving time positions that do not overlap with the baseline reference sequence and have null value markers. These are added to the list to be reconstructed, and the previous and next valid sampling points are searched in the same field. Next, a numerical reconstruction operation is performed on each point to be reconstructed. First, the difference between the next valid value and the previous valid value is taken to obtain the numerical difference. Then, the difference between the next valid timestamp and the previous valid timestamp is taken to obtain the time difference. The ratio of the numerical difference and the time difference is used to obtain the unit time increment. Then, the interval between the timetamp to be reconstructed and the previous valid timestamp is taken, the increment is calculated according to the unit time increment, and added to the previous valid value, and written to the time point field to be reconstructed. The above reconstruction is performed sequentially for planned active power, measured active power, voltage, current, frequency, and state of charge. For operating mode and alarm code, a proximity hold operation is performed, directly writing the previous valid value. In the example, the previous instruction point 1705152000000 has a power of 120.0 kW, and the next instruction point 1705152900000 has a power of 130.0 kW. The point to be reconstructed, 1705152000020, is 20 milliseconds away from the previous instruction point. Substituting the difference between the two points and the time difference into the unit time increment logic, and then adding them to 120.0 kW, we get approximately 120.00022 kW written at that moment. After completion, the timing alignment correction feature set is output, and a reconstruction flag of 0 or 1 is written to each field.
[0023] S103: Based on the time-series alignment correction feature set, the reconstructed running status values and the power command values in the original scheduling plan are concatenated on the same reference time axis to construct a joint feature vector including command dimension and status dimension. The joint feature vector is arranged and encapsulated in the forward ascending order of the time axis to establish a time-synchronized running data sequence. Under the same reference time axis, a feature concatenation operation is performed, writing the scheduling plan instruction value and the reconstructed operating status value into the same joint record. The concatenation order is fixed: first, the planned active power and instruction activation flag are written in the instruction dimension, followed by the measured active power, measured reactive power, AC voltage, AC current, frequency, state of charge, charging / discharging direction, operating mode, alarm code, and communication round-trip delay in the status dimension; if a field is still missing, the most recent valid value is written, and the missing value flag is retained. Subsequently, a joint feature vector is constructed for each reference time point. The vector length and field units are fixed, and the values are retained to 3 decimal places. Discrete fields are written according to predefined codes. The charging / discharging direction code is 1 for discharging, -1 for charging, and 0 for zero power. Then, the sorting and encapsulation operations are performed in ascending order of the time axis, sorting the joint feature vector by millisecond timestamp in ascending order, and writing it into the header and data segment of the time-synchronized running data sequence file. The file header writes the sequence start and end times, time granularity, field list, and unit list. In the example, record 1705152000000 records the planned value of 120.0 kW and the activation flag 1, and then records the measured values of 118.6 kW, 400.8 V, 49.98 Hz, 62.4% state of charge, and 18.0 ms round-trip time. Record 1705152000020 records the planned reconfiguration value of 120.00022 kW and the activation flag 0, and writes the corresponding reconfiguration flag.
[0024] Please see Figure 3 The specific steps of S2 are as follows: S201: Based on the time-synchronized running data sequence, extract the measured active power and planned power values, perform differential operation to quantify the active power tracking error, synchronously send link probe frames and calculate the round-trip time difference of data packets, associate the active power tracking error and communication delay data according to the time index, and generate an active power tracking error and communication delay set. First, read the measured active power and planned active power record by record according to the time index, perform unit consistency verification, and unify them to kilowatts. Then, perform a differential operation on each record, taking the algebraic difference between the measured active power and the planned active power to obtain the active power tracking error, retaining the sign and 3 decimal places. Simultaneously execute link probe frame sending and receiving operations, sending probe frames under the same time index, writing the current millisecond timestamp and an incrementing counter number into the probe frame payload. After receiving the return frame, take the difference between the return arrival timestamp and the sending timestamp to obtain the round-trip time, with the delay unit in milliseconds and retaining 1 decimal place. Then, perform a time index association write operation, writing the active power tracking error and the round-trip time into a record according to the same time index, generating an active power tracking error and communication delay set. In the example, the planned power at time 1705152900000 was 130.0 kW, while the actual measured power was 127.1 kW. Substituting these values into the difference logic yielded -2.9 kW. Since the round-trip time of the probe frame at the same moment was 22.0 milliseconds, the write error for this record was -2.9 kW and the delay was 22.0 milliseconds. Repeating this process over consecutive time periods creates an error and delay sequence that can be directly retrieved via a sliding window.
[0025] S202: Call the time index associated with the active power tracking error and communication delay set, parse the real-time value and planned value of SOC from the time-synchronized running data sequence, calculate the difference and construct a time sliding window, use the sign function to perform polarity mapping on the difference within the window, convert the value into discrete direction identifiers, and generate a sliding window SOC deviation polarity sequence. Based on the time index of each record, the time-synchronized running data sequence is retrieved, and the real-time value and planned value of the state of charge (SOC) are parsed. Then, SOC deviation calculation is performed for each time index, taking the algebraic difference between the real-time value and the planned value to obtain the SOC deviation value. Next, a time sliding window is constructed, with a window length of 30 sampling points and a step size of 1 sampling point. The start and end of the window are determined by the time index, and the deviation value sequence is loaded into the window in chronological order. Then, a polarity mapping operation is performed, converting each deviation value in the window into a discrete direction identifier by sign: a deviation greater than 0 is mapped to a positive direction, a deviation less than 0 to a negative direction, and a deviation equal to 0 to a zero direction, and written into the polarity sequence using numerical codes 1, -1, and 0. Non-numerical fields are quantized in this process, with only three quantization standards used and bound to the time index. In the example, the planned state of charge (SOC) percentage within a certain window is 61.5%, and the real-time values are 61.8%, 61.7%, 61.6%, and 61.4% respectively. The deviations are 0.3%, 0.2%, 0.1%, and -0.1% respectively, and the corresponding direction codes are 1, 1, 1, and -1 respectively. The window start timestamp and end timestamp are written into the window record together to form a sliding window SOC deviation polarity sequence.
[0026] S203: Based on the sliding window SOC deviation polarity sequence, traverse the discrete direction markers within the window, identify continuous data segments that maintain the same polarity, accumulate the number of times the same deviation direction appears continuously, quantify the unidirectional duration and remove the flip points, calculate the cumulative number of points with constant polarity, and obtain the deviation direction consistency count. First, a discrete direction traversal is performed for each window, reading the direction code point by point in chronological order. Then, continuous segment identification is performed, evaluating whether the current point and the previous point are in the same direction. If their codes are the same and not 0, they are grouped into the same continuous segment, and the count of their occurrence is incremented by 1. If the code changes, a flip mark is written at the point of change, the counting of the previous segment is terminated, and the counting of the new segment begins. If the code is 0, a removal mark is written, and the segment is not counted in any direction segment. Next, the cumulative point count is output for each continuous segment. The cumulative point count is directly used as the deviation direction consistency count, and the cumulative point count is converted to the duration of the unidirectional segment in milliseconds by the sampling period of 20 milliseconds. The sampling point where the flip point is located is not counted in the cumulative point count of any segment; it is only used as a segment boundary timestamp. In the example, the window direction sequence is 1, 1, 1, 1, -1, -1, -1, 0, -1. Therefore, the cumulative point count of the positive direction continuous segment is 4, corresponding to a unidirectional duration of 80 milliseconds; the cumulative point count of the first segment in the negative direction is 2, and the point is removed after encountering 0; the cumulative point count of the second segment in the negative direction is 1. The process outputs a count of consistent deviation directions, corresponding directions, window start and end timestamps, and flip point indexes, which can be directly read for subsequent threshold comparisons.
[0027] Please see Figure 4 The specific steps of S3 are as follows: S301: Based on the consistent counting of deviation direction, the cumulative value is compared with the preset threshold. When the condition is met, the active power tracking error and communication delay set are called to verify the power error amplitude and detect the communication round-trip delay. The logic execution permission is determined based on the delay data, and the trigger flag and link indicator set are output to generate the trigger status and link evaluation set. Based on the consistency of deviation direction counting, a threshold comparison is first performed. The threshold uses a dual condition of cumulative point count threshold and duration threshold. The cumulative point count threshold is set to 150 points, corresponding to a duration of 3000 milliseconds with a sampling period of 20 milliseconds. The threshold value is determined through threshold increment experiments. The experiments set the cumulative point count threshold to 60, 90, 120, 150, 180, and 240, respectively. The false trigger rate and trigger lag are counted on the same 7-day dataset. The threshold group with the lowest false trigger rate and trigger lag not exceeding one scheduling granularity is selected. When the threshold conditions are met, the active power tracking error and communication delay set is called for verification. First, the absolute value of the error amplitude within the trigger window is taken and compared with the error amplitude threshold of 5.0 kW. Then, the round-trip communication delay within the window is taken and compared with the delay threshold of 50.0 milliseconds. The error margin threshold is determined through historical data statistics. The average planned active power over 7 days is approximately 120.0 kW. The allowable deviation is calculated as approximately 4.8 kW using a 4.0% percentage adjustment, rounded up to 5.0 kW. Subsequently, based on latency data, permission is determined. If the maximum round-trip latency within the window is less than or equal to 50.0 milliseconds and the maximum error margin within the window is greater than or equal to 5.0 kW, a trigger flag of 1 is output; otherwise, a trigger flag of 0 is output. Simultaneously, a set of link indicators is output, including the window start and end timestamps, maximum latency, average latency, and maximum error margin. In the example, with 180 consistent counts within the window, a maximum latency of 28.0 milliseconds, and a maximum error of 7.6 kW, the trigger flag is set to 1 and written into the indicator set, forming the trigger status and link evaluation set.
[0028] S302: Call the trigger state and link evaluation set, filter the time that meets the error and delay requirements, load the rated parameters of the energy storage converter, calculate the equipment regulation power margin, match the margin with the command requirements, search for the continuous time interval that meets the physical limit and remove the over-limit points to obtain the power limit constraint time slice. The set of time indices with a trigger flag of 1 and whose error and delay meet the threshold are selected as candidate times. Then, the rated parameters and limit parameters of the energy storage converter are loaded: rated AC active power 100.0 kW, maximum allowable charging power 100.0 kW, maximum allowable discharging power 100.0 kW, minimum controllable power step size 0.5 kW, and maximum ramp rate 20.0 kW / s. Next, the device adjustment power margin is calculated for each candidate time. The current output power and charging / discharging direction of the energy storage side are read. When in the discharging direction, the discharge margin is obtained by subtracting the current discharge power from the maximum allowable discharge power; when in the charging direction, the charging margin is obtained by subtracting the absolute value of the current charging power from the absolute value of the maximum allowable charging power; when at zero power, both margins are taken as the maximum allowable value. The margins are then matched with the command requirements. The command requirements are determined by the algebraic sign and magnitude of the active power tracking error. A negative error matches the discharge margin, and a positive error matches the charging margin. The corresponding margin is compared with the error magnitude; if the margin is greater than or equal to the error magnitude, the physical limit is met. Next, continuous time intervals are searched. Time indices that meet the physical limit are grouped into continuous intervals based on adjacent timestamp differences not exceeding 20 milliseconds. If any point exceeds the limit, the exceeding point is removed and the interval is split. In the example, if the current discharge power is 72.0 kW at a certain moment, the discharge margin is 28.0 kW, and the error amplitude is 7.6 kW and negative, then the limit is met at that moment and the interval is entered. Output power limiting constraint time slices, writing the start and end timestamps, minimum margin, maximum error, and number of points for each segment.
[0029] S303: Based on power limiting constraint time slices, time-domain aggregation is performed on discrete intervals that meet the conditions, adjacent time intervals are merged to construct continuous time periods, the start and end boundaries of the time periods are defined, and they are mapped to the microgrid scheduling plan time axis to establish the effective range of regulation and establish an executable time window for energy storage. Sort by start timestamp, then compare the intervals of adjacent time slices. Merge slices if the interval between the start of a later slice and the end of a previous slice is no more than 1000 milliseconds. After merging, the start boundary is the start of the previous slice, and the end boundary is the end of the later slice. Update the minimum margin within the segment to the smaller of the two minimum margins, and update the maximum error within the segment to the larger of the two maximum errors. Segments with an interval exceeding 1000 milliseconds remain independent. Next, define the boundaries of continuous time periods and output the time period number, start and end timestamps (in milliseconds), duration (in milliseconds), number of coverage points, and constraint flags. Then, map the continuous time periods to the scheduling timeline. The mapping rule is to align the start timestamp downwards to the nearest reference point and the end timestamp upwards to the nearest reference point. If the end timestamp is not greater than the start timestamp after alignment, the segment is discarded. In the example, the continuous time period starts at 1705152000500 milliseconds and ends at 1705152899000 milliseconds. The initial alignment is 1705152000000 milliseconds, and the final alignment is 1705152900000 milliseconds, resulting in an executable segment covering one scheduling cycle. For each segment, a window number and the number of scheduling cycles it covers are written, along with the minimum margin within the window. This forms an executable time window for energy storage. The window can be directly referenced in subsequent calculations of the state-of-charge safety distance and ramp-up correction processes, and all time indices remain consistent with the aforementioned sequence.
[0030] Please see Figure 5 The specific steps of S4 are as follows: S401: Based on the energy storage executable time window, retrieve the real-time state of charge of the battery within the window coverage period, obtain the preset safety upper and lower limit thresholds, calculate the absolute difference between the real-time value and the threshold, quantify the remaining capacity space of the battery energy state from the safety boundary, arrange the difference data by time index, and generate the SOC safety boundary remaining distance set. The data sequence corresponding to the time synchronization operation is extracted based on the start and end timestamps of the window. The real-time SOC value is read record by record, and a range check is performed. Points exceeding 0.0% to 100.0% are removed, and the removal timestamp is recorded. Then, preset safety upper and lower thresholds are read: a lower safety limit of 10.0% and an upper safety limit of 90.0%. Next, the absolute difference between the real-time value and the threshold is calculated for each record. First, the absolute value of the difference between the real-time value and the lower limit is calculated, then the absolute value of the difference between the real-time value and the upper limit is calculated. The smaller value is taken as the remaining distance to the nearest safety boundary, expressed as a percentage. Then, the records are sorted in ascending order by time index, and the timestamp and remaining distance are written into the "Remaining Distance Set for State of Charge Safety Boundary," with the window number written to the same record. In the example, the difference between a state of charge (SBC) of 62.4% and the lower limit is 52.4%, and the difference between SBC and the upper limit is 27.6%, so the remaining distance is taken as 27.6%. Similarly, the difference between a SBC of 11.8% and the lower limit is 1.8%, and the difference between SBC and the upper limit is 78.2%, so the remaining distance is taken as 1.8%. This process is repeated for each sampling point covered by the window, and the output set of remaining distances retains a continuous time series structure, which is used for subsequent differential direction filtering and risk anchor point location.
[0031] S402: Call the remaining distance set of the SOC safety boundary, perform first-order difference operation to extract the numerical change rate to determine the evolution direction, filter critical data points whose direction points to the safety boundary and whose remaining space is less than the warning value, lock the corresponding moment when the state of charge exceeds the safety threshold, and establish the SOC over-limit risk anchor point sequence. For each pair of adjacent records within a window, a first-order difference operation is performed. The algebraic difference between the remaining distance of the latter and the remaining distance of the former is taken to obtain the rate of change. A negative rate of change indicates a decrease in remaining space, while a positive rate of change indicates an increase in remaining space. Records with negative rates of change are then selected as candidate points pointing towards the safety boundary, and a warning value is read. The warning distance is set to 3.0 percentile, determined by replaying historical exceedance events. The distribution of remaining distances in the 10 minutes prior to exceedance is statistically analyzed, and the 5th percentile (approximately 2.7 percentile) is rounded up to 3.0 percentile. Next, the remaining distances of candidate points are compared with 3.0 percentile. Points with remaining distances less than 3.0 percentile are added to the critical data point list. Then, the risk moment is locked. For each critical point, its timestamp, window number, remaining distance, and rate of change are recorded. Up to 150 sampling points are traced back to retrieve the timestamp of the first entry into a range less than 3.0 percentile, which is used as the entry anchor point. The current critical point timestamp is used as the exit anchor point. In the example, the remaining distance within a certain window continuously decreases from 3.4% to 2.8% with a negative rate of change. The timestamp for the first time it falls below 3.0% is written into the anchor point, and the timestamp corresponding to 2.8% is written into the breakout anchor point. The output sequence of SOC exceedance risk anchor points provides time boundaries for subsequent power command gradient constraints.
[0032] S403: Based on the SOC over-limit risk anchor point sequence, obtain the maximum power ramp rate of the energy storage converter, perform gradient constraints on the power commands before and after the risk moment, force the power jump amplitude of adjacent moments to meet the rate constraint, and splice the corrected value with the original command on the time axis to generate the energy storage segmented active power reference trajectory. First, the maximum power ramp rate of 20.0 kW / s is read and converted to an allowable power jump limit of 0.4 kW between adjacent sampling points based on a sampling period of 20 milliseconds. Then, a correction interval is constructed for each risk entry point, taking 150 sampling points forward and 150 sampling points backward to form a continuous time segment. Next, the planned active power sequence is traversed in ascending order within the correction interval. The difference between the planned values at adjacent time points is calculated, and the absolute value is compared with the 0.4 kW upper limit. If the upper limit is exceeded, the reference power at the next time point is corrected to be increased or decreased by the upper limit based on the previous reference power, with the direction consistent with the original difference sign; if the upper limit is not exceeded, the reference power remains the original planned value. During the traversal process, a correction flag of 0 or 1 is written at each time point. In the example, if the original plan was to jump from 120.0 kW to 130.0 kW, and the absolute value of the difference exceeded 0.4 kW, the reference power would be corrected to 120.4 kW. The next sampling point would continue to be corrected to 120.8 kW according to the same logic, until it gradually approaches the original planned value. Subsequently, the reference power within the correction interval and the original planned power outside the interval would be spliced together along the time axis to form a segmented active power reference trajectory for energy storage, and a time index field consistent with the time-synchronized operation data sequence would be retained for direct use in subsequent control command encapsulation, implementation verification, and closed-loop comparison.
[0033] Please see Figure 6 The specific steps of S5 are as follows: S501: Based on the segmented active power reference trajectory of energy storage, a monotonically increasing decimal sequence number is generated, the trajectory power parameters are converted into a hexadecimal byte stream, and the sequence number is combined with the sequence number and encapsulated into the control frame load field. The check code is calculated and sent to the inverter via the downlink channel to generate source-grid-load-storage coordinated control instructions. Based on the segmented active power reference trajectory of energy storage, a monotonically increasing decimal sequence number is first generated, starting at 100000 and incrementing by 1 for each issued command. This sequence number is then bound to a timestamp and written to the command cache. Next, the power values of the reference trajectory are converted into a hexadecimal byte stream. During conversion, the data is first quantized into integer amplitude codes using a scaling factor, with each 0.1 kW corresponding to one amplitude unit. After quantization, high and low byte splitting is performed, and the data is written to the payload field in frame format order. Then, the sequence number byte segment, timestamp byte segment, power byte segment, and operating mode byte segment are written to the control frame payload field, along with the frame header, frame length, and command word fields. Subsequently, a checksum is calculated by accumulating byte-by-byte from the frame header to the end of the payload and using the least significant byte as the checksum, which is written to the frame tail field. Finally, the control frame is transmitted via the downlink channel at a 20-millisecond interval, consistent with the sampling period, and sorted by time index in the transmission queue. In the example, the reference power of 120.4 kW is proportionally quantized to obtain the amplitude code 1204, which is then split and written into the power byte segment. At the same time, the corresponding byte segments of the sequence number 100123 and the timestamp 1705152000020 are also written. The check code is accumulated to the low byte of 178 and written to the end of the frame, forming the source-grid-load-storage coordinated control instruction and writing it into the instruction set.
[0034] S502: Call the source-grid-load-storage coordinated control command, capture the verification frame returned by the inverter, extract the feedback sequence number in the frame and compare it with the original sequence number to verify the integrity of the command in the transmission layer and the receiving status at the device end, verify the logical flag of the command being written successfully, and obtain the command landing verification feedback. After each control frame is sent, a receive window is opened with a duration of 200 milliseconds. Within the window, the inverter's uplink port is monitored to capture verification frames. Upon capture, frame header and frame length checks are performed first. If the check passes, the payload field is parsed and the feedback sequence number field is extracted. The feedback sequence number is then compared with the local original sequence number. If they match, a transport layer consistency flag of 1 is written; otherwise, 0 is written. Next, the verification frame status word field is read and the receive status is checked. If the status code is 0, a write success flag of 1 is written; otherwise, 0 is written and the status code value is recorded. Then, the logical flags are summarized. If both the transport layer consistency flag and the write success flag are 1, the command write verification is considered successful; otherwise, it is considered unsuccessful. The result, along with the timestamp, sequence number, status code, and verification frame round-trip time, is written to the command write verification feedback. In the example, if the sequence number is 100123 and the feedback is still 100123 with a status code of 0, the write is successful. If the status code is 5 or the feedback sequence number is inconsistent, the write is unsuccessful, but the corresponding status code and round-trip time are retained. The feedback establishes a one-to-one correspondence between the instruction set in step 501 and the serial number, and subsequent readback comparisons locate the reference power entries according to this correspondence.
[0035] S503: Based on the command landing verification feedback verification execution status, collect the inverter real-time readback active power, and compare the amplitude with the active power reference trajectory of the energy storage segment under the same time coordinate, calculate the algebraic difference between the measured value and the reference benchmark, quantify the closed-loop regulation accuracy, and establish the closed-loop power control deviation status. For records that fail to pass, an exception list is created and subsequent processing is skipped. Then, for each record that passes, real-time inverter readback is performed. A readback request is initiated 40 milliseconds after the record's timestamp, reading the inverter's real-time active power and binding it to the sequence number, which is then written into the readback sequence. Next, amplitude comparison is performed at the same time coordinate. The corresponding reference power is located in the energy storage segment active power reference trajectory according to the sequence number. The algebraic difference between the readback active power and the reference power is used to obtain the closed-loop power control deviation, retaining the sign and three decimal places. The absolute value of the deviation is then compared with the closed-loop accuracy threshold, set to 1.0 kW. The threshold is determined through continuous 24-hour readback statistics; the 95th percentile of the absolute value of the deviation is approximately 0.92 kW, rounded up to 1.0 kW. The comparison result is written into the accuracy satisfaction flag (1 or 0). Simultaneously, the deviation value, accuracy satisfaction flag, communication round-trip time, and remaining distance of the state-of-charge safety boundary at the same moment are written into the closed-loop power control deviation status. In the example, the reference power of serial number 100123 is 120.4 kW, the readback power is 119.9 kW, the deviation is -0.5 kW, the absolute value of the deviation is 0.5 kW less than or equal to 1.0 kW, the accuracy is satisfied and the flag is written to 1; at the same time, the remaining distance of 27.6% and the round-trip delay of 18.0 milliseconds are written together into this status record.
[0036] Please see Figure 7 The green building microgrid EMS optimized operation system with source-grid-load-storage coordination includes: The data timing alignment module is used to execute S1: obtain the green building microgrid time-sharing scheduling plan issued by the microgrid EMS through the edge gateway, collect the source-grid-load-storage real-time operation data reported by the BMS and inverter, and use the linear interpolation algorithm to time-align the green building microgrid time-sharing scheduling plan with the source-grid-load-storage real-time operation data to construct a time-synchronized operation data sequence; The deviation feature statistics module is used to execute S2: calculate the active power tracking error between the measured power and the planned power based on the time-synchronized running data sequence, monitor the edge gateway communication round-trip delay during data transmission, call the sliding window algorithm to perform sign statistics on the SOC deviation in the time-synchronized running data sequence, and calculate the deviation direction consistency count; The adjustment window construction module is used to execute S3: when the deviation direction consistency count reaches the preset threshold, the active power tracking error is compared with the consistency threshold, the execution status is determined based on the communication round-trip delay, and the continuous time slice that meets the power limit is retrieved in combination with the converter adjustment capability to construct the energy storage executable time window; The power trajectory generation module is used to execute S4: calculate the remaining distance for the measured SOC to reach the SOC safety threshold within the energy storage executable time window, lock the risk point of exceeding the limit based on the SOC change trend direction, and call the slope limit algorithm to generate the energy storage segmented active power reference trajectory based on the upper limit of the planned power change rate. The closed-loop control verification module is used to execute S5: encapsulate the active power reference trajectory of the energy storage segment into the source-grid-load-storage coordinated control command with an incrementing sequence number and send it out; compare the sequence number in the verification frame returned by the inverter to verify the command landing status; perform closed-loop verification based on the active power reference trajectory of the energy storage segment and the real-time readback power to generate the closed-loop power control deviation status.
[0037] 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 optimizing the operation of a green building microgrid EMS with coordinated generation, grid, load, and storage, characterized in that: Includes the following steps: S1: Obtain the green building microgrid time-sharing scheduling plan and the real-time operation data of source, grid, load and storage; perform linear interpolation to align the green building microgrid time-sharing scheduling plan with the real-time operation data of source, grid, load and storage, and construct a time-synchronized operation data sequence. S2: Calculate the active power tracking error based on the time-synchronized running data sequence, monitor the communication round-trip delay, use the sliding window algorithm to count the SOC deviation sign, and calculate the deviation direction consistency count; S3: When the deviation direction consistency count reaches the preset threshold, compare the active power tracking error with the consistency threshold, determine the execution status based on the communication round-trip delay, and combine the converter regulation capability to retrieve the time slice that meets the limiting, and construct the energy storage executable time window; S4: Calculate the distance from SOC to SOC safety threshold based on the energy storage executable time window, lock the risk point of exceeding the boundary according to the SOC trend, and generate the energy storage segmented active power reference trajectory using the slope limit algorithm and the upper limit of the planned power change rate. S5: Encapsulate the energy storage segment active power reference trajectory into a source-grid-load-storage coordinated control command including a sequence number and send it out. Verify the landing of the frame sequence number by comparing and verifying the data. Use the energy storage segment active power reference trajectory and readback power for verification to generate a closed-loop power control deviation state.
2. The method for optimizing the operation of a green building microgrid EMS with source-grid-load-storage coordination according to claim 1, characterized in that, The time-synchronized operation data sequence includes a unified time scale, interpolated scheduling plan values, and aligned source-grid-load-storage operation parameters. The deviation direction consistency count includes polarity statistics within a sliding window, deviation sign sequence, and cumulative count status. The energy storage executable time window includes adjustment start time, adjustment end time, window duration, and adjustment power range. The energy storage segmented active power reference trajectory includes trajectory segment nodes, power change slope, and target power setpoint. The closed-loop power control deviation status includes command landing verification identifier, power tracking residual, and closed-loop verification conclusion.
3. The method for optimizing the operation of a green building microgrid EMS with source-grid-load-storage coordination according to claim 1, characterized in that, The active power tracking error is the difference between the planned active power at the grid connection point of the green building microgrid and the active power measured in real time at the grid connection point. The communication round-trip delay is the time difference between the time when the source-grid-load-storage coordinated control command is sent and the time when the readback confirmation frame containing the corresponding sequence number is received. The executability of the control command is determined based on whether the communication round-trip delay is less than a preset delay threshold.
4. The method for optimizing the operation of a green building microgrid EMS with source-grid-load-storage coordination according to claim 1, characterized in that, The sliding window algorithm is based on the statistical analysis of the SOC deviation symbol sequence obtained by continuous sampling. When the consistent count of SOC deviation symbols within the window reaches a preset threshold, it is determined that the energy storage SOC deviation direction is persistent and triggers power correction. At the same time, combined with the maximum charging and discharging power limit of the energy storage converter and the power ramp-up rate constraint, the set of time slices that meet the limiting conditions is retrieved, and the set of time slices is used to construct the energy storage executable time window.
5. The method for optimizing the operation of a green building microgrid EMS with source-grid-load-storage coordination according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Monitor the edge gateway communication interface to receive the green building microgrid time-sharing scheduling plan issued by the microgrid EMS, synchronously scan the BMS and inverter reporting ports to collect real-time operation data of source, grid, load and storage, parse the discrete instruction time points in the scheduling plan and the continuous sampling timestamps of real-time data, map the power scheduling instructions and operating status parameters to the original time axis, and aggregate to generate heterogeneous source and load original datasets. S102: Call the original dataset of heterogeneous source and load, set the time axis of the scheduling plan as the reference sequence, retrieve the time position that does not coincide with the reference sequence, calculate the ratio of the numerical difference to the time difference of adjacent sampling points before and after the position, calculate the increment in combination with the time interval and add it to the value of the previous sampling point, reconstruct the values of asynchronous sampling points, and obtain the time alignment correction feature set. S103: Based on the time-aligned correction feature set, the reconstructed operating status values and the power command values in the original scheduling plan are concatenated on the same reference time axis to construct a joint feature vector including command dimension and status dimension. The joint feature vector is arranged and encapsulated in a forward ascending order of the time axis to establish a time-synchronized operating data sequence.
6. The method for optimizing the operation of a green building microgrid EMS with source-grid-load-storage coordination according to claim 1, characterized in that, The specific steps of S2 are as follows: S201: Based on the time-synchronized running data sequence, extract the measured active power and planned power values, perform differential operation to quantify the active power tracking error, synchronously send link probe frames and calculate the round-trip time difference of data packets, associate the active power tracking error and communication delay data according to the time index, and generate an active power tracking error and communication delay set. S202: Call the time index associated with the active power tracking error and communication delay set, parse the real-time value and planned value of SOC from the time synchronization operation data sequence, calculate the difference and construct a time sliding window, use the sign function to perform polarity mapping on the difference within the window, convert the value into discrete direction identifier, and generate a sliding window SOC deviation polarity sequence. S203: Based on the sliding window SOC deviation polarity sequence, traverse the discrete direction markers within the window, identify continuous data segments that maintain the same polarity, accumulate the number of times the same deviation direction continuously appears, quantify the unidirectional duration and remove the flip points, calculate the cumulative number of points with constant polarity, and obtain the deviation direction consistency count.
7. The method for optimizing the operation of a green building microgrid EMS with source-grid-load-storage coordination according to claim 1, characterized in that, The specific steps for S3 are as follows: S301: Based on the deviation direction consistency count, compare the cumulative value with the preset threshold. If the condition is met, call the active power tracking error and communication delay set, verify the power error amplitude and detect the communication round-trip delay, determine the logic execution permission based on the delay data, output the trigger flag and link indicator set, and generate the trigger status and link evaluation set. S302: Call the trigger state and link evaluation set, filter the time that meets the error and delay requirements, load the rated parameters of the energy storage converter, calculate the equipment adjustment power margin, match the margin with the command requirements, search for the continuous time interval that meets the physical limit and remove the over-limit points to obtain the power limit constraint time slice. S303: Based on the power limiting constraint time slice, perform time-domain aggregation on discrete intervals that meet the conditions, merge adjacent time intervals to construct a continuous time period, define the start and end boundaries of the time period, map them to the microgrid scheduling plan time axis, establish the effective range of regulation, and establish an executable time window for energy storage.
8. The method for optimizing the operation of a green building microgrid EMS with source-grid-load-storage coordination according to claim 1, characterized in that, The specific steps of S4 are as follows: S401: Based on the energy storage executable time window, retrieve the real-time state of charge of the battery within the window coverage period, obtain the preset safety upper and lower limit thresholds, calculate the absolute difference between the real-time value and the threshold, quantify the remaining capacity space of the battery energy state from the safety boundary, arrange the difference data by time index, and generate the SOC safety boundary remaining distance set. S402: Call the remaining distance set of the SOC safety boundary, perform first-order difference operation to extract the numerical change rate to determine the evolution direction, filter critical data points whose direction points to the safety boundary and whose remaining space is less than the warning value, lock the corresponding moment when the state of charge exceeds the safety threshold, and establish a sequence of SOC over-limit risk anchor points. S403: Based on the SOC over-limit risk anchor point sequence, obtain the maximum power ramp rate of the energy storage converter, perform gradient constraints on the power commands before and after the risk moment, force the power jump amplitude of adjacent moments to meet the rate constraint, and splice the corrected value with the original command on the time axis to generate the energy storage segmented active power reference trajectory.
9. The method for optimizing the operation of a green building microgrid EMS with source-grid-load-storage coordination according to claim 1, characterized in that, The specific steps of S5 are as follows: S501: Based on the energy storage segmented active power reference trajectory, generate a monotonically increasing decimal sequence number, convert the trajectory power parameters into a hexadecimal byte stream, encapsulate the sequence number into the control frame load field, calculate the check code and send it to the inverter via the downlink channel to generate a source-grid-load-storage coordinated control command. S502: Invoke the source-grid-load-storage coordinated control command, capture the verification frame returned by the inverter, extract the feedback sequence number in the frame and compare it with the original sequence number, verify the integrity of the command in the transmission layer and the receiving status at the device end, verify the command is written to the logic flag of success, and obtain the command landing verification feedback. S503: Based on the verification feedback of the command landing, the inverter real-time readback active power is collected and compared with the active power reference trajectory of the energy storage segment at the same time coordinate. The algebraic difference between the measured value and the reference benchmark is calculated, and the closed-loop power control deviation status is established.
10. A green building microgrid EMS optimized operation system with source-grid-load-storage coordination, characterized in that, The system is used to implement the source-grid-load-storage coordinated green building microgrid EMS optimization operation method according to any one of claims 1-9, the system comprising: The data timing alignment module is used to execute S1: obtain the green building microgrid time-sharing scheduling plan issued by the microgrid EMS through the edge gateway, collect the source-grid-load-storage real-time operation data reported by the BMS and inverter, and use the linear interpolation algorithm to time-align the green building microgrid time-sharing scheduling plan with the source-grid-load-storage real-time operation data to construct a time-synchronized operation data sequence; The deviation feature statistics module is used to perform S2: calculate the active power tracking error between the measured power and the planned power based on the time-synchronized running data sequence, monitor the edge gateway communication round-trip delay during data transmission, call the sliding window algorithm to perform sign statistics on the SOC deviation in the time-synchronized running data sequence, and calculate the deviation direction consistency count. The adjustment window construction module is used to execute S3: when the deviation direction consistency count reaches the preset threshold, the active power tracking error is compared with the consistency threshold, the execution status is determined based on the communication round-trip delay, and the continuous time slice that meets the power limit is retrieved in combination with the converter adjustment capability to construct the energy storage executable time window; The power trajectory generation module is used to execute S4: within the energy storage executable time window, calculate the remaining distance for the measured SOC to reach the SOC safety threshold, lock the risk point of exceeding the boundary based on the SOC change trend direction, and call the slope limit algorithm to generate the energy storage segmented active power reference trajectory based on the upper limit of the planned power change rate. The closed-loop control verification module is used to execute S5: encapsulate the active power reference trajectory of the energy storage segment into a source-grid-load-storage coordinated control command with an incrementing sequence number and send it out; compare the sequence number in the verification frame returned by the inverter to verify the command landing status; perform closed-loop verification based on the active power reference trajectory of the energy storage segment and the real-time readback power to generate the closed-loop power control deviation status.