A micro-grid hierarchical control method and system under power market constraints

CN122844329APending Publication Date: 2026-09-29JIANGSU ZHIGE HI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611290562.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

该类固定分层方式未考虑各分布式电源在不同运行工况下对节点电压的实际支撑能力差异及其功率调节裕度的变化,容易导致电压敏感节点的调节资源不足,而远端或调节余量较小的电源被过度调用,引发局部电压越限或功率振荡

Benefits of technology

[0016]针对动态分层与电压支撑能力匹配的问题,采用各分布式电源并网点电压与公共连接点参考电压的偏差绝对值,结合向上调节裕量与向下调节裕量的比值构成调节裕度比例,经电压权重因子加权后得到电压支撑能力系数。该系数综合表征了分布式电源所在节点的电压敏感性及其功率双向调节能力,将电压支撑能力系数降序排列并以均值为阈值,使电压偏差大且调节裕度比例适中的电源优先进入一次调节层。由此实现分层结果与实时运行状态的联动,一次调节层汇聚了对电压敏感且调节灵活性高的分布式电源,使得一次功率调节量直接作用于电压薄弱节点,有效抑制电压偏差扩大,减少因分层失当造成的二次调压压力。一次层内再依据各电源的电压支撑能力系数分配功率分担权重,保证电压支撑贡献大的电源承担更多功率调节责任,避免传统按容量均分方式下电压远端电源无效出力的情形,从而在源头上将电压调控资源与电网实际需求对齐。针对电力市场信号与二次调节协同的问题,在二次调节层获取所有分布式电源一次调节后的功率输出值之和以及由实时电价信号计算得到的电价变化率,引入电价响应系数计算出二次调节层的总功率修正需求,再将该总功率修正需求平均分配至二次调节层各分布式电源,形成二次功率修正系数。该修正方式由实时电价变化率直接驱动,电价变化剧烈时修正量增大,价格平稳时修正量趋近于零,使得二次功率调整精准跟随市场边界条件,避免了固定步长或恒定经济分配系数在电价突变时引发的功率冲击。同时,二次修正仅在二次调节层内进行,不影响一次调节层已完成的电压支撑分配,使得电压质量与市场响应在层级间解耦,有利于保证并网点电压在微电网参与市场竞争过程中的稳定性,也降低了多目标协调控制的复杂度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122844329A_ABST
    Figure CN122844329A_ABST
Patent Text Reader

Abstract

This invention discloses a hierarchical control method and system for microgrids under electricity market constraints, belonging to the field of microgrid control technology. The method includes: acquiring the real-time output power and node voltage of each distributed power source within the microgrid; constructing a power regulation margin sequence based on real-time electricity market price signals; determining the voltage support capability coefficient of each distributed power source based on the power regulation margin sequence and node voltages; dividing the distributed power sources into a primary regulation layer and a secondary regulation layer according to the voltage support capability coefficients; calculating the primary power regulation amount in the primary regulation layer and superimposing it to obtain the power output value after primary regulation; determining the secondary power correction coefficient in the secondary regulation layer based on the power output value after primary regulation and the real-time electricity price signal, performing correction, obtaining the final power command value, and issuing it for execution. This method can balance node voltage support requirements and electricity market price signals, improving the economic efficiency and voltage quality of microgrid operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of microgrid control technology, specifically to a hierarchical control method and system for microgrids under electricity market constraints. Background Technology

[0002] Microgrids contain various distributed power sources such as photovoltaics, wind power, and energy storage. Their operation must simultaneously meet internal voltage quality and external electricity market trading constraints. Traditional microgrid hierarchical control methods typically pre-divide primary and secondary regulation layers based on the capacity or equipment type of distributed power sources. The primary regulation layer is responsible for rapid response to frequency or voltage deviations, while the secondary regulation layer is responsible for economic power allocation. This fixed hierarchical approach does not consider the differences in the actual voltage support capabilities of each distributed power source under different operating conditions and the changes in its power regulation margin. This can easily lead to insufficient regulation resources at voltage-sensitive nodes, while remote power sources or those with small regulation margins are over-utilized, causing local voltage exceedances or power oscillations. Furthermore, with the advancement of electricity market reforms, the guiding role of real-time electricity price signals in microgrid power dispatch is increasingly important. In the existing hierarchical control architecture, electricity price information is only used as the input to the economic objective function of secondary regulation. There is a lack of means to consider market signals and voltage support capabilities in a coordinated manner from the initial stage of hierarchical control. This means that the microgrid may sacrifice voltage quality at critical nodes when responding to price fluctuations, or fail to fully respond to market price signals while ensuring voltage stability, making it difficult to simultaneously achieve voltage support optimization and market operation economy. The problem this invention aims to solve is how to construct a hierarchical index that can dynamically reflect the voltage support capability and power regulation margin of nodes, and adaptively divide the primary and secondary regulation levels accordingly, thereby associating voltage regulation resources with voltage-sensitive nodes at the hierarchical structure level; and how to establish a power correction mechanism in the secondary regulation layer that is directly related to the real-time electricity price change rate, so that the power adjustment of the secondary layer can respond to market constraints without destroying the voltage support effect established in the primary layer. Summary of the Invention

[0003] This invention provides a hierarchical control method and system for microgrids under electricity market constraints. The purpose is to achieve dynamic hierarchical control based on voltage support capability coefficients that are based on the ratio of voltage deviation to power regulation margin, and to improve the economic efficiency of microgrids participating in the electricity market by using secondary power correction coefficients driven by real-time electricity price change rates.

[0004] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides a hierarchical control method and system for microgrids under electricity market constraints. This method comprehensively considers the real-time electricity price signal of the electricity market and the voltage support capability of distributed power sources within the microgrid. By dividing the distributed power sources into a primary regulation layer and a secondary regulation layer and calculating the regulation amount separately, it achieves refined hierarchical control of the microgrid. The technical solution is as follows:

[0005] The system acquires the real-time output power and node voltage of each distributed power source within the microgrid; constructs a power regulation margin sequence for each distributed power source based on the real-time electricity price signal from the electricity market; determines the voltage support capability coefficient of each distributed power source based on the power regulation margin sequence and node voltage; and divides the distributed power sources within the microgrid into a primary regulation layer and a secondary regulation layer based on the voltage support capability coefficient.

[0006] As a preferred embodiment of the present invention, when constructing the power regulation margin sequence for each distributed power source, the upper limit of the rated power and the current output power value of each distributed power source are collected, and the difference between the upper limit of the rated power and the current output power value is calculated as the upward regulation margin; the lower limit of the rated power and the current output power value of each distributed power source are collected, and the difference between the current output power value and the lower limit of the rated power is calculated as the downward regulation margin; the upward and downward regulation margins of each distributed power source are arranged in numerical order to form a power regulation margin sequence. This method can accurately quantify the response capability of each distributed power source to fluctuations in electricity market prices, providing a reliable basis for subsequent stratification.

