Methods, devices, equipment and storage media for coordinating active and reactive power in grid-based energy storage

By constructing a safe and feasible support domain and a continuous action coordination and allocation strategy, the problem of insufficient active and reactive power allocation in grid-type energy storage systems with a high proportion of new energy sources has been solved, achieving dynamic coordination support of frequency and voltage and improving system stability.

CN123121870APending Publication Date: 2026-11-17STATE GRID XINJIANG ELECTRIC POWER CO KEZHOU POWERSUPPLY CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611278675.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In high-proportion renewable energy power systems, the active and reactive power of grid-connected energy storage are constrained by the capacity of the same converter. Existing technologies are unable to dynamically adjust the active and reactive power support capabilities when there are frequency deviations and voltage drops, and cannot effectively meet the needs of coordinated frequency and voltage distribution.

Method used

By characterizing the active frequency support requirements and reactive voltage support requirements of grid-type energy storage, and combining the energy storage state of charge, power limits and converter capacity, a safe and feasible support domain is constructed. A continuous action coordination and allocation strategy is adopted to dynamically adjust the active and reactive power commands to meet the system stability requirements.

Benefits of technology

It achieves dynamic coordination and allocation when frequency and voltage demands coexist, ensuring that the active and reactive power support capabilities of the energy storage system meet real-time constraints, improving the frequency and voltage stability margins of the system, and providing a comprehensive evaluation of frequency and voltage stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123121870A_ABST
    Figure CN123121870A_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, equipment, and storage medium for active and reactive power coordination in grid-based energy storage, relating to the field of coordinated control technology for grid-based energy storage in power systems. The method includes: determining the active and reactive power support requirements of grid-based energy storage; constructing a safe and feasible support domain based on the energy storage's state of charge, power limits, and converter capacity; calculating online frequency and voltage stability margins, and combining them with system dynamics and available support capacity to form a margin enhancement state; inputting the margin enhancement state into a continuous action coordination allocation strategy to obtain active and reactive power allocation actions and generate initial power commands; constructing immediate rewards and defining system security costs, updating them using a SAC coordination allocation strategy based on reward distribution and security constraints, and projecting the power commands onto the safe and feasible support domain before execution; and performing closed-loop coordination at each control moment. This invention can achieve dynamic coordinated allocation of active and reactive power support capabilities under limited converter capacity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system energy storage control technology, and in particular to a method, apparatus, equipment and storage medium for coordinating active and reactive power in grid-type energy storage. Background Technology

[0002] With the large-scale integration of renewable energy sources such as photovoltaics and wind power into the power system, the proportion of traditional synchronous generators is gradually decreasing. This weakens the system's inertia, damping, and voltage support capabilities, making the grid frequency and node voltage more sensitive to power fluctuations and network faults. Under active power disturbances such as sudden drops in renewable energy power and sudden load surges, the system may experience problems such as increased frequency change rate, a decrease in the frequency minimum point, and prolonged recovery time. In the event of line faults and insufficient reactive power support, significant voltage drops may also occur at critical nodes. Grid-based energy storage can establish voltage and frequency references and utilize the rapid, bidirectional power regulation capabilities of energy storage devices to provide active frequency support and reactive voltage support. Therefore, it has promising application prospects in the safe and stable operation of high-proportion renewable energy power systems.

[0003] However, the active and reactive power provided by grid-based energy storage are constrained by the capacity of the same converter, and they are not independent during disturbances. When frequency deviation and voltage drop occur simultaneously, the limited converter capacity needs to be rationally allocated between active and reactive power support. Existing research on grid-based energy storage mainly focuses on the design of virtual inertia, damping, and droop parameters, or separately studies issues such as frequency support, voltage support, fault ride-through, and current limiting, but does not adequately consider the coordinated allocation of active and reactive power when frequency and voltage risks change dynamically during disturbances. Using a fixed allocation ratio is difficult to adapt to changes in dominant stability requirements in a timely manner, while directly determining power allocation based on a single instantaneous index is difficult to take into account constraints such as the energy storage's state of charge, power limits, and shared converter capacity. Therefore, there is an urgent need for a coordination method that can sense the system's frequency and voltage stability state and dynamically adjust the active and reactive power support capabilities of grid-based energy storage according to stability requirements. Summary of the Invention

[0004] This invention provides a method, apparatus, equipment, and storage medium for coordinating active and reactive power in grid-connected energy storage. The aim is to address the dynamic changes in frequency and voltage stability requirements during disturbances in high-proportion renewable energy power systems, as well as the constraints on the active and reactive power of grid-connected energy storage due to shared converter capacity. By characterizing the active frequency support requirements and reactive voltage support requirements of grid-connected energy storage, and combining the energy storage's state of charge, power limits, and converter capacity, a real-time safe and feasible support domain is constructed. Based on this domain, dynamic coordination and allocation of active and reactive power support capabilities are achieved.

[0005] In a first aspect, the present invention provides a method for coordinating active and reactive power in grid-type energy storage, the method comprising: Obtain the real-time frequency, frequency change rate, and voltage amplitude of selected key nodes of the power system; determine the active frequency support requirements of grid-type energy storage based on the system frequency deviation and frequency change rate; and determine the reactive voltage support requirements based on the minimum voltage of key nodes. Based on the current state of charge, rated energy storage capacity, active power limit, reactive power limit, and rated apparent power of the converter, the available active power support capacity and available reactive power support capacity under the current operating state are calculated. Based on the active power boundary, reactive power boundary, shared converter capacity, and state of charge constraints, the safe and feasible support domain of the grid-type energy storage at the current moment is constructed. Based on the system's real-time frequency, frequency change rate, and minimum voltage of key nodes, the online frequency stability margin and online voltage stability margin at the current moment are calculated respectively, and the system's real-time dynamic quantities, online stability margin, and the current available support capacity of grid-type energy storage are combined to form the margin enhancement state. The margin enhancement state is input into the continuous action coordination and allocation strategy to obtain active and reactive power allocation actions. The active and reactive power allocation actions are mapped to active power support weights and reactive power support weights. Based on support requirements and real-time available support capabilities, an initial active and reactive power command is generated. Construct an instant reward system that includes online stability margin, converter power utilization, and change in action, and define system-level safety costs. Use a SAC coordination allocation strategy based on reward distribution and safety constraints to determine the dynamic allocation of active and reactive power support capabilities. Map the initial active and reactive power commands obtained from the coordination allocation to the safe and feasible support domain to obtain the actual executed grid-type energy storage power commands. At each control moment, the system frequency, rate of change of frequency, voltage of key nodes, and state of charge and power operation status of grid-type energy storage are collected. The available support capacity calculation, online stability margin update, margin enhancement state construction, active and reactive power coordination allocation, and safe feasible domain projection are completed in sequence. The projected active and reactive power commands are applied to the grid-type energy storage. After the system state is updated, the stability margin calculation and coordination allocation are carried out again at the next control moment.

[0006] In one possible design, the active frequency support requirement and the reactive voltage support requirement are determined by the following formula: (1) in, for The active frequency support demand for grid-type energy storage at all times; for The reactive power and voltage support requirements of grid-connected energy storage at all times; for The normalized deviation of the system's angular frequency from its rated angular frequency at any given moment; for The rate of change of the system frequency at any given time is normalized relative to the allowable range of change. Active power-frequency droop factor; The equivalent damping parameters for grid-type energy storage; Virtual inertia parameters for grid-type energy storage; As a key node exist Voltage amplitude at any given moment; This refers to the set of key nodes participating in voltage stability evaluation. This is the lowest voltage at critical nodes; This is the voltage reference value; Reactive power minus voltage droop factor; Represents the maximum value function; This represents the minimum value function.

[0007] In one possible design, based on the current state of charge of the grid-type energy storage, rated energy storage capacity, active power limit, reactive power limit, and rated apparent power of the converter, the available active power support capacity and available reactive power support capacity under the current operating condition are calculated using the following formula: (2) in, for The state of charge of grid-connected energy storage at all times; This is the limit of the state of charge; Rated energy for energy storage; Preset support duration; Available active power is limited by the remaining energy storage capacity; and They are respectively It can always be supported by both active and reactive power; and These are the upper limits of active and reactive power for grid-type energy storage, respectively. and These represent the current active and reactive power outputs, respectively. The rated apparent power capacity of the grid-type energy storage converter is used to limit the combined output capacity of active and reactive power. Based on active power boundary, reactive power boundary, shared converter capacity, and state of charge constraints, the following formula is used to construct... The safe and feasible support domain for grid-based energy storage at all times: (3) in, for The field of safe and feasible support for grid-type energy storage with both active and reactive power functions at all times; and These are the candidate active power and reactive power commands, respectively. and These are the lower limits of active and reactive power, respectively. and These represent the minimum and maximum states of charge that grid-connected energy storage systems are allowed to operate at; To control the time interval; The state of charge of grid-type energy storage at the next control moment after the current control action is executed; The initial active and reactive power commands obtained through coordinated allocation are mapped to the secure and feasible support domain, and the actual executed grid-type energy storage power commands are obtained through the following formula: (4) in, The initial active and reactive power command before safety constraint processing. and These are the initial active and reactive power commands before the safe feasible region is projected, respectively. This is the matrix transpose operator; This refers to the actual power command for grid-based energy storage. and These are the active power command and reactive power command that are actually sent to the grid-type energy storage execution unit after projection processing, respectively. The safe and feasible support domain projection operator is used to map the initial power command to an executable power space that satisfies the converter's apparent power constraints, state of charge constraints, and active and reactive power output boundary constraints. express The safety and feasibility of grid-type energy storage is supported by constant monitoring.

