Simulation-based distributed photovoltaic cluster inverter network construction optimization method and system

CN123018798APending Publication Date: 2026-10-30ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID SHANDONG ELECTRIC POWER COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611323245.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

然而,标准最小二乘法易受量测噪声及异常数据影响,导致电网强弱判断结果不准确;固定参数模型难以适应光照突变及电压波动等动态工况,造成扰动估算滞后;统一调度未充分考虑各逆变器功率裕度差异,可能导致构网任务分配不合理;直接进行模式切换缺乏平滑过渡机制,易因切换前后电压相位及等效阻抗不匹配而产生暂态冲击电流

Benefits of technology

本发明通过三段式抗差权函数的递归抗差回归算法对电网强度进行辨识,有效抑制量测噪声及异常数据影响,提高电网等效阻抗及抗差短路比的计算可靠性,从而增强弱电网条件下电网强度判断的鲁棒性;同时,本发明基于电压波动方差自适应调整扰动观测参数,对系统总扰动进行实时观测,相较于固定参数方法,提高了扰动估计对光照变化及电压波动等动态工况的跟踪能力,降低扰动估计滞后,使扰动状态表征更加准确;进一步地,本发明将电网强度信息与扰动观测结果共同作为构网决策输入,通过神经网络模型实现构网型逆变器数量的自适应确定,避免固定配置方式带来的适应性不足,提高不同运行工况下的构网合理性;此外,本发明基于功率裕度进行构网逆变器优选,并通过相位预同步与虚拟阻抗渐变控制实现运行模式平滑切换,减少暂态冲击电流,提高切换过程的稳定性;因此,本发明通过抗差辨识提升电网强度感知精度,通过扰动观测增强动态扰动感知能力,并结合二者实现构网配置优化与平滑切换,使光伏集群在弱电网及复杂扰动条件下具备更好的鲁棒性与适应性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123018798A_ABST
    Figure CN123018798A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of power systems, and discloses a simulation-based distributed photovoltaic cluster inverter network configuration optimization method and system. By calculating the equivalent impedance of a power grid, the variance of voltage fluctuation and the power margin distribution vector, the strength of the power grid, the disturbance state and the regulation capacity of each inverter can be respectively represented. A three-section robust weight function is used to modify the recursive least square algorithm, so that the robustness of the robust short-circuit ratio to abnormal data can be improved. The observation parameters of the model-free disturbance control algorithm are dynamically adjusted according to the variance of voltage fluctuation, so that the tracking ability of the total disturbance estimation can be improved. A training set is constructed based on simulation conditions, and a neural network cluster mode ratio optimization model is trained, so that the model learns the mapping relationship between the robust short-circuit ratio, the total disturbance compensation amount and the number of network configuration inverters, thereby the number of network configuration inverters is determined in combination with the current operating state. Target inverters are selected in combination with the power margin, and the transient impact in the mode switching process is reduced through internal potential phase pre-synchronization and virtual impedance gradual change control, so that the reasonable configuration and smooth switching of the network configuration inverters are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system related technologies, specifically to a simulation-based method and system for optimizing the grid structure of distributed photovoltaic cluster inverters. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] As the penetration rate of distributed photovoltaic (PV) power in distribution networks continues to increase, the equivalent inertia and short-circuit capacity of the power system are relatively reduced, and the characteristics of a weak grid are becoming increasingly prominent. The DC power generated by PV modules needs to be converted into AC power that meets the requirements of the distribution network by inverters. The grid-type inverters in distributed PV clusters need to coordinate the regulation of active and reactive power and provide virtual inertia and damping support under conditions of varying illumination, voltage fluctuations, and multiple disturbances.

[0004] During the operation of distributed photovoltaic (PV) clusters, the number of grid-connected inverters needs to be determined based on grid strength and disturbance conditions. Within the cluster, specific inverter units are selected to perform grid-connection functions, and the selected inverters are controlled to switch from grid-following operation mode to grid-connection operation mode. Existing technologies typically use the standard least squares method to identify grid strength parameters, estimate power system disturbances based on a fixed-parameter model, allocate grid-connection tasks according to unified dispatch instructions, and directly switch inverter operating modes when preset conditions are met. However, the standard least squares method is susceptible to measurement noise and abnormal data, leading to inaccurate grid strength assessments; the fixed-parameter model struggles to adapt to dynamic conditions such as sudden changes in sunlight and voltage fluctuations, causing lags in disturbance estimation; unified dispatch does not fully consider the power margin differences among inverters, potentially resulting in unreasonable grid-connection task allocation; and direct mode switching lacks a smooth transition mechanism, easily generating transient inrush currents due to voltage phase and equivalent impedance mismatches before and after switching. Therefore, existing technologies struggle to accurately determine the number of grid-connected inverters required under complex operating conditions, and also struggle to achieve smooth switching of operating modes, thus affecting the ability of distributed photovoltaic clusters to support the voltage, frequency, and disturbances of the distribution network. Summary of the Invention

[0005] To address the aforementioned issues, this invention proposes a simulation-based method and system for optimizing distributed photovoltaic cluster inverter network construction. It corrects the recursive least squares identification results using a three-segment robust weight function and combines voltage fluctuation adaptive disturbance observation to achieve a joint characterization of grid strength and disturbance states. Furthermore, it determines the number of grid-type inverters based on these states and, by combining power margin ranking, pre-synchronization, and virtual impedance gradual control, achieves optimized selection and smooth switching of grid-type inverters.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: One or more embodiments provide a simulation-based method for optimizing the grid configuration of distributed photovoltaic cluster inverters, including the following steps: Acquire three-phase voltage and three-phase current data at the grid connection point, rated capacity data and real-time active power of each inverter unit, and calculate the grid equivalent impedance amplitude, voltage fluctuation variance and power margin distribution vector. Based on the obtained equivalent impedance of the power grid, a recursive robust regression algorithm based on a three-segment robust weight function is used to identify the robustness of the power grid strength. The weighting factor is determined according to the observation residual, and the update gain of the recursive least squares algorithm is corrected using the weighting factor to obtain the robust short-circuit ratio used to characterize the power grid strength. Based on the voltage fluctuation variance at the grid connection point of common coupling, the observation parameters of the model-free disturbance rejection control algorithm are dynamically adjusted, and the total disturbance of the grid-connected system is estimated in real time to obtain the total disturbance estimate. The robust short-circuit ratio and total disturbance compensation are input into the cluster mode allocation optimization model based on the simulation training set to determine the number of grid-type inverters. The switching priority sequence is determined based on the power margin of each inverter, and the target grid inverter is determined based on the number of grid-connected inverters. Internal potential phase pre-synchronization and virtual impedance gradual change control are performed on the target grid-connected inverter to smoothly switch the target grid-connected inverter from grid-following operation mode to grid-connected operation mode.

[0007] Furthermore, based on the obtained equivalent impedance of the power grid, a recursive robust regression algorithm based on a three-segment robust weight function is used to correct the update gain of the recursive least squares algorithm to obtain the robust short-circuit ratio. The method includes the following steps: When the recursive robust regression algorithm is started, the parameters to be identified, the covariance parameters, and the forgetting factor are initialized, and the equivalent impedance magnitude of the power grid calculated based on the actual three-phase voltage data and three-phase current data collected at the grid connection point at the current sampling time is used as the observation input of the recursive robust regression algorithm. The absolute value of the observation residual is calculated based on the difference between the magnitude of the equivalent impedance of the power grid at the current sampling time and the estimated value of the equivalent impedance of the power grid at the previous sampling time. The weighting factor corresponding to the current sampling time is calculated based on the numerical relationship between the absolute value of the observed residual and the first and second threshold parameters of the set three-segment robust weighting function. The standard update gain is calculated based on the covariance parameter of the previous sampling time, the regression value of the current sampling time, and the forgetting factor. The standard update gain is then corrected using a weighting factor, and the parameters to be identified and the covariance parameter are updated accordingly. The estimated value of the equivalent impedance amplitude of the power grid is determined based on the parameters to be identified updated at the current sampling time. The reference impedance value is calculated based on the rated voltage parameters of the grid connection point and the rated capacity parameters of the distributed photovoltaic cluster. Then, the differential short-circuit ratio value at the current sampling time is calculated.

[0008] Furthermore, based on the numerical relationship between the absolute value of the observed residual and the first and second threshold parameters of the set three-segment robust weight function, the weight factor corresponding to the current sampling time is calculated; Step 231: Set the first threshold parameter and the second threshold parameter of the three-segment robust weight function, and the second threshold parameter is greater than the first threshold parameter; Step 232: Compare the absolute value of the observed residual with the first threshold parameter and the second threshold parameter. If the absolute value of the observed residual is less than or equal to the first threshold parameter, the weight factor is assigned a value of 1. If the absolute value of the observed residual is greater than the first threshold parameter and less than or equal to the second threshold parameter, the weight factor is calculated using linear weight reduction logic, so that the weight factor decreases linearly as the absolute value of the observed residual increases. If the absolute value of the observed residual is greater than the second threshold parameter, the weight factor is assigned a value of 0.

[0009] Furthermore, the process of updating the parameters to be identified and the covariance parameters includes: Using the covariance parameter of the previous sampling time, the regression value of the current sampling time, and the forgetting factor, the standard update gain of the current sampling time is calculated according to the recursive least squares algorithm. The standard update gain is weighted and corrected using the weight factor at the current sampling time to obtain the robust update gain; when the weight factor is 1, the robust update gain is equal to the standard update gain; when the weight factor is 0, the robust update gain is set to zero, so that the parameter to be identified stops updating. The robust update gain is used to correct the parameters to be identified at the previous sampling time. The difference between the actual calculated equivalent impedance amplitude of the power grid and the predicted equivalent impedance amplitude of the power grid at the current sampling time is multiplied by the robust update gain, and the resulting multiplier is added to the parameters to be identified at the previous sampling time to obtain the parameters to be identified at the current sampling time. The covariance parameter is updated using robust update gain, regression value at the current sampling time, covariance parameter at the previous sampling time, and forgetting factor to obtain the covariance parameter at the current sampling time. The covariance parameter at the current sampling time is then used for recursive calculation at the next sampling time.

