Grid-connected and off-grid smooth switching method for source-grid-load-storage integrated micro-grid

By employing a hierarchical collaborative construction and dynamic adaptation strategy, the unified integration and linkage of the operating states at all levels of the microgrid are achieved. This solves the problems of insufficient coordination and imperfect fault handling during the switching between the microgrid and off-grid in existing technologies, thereby improving the smoothness of the switching and the reliability of power supply.

CN122026486APending Publication Date: 2026-05-12ZHEJIANG ZHEDA ENERGY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG ZHEDA ENERGY TECH CO LTD
Filing Date
2026-04-10
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing microgrid grid-connected and off-grid switching technologies have shortcomings in terms of multi-unit coordination of source, grid, load and storage, adaptation to complex operating scenarios and emergency fault handling. This leads to difficulties in accurately controlling power balance, increased line losses or power outages, false or untimely switching, voltage and frequency impacts on equipment, and difficulty in ensuring fault propagation and power supply continuity.

Method used

A hierarchical collaborative construction process is adopted. The hierarchical collaborative mechanism collects operational status data of each level in real time to generate a hierarchical status matrix. Combined with a dynamic adaptation strategy, the switching mode adaptation coefficient and threshold parameters are calculated to perform pre-switching and actual switching. Feedback correction data is collected to optimize parameters and construct short-circuit fault emergency response logic to achieve unified integration and linkage of operational data of each level.

Benefits of technology

It achieves unified integration and linkage of operational data at all levels, reduces line loss and power outage risks, avoids false triggering or untimely switching, protects precision electrical equipment, quickly isolates faults, and ensures the continuity of power supply to core loads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122026486A_ABST
    Figure CN122026486A_ABST
Patent Text Reader

Abstract

The invention discloses a grid-connected and off-grid smooth switching method for a source-grid-load-storage integrated micro-grid. The method comprises the steps of hierarchical collaborative construction, dynamic adaptive adjustment, dual-stage switching and switching optimization. Setting a hierarchical collaboration mechanism according to a source level, a superior node level and a local level, and collecting operation state data of each level to generate a hierarchical state matrix; a switching mode adaptation coefficient and a threshold parameter are calculated through a risk power balance algorithm, and a switching control instruction is generated; executing preliminary switching and actual switching and collecting feedback data; and optimizing data acquisition weight, resource configuration logic and algorithm parameters based on the feedback data. Through hierarchical collaboration, dynamic decision and closed-loop optimization, the problems of missing hierarchical collaboration, static decision, unsmooth switching and the like in the traditional technology are solved, the stability of grid-connected and off-grid switching, the power supply continuity and the fault handling capacity are improved, and the method is adaptive to complex operation scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system regulation, specifically to a method for smooth switching between grid connection and off-grid operation in integrated microgrids. Background Technology

[0002] Currently, microgrid grid-connected / off-grid switching technologies are mainly developed around pre-synchronization matching and single energy storage support. However, significant shortcomings remain in areas such as multi-unit coordination of source, grid, load, and storage, adaptation to complex operating scenarios, and emergency fault handling. These shortcomings are specifically reflected in the following aspects:

[0003] Existing switching technologies often fail to differentiate microgrids according to their management levels. Operational status data at each level are isolated, lacking a unified integration and linkage mechanism. This makes precise power balance control during switching difficult, increasing the risk of increased line losses or power outages. Furthermore, existing grid-connected / off-grid switching modes are mostly fixed, failing to dynamically adjust based on the microgrid's real-time operating status. This can lead to false triggering or delayed switching. The decision-making process often doesn't fully consider factors such as energy storage charge status and core load priority, potentially resulting in forced disconnection even after local energy storage is depleted, or excessive power consumption by non-core loads. Traditional switching often employs a single trigger operation, directly executing switching upon detecting a fault signal without a pre-switching phase. Due to inherent voltage and frequency discrepancies between grid-connected and off-grid states, direct switching can easily trigger electrical faults. Sudden voltage fluctuations and frequency oscillations can impact precision electrical equipment, even causing it to trip. While some technologies incorporate pre-synchronization, they fail to feed back the state data from the pre-synchronization process to subsequent decisions, making it impossible to correct switching parameters in a timely manner and adapt to the random fluctuations of distributed power sources. For extreme faults such as short circuits, existing technologies often only perform a single emergency circuit disconnection operation without constructing a tiered emergency response logic. After a fault occurs, the energy storage at the upper-level node may still be in a discharging state, exacerbating the fault propagation. At the same time, the grid connection process after the fault is cleared lacks a step-by-step evaluation mechanism and does not consider factors such as local energy storage methods and remaining power. Direct grid connection is prone to secondary impacts due to voltage adaptation errors. Furthermore, the lack of a coordinated power replenishment mechanism between upper and lower-level energy storage means that when local energy storage power is insufficient, it is impossible to quickly obtain support from the upper level, making it difficult to guarantee the continuity of power supply to core loads.

[0004] Therefore, in order to address the problems of lack of hierarchical coordination, static decision-making, insufficient smoothness of switching, imperfect fault handling, and lack of closed-loop optimization in existing technologies, this invention proposes a smooth switching method for grid-connected and off-grid microgrids with integrated source-grid-load-storage systems. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method for smooth switching between grid connection and off-grid operation in integrated microgrids.

[0006] To achieve the above objectives, the present invention provides the following technical solution: Methods for smooth grid-connection / off-grid switching of integrated source-grid-load-storage microgrids include: The hierarchical collaborative construction steps involve setting up a hierarchical collaborative mechanism based on the microgrid's management and control levels. These levels include the source level, the upper-level node level, and the local level. The hierarchical collaborative mechanism collects operational status data from each level in real time and integrates and processes the data to generate a hierarchical status matrix. The dynamic adaptation and adjustment step involves calculating the switching mode adaptation coefficient and switching threshold parameter of the hierarchical state matrix through a preset dynamic adaptation strategy, and generating a switching control command based on the switching mode adaptation coefficient and switching threshold parameter. The switching control command includes a switching mode command, a threshold parameter, and a hierarchical collaborative correction identifier. The two-stage switching process involves performing pre-switching and actual switching according to the switching control command and switching threshold parameters, and collecting feedback correction data during the switching process. The feedback correction data is then sent back to the hierarchical coordination mechanism and dynamic adaptation adjustment, respectively. After receiving feedback correction data, the hierarchical collaboration mechanism adjusts the collection weights of operational status data at each level and the corresponding resource configuration logic. After receiving feedback correction data, the dynamic adaptation strategy optimizes and updates the calculation parameters of the preset algorithm.

[0007] Preferably, in the hierarchical collaborative construction step, the source-level operational status data includes power grid supply stability information, switching device operating status information, and short-circuit fault early warning information; The operational status data of the upper-level node includes node fault severity information, state of charge information of the upper-level node's dedicated energy storage, and adjustable power information. The local-level operating status data includes real-time load power information, local-level energy storage remaining power information, and core load power supply demand identifiers. The hierarchical collaboration mechanism collects operational status data at each level through a distributed monitoring unit. The collected operational status data at each level is integrated into a hierarchical status matrix according to a preset format of hierarchical identifier, data type, value, and collection timestamp.