[0008] In one possible design, based on the system's real-time frequency, rate of frequency change, and minimum voltage at critical nodes, the online frequency stability margin and online voltage stability margin are calculated using the following formulas: (5) in, for Always online frequency stability margin; for Always maintain online voltage stability margin; This refers to the system's real-time frequency. The rated frequency; This is the lower limit of the minimum frequency safety boundary that the system is allowed to operate at. The real-time frequency change rate of the system; This is the safety boundary limit for the maximum allowable rate of frequency change of the system; This is the lowest voltage at critical nodes; This is the rated voltage amplitude; This is the lowest voltage safety boundary that allows critical nodes to operate. The system's real-time dynamic parameters, online stability margin, and the current available supporting capacity of grid-type energy storage are collectively constituted as the margin enhancement state, which is expressed by the following formula: (6) in, for Margin-enhanced state vectors for coordinating and allocating policy inputs at all times; This represents the system frequency deviation.

[0009] In one possible design, the active and reactive power allocation actions are mapped to active power support weights and reactive power support weights, and an initial active and reactive power command is generated based on support requirements and real-time available support capacity using the following formula: (7) in, and Acting on available active power support capacity respectively and available reactive power support capacity This is used to convert the coordinated allocation result into an initial power command in the corresponding direction, and satisfies... , as well as ; and These are the initial active and reactive power commands before the safe feasible region is projected.

[0010] In one possible design, an instantaneous reward system is constructed, including online stability margin, converter power utilization, and changes in operation. A system-level safety cost is defined, and a SAC (Safety and Reactive Power Acquisition) coordination allocation strategy based on reward distribution and safety constraints is used to determine the dynamic allocation of active and reactive power support capabilities. The initial active and reactive power commands obtained from the coordination allocation are mapped to the safe and feasible support domain to obtain the actually executed grid-type energy storage power commands, including: The instantaneous reward, which includes online stability margin, converter power utilization, and changes in operation, is expressed by the following formula: (8) in, for Instant rewards; and These are the stability margin related weighting coefficients; , and These are the non-negative coefficients corresponding to active power utilization, reactive power utilization, and changes in operation, respectively. Coordinate and allocate actions for the previous control moment; for The continuous action variables output by the constantly coordinated allocation strategy are used to generate active and reactive power support weights. System-level security costs are defined by the following formula: (9) in, for Real-time system security costs; , and These are the non-negative weighting coefficients corresponding to the lower limit of frequency, the limit of rate of change of frequency, and the lower limit of voltage, respectively. The positive part operation is defined as follows: , is used to represent the effective constraint violation amount after variable x exceeds the safety boundary; Based on the reward distribution corresponding to state actions, the lower tail reward is calculated. A policy optimization objective is constructed with the goal of maximizing the sum of the lower tail reward and the policy entropy while minimizing the cumulative security cost. The coordination and allocation policy is then updated using this policy optimization objective. The policy optimization objective is expressed as follows: (10) in, State-action pair The corresponding lower tail return estimate; The number of returns sorted in ascending order One return quantile; The number of quantiles reported; To retain a proportion of tail returns; The number of quantiles participating in the calculation of the lower tail return; This is a floor function; To optimize the strategy objectives; For mathematical expectation operations; For parameters The random strategy; The strategy entropy coefficient; State-action pair The corresponding cumulative safety cost function calculates the system safety cost generated during each control cycle from the current control time to the termination time. The result is obtained by summing. This refers to the control point during the accumulation of safety costs. The time at which the cumulative safety cost calculation terminates; It is a non-negative safety multiplier used to adjust the influence of the cumulative safety cost constraint term on the policy optimization objective; The active and reactive power allocation actions are generated according to the updated coordination and allocation strategy. An initial active and reactive power command is generated based on the active and reactive power allocation actions. The initial active and reactive power command is projected onto the safe and feasible support domain to obtain the actual executed grid-type energy storage power command.

[0011] In one possible design, during the coordinated allocation process at each control moment, when the disturbance response ends, the minimum frequency, maximum rate of change of frequency, minimum voltage of critical nodes, and frequency and voltage recovery times are extracted within a preset observation time range. The full frequency stability margin, full voltage stability margin, comprehensive stability margin, and weighted stability margin are calculated using the following formulas: (11) in, For complete frequency stability margin; For complete voltage stability margin; For overall stability margin; For weighted stability margin; This represents the lowest system frequency within the observation timeframe. The maximum absolute rate of change; This represents the lowest voltage at all critical nodes within the observation timeframe. and These are the frequency recovery time and the voltage recovery time, respectively. and These are the maximum allowable frequency recovery time and the maximum voltage recovery time, respectively. and These are the non-negative weighting coefficients for the frequency side and the voltage side, respectively. ; The full frequency stability margin, full voltage stability margin, comprehensive stability margin, and weighted stability margin are used to evaluate the comprehensive stability level of the system's frequency and voltage under this disturbance scenario.

[0012] Secondly, the present invention provides a grid-type energy storage active and reactive power coordination device, the device comprising: The demand determination module is configured to acquire the real-time frequency, frequency change rate, and voltage amplitude of selected key nodes of the power system, determine the active frequency support demand of grid-type energy storage based on the system frequency deviation and frequency change rate, and determine the reactive voltage support demand based on the minimum voltage of key nodes. The feasible support domain determination module is configured to calculate the available active power support capacity and available reactive power support capacity under the current operating state based on the current state of charge of the grid-type energy storage, rated energy storage capacity, active power limit, reactive power limit, and rated apparent power of the converter, and construct the safe and feasible support domain of the grid-type energy storage at the current moment based on the active power boundary, reactive power boundary, shared converter capacity, and state of charge constraints. The margin enhancement module is configured to calculate the online frequency stability margin and online voltage stability margin at the current moment based on the system's real-time frequency, frequency change rate, and minimum voltage of key nodes, and to combine the system's real-time dynamic quantities, online stability margin, and the current available support capacity of the grid-type energy storage into a margin enhancement state. The initial instruction generation module is configured to input the margin enhancement state into the continuous action coordination allocation strategy to obtain active and reactive power allocation actions, map the active and reactive power allocation actions to active power support weights and reactive power support weights, and generate initial active and reactive power instructions based on support requirements and real-time available support capabilities. The execution instruction generation module is configured to construct an instant reward including online stability margin, converter power utilization level and action change amount, and define system-level safety cost. It adopts a SAC coordination allocation strategy based on reward distribution and safety constraints to determine the dynamic allocation of active and reactive power support capabilities, and maps the initial active and reactive power instructions obtained by coordination allocation to the safe and feasible support domain to obtain the actual executed grid-type energy storage power instructions. The closed-loop coordination support module is configured to collect system frequency, frequency change rate, key node voltage, and state of charge and power operation status of grid-type energy storage at each control moment. It sequentially completes the calculation of available support capacity, online stability margin update, margin enhancement state construction, active and reactive power coordination allocation, and safe feasible domain projection. It then applies the projected active and reactive power commands to the grid-type energy storage. After the system state is updated, the stability margin calculation and coordination allocation are performed again at the next control moment.

[0013] Thirdly, embodiments of the present invention provide an electronic device, comprising: at least one processor and a memory; the memory storing computer execution instructions; the at least one processor executing the computer execution instructions stored in the memory, causing the at least one processor to execute the active and reactive power coordination method for grid-type energy storage as described in the first aspect and various possible designs of the first aspect.

[0014] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the active and reactive power coordination method for grid-type energy storage as described in the first aspect and various possible designs of the first aspect.

[0015] Fifthly, embodiments of the present invention provide a computer program product, including a computer program, which, when executed by a processor, implements the active and reactive power coordination method for grid-type energy storage as described in the first aspect and various possible designs of the first aspect.