[0010] Furthermore, for the preprocessed three-phase voltage data and voltage fluctuation variance, the process of outputting the total disturbance compensation in real time using a model-free disturbance rejection control algorithm is as follows: Based on the preprocessed three-phase voltage data and voltage fluctuation variance, a model-free disturbance rejection control algorithm based on a linear extended state observer is constructed. The voltage amplitude at the grid connection point of common coupling is taken as the observation object, and the unknown factors affecting the voltage change at the grid connection point of common coupling are uniformly represented as the total disturbance state. The observer bandwidth parameter of the linear extended state observer is dynamically adjusted through the voltage fluctuation variance, and the total disturbance state is estimated in real time using the linear extended state observer to obtain the total disturbance estimate.

[0011] Furthermore, the cluster configuration optimization model based on neural networks specifically employs a multilayer perceptron regression network, including an input layer, at least one fully connected hidden layer, and an output layer. The input layer includes two input nodes corresponding to the robust short-circuit ratio and the total disturbance compensation, respectively. The hidden layer extracts the nonlinear relationship between the robust short-circuit ratio, the total disturbance compensation, and the number of grid-type inverters through a nonlinear activation function. The output layer includes an output node for outputting the predicted number of grid-type inverters, and performs integerization and quantity boundary constraints on the predicted number of grid-type inverters to obtain the optimal number of grid-type inverters.

[0012] Furthermore, the process of determining the switching priority sequence based on the power margin of each inverter includes: Step 51: Call the power margin distribution vector, which contains the power margin values ​​corresponding to each inverter unit in the distributed photovoltaic cluster. Step 52: Traverse the power margin distribution vector, make numerical judgments on the power margin values ​​of each inverter unit, and determine the network priority weight corresponding to each inverter unit based on the judgment results. Step 53: Sort the network priority weights of each inverter unit in descending order; Step 54: Based on the order of grid priority weights after the descending sorting operation, extract the corresponding photovoltaic inverter unit numbers in sequence, reorganize the extracted photovoltaic inverter unit numbers into a one-dimensional index vector in chronological order, and use the one-dimensional index vector as the inverter switching priority sequence. Alternatively, the training method for a cluster pattern allocation optimization model based on neural networks includes the following steps: S1. Construct and run the electromagnetic transient simulation model of the distributed photovoltaic cluster, set simulation conditions with different grid strength and disturbance states, obtain and preprocess the voltage and current of the grid connection point under each simulation condition, as well as the rated capacity and real-time active power of each inverter, and calculate the grid equivalent impedance amplitude, voltage fluctuation variance and power margin distribution vector. S2. For each simulation condition, determine the equivalent impedance of the power grid based on the changes in voltage and current at the grid connection point. Based on the equivalent impedance of the power grid, use a three-segment robust weight function to correct the update gain of the recursive least squares algorithm to obtain the robust short-circuit ratio. S3. Based on the voltage fluctuation variance of the grid-connected common coupling point in the electromagnetic transient simulation model, dynamically adjust the observation parameters of the model-free disturbance rejection control algorithm, and estimate the total disturbance of the grid-connected system in real time to obtain the total disturbance estimate. S4. For each simulation condition, set different numbers of grid-connected inverters, obtain the grid common connection point voltage deviation and frequency deviation corresponding to each number of grid-connected inverters, and determine the number of grid-connected inverters with the smallest voltage deviation and frequency deviation as the optimal number of grid-connected inverters under the corresponding simulation condition. The robust short-circuit ratio and total disturbance compensation under each simulation condition are used as sample inputs, and the corresponding number of inverters with optimal grid configuration is used as sample labels to construct a training dataset. S5. Supervised training of the cluster mode configuration optimization model is performed using the training dataset to establish the mapping relationship between the robust short-circuit ratio, the total disturbance compensation, and the optimal number of inverters in the grid configuration, thus obtaining the trained cluster mode configuration optimization model. One or more embodiments provide a simulation-based distributed photovoltaic cluster inverter grid optimization system, including: The acquisition module is configured to acquire three-phase voltage and three-phase current data at the grid connection point, rated capacity data and real-time active power of each inverter unit, and calculate the grid equivalent impedance amplitude, voltage fluctuation variance and power margin distribution vector. The robust short-circuit ratio identification module is configured to identify the robustness of the power grid strength based on the obtained equivalent impedance of the power grid using a recursive robust regression algorithm based on a three-segment robust weight function, determine the weight factor according to the observation residual, and use the weight factor to correct the update gain of the recursive least squares algorithm to obtain the robust short-circuit ratio used to characterize the power grid strength. The total disturbance estimation module is configured to dynamically adjust the observation parameters of the model-free disturbance rejection control algorithm based on the voltage fluctuation variance of the grid connection point, and to estimate the total disturbance of the grid-connected system in real time to obtain the total disturbance estimate. The inverter quantity determination module is configured to input the robust short-circuit ratio and total disturbance compensation into a cluster mode allocation optimization model based on a neural network trained on a simulation training set to determine the number of grid-type inverters. The target grid inverter identification module is configured to determine the switching priority sequence based on the power margin of each inverter, and to determine the target grid inverter based on the number of grid-type inverters. The switching control module is configured to perform internal potential phase pre-synchronization and virtual impedance gradual control on the target grid inverter, so that the target grid inverter can smoothly switch from grid-following operation mode to grid-connected operation mode.

[0013] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, wherein when executed by the processor, the computer instructions complete the steps in the above-described simulation-based distributed photovoltaic cluster inverter network optimization method.

[0014] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the steps in the above-described simulation-based distributed photovoltaic cluster inverter network optimization method.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention identifies grid strength using a recursive robust regression algorithm with a three-segment robust weight function, effectively suppressing the influence of measurement noise and abnormal data, and improving the reliability of calculating the grid's equivalent impedance and robust short-circuit ratio, thereby enhancing the robustness of grid strength assessment under weak grid conditions. Simultaneously, this invention adaptively adjusts disturbance observation parameters based on voltage fluctuation variance to perform real-time observation of the total system disturbance. Compared to fixed-parameter methods, this improves the disturbance estimation's ability to track dynamic conditions such as illumination changes and voltage fluctuations, reduces disturbance estimation lag, and makes the disturbance state characterization more accurate. Furthermore, this invention uses grid strength information and disturbance observation results together as input for grid construction decisions. This invention utilizes a neural network model to adaptively determine the number of grid-connected inverters, avoiding the lack of adaptability caused by fixed configurations and improving the rationality of grid construction under different operating conditions. Furthermore, it optimizes grid-connected inverter selection based on power margin and achieves smooth switching of operating modes through phase pre-synchronization and virtual impedance gradual change control, reducing transient inrush currents and improving the stability of the switching process. Therefore, this invention enhances the accuracy of grid strength perception through robustness identification, strengthens dynamic disturbance perception through disturbance observation, and combines both to achieve grid configuration optimization and smooth switching, enabling photovoltaic clusters to have better robustness and adaptability under weak grid and complex disturbance conditions.

[0016] The advantages of the present invention, as well as its additional advantages, will be described in detail in the following specific embodiments. Attached Figure Description

[0017] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute a limitation thereof.

[0018] Figure 1The flowchart is for the distributed photovoltaic cluster inverter network optimization method provided in Embodiment 1 of the present invention.

[0019] Figure 2 This is a simulation test diagram of the real-time estimation stage of the robust short-circuit ratio during the verification process of Embodiment 1 of the present invention.

[0020] Figure 3 This is a simulation test diagram of the model-free disturbance rejection control algorithm during the verification process of Embodiment 1 of the present invention.

[0021] Figure 4 This is a simulation test diagram of the virtual impedance soft-start stage during the verification process of Embodiment 1 of the present invention.

[0022] Figure 5 This is a simulation test diagram of the grid-connected common coupling point current smoothing response stage during the verification process of Embodiment 1 of the present invention. Detailed Implementation

[0023] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0024] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0025] It should be noted that the terminology used herein is for describing particular embodiments only and is not intended to limit the exemplary embodiments of the present invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof. It should be noted that, without conflict, the various embodiments and features within those embodiments can be combined with each other. The embodiments will now be described in detail with reference to the accompanying drawings.

[0026] Example 1 In one or more of the technical solutions disclosed in the embodiments, such as Figures 1 to 5 As shown, a simulation-based method for optimizing the grid configuration of inverters in a distributed photovoltaic (PV) cluster is used to dynamically determine the number of inverters and specific inverter units entering the grid configuration operation mode in a distributed PV cluster. The method includes the following steps: Step 1: Obtain the three-phase voltage and three-phase current data at the grid connection point, the rated capacity data and real-time active power of each inverter unit, and calculate the grid equivalent impedance amplitude, voltage fluctuation variance and power margin distribution vector. Step 2: Based on the obtained equivalent impedance of the power grid, a recursive robust regression algorithm based on a three-segment robust weight function is used to identify the robustness of the power grid strength. The weighting factor is determined according to the observation residual, and the update gain of the recursive least squares algorithm is corrected using the weighting factor to obtain the robust short-circuit ratio used to characterize the power grid strength. Step 3: Based on the voltage fluctuation variance at the grid connection point of common coupling, dynamically adjust the observation parameters of the model-free disturbance rejection control algorithm, and estimate the total disturbance of the grid-connected system in real time to obtain the total disturbance estimate. Step 4: Input the robust short-circuit ratio and total disturbance compensation into the cluster mode allocation optimization model based on the simulation training set to determine the number of grid-type inverters; Step 5: Determine the switching priority sequence based on the power margin of each inverter, and determine the target grid inverter based on the number of grid-connected inverters; Step 6: Perform internal potential phase pre-synchronization and virtual impedance gradual change control on the target grid-connected inverter to smoothly switch the target grid-connected inverter from grid-following operation mode to grid-connected operation mode.