[0007] When determining the voltage support capability coefficient of each distributed power source, the measured voltage at the grid connection point and the reference voltage at the microgrid's point of common coupling are obtained, and the absolute value of the voltage deviation between the two is calculated. The upward and downward regulation margins in the power regulation margin sequence of each distributed power source are obtained, and the ratio of the upward to the downward regulation margin is calculated to obtain the regulation margin ratio. The absolute value of the voltage deviation is multiplied by a preset voltage weighting factor and then divided by the regulation margin ratio of that distributed power source to obtain the voltage support capability coefficient. This coefficient comprehensively reflects the distributed power source's sensitivity to voltage and its own power regulation flexibility, making the hierarchical results more adaptable to actual operating conditions.

[0008] When dividing distributed generation sources within a microgrid into a primary regulation layer and a secondary regulation layer, the voltage support capability coefficients of each distributed generation source are sorted in descending order of value to obtain a capability coefficient ranking sequence. The average value of all voltage support capability coefficients in this sequence is calculated as the capability coefficient threshold. Distributed generation sources with voltage support capability coefficients greater than or equal to the capability coefficient threshold are assigned to the primary regulation layer, while those with voltage support capability coefficients less than the capability coefficient threshold are assigned to the secondary regulation layer. Preferably, the primary regulation layer gathers distributed generation sources with strong voltage support capabilities, which can prioritize undertaking rapid power regulation tasks.

[0009] In the primary regulation layer, the primary power regulation amount of each distributed power source is calculated based on its real-time output power and voltage support capability coefficient. Specifically: the real-time output power and voltage support capability coefficient of each distributed power source in the primary regulation layer are obtained, and the sum of the voltage support capability coefficients of all distributed power sources in the layer is calculated as the total support coefficient within the layer; for each distributed power source, its voltage support capability coefficient is divided by the total support coefficient within the layer to obtain its power sharing weight; the real-time frequency deviation value at the microgrid's point of common coupling is obtained, and the real-time frequency deviation value is multiplied by a preset frequency-power droop coefficient, and then multiplied by the power sharing weight of that distributed power source to obtain the primary power regulation amount of that distributed power source. This method ensures that the power regulation amount allocation matches the voltage support capability and frequency deviation of each power source, guaranteeing the speed and rationality of primary regulation.

[0010] The primary power adjustment of each distributed power source is superimposed on its initial power setting to obtain the power output value after primary adjustment. During this process, the initial power setting of each distributed power source is obtained and added to its corresponding primary power adjustment to obtain an intermediate power value for primary adjustment. This intermediate power value is then compared with its corresponding upper and lower rated power limits. If the intermediate power value exceeds the limit, the limit is used as the power output value after primary adjustment; otherwise, the intermediate power value is used as the output value. Through power limiting processing, the operation of each distributed power source is ensured to remain within a safe operating range.

[0011] In the secondary regulation layer, the secondary power correction coefficient is determined based on the power output value after primary regulation and the real-time electricity price signal. Preferably, the power output value after primary regulation and the real-time electricity price signal of each distributed power source in the secondary regulation layer are obtained, and the sum of the power output values ​​after primary regulation of all distributed power sources in the layer is calculated to obtain the total output power in the layer. The electricity price change rate at the current moment is determined based on the real-time electricity price signal. The electricity price change rate is the difference in electricity prices between two adjacent sampling moments divided by the sampling time interval. The total output power in the layer is multiplied by the electricity price change rate and then multiplied by a preset electricity price response coefficient to obtain the total power correction demand of the secondary regulation layer. The total power correction demand is divided by the number of distributed power sources in the secondary regulation layer to obtain the secondary power correction coefficient of each distributed power source. This coefficient can reflect the economic guiding role of the electricity market price signal on the overall output of the microgrid.

[0012] The power output value after primary regulation is corrected using a secondary power correction coefficient to obtain the final power command value for each distributed power source. Specifically, the power output value after primary regulation of each distributed power source in the secondary regulation layer is added to the corresponding secondary power correction coefficient to obtain the intermediate power value for secondary regulation. This intermediate power value is then compared with the upper and lower limits of the rated power of each distributed power source. If the limit is exceeded, the corresponding limit is used; otherwise, the intermediate power value is taken as the final power command value. Through the connection and limiting of the two-layer regulation, it is ensured that the final power command value meets the system frequency regulation requirements, responds to changes in electricity market prices, and always meets the capacity constraints of each power source.

[0013] When the final power command value is sent to each distributed power source for execution, the final power command value of each distributed power source is encapsulated according to the communication address to generate a power command data packet. The real-time bit error rate of each communication link within the microgrid is obtained, and the number of command retransmissions for each distributed power source is determined based on the real-time bit error rate. The power command data packet is then sent to the controller of each distributed power source through the corresponding communication link according to the number of retransmissions. Upon receiving the data packet, each controller parses it to obtain the final power command value and writes it into the power control register of its respective distributed power source. This communication method can dynamically adjust the number of retransmissions based on link quality, improving the reliability of command transmission and ensuring the effective execution of the hierarchical control strategy.

[0014] This invention also provides a hierarchical control system for microgrids under electricity market constraints, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the aforementioned hierarchical control method for microgrids under electricity market constraints. This system and corresponding method enable microgrids to coordinate distributed power sources with different voltage support capabilities for hierarchical power allocation while meeting electricity market constraints, taking into account frequency response, voltage support, and economic operation, thereby improving the overall regulation performance and market adaptability of the microgrid.

[0015] The technical effects and advantages provided by the present invention in the above technical solution are as follows:

[0016] To address the issue of dynamic stratification and voltage support capability matching, a voltage support capability coefficient is obtained by combining the absolute value of the deviation between the grid connection voltage of each distributed generation source and the reference voltage of the point of common coupling, along with the ratio of upward to downward adjustment margins. This coefficient is weighted by a voltage weighting factor. This coefficient comprehensively characterizes the voltage sensitivity and bidirectional power regulation capability of the nodes where the distributed generation sources are located. The voltage support capability coefficients are arranged in descending order, with the mean value as the threshold, prioritizing sources with large voltage deviations and appropriate adjustment margin ratios for entry into the primary regulation layer. This achieves linkage between the stratification results and real-time operating status. The primary regulation layer aggregates distributed generation sources that are sensitive to voltage and have high regulation flexibility, allowing primary power regulation to directly act on voltage-weak nodes, effectively suppressing the expansion of voltage deviations and reducing secondary voltage regulation pressure caused by improper stratification. Within the primary layer, power sharing weights are further allocated according to the voltage support capability coefficients of each source, ensuring that sources with large voltage support contributions bear more power regulation responsibility. This avoids the situation of ineffective output from distant voltage sources under the traditional capacity-based equal distribution method, thus aligning voltage regulation resources with the actual needs of the grid from the source. To address the coordination issue between electricity market signals and secondary regulation, this method obtains the sum of the power output values ​​of all distributed generation sources after primary regulation and the rate of change in electricity prices calculated from real-time price signals at the secondary regulation layer. A price response coefficient is then introduced to calculate the total power correction demand of the secondary regulation layer. This total power correction demand is then evenly distributed among the distributed generation sources in the secondary regulation layer, forming the secondary power correction coefficient. This correction method is directly driven by the real-time rate of change in electricity prices. The correction amount increases when electricity prices fluctuate drastically and approaches zero when prices are stable. This allows secondary power adjustments to accurately follow market boundary conditions, avoiding power shocks caused by fixed step sizes or constant economic allocation coefficients during sudden price changes. Simultaneously, secondary correction is only performed within the secondary regulation layer and does not affect the voltage support allocation already completed by the primary regulation layer. This decouples voltage quality and market response between layers, which helps ensure the stability of the grid connection voltage during microgrid participation in market competition and reduces the complexity of multi-objective coordinated control. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0018] Figure 1 This is a flowchart of a hierarchical control method for microgrids under electricity market constraints;