[0016] The active and reactive power coordination method, apparatus, equipment, and storage medium for grid-type energy storage provided by this invention have at least the following beneficial effects: This invention characterizes the changes in frequency and voltage stability requirements during disturbances using online frequency stability margin and online voltage stability margin, and continuously coordinates the allocation of power based on the real-time available active and reactive power support capabilities of grid-based energy storage. It projects constraints on initial active and reactive power commands through a safe and feasible support domain, ensuring that the actual executed grid-based energy storage power commands meet the requirements of energy storage state of charge, power limits, and shared converter capacity. It enhances the sensitivity of the coordinated allocation strategy to adverse response outcomes through lower tail rewards and system safety costs, and constrains the exceedance of system frequency, rate of change of frequency, and voltage limits at critical nodes. This invention can adjust the allocation priority of active and reactive power support for grid-based energy storage based on changes in the system's stable state when both frequency and voltage support requirements coexist. After the disturbance response ends, it provides a unified evaluation of the post-disturbance frequency stability, voltage stability, and overall stability levels using complete frequency stability margin, complete voltage stability margin, comprehensive stability margin, and weighted stability margin. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0018] Figure 1 This is a general framework diagram of a grid-type energy storage active and reactive power coordination method provided in an embodiment of the present invention; Figure 2 A flowchart of a method for coordinating active and reactive power in grid-type energy storage provided in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the closed-loop coordination and support process for grid-type energy storage active and reactive power in an embodiment of the present invention. Figure 4 A schematic diagram of the improved IEEE 39-node system and the grid-type energy storage access location provided in an embodiment of the present invention; Figure 5 A comparison diagram of system frequency response under active power disturbance provided for embodiments of the present invention; wherein, (a) the power of new energy sources decreases; and (b) the load increases. Figure 6 This is a comparison diagram of the voltage recovery response of key nodes under line faults provided in an embodiment of the present invention; Figure 7 A comparison diagram of system frequency and key node voltage response under combined disturbances provided in an embodiment of the present invention; wherein, (a) frequency response; (b) voltage response of node 16; Figure 8 The diagram shows the active and reactive power support output and allocation weights of a grid-type energy storage system under combined disturbances, as provided in this embodiment of the invention. (a) Active power support output; (b) Reactive power support output; (c) Active power allocation weights; (d) Reactive power allocation weights. Figure 9 The following is a comparison chart of frequency and voltage stability margins under different disturbance scenarios and support methods provided in the embodiments of the present invention; wherein, (a) frequency stability margin; (b) voltage stability margin; (c) overall stability margin; Figure 10 This is a weighted stability margin heatmap provided by embodiments of the present invention under different disturbance scenarios and support methods; Figure 11 This is a structural diagram of a grid-type energy storage active and reactive power coordination device provided in an embodiment of the present invention.

[0019] The accompanying drawings have illustrated specific embodiments of the invention, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the invention in any way, but rather to illustrate the concept of the invention to those skilled in the art through reference to specific embodiments. Detailed Implementation

[0020] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0021] In the technical solution of this invention, the collection, storage, use, processing, transmission, provision and disclosure of relevant data and information comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0022] It should be noted that in the embodiments of the present invention, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of the present invention. However, they do not mean that the inventor has used or necessarily used the solution.

[0023] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.

[0024] Example 1: This invention provides a method for coordinating active and reactive power in grid-type energy storage. Figure 1 This is a general framework diagram of a grid-type energy storage active and reactive power coordination method provided in an embodiment of the present invention. The entire framework includes an online margin sensing module, a stability margin-guided active and reactive power coordination module, a post-disturbance stability margin evaluation module, and a support effect output module; the online margin sensing module outputs online frequency stability margin. With online voltage stability margin ;Will , The input is fed into a stability margin-guided active and reactive power coordination module, which internally includes converter capacity and state-of-charge constraints. P - f Channel, margin-driven allocation, Q - V The channel, in which the converter capacity and state of charge constraints include constraint formulas. as well as , P ess For grid-type energy storage, the actual output active power is... Q ess The actual reactive power output of grid-type energy storage is... S ess The rated apparent power of the converter is given by [reference to power rating], and SOC is the real-time state of charge of the grid-connected energy storage system. This is the limit of the state of charge. This represents the upper limit of the state of charge. P - f The channel provides virtual inertia support, fast frequency response, and active power support, thus supporting the active power supply requirements. Q - V The channel provides voltage support, reactive power response, and voltage regulation, outputting reactive power support to meet demand; margin-driven distribution receives data from... P - f aisle, Q - V The inputs of the channel and the online margin sensing module , Output active power support weight Reactive power support weight And then according to , Generate initial active power command Initial reactive power command After constraint processing, the actual output active power of the energy storage is... P ess Actual output reactive power Q ess ; P ess , Q ess On one hand, the output is sent to the post-disturbance stability margin evaluation module; on the other hand, it is fed back to the online margin sensing module through system response updates and online margin recalculation, forming a closed-loop control. The post-disturbance stability margin evaluation module is used to calculate the full frequency stability margin. Complete voltage stability margin Overall stability margin Weighted stability margin After the disturbance, the stability margin evaluation module sends the evaluation results to the support effect output module. The support effect output module outputs the visualized results of frequency recovery, voltage recovery and stability improvement, completing the closed-loop control and effect evaluation of the active and reactive power coordination of the grid-type energy storage.

[0025] like Figure 2 As shown, the active and reactive power coordination method of the grid-type energy storage includes the following steps S10-S60.

[0026] S10: Obtain the real-time frequency, frequency change rate, and voltage amplitude of selected key nodes of the power system; determine the active frequency support requirements of grid-type energy storage based on the system frequency deviation and frequency change rate; and determine the reactive voltage support requirements based on the minimum voltage of key nodes.

[0027] Step S10 is used to determine the active and reactive power support requirements of grid-based energy storage. Active frequency support requirements are determined jointly based on the normalized frequency deviation and the normalized frequency change rate. The frequency deviation reflects the degree of steady-state frequency shift, and the frequency change rate reflects the initial frequency drop rate during a disturbance. The combination of these two factors simultaneously characterizes the severity of the disturbance and the initial inertial response requirements. Reactive voltage support requirements are determined based on the deviation between the minimum voltage at critical nodes and the voltage reference value. When the voltage at critical nodes drops, grid-based energy storage provides reactive power support based on this voltage deviation. Step S10 quantifies the real-time operating status of frequency and voltage into active and reactive power support requirements, providing a benchmark for subsequent coordinated allocation.

[0028] In some embodiments, an exemplary implementation of step S10 is provided. Specifically, the real-time frequency of the power system, the rate of frequency change, and the voltage amplitude of selected key nodes are obtained. The active power frequency support requirement for grid-based energy storage is determined based on the system frequency deviation and the rate of frequency change, and the reactive power voltage support requirement is determined based on the minimum voltage of the key nodes. The active power and reactive power support requirements of grid-based energy storage are expressed as Equation (1): (1) in, for The active frequency support demand for grid-type energy storage at all times; for The reactive power and voltage support requirements of grid-connected energy storage at all times; for The normalized deviation of the system's angular frequency from its rated angular frequency at any given moment; for The rate of change of the system frequency at any given time is normalized relative to the allowable range of change. Active power-frequency droop factor; This is the equivalent damping parameter for grid-type energy storage, used to describe the damping support capability of energy storage to frequency changes; This is a virtual inertia parameter for grid-type energy storage, used to describe the inertial response capability of energy storage to the rate of frequency change. As a key node exist Voltage amplitude at any given moment; This refers to the set of key nodes participating in voltage stability evaluation. This is the lowest voltage at critical nodes; This is the voltage reference value; Reactive power minus voltage droop factor; This represents the maximum value function, used to select the maximum value from multiple input values; This represents a minimum value function, used to select the minimum value from multiple input quantities.

[0029] S20: Based on the current state of charge, rated energy storage capacity, active power limit, reactive power limit, and rated apparent power of the converter, calculate the available active power support capacity and available reactive power support capacity under the current operating state, and construct the safe and feasible support domain of the grid-type energy storage at the current moment based on the active power boundary, reactive power boundary, shared converter capacity, and state of charge constraints.

[0030] Step S20 is used to construct the active and reactive power safety and feasibility support domain for grid-based energy storage. The available active power support capacity is jointly limited by three factors: the active power limit, the power limit corresponding to the remaining energy storage capacity, and the remaining capacity of the shared converter. The minimum value among these three factors is taken as the available active power support capacity at the current moment. The available reactive power support capacity is jointly limited by the reactive power limit and the remaining capacity of the shared converter. The minimum value between these two factors is taken as the available reactive power support capacity at the current moment. The safety and feasibility support domain further constrains the active power boundary, reactive power boundary, shared converter capacity, and state of charge of candidate active power commands and candidate reactive power commands to ensure that the actual executable power commands meet the various operational limitations of the energy storage equipment.

[0031] In some embodiments, an exemplary implementation of step S20 is provided. Specifically, based on the current state of charge of the grid-type energy storage, the rated energy storage capacity, the active power limit, the reactive power limit, and the rated apparent power of the converter, the available active power support capacity and the available reactive power support capacity under the current operating state are calculated. Considering the remaining energy storage capacity and the active and reactive power shared converter capacity, the available support capacity is expressed as Equation (2): (2) in, for The state of charge of grid-connected energy storage at all times; This is the limit of the state of charge; Rated energy for energy storage; The preset support duration is used to convert the remaining energy storage capacity into a power constraint that meets the continuous support requirements; The available active power is limited by the remaining energy storage capacity, representing the maximum continuous active power support capacity determined by the remaining energy storage capacity constraint after considering the current state of charge and the preset support time. and They are respectively It can always be supported by both active and reactive power; and These are the upper limits of active and reactive power for grid-type energy storage, respectively. and These represent the current active and reactive power outputs, respectively. The rated apparent power capacity of the grid-type energy storage converter is used to limit the combined output capacity of active and reactive power.