[0027] This invention characterizes the grid strength, disturbance state, and regulation capability of each inverter by calculating the grid equivalent impedance, voltage fluctuation variance, and power margin distribution vector. It improves the robustness of the robust short-circuit ratio to abnormal data by using a three-segment robust weight function to correct the recursive least squares algorithm. Dynamically adjusting the observation parameters of the model-free disturbance rejection control algorithm based on the voltage fluctuation variance enhances the tracking capability of the total disturbance estimation. A training set is constructed based on simulated operating conditions, and a neural network cluster mode matching optimization model is trained. This model learns the mapping relationship between the robust short-circuit ratio, the total disturbance compensation, and the number of grid-connected inverters, thereby determining the number of grid-connected inverters based on the current operating state. Furthermore, it selects target inverters based on power margin and reduces transient impacts during mode switching through internal potential phase pre-synchronization and virtual impedance gradual control, achieving reasonable configuration and smooth switching of grid-connected inverters.

[0028] In step 1, optionally, for the actual power grid, voltage and current acquisition devices installed at the grid connection point can be used to synchronously acquire three-phase voltage and three-phase current data at a preset sampling frequency; and the rated capacity data and real-time active power data of each inverter unit can be obtained through the controller or communication interface of each inverter unit. It is feasible to preprocess the acquired three-phase voltage and current data, rated capacity data of each inverter unit, and real-time active power, including: Step 11: Perform low-pass filtering on the three-phase voltage data and three-phase current data to filter out high-frequency interference and harmonic components, and obtain the preprocessed three-phase voltage data and three-phase current data. Step 12: Perform a moving average processing on the real-time active power to obtain preprocessed three-phase voltage data, three-phase current data, and real-time active power data; Optionally, the collected rated capacity data and real-time active power output data of each inverter unit are input into a data smoothing processor. The data smoothing processor performs a moving average calculation on the real-time active power output data to suppress numerical jitter, outputs pre-processed real-time active power output data, and directly outputs the rated capacity data as the pre-processed rated capacity data.

[0029] A further technical solution involves calculating the magnitude of the equivalent impedance of the power grid, including the following steps: Step 141: Perform Parker transformation on the preprocessed three-phase voltage and three-phase current data to convert the three-phase quantities in the stationary coordinate system into direct-axis voltage components in the synchronous rotating coordinate system. quadrature axis voltage component Direct-axis current component With cross-axis current component ; Step 142: Construct differential calculation logic to calculate the difference between the direct-axis voltage components at the current data sampling time and the previous sampling time. Difference between cross-axis voltage components Difference between direct-axis current components Difference with quadrature axis current component ; ; Where k represents the current sampling time.

[0030] Step 143: Using the voltage and current phasor calculation logic, calculate the sum of the squares of the difference between the direct-axis voltage component and the quadrature-axis voltage component between the current simulation time and the previous simulation time, and perform a square root operation to obtain the voltage change magnitude value. Calculate the sum of the squares of the difference between the direct-axis current component and the quadrature-axis current component between the current simulation time and the previous simulation time, and perform a square root operation to obtain the current change magnitude value. The ratio of the voltage change magnitude value to the current change magnitude value is the equivalent impedance amplitude of the power grid. The magnitude of voltage change is: ; The magnitude of the current change is: ; The magnitude of the equivalent impedance of the power grid is: ; Further, the voltage fluctuation variance is calculated, including: Step 151: Perform root mean square calculation on the preprocessed three-phase voltage data, and determine the effective voltage value at the grid connection point based on the three-phase voltage data corresponding to the current sampling time. When using the three-phase voltage synthesis root mean square (RMS) method, the effective voltage value at the current sampling moment can be expressed as: ; in, This represents the effective voltage value at the grid common coupling point at the k-th sampling time; and These represent the preprocessed phase A voltage, phase B voltage, and phase C voltage at the k-th sampling time, respectively. Therefore, as the sampling time changes continuously, the corresponding effective voltage value data sequence is obtained: ; Step 152: Construct a sliding statistical time window and collect the effective voltage value data at consecutive sampling times within the sliding statistical time window; the sliding statistical time window contains N sampling points, where N represents the total number of sampling points within the sliding statistical time window.

[0031] Step 153: Calculate the square of the difference between the effective voltage value data at each sampling time within the sliding statistical time window and the arithmetic mean of the effective voltage value data within the sliding statistical time window. Sum the squares of each difference and divide by the total number of sampling points within the sliding statistical time window to obtain the voltage fluctuation variance. ; in, This represents the voltage fluctuation variance corresponding to the k-th sampling time. This represents the effective voltage value at the kj-th sampling time within the sliding statistical time window; The value represents the arithmetic mean of the effective voltage values ​​within the sliding statistical time window; N represents the total number of sampling points within the sliding statistical time window; and j represents the index of the effective voltage values ​​within the sliding statistical time window.

[0032] Further, the power margin distribution vector is calculated, including: Step 161: For each inverter unit in the distributed photovoltaic cluster, subtract the pre-processed real-time active power output data from the pre-processed rated active power to obtain the power margin value of the inverter unit. The power margin value of the i-th inverter unit is expressed as: in, This represents the power margin value of the i-th inverter unit; This represents the preprocessed rated active power data of the i-th inverter unit; This represents the real-time active power output data after preprocessing by the i-th inverter unit; i represents the inverter unit number.

[0033] Step 162: Arrange the power margin values ​​of each inverter unit into a column vector according to the numbering order of the inverter units, and use it as the power margin distribution vector.

[0034] ; in, represents the power margin distribution vector of the distributed photovoltaic cluster; M represents the total number of inverter units within the distributed photovoltaic cluster.

[0035] In step 2, the equivalent impedance magnitude of the power grid calculated based on the actual three-phase voltage and three-phase current data collected at the grid connection point is input into a robust recursive least squares algorithm based on a three-segment robust weight function. The weight factor corresponding to the three-segment robust weight function is determined based on the observation residual of the equivalent impedance magnitude of the power grid. The update gain of the recursive least squares algorithm is corrected using the weight factor, and the estimated value of the equivalent impedance magnitude of the power grid is recursively updated based on the corrected update gain. The robust short-circuit ratio is calculated based on the estimated equivalent impedance magnitude of the power grid. In step 2, based on the obtained equivalent impedance of the power grid, a recursive robust regression algorithm based on a three-segment robust weight function is used to correct the update gain of the recursive least squares algorithm to obtain the robust short-circuit ratio. The method includes the following steps: Step 21: Initialize the recursive robust regression algorithm: When the recursive robust regression algorithm is started, the parameters to be identified, the covariance parameters, and the forgetting factor are initialized, and the equivalent impedance amplitude of the power grid calculated based on the actual three-phase voltage data and three-phase current data collected at the grid connection point at the current sampling time is used as the observation input of the recursive robust regression algorithm. The observed input is represented as: ; in, This represents the observed input at the k-th sampling time. This represents the magnitude of the equivalent impedance of the power grid calculated based on the actual voltage and current data at the k-th sampling time and its adjacent sampling times; k represents the current sampling time.

[0036] The initial representation of the parameters to be identified and the covariance parameters is as follows: ; ; in, Indicates the initial value of the parameter to be identified; This indicates the preset initial value of the parameter to be identified; This represents the initial value of the covariance parameter; This represents the preset initial value of the covariance.

[0037] The forgetting factor used in the recursive calculation satisfy: ; Step 22: Calculate the absolute value of the observation residual: Calculate the absolute value of the observation residual based on the difference between the magnitude of the equivalent impedance of the power grid at the current sampling time and the estimated value of the equivalent impedance of the power grid at the previous sampling time. Specifically, the calculation process for the absolute value of the observed residuals includes: Step 221: Using the equivalent impedance amplitude of the power grid as the direct observation object, construct the regression quantity at the current sampling time according to the single-parameter direct observation model. And set the regression vector to a unit numerical vector; Step 222: Call the parameters to be identified obtained from the previous sampling time, and combine them with the regression value at the current sampling time to calculate the predicted value of the equivalent impedance amplitude of the power grid at the current sampling time. ; in, This represents the predicted magnitude of the equivalent impedance of the power grid at the k-th sampling time. This represents the parameter to be identified obtained from the previous sampling time.

[0038] Step 223: Calculate the difference between the actual calculated equivalent impedance amplitude of the power grid at the current sampling time and the predicted equivalent impedance amplitude of the power grid, and take the absolute value of the difference to obtain the absolute value of the observation residual; ; in, This represents the absolute value of the observation residual at the k-th sampling time.

[0039] Step 23: Calculate the weighting factor: Based on the numerical relationship between the absolute value of the observed residual and the first and second threshold parameters of the set three-segment robust weighting function, calculate the weighting factor corresponding to the current sampling time. Step 231: Set the first threshold parameter and the second threshold parameter of the three-segment robust weight function, and the second threshold parameter is greater than the first threshold parameter; Step 232: Compare the absolute value of the observed residual with the first threshold parameter and the second threshold parameter. If the absolute value of the observed residual is less than or equal to the first threshold parameter, the weight factor is assigned a value of 1. If the absolute value of the observed residual is greater than the first threshold parameter and less than or equal to the second threshold parameter, the weight factor is calculated using linear weight reduction logic, so that the weight factor decreases linearly as the absolute value of the observed residual increases. If the absolute value of the observed residual is greater than the second threshold parameter, the weight factor is assigned a value of 0. The formula for calculating the weighting factor is: ; in, This represents the weight factor at the k-th sampling time. This represents the absolute value of the observation residual at the k-th sampling time. Indicates the first threshold parameter; This represents the second threshold parameter.