[0008] Preferably, the dynamic adaptation adjustment step includes calculating the handover mode adaptation coefficient and handover threshold parameter using a risk power balance algorithm, specifically including: Based on the hierarchical state matrix, source-level grid power supply stability information and upper-level node fault severity information are extracted. The grid power supply stability information is quantified into a stability value; the larger the stability value, the stronger the grid power supply stability. The node fault severity information is quantified into a severity level. The stability value and the severity level are weighted according to preset weights to obtain the grid-connected / off-grid adaptation coefficient, and a corresponding adaptation threshold is preset. If the adaptation coefficient is greater than the preset adaptation threshold, the output switching mode is grid-connected mode; if the adaptation coefficient is less than the preset threshold, the output switching mode is off-grid mode. Based on the hierarchical state matrix, upper-level adjustable power information and local-level real-time load power information are extracted again. The difference ratio between the real-time load power and the adjustable power is calculated, and the pre-switching trigger threshold and the actual switching execution threshold are determined based on the difference ratio.

[0009] Preferably, the two-stage switching step includes: When performing a pre-switching, the pre-switching trigger threshold in the switching control command is used as the start condition. When the microgrid operating parameters are detected to reach the threshold, the pre-switching is initiated. Simultaneously, the voltage deviation change rate data and the adjustment response time data of the upper-level node-level dedicated energy storage are collected as feedback data for the pre-switching stage. The data is then transmitted back to the hierarchical coordination mechanism according to a preset cycle. After receiving the data, the hierarchical coordination mechanism presets a response threshold. If the response time is greater than the preset response threshold, the adjustable power assessment value of the corresponding upper-level node is immediately reduced. The reduction magnitude is linearly positively correlated with the proportion of the response time exceeding the threshold. When performing an actual handover, the actual handover execution threshold is used as the trigger condition. Once the threshold is reached, the arc-free handover device is triggered to perform the handover action. The load voltage fluctuation value and handover time data are collected in real time as feedback data for the execution stage and sent back to the dynamic adaptation strategy. After receiving the data, the dynamic adaptation strategy presets the fluctuation threshold. If the fluctuation value is greater than the preset fluctuation threshold, the corresponding level identifier is recorded and the threshold parameter is tightened.

[0010] Preferably, the hierarchical collaborative construction step further includes constructing an emergency response triggered by short-circuit fault early warning information. The hierarchical collaborative mechanism monitors short-circuit fault early warning information at the source level and the upper-level node level in real time. When such information is detected at any level, an emergency response is immediately triggered. The hierarchical collaborative mechanism sends an emergency cut-off command to the source-level switching device and generates an energy storage lock signal, which is sent to the unit used for dedicated energy storage control at the upper-level node level to lock its discharge function. The hierarchical collaborative mechanism sends an emergency response trigger signal to the dynamic adaptation strategy. The dynamic adaptation strategy stops conventional algorithm calculation and generates a switching mode command for emergency off-grid and local-level energy storage priority power supply. After the pre-switching is completed in the two-stage switching step, a switching success signal is generated and sent back to the hierarchical collaborative mechanism. The hierarchical collaborative mechanism generates an energy storage unlock signal and a power replenishment command again, which are sent to the unit used for dedicated energy storage control at the upper-level node level to unlock the discharge function and control it to supply power according to the power replenishment needs of the local-level energy storage.

[0011] Preferably, the hierarchical state matrix includes data priority identifiers, which include highest priority, medium priority, and normal priority. A preset severity level threshold is set. When the severity of a fault at the upper-level node is greater than the preset threshold, the priority of the fault severity information and the corresponding upper-level node-specific energy storage charge status information is set to the highest priority. When there is a core load power supply demand identifier at the local level, the priority of the local level real-time load power information and the core load power supply demand identifier is set to the highest priority. After receiving the matrix, the dynamic adaptation strategy prioritizes calculations based on the highest priority data to ensure that key data participates in decision-making first.

[0012] Preferably, the dynamic adaptation and adjustment step further includes, when calculating the switching threshold parameters through the risk power balance algorithm, extracting the local-level real-time load power deviation based on the hierarchical state matrix, setting a preset deviation threshold, extracting the adjustable power information of the upper-level node, setting a preset power threshold, and if the real-time load power deviation is less than the preset threshold and the adjustable power is greater than a preset multiple of the real-time load power, setting the pre-switching trigger threshold to a lenient threshold to reduce the probability of false switching triggering; if the real-time load power deviation is greater than the preset threshold and the adjustable power is less than a preset multiple of the real-time load power, setting the pre-switching trigger threshold to a tightened threshold to initiate the pre-switching reserved adjustment time in advance. The specific values ​​of the lenient threshold and the tightened threshold are determined based on the historical operating data of the microgrid over the past 6 months.

[0013] Preferably, the dual-stage switching step further includes the feedback correction data transmitted back by the dual-stage switching step, which includes voltage deviation change rate, energy storage regulation response time, load voltage fluctuation value, and switching time. After the hierarchical coordination mechanism receives the data, it calculates the average value of the energy storage regulation response time data collected three times consecutively at the same upper-level node. If the average value is greater than the preset response threshold, it generates an energy storage parameter adjustment command and sends it to the unit used for dedicated energy storage control at the upper-level node to adjust its charging and discharging current limit parameters and response sensitivity parameters. After the dynamic adaptation strategy receives the data, it statistically analyzes the load voltage fluctuation values ​​collected five times consecutively at the same local level. If the fluctuation value is greater than the preset fluctuation threshold, it records the local level identifier and further tightens the pre-switching trigger threshold and actual switching execution threshold when calculating the pre-switching trigger threshold and actual switching execution threshold corresponding to the next level, until the subsequent three consecutive fluctuation values ​​are less than the preset fluctuation threshold, at which point the tightening stops.

[0014] The beneficial effects of this invention are: (1) By dividing the three-level control hierarchy and constructing the hierarchical status matrix, the unified integration and linkage of the operation data of each level can be realized. The upper-level power grid can accurately grasp the energy storage status and load demand of the lower-level nodes, and the lower-level nodes can quickly respond to the upper-level dispatch and fault warning, effectively reducing line loss and power supply interruption risk, and improving the collaborative efficiency of multiple units of source, grid, load and storage.

[0015] (2) Based on the risk power balance algorithm, the switching mode and threshold parameters are dynamically calculated in combination with real-time operation data to adapt to the fluctuations and load changes of distributed power sources, avoid false triggering or untimely switching, and at the same time take into account the energy storage charge status and core load priority to prevent local energy storage from being depleted or non-core loads from occupying too much power supply resources.