[0032] Further considering active power boundaries, reactive power boundaries, shared converter capacity, and state of charge constraints, a system is constructed. The safe and feasible support domain for grid-based energy storage at all times: (3) in, for The field of safe and feasible support for grid-type energy storage with both active and reactive power functions at all times; and These are the candidate active power and reactive power commands, respectively. and These are the lower limits of active and reactive power, respectively. and These represent the minimum and maximum states of charge that grid-connected energy storage systems are allowed to operate at; To control the time interval; The state of charge of grid-type energy storage at the next control moment after the current control action is executed is used to describe the change in the energy storage state after the current active and reactive power support command is applied.

[0033] For the initial active and reactive power commands obtained through coordinated allocation, they are mapped to the safe and feasible support domain defined by equation (3) to obtain the actual executed grid-type energy storage power commands: (4) in, The initial active and reactive power command before safety constraint processing. and These are the initial active and reactive power commands before the safe feasible region is projected, respectively. This is the matrix transpose operator, used to represent the transposed form of a vector or matrix; This refers to the actual power command for grid-based energy storage. and These are the active power command and reactive power command that are actually sent to the grid-type energy storage execution unit after projection processing, respectively. The safe and feasible support domain projection operator is used to map the initial power command to an executable power space that satisfies the converter's apparent power constraints, state of charge constraints, and active and reactive power output boundary constraints. express This provides a secure and feasible support domain for grid-based energy storage. This ensures that the execution commands of grid-based energy storage meet power, state of charge, and shared converter capacity constraints.

[0034] S30: Based on the system's real-time frequency, frequency change rate, and minimum voltage of key nodes, calculate the online frequency stability margin and online voltage stability margin at the current moment, and combine the system's real-time dynamic quantities, online stability margin, and the current available support capacity of grid-type energy storage to form a margin enhancement state.

[0035] Step S30 is used to realize online voltage and frequency stability margin perception and state construction. The online frequency stability margin is calculated based on the frequency deviation and the frequency change rate, and the smaller value between the frequency margin and the frequency change rate margin is taken to characterize the distance between the current frequency operating state and the frequency safety boundary. The online voltage stability margin is calculated based on the minimum voltage of the critical node and is used to characterize the distance between the current voltage operating state and the voltage safety boundary. The smaller the values ​​of the online frequency stability margin and the online voltage stability margin, the closer the corresponding stability constraint is to the specified boundary, and the more urgent the dominant stability requirement on the corresponding side is. This online stability margin, together with the real-time dynamic quantity of the system and the available support capacity of energy storage, forms a margin enhancement state, enabling the coordinated allocation strategy to simultaneously perceive the current system stability state and the remaining support capacity of energy storage.

[0036] In some embodiments, an exemplary implementation of step S30 is provided. Specifically, based on the system's real-time frequency, rate of change of frequency, and minimum voltage of critical nodes, the frequency stability margin and voltage stability margin at the current moment are calculated respectively to characterize the proximity of the safety constraints on the frequency and voltage sides. The online stability margin is expressed as Equation (5): (5) in, for Always online frequency stability margin; for Always maintain online voltage stability margin; This refers to the system's real-time frequency. The rated frequency; This is the lower limit of the minimum frequency safety boundary that the system is allowed to operate at. The real-time frequency change rate of the system; This is the safety boundary limit for the maximum allowable rate of frequency change of the system; This is the lowest voltage at critical nodes; This is the rated voltage amplitude; This is the lowest voltage safety boundary that allows critical nodes to operate.

[0037] The system's real-time dynamic parameters, online stability margin, and the current available support capacity of grid-type energy storage are collectively considered to form the margin enhancement state: (6) in, for The margin-enhanced state vector of the constant-time coordinated allocation strategy input is composed of system frequency deviation, frequency change rate, voltage state, online stability margin, and current available energy storage support capacity, and is used to characterize the current system stability requirements and energy storage support capacity. This represents the system frequency deviation.

[0038] S40: Input the margin enhancement state into the continuous action coordination allocation strategy to obtain the active and reactive power allocation actions, map the active and reactive power allocation actions to active power support weights and reactive power support weights, and generate the initial active and reactive power command based on support requirements and real-time available support capabilities.

[0039] Step S40 is used to achieve coordinated active and reactive power allocation based on the stability margin state. The continuous action coordination allocation strategy outputs a continuous active and reactive power allocation action according to the margin enhancement state. After mapping, this active and reactive power allocation action yields active power support weights and reactive power support weights, the sum of which is always 1. The initial active power command is taken as the smaller value between the active power frequency support demand, the product of the active power support weight, and the available active power support capacity. The initial reactive power command is taken as the smaller value between the reactive power voltage support demand, the product of the reactive power support weight, and the available reactive power support capacity. Through this active and reactive power allocation action, the active power support capacity and reactive power support capacity are uniformly allocated, achieving coordinated allocation of active power support and reactive power support under the shared converter capacity constraint.

[0040] In some embodiments, an exemplary implementation of step S40 is provided. Specifically, the margin enhancement state shown in equation (6) is input into the continuous action coordination allocation strategy. The continuous action coordination allocation strategy is implemented using an existing agent reinforcement learning method. It is used to determine the dynamic allocation weight between active power support and reactive power support in the continuous action space based on the current system stability state, power support requirements, and the real-time available support capability of grid-type energy storage, and to generate corresponding active and reactive power support actions. The agent reinforcement learning method can be implemented using existing continuous action reinforcement learning algorithms, including the Soft Actor-Critic (SAC) algorithm, the Deep Deterministic Policy Gradient (DDPG) algorithm, etc. Compared with the discrete control method using a finite set of actions, the continuous action strategy can expand the adjustment range of control variables and realize the continuous adjustment of the ratio of active power support and reactive power support.

[0041] The continuous action coordination and allocation strategy outputs continuous action variables. ,in The continuous action variables are used to characterize the relative distribution tendency between active and reactive power support under the current disturbance conditions. When the value increases, it indicates that the coordination and allocation strategy tends to increase the allocation weight of active power support resources; when... When the value decreases, it indicates that the coordination and allocation strategy tends to increase the allocation weight of reactive power support resources.

[0042] Furthermore, the continuous action variables are normalized and mapped to obtain the active power support allocation weight and reactive power support allocation weight. Combined with the active frequency support demand and reactive voltage support demand determined by equation (1) and the real-time available support capacity calculated by equation (2), the initial active and reactive power command before safety constraint processing is generated.

[0043] (7) in, and Acting on available active power support capacity respectively and available reactive power support capacity This is used to convert the coordinated allocation result into an initial power command in the corresponding direction, and satisfies... , as well as ; and These are the initial active and reactive power commands before the projection of the safe and feasible domain. Through continuous operation, the active and reactive power support capabilities are uniformly allocated, achieving coordinated active and reactive power support under the constraints of shared converter capacity.

[0044] S50: Construct an instant reward system that includes online stability margin, converter power utilization, and change in action, and define system-level safety costs. Use a SAC coordination allocation strategy based on reward distribution and safety constraints to determine the dynamic allocation of active and reactive power support capabilities. Map the initial active and reactive power commands obtained from the coordination allocation to the safe and feasible support domain to obtain the actual executed grid-type energy storage power commands.

[0045] Step S50 is used to implement SAC coordinated allocation based on reward distribution and security constraints. The immediate reward consists of three components: a stability margin term, a converter power utilization term, and an action change term. The stability margin term encourages the coordinated allocation strategy to maintain high frequency and voltage stability margins. The converter power utilization term suppresses unnecessary converter power occupancy. The action change term suppresses abrupt changes in active and reactive power allocation actions between adjacent control moments. The system security cost is defined based on the lower frequency limit, the frequency change rate limit, and the lower voltage limit. When the system frequency, frequency change rate, or critical node voltage exceeds the limit, the corresponding security cost increases. The lower tail reward is calculated based on the reward distribution corresponding to the state action. The strategy optimization objective is constructed and the coordinated allocation strategy is updated with the goal of maximizing the sum of the lower tail reward and the strategy entropy while minimizing the cumulative security cost. This makes the coordinated allocation strategy more sensitive to adverse response results, while also constraining the frequency, frequency change rate, and voltage limits. The initial active and reactive power commands are projected onto the safe and feasible support domain so that the actual active and reactive power commands executed meet the energy storage state of charge, power limits and shared converter capacity requirements.

[0046] In some embodiments, an exemplary implementation of step S50 is provided. Specifically, to enable the coordinated allocation strategy to adjust the active and reactive power support priorities according to the frequency and voltage stability state, an instantaneous reward system is constructed, which includes online stability margin, converter power utilization level, and changes in operation. (8) in, for Instant rewards; and These are the stability margin related weighting coefficients; , and These are the non-negative coefficients corresponding to active power utilization, reactive power utilization, and changes in operation, respectively. Coordinate and allocate actions for the previous control moment; for The continuous action variables output by the constant coordination allocation strategy are used to generate active and reactive power support weights. The frequency and voltage support status are characterized by a stability margin term, and unnecessary power consumption and excessive action changes are suppressed by power utilization and action change terms.