[0019] Figure 2 This is a flowchart for constructing the power regulation margin sequence of distributed power sources;

[0020] Figure 3 This is a schematic diagram of the power regulation margin sequence of distributed generation in a microgrid.

[0021] Figure 4 This is a schematic diagram of the voltage support capability coefficient and regulation layer division of distributed power sources. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] See Figure 1 This invention provides a hierarchical control method for microgrids under electricity market constraints, comprising: acquiring the real-time output power and node voltage of each distributed power source within the microgrid; constructing a power regulation margin sequence for each distributed power source based on the real-time electricity price signal of the electricity market; determining the voltage support capability coefficient of each distributed power source based on the power regulation margin sequence and the node voltage; dividing the distributed power sources within the microgrid into a primary regulation layer and a secondary regulation layer according to the voltage support capability coefficient; calculating the primary power regulation amount of each distributed power source based on the real-time output power and the voltage support capability coefficient in the primary regulation layer; superimposing the primary power regulation amount of each distributed power source to its initial power setpoint to obtain the power output value after primary regulation; determining a secondary power correction coefficient based on the power output value after primary regulation and the real-time electricity price signal in the secondary regulation layer; correcting the power output value after primary regulation using the secondary power correction coefficient to obtain the final power command value for each distributed power source; and issuing the final power command value to each distributed power source for execution.

[0024] In specific implementation, please refer to Figure 2 The implementation method for constructing the power regulation margin sequence of each distributed power source is as follows.

[0025] This method retrieves the rated power limit and current output power value of a distributed power source (DPG) numbered i within the microgrid, where i is an index identifier used to distinguish different DPGs within the microgrid. The rated power limit of each DPG within the microgrid is determined by its physical characteristics and operational limitations, and is typically stored in the parameter configuration table of the DPG controller. Each time this method is executed, the parameter configuration table is read through the DPG's communication interface to obtain the rated power limit. Simultaneously, a power measurement unit deployed at the DPG's grid connection point collects power data streams in real time, extracting the current sampling data from the power data stream as the current output power value of the corresponding DPG.

[0026] After obtaining the rated power limit and current output power of distributed power source i, the difference between the rated power limit and the current output power is calculated, and this difference is used as the upward adjustment margin of the distributed power source. Mathematically, the upward adjustment margin of distributed power source i is derived according to the following formula:

[0027]

[0028] in, The upward regulation margin represents the distributed power source numbered i, in kilowatts; The rated power limit of the distributed power source with the number i is expressed in kilowatts and is obtained by reading the parameter configuration table of the distributed power source controller with the number i. The current output power value of distributed power source i, in kilowatts, is collected in real time by a power measurement unit deployed at the grid connection point of distributed power source i. The above-mentioned upward adjustment margin calculation process is performed on all distributed power sources in the microgrid that have been connected to the grid and are in a dispatchable state.

[0029] Simultaneously, the rated power lower limit and current output power value of distributed power source number i are collected. The rated power lower limit is also obtained from the parameter configuration table of the distributed power source controller, and the method for obtaining the current output power value is consistent with that used when calculating the upward adjustment margin. The difference between the current output power value and the rated power lower limit of distributed power source number i is calculated, and the calculated difference is used as the downward adjustment margin for that distributed power source.

[0030] After calculating the upward and downward regulation margins for all dispatchable distributed generation sources within the microgrid, the upward and downward regulation margins for each distributed generation are arranged sequentially according to their numbering. The resulting sequence structure is: upward regulation margin for distributed generation number 1, downward regulation margin for distributed generation number 1, upward regulation margin for distributed generation number 2, downward regulation margin for distributed generation number 2, and so on, until the last dispatchable distributed generation in the microgrid. This complete sequence is then determined as the power regulation margin sequence for each distributed generation. The power regulation margin sequence is stored as an array in the memory area of ​​the microgrid central controller, with each element in the sequence uniquely corresponding to a specific distributed generation and its regulation direction.

[0031] In some embodiments, if a distributed power source is not configured with a rated power lower limit parameter, its rated power lower limit is set to 0 kW. If the current output power value of a distributed power source has reached or exceeded the rated power upper limit, the calculated upward adjustment margin is 0 or a negative value, and the upward adjustment margin is set to 0. If the current output power value has reached or fallen below the rated power lower limit, the calculated downward adjustment margin is 0 or a negative value, and the downward adjustment margin is set to 0.

[0032] Optionally, during the collection of the upper limit of rated power, the lower limit of rated power, and the current output power value of each distributed power source, a data recording method with timestamps is used. In the power regulation margin sequence, each upward and downward regulation margin value is accompanied by the timestamp information of the power data used in its calculation, so as to realize the timeliness traceability of the power regulation margin sequence.

[0033] See Figure 3 In the graph, the horizontal axis represents the sequence index of the distributed power source, and the vertical axis represents the power regulation margin, in kilowatts. The legend indicates that red dots represent upward regulation margin and blue squares represent downward regulation margin.

[0034] As observed in the graph, the upward adjustment margin values ​​are widely distributed, with a maximum value approaching 900 kW and minimum values ​​mostly concentrated around 0. The upward adjustment margin for some distributed power sources is 0, consistent with the rule in the embodiment that the upward adjustment margin is set to 0 when the output power reaches or exceeds the rated power upper limit. The downward adjustment margin is mostly distributed in the range of 0 to 400 kW, with a significant number of blue squares marked as 0, indicating that the current output power of some distributed power sources has reached or fallen below the rated power lower limit, thus the downward adjustment margin is set to zero.

[0035] Overall, the sequence index ranges from 0 to 500, with upward and downward adjustment margins alternating, reflecting the complete collection and calculation of upward and downward power adjustment margins for all grid-connected and dispatchable distributed power sources. No obvious trend fluctuations are observed in the figure, indicating that the adjustment margins of each distributed power source are dispersed due to their own physical characteristics and operating status, consistent with the method described in the embodiment of dynamically obtaining adjustment margins through parameter configuration tables and real-time measurement data.

[0036] In specific implementation, the voltage support capability coefficient of each distributed power source and the implementation method of dividing the distributed power sources in the microgrid into a primary regulation layer and a secondary regulation layer are as follows.