[0016] (3) By preparing a stable operating environment through pre-switching, the actual switching is achieved without impact by using an arc-free switching device, which greatly reduces the risk of voltage sudden change and frequency oscillation and protects precision electrical equipment from impact; the feedback data processing mechanism optimizes parameters through multiple rounds of verification to further improve the switching accuracy.

[0017] (4) A hierarchical emergency response logic is constructed for short-circuit faults to quickly disconnect the faulty line and lock the energy storage discharge function to prevent the fault from spreading. After the fault, the core load is guaranteed to be powered by the coordinated power supply of the upper and lower level energy storage. At the same time, after the fault is cleared, the grid is evaluated according to the level to avoid secondary impact. Attached Figure Description

[0018] Figure 1 This is a flowchart of the method for smooth switching between grid connection and off-grid operation in microgrids with integrated source, grid, load and storage systems according to the present invention; Figure 2 This is a flowchart of the hierarchical collaborative construction steps according to an embodiment of the present invention; Figure 3This is a flowchart of the risk power balancing algorithm for the dynamic adaptation and adjustment steps in an embodiment of the present invention; Figure 4 This is a flowchart of the two-stage switching steps in an embodiment of the present invention. Detailed Implementation

[0019] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Identical components are denoted by the same reference numerals. It should be noted that the terms "front," "rear," "left," "right," "upper," and "lower" used in the following description refer to directions in the accompanying drawings, and the terms "bottom surface," "top surface," "inner," and "outer" refer to directions toward or away from the geometric center of a specific component, respectively.

[0020] This invention proposes a method for smooth grid-connection / off-grid switching in integrated source-grid-load-storage microgrids, such as... Figures 1 to 4 As shown, it includes: The hierarchical collaborative construction steps involve setting up a hierarchical collaborative mechanism based on the microgrid's management and control levels. These levels include the source level, the upper-level node level, and the local level. The hierarchical collaborative mechanism collects operational status data from each level in real time and integrates and processes the data to generate a hierarchical status matrix. The generation of the hierarchical state matrix is ​​the core process of the hierarchical collaborative mechanism, which transforms the dispersed operational data of various control levels of the microgrid into unified structured decision support data. The overall process follows a closed-loop technology framework: differentiated data acquisition and preprocessing, structured framework mapping, verification and priority embedding, and dynamic updating and synchronization. Differentiated data acquisition is implemented based on the functional positioning of each level. At the source level, high-precision voltage and frequency sensors and fault current transformers are deployed to focus on capturing grid power supply stability, switching device status, and short-circuit fault early warning. At the upper-level node level, SOC sensors, power sensors, and fault level analyzers are configured to focus on severe node faults. The system collects data on the load, state of charge, and adjustable power of dedicated energy storage. At the local level, smart meters and load classification modules are used to collect real-time load power, remaining local energy storage capacity, and core load identifiers. The collected data undergoes outlier removal, data quantization, and timestamp unification by a preprocessing submodule to ensure data reliability. Data mapping is completed based on a five-dimensional structured framework of hierarchical identifiers, data type codes, parameter values, collection timestamps, and priority identifiers. Hierarchical identifiers use alphanumeric codes, data type codes are set according to parameter types and abbreviation rules, and parameters at each level are filled into the corresponding dimensions to form the basic entries of the matrix.

[0021] The source level serves as the connection hub between the microgrid and the external power grid, primarily responsible for transmitting the operating status and dispatch instructions of the main power grid. The upper-level node level acts as the coordination center for regional power supply, covering multiple local-level nodes and undertaking the functions of power allocation and fault isolation within the region. The local level is the direct power supply end for loads, directly connected to user-side electrical equipment, and must prioritize ensuring the power supply continuity of core loads. The hierarchical coordination mechanism is the core control unit connecting the three levels. It integrates a data acquisition submodule, a data integration submodule, and an emergency response submodule. These three submodules work together to achieve real-time acquisition of the operating status of each level and to quickly activate emergency procedures in the event of extreme faults, preventing the fault from spreading.

[0022] In the data collection and integration phase of operational status, it is necessary to determine key monitoring parameters and clarify the technical significance of each parameter based on the functional positioning of different levels. For the source level, grid power supply stability information is mainly obtained by continuously monitoring the fluctuation amplitude and duration of voltage and frequency of the main grid. This parameter directly determines whether the microgrid has the conditions for grid connection. If the voltage fluctuation exceeds ±2% or the frequency fluctuation exceeds ±0.2Hz, it is necessary to determine that there may be instability risks in the main grid, which will affect the switching mode decision. The operating status information of the switching device mainly monitors the opening and closing status and contact temperature of the power plant's outlet circuit breaker and disconnector to prevent damage to the power plant due to switching device failure during the switching process. Short circuit fault early warning information is obtained by monitoring the sudden change of fault current in the line through current transformers to detect short circuit risks in advance and reserve time for handling extreme situations.

[0023] Specifically, such as Figures 1 to 4 As shown, in the hierarchical collaborative construction step, the source-level operational status data includes power grid supply stability information, switching device operating status information, and short-circuit fault early warning information; The operational status data of the upper-level node includes node fault severity information, state of charge information of the upper-level node's dedicated energy storage, and adjustable power information. The local-level operating status data includes real-time load power information, local-level energy storage remaining power information, and core load power supply demand identifiers. The hierarchical collaboration mechanism collects operational status data at each level through a distributed monitoring unit. The collected operational status data at each level is integrated into a hierarchical status matrix according to a preset format of hierarchical identifier, data type, value, and collection timestamp.

[0024] Monitoring parameters at the upper-level node level need to focus on the impact of faults and power supply support capabilities. The severity of node faults is determined by analyzing the magnitude of the fault current, the duration of the fault, and the number of local levels affected. For example, a fault affecting only one local level with a small fault current is considered a minor fault, while a fault affecting three or more local levels with a large fault current is considered a severe fault. This parameter is used to determine whether upper-level energy storage support needs to be activated. The state of charge (SOC) information of the dedicated energy storage at the upper-level node is collected in real time by the SOC sensor of the energy storage system. The adjustable power information is calculated based on the current SOC and charge / discharge rate of the energy storage. Both together determine whether the upper-level node can provide supplementary power support to the lower-level local levels. If the SOC is lower than the preset value, the adjustable power will drop significantly, and priority should be given to ensuring the basic power supply of the node itself.

[0025] Local-level monitoring parameters focus on load demand and local support capabilities. Real-time load power information is collected through smart meters or power sensors on the load side to match power supply with load demand and avoid voltage fluctuations caused by power imbalance. The remaining power information of local energy storage is also obtained through SOC sensors, and its core function is to prevent the inability to guarantee power supply to core loads after local energy storage is depleted. The core load power demand identifier is set in advance by classifying user-side loads, specifically including power loads such as medical equipment loads and data center server loads, where power outages would result in significant economic losses or safety risks. This identifier is used to prioritize the power needs of such loads when power supply is insufficient.