[0040] Step 24: Correcting the gain and updating the parameters: Calculate the standard update gain based on the covariance parameter of the previous sampling time, the regression value of the current sampling time, and the forgetting factor. Correct the standard update gain using the weighting factor, and then update the parameters to be identified and the covariance parameter. The process of updating the parameters to be identified and the covariance parameters includes: Step 241: Using the covariance parameter of the previous sampling time, the regression value of the current sampling time, and the forgetting factor, calculate the standard update gain of the current sampling time according to the recursive least squares algorithm; ; in, This represents the standard update gain at the k-th sampling time. This represents the covariance parameter at the previous sampling time. This represents the regression value at the k-th sampling time. This represents the forgetting factor.

[0041] Step 242: Use the weight factor at the current sampling time to perform weighted correction on the standard update gain to obtain the robust update gain; when the weight factor is 1, the robust update gain is equal to the standard update gain; when the weight factor is 0, the robust update gain is set to zero, so that the parameter to be identified stops updating. ; in, This represents the robust update gain at the k-th sampling time. This represents the weight factor at the k-th sampling time. This represents the standard update gain at the k-th sampling time.

[0042] Step 243: Use robust update gain to correct the parameters to be identified at the previous sampling time. Multiply the difference between the actual calculated equivalent impedance amplitude of the power grid and the predicted equivalent impedance amplitude of the power grid at the current sampling time by the robust update gain, and add the resulting multiplier to the parameters to be identified at the previous sampling time to obtain the parameters to be identified at the current sampling time. ; in, This represents the parameter to be identified obtained by updating at the k-th sampling time. This represents the parameter to be identified obtained from the previous sampling time. This shows the robust update gain at the k-th sampling time. This represents the magnitude of the equivalent impedance of the power grid actually calculated at the k-th sampling time; This represents the predicted magnitude of the equivalent impedance of the power grid at the k-th sampling time.

[0043] Step 244: Update the covariance parameter using robust update gain, regression value at the current sampling time, covariance parameter at the previous sampling time, and forgetting factor to obtain the covariance parameter at the current sampling time, and use the covariance parameter at the current sampling time for recursive calculation at the next sampling time. ; in, This represents the covariance parameter updated at the k-th sampling time. This represents the covariance parameter at the previous sampling time. This represents the robust update gain at the k-th sampling time. This represents the regression value at the k-th sampling time. This represents the forgetting factor.

[0044] Step 25: Output the robust short-circuit ratio value: Determine the estimated value of the equivalent impedance amplitude of the power grid based on the parameters to be identified updated at the current sampling time, and calculate the reference impedance value based on the rated voltage parameters of the grid connection point and the rated capacity parameters of the distributed photovoltaic cluster, and then calculate the robust short-circuit ratio value at the current sampling time. Step 251: Extract the estimated value of the equivalent impedance magnitude of the power grid from the parameter vector to be identified at the current simulation moment; Step 252: Obtain the rated voltage parameters of the grid-connected common connection point and the rated capacity parameters of the distributed photovoltaic cluster set in the electromagnetic transient simulation model; Step 253: Divide the square of the rated voltage parameter by the rated capacity parameter to obtain the reference impedance value; ; in, Indicates the reference impedance value; U N This indicates the rated voltage parameter of the grid connection point; This indicates the rated capacity parameter of a distributed photovoltaic cluster.

[0045] Step 254: Divide the reference impedance value by the estimated value of the equivalent impedance of the power grid to obtain the differential short-circuit ratio value at the current simulation time. ; in, This represents the robust short-circuit ratio at the k-th sampling time. Indicates the reference impedance value; This represents the estimated magnitude of the equivalent impedance of the power grid at the k-th sampling time.

[0046] Step 2 of this embodiment inputs the equivalent impedance magnitude of the power grid into a recursive robust regression algorithm based on a three-segment robust weight function. The update gain of the recursive least squares algorithm is corrected by segmented weighting based on the observation residuals. This can reduce the impact of abnormal observations on the parameter recursion results when measurement noise, abnormal data, or local mutations exist. Furthermore, the recursive update process continuously obtains a relatively stable estimate of the equivalent impedance of the power grid, and then calculates the robust short-circuit ratio. This makes the obtained power grid strength characterization results more resistant to disturbances and more stable to abnormal data, providing a more reliable basis for determining the number of grid-type inverters to be configured based on the strength of the power grid.

[0047] Step 3 involves using a model-free disturbance rejection control (MRC) algorithm to output the total disturbance compensation in real time, based on the preprocessed three-phase voltage data and voltage fluctuation variance. Specifically, this involves constructing a model-free MRC algorithm based on a linear extended state observer, using the grid-connected point-of-combination (PCC) voltage amplitude as the observation object, and uniformly representing the unknown factors affecting PCC voltage changes as the total disturbance state. The observer bandwidth parameter of the linear extended state observer is dynamically adjusted using the voltage fluctuation variance, and the total disturbance state is estimated in real time using the linear extended state observer to obtain the total disturbance estimate. The steps include: Step 31: Set the observation input and observer bandwidth parameters; Step 311: Perform voltage magnitude calculation on the preprocessed three-phase voltage data to obtain the voltage amplitude at the grid connection point of common coupling. Set the voltage amplitude at the grid connection point of common coupling as the output observation value of the model-free disturbance rejection control algorithm. Step 312: Based on the voltage fluctuation variance, dynamically adjust the observer bandwidth parameter of the extended state observer inside the model-free disturbance rejection control algorithm. Compare the voltage fluctuation variance with the preset standard deviation threshold. If the voltage fluctuation variance is greater than the standard deviation threshold, increase the observer bandwidth parameter. If the voltage fluctuation variance is less than or equal to the standard deviation threshold, maintain the preset observer bandwidth parameter. ; in, This represents the observer bandwidth parameter at the k-th sampling time. This represents the preset observer bandwidth parameter; This represents the increased observer bandwidth parameter, and ; This represents the variance of voltage fluctuation at the k-th sampling time. This represents the preset standard deviation threshold.

[0048] Step 313: Take the voltage amplitude of the grid-connected point of common coupling as the first state, and characterize the sudden changes in light intensity, voltage fluctuations, inverter parameter perturbations and unmodeled dynamics that affect the voltage change of the grid-connected point of common coupling as the total disturbance state, and take the total disturbance state as the extended state, and use the voltage amplitude estimate and the total disturbance estimate to form the extended state variables of the linear extended state observer. When the linear expansion state observer is started, the initial values ​​of the voltage amplitude estimate and the total disturbance estimate are both set to zero, and the input gain estimate is preset, while the initial value of the nominal control input is set to zero. Step 32: Execute the extended state observer algorithm iteration: Calculate the voltage observation error based on the voltage amplitude at the current sampling time and the voltage amplitude estimate at the previous sampling time, and update the voltage amplitude estimate and total disturbance estimate based on the linear extended state observer state equation and the observer bandwidth parameter; Step 321: Call the voltage amplitude estimate and total disturbance estimate obtained from the previous sampling time as the initial state for the linear expansion state observer to perform state update at the current sampling time; Step 322: Calculate the difference between the voltage amplitude at the grid-connected point of common coupling at the current sampling time and the estimated voltage amplitude at the previous sampling time to obtain the voltage observation error at the current sampling time; Step 323: Using the voltage observation error and the observer bandwidth parameter, and based on the state equation of the linear extended state observer, calculate the rate of change of the voltage amplitude estimate and the rate of change of the total disturbance estimate, and update the extended state variables according to the sampling period of the actual control system. Specifically, including: Step 3231: The sum of the total disturbance estimate at the previous sampling time, the nominal control input amplified by the input gain estimate, and the first correction term is used as the rate of change of the voltage amplitude estimate at the current sampling time, where the first correction term is the product of the first gain coefficient and the voltage observation error. ; in, This represents the rate of change of the estimated voltage amplitude at the k-th sampling time. This represents the input gain estimate; This represents the nominal control input at the k-th sampling time. This represents the first gain coefficient.

[0049] Step 3232: Use the product of the second gain coefficient and the voltage observation error as the second correction term, and use the second correction term as the rate of change of the total disturbance estimate at the current sampling time; ; in, This represents the rate of change of the total disturbance estimate at the k-th sampling time. This represents the second gain coefficient.

[0050] Step 3233: Using the actual sampling period, perform discrete-time integration on the rate of change of the voltage amplitude estimate and the rate of change of the total disturbance estimate, respectively; Step 32331: Add the voltage amplitude estimate at the previous sampling time to the product of the sampling period and the rate of change of the voltage amplitude estimate to obtain the voltage amplitude estimate at the current sampling time; ; in, Indicates the sampling period of the actual control system; This represents the voltage amplitude estimate obtained at the k-th sampling time.

[0051] Step 32332: Add the total disturbance estimate of the previous sampling time to the product of the sampling period and the rate of change of the total disturbance estimate to obtain the total disturbance estimate of the current sampling time; ; in, This represents the total disturbance estimate obtained at the k-th sampling time.

[0052] Step 3234: Determine the first and second gain coefficients of the linearly extended state observer based on the observer bandwidth parameters at the current sampling time; ; ; in, This represents the first gain coefficient at the k-th sampling time. This represents the second gain coefficient at the k-th sampling time. This represents the observer bandwidth parameter at the k-th sampling time.

[0053] Step 33: Extract the total disturbance estimate from the expanded state variables updated at the current sampling time, and use the total disturbance estimate as the total disturbance compensation amount for disturbance compensation at the current sampling time; ; in, This represents the total disturbance compensation amount at the k-th sampling time. This represents the total perturbation estimate obtained at the k-th sampling time using the linearly extended state observer.