[0037] The method acquires the measured grid connection voltage of each distributed generation (DG) within the microgrid. For DG numbered m, the voltage waveform is acquired in real time via a voltage transformer installed at its grid connection point. After analog-to-digital conversion, a discrete voltage sampling sequence is obtained. The effective voltage value of the most recent power frequency cycle is extracted and used as the measured grid connection voltage of DG numbered m, where m is an index identifier used to distinguish different DGs within the microgrid. Simultaneously, the microgrid point of common coupling (PCC) voltage reference value is acquired. This PCC voltage reference value is pre-set by the microgrid central controller based on the overall microgrid operating status and superior dispatch instructions, and is stored in the central controller's global parameter table. During execution of this method, it is directly read from the global parameter table.

[0038] For distributed generation numbered m, calculate the absolute value of the voltage deviation between the measured voltage at the grid connection point of distributed generation numbered m and the reference voltage at the microgrid's point of common coupling. The absolute value of the voltage deviation is calculated as follows: subtract the measured voltage at the grid connection point of distributed generation numbered m from the reference voltage at the microgrid's point of common coupling, and take the absolute value of the difference to obtain the absolute value of the voltage deviation for distributed generation numbered m.

[0039] From the constructed power regulation margin sequence of each distributed power source, obtain the upward and downward regulation margins corresponding to the distributed power source numbered m. The power regulation margin sequence of each distributed power source has been generated and stored in the memory of the microgrid central controller during previous processing. This sequence is arranged in the order of the distributed power source numbers, and two adjacent elements in the sequence correspond to the upward and downward regulation margins of a distributed power source, respectively. The upward and downward regulation margins of the distributed power source numbered m can be directly extracted through index calculation.

[0040] After obtaining the upward and downward regulation margins of the distributed power source numbered m, the ratio of the upward to the downward regulation margin is calculated, and this ratio is used as the regulation margin ratio for the distributed power source numbered m. When calculating the regulation margin ratio, if the downward regulation margin is zero, the regulation margin ratio is set to a preset large constant to avoid division by zero errors. This large constant is set to 1.0 × 10⁻⁶. 6 This indicates that when the downward adjustment capability is lacking, the adjustment margin of the distributed power source tends to be infinite.

[0041] After calculating the regulation margin ratio, the absolute value of the voltage deviation of the distributed power source numbered m is multiplied by a preset voltage weighting factor. The result is then divided by the regulation margin ratio of the distributed power source numbered m. The final result is determined as the voltage support capability coefficient of the distributed power source numbered m. The calculation process for the voltage support capability coefficient is expressed mathematically as follows:

[0042]

[0043] in, The voltage reference value for a microgrid is expressed in volts. It is usually taken as the rated voltage of the microgrid and is used to normalize voltage deviations to a dimensionless per-unit value. The voltage support capability coefficient represents the distributed power source numbered m, and this coefficient is a dimensionless value. The absolute value of the voltage deviation of the distributed power source with the number m is expressed in volts. It is obtained by calculating the absolute value of the difference between the measured value of the grid connection point voltage of the distributed power source with the number m and the reference value of the voltage at the microgrid's point of common coupling. The voltage weighting factor represents a preset voltage weighting factor, which is a coefficient used to adjust the contribution of voltage deviation to the voltage support capability coefficient. The voltage weighting factor ranges from 0.5 to 1.5. The specific value of the voltage weighting factor is determined according to the microgrid voltage level and operating procedures. In this embodiment, the voltage weighting factor is set to 1.0. The setting basis is to directly weight the absolute value of the voltage deviation with the reciprocal of the regulation margin ratio under the standard voltage deviation response requirements. The regulation margin ratio of distributed generation numbered m is dimensionless and is calculated by dividing the upward regulation margin of distributed generation numbered m by the downward regulation margin. The above steps are performed on all distributed generation sources within the microgrid to obtain the voltage support capability coefficient for each distributed generation source.

[0044] After obtaining the voltage support capability coefficients of all distributed power sources, the regulation layer is divided. All voltage support capability coefficients of the distributed power sources are sorted in descending order of value, forming an ordered capability coefficient ranking sequence. In this sequence, the distributed power source with the largest voltage support capability coefficient is at the beginning, and the distributed power source with the smallest voltage support capability coefficient is at the end.

[0045] The arithmetic mean of all voltage support capability coefficients in the capability coefficient ranking sequence is calculated, and this arithmetic mean is used as the capability coefficient threshold. The capability coefficient threshold is used to distinguish the strength of the voltage support capability of distributed power sources.

[0046] Each distributed generation (DG) within the microgrid is iterated sequentially, comparing its voltage support capability coefficient with a capability threshold. If a DG's voltage support capability coefficient is greater than or equal to the capability threshold, it is assigned to the primary regulation layer; otherwise, it is assigned to the secondary regulation layer. After this iteration, all DGs in the microgrid are assigned to either the primary or secondary regulation layer.

[0047] In some embodiments, a preset voltage weighting factor Adjustments are made based on the allowable range of voltage deviation at the microgrid's point of common coupling. When the allowable voltage deviation range is narrow, the voltage weighting factor... A value close to 1.5 is chosen to enhance the distinguishability of voltage deviation on the voltage support capability coefficient; when the allowable voltage deviation range is wide, the voltage weighting factor... A value close to 0.5 is chosen to reduce the impact of voltage deviation and make the regulation margin ratio the dominant factor. Voltage weighting factor. The adjustments can be manually input through the human-machine interface of the central controller or automatically tuned by the voltage quality optimization algorithm and written into the global parameter table.

[0048] Optionally, when calculating the average of all voltage support capability coefficients in the capability coefficient ranking sequence, if the voltage support capability coefficients of individual distributed power sources deviate significantly from the overall distribution, a truncated average method can be used. This involves removing the largest and smallest voltage support capability coefficients from the capability coefficient ranking sequence and calculating the average of the remaining coefficients. This average is then used as the capability coefficient threshold to eliminate the influence of extreme values ​​on the stratification results. Whether to use a truncated average is selected by the user through a configuration flag.

[0049] See Figure 4In the figure, the horizontal axis represents the number of distributed power sources within the microgrid, ranging from 0 to 500, and the vertical axis represents the voltage support capability coefficient. Blue dots indicate the voltage support capability coefficient of each distributed power source in the primary regulation layer, orange triangles indicate the voltage support capability coefficient of each distributed power source in the secondary regulation layer, and red dashed lines represent the capability coefficient threshold.

[0050] As shown in the figure, the voltage support capability coefficients of most distributed power sources are relatively small, mainly concentrated between 0 and 10. Furthermore, the voltage support capability coefficients of the secondary regulation layer are generally low, all below the capability coefficient threshold. The voltage support capability coefficients of the primary regulation layer are more dispersed, with some distributed power sources having capability coefficients significantly higher than the capability coefficient threshold, and extreme values ​​exist, with the maximum value exceeding 90, indicating that their voltage support capability is significantly better than other units.

[0051] The capability factor threshold, represented by a red dashed line, runs through the diagram and has a value of approximately 3.8, serving as the boundary between the primary and secondary regulation layers. Distributed power sources with a voltage support capability factor greater than or equal to this threshold are classified as the primary regulation layer, undertaking the main voltage regulation tasks; distributed power sources with a capability factor lower than the threshold are classified as the secondary regulation layer, undertaking auxiliary regulation functions.