[0026] All operational status data at each level are collected through distributed monitoring units. These units need to be deployed differently according to the installation environment and monitoring requirements at different levels: At the source level, the monitoring units are deployed at the power plant's outlet bus, using high-precision voltage and current sensors with a sampling frequency of no less than 100Hz to ensure the capture of rapid voltage and frequency fluctuations; at the upper-level node level, the monitoring units are deployed at the interface between the low-voltage side bus and the energy storage system in the regional substation, integrating temperature sensors and fault current detection modules to monitor both conventional and fault parameters; at the local level, the monitoring units are deployed in the load distribution box and the local energy storage control cabinet, using miniaturized, low-power sensors to adapt to the complex installation environment on the user side. The collected data needs to be integrated into a hierarchical status matrix according to a unified format. The hierarchical identifier in this format is used to quickly locate the control level to which the data belongs, avoiding confusion between data from different levels; the data type is used to distinguish different parameter categories such as voltage, current, and SOC, which facilitates subsequent classification and processing; the numerical values ​​need to retain a certain degree of precision to ensure the accuracy of decision calculations; and the timestamp is used to mark the time of data collection to avoid the influence of old data on decision-making due to data transmission delays. Under normal circumstances, the delay from data collection to integration into the matrix needs to be controlled within a short period of time. If the load fluctuates greatly, the delay can be further shortened by increasing the data transmission bandwidth.

[0027] Specifically, such as Figures 1 to 4 As shown, the hierarchical collaborative construction step further includes constructing an emergency response triggered by short-circuit fault early warning information. The hierarchical collaborative mechanism monitors short-circuit fault early warning information at the source level and the upper-level node level in real time. When the information is detected at any level, an emergency response is immediately triggered. The hierarchical collaborative mechanism sends an emergency cut-off command to the source-level switching device and generates an energy storage lock signal, which is sent to the unit used for dedicated energy storage control at the upper-level node level to lock its discharge function. The hierarchical collaborative mechanism sends an emergency response trigger signal to the dynamic adaptation strategy. The dynamic adaptation strategy stops the conventional algorithm operation and generates a switching mode command for emergency off-grid and local-level energy storage priority power supply. After the pre-switching is completed in the two-stage switching step, a switching success signal is generated and sent back to the hierarchical collaborative mechanism. The hierarchical collaborative mechanism generates an energy storage unlock signal and a power replenishment command again, which are sent to the unit used for dedicated energy storage control at the upper-level node level to unlock the discharge function and control it to supply power according to the power replenishment needs of the local-level energy storage.

[0028] Specifically, such as Figures 1 to 4 As shown, the hierarchical state matrix includes data priority identifiers, which include highest priority, medium priority, and normal priority. A preset severity level threshold is set. When the severity of a fault at the upper-level node is greater than the preset threshold, the priority of the fault severity information and the corresponding upper-level node-specific energy storage charge status information is set to the highest priority. When there is a core load power supply demand identifier at the local level, the priority of the local level real-time load power information and the core load power supply demand identifier is set to the highest priority. After receiving the matrix, the dynamic adaptation strategy prioritizes calculations based on the highest priority data to ensure that key data participates in decision-making first.

[0029] The data priority markers in the hierarchical state matrix are designed to ensure that the dynamic adaptation strategy prioritizes key information affecting switching safety and core loads when processing multi-dimensional data. Priorities are categorized into three levels: highest, medium, and normal. This classification is based on the data's impact on switching decisions: highest priority data consists of parameters directly related to power supply safety and core loads, such as fault severity information at the upstream node level and the local core load power demand identifier; medium priority data consists of parameters that support decision-making, such as grid power stability information at the source level and adjustable power information at the upstream node level; normal priority data consists of routine monitoring parameters, such as local non-core load power information. Preset severity thresholds are typically set based on historical fault statistics. For example, a level 3 fault might be used as the threshold. When a fault severity reaches level 3 or higher, it indicates that the fault may affect the regional power supply. This fault information, along with the corresponding upstream node's energy storage charge status information, should be set to the highest priority to ensure that the dynamic adaptation strategy prioritizes this type of data and avoids decision delays.

[0030] In the emergency response process for short-circuit faults, it is crucial to focus on the technical coordination and timing of actions at each stage to ensure rapid fault isolation and guaranteed power supply to core loads even in extreme circumstances. When the hierarchical coordination mechanism detects a short-circuit fault warning through the monitoring unit at the source level or the upper-level node level, the emergency response submodule is immediately activated. First, it sends an emergency disconnection command to the high-voltage circuit breaker at the source level. This command is transmitted via hard-wired transmission to ensure that the circuit breaker trips within 0.1ms, disconnecting the faulty line from the power plant and preventing short-circuit current from damaging the power plant equipment. Simultaneously, it generates an energy storage lockout signal, which is sent to the unit for dedicated energy storage control at the upper-level node level. By locking the energy storage discharge circuit, it prevents the energy storage from discharging during a short circuit, which could exacerbate the fault current and further expand the scope of the fault's impact.

[0031] The hierarchical coordination mechanism sends an emergency response trigger signal to the dynamic adaptation strategy. This signal pauses the routine weighted calculation process of the risk power balance algorithm being executed by the dynamic adaptation strategy and instead invokes preset emergency mode parameters. These parameters are fixed strategies set based on historical short-circuit fault handling experience, which can quickly generate switching mode instructions for emergency off-grid and priority power supply from local energy storage without complex calculations, ensuring no delay in the decision-making process. Upon receiving this instruction, the two-stage switching module used in the system quickly executes preparatory switching operations. By adjusting the output of local energy storage, it stabilizes the local voltage and frequency within the allowable range of the core load. After the voltage and frequency stabilize, a switching success signal is generated and sent back to the hierarchical coordination mechanism.

[0032] After receiving the successful switchover signal, the hierarchical coordination mechanism confirms that the fault has been isolated and the core load power supply is stable. At this point, it generates an energy storage unlock signal and a power replenishment command, which are sent to the unit used for controlling the dedicated energy storage at the upper node level. The unlock signal releases the locked state of the energy storage discharge circuit. The power replenishment command calculates the required power and duration of power replenishment based on the remaining power of the local energy storage and the hourly power demand of the core load. For example, if the remaining power of the local energy storage can only support the core load for 0.5 hours, and the adjustable power of the dedicated energy storage at the upper node level is 100kW, then the power replenishment command will control the upper energy storage to replenish the local energy storage with 50kW of power for 1 hour, ensuring that the local energy storage power is restored to a level that can support the core load for 1.5 hours, thus reserving sufficient power supply buffer for subsequent fault clearance or grid connection operations.

[0033] Through the above-mentioned hierarchical collaborative construction steps, comprehensive perception of the operating status of each level of the microgrid, orderly integration of data, and rapid response to extreme faults can be achieved, providing accurate decision-making basis for subsequent dynamic adaptation and adjustment steps, and laying a safe foundation for smooth off-grid switching.