[0054] Step 3 of this embodiment uses the voltage amplitude at the grid connection point of common coupling as the observation object, and uniformly represents sudden changes in illumination, voltage fluctuations, inverter parameter perturbations, and unmodeled dynamics as the total disturbance state. Based on the voltage fluctuation variance, the observer bandwidth parameter of the linear extended state observer is dynamically adjusted, enabling the observer to adaptively adjust its tracking capability for state changes and disturbance changes according to the degree of voltage fluctuation. This improves the problem of disturbance estimation lag that easily occurs under dynamic operating conditions with fixed observation parameters, and realizes real-time estimation of the total disturbance of the grid-connected system. This provides a dynamic basis reflecting the current disturbance state for subsequent grid-connected inverter configuration, operation mode switching, and disturbance compensation control.

[0055] In step 4, the cluster mode allocation optimization model based on neural networks specifically adopts a multilayer perceptron regression network, including an input layer, at least one fully connected hidden layer, and an output layer. The input layer includes two input nodes corresponding to the robust short-circuit ratio and the total disturbance compensation, respectively. The hidden layer extracts the nonlinear relationship between the robust short-circuit ratio, the total disturbance compensation, and the number of grid-type inverters through a nonlinear activation function. The output layer includes an output node, which is used to output the predicted value of the number of grid-type inverters, and performs integerization and quantity boundary constraints on the predicted value of the number of grid-type inverters to obtain the optimal number of grid-type inverters.

[0056] Step 5: Determine the switching priority sequence based on the power margin of each inverter, and determine the target grid inverter based on the number of grid inverters; Specifically, the power margin of each inverter is determined based on its rated capacity and real-time active power. An inverter switching priority sequence is formed according to the power margin. The target grid inverter is determined from the inverter switching priority sequence based on the number of inverters in the optimal grid configuration. Furthermore, the process of determining the switching priority sequence based on the power margin of each inverter includes: Step 51: Call the power margin distribution vector, which contains the power margin values ​​corresponding to each inverter unit in the distributed photovoltaic cluster. Step 52: Traverse the power margin distribution vector, make numerical judgments on the power margin values ​​of each inverter unit, and determine the network priority weight corresponding to each inverter unit based on the judgment results. Specifically, the process of determining network priority weights includes: Step 521: If the power margin value of the photovoltaic inverter unit model is greater than zero, the power margin value is defined as the grid construction priority weight of the photovoltaic inverter unit model, so that the photovoltaic inverter unit model with a larger power margin value gets a larger grid construction priority weight. Step 522: If the power margin value of the photovoltaic inverter unit model is less than or equal to zero, then set the grid priority weight of the photovoltaic inverter unit model to zero. Step 53: Sort the network priority weights of each inverter unit in descending order; During the execution of the descending sorting operation, the index tracking logic runs synchronously to lock the photovoltaic inverter unit model number corresponding to each network priority weight before the sorting occurs. Step 54: Based on the order of grid priority weights after the descending sorting operation, extract the corresponding photovoltaic inverter unit numbers in sequence, reorganize the extracted photovoltaic inverter unit numbers into a one-dimensional index vector in chronological order, and use the one-dimensional index vector as the inverter switching priority sequence.

[0057] Based on the inverter switching priority sequence, the same number of inverter units as the number of inverters in the optimal grid configuration are selected in descending order of the inverter switching priority sequence to determine the target grid inverters.

[0058] Step 6: Perform internal potential phase pre-synchronization and virtual impedance gradual change control on the target grid-connected inverter to smoothly switch the target grid-connected inverter from grid-following operation mode to grid-connected operation mode. Specifically: generate a mode switching signal containing pre-synchronization command and virtual impedance gradual change command for the target grid-connected inverter in grid-following operation mode, so that the target grid-connected inverter completes the synchronization of internal potential phase with grid connection common coupling point voltage phase before switching, and puts in initial virtual impedance when switching from grid-following operation mode to grid-connected operation mode, and then gradually reduces the initial virtual impedance to the rated virtual impedance according to the exponential decay law. Step 6 generates a mode switching signal for the target grid-connected inverter model in grid-connected operation mode, including pre-synchronization commands and virtual impedance gradation commands, including: Step 61: Detect the current operating mode of the target grid inverter. If the target grid inverter is in grid-following operation mode, generate a mode switching signal and send it to the target grid inverter. The mode switching signal includes a pre-synchronization command and a virtual impedance gradation command. Step 62: When the target grid inverter responds to the pre-synchronization command, obtain the internal potential phase and voltage phase of the target grid inverter; The target grid inverter model responds to the pre-synchronization command and controls the internal potential phase of the target grid inverter model to track the voltage phase at the grid connection point in the electromagnetic transient simulation model in real time until the internal potential phase and the voltage phase are synchronized. Step 63: At the moment when the target grid-connected inverter model switches from grid-following operation mode to grid-connected operation mode, the initial virtual impedance is introduced into the control loop of the target grid-connected inverter model. Step 64: Starting from the switching moment, control the virtual impedance value to decrease from the initial virtual impedance to the rated virtual impedance over time according to the exponential decay law, until the virtual impedance stabilizes at the rated virtual impedance.

[0059] This embodiment constructs an inverter switching priority sequence based on the power margin distribution vector, prioritizing the scheduling of inverter units with larger power margins to participate in grid construction. This solves the problem of the unified scheduling command ignoring the capacity margin differences between heterogeneous inverters. At the same time, by generating a mode switching signal containing pre-synchronization and virtual impedance gradation commands, the target grid inverter model is controlled to track the grid voltage phase at the moment of switching and decay the virtual impedance exponentially, suppressing the transient inrush current triggered by the direct mode switching logic, and ensuring a smooth and shock-free operation mode switching process for the distributed photovoltaic cluster.

[0060] Furthermore, the training method for the cluster pattern allocation optimization model based on neural networks includes the following steps: S1. Construct and run the electromagnetic transient simulation model of the distributed photovoltaic cluster, set simulation conditions with different grid strength and disturbance states, obtain and preprocess the voltage and current of the grid connection point under each simulation condition, as well as the rated capacity and real-time active power of each inverter, and calculate the grid equivalent impedance amplitude, voltage fluctuation variance and power margin distribution vector. S2. For each simulation condition, determine the equivalent impedance of the power grid based on the changes in voltage and current at the grid connection point. Based on the equivalent impedance of the power grid, use a three-segment robust weight function to correct the update gain of the recursive least squares algorithm to obtain the robust short-circuit ratio. S3. Based on the voltage fluctuation variance of the grid-connected common coupling point in the electromagnetic transient simulation model, dynamically adjust the observation parameters of the model-free disturbance rejection control algorithm, and estimate the total disturbance of the grid-connected system in real time to obtain the total disturbance estimate. S4. For each simulation condition, set different numbers of grid-connected inverters, obtain the grid common connection point voltage deviation and frequency deviation corresponding to each number of grid-connected inverters, and determine the number of grid-connected inverters with the smallest voltage deviation and frequency deviation as the optimal number of grid-connected inverters under the corresponding simulation condition. The robust short-circuit ratio and total disturbance compensation under each simulation condition are used as sample inputs, and the corresponding number of inverters with optimal grid configuration is used as sample labels to construct a training dataset. S5. Supervised training of the cluster mode allocation optimization model is performed using the training dataset. The mapping relationship between the robust short-circuit ratio, the total disturbance compensation amount and the number of inverters in the optimal grid configuration is established to obtain the trained cluster mode allocation optimization model. In S1, the process of constructing and running an electromagnetic transient simulation model of a distributed photovoltaic cluster, acquiring and preprocessing three-phase voltage and current data at the grid connection point, rated capacity data of each internal inverter unit, and real-time active power output data in the electromagnetic transient simulation model includes: S11. In the electromagnetic transient simulation software environment, configure and connect the equivalent power source model of the public power grid, the transmission line impedance model and the photovoltaic inverter unit model to construct the electromagnetic transient simulation model of the distributed photovoltaic cluster. Set the simulation step size parameters and solver type parameters of the electromagnetic transient simulation model, and start the electromagnetic transient simulation model to perform time-domain simulation calculations. S12. Configure virtual voltage measurement probes and virtual current measurement probes at the grid connection point in the electromagnetic transient simulation model. Read the three-phase voltage data in real time through the virtual voltage measurement probes and read the three-phase current data in real time through the virtual current measurement probes. Configure signal reading interfaces at the output end of each photovoltaic inverter unit model in the electromagnetic transient simulation model to read the rated capacity data and real-time active power output data of each inverter unit in real time. Furthermore, the three-phase voltage data, three-phase current data, rated capacity data, and real-time active power output data are preprocessed, including: S131. Input the collected three-phase voltage data and three-phase current data into the digital low-pass filter built into the electromagnetic transient simulation model. Perform discrete low-pass filtering operation on the input data through the digital low-pass filter to filter out high-frequency harmonic components and output the pre-processed three-phase voltage data and three-phase current data. S132. The collected rated capacity data and real-time active power output data of each inverter unit are input into the data smoothing processor. The data smoothing processor performs a moving average calculation on the real-time active power output data to suppress numerical jitter, outputs the pre-processed real-time active power output data, and directly outputs the rated capacity data as the pre-processed rated capacity data.