[0052] In practical implementation, the method for calculating the primary power regulation amount of each distributed power source in the primary regulation layer and obtaining the power output value after primary regulation is as follows.

[0053] The system acquires the real-time output power and voltage support capability coefficient of all distributed power sources in the primary regulation layer. The distributed power sources in the primary regulation layer have been clearly identified during the previous regulation layer segmentation process. The microgrid central controller maintains a primary regulation layer member list, which records the numbers of each distributed power source belonging to the primary regulation layer. For each distributed power source in this list, the real-time output power of the distributed power source is acquired in real time through the power measurement unit, and the previously calculated and stored voltage support capability coefficient of the distributed power source is read from the central controller's memory.

[0054] Calculate the sum of the voltage support capability coefficients of all distributed power sources in the primary regulation layer. Iterate through the list of members of the primary regulation layer, summing the voltage support capability coefficients of each distributed power source in the list. The sum is recorded as the total support coefficient within the layer. The total support coefficient within the layer is a dimensionless value used to characterize the overall voltage support capability of the primary regulation layer.

[0055] For each distributed power source in the primary regulation layer member list, calculate its power-sharing weight. The calculation method is as follows: divide the voltage support capability coefficient of the distributed power source by the total support coefficient within the layer; the quotient is the power-sharing weight of that distributed power source. The sum of the power-sharing weights of all distributed power sources equals 1.

[0056] The real-time frequency deviation at the microgrid's point of common coupling (PCC) is obtained. A frequency measuring device is installed at the PCC, which collects the zero-crossing time intervals of the PCC voltage waveform in real time and calculates the current actual frequency value. Simultaneously, the central controller stores the microgrid's rated frequency setpoint, typically 50Hz or 60Hz, determined according to the power grid standards of the microgrid's location. The difference between the current actual frequency value and the rated frequency setpoint is the real-time frequency deviation, measured in Hz. Within each control cycle, the frequency measuring device transmits the real-time frequency deviation value to the microgrid's central controller.

[0057] After obtaining the real-time frequency deviation value, the primary power regulation is calculated for each distributed power source in the primary regulation layer. The calculation process is expressed mathematically as follows:

[0058]

[0059] in, It serves as an index identifier for distributed power sources in the primary regulation layer, used to distinguish different distributed power sources within the primary regulation layer; The index identifier is The primary power regulation of a distributed power source, in kilowatts; The real-time frequency deviation at the point of common coupling of the microgrid is measured in Hertz and is obtained in real time by a frequency measuring device installed at the point of common coupling. The frequency-power droop coefficient represents the preset frequency-power droop factor, with the unit being kilowatts per hertz. The physical meaning of the frequency-power droop factor is the power adjustment corresponding to a unit frequency deviation. The frequency-power droop factor is preset and stored in the microgrid central controller. The index identifier is The power sharing weight of distributed power sources is dimensionless and identified by an index. The voltage support capability coefficient of the distributed power source is obtained by dividing the total support coefficient within the layer.

[0060] In this embodiment, the frequency-power droop coefficient The setting is based on the frequency regulation characteristics of the microgrid, specifically 20 kW / Hz. The basis for this setting is: in a 50Hz rated frequency system used in the microgrid, according to microgrid operating procedures, the maximum allowable frequency deviation at the point of common coupling is ±0.5Hz, corresponding to a total power regulation requirement of ±10 kW for the primary regulation layer. Therefore, the frequency-power droop factor is calculated as 10 kW divided by 0.5 Hz, i.e., 20 kW / Hz. Frequency-power droop factor The value can be adjusted according to the microgrid capacity and frequency regulation performance requirements. Its typical adjustment range is 5 kW / Hz to 50 kW / Hz. It can also be modified through the human-machine interface of the central controller. The modified value is automatically stored in the global parameter table for subsequent control cycles.

[0061] According to the above formula, the primary power regulation amount of each distributed power source in the primary regulation layer is calculated one by one.

[0062] After obtaining the primary power regulation values ​​of each distributed power source in the primary regulation layer, the power output values ​​are superimposed and limited. The initial power setpoints of each distributed power source in the primary regulation layer are obtained. These initial power setpoints are the final power command values ​​issued to each distributed power source in the previous control cycle and are stored in the power command history table of the central controller. They are read from the power command history table at the start of the current control cycle.

[0063] For each distributed power source in the primary regulation layer, the initial power setting value of the distributed power source is algebraically added to the corresponding primary power regulation amount, and the result is used as the intermediate power value of the primary regulation of the distributed power source.

[0064] Subsequently, the upper and lower limits of the rated power of the distributed power source are obtained. These limits are read from the parameter configuration table of the distributed power source controller.

[0065] The intermediate power value of the first adjustment is compared with the upper limit and lower limit of the rated power: if the intermediate power value of the first adjustment is greater than the upper limit of the rated power, the upper limit of the rated power of the distributed power source is used as the power output value after the first adjustment; if the intermediate power value of the first adjustment is less than the lower limit of the rated power, the lower limit of the rated power of the distributed power source is used as the power output value after the first adjustment; if the intermediate power value of the first adjustment is neither greater than the upper limit nor less than the lower limit of the rated power, the intermediate power value of the first adjustment is directly used as the power output value after the first adjustment.

[0066] The above processing is applied to all distributed power sources in the primary regulation layer to obtain the primary regulated power output value of each distributed power source. These power output values ​​are all limited to their respective allowable operating ranges.

[0067] In some embodiments, when acquiring the real-time frequency deviation value at the microgrid's point of common coupling, a low-pass filter is applied to the acquired frequency signal to avoid erroneous adjustments caused by instantaneous frequency fluctuations. The filtering process uses a first-order inertial filtering algorithm with a filtering time constant set to 200 milliseconds. The filtered frequency value is then subtracted from the rated frequency setting to obtain the real-time frequency deviation value, thereby eliminating high-frequency noise interference.

[0068] Optional, frequency-power droop factor The value of is not fixed, but adaptively adjusted based on the total available regulation capacity of distributed power sources in the primary regulation layer. When the sum of the total upward regulation margins of distributed power sources in the primary regulation layer exceeds the preset regulation capacity threshold, the frequency-power droop coefficient... Maintain the above settings; when the sum of the total upward adjustment margins is lower than the preset adjustment capacity threshold, the frequency-power droop coefficient... The adjustment is reduced proportionally, with the reduction ratio being the ratio of the sum of the total upward adjustment margin to the preset adjustment capacity threshold, to avoid the adjustment amount exceeding the actual adjustable range. The preset adjustment capacity threshold can be set to 5% of the microgrid's peak load based on historical microgrid operating data.

[0069] In specific implementation, the following methods are used to determine the secondary power correction coefficient and to correct the power output value after the primary adjustment to obtain the final power command value.