[0034] The dynamic adaptation and adjustment step involves calculating the switching mode adaptation coefficient and switching threshold parameter of the hierarchical state matrix through a preset dynamic adaptation strategy, and generating a switching control command based on the switching mode adaptation coefficient and switching threshold parameter. The switching control command includes a switching mode command, a threshold parameter, and a hierarchical collaborative correction identifier. In the switching mode adaptation coefficient calculation stage, two types of basic data that play a decisive role in grid connection and disconnection decisions are extracted from the hierarchical state matrix: source-level grid power supply stability information and upper-level node fault severity information. Non-numerical information is then transformed into calculable parameters through standardization and quantification. Specifically, the quantification of grid power supply stability information requires consideration of the allowable deviation ranges of voltage and frequency in the grid equipment operation standards. A dual-dimensional assessment of fluctuation amplitude and duration is adopted, using a 100ms monitoring cycle. If the voltage fluctuation is consistently controlled within ±0.5% of the rated voltage and the frequency fluctuation is between 49.9-50.1Hz within the cycle, the stability value is set to 100. If the voltage fluctuation reaches ±1% or the frequency fluctuation reaches 49.8-50.2Hz, the stability value drops to 80. If the voltage fluctuation exceeds ±2% or the frequency fluctuation exceeds 49.5-50.5Hz, the stability value drops below 50. A higher value indicates a more stable grid and greater suitability for grid connection. The quantification of node fault severity information requires a comprehensive consideration of the fault's impact range and intensity: a fault affecting only one local node and with a fault current not exceeding 1.2 times the rated current of the upstream node is classified as a minor fault, with a severity level of 1-2; a fault affecting 2-3 local nodes and with a fault current reaching 1.2-2 times the rated current is classified as a moderate fault, with a level of 3-4; a fault affecting more than 3 local nodes or with a fault current exceeding twice the rated current is classified as a severe fault, with a level of 5. The higher the level, the greater the risk of failure of the upstream node, and the more priority should be given to disconnecting it from the network.

[0035] After quantifying the two types of data, a weighted calculation is performed based on preset weights according to the safety priority of microgrid operation to obtain the grid connection and off-grid adaptation coefficient. The stability of the main grid directly determines the power supply security after grid connection. If the main grid itself is unstable, even if the fault of the upstream node is minor, grid connection may trigger a chain reaction of problems. Therefore, the weight of the stability value is set to 60%, and the weight of the node fault severity level is set to 40%. The weighted calculation process needs to be implemented through logical association. First, the severity level is assigned a score according to the level, and each preset score is converted into a score within the same range as the stability value. Then, each score is multiplied by its corresponding weight and summed to obtain the adaptation coefficient.

[0036] The adaptation threshold must be set based on historical grid connection success rate data from long-term microgrid operation. Its core function is to delineate the decision boundary between grid connection and off-grid operation. If historical data shows that when the adaptation coefficient is ≥80, the probability of switching failure due to grid instability or upstream faults after grid connection is less than 5%, then the adaptation threshold for high stability scenarios is set to 80. If the adaptation coefficient is between 60 and 80, the grid connection success rate remains between 80% and 90%, then the adaptation threshold for normal scenarios is set to 60. If the adaptation coefficient is <60, the probability of grid connection failure exceeds 30%, then it is determined that grid connection is not suitable. The final decision logic is as follows: if the adaptation coefficient reaches or exceeds the adaptation threshold, it indicates that both grid stability and upstream node fault status meet the grid connection requirements, and the output switching mode is grid connection mode; if the adaptation coefficient is lower than the adaptation threshold, it indicates that grid instability or upstream fault risk is high, and the output switching mode is off-grid mode.

[0037] Specifically, such as Figures 1 to 4 As shown, the dynamic adaptation adjustment step includes calculating the handover mode adaptation coefficient and handover threshold parameter using a risk power balance algorithm, specifically including: Based on the hierarchical state matrix, source-level grid power supply stability information and upper-level node fault severity information are extracted. The grid power supply stability information is quantified into a stability value; the larger the stability value, the stronger the grid power supply stability. The node fault severity information is quantified into a severity level. The stability value and the severity level are weighted according to preset weights to obtain the grid-connected / off-grid adaptation coefficient, and a corresponding adaptation threshold is preset. If the adaptation coefficient is greater than the preset adaptation threshold, the output switching mode is grid-connected mode; if the adaptation coefficient is less than the preset threshold, the output switching mode is off-grid mode. Based on the hierarchical state matrix, upper-level adjustable power information and local-level real-time load power information are extracted again. The difference ratio between the real-time load power and the adjustable power is calculated, and the pre-switching trigger threshold and the actual switching execution threshold are determined based on the difference ratio.

[0038] The calculation of the switching mode adaptation coefficient is based on the risk power balance algorithm. It requires first completing the quantification of basic data and weight configuration, then obtaining the final coefficient through logical correlation calculations, and dynamically correcting it in conjunction with the local energy storage status. Firstly, source-level grid power supply stability information and upper-level node fault severity information are extracted from the hierarchical state matrix. Both types of information are standardized and quantified: the quantification of grid power supply stability information refers to the allowable deviation range of voltage and frequency in the grid equipment operation standards, with a monitoring period of 100ms. If the voltage fluctuation is consistently controlled within ±0.5% of the rated voltage and the frequency fluctuation is within 49.9-50.1Hz within the period, the stability value is set to 100; when the voltage fluctuation is ±1% or the frequency fluctuation is 49.8-50.2Hz, the value drops to 80; when the voltage fluctuation exceeds ±2% or the frequency fluctuation exceeds 49.5-50.5Hz, the value drops to below 50. The value directly reflects the stability of the large power grid. The quantification of node fault severity information requires a comprehensive consideration of the fault's impact range and intensity. When a fault affects only one local node and the fault current does not exceed 1.2 times the rated current of the upstream node, it is classified as a level 1-2 minor fault, converted to a 100-point scale (20 points for level 1, 40 points for level 2). When a fault affects 2-3 local nodes and the fault current reaches 1.2-2 times the rated current, it is classified as a level 3-4 moderate fault, corresponding to 60 and 80 points respectively. When a fault affects more than 3 local nodes or the fault current exceeds twice the rated current, it is classified as a level 5 severe fault, corresponding to 100 points, thus completing the conversion from non-numerical levels to calculable scores. Next, weights are set according to the principle of "large power grid stability priority," with stability values ​​accounting for 60% and fault severity converted scores accounting for 40%. An initial adaptation coefficient is obtained through weighted summation. For example, when the stability value is 80 and the fault level is 3 (converted to 60 points), the initial adaptation coefficient is the sum of 80 multiplied by 60% and 60 multiplied by 40%. Finally, the remaining power of local energy storage needs to be corrected. If the remaining power is lower than the energy storage power corresponding to the power supply of the local core load for 1 hour, it indicates that the local support capacity is insufficient. At this time, the weight of the remaining power of local energy storage is increased to 30%, and the weights of stability value and fault severity score are reduced to 45% and 25% respectively. The final adaptation coefficient is then recalculated to avoid decision-making bias due to insufficient local energy storage.

