Method and system for optimizing distributed photovoltaic access capacity of power distribution network
By integrating the SQPaxos consensus mechanism and the MARL framework, and combining them with a nonlinear power flow model, distributed optimization of photovoltaic (PV) access capacity in the distribution network was achieved. This solved the problems of uneven PV access and low computational efficiency in existing technologies, and improved decision consistency and security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies cannot accurately capture the differences in physical characteristics of different voltage levels in the distribution network, resulting in uneven distribution of photovoltaic access capacity, low computational efficiency, inability to cope with dynamic scenarios, safety hazards, and high computational resource requirements.
By adopting the SQPaxos consensus mechanism and the MARL framework, the distributed photovoltaic (PV) grid connection capacity is optimized through multi-agent coordination and combined with nonlinear power flow models and reward function optimization strategies.
It improves the consistency and accuracy of photovoltaic grid connection capacity decisions, reduces the risk of action conflicts, reduces the central computing burden, supports large-scale network optimization, and improves photovoltaic utilization and system security.
Smart Images

Figure CN121749332A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power system technology, and more specifically, relates to a method and system for optimizing the capacity of distributed photovoltaic power grid access. Background Technology
[0002] In power distribution networks, the rapid growth of distributed photovoltaic power has brought unprecedented challenges, and traditional assessment methods have significant limitations in terms of capacity optimization, risk management and real-time response.
[0003] Current technologies primarily rely on centralized optimization models, treating the distribution network as a single entity. This fails to accurately capture the physical characteristics differences between different voltage levels. The low-voltage layer, as a densely populated point for photovoltaic (PV) grid integration, is prone to overload due to reverse power flow. However, traditional models do not separately model low-voltage risks, leading to overgeneralized capacity allocation, resulting in excess capacity in some areas and insufficient capacity in others, increasing resource waste. Centralized optimization is computationally time-consuming when processing large-scale network nodes, unable to achieve minute-level updates, and struggles to parallelize multi-region optimization, resulting in significant lag in capacity decisions and difficulty adapting to real-time changes in weather or load. This leads to low PV utilization. As the scale of the distribution network expands and smart grids upgrade, the demand for computing resources grows exponentially, making it costly and impractical.
[0004] Existing technologies rely on static safety constraints such as fixed voltage ranges or current limits, without considering dynamic scenarios such as high irradiance or fault events. This makes photovoltaic grid connection capacity decisions unable to respond to extreme events, which in turn can lead to voltage collapse or equipment damage under high irradiance or fault conditions, increasing the risk of system downtime.
[0005] Existing technologies use linearized power flow models or empirical formulas, ignoring the nonlinear characteristics of the distribution network. This introduces significant errors under high photovoltaic penetration rates, causing capacity calculations to deviate from reality, resulting in investment errors and operational insecurity. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a method and system for optimizing distributed photovoltaic (PV) grid access capacity. By integrating the SQPaxos (Scalable Quorum based Paxos) consensus mechanism and the MARL (Multi-Agent Reinforcement Learning) framework, it coordinates the actions of multiple agents to achieve distributed consensus. MARL, through state space optimization and reward functions that integrate economics and security, distributes and coordinates the PV access capacity of multiple agents, improving the consistency of PV access capacity decisions among them, reducing the risk of action conflicts, reducing the central computing burden, supporting large-scale networks, accelerating the optimization process, and improving the efficiency of multiple agents simultaneously optimizing PV access capacity.
[0007] The present invention adopts the following technical solution.
[0008] The first aspect of the present invention provides a method for optimizing the capacity of distributed photovoltaic (PV) grid connections, comprising: The power grid topology model is divided into node levels according to the reference voltage level, and the boundary parameter set is solved based on the node levels; A joint probability distribution is constructed by using solar radiation intensity, fault type data, and virtual load sets. Latin hypercube sampling is used to screen extreme condition scenarios of the joint probability distribution to form a set of critical combination scenarios. Based on the node level of the distribution network topology model, dedicated agents are assigned. A state space is constructed for each agent based on the critical combination scenario set and the boundary parameter set. The SQPaxos consensus mechanism is used to coordinate the actions of all agents. Based on the coordinated actions, the state space of each agent is updated using iterative voltage to construct the policy loss function. The policy parameters are updated according to the policy loss function. The iteration is repeated until a set number of times to obtain the trained photovoltaic access capacity optimization model based on multi-agent reinforcement learning. Real-time data is input into a photovoltaic access capacity optimization model based on multi-agent reinforcement learning to generate the optimal distributed photovoltaic access capacity of the distribution network, thereby achieving the optimization of distributed photovoltaic access capacity of the distribution network.
[0009] Preferably, the power grid topology model node levels are allocated according to the reference voltage level, and the boundary parameter set is solved based on the node levels, including: Based on the reference voltage level, the hierarchy of each node in the basic distribution network topology model is divided into HV, MV, and LV; calculate the sensitivity of the active power change of the HV node to the voltage of the MV node, the maximum short-circuit capacity of the MV node, and calculate the virtual load of all LV nodes.
[0010] Preferably, the set of critical combination scenarios includes: Linear interpolation was performed to align the timestamps and normalize the solar radiation intensity, fault type data, and virtual load sets, respectively. The distributions of solar irradiance, load deviation, and fault type are estimated based on normalized data, and a joint probability distribution is constructed based on the distributions of solar irradiance, load deviation, and fault type. Latin hypercube sampling is used to perform stratified sampling of each variable from the joint probability distribution and randomly combine them into sample points to screen extreme condition scenarios and form a set of critical combination scenarios.
[0011] Preferably, Latin hypercube sampling is used to stratify and sample each variable from the joint probability distribution, and the samples are randomly combined to screen extreme condition scenarios, forming a set of critical combination scenarios, including: Divide the inverse cumulative distribution function of the Beta distribution into n intervals, each with a probability of 1 / n. In each interval, randomly sample a value using the inverse cumulative distribution function to obtain n solar irradiance sample values. Divide the inverse cumulative distribution function of the normal distribution into n intervals, each with a probability of 1 / n. In each interval, randomly sample a value using the inverse cumulative distribution function to obtain n load deviation sampling values. Divide the probability space of fault types into n intervals, and allocate the number of intervals according to the proportion of the occurrence probability of fault types N-0, N-1 and N-2. For each fault type, generate a sample value of the fault type within its allocated interval. The n solar irradiance sampling values, n load deviation sampling values, and fault type sampling values are randomly shuffled to obtain new sequences of solar irradiance, load deviation, and fault type. Data with the same index in each new sequence are set as random combination sample points containing solar irradiance, load deviation, and fault type. Traverse all combined sample points and filter out critical combined scenarios that simultaneously satisfy the conditions of solar irradiance greater than the extreme irradiance threshold, load deviation less than the extreme load threshold, and single fault scenario, to obtain the filtered set of critical combined scenarios.
[0012] Preferably, assigning dedicated intelligent agents according to the node level of the distribution network topology model includes: Starting from each HV node, with the starting node as the root node, a breadth-first search algorithm is used to traverse all HV nodes directly connected by branches, forming an HV region. The region contains all HV nodes reachable from the root node, forming a tree structure. The leaf nodes are the end nodes in the region that have no downstream connections. Each HV region corresponds to an HV agent. Starting from each MV node, with the starting node as the root node, a breadth-first search algorithm is used to traverse all MV nodes directly connected by branches, forming an MV region. The region contains all MV nodes reachable from the root node, forming a tree structure. Leaf nodes are the end nodes in the region that have no downstream connections. Each MV region corresponds to an MV agent.
[0013] Preferably, iterative voltage updates of the state space of each agent include: Calculate the branch power flow within all HV agents and MV agents. Starting from the leaf node of the corresponding agent, traverse towards the root node and calculate the active and reactive power of each branch within the area managed by the corresponding agent. Starting from the root node of the corresponding agent, traverse to the leaf nodes, and update the voltage of all nodes based on the active and reactive power of the branches within the area managed by the corresponding agent using the voltage drop formula. Calculate the voltage change of all nodes in the corresponding agent, and repeatedly update the voltage of all nodes until the voltage change of the largest node is less than the tolerance error. Solve for the average voltage, average branch current, total photovoltaic output and total load demand of all nodes in the corresponding agent, and update the state space.
[0014] Preferably, the SQPaxos consensus mechanism is used to coordinate the actions of all agents, including: During the proposal phase, each agent's action is set as an action proposal for that agent. For critical combination scenarios, the agents submit action proposals to the coordinator, which sorts them in the order of receipt to form a proposal sequence. During the serialization voting phase, the proposals and critical combination scenarios in each proposal sequence are given to all agents. Each agent dynamically modifies the threshold of the local constraint and checks whether all proposals satisfy the local constraint. If all local constraints are satisfied, the agents vote to accept; otherwise, they reject. The coordinator collects votes from all agents. If the number of agents who accept the vote is greater than half of the total number of agents, the corresponding sorted proposal is added to the candidate set; otherwise, it is discarded.
[0015] The consensus action for the critical combination scenario is calculated from the candidate set, and the coordinator broadcasts the consensus action for the critical combination scenario to all agents. The DistFlow (Distribution Power Flow Equations) equations are used to simulate the consensus actions of all nodes and branch currents under critical combination scenarios. All agents verify whether the node voltages and branch currents meet the local constraints. If any constraint is not met by any agent, the verification fails, and all agents trigger the rollback mechanism to use the last valid action. If there is no last valid action, all agents do not take any action. If all constraints are met, all agents apply the consensus action under the critical combination scenario to update the corresponding agent's action in the critical combination scenario.
[0016] Preferably, the threshold for each agent to dynamically modify local constraints includes: Adjust the uniform maximum allowable current of all branches in the region according to the fault type of the critical combination scenario; Adjust the voltage range of all nodes within the region according to the solar irradiance of the critical combination scenario; Adjust the capacity adjustment range according to the load deviation.
[0017] Preferably, the consensus action under the critical combination scenario is calculated from the candidate set, expressed by the following formula:
[0018] In the formula, This represents the consensus action under the critical combination scenario k. Represents the candidate set The number of proposals accepted. Represents the candidate set The v-th action proposal describes the photovoltaic access capacity adjustment suggested by the agent. Empty .
[0019] A second aspect of the present invention provides a distributed photovoltaic (PV) grid capacity optimization system for a distribution network, which operates the distributed PV grid capacity optimization method described in the first aspect, comprising: The boundary parameter set solution module is used to allocate the node level of the power grid topology model according to the reference voltage level, and solve the boundary parameter set based on the node level; The critical combination scenario set solution module is used to construct a joint probability distribution using solar radiation intensity, fault type data and virtual load set, and use Latin hypercube sampling to screen extreme condition scenarios of the joint probability distribution to form a critical combination scenario set. The capacity optimization model construction module is used to allocate dedicated agents according to the node level of the distribution network topology model. It constructs a state space for each agent based on the critical combination scenario set and boundary parameter set, uses the SQPaxos consensus mechanism to coordinate the actions of all agents, updates the state space of each agent with iterative voltage based on the coordinated actions to construct the policy loss function, updates the policy parameters according to the policy loss function, and repeats the iteration until a set number of times to obtain the trained photovoltaic access capacity optimization model based on multi-agent reinforcement learning. The output module is used to input real-time data into the photovoltaic access capacity optimization model based on multi-agent reinforcement learning, generate the optimal distributed photovoltaic access capacity of the distribution network, and realize the optimization of distributed photovoltaic access capacity of the distribution network. Compared with the prior art, the beneficial effects of the present invention include at least the following: The present invention integrates the SQPaxos consensus mechanism and the MARL framework to coordinate the actions of multiple agents. SQPaxos achieves distributed consensus through proposal, voting, and decision-making phases, while MARL optimizes the photovoltaic access capacity of multiple agents through state space and reward functions that integrate economy and security, thereby distributively coordinating the photovoltaic access capacity of multiple agents. This improves the consistency of photovoltaic access capacity decisions of multiple agents, reduces the risk of action conflicts in photovoltaic access capacity decisions of multiple agents, reduces the central computing burden of distributed processing, supports large-scale networks, accelerates the optimization process, improves the efficiency of multiple agents simultaneously optimizing photovoltaic access capacity, and supports large-scale networks. This invention integrates the DistFlow equation, a nonlinear power flow model, into the state update process. Combined with actions output from the SQPaxos consensus mechanism in critical combination scenarios, iterative calculation of branch power and voltage drop ensures that the state reflects the true physical characteristics of the distribution network, improving the accuracy and stability of photovoltaic (PV) grid connection capacity decisions and avoiding overestimation or underestimation. Voltage updates directly integrate capacity actions from the consensus mechanism, allowing the state space to dynamically change with capacity adjustment actions, adapting to the conditions of critical combination scenarios and improving state update stability. The state space is input into the reward function to guide the agent in learning safer capacity strategies, enhancing the security of optimizing PV grid connection capacity. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the distributed photovoltaic access capacity of the distribution network provided in accordance with an embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of this invention.
[0022] like Figure 1 As shown, Embodiment 1 of the present invention provides a method for optimizing the capacity of distributed photovoltaic (PV) grid access, comprising the following steps: Step 1: Divide the power grid topology model into node levels according to the reference voltage level, and solve the boundary parameter set based on the node levels.
[0023] Step 1.1: Construct the initial power distribution network diagram structure.
[0024] More preferably, step 1.1 includes: Construct an initial graph structure with nodes V representing power sources, loads, connection points, and distributed energy access points. Power sources include power plants and main substations; loads include power-consuming points such as residential areas and industrial facilities; connection points include line junctions or transformer connection points for power routing; and distributed energy access points include photovoltaic access points. Node attributes include device information and coordinate information. Transmission lines, distribution lines, and cables are used as connecting edges E.
[0025] Step 1.2: Obtain the reference voltage of each node in the initial distribution network diagram structure, expressed by the following formula:
[0026] In the formula, Represents the i-th node The reference voltage, This represents the primary voltage of the transformer. This indicates the secondary voltage of the transformer. This indicates the rated operating voltage of the line. This indicates the intersection point of the lines in the connection point.
[0027] Step 1.3: Using the node with the highest reference voltage as the root node, a breadth-first search is used to build a radial tree-structured distribution network topology model.
[0028] Step 1.4: Based on the reference voltage levels (HV, MV, LV), the hierarchy of each node in the basic distribution network topology model is divided into HV, MV, and LV, as expressed by the following formula:
[0029] in, Represents the i-th node Voltage level classification, For the i-th node The reference voltage is determined by the connected transformer; HV indicates high voltage. Indicates medium pressure. This indicates low pressure.
[0030] Sub-step 1.5: Calculate the virtual load of all LV nodes, expressed by the following formula:
[0031] In the formula, Represents LV node The virtual load is used to characterize the additional capacity margin of an LV node under reverse power flow. Represents LV node Peak reverse current when distributed photovoltaic power output is at its maximum Represents LV node The maximum allowable current of the connected equipment This represents an adjustment factor based on transformer capacity and load rate, used to normalize the current difference to a standard reference, expressed by the following formula:
[0032] In the formula, Represents LV node The associated transformer rated capacity, This indicates the preset baseline capacity of the power system. Represents LV node The current load rate of the associated transformer.
[0033] In distribution networks, reverse power flow—the problem of power flowing backward from distributed energy sources to the grid—most commonly occurs at the LV layer. This is because distributed photovoltaic (PV) systems, such as, but not limited to, rooftop PV and community PV systems, are typically directly connected to the LV network, for example, at voltage levels of 400V or lower. LV nodes are densely populated points for distributed energy sources, making them prone to reverse current flow due to excessive PV output, which can lead to risks such as equipment overload and voltage exceeding limits. In contrast, the MV and HV layers, which typically serve as the transmission and distribution backbone, already have robust power flow control and protection mechanisms, such as, but not limited to, substation regulation and relay protection. The risk of reverse power flow is lower or can be managed through existing equipment.
[0034] Sub-step 1.6: Calculate the sensitivity of the active power change at the HV node to the voltage at the MV node and the maximum short-circuit capacity of the MV node.
[0035] More preferably, step 1.6 includes: Step 1.6.1: Obtain the active power and reference voltage of the HV node, as well as the voltage vector and impedance parameters of the MV node.
[0036] Step 1.6.2: Based on the extracted data, construct the power flow equations of the distribution network to describe the relationship between power and voltage.
[0037] Step 1.6.3: Based on the power flow model, calculate the Jacobian matrix using historical power flow data. This matrix contains the partial derivatives of power with respect to voltage and phase angle. Iterate using the Newton-Raphson method until convergence, outputting the Jacobian matrix. Extract the HV-MV sensitivity matrix from the Jacobian matrix, expressed by the following formula:
[0038] In the formula, The HV-MV sensitivity matrix represents the sensitivity of active power changes at the HV node to voltage changes at the MV node. This represents the voltage change at node m of MV. This represents the change in active power at node h of the HV node.
[0039] Step 1.6.4, Maximum short-circuit capacity of MV nodes It can be expressed by the following formula:
[0040] In the formula, This represents the reference voltage at node m of MV. This represents the equivalent impedance of node m in the MV series.
[0041] Step 1.6.5, based on the HV-MV sensitivity matrix The maximum short-circuit capacity SC of the MV node and the virtual load set are used to construct the boundary parameter set. The virtual load set includes the virtual loads of all LV nodes.
[0042] It is worth noting that virtual load calculation quantifies the additional carrying capacity margin of LV nodes under reverse power flow, accurately captures the risk of LV layer reverse power flow such as photovoltaic overload, avoids the problem of risk underestimation in traditional methods, ensures that subsequent assessments are more in line with actual conditions, improves the security of photovoltaic access capacity allocation, and solves the technical problem of capacity overload caused by LV layer risk underestimation in existing technologies.
[0043] Step 2: Construct a joint probability distribution using solar radiation intensity, fault type data, and virtual load set. Use Latin hypercube sampling to screen extreme condition scenarios of the joint probability distribution to form a set of critical combination scenarios.
[0044] In a preferred but non-limiting embodiment of the present invention, step 2 includes: Step 2.1: Perform linear interpolation to align the timestamps and normalize the solar radiation intensity obtained from historical meteorological data, the fault type data obtained from historical fault event records, and the virtual load set, respectively.
[0045] Step 2.2: Estimate the distribution of solar irradiance, load deviation and fault type based on the normalized data from Step 2.1.
[0046] Solar irradiance follows a Beta distribution, which is used to model the uncertainty of photovoltaic output. It is suitable for describing bounded random variables and can be expressed by the following formula:
[0047] In the formula, Indicates solar irradiance The distribution Represents the Beta distribution. and The shape parameter, used to control the shape of the Beta distribution, is expressed by the following formula:
[0048] In the formula, The mean of normalized solar irradiance is expressed by the following formula:
[0049] In the formula, This indicates the number of data points for solar radiation intensity. This represents the normalized solar irradiance value for the t-th data point. This represents the variance of solar radiation intensity.
[0050] Load deviation It follows a normal distribution because load deviation is a continuous variable, and the normal distribution is suitable for modeling random variations, as expressed by the following formula:
[0051] In the formula, Indicates load deviation The distribution Indicates a normal distribution. This represents the mean of a normal distribution. , This represents the maximum value of the normalized virtual load set VL. This represents the scaling factor; in this invention, it is set to 0.7. This represents the standard deviation of the normalized virtual load set.
[0052] The fault type Z follows a categorical distribution. Since the fault type is a discrete variable, the categorical distribution is suitable for modeling multi-class probabilities, as expressed by the following formula:
[0053] In the formula, This represents the distribution of fault type Z. Indicates categorical distribution, , and These represent the normalized occurrence probabilities of fault types N-0, N-1, and N-2, respectively.
[0054] According to solar irradiance Distribution, load deviation A joint probability distribution is constructed from the distribution of the fault type Z and the distribution of the fault type Z. .
[0055] Step 2.3, use Latin hypercube sampling from In this process, stratified sampling is performed on each variable, and the samples are randomly combined to form a set of critical combination scenarios by screening extreme condition scenarios.
[0056] More preferably, step 2.3 includes: Step 2.3.1: Divide the inverse cumulative distribution function of the Beta distribution into n intervals, each interval having a probability of 1 / n. In each interval, randomly sample a value using the inverse cumulative distribution function to obtain n solar irradiance sample values.
[0057] Step 2.3.2: Divide the inverse cumulative distribution function of the normal distribution into n intervals, each interval having a probability of 1 / n. In each interval, use the inverse cumulative distribution function to randomly sample a value to obtain n load deviation sampling values.
[0058] Step 2.3.3: Divide the probability space of fault types into n intervals, and classify them according to the probability of occurrence of fault type N-0, fault type N-1, and fault type N-2. The number of intervals is proportionally allocated, and for each fault type, a sample value of the fault type is generated within its allocated interval. Since Z is discrete, each interval directly corresponds to a fault type value.
[0059] Step 2.3.4: Randomly shuffle the n solar irradiance sampling values, n load deviation sampling values, and fault type sampling values to obtain new sequences of solar irradiance, load deviation, and fault type. Take the data with the same index in each new sequence as a random combination sample point containing solar irradiance, load deviation, and fault type.
[0060] Step 2.3.5: Iterate through all combined sample points and filter out critical combined scenarios that simultaneously satisfy the conditions of solar irradiance greater than the extreme irradiance threshold, load deviation less than the extreme load threshold, and a single fault scenario. This yields the filtered set of critical combined scenarios. Specifically, the extreme irradiance threshold needs to identify peak loads to capture the most extreme irradiance conditions; the extreme load threshold needs to ensure coverage of the highest-risk periods, such as load troughs; and the single fault scenario is an N-1 fault type. N-1 faults are a key indicator of system vulnerability because they can trigger chain reactions, such as voltage collapse.
[0061] It is worth noting that this invention accurately captures photovoltaic output uncertainty, load variation, and fault risk by using solar irradiance to follow a Beta distribution, load deviation to follow a normal distribution, and fault type to follow a categorical distribution. These distributions are parameterized based on historical data, avoiding biases caused by simplification assumptions and solving the technical problem of incomplete capacity decision-making due to insufficient scenario coverage in existing technologies. Furthermore, it uses LHS (Latin Hypercube Sampling) for stratified sampling and integrates multidimensional variables: solar irradiance, load deviation, and fault type, to automatically generate a set of critical scenarios. Compared to traditional random sampling or manual scenario setting, LHS ensures that sample points uniformly cover extreme events in all areas, avoiding sampling bias, improving the efficiency of extreme scenario generation, and enhancing the accuracy and safety of capacity optimization. It comprehensively covers extreme conditions, reduces the omission of high-risk scenarios, and ensures that the capacity scheme is more robust in real-world environments. This solves the technical problem of fragile capacity schemes due to incomplete risk assessment in existing technologies, and is more closely aligned with actual risks.
[0062] Step 3: Assign dedicated agents according to the node level of the distribution network topology model. Construct a state space for each agent based on the critical combination scenario set and boundary parameter set. Use the SQPaxos consensus mechanism to coordinate the actions of all agents. Based on the coordinated actions, use iterative voltage to update the state space of each agent to construct the policy loss function. Update the policy parameters according to the policy loss function. Repeat the iteration until a set number of times to obtain the trained photovoltaic access capacity optimization model based on multi-agent reinforcement learning.
[0063] More preferably, step 3 includes: Step 3.1: Assign a dedicated intelligent agent to each HV and MV region.
[0064] More preferably, step 3.1 includes: Starting from each HV node, with the starting node as the root node, a breadth-first search algorithm is used to traverse all HV nodes directly connected by branches, forming HV regions. Each region contains all HV nodes reachable from the root node, forming a tree structure. Leaf nodes are end nodes in the region without downstream connections (such as load points), while intermediate nodes have upstream and downstream connections. Each HV region corresponds to an HV agent, which is responsible for optimizing the photovoltaic access capacity of the region. The number of HV agents is equal to the number of HV regions. Starting from each MV node, with the starting node as the root node, a breadth-first search algorithm is used to traverse all MV nodes directly connected by branches, forming MV regions. Each region contains all MV nodes reachable from the root node, forming a tree structure. Leaf nodes are the end nodes in the region without downstream connections (such as load points), while intermediate nodes have upstream and downstream connections. Each MV region corresponds to an MV agent, which is responsible for optimizing the thermal stability and load management of the region. The number of MV agents is equal to the number of MV regions.
[0065] It is worth noting that this invention improves the accuracy of capacity allocation, reduces inter-regional conflicts, and ensures consistent capacity plans by refining the granularity of regional agent allocation, with each agent focusing on capacity decisions within its own region. This directly solves the technical problem of inconsistent capacity decisions caused by coarse optimization granularity in traditional methods.
[0066] Step 3.2: Construct a state space for each agent based on the set of critical combination scenarios and the set of boundary parameters.
[0067] More preferably, step 3.2 includes: The state space of the kth critical combination scenario of the HV agent is represented by the following formula:
[0068] In the formula, This represents the state space of the h-th HV agent at time step t in the k-th critical combination scenario. This represents the average voltage across all nodes at time step t for the h-th HV agent in the k-th critical combination scenario. This represents the average branch current at time step t for the h-th HV agent in the k-th critical combination scenario. This represents the total photovoltaic output at time step t in the k-th critical combination scenario of the h-th HV agent. This represents the total load requirement of the h-th HV agent in the k-th critical combination scenario at time step t. Let represent the solar irradiance of the k-th critical combination scenario. This represents the fault type of the k-th critical combination scenario.
[0069] The state space of the k-th critical combination scenario of the MV agent is represented by the following formula:
[0070] In the formula, Let represent the state space of the m-th MV agent at time step t in the k-th critical combination scenario. This represents the average voltage across all nodes at time step t in the k-th critical combination scenario for the m-th MV agent. This represents the average branch current at time step t in the k-th critical combination scenario for the m-th MV agent. This represents the total photovoltaic output at time step t in the k-th critical combination scenario of the m-th MV agent. This represents the total load requirement of the m-th MV agent in the k-th critical combination scenario at time step t. Let represent the solar irradiance of the k-th critical combination scenario. This represents the load deviation of the k-th critical combination scenario.
[0071] The adjustment amount of photovoltaic access capacity in the area under the jurisdiction of each intelligent agent is the corresponding action of the intelligent agent.
[0072] All scenarios for all HV agents and MV agents sample actions at time step t from a Gaussian distribution. It can be expressed by the following formula:
[0073] In the formula, Indicating the central trend of capacity adjustment, the strategy network Receive the state vector of the corresponding agent As input, it is processed through a fully connected layer, and the output is... , The degree of dispersion in the distribution of actions is expressed by the following formula:
[0074] In the formula, This represents the activation function. Represents the weighting coefficients of the linear transformation. Baseline bias term.
[0075] Will Trim to physical constraints [ ],in, This represents the total capacity of the area governed by the corresponding intelligent agent.
[0076] Step 3.3, construct the reward function for the HV agent, expressed by the following formula:
[0077] In the formula, Let represent the reward function of the k-th critical combination scenario for the h-th HV agent at time step . This represents the photovoltaic access capacity weight of the HV agent. This represents the current total photovoltaic grid connection capacity of the HV region managed by the h-th HV agent. This represents the maximum allowable photovoltaic grid connection capacity within the area managed by the h-th HV agent. Indicates the loss weight of the HV agent; This represents the summation of the branch currents within the jurisdiction of the h-th HV agent. Let pq represent the current value of branch pq at time step t of the h-th HV agent. This represents the resistance of branch pq at time step t of the h-th HV agent. This represents the historical maximum loss within the area managed by the h-th HV agent; Represents the safety weights of the HV agent. express Not in range Intratime, indicator function The return value is 1, otherwise it returns 0; These represent the lower and upper limits of the penalty voltage for the HV agent, respectively. This represents the voltage of node l within the region managed by the h-th HV agent at time step t. Penalties for violating security constraints; This represents the upper limit of the penalty current for the HV agent. Indicates if Indicator function The return value is 1, otherwise it returns 0; This represents the fault risk weight of the HV agent.
[0078] The reward function for the MV agent is constructed as follows:
[0079] In the formula, Let represent the reward function for the k-th critical combination scenario of the m-th MV agent. This indicates the photovoltaic access capacity weight of the MV agent. This represents the total photovoltaic grid connection capacity of the MV region managed by the m-th MV agent. This represents the maximum allowable photovoltaic (PV) grid connection capacity within the area managed by the m-th MV agent. Indicates the loss weight of the MV agent; This represents the summation of the branch currents within the jurisdiction of the m-th MV agent. Let x represent the current value of branch xy at time step t of the m-th MV agent. This represents the resistance of branch xy at time step t of the m-th MV agent. This represents the historical maximum loss within the area managed by the m-th MV agent; Represents the safety weights of the MV agent. express Not in range Intratime, indicator function The return value is 1, otherwise it returns 0; These represent the lower and upper limits of the penalty voltage for the MV agent, respectively. This represents the voltage of node n within the region managed by the m-th MV agent at time step t; This indicates the upper limit of the penalty current for the MV agent. Indicates if Indicator function The return value is 1, otherwise it returns 0; This represents the fault risk weight of the HV agent.
[0080] It is worth noting that the state space of this invention enables the agent to make decisions based on real-time and multi-scenario data, and the reward function guides the agent to learn a strategy that balances high capacity and low risk, thereby directly optimizing capacity allocation, improving the economy and security of photovoltaic access capacity, and solving the technical problem of incomplete capacity optimization caused by a single objective in traditional methods.
[0081] Step 3.4: Use the SQPaxos consensus mechanism to coordinate the actions of all agents. Agents include HV agents and MV agents.
[0082] More preferably, step 3.3 includes: Step 3.4.1: In the proposal phase, each agent's action is set as an action proposal for that agent. For critical combination scenario k, the agent submits an action proposal. To the coordinator, This represents the action proposal of agent u at time step t in the k-th critical combination scenario. The coordinator sorts the proposals in the order they are received to form a proposal sequence. Where O represents the total number of agents.
[0083] Step 3.4.2: In the serialization voting phase, the proposals and critical combination scenarios in each proposal sequence are given to all agents. Each agent dynamically modifies the threshold of the local constraint and checks whether all proposals satisfy the local constraint.
[0084] More preferably, the threshold for each agent to dynamically modify local constraints includes: Adjust the uniform maximum allowable current for all branches in the critical combination scenario according to the fault type:
[0085] In the formula, This refers to the new uniform maximum allowable current for all branches in the area, and it should be noted that this applies to fault types. The new unified maximum current; The uniform maximum allowable current for regional branches, Indicates the adjustment factor. For indicator functions, Indicates when The value is 1 if it is active, and 0 otherwise.
[0086] Adjust the voltage range of all nodes within the region based on the solar irradiance of the critical combination scenario:
[0087] In the formula, This represents the new minimum threshold voltage for all nodes within the region. The table shows the new maximum threshold voltage for all nodes within the region. This represents the minimum threshold voltage for all nodes within the region. This represents the maximum threshold voltage across all nodes within the region. Represents the sensitivity coefficient. Indicates taking 0 and The maximum value in, This indicates the irradiance threshold.
[0088] Adjust the capacity adjustment range according to the load deviation:
[0089] In the formula, This represents the maximum allowable capacity adjustment in scenario k. Indicates the amplitude tightening strength coefficient. Indicates when The value is 1 if the condition is met, and 0 otherwise. This indicates the threshold value that triggers the amplitude adjustment.
[0090] The agent checks whether local constraints are satisfied. These local constraints include physical constraints. , This is the o-th action proposal in the proposal sequence; scenario-specific constraints include: the current of all branches within the area. Voltage of all nodes in the region .
[0091] If all local constraints are satisfied, the agents vote to accept; otherwise, they reject.
[0092] The coordinator collects votes from all agents. If the number of agents whose votes are accepted is greater than O / 2, the corresponding sorted proposal is added to the candidate set. Otherwise discard.
[0093] Step 3.4.3, from the candidate set Consensus actions in computational scenario k:
[0094] In the formula, This represents the consensus action output under the critical combination scenario k. Represents the candidate set The number of proposals accepted. Represents the candidate set The v-th action proposal describes the photovoltaic access capacity adjustment suggested by the agent. Empty .
[0095] Coordinator broadcast Give to all intelligent agents.
[0096] Step 3.4.4, Application through DistFlow equation simulation All node voltages and branch currents are then checked, and all agents verify whether all node voltages and branch currents meet local constraints.
[0097] If any constraint is not satisfied by any agent, the verification fails, and all agents trigger a rollback mechanism, using the last valid action; if there is no previous valid action, no action is taken. If all constraints are satisfied, all agents apply the action. Update the corresponding agent's actions in critical combination scenarios. ,in, For the current photovoltaic grid connection capacity of agent u, This represents the action of agent u in critical combination scenario k.
[0098] It is worth noting that this invention uses the SQPaxos consensus mechanism to coordinate the actions of intelligent agents, ensuring that the capacity actions of all intelligent agents are coordinated and consistent, avoiding conflicts between regions, improving the optimality and feasibility of the global capacity scheme, and improving the decision-making consistency of multiple intelligent agents through the distributed consensus mechanism, ensuring the global optimality of the photovoltaic access capacity scheme; reducing the risk of action conflict, and solving the technical problem of capacity allocation conflict caused by inconsistent decision-making in the prior art.
[0099] Step 3.5: Update the state space of each agent based on the action iteration voltage of agent u under the critical combination scenario k.
[0100] More preferably, step 3.4 includes: Step 3.5.1: Calculate the branch power flow within all HV and MV agents. Starting from the leaf node of the corresponding agent, traverse towards the root node and calculate the active and reactive power of each branch within the area managed by the corresponding agent, expressed by the following formula:
[0101] In the formula, This represents the active power of the branch de flowing from upstream node d to downstream node e within the area managed by the corresponding intelligent agent. This represents the downstream node e' of node e within the region managed by the corresponding agent. This represents the set of downstream nodes of node e within the region managed by the corresponding agent. The photovoltaic output of node e' within the area managed by the corresponding intelligent agent at time step t+1 is represented by the following formula:
[0102] In the formula, This represents the total photovoltaic output within the area managed by the agent at time step t, obtained from the state space of the agent at the current time step t. The allocation coefficient is preset based on the node capacity ratio. This represents the load demand of node e' within the area managed by the corresponding agent at time step t+1. Indicates a branch The current, Indicates a branch The resistance; This represents the action of the corresponding agent, obtained from all agents in step 3.3. Obtain; This represents the reactive power of the branch de flowing from upstream node d to downstream node e within the area managed by the corresponding intelligent agent. This represents the reactive power of node e' within the area managed by the corresponding agent at time step t+1. Indicates a branch The reactance.
[0103] It is worth noting that this invention uses the DistFlow equation to calculate active and reactive power flows, traversing from leaf nodes to root nodes to accurately capture the impact of branch losses and distributed photovoltaics. The power flow calculation integrates the impact of capacity actions, ensuring that the state update reflects the system conditions after capacity adjustment. This improves the accuracy and reliability of photovoltaic access capacity decisions and solves the technical problem of unreliable capacity optimization caused by inaccurate power flow calculations in the prior art.
[0104] Step 3.5.2: Starting from the root node of the corresponding agent, traverse towards the leaf nodes. Based on the active and reactive power of the branches de within the area managed by the corresponding agent, update the voltage of all nodes using the voltage drop formula, expressed as follows:
[0105] In the formula, This represents the voltage magnitude at the downstream node e of branch de. This represents the voltage amplitude at the upstream node d of branch de. Indicates a branch The resistance, Indicates a branch Reactance, Indicates a branch The current.
[0106] It is worth noting that this invention traverses from the root node to the leaf node and uses the voltage drop formula to update the voltage of all nodes based on the power flow, ensuring that the voltage distribution conforms to the physical laws. The voltage update ensures the accuracy of the voltage value in the state space and is used for constraint checks in the reward function, such as voltage over-limit penalties, which directly affect the safety and economy of capacity operation. This invention solves the technical problem of high risk in capacity decision-making due to inaccurate voltage estimation in traditional methods, and improves the accuracy of voltage update and the safety of photovoltaic access capacity decision-making.
[0107] Step 3.5.3: Calculate the voltage changes of all nodes in the corresponding agent, and repeatedly update the voltage of all nodes until the voltage change of the largest node is less than the tolerance error. Solve for the average voltage, average branch current, total photovoltaic output, and total load demand of all nodes in the corresponding agent, update the state space, and obtain the state space at time step t+1. .
[0108] Step 3.6: Store the state space containing the state of the corresponding agent at time step t. The action corresponding to the agent at time step t, the reward function of the agent at time step t+1, and the state space of the agent at time step t+1. The empirical tuples are stored in the cache, and a batch of empirical tuples are randomly sampled from the cache.
[0109] Step 3.7: Based on the sampled batch of empirical tuples, calculate the advantage function of the corresponding agent through generalized advantage estimation, expressed by the following formula:
[0110] In the formula, This represents the advantage estimate of the k-th critical combination scenario for the h-th HV agent at time step t. This is a parameter for the bias-variance tradeoff, used to adjust the tradeoff between bias and variance in dominance estimation. The higher the value, the smoother the advantage estimate but the more bias it introduces. The lower the value, the more direct the estimate, but the larger the variance. This represents the discount factor, used to indicate how much importance the agent places on long-term rewards. The higher the level, the more the agent focuses on long-term gains; The lower the value, the more attention is paid to instant rewards. Discount the timing difference error of the next time step to ensure that the optimization is not based solely on the current reward, but also on the long-term cumulative return; This represents the offset of a future time step relative to the current time step t. Indicates a finite step size. This represents the k-th critical combination scenario of the h-th HV agent at time step [h]. The temporal difference error. The k-th critical combination scenario of the h-th HV agent at time step Timing difference error It can be expressed by the following formula:
[0111] In the formula, The parameter is The value network.
[0112] This represents the advantage estimate of the m-th MV agent in the k-th critical combination scenario at time step t. This is a parameter for the bias-variance tradeoff, used to adjust the tradeoff between bias and variance in dominance estimation. The higher the value, the smoother the advantage estimate but the more bias it introduces. The lower the value, the more direct the estimate, but the larger the variance. This represents the discount factor, used to indicate how much importance the agent places on long-term rewards. The higher the level, the more the agent focuses on long-term gains; The lower the value, the more attention is paid to instant rewards. Discount the timing difference error of the next time step to ensure that the optimization is not based solely on the current reward, but also on the long-term cumulative return; This represents the offset of a future time step relative to the current time step t. Indicates a finite step size. This represents the k-th critical combination scenario of the m-th MV agent at time step [m]. The temporal differential error, the k-th critical combination scenario of the m-th MV agent at time step Timing difference error It can be expressed by the following formula:
[0113] It is worth noting that the advantage function of this invention provides a more accurate estimate of action value, guides strategy updates, reduces estimation variance, reduces fluctuations in capacity decisions, and improves the accuracy and stability of photovoltaic access capacity schemes. It solves the technical problem that unstable advantage estimation in traditional methods leads to large fluctuations in photovoltaic access capacity decisions.
[0114] Step 3.8: Construct a policy loss function for each agent based on the policy ratio and advantage estimation. It can be expressed by the following formula:
[0115] In the formula, This indicates that the data at time step t are averaged. and Let be the policy ratios for the k-th critical combination scenario of the h-th HV agent and the k-th critical combination scenario of the m-th MV agent, respectively, expressed by the following formula:
[0116] In the formula, Indicates the state Below, the policy network parameters are: New Strategy Network Select Action The probability, Indicates the state Below, the parameters stored in the buffer are Old policy network Select Action The probability, It is updated to the current value after each policy update. The value, Indicates the policy network parameters, This indicates the old policy network parameters stored in the buffer. Indicates a range-limiting function. and Indicates that they will be respectively and Limited to [ Taking the HV agent as an example, it can be expressed by the following formula:
[0117] In the formula, This indicates the range of control parameters.
[0118] It is worth noting that this invention uses a clip mechanism for near-end policy optimization to limit the policy update magnitude, prevent excessive changes, ensure training stability, accelerate training convergence, reduce policy oscillations, make the photovoltaic access capacity scheme reliable, improve the photovoltaic access capacity optimization efficiency, and solve the technical problem of inconsistent capacity schemes caused by training instability in traditional methods.
[0119] Step 3.9, minimize using the Adam optimizer The strategy parameters are updated and iterated repeatedly for a set number of times to obtain a trained photovoltaic access capacity optimization model based on multi-agent reinforcement learning.
[0120] Step 4: Input the real-time data into the photovoltaic access capacity optimization model based on multi-agent reinforcement learning to generate the optimal distributed photovoltaic access capacity of the distribution network, thereby realizing the optimization of the distributed photovoltaic access capacity of the distribution network.
[0121] Real-time data includes: real-time voltages of HV and MV nodes to solve for the average voltages of the HV and MV regions; real-time current measurements of each branch of the distribution network to determine the average branch currents of the HV and MV regions; real-time output measurements of the distributed photovoltaic (PV) system to determine the total PV output of the HV and MV regions; real-time power demand measurements of the distribution network load points to determine the total load demand of the HV and MV regions; and current real-time solar irradiance, fault status, and load deviation to determine the current critical combination scenario. The real-time data, combined with the HV-MV sensitivity matrix, the maximum short-circuit capacity of the MV nodes, and the virtual load set, forms the state space input to a PV access capacity optimization model based on multi-agent reinforcement learning. This model generates the optimal PV access capacity for each HV and MV region, which is the optimal distributed PV access capacity of the distribution network, achieving dynamic optimization of the distributed PV access capacity of the distribution network.
[0122] Embodiment 2 of the present invention provides a distributed photovoltaic (PV) grid capacity optimization system, which runs the distributed PV grid capacity optimization method described in Embodiment 1, including: The boundary parameter set solution module is used to allocate the node level of the power grid topology model according to the reference voltage level, and solve the boundary parameter set based on the node level; The critical combination scenario set solution module is used to construct a joint probability distribution using solar radiation intensity, fault type data and virtual load set, and use Latin hypercube sampling to screen extreme condition scenarios of the joint probability distribution to form a critical combination scenario set. The capacity optimization model construction module is used to allocate dedicated agents according to the node level of the distribution network topology model. It constructs a state space for each agent based on the critical combination scenario set and boundary parameter set, uses the SQPaxos consensus mechanism to coordinate the actions of all agents, updates the state space of each agent with iterative voltage based on the coordinated actions to construct the policy loss function, updates the policy parameters according to the policy loss function, and repeats the iteration until a set number of times to obtain the trained photovoltaic access capacity optimization model based on multi-agent reinforcement learning. The output module is used to input real-time data into the photovoltaic access capacity optimization model based on multi-agent reinforcement learning, generate the optimal distributed photovoltaic access capacity of the distribution network, and realize the optimization of distributed photovoltaic access capacity of the distribution network.
[0123] Compared with the prior art, the beneficial effects of the present invention include at least the following: The present invention integrates the SQPaxos consensus mechanism and the MARL framework. SQPaxos achieves distributed consensus through proposal, voting and decision-making stages, and coordinates the photovoltaic access capacity of multiple agents in a distributed manner, thereby improving the consistency of photovoltaic access capacity decisions of multiple agents and reducing the risk of action conflicts in photovoltaic access capacity decisions of multiple agents. MARL is based on a state space containing electrical measurement data and operating status, combined with a multi-objective reward function that integrates economic rewards and security constraints, and realizes policy autonomous optimization through distributed parallel computing, thereby reducing the central processing burden, accelerating the optimization process, improving the efficiency of multiple agents simultaneously optimizing photovoltaic access capacity, and supporting large-scale networks. This invention embeds the DistFlow equation of the nonlinear power flow model into the state update process, and combines the actions output by the SQPaxos consensus mechanism in critical combination scenarios. By iteratively calculating branch power and voltage drop, it ensures that the state reflects the true physical characteristics of the distribution network, improving the accuracy and stability of photovoltaic access capacity decisions. Voltage updates directly integrate capacity actions from the consensus mechanism, making the state space dynamically change with capacity adjustment actions, adapting to the conditions of critical combination scenarios, and improving the stability of state updates. The state space is input into the reward function to guide the agent to learn safer capacity strategies, thereby improving the security of optimizing photovoltaic access capacity.
[0124] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for optimizing the capacity of distributed photovoltaic (PV) grid connections, characterized in that: The power grid topology model is divided into node levels according to the reference voltage level, and the boundary parameter set is solved based on the node levels; A joint probability distribution is constructed by using solar radiation intensity, fault type data, and virtual load sets. Latin hypercube sampling is used to screen extreme condition scenarios of the joint probability distribution to form a set of critical combination scenarios. Based on the node level of the distribution network topology model, dedicated agents are assigned. A state space is constructed for each agent based on the critical combination scenario set and the boundary parameter set. The SQPaxos consensus mechanism is used to coordinate the actions of all agents. Based on the coordinated actions, the state space of each agent is updated using iterative voltage to construct the policy loss function. The policy parameters are updated according to the policy loss function. The iteration is repeated until a set number of times to obtain the trained photovoltaic access capacity optimization model based on multi-agent reinforcement learning. Real-time data is input into a photovoltaic access capacity optimization model based on multi-agent reinforcement learning to generate the optimal distributed photovoltaic access capacity of the distribution network, thereby achieving the optimization of distributed photovoltaic access capacity of the distribution network.
2. The method for optimizing the capacity of distributed photovoltaic power grid access according to claim 1, characterized in that: The power grid topology model is divided into node levels based on the reference voltage level, and the set of boundary parameters is solved based on the node levels, including: Based on the reference voltage level, the hierarchy of each node in the basic distribution network topology model is divided into HV, MV, and LV; calculate the sensitivity of the active power change of the HV node to the voltage of the MV node, the maximum short-circuit capacity of the MV node, and calculate the virtual load of all LV nodes.
3. The method for optimizing the capacity of distributed photovoltaic power grid access according to claim 1, characterized in that: The set of critical combination scenarios includes: Linear interpolation was performed to align the timestamps and normalize the solar radiation intensity, fault type data, and virtual load sets, respectively. The distributions of solar irradiance, load deviation, and fault type are estimated based on normalized data, and a joint probability distribution is constructed based on the distributions of solar irradiance, load deviation, and fault type. Latin hypercube sampling is used to perform stratified sampling of each variable from the joint probability distribution and randomly combine them into sample points to screen extreme condition scenarios and form a set of critical combination scenarios.
4. The method for optimizing the capacity of distributed photovoltaic power grid access according to claim 1, characterized in that: Latin hypercube sampling is used to stratify and sample each variable from the joint probability distribution, and the samples are randomly combined to form a set of critical combination scenarios, which are then selected from extreme condition scenarios. Divide the inverse cumulative distribution function of the Beta distribution into n intervals, each with a probability of 1 / n. In each interval, randomly sample a value using the inverse cumulative distribution function to obtain n solar irradiance sample values. Divide the inverse cumulative distribution function of the normal distribution into n intervals, each with a probability of 1 / n. In each interval, randomly sample a value using the inverse cumulative distribution function to obtain n load deviation sampling values. Divide the probability space of fault types into n intervals, and allocate the number of intervals according to the proportion of the occurrence probability of fault types N-0, N-1 and N-2. For each fault type, generate a sample value of the fault type within its allocated interval. The n solar irradiance sampling values, n load deviation sampling values, and fault type sampling values are randomly shuffled to obtain new sequences of solar irradiance, load deviation, and fault type. Data with the same index in each new sequence are set as random combination sample points containing solar irradiance, load deviation, and fault type. Traverse all combined sample points and filter out critical combined scenarios that simultaneously satisfy the conditions of solar irradiance greater than the extreme irradiance threshold, load deviation less than the extreme load threshold, and single fault scenario, to obtain the filtered set of critical combined scenarios.
5. The method for optimizing the capacity of distributed photovoltaic power grid access according to claim 1, characterized in that: Based on the distribution network topology model, dedicated intelligent agents are assigned at the node level, including: Starting from each HV node, with the starting node as the root node, a breadth-first search algorithm is used to traverse all HV nodes directly connected by branches, forming an HV region. The region contains all HV nodes reachable from the root node, forming a tree structure. The leaf nodes are the end nodes in the region that have no downstream connections. Each HV region corresponds to an HV agent. Starting from each MV node, with the starting node as the root node, a breadth-first search algorithm is used to traverse all MV nodes directly connected by branches, forming an MV region. The region contains all MV nodes reachable from the root node, forming a tree structure. Leaf nodes are the end nodes in the region that have no downstream connections. Each MV region corresponds to an MV agent.
6. The method for optimizing the capacity of distributed photovoltaic power grid access according to claim 1, characterized in that: Iterative voltage updates to the state space of each agent include: Calculate the branch power flow within all HV agents and MV agents. Starting from the leaf node of the corresponding agent, traverse towards the root node and calculate the active and reactive power of each branch within the area managed by the corresponding agent. Starting from the root node of the corresponding agent, traverse to the leaf nodes, and update the voltage of all nodes based on the active and reactive power of the branches within the area managed by the corresponding agent using the voltage drop formula. Calculate the voltage change of all nodes in the corresponding agent, and repeatedly update the voltage of all nodes until the voltage change of the largest node is less than the tolerance error. Solve for the average voltage, average branch current, total photovoltaic output and total load demand of all nodes in the corresponding agent, and update the state space.
7. The method for optimizing the capacity of distributed photovoltaic power grid access according to claim 1, characterized in that: The SQPaxos consensus mechanism is used to coordinate the actions of all agents, including: During the proposal phase, each agent's action is set as an action proposal for that agent. For critical combination scenarios, the agents submit action proposals to the coordinator, which sorts them in the order of receipt to form a proposal sequence. During the serialization voting phase, the proposals and critical combination scenarios in each proposal sequence are given to all agents. Each agent dynamically modifies the threshold of the local constraint and checks whether all proposals satisfy the local constraint. If all local constraints are satisfied, the agents vote to accept; otherwise, they reject. The coordinator collects votes from all agents. If the number of agents who accept the vote is greater than half of the total number of agents, the corresponding sorted proposal is added to the candidate set; otherwise, it is discarded.
8. Calculate the consensus action for the critical combination scenario from the candidate set, and broadcast the consensus action for the critical combination scenario to all agents; The DistFlow equations are used to simulate the consensus actions of all nodes and branch currents in critical combination scenarios. All agents verify whether the node voltages and branch currents meet the local constraints. If any constraint is not met by any agent, the verification fails, and all agents trigger the rollback mechanism to use the last valid action. If there is no last valid action, all agents do not take any action. If all constraints are met, all agents apply the consensus action under the critical combination scenario to update the corresponding agent's action in the critical combination scenario.
9. The method for optimizing the capacity of distributed photovoltaic power grid access according to claim 7, characterized in that: Each agent dynamically modifies the thresholds of local constraints, including: Adjust the uniform maximum allowable current of all branches in the region according to the fault type of the critical combination scenario; Adjust the voltage range of all nodes within the region according to the solar irradiance of the critical combination scenario; Adjust the capacity adjustment range according to the load deviation.
10. The method for optimizing the capacity of distributed photovoltaic power grid access according to claim 7, characterized in that: The consensus action for critical combination scenarios is calculated from the candidate set, expressed by the following formula: In the formula, This represents the consensus action under the critical combination scenario k. Represents the candidate set The number of proposals accepted. Represents the candidate set The v-th action proposal describes the photovoltaic access capacity adjustment suggested by the agent. Empty .
11. A distributed photovoltaic (PV) grid capacity optimization system for a distribution network, comprising the distributed PV grid capacity optimization method according to any one of claims 1-9, characterized in that: The boundary parameter set solution module is used to allocate the node level of the power grid topology model according to the reference voltage level, and solve the boundary parameter set based on the node level; The critical combination scenario set solution module is used to construct a joint probability distribution using solar radiation intensity, fault type data and virtual load set, and use Latin hypercube sampling to screen extreme condition scenarios of the joint probability distribution to form a critical combination scenario set. The capacity optimization model construction module is used to allocate dedicated agents according to the node level of the distribution network topology model. Based on the critical combination scenario set and boundary parameter set, a state space is constructed for each agent. The SQPaxos consensus mechanism is used to coordinate the actions of all agents. Based on the coordinated actions, the state space of each agent is updated using iterative voltage to construct the policy loss function. The policy parameters are updated according to the policy loss function. The iteration is repeated until a set number of times to obtain the trained photovoltaic access capacity optimization model based on multi-agent reinforcement learning. The output module is used to input real-time data into the photovoltaic access capacity optimization model based on multi-agent reinforcement learning, generate the optimal distributed photovoltaic access capacity of the distribution network, and realize the optimization of distributed photovoltaic access capacity of the distribution network.