[0070] Relevant data is obtained from each distributed power source in the secondary regulation layer. These distributed power sources were identified during the previous regulation layer segmentation process. The microgrid central controller maintains a secondary regulation layer member list, which records the numbers of each distributed power source belonging to the secondary regulation layer. For each distributed power source in the secondary regulation layer member list, the primary regulated power output value, generated and stored during previous processing, is read from the central controller's memory area. The primary regulated power output value is written to memory after the primary regulation layer processing is completed; its value has been limited and lies between the upper and lower limits of the corresponding distributed power source's rated power.

[0071] Simultaneously, real-time electricity price signals from the electricity market are acquired. The microgrid central controller establishes a data connection with the electricity trading platform through the electricity market communication gateway and receives real-time electricity price data from the platform according to a preset sampling period. The sampling period is set based on the electricity market clearing cycle, typically 15 minutes. The central controller has an electricity price data buffer that stores the electricity price values ​​at the most recent sampling times, with each price value accompanied by a corresponding sampling timestamp. During the execution of the current control cycle, the electricity value at the current sampling time and the electricity value at the previous sampling time are retrieved from the electricity price data buffer.

[0072] The rate of change of electricity price at the current moment is determined based on the real-time electricity price signal. The rate of change is calculated as follows: subtract the electricity price at the previous sampling moment from the current sampling moment's electricity price to obtain the price difference between two adjacent sampling moments; then divide this price difference by the sampling time interval. The sampling time interval is the duration of the preset sampling period, expressed in hours. Numerically, if the electricity price at the current sampling moment is... The unit is currency per kilowatt-hour, and the electricity value at the previous sampling time was... The sampling time interval is If the unit is hours, then the electricity price change rate Depend on The unit is determined to be per square hour per kilowatt-hour in monetary terms. Within each control cycle, the electricity price change rate is calculated only once and temporarily stored in the register of the central controller.

[0073] Calculate the sum of the regulated power output values ​​of all distributed power sources in the secondary regulation layer to obtain the total output power within the layer. Iterate through the member list of the secondary regulation layer, summing the regulated power output values ​​of each distributed power source in the list, and record the sum as . The unit is kilowatt.

[0074] Based on the total output power within the layer, the rate of change in electricity price, and the preset electricity price response coefficient, the secondary power correction coefficient for each distributed power source is calculated. The calculation process is expressed in the following mathematical form:

[0075]

[0076] in, This represents the secondary power correction coefficient for each distributed power source in the secondary regulation layer, expressed in kilowatts. It represents the total output power within the secondary regulation layer, in kilowatts, and is obtained by summing the power output values ​​of all distributed power sources in the secondary regulation layer after primary regulation. The rate of change of electricity price at the current moment is expressed in monetary units per square hour per kilowatt-hour and is calculated by dividing the difference in electricity price between two adjacent sampling moments by the sampling time interval. This represents the preset electricity price response coefficient, measured in kilowatt-hours per monetary unit. It is a gain coefficient used to convert the rate of change in electricity price and power dimensions into power correction demand. The number of distributed power sources in the secondary regulation layer is represented by an integer directly determined by the length of the secondary regulation layer member list.

[0077] Electricity price response coefficient The value is pre-set based on the microgrid's response strategy in the electricity market, ranging from 0.2 to 1.0 kW square hours per monetary unit. In this embodiment, the electricity price response coefficient... The value is set at 0.5 kW square hours per monetary unit. The rationale is as follows: when the electricity price change rate reaches 1 monetary unit per square hour per kilowatt-hour and the total output power within the floor is 10 kilowatt-hours, the expected value of the secondary power correction coefficient is 0.5 kW. This is calculated by substituting the values ​​into the formula. The value is rounded to 0.5 under a typical secondary regulation layer membership. Electricity price response coefficient. The configuration can be modified through the human-machine interface of the microgrid central controller to adapt to different market strategies.

[0078] After obtaining the secondary power correction coefficient, power output value correction and limiting processing are performed. For each distributed power source in the secondary regulation layer member list, the primary regulated power output value and secondary power correction coefficient of that distributed power source are read from the memory area. Since the secondary power correction coefficient is calculated uniformly for all secondary regulation layer members, each distributed power source uses the same secondary power correction coefficient value.

[0079] The power output value after primary regulation of the distributed power source is added to the secondary power correction coefficient, and the result is used as the intermediate power value for secondary regulation of the distributed power source.

[0080] Obtain the upper and lower limits of the rated power for this distributed power source. The upper and lower limits are read from the parameter configuration table of the distributed power source controller.

[0081] The intermediate power value of the secondary regulation is compared with the upper limit and lower limit of the rated power: if the intermediate power value of the secondary regulation is greater than the upper limit of the rated power, the upper limit of the rated power is used as the final power command value of the distributed power source; if the intermediate power value of the secondary regulation is less than the lower limit of the rated power, the lower limit of the rated power is used as the final power command value of the distributed power source; if the intermediate power value of the secondary regulation is neither greater than the upper limit of the rated power nor less than the lower limit of the rated power, the intermediate power value of the secondary regulation is directly used as the final power command value of the distributed power source.

[0082] The above correction and limiting process is performed on all distributed power sources in the secondary regulation layer to obtain the final power command value for each distributed power source. For distributed power sources that have been assigned to the primary regulation layer, their final power command value is directly the power output value after primary regulation obtained in the previous processing, without adding the secondary power correction coefficient.

[0083] In some embodiments, the electricity price change rate is calculated using a moving average method to reduce the impact of electricity price signal noise. The central controller retains the electricity price data from the three most recent sampling times, calculates the price difference between two adjacent times, and then averages the average value. The average value is divided by the sampling time interval to obtain the electricity price change rate at the current time.

[0084] Optional, electricity price response coefficient It is not constant, but dynamically limited based on the total regulation margin of distributed power sources in the secondary regulation layer. When the calculated total power correction demand is divided by... If the obtained value exceeds the adjustable range of a certain distributed power source in the secondary regulation layer, the electricity price response coefficient is automatically reduced until the secondary power correction coefficient can be applied to all members of the secondary regulation layer without exceeding the limit. The reduced electricity price response coefficient is used as the parameter actually used in this control cycle and is restored to the preset value in the next control cycle.

[0085] In practice, the process of sending the final power command value to each distributed power source for execution is as follows.

[0086] After calculating the power commands for the primary and secondary regulation layers, the microgrid central controller stores the final power command value for each grid-connected distributed generation (DG) within the microgrid in its memory. Each final power command value is bound to a unique DG identifier, which uses the communication address registered by the DG in the microgrid monitoring system. The central controller maintains a DG communication address mapping table, which records the correspondence between each DG identifier and its communication address in the network. The communication address includes the DG controller's IP address and port number; when the communication method is a serial bus, the communication address is the slave address on the bus.

[0087] The final power command value of each distributed power source is encapsulated according to its communication address to generate a power command data packet for each distributed power source. For each distributed power source in the communication address mapping table, the central controller reads the final power command value of that distributed power source and uses it as the payload data to construct a power command data packet. The power command data packet contains three fields: a header field, a payload field, and a check field. The header field is filled with the communication address of the target distributed power source. The payload field contains the final power command value, encoded as 4 bytes using IEEE 754 single-precision floating-point format. The check field uses a cyclic redundancy check (CRC) code, and a 16-bit CRC check value is calculated from the contents of the header and payload fields. The encapsulated power command data packet is temporarily stored in the central controller's transmission buffer, awaiting transmission.