[0061] For the preprocessed data, calculate the magnitude of the grid equivalent impedance, the variance of voltage fluctuation, and the power margin distribution vector; Specifically, calculating the equivalent impedance magnitude of the power grid includes: S141. Perform Parker transformation on the preprocessed three-phase voltage data and three-phase current data to convert the three-phase quantities in the stationary coordinate system into direct-axis voltage components, quadrature-axis voltage components, direct-axis current components and quadrature-axis current components in the synchronous rotating coordinate system. S142. Construct differential calculation logic to calculate the difference between the direct-axis voltage component, the quadrature-axis voltage component, the direct-axis current component, and the quadrature-axis current component between the current simulation time and the previous simulation time, respectively. S143. Using the voltage and current phasor calculation logic, calculate the sum of the squares of the difference between the direct-axis voltage components and the quadrature-axis voltage components between the current simulation time and the previous simulation time, and perform a square root operation to obtain the voltage change magnitude value. Calculate the sum of the squares of the difference between the direct-axis current components and the quadrature-axis current components between the current simulation time and the previous simulation time, and perform a square root operation to obtain the current change magnitude value. The ratio of the voltage change magnitude value to the current change magnitude value is the equivalent impedance amplitude of the power grid. Specifically, calculating the voltage fluctuation variance includes: S151. Perform root mean square calculation on the preprocessed three-phase voltage data to obtain the effective voltage value data at the grid connection point of common coupling. S152. Construct a sliding statistical time window and collect the effective voltage value data at consecutive sampling times within the sliding statistical time window; S153. Calculate the square of the difference between the effective voltage value data at each sampling time within the sliding statistical time window and the arithmetic mean of the effective voltage value data within the sliding statistical time window. Sum the squares of each difference and divide by the total number of sampling points within the sliding statistical time window to obtain the voltage fluctuation variance. Specifically, calculating the power margin distribution vector includes: S161. For each inverter unit in the distributed photovoltaic cluster, the power margin value of the inverter unit is obtained by subtracting the pre-processed real-time active power output data from the pre-processed rated active power. S162. Arrange the power margin values ​​of each inverter unit into a column vector according to the numbering order of the inverter units, and use it as the power margin distribution vector.

[0062] In S2, for each simulation condition, the equivalent impedance of the power grid is determined based on the changes in voltage and current at the grid connection point. Based on the equivalent impedance of the power grid, the update gain of the recursive least squares algorithm is corrected using a three-segment robust weight function to obtain the robust short-circuit ratio. Furthermore, in S2, the process of inputting the equivalent impedance magnitude of the power grid into a recursive robust regression algorithm based on a three-segment robust weight function, and using the three-segment robust weight function to correct the update gain of the recursive least squares algorithm to obtain the robust short-circuit ratio includes: S21. At the initial moment of the electromagnetic transient simulation model, initialize the parameter vector to be identified, the covariance matrix and the forgetting factor inside the recursive robust regression algorithm, and set the equivalent impedance amplitude of the power grid as the observation input of the recursive robust regression algorithm. S22. Calculate the absolute value of the observation residuals; S221. Using the equivalent impedance amplitude of the power grid as the direct observation object, construct the regression quantity at the current sampling time according to the single-parameter direct observation model. And set the regression vector to a unit numerical vector; S222: Call the parameter vector to be identified obtained from the previous simulation time, and combine it with the current regression vector to calculate the predicted value of the equivalent impedance amplitude of the power grid at the current simulation time. S223. Calculate the difference between the magnitude of the equivalent impedance of the power grid at the current simulation moment and the predicted value, and take the absolute value of the difference to obtain the absolute value of the observation residual. S23. Calculate the weighting factors; S231. Set the first threshold parameter and the second threshold parameter of the three-segment robust weight function, and the second threshold parameter is greater than the first threshold parameter; S232. Compare the absolute value of the observed residual with the first threshold parameter and the second threshold parameter. If the absolute value of the observed residual is less than or equal to the first threshold parameter, the weight factor is assigned a value of 1. If the absolute value of the observed residual is greater than the first threshold parameter and less than or equal to the second threshold parameter, the weight factor is calculated using linear weight reduction logic, so that the weight factor decreases linearly as the absolute value of the observed residual increases. If the absolute value of the observed residual is greater than the second threshold parameter, the weight factor is assigned a value of 0. S24. Adjust gain and update parameters; S241. Using the covariance matrix from the previous simulation moment, the constructed regression vector, and the initialized forgetting factor, update the gain matrix according to the recursive least squares logic calculation standard. S242. The standard update gain matrix is ​​weighted and corrected using a weight factor to obtain a robust update gain matrix. When the weight factor is 1, the robust update gain matrix is ​​equal to the standard update gain matrix. When the weight factor is 0, the robust update gain matrix is ​​set to zero, so that the parameter vector to be identified stops updating. S243. Using the robust update gain matrix and the equivalent impedance magnitude of the power grid, the parameter vector to be identified at the previous simulation time is corrected. The difference between the equivalent impedance magnitude of the power grid and the predicted value is multiplied by the robust update gain matrix, and the multiplication is added to the parameter vector to be identified at the previous simulation time to obtain the parameter vector to be identified at the current simulation time. The parameter vector to be identified contains the estimated value of the equivalent impedance magnitude of the power grid at the current time. S244. Using robust update gain matrix, regression vector, covariance matrix of the previous simulation time step and forgetting factor, update covariance matrix to obtain covariance matrix of the current simulation time step, which is used for calculation iteration of the next simulation time step. S25, Output differential short-circuit ratio value; S251. Extract the estimated value of the equivalent impedance magnitude of the power grid from the parameter vector to be identified at the current simulation moment; S252. Obtain the rated voltage parameters of the grid-connected common connection point and the rated capacity parameters of the distributed photovoltaic cluster set in the electromagnetic transient simulation model. S253. Divide the square of the rated voltage parameter by the rated capacity parameter to obtain the reference impedance value; S254. Divide the reference impedance value by the estimated value of the equivalent impedance amplitude of the power grid to obtain the differential short-circuit ratio value at the current simulation time.

[0063] S3. The process of dynamically adjusting the observation parameters of the model-free disturbance rejection control algorithm based on the voltage fluctuation variance of the grid-connected common coupling point in the electromagnetic transient simulation model, and estimating the total disturbance of the grid-connected system in real time to obtain the total disturbance estimate includes: S31. Set the observation input quantity and the observer bandwidth parameter; S311. Perform voltage magnitude calculation on the preprocessed three-phase voltage data to obtain the voltage amplitude of the grid-connected point of common coupling (PCC) and set the PCC voltage amplitude as the output observation value of the model-free disturbance rejection control algorithm. S312. Based on the voltage fluctuation variance, dynamically adjust the observer bandwidth parameter of the extended state observer inside the model-free disturbance rejection control algorithm, compare the voltage fluctuation variance with the preset standard deviation threshold, if the voltage fluctuation variance is greater than the standard deviation threshold, increase the observer bandwidth parameter, if the voltage fluctuation variance is less than or equal to the standard deviation threshold, maintain the preset observer bandwidth parameter. S313. At the initial moment of the electromagnetic transient simulation model operation, the extended state variables inside the model-free disturbance rejection control algorithm are initialized and assigned values. The initial values ​​of the voltage amplitude estimate and the total disturbance estimate are both set to zero. The extended state variables include the voltage amplitude estimate and the total disturbance estimate representing the sudden change in illumination, voltage fluctuation and inverter parameter perturbation. The input gain estimate of the model-free disturbance rejection control algorithm is preset, and the initial value of the nominal control input is set to zero. S32, Execute the extended state observer algorithm iteration; S321, The model-free disturbance rejection control algorithm calls the voltage amplitude estimate output at the previous simulation moment; S322. Calculate the difference between the voltage amplitude at the current simulation moment and the estimated voltage amplitude at the previous simulation moment to obtain the voltage observation error; S323. Using the voltage observation error and the observer bandwidth parameter, update the extended state variables according to the linear extended state observer state equation; S3231. The sum of the total disturbance estimate at the previous simulation moment, the nominal control input amplified by the input gain estimate, and the first correction term is used as the rate of change of the voltage amplitude estimate at the current sampling moment, where the first correction term is the product of the first gain coefficient and the voltage observation error. S3232, The product of the second gain coefficient and the voltage observation error is used as the second correction term, and the second correction term is used as the rate of change of the total disturbance estimate at the current sampling time; S3233. Using the simulation step size parameter of the electromagnetic transient simulation model, perform discrete-time integration operations on the rate of change of the voltage amplitude estimate and the rate of change of the total disturbance estimate, respectively. S32331. Add the voltage amplitude estimate of the previous simulation moment to the product of the simulation step size parameter and the rate of change of the voltage amplitude estimate to obtain the voltage amplitude estimate of the current simulation moment. S32332. Add the total disturbance estimate of the previous simulation time to the product of the simulation step size parameter and the rate of change of the total disturbance estimate to obtain the total disturbance estimate of the current simulation time. S3234. Determine the first gain coefficient and the second gain coefficient of the linearly extended state observer based on the observer bandwidth parameters at the current simulation moment. S33. Extract the total disturbance estimate at the current simulation moment from the updated expanded state variables as the total disturbance compensation amount.

[0064] In step S5, the training dataset is input into the cluster mode allocation optimization model. Based on the error between the predicted number of grid-type inverters output by the model and the corresponding sample label, the parameters of the multilayer perceptron neural network are iteratively updated to gradually reduce the error. Mean squared error can be used as the training loss function: ; Where L represents the model training loss; This represents the predicted number of grid-type inverters corresponding to the j-th training sample. This represents the number of optimal grid-type inverters corresponding to the j-th training sample.

[0065] When the model training meets the preset convergence condition, the parameter update is stopped and the multilayer perceptron neural network parameters are saved to obtain the trained cluster mode ratio optimization model. The trained cluster mode ratio optimization model establishes a nonlinear mapping relationship between the robust short-circuit ratio, the total disturbance compensation amount and the number of inverters in the optimal grid configuration.