[0047] Define system-level safety costs for frequency and voltage operating limits: (9) in, for Real-time system security costs; , and These are the non-negative weighting coefficients corresponding to the lower limit of frequency, the limit of rate of change of frequency, and the lower limit of voltage, respectively. The positive part operation is defined as follows: This represents the effective constraint violation amount after variable x exceeds the safety boundary. Based on the above system safety cost calculation results, the safety cost of the continuous control process is accumulated during the strategy optimization process, and the cumulative safety cost estimate under state-action conditions is used to represent the long-term safety constraint impact, thus obtaining the cumulative safety cost estimate. This is then used as a safety constraint in subsequent strategy optimization.

[0048] To account for the differences in reward distribution under different operating conditions, quantiles are used to represent the reward distribution corresponding to state actions, and lower quantile intervals are selected to construct the lower tail reward. Based on this, the lower tail reward, policy entropy, and safety cost are used together to coordinate the allocation of policy updates. (10) in, State-action pair The corresponding lower tail return estimate is used to measure the conservative return level of the strategy under adverse operating scenarios; The number of returns sorted in ascending order One return quantile; The number of quantiles reported; To retain a proportion of tail returns; The number of quantiles participating in the calculation of the lower tail return; This is a floor function; To optimize the strategy objectives; For mathematical expectation operations; For parameters The random strategy; This is the strategy entropy coefficient, used to adjust the randomness and exploration capability of the strategy; State-action pair The corresponding cumulative safety cost function is determined by the control time. Until the end time System security costs generated in each control cycle The summation is used to characterize the long-term impact of the current control action on the degree to which safety constraints are satisfied in subsequent operations; The safety multiplier is a non-negative safety multiplier used to adjust the influence of the cumulative safety cost constraint term on the policy optimization objective; the cumulative safety cost function serves as a safety constraint penalty term in the policy optimization objective, and is controlled by the safety multiplier. Adjust the degree of its influence; This refers to the control point during the accumulation of safety costs. The time at which the cumulative safety cost calculation ends.

[0049] Specifically, the system-level safety cost at the current control moment is calculated according to equation (9), and the system safety costs generated by each control cycle within the influence range of the current control action are accumulated to obtain the cumulative safety cost estimate under the corresponding state action condition. The cumulative safety cost estimate is used to describe the impact of the active and reactive power support actions generated by the continuous action coordination allocation strategy on the system frequency stability, voltage stability, and the degree of satisfaction of operating constraints, and participates in the strategy optimization process as a safety constraint term.

[0050] By introducing cumulative safety cost estimation, the continuous action coordination allocation strategy can comprehensively consider the adverse safety impact of the current control action, reduce the probability of action selection that may lead to increased frequency deviation, excessive frequency change rate, and voltage exceeding the limit of critical nodes, and improve the adaptability of the coordination support strategy to complex disturbance scenarios.

[0051] After completing the strategy training, the strategy parameters are kept fixed during the online operation phase. Active and reactive power allocation actions are generated according to the real-time status shown in Equation (6), and the initial active and reactive power commands are calculated according to Equation (7). The obtained initial commands are then projected onto the safe and feasible support domain according to Equation (4) before execution.

[0052] S60: At each control moment, the system frequency, frequency change rate, key node voltage, and the state of charge and power operation status of the grid-type energy storage are collected. The available support capacity calculation, online stability margin update, margin enhancement state construction, active and reactive power coordination allocation, and safe feasible domain projection are completed in sequence. The projected active and reactive power commands are applied to the grid-type energy storage. After the system state is updated, the stability margin calculation and coordination allocation are performed again at the next control moment.

[0053] Step S60 is used to achieve closed-loop coordinated support. At each control moment, the grid-type energy storage acquires the latest system status information and its own operating status information, and sequentially executes the complete process of steps S20-S50 above. The calculated active and reactive power commands are applied to the grid-type energy storage. After the system status is updated, the system enters the next control moment, forming a closed-loop coordinated support process. This closed-loop coordinated support process ensures that the coordinated allocation strategy continuously adjusts the allocation weights of active and reactive power support capabilities based on real-time changes in frequency and voltage stability throughout the entire disturbance duration, adapting to the dynamic changes in frequency-side and voltage-side dominant stability demands during the disturbance.

[0054] In some embodiments, an exemplary implementation of step S60 is provided. Specifically, at each control moment, the system frequency, rate of change of frequency, critical node voltage, and the state of charge and power operation status of the grid-type energy storage are collected. The available support capacity calculation, online stability margin update, margin enhancement state construction, active and reactive power coordination allocation, and safe feasible domain projection are completed sequentially. The projected active and reactive power commands are then applied to the grid-type energy storage. After the system state is updated, the stability margin calculation and coordination allocation are performed again for the next control moment, forming a closed-loop coordinated support process.

[0055] like Figure 3 The diagram shown is a flowchart of the active and reactive power closed-loop coordination support process for grid-type energy storage provided in this application embodiment.

[0056] In some embodiments, after the disturbance response ends, the minimum frequency value, maximum frequency change rate, minimum voltage of critical nodes, and frequency and voltage recovery times are extracted within a preset observation time range. The full frequency stability margin, full voltage stability margin, comprehensive stability margin, and weighted stability margin are calculated respectively. (11) in, For complete frequency stability margin; For complete voltage stability margin; For overall stability margin; For weighted stability margin; This represents the lowest system frequency within the observation timeframe. The maximum absolute rate of change; This represents the lowest voltage at all critical nodes within the observation timeframe. and These are the frequency recovery time and the voltage recovery time, respectively. and These are the maximum allowable frequency recovery time and the maximum voltage recovery time, respectively. and These are the non-negative weighting coefficients for the frequency side and the voltage side, respectively. .

[0057] Example 2: This invention provides a method for coordinating active and reactive power in grid-based energy storage based on stability margin awareness, comprising the following steps: 1) Determine the active frequency support requirements and reactive voltage support requirements of grid-type energy storage based on the system's real-time frequency, frequency change rate, and key node voltages; 2) Calculate the real-time available active and reactive power support capabilities based on the grid-type energy storage's state of charge, power limits, and shared converter capacity, and construct a safe and feasible support domain; 3) Calculate the online frequency stability margin and online voltage stability margin, and construct a margin enhancement state; 4) Determine the active and reactive power allocation actions based on the margin enhancement state, and generate initial active and reactive power commands; 5) Use the SAC coordinated allocation method based on reward distribution and security constraints to determine the dynamic allocation of active and reactive power support capabilities, and restrict the obtained power commands to the safe and feasible support domain; 6) Execute the grid-type energy storage active and reactive power coordinated support in a closed-loop manner, and calculate the complete frequency stability margin, complete voltage stability margin, comprehensive stability margin, and weighted stability margin after the disturbance ends.

[0058] The specific implementation method is as follows: This embodiment uses an improved IEEE 39-node test system for simulation analysis. The system's rated frequency is 50Hz, and its base capacity is 6254.23MVA. New energy access nodes are 4, 8, 15, 21, 24, and 26. Before the disturbance, the active power penetration rate of new energy was approximately 60.16%. Grid-type energy storage access node 16 is selected, with nodes 16, 17, 21, 24, and 26 chosen as key nodes. The rated capacity of the grid-type energy storage converter is 625.423MVA. The initial state of charge (SOC) of the energy storage is 0.60, with an allowable SOC range of 0.20–0.90, and the energy storage power ratio is 0.50h. The virtual inertia coefficient of the grid-type energy storage is 4s, the damping coefficient is 20, the active power-frequency droop coefficient is 0.04, the reactive power-voltage droop coefficient is 0.05, and the active power and reactive power response time constants are 0.08s and 0.04s, respectively. Improvements to the IEEE 39-node test system, new energy access locations, grid-type energy storage access locations, key nodes, and faulty lines, such as... Figure 4 As shown.

[0059] This embodiment sets up three comparative support methods and compares them with the method of the present invention. Method 1 is a support method without energy storage; Method 2 is a grid-connected energy storage support method, which only provides active power compensation; Method 3 is a grid-connected energy storage support method with fixed active and reactive power allocation, where the active and reactive power allocation weights are both set to 0.5; the method of the present invention adopts a grid-connected energy storage active and reactive power coordination method based on stability margin perception. Method 3 and the method of the present invention use the same energy storage capacity, state of charge range, converter capacity, and basic parameters of grid-connected energy storage, differing only in the allocation method of active and reactive power support capabilities.

[0060] In this embodiment, the system frequency lower limit is set to 49.8Hz, the frequency change rate limit is set to 0.5Hz / s, and the maximum frequency recovery time is set to 10s; the allowable voltage range for critical nodes is set to 0.90~1.10pu, the maximum voltage recovery time is set to 2s, the threshold for the boundary between the stability margin safe zone and the warning zone is set to 0.20, and the weighting coefficients for both the frequency side and the voltage side are set to 0.5. All disturbances are applied at 1.0s, the line fault lasts for 0.10s, and lines 16-17 are disconnected after the fault is cleared. The settings for different disturbance scenarios are shown in Table 1.

[0061] Table 1. Settings for different disturbance scenarios

[0062] Based on the above-mentioned disturbance scenario, the method of the present invention includes six steps in its specific implementation, namely steps 1 to 6. The implementation principles and methods of these six steps correspond to steps S10 to S60 in Embodiment 1. This embodiment aims to further illustrate the feasibility and progress of the method of the present invention by combining experimental data. For specific implementation principles and calculation methods, please refer to Embodiment 1. This embodiment will not elaborate further here.