[0088] The system acquires the real-time bit error rate (BER) of each communication link within the microgrid. Each communication link refers to the physical communication channel between the central controller and each distributed power controller. These links can be wired Ethernet links, wireless communication links, or fieldbus links. Each communication link has a corresponding communication interface on the central controller side. The communication interface driver calculates the ratio of the number of erroneous bits transmitted per unit time to the total number of transmitted bits; this ratio is the real-time BER. The statistical time window is set to 1 second. Every second, the central controller reads the real-time BER from the communication interface driver and updates the corresponding link's BER value stored in the communication quality monitoring table. Before each execution command is issued, the current real-time BER of each communication link is queried from the communication quality monitoring table.

[0089] The command retransmission count for each distributed power source is determined based on the real-time bit error rate. The command retransmission count refers to the number of times the central controller repeatedly sends the same power command data packet to the same distributed power source controller, excluding the initial transmission. The command retransmission count is determined by setting a correspondence table between the bit error rate threshold range and the retransmission count. This correspondence table is pre-configured in the central controller, and the specific correspondence rule is: real-time bit error rate less than 1×10⁻⁶... -3 At that time, the command retransmission count is 0, meaning only one power command data packet is sent; the real-time bit error rate is 1×10⁻⁶. -3 Up to 5×10 -3 During this period, the instruction retransmission count is 1; the real-time bit error rate is 5×10⁻⁶. -3 Up to 1×10 -2 During this period, the instruction retransmission count is 2; the real-time bit error rate is greater than 1×10⁻⁶. -2At this time, the command retransmission count is 3. The above bit error rate threshold range is set based on the threshold requirement of the communication system's probability of successful data packet transmission under a given bit error rate, and is automatically generated after the error prevention level is set on the system configuration interface of the central controller. For each communication link, the central controller looks up the command retransmission count for the corresponding distributed power source based on the currently read real-time bit error rate. If a communication link of a distributed power source has no record in the communication quality monitoring table, the default command retransmission count value of 1 is used.

[0090] According to the retransmission count, the power command data packets of each distributed power source are sent to the controller of each distributed power source through the corresponding communication link. The central controller processes each power command data packet in the transmission buffer sequentially. For each power command data packet, the central controller selects the corresponding communication interface based on the communication address in the packet header field and sends a transmission command containing the retransmission count to that communication interface. When the communication interface performs the transmission operation, it first sends the power command data packet as the first transmission. If the retransmission count is greater than 0, the same power command data packet is retransmitted a specified number of times according to the set retransmission interval. The retransmission interval is set to 10 milliseconds, which is determined by the physical transmission delay of the communication interface and the processing delay of the receiving end to ensure that the receiving end has enough time to process each frame of data. All repeatedly transmitted data packets have completely identical content.

[0091] After each distributed power source controller receives a power command data packet, it parses the received packet. Upon receiving a data frame, the controller's communication receiving module first performs a CRC check on the entire frame based on the checksum field. If the calculated checksum does not match the received checksum field, the data frame is discarded. If the checksum matches, the 4-byte floating-point code is extracted from the data payload field and decoded into the final power command value. If the distributed power source controller receives multiple power command data packets with the same identifier within the set receiving wait time window, only the first data packet that passes the checksum is parsed; subsequent duplicate packets are discarded. The receiving wait time window is set to 2.5 times the retransmission interval, i.e., 25 milliseconds.

[0092] After parsing the final power command value, the distributed power controller writes it into the power control register of the distributed power source. The distributed power controller internally has a set of power control registers, whose addresses are mapped to the power electronic interface of the distributed power source. The power setpoint in the power control register directly affects the output power closed-loop regulation algorithm of the distributed power source, serving as the reference setpoint for the power closed loop. After completing the write operation to the power control register, the distributed power controller replies with an acknowledgment data packet to the central controller. If the central controller does not receive an acknowledgment from a distributed power source within a acknowledgment waiting timeout period, it determines that the command issuance failed, marks the distributed power source as offline, and triggers alarm processing.

[0093] In some embodiments, the determination of the instruction retransmission count uses dynamic calculation instead of table lookup. A communication reliability index is introduced for each communication link, which is calculated based on the exponentially weighted moving average of the real-time bit error rate over the most recent statistical periods. The instruction retransmission count is obtained by rounding down the logarithm of the communication reliability index to the target reliability threshold, thereby enabling adaptive adjustment of the retransmission count under different communication environments.

[0094] Optionally, the encapsulation format of the power command data packet can adopt a message format based on the Modbus TCP protocol. In this case, the header field contains the Modbus TCP protocol header, and the data payload field contains the holding register address and 16-bit integer value of the power command value. The final power command value is converted from a floating-point number in kilowatts to a 16-bit signed integer by multiplying it by 10 and rounding it down before encapsulation to adapt to the Modbus protocol's data format. The checksum field is automatically added by the Modbus TCP protocol stack.

[0095] A hierarchical control system for a microgrid under electricity market constraints includes a memory, a processor, and a computer program stored in the memory and running on the processor. The memory is a non-volatile storage medium storing an operating system, control algorithm program modules, a communication protocol stack program, and a real-time database. The processor is an embedded microprocessor with an operating frequency of at least 1 GHz, supporting multi-task scheduling. When executing the computer program, the processor sequentially performs the following steps: acquiring the real-time output power and node voltage of each distributed power source within the microgrid; constructing a power regulation margin sequence for each distributed power source based on the real-time electricity price signal from the electricity market; determining the voltage support capability coefficient of each distributed power source based on the power regulation margin sequence and node voltage; dividing the distributed power sources into a primary regulation layer and a secondary regulation layer according to the voltage support capability coefficient; calculating the primary power regulation amount of each distributed power source in the primary regulation layer and superimposing it onto the initial power setpoint to obtain the power output value after primary regulation; determining the secondary power correction coefficient based on the power output value after primary regulation and the real-time electricity price signal in the secondary regulation layer, and correcting the power output value after primary regulation to obtain the final power command value for each distributed power source; and issuing the final power command value to each distributed power source for execution. The above steps are executed cyclically within each control cycle, which is triggered by a timer interrupt in the processor, with the timing period set to 200 milliseconds.

[0096] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A hierarchical control method for microgrids under electricity market constraints, characterized in that, include: Obtain the real-time output power and node voltage of each distributed power source within the microgrid; Based on real-time electricity price signals from the electricity market, a power regulation margin sequence for each distributed power source is constructed. Based on the power regulation margin sequence and the node voltage, the voltage support capability coefficient of each distributed power source is determined. Based on the voltage support capability coefficient, the distributed power sources in the microgrid are divided into a primary regulation layer and a secondary regulation layer. In the primary regulation layer, the primary power regulation amount of each distributed power source is calculated based on the real-time output power of each distributed power source and the voltage support capability coefficient. The power regulation of each distributed power source is superimposed on its initial power setting value to obtain the power output value after the first regulation. In the secondary adjustment layer, a secondary power correction coefficient is determined based on the power output value after the primary adjustment and the real-time electricity price signal; The power output value after the first adjustment is corrected using the secondary power correction coefficient to obtain the final power command value of each distributed power source. The final power command value is then sent to each distributed power source for execution.