[0039] Specifically, such as Figures 1 to 4As shown, the dynamic adaptation and adjustment step further includes, when calculating the switching threshold parameters through the risk power balance algorithm, extracting the local-level real-time load power deviation based on the hierarchical state matrix, setting a preset deviation threshold, extracting the upper-level node-level adjustable power information, setting a preset power threshold, and if the real-time load power deviation is less than the preset threshold and the adjustable power is greater than a preset multiple of the real-time load power, setting the pre-switching trigger threshold to a lenient threshold to reduce the probability of false switching triggering; if the real-time load power deviation is greater than the preset threshold and the adjustable power is less than a preset multiple of the real-time load power, setting the pre-switching trigger threshold to a tightened threshold to initiate the pre-switching reserved adjustment time in advance. The specific values ​​of the lenient threshold and the tightened threshold are determined based on the historical operating data of the microgrid over the past 6 months.

[0040] The generation of switching control commands requires a dual basis: the switching mode adaptation coefficient and the switching threshold parameter. It integrates mode decision-making, threshold standards, and collaborative correction requirements to form a set of commands with clear operational guidance. First, the switching mode command is determined based on the switching mode adaptation coefficient and the preset adaptation threshold. The preset adaptation threshold is set according to the microgrid's historical grid connection success rate. If historical data shows that the grid connection failure probability is less than 5% when the adaptation coefficient is ≥80, the high-stability scenario threshold is set to 80. When the adaptation coefficient reaches or exceeds this threshold, it is determined that the stability of the main grid and the fault status of the upper-level node meet the grid connection requirements, and a "grid-connected mode" command is generated. If the adaptation coefficient is between 60 and 80, the threshold for the regular scenario is set to 60, and a "grid-connected mode" command is also output when the coefficient meets the standard. If the adaptation coefficient is <60 and the grid connection failure probability exceeds 30%, an "off-grid mode" command is output. If the adaptation coefficient is close to the threshold after correction by the remaining local energy storage capacity, it needs to be further determined as an "off-grid + upper-level node-level dedicated energy storage supplementation" mode, clearly indicating the mode type to guide the action direction of the two-stage switching module. Secondly, the switching threshold parameter is embedded. This parameter is determined based on the difference ratio between the adjustable power of the upper-level node and the real-time load power of the local level in the hierarchical state matrix. When the difference ratio is less than 10% (the adjustable power of the upper level covers more than 90% of the local load), a loose threshold is adopted, and the allowable range of voltage deviation is set to ±3% of the rated voltage and the frequency deviation is set to ±0.3Hz. When the difference ratio is greater than 10% (the power gap is large), a tight threshold is adopted, and the voltage deviation is compressed to ±1.5% and the frequency deviation is compressed to ±0.15Hz. At the same time, the specific value of the threshold is optimized by combining the historical operation data of the microgrid over the past 6 months (covering different seasons and time periods) to ensure that the threshold reduces false triggering and ensures smoothness. The final determined pre-switching trigger threshold and the actual switching execution threshold are fully incorporated into the instruction. Finally, a hierarchical collaborative correction identifier is generated. This identifier is dynamically generated based on the current mode and threshold parameters: if it is an "off-grid + supplementary power" mode, the identifier prompts the hierarchical collaborative mechanism to increase the acquisition frequency of the upper-level node-level dedicated energy storage charge status and adjustable power (e.g., from 50Hz to 100Hz); if it is a grid-connected mode and the adaptation coefficient is close to the threshold, the identifier prompts to strengthen the monitoring density of source-level grid power supply stability information. Through this identifier, the dynamic adaptation strategy and hierarchical collaborative mechanism are linked to ensure that the data is updated in real time during the subsequent switching process. Finally, the switching mode command, switching threshold parameters and hierarchical collaborative correction identifier are integrated to form a complete switching control command, providing a comprehensive operational basis for the two-stage switching module.

[0041] The two-stage switching process involves performing pre-switching and actual switching according to the switching control command and switching threshold parameters, and collecting feedback correction data during the switching process. The feedback correction data is then sent back to the hierarchical coordination mechanism and dynamic adaptation adjustment, respectively. Specifically, such as Figures 1 to 4 As shown, the two-stage switching step includes: When performing a pre-switching, the pre-switching trigger threshold in the switching control command is used as the start condition. When the microgrid operating parameters are detected to reach the threshold, the pre-switching is initiated. Simultaneously, the voltage deviation change rate data and the adjustment response time data of the upper-level node-level dedicated energy storage are collected as feedback data for the pre-switching stage. The data is then transmitted back to the hierarchical coordination mechanism according to a preset cycle. After receiving the data, the hierarchical coordination mechanism presets a response threshold. If the response time is greater than the preset response threshold, the adjustable power assessment value of the corresponding upper-level node is immediately reduced. The reduction magnitude is linearly positively correlated with the proportion of the response time exceeding the threshold. When performing an actual handover, the actual handover execution threshold is used as the trigger condition. Once the threshold is reached, the arc-free handover device is triggered to perform the handover action. The load voltage fluctuation value and handover time data are collected in real time as feedback data for the execution stage and sent back to the dynamic adaptation strategy. After receiving the data, the dynamic adaptation strategy presets the fluctuation threshold. If the fluctuation value is greater than the preset fluctuation threshold, the corresponding level identifier is recorded and the threshold parameter is tightened.

[0042] Specifically, such as Figures 1 to 4 As shown, the dual-stage switching step further includes the feedback correction data returned by the dual-stage switching step, which includes voltage deviation change rate, energy storage regulation response time, load voltage fluctuation value, and switching time. When the hierarchical coordination mechanism receives the data, it calculates the average value of the energy storage regulation response time data collected three times consecutively at the same upper-level node. If the average value is greater than the preset response threshold, it generates an energy storage parameter adjustment command and sends it to the unit used for dedicated energy storage control at the upper-level node to adjust its charging and discharging current limit parameters and response sensitivity parameters. After the dynamic adaptation strategy receives the data, it statistically analyzes the load voltage fluctuation values ​​collected five times consecutively at the same local level. If the fluctuation value is greater than the preset fluctuation threshold, it records the local level identifier and further tightens the pre-switching trigger threshold and actual switching execution threshold when calculating the pre-switching trigger threshold and actual switching execution threshold corresponding to the next level, until the subsequent three consecutive fluctuation values ​​are less than the preset fluctuation threshold, at which point the tightening stops.

[0043] The pre-switching phase is initiated based on the pre-switching trigger threshold output by the dynamic adaptation strategy. This threshold is determined by the difference ratio between the adjustable power at the upper-level node and the real-time load power at the local level, combined with six months of historical operating data of the microgrid. When the difference ratio is less than a preset value, the threshold is ±3% for voltage and ±0.3Hz for frequency; when the difference ratio is greater than the preset value, it tightens to ±1.5% for voltage and ±0.15Hz for frequency. The dual-stage switching module monitors the microgrid voltage and frequency in real time. If either parameter reaches the threshold, the pre-switching is initiated, simultaneously collecting two types of data: the voltage deviation change rate and the upper-level node's dedicated energy storage adjustment response time. Data is transmitted back to the hierarchical coordination mechanism at 50ms intervals. The hierarchical coordination mechanism calls the preset response threshold. If the response time does not exceed the threshold, the adjustable power assessment value is maintained; if it exceeds the threshold, the assessment value is lowered. The reduction magnitude is linearly positively correlated with the proportion exceeding the threshold, balancing the energy storage response capability and power supply support requirements.