[0063] Step 1: Determine the active and reactive power support requirements for grid-based energy storage. For example... Figure 1 As shown, at each control moment, the system frequency, frequency change rate and key node voltage are collected. The active frequency support requirement of the grid-type energy storage is calculated according to Equation (1) based on the system frequency deviation and frequency change rate. At the same time, the lowest voltage in the key node is extracted, and the reactive voltage support requirement is calculated based on the deviation between the lowest voltage of the key node and the voltage reference value.

[0064] Scenario 1 and Scenario 2 correspond to the decrease in active power of new energy sources and the increase in system load, respectively. After the disturbance, the system generates an active power deficit, and the demand for active frequency support increases accordingly. Scenario 3 is a three-phase short circuit fault on the line, the voltage of key nodes drops, and the demand for reactive voltage support increases. Scenario 4 includes both active power disturbance and line fault, and the demand for active frequency support and reactive voltage support exists simultaneously.

[0065] Step 2: Construction of the active and reactive power safety and feasibility support domain for grid-based energy storage. Based on the real-time state of charge, rated energy storage capacity, rated apparent power, and current active and reactive power output of the grid-based energy storage, the available active power support capacity and available reactive power support capacity at the current control moment are calculated according to Equation (2). On this basis, taking into account the active power boundary, reactive power boundary, energy storage state of charge range, and shared converter capacity, the active and reactive power safety and feasibility support domain is constructed according to Equation (3).

[0066] For the initial active and reactive power commands obtained through coordination and allocation, the safe and feasible support domain is projected according to equation (4) to obtain the actual active and reactive power commands to be executed, so that the grid-type energy storage output meets the power limit, state of charge range and shared converter capacity constraints.

[0067] Step 3: Online voltage and frequency stability margin sensing and state construction. Based on the real-time system frequency, frequency change rate, and minimum voltage of key nodes, calculate the online frequency stability margin and online voltage stability margin according to equation (5). The online stability margin is used to characterize the relative distance between the current operating state and the corresponding stability boundary. When the margin decreases, the corresponding stable state gradually approaches the specified boundary.

[0068] The system frequency deviation, frequency change rate, minimum voltage of key nodes, online frequency stability margin, online voltage stability margin, energy storage state of charge, and available active and reactive power support capacity are combined into a margin enhancement state according to Equation (6), and used as the input for active and reactive power coordination allocation, so that the coordination allocation process simultaneously considers the current voltage and frequency state and the remaining support capacity of the grid-type energy storage.

[0069] Step 4: Active and reactive power coordination and allocation based on the stable margin state. The margin enhancement state obtained in Step 3 is input into the continuous action coordination and allocation strategy to obtain the active and reactive power allocation actions, and the actions are mapped to active power support weights and reactive power support weights according to Equation (7). Combining the active and reactive power support requirements obtained in Step 1 and the real-time available support capacity obtained in Step 2, an initial active and reactive power command is generated.

[0070] When the frequency-side stable state approaches the specified boundary, the allocation ratio of active power support capacity is increased; when the voltage-side stable state approaches the specified boundary, the allocation ratio of reactive power support capacity is increased; when both frequency and voltage support demands exist simultaneously, the allocation ratio of the two types of support capacity is continuously adjusted according to changes in online stability margin.

[0071] Step 5: SAC Coordination Allocation Based on Reward Distribution and Security Constraints. Construct an instant reward system according to Equation (8), which includes online frequency stability margin, online voltage stability margin, converter power utilization, and change in action. Calculate the system security cost corresponding to system frequency, frequency change rate, and voltage overruns at critical nodes according to Equation (9). Construct the tail reward and security strategy optimization objectives according to Equation (10), so that the coordination allocation process considers both adverse response states and system operating boundaries.

[0072] After completing the strategy training, the strategy parameters are kept fixed during the online operation phase. At each control moment, active and reactive power allocation actions are generated according to the margin enhancement state. The initial active and reactive power commands are obtained according to Equation (7), and the initial commands are projected onto the safe and feasible support domain according to Equation (4) and then applied to the grid-type energy storage.

[0073] Step 6: Closed-loop coordinated support and post-disturbance stability margin evaluation. For example... Figure 3 As shown, at each control moment, the system status is acquired sequentially, online stability margin is calculated, margin enhancement state is constructed, active and reactive power are coordinated and allocated, safe and feasible support domain is projected, and grid-type energy storage power commands are executed. After the system status is updated, the stability margin calculation and coordination allocation are repeated for the next control moment, forming a closed-loop coordination support process.

[0074] First, we use scenario 1 and scenario 2 to analyze the frequency response under active power disturbance. The main frequency response indicators corresponding to different support methods are shown in Table 2.

[0075] Table 2 Frequency response indices for different support methods under active power disturbances

[0076] like Figure 5 As shown in Table 2, in scenario 1, the lowest system frequency of method 1 is 49.717 Hz, the maximum frequency change rate is 0.603 Hz / s, and the frequency stability margin is -0.417. After using method 2, the lowest frequency increases to 49.879 Hz, and the maximum frequency change rate decreases to 0.494 Hz / s. When using method 3 and the method of the present invention, the lowest frequency is 49.952 Hz, the maximum frequency change rate is 0.245 Hz / s, and the frequency stability margin is 0.511.

[0077] In Scenario 2, the lowest system frequency using Method 1 is 49.755Hz, with a frequency stability margin of -0.226. Using Method 2, the lowest frequency increases to 49.910Hz, and the frequency stability margin increases to 0.506. When using Method 3 and the method of this invention, the lowest frequency is 49.958Hz, the maximum frequency change rate is 0.100Hz / s, and the frequency stability margin is 0.789. Under disturbance conditions primarily caused by active power imbalance and with low voltage-side support requirements, the method of this invention can maintain the active power frequency support capability of grid-type energy storage.

[0078] Scenario 3 is then used to analyze the voltage recovery process under line fault conditions. The voltage changes at key nodes are as follows: Figure 6 As shown in Table 3, the minimum node voltage, voltage recovery time, and voltage stability margin for different support methods are as follows.

[0079] Table 3 Voltage recovery indicators for different support methods under line faults

[0080] like Figure 6 As shown in Table 3, after a three-phase short-circuit fault occurs on line 16-17, the lowest node voltage for both Mode 1 and Mode 2 is 0.815 pu, the voltage recovery time is 0.20 s, and the voltage stability margin is -0.849. Using Mode 3, the lowest node voltage increases to 0.841 pu, the voltage recovery time is shortened to 0.13 s, and the voltage stability margin increases to -0.588. Using the method of this invention, the lowest node voltage is further increased to 0.862 pu, the voltage recovery time is shortened to 0.12 s, and the voltage stability margin increases to -0.385.

[0081] Compared to method 3, the method of this invention increases the minimum node voltage by approximately 0.021 pu and the voltage stability margin by approximately 0.203. While the voltage stability margin remains negative in this scenario, indicating that the voltage stability constraints under the set line fault conditions are not fully met, the degree of voltage drop at critical nodes and the voltage recovery process after the fault are improved.

[0082] Scenario 4 is used to analyze the coordinated support process when active power frequency support demand and reactive power voltage support demand coexist. Scenario 4 applies a simultaneous decrease in active power from renewable energy sources, an increase in load, and a three-phase short-circuit fault at line 16-17 at 1.0s. The system frequency and node 16 voltage responses are as follows: Figure 7 As shown, the active and reactive power support outputs and allocation weights of the grid-type energy storage are as follows: Figure 8 As shown in Table 4, the main stable response indicators are as follows.

[0083] Table 4. Stability response indices of different support methods under combined disturbances

[0084] like Figure 7 As shown in Table 4, under combined disturbance conditions, the lowest system frequency for Method 1 is 49.392 Hz, with a maximum frequency change rate of 0.942 Hz / s. Using Method 2, the lowest frequency increases to 49.798 Hz. For Method 3, the lowest frequency is 49.761 Hz, with a maximum frequency change rate of 0.396 Hz / s. Using the method of this invention, the lowest frequency increases to 49.896 Hz, with a maximum frequency change rate of 0.455 Hz / s, which is lower than the set limit of 0.5 Hz / s. The frequency stability margin for Method 3 is -0.195, which increases to 0.089 after using the method of this invention.

[0085] Regarding voltage response, the lowest node voltages for methods 1 and 2 are 0.810 pu and 0.811 pu, respectively, while the lowest node voltage for method 3 is 0.839 pu, which is increased to 0.841 pu after applying the method of this invention. The voltage stability margin for method 3 is -0.608, which is increased to -0.587 after applying the method of this invention. Since the voltage stability margin corresponding to the method of this invention is lower than the frequency stability margin, its overall stability margin is -0.587.

[0086] like Figure 8As shown, in the initial stage of a fault, the voltage at the critical node drops, increasing the demand for reactive power support. The reactive power support allocation weight is highest at approximately 0.952, while the active power support allocation weight is lowest at approximately 0.048. After the fault is cleared, as the voltage at the critical node recovers, the impact of active power imbalance gradually increases. The active power support allocation weight is highest at approximately 0.749, gradually stabilizing at approximately 0.700, while the reactive power support allocation weight decreases accordingly. During the coordination process, both active and reactive power support outputs are constrained by the shared converter capacity.