[0066] Furthermore, it also includes S6, which performs closed-loop feedback correction on the predicted number of grid-connected inverters. Specifically, for each simulation condition, the initial optimal number of grid-connected inverters determined based on the voltage deviation and frequency deviation of the grid connection point common coupling is checked for harmonic performance. The total harmonic distortion of the voltage at the grid connection point common coupling is used to determine whether the currently predicted number of grid-connected inverters meets the harmonic constraints. When the total harmonic distortion of the voltage exceeds the preset safety threshold, the number of grid-connected inverters is increased and the simulation is re-executed until the total harmonic distortion of the voltage meets the safety threshold requirement. The final number of grid-connected inverters is then used as the final optimal number of grid-connected inverters under the corresponding simulation condition. The training set is updated, and the cluster mode configuration optimization model is trained. The predicted number of grid-connected inverters is corrected using closed-loop feedback, including the following steps: S61. Calculate the harmonic voltage components at the grid connection point of common coupling: Perform a discrete Fourier transform operation on the preprocessed three-phase voltage data at the grid connection point of common coupling in the electromagnetic transient simulation model to separate the fundamental voltage component data and the harmonic voltage component data. S62. Calculate the total harmonic distortion of voltage: Calculate the effective value of each harmonic voltage component data, and calculate the sum of squares of the effective values ​​of each harmonic voltage component data. Perform a square root operation on the sum of squares to obtain the effective value of the total harmonic voltage. Calculate the ratio of the effective value of the total harmonic voltage to the effective value of the fundamental voltage component data. Define the ratio as the total harmonic distortion of voltage. S63. Determine whether the current number of grid-connected inverters meets the harmonic constraint: Set a safety threshold parameter for total harmonic distortion of voltage, and compare the total harmonic distortion of voltage corresponding to the current number of grid-connected inverters with the safety threshold parameter. S64. If the total harmonic distortion of the voltage is greater than the safety threshold parameter, an early warning signal is generated and the closed-loop feedback adjustment logic is triggered. Based on the determined optimal number of grid-type inverters, a preset incremental step value is added to obtain the corrected total number of grid-type inverters required, and the supplementary grid-type inverter model is determined. Specifically, in the inverter switching priority sequence, the photovoltaic inverter unit model numbers that are already in grid operation mode are identified and removed to obtain the remaining available inverter sequence; In the remaining available inverter sequence, photovoltaic inverter unit model numbers are selected sequentially in descending order of grid priority weight, with the number of numbers equal to the incremental step size. The photovoltaic inverter unit model corresponding to the selected photovoltaic inverter unit model number is determined as the supplementary grid inverter model. S65. Generate a mode switching signal containing pre-synchronization command and virtual impedance gradient command for the supplementary grid inverter model, and control the supplementary grid inverter model to perform a smooth switch from grid-following operation mode to grid-connected operation mode. S68. After the smooth handover is completed, re-monitor the total harmonic distortion of voltage at the grid connection point until the total harmonic distortion of voltage is less than or equal to the safety threshold parameter, and then stop the closed-loop feedback adjustment logic.

[0067] To verify the optimization and control capabilities of the simulation-based inverter network optimization method in a distributed photovoltaic cluster described in this invention under different grid operating conditions and disturbance conditions, this embodiment constructs an electromagnetic transient simulation model of a distributed photovoltaic cluster containing multiple heterogeneous inverter unit models in electromagnetic transient simulation software, and records and visualizes the data during the simulation process in real time to generate visual charts.

[0068] The test scenario assumes the power grid is initially in a strong grid state (short-circuit robustness ratio > 2.5), and then experiences a fault change at 2.0 seconds into the simulation, transitioning to a weak grid state (short-circuit robustness ratio < 1.0). The disturbance condition is light or voltage fluctuation occurring at 1.0 seconds. The simulation results are shown in the figure below. Figure 2-5 As shown, the horizontal axis represents simulation time (s).

[0069] Figure 2 The diagram shows the real-time estimation stage of the robust short-circuit ratio in this embodiment. The solid line represents the robust short-circuit ratio output by the recursive robust regression algorithm, and the dashed line represents the preset mode switching threshold (value 2.5). Figure 2 It can be seen that during the strong power grid phase from 0 seconds to 2.0 seconds, even with measurement noise interference, the robust short-circuit ratio remains stable at around 5.5 without drastic fluctuations, always remaining above the threshold. This verifies that the recursive robust regression algorithm based on the three-segment robust weight function has a strong noise suppression capability. At 2.0 seconds, with the sudden change in power grid conditions, the robust short-circuit ratio drops rapidly to around 0.8 and remains stable, accurately identifying the weakening of the power grid.

[0070] Figure 3 The diagram shows the operation phase of the model-free disturbance rejection control algorithm, where the curve represents the total disturbance compensation output in real time by the algorithm. Figure 3 It can be seen that in the interval of 1.0 to 1.2 seconds, the total disturbance compensation amount exhibits obvious oscillating response to injected light or voltage fluctuation disturbances, indicating that the model-free disturbance rejection control algorithm can capture and quantify external disturbances in real time. In the period without disturbance (such as 0-1.0s and 1.2-3.0s), the total disturbance compensation amount remains at zero, which verifies the algorithm's keen perception and compensation ability for dynamic disturbances.

[0071] Figure 4 The diagram shows the smooth mode switching phase, where the dashed lines represent the virtual impedance in the control loop of the target grid inverter model. Figure 4It can be seen that during the period from 0 seconds to 2.0 seconds, since the robust short-circuit ratio is greater than the mode switching threshold, the target grid-connected inverter model is in grid-following operation mode and the virtual impedance remains at zero. At 2.0 seconds, when the robust short-circuit ratio is detected to fall below the mode switching threshold and trigger mode switching, the virtual impedance is instantly applied (peak value of about 25 ohms), and then rapidly decays to zero according to an exponential law, verifying the effective execution of the virtual impedance gradual change command.

[0072] Figure 5 The diagram shows the current response phase at the grid-connected point of common coupling (PCC), where the curve represents the PCC current waveform. Figure 5 As can be seen, throughout the simulation process, the current waveform at the grid connection point of common coupling remains a smooth and continuous sine wave. Especially at the 2.0-second mode switching instant, despite the fundamental change in control mode and the dynamic input of virtual impedance, the current waveform at the grid connection point of common coupling still has no spikes, breaks or distortions, achieving a truly impact-free smooth transition.

[0073] This embodiment effectively solves the problems of parameter identification distortion and insufficient disturbance rejection capability in noisy environments by combining a recursive robust regression algorithm based on a three-segment robust weight function with a model-free disturbance rejection control algorithm. Furthermore, by combining smooth switching control with virtual impedance gradient commands, it ensures the transient stability of the inverter during the switching between strong and weak power grids, eliminating inrush currents. The simulation-based inverter grid optimization method in this embodiment demonstrates accurate grid strength assessment and robust disturbance rejection control capabilities under weak power grid and multi-disturbance conditions. Simultaneously, through adaptive smooth switching between grid-connected and grid-following operation modes, it constructs a highly reliable distributed photovoltaic cluster grid-connected control process, possessing significant engineering application value.

[0074] Example 2 Based on Example 1, this example provides a simulation-based distributed photovoltaic cluster inverter network optimization system, including: The acquisition module is configured to acquire three-phase voltage and three-phase current data at the grid connection point, rated capacity data and real-time active power of each inverter unit, and calculate the grid equivalent impedance amplitude, voltage fluctuation variance and power margin distribution vector. The robust short-circuit ratio identification module is configured to identify the robustness of the power grid strength based on the obtained equivalent impedance of the power grid using a recursive robust regression algorithm based on a three-segment robust weight function, determine the weight factor according to the observation residual, and use the weight factor to correct the update gain of the recursive least squares algorithm to obtain the robust short-circuit ratio used to characterize the power grid strength. The total disturbance estimation module is configured to dynamically adjust the observation parameters of the model-free disturbance rejection control algorithm based on the voltage fluctuation variance of the grid connection point, and to estimate the total disturbance of the grid-connected system in real time to obtain the total disturbance estimate. The inverter quantity determination module is configured to input the robust short-circuit ratio and total disturbance compensation into a cluster mode allocation optimization model based on a neural network trained on a simulation training set to determine the number of grid-type inverters. The target grid inverter identification module is configured to determine the switching priority sequence based on the power margin of each inverter, and to determine the target grid inverter based on the number of grid-type inverters. The switching control module is configured to perform internal potential phase pre-synchronization and virtual impedance gradual control on the target grid inverter, so that the target grid inverter can smoothly switch from grid-following operation mode to grid-connected operation mode.

[0075] It should be noted that each module in this embodiment corresponds one-to-one with each step in embodiment 1, and their specific implementation process is the same, so it will not be repeated here.

[0076] Example 3 Based on Embodiment 1, this embodiment provides an electronic device, including a memory and a processor, as well as computer instructions stored in the memory and running on the processor. When the computer instructions are executed by the processor, they complete the steps in the simulation-based distributed photovoltaic cluster inverter network optimization method described in Embodiment 1.

[0077] Example 4 Based on Embodiment 1, this embodiment provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, they complete the steps in the simulation-based distributed photovoltaic cluster inverter network optimization method described in Embodiment 1.

[0078] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

[0079] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A simulation-based method for optimizing the grid configuration of distributed photovoltaic cluster inverters, characterized in that, Includes the following steps: Acquire three-phase voltage and three-phase current data at the grid connection point, rated capacity data and real-time active power of each inverter unit, and calculate the grid equivalent impedance amplitude, voltage fluctuation variance and power margin distribution vector. Based on the obtained equivalent impedance of the power grid, a recursive robust regression algorithm based on a three-segment robust weight function is used to identify the robustness of the power grid strength. The weighting factor is determined according to the observation residual, and the update gain of the recursive least squares algorithm is corrected using the weighting factor to obtain the robust short-circuit ratio used to characterize the power grid strength. Based on the voltage fluctuation variance at the grid connection point of common coupling, the observation parameters of the model-free disturbance rejection control algorithm are dynamically adjusted, and the total disturbance of the grid-connected system is estimated in real time to obtain the total disturbance estimate. The robust short-circuit ratio and total disturbance compensation are input into the cluster mode allocation optimization model based on the simulation training set to determine the number of grid-type inverters. The switching priority sequence is determined based on the power margin of each inverter, and the target grid inverter is determined based on the number of grid-connected inverters. Internal potential phase pre-synchronization and virtual impedance gradual change control are performed on the target grid-connected inverter to smoothly switch the target grid-connected inverter from grid-following operation mode to grid-connected operation mode.