[0044] The actual switching phase is triggered by a further tightened actual switching execution threshold. For example, if the preliminary threshold is ±1.5% of the voltage, the actual threshold is tightened to ±1%, ensuring that the microgrid parameters are close to the target state at the moment of switching, i.e., close to the main grid parameters when connected to the grid and close to the internal balance parameters when disconnected from the grid. After the dual-stage switching module detects that the parameters have reached the threshold, it triggers the arc-free switching device to perform the action. This device detects the zero-crossing points of current and voltage and completes the switching at the zero crossing to avoid arcing, thereby protecting the equipment and preventing fluctuations. Two types of data are collected in real time during the switching: the load voltage fluctuation value, the maximum change in load-side voltage during the switching, reflecting the impact on the load, and the switching time. The time from command triggering to power supply stabilization must be less than 100ms to avoid interruption. Data is transmitted back in real time to a dynamic adaptation strategy, calling the preset fluctuation threshold for judgment. If the fluctuation value does not exceed the threshold, the switching is qualified; if it exceeds the threshold, the corresponding level identifier is recorded as a basis for subsequent threshold adjustment, ensuring the accuracy and safety of the switching.

[0045] Feedback correction data processing revolves around four types of data: voltage deviation change rate, energy storage regulation response time, load voltage fluctuation value, and switching time. A hierarchical coordination mechanism and a dynamic adaptation strategy are optimized in their respective roles. The hierarchical coordination mechanism, targeting the upper-level node-level energy storage response time, uses three consecutive data acquisitions to average the results and eliminate instantaneous interference. When the average exceeds a preset response threshold, an energy storage parameter adjustment command is generated and sent to the unit used for upper-level energy storage control, adjusting charging and discharging current limits and response sensitivity. For example, the control signal delay is reduced from 50ms to 30ms, improving the dynamic support capability of energy storage. The dynamic adaptation strategy, targeting the local-level load voltage fluctuation value, uses five consecutive data acquisitions. When more than 80% of the fluctuation value exceeds a preset threshold, a hierarchical identifier is recorded. The next time the threshold for that level is calculated, the preparatory and actual switching thresholds are tightened until three consecutive fluctuation values ​​meet the threshold, at which point tightening stops, achieving continuous optimization of switching accuracy and forming a closed loop of execution, feedback, and optimization.

[0046] After receiving feedback correction data, the hierarchical collaboration mechanism adjusts the collection weights of operational status data at each level and the corresponding resource configuration logic. After receiving feedback correction data, the dynamic adaptation strategy optimizes and updates the calculation parameters of the preset algorithm.

[0047] The handover optimization step is a closed-loop iterative process for smooth handover between parallel and offline networks. Its core is to optimize the hierarchical coordination mechanism and dynamic adaptation strategy based on the feedback correction data transmitted back from the two-stage handover, so as to achieve continuous iterative upgrades.

[0048] The optimization of the hierarchical coordination mechanism includes adjusting the data acquisition weights at each level. These weights determine the update frequency and decision priority of data in the hierarchical state matrix. If the response time of a higher-level node's energy storage frequently exceeds the limit, it indicates a weakness in its energy storage support capacity. The acquisition weights for the node's dedicated energy storage state of charge and adjustable power should be increased from the default values, and the acquisition frequency should be increased accordingly. If the voltage fluctuations of a local-level load frequently exceed the limit, the acquisition weights and frequencies for the node's real-time load power and core load identifier should be increased to ensure data real-time performance. The resource allocation logic, which refers to the hardware resource allocation rules, is also adjusted. If the energy storage response of a higher-level node is slow, instructions can be sent to its energy storage control unit to adjust the charging and discharging current limits and response sensitivity. If there is a large power gap when the local-level node is disconnected from the grid, redundant power can be requested from the higher level, while simultaneously prioritizing charging the local energy storage to a high state of charge to ensure a switching buffer.

[0049] The optimization of the dynamic adaptation strategy focuses on the calculation parameters of the risk power balance algorithm. In terms of weight optimization, if the source-level stability weight is too high during the summer load peak, ignoring the risk of upstream faults, the stability weight can be lowered and the fault severity weight can be increased, based on the proportion of switching failures caused by faults in this scenario. In terms of threshold optimization, if the local-level leniency threshold fluctuation exceeds the standard, its voltage deviation range can be compressed; if the instability of the large power grid leads to an increase in the grid connection failure rate, the adaptation threshold can be increased to improve the grid connection standard.

[0050] The optimization is performed in cycles of three complete switches. The adjusted parameters and switching effects are evaluated and stored to form an experience base, which can be directly called upon in subsequent similar scenarios to achieve long-term iteration and ensure smooth and reliable switching in different scenarios.

[0051] The foregoing has illustrated and described the basic features, principles, and advantages of the present invention. It should be noted that the present invention is not limited to the above embodiments, but only to some embodiments. Any improvements and additions made without departing from the spirit and scope of the present invention are considered to be within the scope of protection of the present invention.

Claims

1. A method for smooth switching between grid connection and off-grid operation in integrated source-grid-load-storage microgrids, characterized in that, include: The hierarchical collaborative construction steps involve setting up a hierarchical collaborative mechanism based on the microgrid's management and control levels. These levels include the source level, the upper-level node level, and the local level. The hierarchical collaborative mechanism collects operational status data from each level in real time and integrates and processes the data to generate a hierarchical status matrix. The dynamic adaptation and adjustment step involves calculating the switching mode adaptation coefficient and switching threshold parameter of the hierarchical state matrix through a preset dynamic adaptation strategy, and generating a switching control command based on the switching mode adaptation coefficient and switching threshold parameter. The switching control command includes a switching mode command, a threshold parameter, and a hierarchical collaborative correction identifier. The two-stage switching process involves performing pre-switching and actual switching according to the switching control command and switching threshold parameters, and collecting feedback correction data during the switching process. The feedback correction data is then sent back to the hierarchical coordination mechanism and dynamic adaptation adjustment, respectively. After receiving feedback correction data, the hierarchical collaboration mechanism adjusts the collection weights of operational status data at each level and the corresponding resource configuration logic. After receiving feedback correction data, the dynamic adaptation strategy optimizes and updates the calculation parameters of the preset algorithm.