[0087] Therefore, at different stages of complex disturbances, the method of this invention can adjust the allocation of active and reactive power support capabilities of grid-type energy storage according to changes in frequency and voltage stability. During the fault occurrence phase, the reactive power support ratio is increased; after the fault is cleared, the active power support ratio is increased, achieving dynamic adjustment of the limited converter capacity between the two types of support demands.

[0088] After the disturbance response ends, the complete frequency stability margin, complete voltage stability margin, comprehensive stability margin, and weighted stability margin are calculated according to equation (11) for different disturbance scenarios and different support methods. The frequency stability margin, voltage stability margin, and comprehensive stability margin for different disturbance scenarios and support methods are as follows: Figure 9 As shown.

[0089] In Scenario 1, the overall stability margins of Method 1, Method 2, Method 3, and the method of the present invention are -0.417, 0.012, 0.511, and 0.511, respectively; in Scenario 2, they are -0.226, 0.506, 0.789, and 0.789, respectively. In Scenario 3, the overall stability margins of Method 1 and Method 2 are both -0.849, Method 3 is -0.588, and the method of the present invention is -0.385. In Scenario 4, the overall stability margins of Method 1, Method 2, Method 3, and the method of the present invention are -2.041, -0.894, -0.608, and -0.587, respectively.

[0090] Weighted stability margin under different disturbance scenarios and support methods, such as Figure 10 As shown. In scenario 1, the weighted stability margins of method 1, method 2, method 3, and the method of the present invention are 0.291, 0.506, 0.755, and 0.755, respectively; in scenario 2, they are 0.387, 0.753, 0.894, and 0.894, respectively; in scenario 3, they are 0.076, 0.076, 0.206, and 0.308, respectively; and in scenario 4, they are -1.468, -0.661, -0.401, and -0.249, respectively.

[0091] In scenario 4, compared to method 3, the method of this invention increases the minimum system frequency from 49.761Hz to 49.896Hz, the frequency stability margin from -0.195 to 0.089, the weighted stability margin from -0.401 to -0.249, and the minimum node voltage from 0.839 pu to 0.841 pu. Under the condition that frequency and voltage support requirements coexist and share limited converter capacity, the method of this invention can adjust the allocation of active and reactive power support capabilities according to changes in the system's stable state.

[0092] Example 3: This invention also provides a grid-type energy storage active and reactive power coordination device for implementing the methods described in any of the above embodiments, such as... Figure 11 As shown, the device includes: The demand determination module 1101 is configured to acquire the real-time frequency, frequency change rate, and voltage amplitude of selected key nodes of the power system, determine the active frequency support demand of grid-type energy storage based on the system frequency deviation and frequency change rate, and determine the reactive voltage support demand based on the minimum voltage of key nodes. The feasible support domain determination module 1102 is configured to calculate the available active power support capacity and available reactive power support capacity under the current operating state based on the current state of charge of the grid-type energy storage, the rated energy storage capacity, the active power limit, the reactive power limit, and the rated apparent power of the converter, and to construct the safe and feasible support domain of the grid-type energy storage at the current moment based on the active power boundary, the reactive power boundary, the shared converter capacity, and the state of charge constraints. The margin enhancement module 1103 is configured to calculate the online frequency stability margin and online voltage stability margin at the current moment based on the system's real-time frequency, frequency change rate, and minimum voltage of key nodes, and to combine the system's real-time dynamic quantities, online stability margin, and the current available support capacity of the grid-type energy storage into a margin enhancement state. The initial instruction generation module 1104 is configured to input the margin enhancement state into the continuous action coordination allocation strategy to obtain active and reactive power allocation actions, map the active and reactive power allocation actions to active power support weights and reactive power support weights, and generate initial active and reactive power instructions based on support requirements and real-time available support capabilities. The execution instruction generation module 1105 is configured to construct an instant reward including online stability margin, converter power utilization and action change amount, define system-level safety cost, adopt a SAC coordination allocation strategy based on reward distribution and safety constraints to determine the dynamic allocation of active and reactive power support capabilities, map the initial active and reactive power instructions obtained by coordination allocation to the safe and feasible support domain, and obtain the actual executed grid-type energy storage power instructions. The closed-loop coordination support module 1106 is configured to collect system frequency, frequency change rate, key node voltage, and state of charge and power operation status of grid-type energy storage at each control moment. It sequentially completes the calculation of available support capacity, online stability margin update, margin enhancement state construction, active and reactive power coordination allocation, and safe feasible domain projection. It then applies the projected active and reactive power commands to the grid-type energy storage. After the system state is updated, the stability margin calculation and coordination allocation are performed again at the next control moment.

[0093] This invention provides an electronic device. The electronic device may include a processor and a memory, wherein the processor and the memory can communicate; exemplarily, the processor and the memory communicate via a communication bus.

[0094] The processor executes computer execution instructions stored in memory, causing the processor to perform the scheme in the above embodiments. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0095] The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.

[0096] The electronic device provided in this embodiment of the invention can be the terminal device described in the above embodiments.

[0097] This invention also provides a computer-readable storage medium storing computer instructions. When these computer instructions are executed on a computer, the computer performs the technical solution of the above-described method for coordinating active and reactive power in grid-type energy storage.

[0098] This invention also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the technical solution of the active and reactive power coordination method of the grid-type energy storage described in the above embodiments.

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

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

[0101] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0102] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute certain steps of the methods of the various embodiments of the present invention.

[0103] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.

[0104] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.

[0105] Buses can be Industry Standard Architecture (ISA) buses, Peripheral Component Interconnect (PCI) buses, or Extended Industry Standard Architecture (EISA) buses, etc. Buses can be categorized into address buses, data buses, control buses, etc.

[0106] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0107] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.

[0108] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for coordinating active and reactive power in grid-type energy storage, characterized in that, The method includes: Obtain the real-time frequency, frequency change rate, and voltage amplitude of selected key nodes of the power system; determine the active frequency support requirements of grid-type energy storage based on the system frequency deviation and frequency change rate; and determine the reactive voltage support requirements based on the minimum voltage of key nodes. Based on the current state of charge, rated energy storage capacity, active power limit, reactive power limit, and rated apparent power of the converter, the available active power support capacity and available reactive power support capacity under the current operating state are calculated. Based on the active power boundary, reactive power boundary, shared converter capacity, and state of charge constraints, the safe and feasible support domain of the grid-type energy storage at the current moment is constructed. Based on the system's real-time frequency, frequency change rate, and minimum voltage of key nodes, the online frequency stability margin and online voltage stability margin at the current moment are calculated respectively, and the system's real-time dynamic quantities, online stability margin, and the current available support capacity of grid-type energy storage are combined to form the margin enhancement state. The margin enhancement state is input into the continuous action coordination and allocation strategy to obtain active and reactive power allocation actions. The active and reactive power allocation actions are mapped to active power support weights and reactive power support weights. Based on support requirements and real-time available support capabilities, an initial active and reactive power command is generated. Construct an instant reward system that includes online stability margin, converter power utilization, and change in action, and define system-level safety costs. Use a SAC coordination allocation strategy based on reward distribution and safety constraints to determine the dynamic allocation of active and reactive power support capabilities. Map the initial active and reactive power commands obtained from the coordination allocation to the safe and feasible support domain to obtain the actual executed grid-type energy storage power commands. At each control moment, the system frequency, rate of change of frequency, voltage of key nodes, and state of charge and power operation status of grid-type energy storage are collected. The available support capacity calculation, online stability margin update, margin enhancement state construction, active and reactive power coordination allocation, and safe feasible domain projection are completed in sequence. The projected active and reactive power commands are applied to the grid-type energy storage. After the system state is updated, the stability margin calculation and coordination allocation are carried out again at the next control moment.

2. The method for coordinating active and reactive power in grid-type energy storage according to claim 1, characterized in that, The active frequency support requirement and the reactive voltage support requirement are determined by the following formula: (1) in, for The active frequency support demand for grid-type energy storage at all times; for The reactive power and voltage support requirements of grid-connected energy storage at all times; for The normalized deviation of the system's angular frequency from its rated angular frequency at any given moment; for The rate of change of the system frequency at any given time is normalized relative to the allowable range of change. Active power-frequency droop factor; The equivalent damping parameters for grid-type energy storage; Virtual inertia parameters for grid-type energy storage; As a key node exist Voltage amplitude at any given moment; This refers to the set of key nodes participating in voltage stability evaluation. This is the lowest voltage at critical nodes; This is the voltage reference value; Reactive power minus voltage droop factor; Represents the maximum value function; This represents the minimum value function.