2. The simulation-based distributed photovoltaic cluster inverter network optimization method as described in claim 1, characterized in that, Based on the obtained equivalent impedance of the power grid, a recursive robust regression algorithm based on a three-segment robust weight function is used to correct the update gain of the recursive least squares algorithm to obtain the robust short-circuit ratio. The method includes the following steps: When the recursive robust regression algorithm is started, the parameters to be identified, the covariance parameters, and the forgetting factor are initialized, and the equivalent impedance magnitude of the power grid calculated based on the actual three-phase voltage data and three-phase current data collected at the grid connection point at the current sampling time is used as the observation input of the recursive robust regression algorithm. The absolute value of the observation residual is calculated based on the difference between the magnitude of the equivalent impedance of the power grid at the current sampling time and the estimated value of the equivalent impedance of the power grid at the previous sampling time. The weighting factor corresponding to the current sampling time is calculated based on the numerical relationship between the absolute value of the observed residual and the first and second threshold parameters of the set three-segment robust weighting function. The standard update gain is calculated based on the covariance parameter of the previous sampling time, the regression value of the current sampling time, and the forgetting factor. The standard update gain is then corrected using a weighting factor, and the parameters to be identified and the covariance parameter are updated accordingly. The estimated value of the equivalent impedance amplitude of the power grid is determined based on the parameters to be identified updated at the current sampling time. The reference impedance value is calculated based on the rated voltage parameters of the grid connection point and the rated capacity parameters of the distributed photovoltaic cluster. Then, the differential short-circuit ratio value at the current sampling time is calculated.

3. The simulation-based distributed photovoltaic cluster inverter network optimization method as described in claim 2, characterized in that, The weighting factor corresponding to the current sampling time is calculated based on the numerical relationship between the absolute value of the observed residual and the first and second threshold parameters of the set three-segment robust weighting function. Step 231: Set the first threshold parameter and the second threshold parameter of the three-segment robust weight function, and the second threshold parameter is greater than the first threshold parameter; Step 232: Compare the absolute value of the observed residual with the first threshold parameter and the second threshold parameter. If the absolute value of the observed residual is less than or equal to the first threshold parameter, the weight factor is assigned a value of 1. If the absolute value of the observed residual is greater than the first threshold parameter and less than or equal to the second threshold parameter, the weight factor is calculated using linear weight reduction logic, so that the weight factor decreases linearly as the absolute value of the observed residual increases. If the absolute value of the observed residual is greater than the second threshold parameter, the weight factor is assigned a value of 0.

4. The simulation-based distributed photovoltaic cluster inverter network optimization method as described in claim 1, characterized in that, The process of updating the parameters to be identified and the covariance parameters includes: Using the covariance parameter of the previous sampling time, the regression value of the current sampling time, and the forgetting factor, the standard update gain of the current sampling time is calculated according to the recursive least squares algorithm. The standard update gain is weighted and corrected using the weight factor at the current sampling time to obtain the robust update gain; when the weight factor is 1, the robust update gain is equal to the standard update gain; when the weight factor is 0, the robust update gain is set to zero, so that the parameter to be identified stops updating. The robust update gain is used to correct the parameters to be identified at the previous sampling time. The difference between the actual calculated equivalent impedance amplitude of the power grid and the predicted equivalent impedance amplitude of the power grid at the current sampling time is multiplied by the robust update gain, and the resulting multiplier is added to the parameters to be identified at the previous sampling time to obtain the parameters to be identified at the current sampling time. The covariance parameter is updated using robust update gain, regression value at the current sampling time, covariance parameter at the previous sampling time, and forgetting factor to obtain the covariance parameter at the current sampling time. The covariance parameter at the current sampling time is then used for recursive calculation at the next sampling time.

5. The simulation-based distributed photovoltaic cluster inverter grid optimization method as described in claim 1, characterized in that, The process of using a model-free disturbance rejection control algorithm to output the total disturbance compensation in real time for the preprocessed three-phase voltage data and voltage fluctuation variance is as follows: Based on the preprocessed three-phase voltage data and voltage fluctuation variance, a model-free disturbance rejection control algorithm based on a linear extended state observer is constructed. The voltage amplitude at the grid connection point of common coupling is taken as the observation object, and the unknown factors affecting the voltage change at the grid connection point of common coupling are uniformly represented as the total disturbance state. The observer bandwidth parameter of the linear extended state observer is dynamically adjusted through the voltage fluctuation variance, and the total disturbance state is estimated in real time using the linear extended state observer to obtain the total disturbance estimate.

6. The simulation-based distributed photovoltaic cluster inverter network optimization method as described in claim 1, characterized in that, The cluster configuration optimization model based on neural networks specifically employs a multilayer perceptron regression network, including an input layer, at least one fully connected hidden layer, and an output layer. The input layer includes two input nodes corresponding to the robust short-circuit ratio and the total disturbance compensation, respectively. The hidden layer extracts the nonlinear relationship between the robust short-circuit ratio, the total disturbance compensation, and the number of grid-type inverters through a nonlinear activation function. The output layer includes one output node, which outputs the predicted number of grid-type inverters and performs integerization and quantity boundary constraints on the predicted number of grid-type inverters to obtain the optimal number of grid-type inverters.

7. The simulation-based distributed photovoltaic cluster inverter grid optimization method as described in claim 1, characterized in that, The process of determining the switching priority sequence based on the power margin of each inverter includes: Step 51: Call the power margin distribution vector, which contains the power margin values ​​corresponding to each inverter unit in the distributed photovoltaic cluster. Step 52: Traverse the power margin distribution vector, make numerical judgments on the power margin values ​​of each inverter unit, and determine the network priority weight corresponding to each inverter unit based on the judgment results. Step 53: Sort the network priority weights of each inverter unit in descending order; Step 54: Based on the order of grid priority weights after the descending sorting operation, extract the corresponding photovoltaic inverter unit numbers in sequence, reorganize the extracted photovoltaic inverter unit numbers into a one-dimensional index vector in chronological order, and use the one-dimensional index vector as the inverter switching priority sequence. Alternatively, the training method for a cluster pattern allocation optimization model based on neural networks includes the following steps: S1. Construct and run the electromagnetic transient simulation model of the distributed photovoltaic cluster, set simulation conditions with different grid strength and disturbance states, obtain and preprocess the voltage and current of the grid connection point under each simulation condition, as well as the rated capacity and real-time active power of each inverter, and calculate the grid equivalent impedance amplitude, voltage fluctuation variance and power margin distribution vector. S2. For each simulation condition, determine the equivalent impedance of the power grid based on the changes in voltage and current at the grid connection point. Based on the equivalent impedance of the power grid, use a three-segment robust weight function to correct the update gain of the recursive least squares algorithm to obtain the robust short-circuit ratio. S3. Based on the voltage fluctuation variance of the grid-connected common coupling point in the electromagnetic transient simulation model, dynamically adjust the observation parameters of the model-free disturbance rejection control algorithm, and estimate the total disturbance of the grid-connected system in real time to obtain the total disturbance estimate. S4. For each simulation condition, set different numbers of grid-connected inverters, obtain the grid common connection point voltage deviation and frequency deviation corresponding to each number of grid-connected inverters, and determine the number of grid-connected inverters with the smallest voltage deviation and frequency deviation as the optimal number of grid-connected inverters under the corresponding simulation condition. The robust short-circuit ratio and total disturbance compensation under each simulation condition are used as sample inputs, and the corresponding number of inverters with optimal grid configuration is used as sample labels to construct a training dataset. S5. Supervised training of the cluster mode configuration optimization model is performed using the training dataset to establish the mapping relationship between the robust short-circuit ratio, the total disturbance compensation amount and the number of inverters in the optimal grid configuration, and the trained cluster mode configuration optimization model is obtained.

8. A simulation-based distributed photovoltaic cluster inverter grid optimization system, characterized in that, include: The acquisition module is configured to acquire three-phase voltage and three-phase current data at the grid connection point, rated capacity data and real-time active power of each inverter unit, and calculate the grid equivalent impedance amplitude, voltage fluctuation variance and power margin distribution vector. The robust short-circuit ratio identification module is configured to identify the robustness of the power grid strength based on the obtained equivalent impedance of the power grid using a recursive robust regression algorithm based on a three-segment robust weight function, determine the weight factor according to the observation residual, and use the weight factor to correct the update gain of the recursive least squares algorithm to obtain the robust short-circuit ratio used to characterize the power grid strength. The total disturbance estimation module is configured to dynamically adjust the observation parameters of the model-free disturbance rejection control algorithm based on the voltage fluctuation variance of the grid connection point, and to estimate the total disturbance of the grid-connected system in real time to obtain the total disturbance estimate. The inverter quantity determination module is configured to input the robust short-circuit ratio and total disturbance compensation into a cluster mode allocation optimization model based on a neural network trained on a simulation training set to determine the number of grid-type inverters. The target grid inverter identification module is configured to determine the switching priority sequence based on the power margin of each inverter, and to determine the target grid inverter based on the number of grid-type inverters. The switching control module is configured to perform internal potential phase pre-synchronization and virtual impedance gradual control on the target grid inverter, so that the target grid inverter can smoothly switch from grid-following operation mode to grid-connected operation mode.

9. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, complete the steps in the simulation-based distributed photovoltaic cluster inverter network optimization method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, complete the steps in the simulation-based distributed photovoltaic cluster inverter network optimization method according to any one of claims 1-7.