2. The hierarchical control method for microgrids under electricity market constraints according to claim 1, characterized in that, The specific steps for constructing the power regulation margin sequence of each distributed power source are as follows: Collect the rated power limit and current output power value of each distributed power source; Calculate the difference between the rated power upper limit of each distributed power source and the current output power value, and use it as the upward adjustment margin of each distributed power source. Collect the rated power lower limit and current output power value of each distributed power source; Calculate the difference between the current output power value and the lower limit of the rated power value of each distributed power source, and use it as the downward adjustment margin of each distributed power source. The upward and downward regulation margins of each distributed power source are arranged in the order of their numbers to form a power regulation margin sequence for each distributed power source.

3. The hierarchical control method for microgrids under electricity market constraints according to claim 2, characterized in that, The specific steps for determining the voltage support capability coefficient of each distributed power source are as follows: Obtain the measured voltage values ​​at the grid connection points of each distributed power source and the reference voltage values ​​at the microgrid's point of common coupling. Calculate the absolute value of the voltage deviation between the measured voltage at the grid connection point of each distributed power source and the reference voltage at the microgrid's point of common coupling; Obtain the upward and downward adjustment margins in the power regulation margin sequence of each distributed power source; Calculate the ratio of the upward regulation margin to the downward regulation margin of each distributed power source to obtain the regulation margin ratio of each distributed power source. The voltage support capability coefficient of each distributed power source is obtained by multiplying the absolute value of the voltage deviation of each distributed power source by a preset voltage weighting factor and then dividing by the regulation margin ratio of that distributed power source.

4. The hierarchical control method for microgrids under electricity market constraints according to claim 3, characterized in that, The specific steps for dividing the distributed power sources in the microgrid into a primary regulation layer and a secondary regulation layer are as follows: The voltage support capability coefficients of each distributed power source are sorted in descending order of their numerical values ​​to obtain the capability coefficient sorting sequence. Calculate the average value of all voltage support capability coefficients in the capability coefficient sorting sequence, and use it as the capability coefficient threshold; Distributed power sources with a voltage support capability coefficient greater than or equal to the capability coefficient threshold are classified into the primary regulation layer; Distributed power sources with a voltage support capability coefficient less than the capability coefficient threshold are assigned to the secondary regulation layer.

5. The hierarchical control method for microgrids under electricity market constraints according to claim 4, characterized in that, The specific steps for calculating the primary power regulation of each distributed power source are as follows: Obtain the real-time output power and voltage support capability coefficient of each distributed power source in the primary regulation layer; The sum of the voltage support capability coefficients of all distributed power sources in the first regulation layer is calculated to obtain the total support coefficient within the layer. For each distributed power source in the primary regulation layer, the voltage support capability coefficient of the distributed power source is divided by the total support coefficient within the layer to obtain the power sharing weight of the distributed power source. Obtain the real-time frequency deviation value at the microgrid's point of common coupling; Multiply the real-time frequency deviation value by a preset frequency-power droop coefficient, and then multiply it by the power sharing weight of the distributed power source to obtain the primary power regulation amount of the distributed power source.

6. The hierarchical control method for microgrids under electricity market constraints according to claim 5, characterized in that, The specific steps for obtaining the adjusted power output value are as follows: Obtain the initial power setting values ​​of each distributed power source in the primary regulation layer; Add the initial power setting value of each distributed power source to the corresponding primary power regulation value to obtain the primary regulation intermediate power value of each distributed power source. Obtain the upper limit and lower limit of the rated power for each distributed power source; The intermediate power value of each distributed power source after primary regulation is compared with the corresponding upper and lower limits of rated power. If the intermediate power value of primary regulation is greater than the upper limit of rated power, the upper limit of rated power is used as the power output value of the distributed power source after primary regulation. If the intermediate power value of primary regulation is less than the lower limit of rated power, the lower limit of rated power is used as the power output value of the distributed power source after primary regulation. Otherwise, the intermediate power value of primary regulation is used as the power output value of the distributed power source after primary regulation.

7. The hierarchical control method for microgrids under electricity market constraints according to claim 6, characterized in that, The specific steps for determining the secondary power correction coefficient are as follows: Obtain the power output value and real-time electricity price signal of each distributed power source in the secondary regulation layer after primary regulation; The total output power within the layer is obtained by summing the power output values ​​of all distributed power sources after primary regulation in the secondary regulation layer. The electricity price change rate at the current moment is determined based on the real-time electricity price signal. The electricity price change rate is the difference in electricity prices between two adjacent sampling moments divided by the sampling time interval. Multiply the total output power within the layer by the rate of change in electricity price and then by a preset electricity price response coefficient to obtain the total power correction requirement of the secondary adjustment layer; Divide the total power correction requirement by the number of distributed power sources in the secondary regulation layer to obtain the secondary power correction coefficient for each distributed power source.

8. A hierarchical control method for microgrids under electricity market constraints according to claim 7, characterized in that, The specific steps for obtaining the power output value of each distributed power source in the secondary regulation layer after primary regulation are as follows: Obtain the power output value and secondary power correction coefficient of each distributed power source in the secondary regulation layer after primary regulation; The power output value after primary regulation of each distributed power source is added to the corresponding secondary power correction coefficient to obtain the intermediate power value of secondary regulation for each distributed power source. Obtain the upper limit and lower limit of the rated power of each distributed power source in the secondary regulation layer; The intermediate power value of the secondary regulation of each distributed power source is compared with the corresponding upper limit and lower limit of the rated power. If the intermediate power value of the secondary regulation is greater than the upper limit of the rated power, the upper limit of the rated power is used as the final power command value of the distributed power source. If the intermediate power value of the secondary regulation is less than the lower limit of the rated power, the lower limit of the rated power is used as the final power command value of the distributed power source. Otherwise, the intermediate power value of the secondary regulation is used as the final power command value of the distributed power source.

9. A hierarchical control method for microgrids under electricity market constraints according to claim 1, characterized in that, The specific steps for sending the final power command value to each distributed power source for execution are as follows: The final power command value of each distributed power source is encapsulated according to the communication address of the distributed power source to generate a power command data packet for each distributed power source. The real-time bit error rate of each communication link in the microgrid is obtained, and the number of command retransmissions for each distributed power source is determined based on the real-time bit error rate. According to the number of retransmissions of the instruction, the power instruction data packets of each distributed power source are sent to the controller of each distributed power source through the corresponding communication link; After the controller of each distributed power source receives the power command data packet, it parses the power command data packet to obtain the final power command value and writes the final power command value into the power control register of each distributed power source.

10. A hierarchical control system for a microgrid under electricity market constraints, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the microgrid hierarchical control method under electricity market constraints as described in any one of claims 1 to 9.