3. The method for coordinating active and reactive power in grid-type energy storage according to claim 2, characterized in that, Based on the current state of charge, rated energy storage capacity, active power limit, reactive power limit, and rated apparent power of the converter, the available active power support capacity and available reactive power support capacity under the current operating condition are calculated using the following formulas: (2) in, for The state of charge of grid-connected energy storage at all times; This is the limit of the state of charge; Rated energy for energy storage; Preset support duration; Available active power is limited by the remaining energy storage capacity; and They are respectively It can always be supported by both active and reactive power; and These are the upper limits of active and reactive power for grid-type energy storage, respectively. and These represent the current active and reactive power outputs, respectively. The rated apparent power capacity of the grid-type energy storage converter is used to limit the combined output capacity of active and reactive power. Based on active power boundary, reactive power boundary, shared converter capacity, and state of charge constraints, the following formula is used to construct... The safe and feasible support domain for grid-based energy storage at all times: (3) in, for The field of safe and feasible support for grid-type energy storage with both active and reactive power functions at all times; and These are the candidate active power and reactive power commands, respectively. and These are the lower limits of active and reactive power, respectively. and These represent the minimum and maximum states of charge that grid-connected energy storage systems are allowed to operate at; To control the time interval; The state of charge of grid-type energy storage at the next control moment after the current control action is executed; The initial active and reactive power commands obtained through coordinated allocation are mapped to the secure and feasible support domain, and the actual executed grid-type energy storage power commands are obtained through the following formula: (4) in, The initial active and reactive power command before safety constraint processing. and These are the initial active and reactive power commands before the safe feasible region is projected, respectively. This is the matrix transpose operator; This refers to the actual power command for grid-based energy storage. and These are the active power command and reactive power command that are actually sent to the grid-type energy storage execution unit after projection processing, respectively. The safe and feasible support domain projection operator is used to map the initial power command to an executable power space that satisfies the converter's apparent power constraints, state of charge constraints, and active and reactive power output boundary constraints. express The safety and feasibility of grid-type energy storage is supported by constant monitoring.

4. The active and reactive power coordination method for grid-type energy storage according to claim 3, characterized in that, Based on the system's real-time frequency, rate of frequency change, and minimum voltage at critical nodes, the online frequency stability margin and online voltage stability margin are calculated using the following formulas: (5) in, for Always online frequency stability margin; for Always maintain online voltage stability margin; This refers to the system's real-time frequency. The rated frequency; This is the lower limit of the minimum frequency safety boundary that the system is allowed to operate at. The real-time frequency change rate of the system; This is the safety boundary limit for the maximum allowable rate of frequency change of the system; This is the lowest voltage at critical nodes; This is the rated voltage amplitude; This is the lowest voltage safety boundary that allows critical nodes to operate. The system's real-time dynamic parameters, online stability margin, and the current available supporting capacity of grid-type energy storage are collectively constituted as the margin enhancement state, which is expressed by the following formula: (6) in, for Margin-enhanced state vectors for coordinating and allocating policy inputs at all times; This represents the system frequency deviation.

5. The method for coordinating active and reactive power in grid-type energy storage according to claim 4, characterized in that, The active and reactive power allocation actions are mapped to active power support weights and reactive power support weights, and based on support requirements and real-time available support capabilities, an initial active and reactive power command is generated using the following formula: (7) in, and Acting on available active power support capacity respectively and available reactive power support capacity This is used to convert the coordinated allocation result into an initial power command in the corresponding direction, and satisfies... , as well as ; and These are the initial active and reactive power commands before the safe feasible region is projected.

6. The method for coordinating active and reactive power in grid-type energy storage according to claim 5, characterized in that, A real-time reward system is constructed, including online stability margin, converter power utilization, and changes in operation. A system-level safety cost is defined. A SAC (Safe and Reactive Power Acquisition) coordination allocation strategy based on reward distribution and safety constraints is adopted to determine the dynamic allocation of active and reactive power support capabilities. The initial active and reactive power commands obtained from the coordination allocation are mapped to the safe and feasible support domain to obtain the actually executed grid-based energy storage power commands, including: The instantaneous reward, which includes online stability margin, converter power utilization, and changes in operation, is expressed by the following formula: (8) in, for Instant rewards; and These are the stability margin related weighting coefficients; , and These are the non-negative coefficients corresponding to active power utilization, reactive power utilization, and changes in operation, respectively. Coordinate and allocate actions for the previous control moment; for The continuous action variables output by the constantly coordinated allocation strategy are used to generate active and reactive power support weights. System-level security costs are defined by the following formula: (9) in, for Real-time system security costs; , and These are the non-negative weighting coefficients corresponding to the lower limit of frequency, the limit of rate of change of frequency, and the lower limit of voltage, respectively. The positive part operation is defined as follows: , is used to represent the effective constraint violation amount after variable x exceeds the safety boundary; Based on the reward distribution corresponding to state actions, the lower tail reward is calculated. A policy optimization objective is constructed with the goal of maximizing the sum of the lower tail reward and the policy entropy while minimizing the cumulative security cost. The coordination and allocation policy is then updated using this policy optimization objective. The policy optimization objective is expressed as follows: (10) in, State-action pair The corresponding lower tail return estimate; The number of returns sorted in ascending order One return quantile; The number of quantiles reported; To retain a proportion of tail returns; The number of quantiles participating in the calculation of the lower tail return; This is a floor function; To optimize the strategy objectives; For mathematical expectation operations; For parameters The random strategy; The strategy entropy coefficient; State-action pair The corresponding cumulative safety cost function calculates the system safety cost generated during each control cycle from the current control time to the termination time. The result is obtained by summing. This refers to the control point during the accumulation of safety costs. The time at which the cumulative safety cost calculation terminates; It is a non-negative safety multiplier used to adjust the influence of the cumulative safety cost constraint term on the policy optimization objective; The active and reactive power allocation actions are generated according to the updated coordination and allocation strategy. An initial active and reactive power command is generated based on the active and reactive power allocation actions. The initial active and reactive power command is projected onto the safe and feasible support domain to obtain the actual executed grid-type energy storage power command.

7. The method for coordinating active and reactive power in grid-type energy storage according to claim 6, characterized in that, During the coordinated allocation process at each control moment, when the disturbance response ends, the minimum frequency value, maximum frequency change rate, minimum voltage of critical nodes, and frequency and voltage recovery time are extracted within the preset observation time range. The full frequency stability margin, full voltage stability margin, comprehensive stability margin, and weighted stability margin are calculated using the following formulas: (11) in, For complete frequency stability margin; For complete voltage stability margin; For overall stability margin; For weighted stability margin; This represents the lowest system frequency within the observation timeframe. The maximum absolute rate of change; This represents the lowest voltage at all critical nodes within the observation timeframe. and These are the frequency recovery time and the voltage recovery time, respectively. and These are the maximum allowable frequency recovery time and the maximum voltage recovery time, respectively. and These are the non-negative weighting coefficients for the frequency side and the voltage side, respectively. ; The full frequency stability margin, full voltage stability margin, comprehensive stability margin, and weighted stability margin are used to evaluate the comprehensive stability level of the system's frequency and voltage under this disturbance scenario.

8. A grid-type energy storage active and reactive power coordination device, characterized in that, The device includes: The demand determination module is configured to acquire the real-time frequency, frequency change rate, and voltage amplitude of selected key nodes of the power system, determine the active frequency support demand of grid-type energy storage based on the system frequency deviation and frequency change rate, and determine the reactive voltage support demand based on the minimum voltage of key nodes. The feasible support domain determination module is configured to calculate the available active power support capacity and available reactive power support capacity under the current operating state based on the current state of charge of the grid-type energy storage, rated energy storage capacity, active power limit, reactive power limit, and rated apparent power of the converter, and construct the safe and feasible support domain of the grid-type energy storage at the current moment based on the active power boundary, reactive power boundary, shared converter capacity, and state of charge constraints. The margin enhancement module is configured to calculate the online frequency stability margin and online voltage stability margin at the current moment based on the system's real-time frequency, frequency change rate, and minimum voltage of key nodes, and to combine the system's real-time dynamic quantities, online stability margin, and the current available support capacity of the grid-type energy storage into a margin enhancement state. The initial instruction generation module is configured to input the margin enhancement state into the continuous action coordination allocation strategy to obtain active and reactive power allocation actions, map the active and reactive power allocation actions to active power support weights and reactive power support weights, and generate initial active and reactive power instructions based on support requirements and real-time available support capabilities. The execution instruction generation module is configured to construct an instant reward including online stability margin, converter power utilization level and action change amount, and define system-level safety cost. It adopts a SAC coordination allocation strategy based on reward distribution and safety constraints to determine the dynamic allocation of active and reactive power support capabilities, and maps the initial active and reactive power instructions obtained by coordination allocation to the safe and feasible support domain to obtain the actual executed grid-type energy storage power instructions. The closed-loop coordination support module is configured to collect system frequency, frequency change rate, key node voltage, and state of charge and power operation status of grid-type energy storage at each control moment. It sequentially completes the calculation of available support capacity, online stability margin update, margin enhancement state construction, active and reactive power coordination allocation, and safe feasible domain projection. It then applies the projected active and reactive power commands to the grid-type energy storage. After the system state is updated, the stability margin calculation and coordination allocation are performed again at the next control moment.

9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes the computer execution instructions stored in the memory to implement the active and reactive power coordination method for grid-type energy storage as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the active and reactive power coordination method for grid-type energy storage as described in any one of claims 1-7.