Method for dynamically dividing large-scale distributed photovoltaic clusters based on improved local louvain algorithm
By improving the local Louvain algorithm and dynamically adjusting the distributed photovoltaic cluster, the problem of low computational efficiency of large-scale distributed photovoltaic clusters under grid changes is solved, and efficient cluster partitioning and network adjustment are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU INST OF ENERGY CONVERSION CHINESE ACAD OF SCI
- Filing Date
- 2022-06-29
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies are unable to effectively cope with the dynamic changes of large-scale distributed photovoltaic clusters, resulting in low grid control efficiency, high computational complexity, and excessively long computation time for traditional algorithms when the network expands and parameters change.
An improved local Louvain algorithm is adopted. By obtaining the parameters of the distributed photovoltaic network, an adjacency matrix and an electrical distance matrix are established and weighted. Combined with the principle of maximizing modularity, the cluster division of the affected part is dynamically adjusted, the original cluster characteristics are preserved, and the computational efficiency is improved.
While preserving the original cluster characteristics to the greatest extent, the affected areas are dynamically adjusted, which improves computational efficiency and reduces computation time, making it suitable for the dynamic partitioning of large-scale distributed photovoltaic clusters.
Smart Images

Figure CN115549176B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the development and application of regional contiguous distributed photovoltaic clusters, belonging to the field of active distribution network optimization control technology, specifically involving a dynamic partitioning method for large-scale distributed photovoltaic clusters based on an improved local Louvain algorithm. Background Technology
[0002] Distributed photovoltaic (PV) systems are characterized by numerous locations and wide coverage, which differs significantly from the centralized power generation methods of traditional power grids. Therefore, the large-scale, contiguous development of distributed PV systems will inevitably bring challenges and profound impacts to the power grid, fundamentally changing the development model of the power system.
[0003] From a technical perspective, the centralized control methods of traditional power grids are no longer applicable to large-scale distributed photovoltaic (PV) distribution systems, leading to the emergence of distributed control methods. Control of distributed PV units is often based on a certain degree of clustering. Some literature defines a distributed PV cluster as a collection of several geographically or electrically proximate or complementary distributed generation units, energy storage, loads, and their control devices within the same distribution network area. Clustering of distributed PV is based on analyzing the matching relationship between the output characteristics of distributed PV power generation and the energy consumption characteristics of local loads, with the aim of achieving flexible grid connection control and economic absorption of PV power generation within the cluster.
[0004] Currently, there are some studies involving the partitioning of distributed photovoltaic (PV) clusters. For example, the patent with authorization publication number CN107834596 A discloses a dynamic partitioning method for distributed PV clusters based on grid operation status perception. When the grid control target changes, it dynamically partitions distributed PV clusters using fuzzy clustering with different partitioning indicators. The PV cluster partitioning method and system disclosed in the patent with authorization publication number CN 111382763A uses the BIRCH algorithm for initial cluster partitioning and optimizes the initial cluster partitioning results based on outlier detection results. The distributed PV cluster partitioning method and system based on the BAS-IGA algorithm disclosed in the patent with authorization publication number CN 114221350 A uses multiple algorithms such as the beetle whisker search algorithm, genetic algorithm, and K-means algorithm to achieve cluster partitioning of the target distribution network. Summary of the Invention
[0005] This invention provides a dynamic partitioning method for large-scale distributed photovoltaic (PV) clusters based on an improved local Louvain algorithm. Targeting the regional contiguous development and large-scale application of distributed PV, this method proposes a dynamic cluster partitioning approach. After network changes, it dynamically adjusts the affected parts while preserving the original cluster characteristics to the greatest extent possible, effectively improving computational efficiency. This invention approaches the problem from the perspective of community detection algorithms, selecting the Louvain algorithm as the baseline and improving its local algorithms. By acquiring changes in network information and using the maximum modularity value of the system as the optimization objective, it achieves dynamic cluster partitioning of distributed PV.
[0006] To achieve the above objectives, the technical solution adopted by the present invention includes the following:
[0007] In a first aspect, the present invention provides a method for dynamic partitioning of large-scale distributed photovoltaic clusters based on an improved local Louvain algorithm, comprising the following steps:
[0008] S1. Obtain the wiring diagram and network parameters of the distributed photovoltaic network;
[0009] S2. Establish an adjacency matrix based on network parameters;
[0010] S3. Establish the electrical distance matrix and node similarity matrix based on the network parameters;
[0011] S4. Weight the parameters from step S3 to generate the edge weight matrix;
[0012] S5. Perform a cluster partitioning in the initial network using the basic global Louvain algorithm;
[0013] S6. In subsequent time slices, if the network changes, keep the unaffected parts unchanged and perform local updates on the affected parts;
[0014] S7. Update the affected cluster using the improved local Louvain algorithm.
[0015] In the preferred embodiment, step S1, obtaining the distributed photovoltaic network wiring diagram and network parameters, includes:
[0016] S101. Determine the number of network nodes and branches, and generate a network wiring diagram;
[0017] S102. Obtain the initial voltage value, power output, load status, and reactive power compensation equipment connection status of each node;
[0018] S103. Obtain the impedance, susceptance to ground, and transformer parameters of each branch.
[0019] In the preferred embodiment, step S2, the step of establishing the network adjacency matrix, includes:
[0020] S201. Generate an all-zero square matrix N_Link, whose number of rows and columns is equal to the number of network nodes;
[0021] S202. If node i and node j are directly connected by a line, then N_Link ij and N_Link ji Set to 1.
[0022] It should be noted here that if i = j, then N_Link ij =0, meaning the entire diagonal of the matrix is 0.
[0023] In the preferred embodiment, step S3, which involves establishing the electrical distance matrix and the node similarity matrix, includes:
[0024] S301. Based on the network parameters obtained in step S1 and the adjacency relationship established in step S2, calculate the electrical distance matrix determined by the reactive voltage sensitivity and the active voltage sensitivity.
[0025] S302. Establish a similarity matrix based on the differences in active and reactive power regulation capacity, control methods, and distributed power regulation costs.
[0026] It should be noted that the node similarity matrix can be adjusted according to existing parameters and actual needs, and is not necessarily limited to or required to include the content described in step S302. Step S302 can also be omitted.
[0027] In the preferred embodiment, the method for weighting the parameters and generating the edge weight matrix in step S4 is as follows: according to actual needs, the electrical distance matrix and node similarity matrix established in step S3 are assigned weight values, and the edge weight matrix required by the Louvain algorithm is obtained through weighted calculation.
[0028] It should be noted that the definitions of electrical distance and node similarity vary depending on the actual needs. There is no specific formula for the weighted calculation here, and it should be defined by the user based on the existing parameters and experimental requirements.
[0029] In a preferred embodiment, step S5 of the basic global Louvain algorithm includes the following steps:
[0030] S501. Assign each node in the network to all its adjacent clusters in turn, and calculate the change in modularity Δρ before and after the assignment. Find the adjacent cluster corresponding to the maximum value of Δρ. If maxΔρ>0, then assign the node to this cluster; otherwise, leave it unchanged.
[0031] S502. Repeat step S501 until the cluster affiliation of all nodes no longer changes;
[0032] S503. Perform graph compression. Compress the clusters formed in the above steps into new nodes. The weights of edges within the clusters are converted into the weights of the new nodes themselves, and the weights of edges between clusters are converted into the weights of edges between the new nodes.
[0033] S504. Repeat steps S501-S503 until the network cluster structure no longer changes.
[0034] In a preferred embodiment, step S6, which involves performing a partial update on the affected portion of the network, includes:
[0035] S601. Determine the nodes and branches that have changed in the network and their related parameters;
[0036] S602. Update the adjacency matrix and edge weight matrix according to the changes in information;
[0037] S603. For the affected cluster, if the disbanding conditions are met, then the cluster shall be disbanded; otherwise, the cluster shall not be disbanded.
[0038] S604. Generate the updated cluster partitioning and update the modularity matrix.
[0039] In a preferred embodiment, the change parameters to be determined in step S601 should include: nodes and their parameters that have changed in the original network, branches and their parameters that have changed in the original network, newly added nodes and their parameters, newly added branches and their parameters, and deleted branches and their parameters.
[0040] In a preferred embodiment, in step S603, the conditions for disbanding a cluster include the following three scenarios: the newly added or increased edge weight branch is between two different original clusters; the newly added or increased edge weight branch is between an original node and a newly added node; and the deleted or decreased edge weight branch is within an original cluster.
[0041] Under other conditions, although the cluster is affected, the cluster disbanding operation is not performed, including the following three situations: the newly added branch or the branch with increased edge weight is within an existing cluster, the newly added branch is between two newly added nodes, and the deleted branch or the branch with decreased edge weight is between two different existing clusters.
[0042] It should be noted that since the core of the Louvain algorithm is based on maximizing modularity, the basis for disbanding the cluster is that changes in the branches will reduce the cluster's modularity; if changes in the branches lead to an increase in the cluster's modularity, then the cluster will not be disbanded.
[0043] In the preferred embodiment, the improved local Louvain algorithm in step S7 is characterized by the following: its process is the same as the global Louvain algorithm described in step S5, but the improved local Louvain algorithm, based on the clusters partitioned in the previous time slice and step S6, only performs algorithm operations on the affected parts, leaving other parts unprocessed. When the cluster partitioning target is a large-scale distributed photovoltaic access point network, compared to the basic Louvain algorithm, the improved local Louvain algorithm can effectively improve computational efficiency and reduce computation time.
[0044] In a second aspect, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, characterized in that: when the processor executes the computer program, it implements any of the steps of the method described above.
[0045] Compared with the prior art, the advantages of this invention are as follows:
[0046] (1) Unlike traditional clustering algorithms such as K-means, community detection algorithms do not require a pre-defined number of clusters, avoiding the difficulty in judgment and redundant calculations that may occur when the network is too large. The number of clusters can be optimally arranged according to the network conditions. The Louvain algorithm, as one of the best-performing community detection algorithms, optimizes the system's maximum modularity, resulting in the most compact cluster partitioning. In the implementation scheme provided by this invention, the Louvain algorithm is based on a modularity function quantified by network electrical parameters, and can perform cluster partitioning based on objectives such as power quality optimization and maximizing power absorption.
[0047] (2) This invention makes certain improvements to the basic Louvain algorithm and the local Louvain algorithm, and proposes a dynamic Louvain algorithm for partitioning large-scale distributed photovoltaic clusters. The original local Louvain algorithm only considered the addition and deletion of nodes and edges. For distributed photovoltaic low-voltage networks, this invention makes the following modifications: The operations of adding nodes and adding / deleting edges are retained. The addition of a node is regarded as the commissioning of a new distributed photovoltaic power generation, and the addition / deletion of an edge is regarded as the connection and disconnection of the line between two nodes under the control of the switch; The operation of deleting a node is removed and regarded as the island operation state of the photovoltaic node, which may be reconnected to the grid after the next network change. Therefore, all the information of the existing nodes is retained; The operation of increasing / decreasing the edge weight is added. Since the output and load of distributed photovoltaic power sources change with the season and weather, the node parameters will change, which may affect the sensitivity and node similarity, thereby changing the edge weight.
[0048] (3) This algorithm can dynamically adjust regions affected by network changes while maximizing the preservation of the original clusters. This invention also verifies the feasibility of using this algorithm for dynamic cluster partitioning.
[0049] (4) When the cluster partitioning target is a network with a large scale of distributed photovoltaic access points, the dynamic Louvain algorithm can effectively improve the computational efficiency and reduce the computation time compared with the basic Louvain algorithm. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart of a dynamic partitioning method for large-scale distributed photovoltaic clusters based on an improved local Louvain algorithm, provided in Embodiment 1 of the present invention.
[0052] Figure 2 This is a flowchart of step S1 in Embodiment 1 of the present invention;
[0053] Figure 3 This is a schematic diagram of the method for generating the adjacency matrix in step S2 of Embodiment 1 of the present invention;
[0054] Figure 4 This is a flowchart of step S3 in Embodiment 1 of the present invention;
[0055] Figure 5 This is a flowchart of step S5 in Embodiment 1 of the present invention, that is, a flowchart of the basic Louvain algorithm.
[0056] Figure 6 This is a flowchart illustrating step S6 in Embodiment 1 of the present invention.
[0057] Figure 7 This is a schematic diagram of disbanding the cluster in step S6 of embodiment 1 of the present invention;
[0058] Figure 8 This is a schematic diagram illustrating the use of the improved local Louvain algorithm to update the cluster in Embodiment 2 of the present invention;
[0059] Figure 9 This is a schematic diagram of the composition of the computer device described in Embodiment 4 of the present invention. Detailed Implementation
[0060] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0061] It should be noted that the terms "comprising" and "having" and any variations thereof in the embodiments of the present invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or devices.
[0062] With the increasing scale of distributed photovoltaic (PV) construction in my country, the demand for cluster control of large-scale distributed networks has emerged. However, due to frequent changes in PV output characteristics, network expansion requirements, and the dynamic reconfiguration of the distribution network structure by soft-switching devices, distributed PV networks are constantly evolving. Therefore, it is essential to study the dynamic adjustment of distributed network control methods and to dynamically partition them into clusters. Based on this, this invention provides a method for dynamic partitioning of large-scale distributed PV clusters based on an improved local Louvain algorithm.
[0063] In Example 1:
[0064] like Figure 1 As shown, the present invention provides the following technical solution: a dynamic partitioning method for large-scale distributed photovoltaic clusters based on an improved local Louvain algorithm, comprising the following steps:
[0065] S1. Obtain the wiring diagram and network parameters of the distributed photovoltaic network;
[0066] S2. Establish an adjacency matrix based on network parameters;
[0067] S3. Establish the electrical distance matrix and node similarity matrix based on the network parameters;
[0068] S4. Weight the parameters from step S3 to generate the edge weight matrix;
[0069] S5. Perform a cluster partitioning in the initial network using the basic global Louvain algorithm;
[0070] S6. In subsequent time slices, if the network changes, keep the unaffected parts unchanged and perform local updates on the affected parts;
[0071] S7. Update the affected cluster using the improved local Louvain algorithm.
[0072] Thus, through the above steps, this invention provides a method for dynamically partitioning distributed photovoltaic clusters. It should be noted that this improved algorithm is not only applicable to the embodiments provided in this invention, but also to cluster partitioning in other time-varying networks.
[0073] like Figure 2 As shown, in this embodiment, preferably, the step of obtaining the distributed photovoltaic network wiring diagram and network parameters in step S1 includes:
[0074] S101. Determine the number of network nodes and branches, and generate a network wiring diagram;
[0075] S102. Obtain the initial voltage value, power output, load status, and reactive power compensation equipment connection status of each node;
[0076] S103. Obtain the impedance, susceptance to ground, and transformer parameters of each branch.
[0077] Thus, through the above steps, the parameters required for power flow calculation in the entire distributed photovoltaic network are obtained. It should be noted that although this invention does not focus on power flow calculation, it is still necessary to obtain the key parameters required for subsequent cluster partitioning through power flow calculation; this will be discussed in detail below.
[0078] In this embodiment, preferably, the step of establishing the network adjacency matrix in step S2 includes:
[0079] S201. Generate an all-zero square matrix N_Link, whose number of rows and columns is equal to the number of network nodes;
[0080] S202. If node i and node j are directly connected by a line, then N_Link ij and N_Link ji Set to 1.
[0081] It should be noted here that if i = j, then N_Link ij =0, meaning the entire diagonal of the matrix is 0.
[0082] by Figure 3 To illustrate the above steps: Figure 3 (a) is a schematic diagram of a dot matrix. Figure 3 (b) is the adjacency matrix corresponding to this point. As shown in Figure 3, if there is a direct branch connecting two points, the corresponding element in the matrix is 1; otherwise, it is 0. Furthermore, since the connection is bidirectional, the matrix is symmetric, i.e., N_Link. ij =N_Link ji .
[0083] In an electrical network, different electrical nodes are connected based on tie lines or tie switches. Figure 3 Solid lines indicate direct feeder connections, maintaining a constant connection between the two nodes under fault-free conditions; dashed lines indicate soft-switch interconnections, where the connection is controlled by soft switches as network control requirements change, therefore t i ∈{0,1} (i=1,2,3), a value of 1 indicates the switch is closed, and a value of 0 indicates the switch is open. In particular, when t3=0, node 6 has no connection to it and is an isolated node.
[0084] Thus, through the above steps, the adjacency matrix of the entire network is generated, and subsequent calculations will be based on this adjacency matrix. If an element in the adjacency matrix is 0, the element at the same position in the electrical distance matrix, similarity matrix, and subsequently generated edge weight matrix is set to 0. That is, in subsequent calculations, two points in the electrical network that are not connected by lines will not be compared, avoiding excessive redundant calculations.
[0085] like Figure 4 As shown, in this embodiment, preferably, the steps of establishing the electrical distance matrix and the node similarity matrix in step S3 include:
[0086] S301. Based on the network parameters obtained in step S1 and the adjacency relationship established in step S2, calculate the electrical distance matrix determined by the reactive voltage sensitivity and the active voltage sensitivity.
[0087] S302. Establish a similarity matrix based on the differences in active and reactive power regulation capacity, control methods, and distributed power regulation costs.
[0088] For step S301, in a power system, changes in the electrical parameters of one node are also affected by changes in the parameters of other nodes. The impact of the power change at node j on the voltage at node i is the power-voltage sensitivity between the two nodes, which indirectly reflects the degree of coupling between the two nodes and is often used to define the electrical distance between them. Reactive power-voltage sensitivity The relationship between the voltage magnitude at node i and the voltage at node j after a unit reactive power is injected is defined as follows: Therefore, we can give the definition of the node electrical distance based on reactive voltage sensitivity:
[0089]
[0090] In the formula, d ij This is a commonly used logarithmic value representing the ratio of the voltage change at node j to the voltage change at node i after a change in reactive power. Therefore, d... ijThe larger the value of d, the smaller the influence of node j on node i, and the greater the electrical distance between the two nodes. In addition, some literature considers the influence of other nodes on d... ij Taking into account the impact of [the above], the definition of electrical distance has been further processed, but since this is not the focus of this invention, it will not be elaborated here.
[0091] The definition of active voltage sensitivity is the same as that of reactive voltage sensitivity, and will not be discussed further here. However, since voltage changes are often more closely related to reactive power, many studies only consider reactive voltage sensitivity.
[0092] For step S302, node similarity is considered for the following reasons: Since community detection algorithms often use modularity maximization as the optimization objective, they consider the tightness of the connection between two nodes and pay more attention to edge information, while often ignoring node information. Node similarity can transform the information of two different nodes into edge information and represent the similarity between nodes with a quantified value.
[0093] It should be noted that the node similarity matrix can be adjusted according to existing parameters and actual needs, and is not necessarily limited to or required to include the content described in step S302. Step S302 can also be omitted.
[0094] Thus, through the above steps, all the parameters required to construct the edge weight matrix are generated.
[0095] In this embodiment, preferably, the method for weighting the parameters and generating the edge weight matrix in step S4 is as follows: Based on actual needs, weights are assigned to the electrical distance matrix and node similarity matrix established in step S3, and the edge weight matrix required by the Louvain algorithm is obtained through weighted calculation. It should be noted that the definitions of electrical distance and node similarity vary depending on actual needs, and there is no specific formula for the weighted calculation here; it should be defined according to existing parameters and experimental requirements.
[0096] Thus, through the above steps, the edge weight matrix Edge_W required by the community detection algorithm is established, where Edge_W ij This represents the weight value of the edge connecting node i and node j. The larger the weight, the closer the connection between the two nodes, and the greater the likelihood that they will be assigned to the same cluster.
[0097] like Figure 5 As shown, in this embodiment, preferably, in step S5, the steps of the basic global Louvain algorithm include:
[0098] S501. Assign each node in the network to all its adjacent clusters in turn, and calculate the change in modularity Δρ before and after the assignment. Find the adjacent cluster corresponding to the maximum value of Δρ. If maxΔρ>0, then assign the node to this cluster; otherwise, leave it unchanged.
[0099] S502. Repeat step S501 until the cluster affiliation of all nodes no longer changes;
[0100] S503. Perform graph compression. Compress the clusters formed in the above steps into new nodes. The weights of edges within the clusters are converted into the weights of the new nodes themselves, and the weights of edges between clusters are converted into the weights of edges between the new nodes.
[0101] S504. Repeat steps S501-S503 until the network cluster structure no longer changes.
[0102] The basic idea of Louvain's algorithm is to maximize modularity, and the algorithm is based on the Newman modularity formula:
[0103]
[0104] In the formula, ρ represents the modularity, and ew ij These are the elements in the edge weight matrix Edge_W, i.e., the weights of the connected edges. It is the sum of the weights of all connected edges. The sum of the weights of all edges connected to node i is given. When node i and node j belong to the same community, δ(i,j) = 1; otherwise, δ(i,j) = 0. From this formula, we can see that the maximum value of ρ is 1, and the larger ρ is, the greater the modularity of the cluster and the more compact and reasonable the cluster partitioning.
[0105] Thus, through the above steps, the network in its initial state is partitioned into clusters based on the basic Louvain algorithm. Subsequent cluster updates will be based on the first cluster partition, which can preserve the unaffected cluster parts to the greatest extent.
[0106] like Figure 6 As shown, in this embodiment, preferably, the step of performing a partial update on the affected part of the network in step S6 includes:
[0107] S601. Determine the nodes and branches that have changed in the network and their related parameters;
[0108] S602. Update the adjacency matrix and edge weight matrix according to the changes in information;
[0109] S603. For the affected cluster, if the disbanding conditions are met, then the cluster shall be disbanded; otherwise, the cluster shall not be disbanded.
[0110] S604. Generate the updated cluster partitioning and update the modularity matrix.
[0111] In this embodiment, preferably, the change parameters to be determined in step S601 should include: nodes and their parameters that have changed in the original network, branches and their parameters that have changed in the original network, newly added nodes and their parameters, newly added branches and their parameters, and deleted branches and their parameters.
[0112] In this embodiment, preferably, in step S603, the conditions for disbanding the cluster include the following three scenarios: the newly added or weighted branch is between two different existing clusters; the newly added or weighted branch is between an existing node and a newly added node; and the deleted or weighted branch is within an existing cluster. Under other conditions, although the cluster is affected, the cluster disbanding operation is not performed, including the following three scenarios: the newly added or weighted branch is within an existing cluster; the newly added branch is between two newly added nodes; and the deleted or weighted branch is between two different existing clusters. It should be noted that since the core of the Louvain algorithm is based on maximizing modularity, the basis for disbanding the cluster is that changes in the branch will decrease the cluster's modularity; if changes in the branch lead to an increase in the cluster's modularity, the cluster is not disbanded.
[0113] like Figure 7 The following are two examples of disbanding a cluster. Figure 7 Figure 7(a) shows the initial cluster, with the weight of each edge labeled. Figure 7(b) shows the compressed graph, where nodes 1 and 4 represent the two clusters. The weights of edges within a cluster are converted to the weights of the new node itself, and the weights of edges between clusters are converted to the weights of edges between the new nodes. It should be noted that when converting the weights of edges within a cluster to the weights of the new node itself, due to the bidirectional nature of the connections, the sum of all weights should be multiplied by 2. In Figure 7(c), the network is modified by adding edges 2-7. This operation, which adds edges between different clusters, tends to reduce the modularity of the two clusters; therefore, both clusters 1 and 4 are disbanded. Figure 7 In (d), the network change involves deleting the edge 4-6. This operation deletes an edge within the cluster, which only reduces the modularity of cluster 4 and has no effect on cluster 1. Therefore, only cluster 4 is disbanded. Subsequent operations are based on the Louvain algorithm to update the cluster, which will not be elaborated here.
[0114] It is worth noting that the original local Louvain algorithm only considered the addition and deletion of nodes and edges. For distributed photovoltaic (PV) low-voltage networks, this invention makes the following improvements: It retains the operations of adding nodes and adding / deleting edges; adding a node is considered as a new distributed PV power generation system being put into operation, and adding / deleting an edge is considered as the connection / disconnection of the line between two nodes under the control of a switch; it removes the operation of deleting nodes, treating it as an islanded operation state of the PV node, which may be reconnected to the grid after the next network change, thus retaining all information of existing nodes; it adds the operation of increasing / decreasing edge weights. Since parameters such as the output and load of distributed PV power sources change with seasonal and weather factors, node parameters may change, potentially affecting sensitivity and node similarity, thus changing the edge weights. The method of disbanding the cluster in the above operations is similar to... Figure 7 The same applies here, so I will not repeat it again.
[0115] In this embodiment, preferably, the improved local Louvain algorithm in step S7 is characterized by the following: its process is the same as the global Louvain algorithm described in step S5, but the improved local Louvain algorithm, based on the clusters partitioned in the previous time slice and step S6, only performs algorithm operations on the affected parts, leaving other parts unprocessed. When the cluster partitioning target is a large-scale distributed photovoltaic access point network, compared with the basic Louvain algorithm, the improved local Louvain algorithm can effectively improve computational efficiency and reduce computation time.
[0116] Thus, the cluster partitioning function in the new time slice has two inputs: the cluster partitioning result in the previous time slice and the changes in network parameters in the current time slice. Therefore, this improved local Louvain algorithm can be understood as a time-progressing serial algorithm.
[0117] In Example 2:
[0118] This embodiment generates a test matrix to verify the effectiveness of the improved local Louvain algorithm described in Embodiment 1. The original information of the test matrix is the same as... Figure 7 As shown in (a), the test process and results are as follows: Figure 8 As shown.
[0119] It should be noted that, in order to simplify the testing process, the edge weight is defined as the reciprocal of the length in this embodiment, and only the Louvain algorithm part is tested.
[0120] like Figure 8 As shown in (a), in the initial state, it is calculated by writing a program that nodes 1, 2, and 3 are in cluster 1, and nodes 4, 5, 6, and 7 are in cluster 4, with a modularity ρ = 0.3529.
[0121] Based on the cluster partitioning results in the previous time slice Figure 8 In (b), adding edges 2-7 does not change the cluster update result, but the modularity decreases due to the addition of inter-cluster edges, ρ = 0.3066.
[0122] Based on the cluster partitioning results in the previous time slice Figure 8 In (c), deleting edges 4-6 does not change the cluster update result, but the modularity decreases due to the deletion of internal cluster edges, ρ = 0.3048.
[0123] Based on the cluster partitioning results in the previous time slice Figure 8 In (d), add edge 5-7 and add node 8. The original cluster remains unchanged after the update, and a new single-node cluster 8 is added. However, since the internal edge of the cluster is added, and since node 8 is an isolated node, it has no impact on the overall modularity, so the modularity increases, ρ = 0.3066.
[0124] Based on the cluster partitioning results in the previous time slice Figure 8 In (e), edges 5-8 and 6-8 are added. After the update, cluster 8 is merged into cluster 4. However, since the two newly added edges are located between the two original different clusters, the modularity is reduced, and ρ = 0.2979.
[0125] Based on the cluster partitioning results in the previous time slice Figure 8 In (f), the parameters of node 4 change, the weight of the edge 3-4 increases, and the weights of 4-5 and 4-7 decrease. After the update, the cluster is reorganized. Node 4, nodes 1, 2, and 3 form a new cluster 1, and nodes 5, 6, 7, and 8 form a cluster 5. The modularity increases, and ρ = 0.3153.
[0126] In summary, the improved local Louvain algorithm can effectively update the changed cluster, and the modularity-based optimization process can make the cluster partitioning structure compact and reasonable.
[0127] In Example 3:
[0128] This embodiment generates three test lattices with different numbers of nodes to test the computational efficiency of the improved local Louvain algorithm described in Embodiment 1, and compares the efficiency of the algorithm provided by this invention with that of the basic Louvain algorithm.
[0129] Similar to Example 2, to simplify the testing process, this example only tests the Louvain algorithm. To make the test results more accurate, the average time of 10 tests is taken as a reference value for the algorithm efficiency. The calculation program is written in Matlab.
[0130] First, a test was conducted on adding a branch to the network: based on the initial cluster partitioning results, the time required for the basic Louvain algorithm and the improved local Louvain algorithm to update the cluster after adding a new branch was measured.
[0131] Matrix 1 consists of 34 nodes. In 10 tests, the basic Louvain algorithm took an average time of 6.502 × 10⁻⁶. -4 The improved local Louvain algorithm takes an average time of 8.371 × 10⁻⁶ seconds. -4 The improved algorithm takes 28.7% longer than the basic algorithm and does not have an efficiency advantage.
[0132] Matrix 2 consists of 136 nodes. In 10 tests, the basic Louvain algorithm took an average time of 6.33 × 10⁻⁶. -3 The improved local Louvain algorithm takes an average time of 2.79 × 10⁻⁶ seconds. -3 The improved algorithm is 55.9% faster than the basic algorithm, demonstrating a significant efficiency advantage.
[0133] The lattice 3 consists of 680 nodes. In 10 tests, the basic Louvain algorithm took an average of 0.182 seconds, while the improved local Louvain algorithm took an average of 0.012 seconds. The improved algorithm took only 6.6% of the time of the basic algorithm, demonstrating a significant efficiency advantage.
[0134] Furthermore, the efficiency differences between the two algorithms were compared and tested under the conditions of adding two branches and deleting one branch (a total of three branches were modified).
[0135] In 10 tests on lattice 1, the basic Louvain algorithm took an average time of 8.192 × 10⁻¹⁰. -4 The improved local Louvain algorithm takes an average time of 1.59 × 10⁻⁶ seconds. -3 The improved algorithm takes 94.1% longer than the basic algorithm and does not have an efficiency advantage.
[0136] In 10 tests on lattice 2, the basic Louvain algorithm took an average time of 5.91 × 10⁻⁶. -3 The improved local Louvain algorithm takes an average time of 4.05 × 10⁻⁶ seconds. -3 The improved algorithm is 31.5% faster than the basic algorithm, demonstrating an efficiency advantage.
[0137] In 10 tests on Matrix 3, the basic Louvain algorithm took an average of 0.179s, while the improved local Louvain algorithm took an average of 0.014s. The improved algorithm took 7.8% of the time of the basic algorithm, demonstrating a significant efficiency advantage.
[0138] By comparing the above results, we can draw the following conclusions:
[0139] 1) The efficiency of the basic Louvain algorithm is independent of changes in information in the network, but its computation time increases significantly as the number of nodes and branches in the network increases.
[0140] 2) The efficiency of the improved local Louvain algorithm is related to the changes in information in the network. The more branches with changing parameters, the longer the computation time. However, the number of network nodes has little impact on the improved local algorithm. Since only the changing region is processed, other regions have little impact on the improved algorithm.
[0141] In lattice 1 with a small number of network nodes, the improved algorithm is less efficient than the basic algorithm. However, as the number of network nodes increases, the advantages of the improved algorithm become increasingly apparent. This is because the improved algorithm needs to first disband and update the clusters partitioned in the previous time slice, a process that requires computation time. In contrast, the basic algorithm performs global cluster partitioning of the entire network, which does not require much time when the number of nodes is small. As the network grows, the basic algorithm becomes more efficient. Figure 5 The loop shown takes a lot of time for iteration, while the improved algorithm only operates on the affected parts, greatly reducing the time required for iteration.
[0142] In summary, when the cluster partitioning target is a network with a large number of distributed photovoltaic access points, the large-scale distributed photovoltaic cluster dynamic partitioning method based on the improved local Louvain algorithm provided in this invention can effectively improve computational efficiency and reduce computation time compared to the basic Louvain algorithm.
[0143] In Example 4:
[0144] like Figure 9 As shown, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, characterized in that: when the processor executes the computer program, it implements the steps of any one of the above-described examples.
[0145] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete component gate circuits, transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0146] The memory can be used to store the computer program or module, such as a program for a dynamic partitioning method for large-scale distributed photovoltaic clusters based on an improved local Louvain algorithm. The memory can also be an external storage device, such as a hard disk, RAM, plug-in hard disk, smart memory card, secure digital card, magnetic tape, floppy disk, or optical storage. Furthermore, the memory can include both internal storage units and external storage devices. The memory can also be used to temporarily store data that has been output or will be output.
[0147] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0148] The above embodiments are merely illustrative of the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made based on the essence of the content of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A dynamic partitioning method based on an improved local Louvain algorithm, used for cluster partitioning of large-scale distributed photovoltaic systems, characterized in that, Includes the following steps: Obtain the network wiring diagram of the distributed photovoltaic system and determine the network parameters of the network wiring diagram; Establish a network adjacency matrix based on the network parameters; An electrical distance matrix and a node similarity matrix are established based on the network parameters and the network adjacency matrix; An edge weight matrix is established based on the electrical distance matrix and the node similarity matrix; The basic global Louvain algorithm is used for cluster partitioning in the initial network. The specific steps of the basic global Louvain algorithm are as follows: each node in the network is sequentially assigned to all its adjacent clusters, and the change in modularity before and after the assignment is calculated. ,turn up The adjacent clusters corresponding to the maximum value, if If the node is assigned to a cluster, then the node is assigned to this cluster; otherwise, it remains unchanged until the cluster affiliation of all nodes no longer changes. The clusters formed by the above steps are compressed into new nodes, and the weights of the edges within the cluster are converted into the weights of the new nodes themselves, and the weights of the edges between the clusters are converted into the weights of the edges between the new nodes, until the network cluster structure no longer changes. In subsequent time slices, if the network changes, the unaffected parts remain unchanged, and the affected parts are locally updated. The specific steps for locally updating the affected parts are: determining the nodes and branches that have changed in the network and their related parameters, and updating the network adjacency matrix and edge weight matrix according to the information changes. If the clusters affected meet the disbanding conditions, then the clusters are disbanded; otherwise, the clusters are not disbanded. The updated cluster partitioning is generated, and the modularity matrix is updated. The affected clusters are updated using the improved local Louvain algorithm.
2. The dynamic partitioning method based on the improved local Louvain algorithm according to claim 1, characterized in that, Obtaining the network wiring diagram of a distributed photovoltaic system and determining the network parameters of the network wiring diagram specifically includes the following steps: Determine the number of network nodes and branches, and generate a network wiring diagram; Obtain the initial voltage value, power output, load status, and reactive power compensation equipment connection status of each node; Obtain the impedance, susceptance to ground, and transformer parameters of each branch.
3. The dynamic partitioning method based on the improved local Louvain algorithm according to claim 1, characterized in that, Establishing a network adjacency matrix involves the following steps: Generate an all-zero square matrix Its number of rows and columns is equal to the number of network nodes, where if the node With nodes If there is a direct connection, then... and Set to 1; if ,but That is, the diagonal of the matrix is all 0.
4. The dynamic partitioning method based on the improved local Louvain algorithm according to claim 1, characterized in that, The electrical distance matrix and node similarity matrix are established, specifically including the following steps: Based on the obtained network parameters and the adjacency relationship established by the adjacency matrix, calculate the electrical distance matrix determined by the reactive voltage sensitivity and the active voltage sensitivity; A similarity matrix is established based on the differences in active and reactive power regulation capacity, control methods, and distributed power regulation costs.
5. The dynamic partitioning method based on the improved local Louvain algorithm according to claim 1, characterized in that, The steps to establish the edge weight matrix are as follows: The electrical distance matrix and the node similarity matrix are assigned weights, and the edge weight matrix required by the Louvain algorithm is obtained by weighted calculation.
6. The dynamic partitioning method based on the improved local Louvain algorithm according to claim 1, characterized in that, The relevant parameters include: nodes and their parameters that have changed in the original network, branches and their parameters that have changed in the original network, newly added nodes and their parameters, newly added branches and their parameters, and deleted branches and their parameters.
7. The dynamic partitioning method based on the improved local Louvain algorithm according to claim 1, characterized in that, The conditions for disbanding a cluster include: a newly added branch or a branch with increased edge weight is between two different original clusters; a newly added branch or a branch with increased edge weight is between an original node and a newly added node; and a deleted branch or a branch with decreased edge weight is within an original cluster.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.