2. The method for smooth switching between grid connection and off-grid operation in a microgrid integrating source, grid, load, and storage as described in claim 1, is characterized in that, In the hierarchical collaborative construction step, the source-level operational status data includes power grid supply stability information, switching device operating status information, and short-circuit fault early warning information; The operational status data of the upper-level node includes node fault severity information, state of charge information of the upper-level node's dedicated energy storage, and adjustable power information. The local-level operating status data includes real-time load power information, local-level energy storage remaining power information, and core load power supply demand identifiers. The hierarchical collaboration mechanism collects operational status data at each level through a distributed monitoring unit. The collected operational status data at each level is integrated into a hierarchical status matrix according to a preset format of hierarchical identifier, data type, value, and collection timestamp.

3. The method for smooth switching between grid connection and off-grid operation in a microgrid integrating source, grid, load, and storage as described in claim 1, is characterized in that... The dynamic adaptation and adjustment step includes calculating the handover mode adaptation coefficient and handover threshold parameters using a risk power balance algorithm, specifically including: Based on the hierarchical state matrix, source-level grid power supply stability information and upper-level node fault severity information are extracted. The grid power supply stability information is quantified into a stability value; the larger the stability value, the stronger the grid power supply stability. The node fault severity information is quantified into a severity level. The stability value and the severity level are weighted according to preset weights to obtain the grid-connected / off-grid adaptation coefficient, and a corresponding adaptation threshold is preset. If the adaptation coefficient is greater than the preset adaptation threshold, the output switching mode is grid-connected mode; if the adaptation coefficient is less than the preset threshold, the output switching mode is off-grid mode. Based on the hierarchical state matrix, upper-level adjustable power information and local-level real-time load power information are extracted again. The difference ratio between the real-time load power and the adjustable power is calculated, and the pre-switching trigger threshold and the actual switching execution threshold are determined based on the difference ratio.

4. The method for smooth switching between grid connection and off-grid operation in a microgrid integrating source, grid, load, and storage as described in claim 1, is characterized in that, The two-stage switching steps include: When performing a pre-switching, the pre-switching trigger threshold in the switching control command is used as the start condition. When the microgrid operating parameters are detected to reach the threshold, the pre-switching is initiated. Simultaneously, the voltage deviation change rate data and the adjustment response time data of the upper-level node-level dedicated energy storage are collected as feedback data for the pre-switching stage. The data is then transmitted back to the hierarchical coordination mechanism according to a preset cycle. After receiving the data, the hierarchical coordination mechanism presets a response threshold. If the response time is greater than the preset response threshold, the adjustable power assessment value of the corresponding upper-level node is immediately reduced. The reduction magnitude is linearly positively correlated with the proportion of the response time exceeding the threshold. When performing an actual handover, the actual handover execution threshold is used as the trigger condition. Once the threshold is reached, the arc-free handover device is triggered to perform the handover action. The load voltage fluctuation value and handover time data are collected in real time as feedback data for the execution stage and sent back to the dynamic adaptation strategy. After receiving the data, the dynamic adaptation strategy presets the fluctuation threshold. If the fluctuation value is greater than the preset fluctuation threshold, the corresponding level identifier is recorded and the threshold parameter is tightened.

5. The method for smooth switching between grid connection and off-grid operation in a microgrid integrating source, grid, load, and storage as described in claim 2, is characterized in that, The hierarchical collaborative construction steps also include constructing an emergency response triggered by short-circuit fault early warning information. The hierarchical collaborative mechanism monitors short-circuit fault early warning information at the source level and the upper-level node level in real time. When such information is detected at any level, an emergency response is immediately triggered. The hierarchical collaborative mechanism sends an emergency cut-off command to the source-level switching device and generates an energy storage lock signal, which is sent to the unit used for upper-level node-level dedicated energy storage control to lock its discharge function. The hierarchical collaborative mechanism sends an emergency response trigger signal to the dynamic adaptation strategy. The dynamic adaptation strategy stops conventional algorithm calculation and generates a switching mode command for emergency off-grid and local-level energy storage priority power supply. After the pre-switching is completed in the two-stage switching step, a switching success signal is generated and sent back to the hierarchical collaborative mechanism. The hierarchical collaborative mechanism generates an energy storage unlock signal and a power replenishment command again, which are sent to the unit used to control the upper-level node-level dedicated energy storage to unlock the discharge function and control it to supply power according to the power replenishment needs of the local-level energy storage.

6. The method for smooth switching between grid connection and off-grid operation in a microgrid integrating source, grid, load, and storage as described in claim 1, is characterized in that, The hierarchical state matrix contains data priority identifiers, which include highest priority, medium priority, and normal priority. A preset severity level threshold is set. When the severity of a fault at the upper-level node is greater than the preset threshold, the priority of the fault severity information and the corresponding upper-level node-specific energy storage charge state information is set to the highest priority. When a core load power demand identifier exists at the local level, the local real-time load power information and the core load power demand identifier are given the highest priority. After receiving the matrix, the dynamic adaptation strategy prioritizes calculations based on the highest priority data to ensure that key data participates in decision-making first.

7. The method for smooth switching between grid connection and off-grid operation in a microgrid integrating source, grid, load, and storage as described in claim 3, is characterized in that... The dynamic adaptation and adjustment step further includes, when calculating the switching threshold parameters through the risk power balance algorithm, extracting the local-level real-time load power deviation based on the hierarchical state matrix, setting a preset deviation threshold, extracting the adjustable power information of the upper-level node, setting a preset power threshold, and if the real-time load power deviation is less than the preset threshold and the adjustable power is greater than a preset multiple of the real-time load power, setting the pre-switching trigger threshold to a lenient threshold to reduce the probability of false switching triggering; if the real-time load power deviation is greater than the preset threshold and the adjustable power is less than a preset multiple of the real-time load power, setting the pre-switching trigger threshold to a tightened threshold to initiate the pre-switching reserved adjustment time in advance. The specific values ​​of the lenient threshold and the tightened threshold are determined based on the historical operating data of the microgrid over the past 6 months.

8. The method for smooth switching between grid connection and off-grid operation in a microgrid integrating source, grid, load, and storage as described in claim 4, is characterized in that, The dual-stage switching step further includes the feedback correction data transmitted back by the dual-stage switching step, which includes voltage deviation change rate, energy storage regulation response time, load voltage fluctuation value, and switching time. When the hierarchical coordination mechanism receives the data, it calculates the average value of the energy storage regulation response time data collected three times consecutively at the same upper-level node. If the average value is greater than the preset response threshold, it generates an energy storage parameter adjustment command and sends it to the unit used for dedicated energy storage control at the upper-level node to adjust its charging and discharging current limit parameters and response sensitivity parameters. After the dynamic adaptation strategy receives the data, it statistically analyzes the load voltage fluctuation values ​​collected five times consecutively at the same local level. If the fluctuation value is greater than the preset fluctuation threshold, it records the level identifier corresponding to the local level. When calculating the pre-switching trigger threshold and the actual switching execution threshold corresponding to the next level, it further tightens both the pre-switching trigger threshold and the actual switching execution threshold until the subsequent three consecutive fluctuation values ​​are less than the preset fluctuation threshold, at which point the tightening stops.