Grounding grid detection method and system based on particle swarm algorithm
By generating a resistance matrix in the grounding network and using particle swarm algorithm and energy diffusion algorithm, combined with Markov chain relationship, the problem of resistance detection accuracy of grounding grid in the prior art is solved, and the reliability of the detection results is improved.
Patent Information
- Application Number
- CN202411026137.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-07-30
AI Technical Summary
In the prior art, due to the small number of accessible nodes at a time, it is difficult to solve the optimal solution of the underdetermined system of equations, which reduces the accuracy of the ground grid resistance value.
By setting the branch intersection in the grounding network as a node, a first resistance matrix is generated, and an excitation voltage is applied to the first accessible node, random noise is added on the basis of the first resistance matrix through the particle swarm algorithm to generate a candidate solution Matrix, iteratively solves the loss function to obtain the second resistance matrix, combines energy diffusion and Markov chain relationships to verify the reliability of the iterative results.
It improves the accuracy of the resistance value of the ground grid, ensures the reliability of the calculation results, and enhances the accuracy of the resistance detection of the corrosion ground grid.
Smart Images

Figure CN118551146B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of grounding grid fault diagnosis, and in particular relates to a grounding grid detection method and system based on a particle swarm algorithm. Background Art
[0002] The grounding grid is an important part of the power system, responsible for quickly conducting fault current to the earth, thereby protecting equipment and personal safety. The increase in grounding grid resistance caused by corrosion will significantly reduce its ability to discharge fault current, increasing the risk of equipment damage and personal injury. Therefore, regular monitoring of the corrosion condition of the grounding grid and timely detection and treatment of corrosion problems are the key to ensuring the safe and stable operation of the power system.
[0003] The following methods are proposed in the prior art to detect grounding grid faults. For example, Chinese patent document CN110646707A discloses a grounding grid fault diagnosis method based on micro-processing method and particle swarm algorithm. The method first estimates the port resistance and branch current value of each group before corrosion, and measures the port resistance of each group after corrosion; then the fault diagnosis model is established using Tellegen's theorem, and the model is micro-processed using the linearization idea to quickly obtain an initial solution close to the actual resistance change multiple of the grounding grid branch. The particle swarm algorithm is used to optimize the initial solution, obtain the final solution with an accurate change multiple, and judge the grounding grid fault based on the final solution; for example, Chinese patent document CN103605042A discloses a grounding grid fault diagnosis method based on an adaptive particle swarm optimization algorithm. The method establishes a fault diagnosis equation according to the node voltage analysis method in the electrical network theory, and then obtains the target optimization function according to the minimum energy principle, converts the grounding grid fault diagnosis problem into a target optimization problem with constraints, and then uses the adaptive particle swarm optimization algorithm to solve the optimization problem to obtain the diagnosis result.
[0004] The above method usually uses the current or voltage of multiple accessible nodes obtained by one measurement, establishes an underdetermined system of equations according to the basic principle of circuit and Tellegen's theorem, and solves the approximate optimal solution of the underdetermined system of equations through the particle swarm algorithm to obtain the multiple of the branch resistance value relative to the nominal value, so as to realize the detection of grounding grid corrosion. However, in actual situations, due to the small number of accessible nodes that can be measured at one time, it is difficult to solve the optimal solution of the underdetermined system of equations, which will reduce the accuracy of the resistance value of the corroded grounding grid. Summary of the invention
[0005] In order to solve the above problems, the present invention provides a grounding grid detection method and system based on particle swarm algorithm to solve the problems in the prior art.
[0006] In order to achieve the above-mentioned invention object, the present invention proposes a grounding grid detection method based on particle swarm algorithm, comprising:
[0007] The branch intersections in the grounding grid are set as nodes, there are branches between the nodes, and there are ideal resistance values in the branches;
[0008] A first resistance matrix is generated based on ideal resistance values, wherein the first resistance matrix includes nodes i and nodes j The ideal resistance value between ;
[0009] Selecting a first accessible node, applying an excitation voltage to the first accessible node, selecting a plurality of second accessible nodes, and obtaining first voltage values of the second accessible nodes by measuring;
[0010] The loss function is defined as ,in, is the second resistor matrix, which includes the elements , is the target resistance value between node i and node j, t is the number of the second accessible nodes, and are respectively a second voltage value and the first voltage value of the kth second accessible node;
[0011] Solving the loss function based on the excitation voltage and the first resistance matrix to obtain the second resistance matrix that minimizes the loss function , obtaining the elements in the second resistance matrix whose values are increased compared to the first resistance matrix , defined as the target branch, and the branch corresponding to the target branch is determined as the grounding grid corrosion fault branch.
[0012] Further, solving the loss function comprises the following steps:
[0013] Setting update parameters, wherein the update parameters include the number of candidate solutions, the maximum number of iterations, the iteration speed, the first learning factor, the second learning factor, and the inertia weight parameter. In the first iteration, adding random noise values to the elements in the first resistance matrix to obtain a candidate solution matrix, repeating this step until the candidate solution matrix of the number of candidate solutions is obtained;
[0014] Calculate the corresponding second voltage value based on the candidate solution matrix, calculate the fitness value of the candidate solution matrix based on the loss function, determine the individual optimal value and the group optimal value therefrom, in the second iteration, update the candidate solution matrix based on the individual optimal value and the group optimal value in combination with the first learning factor, the second learning factor, the iteration speed and the inertia weight parameter, update the group optimal value based on the updated candidate solution matrix, repeat this step until the maximum number of iterations is reached, and define the candidate solution matrix corresponding to the group optimal value as a candidate matrix;
[0015] If the candidate matrix does not meet the predetermined condition, the update parameter is updated, the candidate matrix is recalculated, and it is determined again whether the candidate matrix meets the predetermined condition, and the candidate matrix that finally meets the predetermined condition is set as the second resistance matrix.
[0016] Further, calculating the second voltage value comprises the following steps:
[0017] Based on the target conductance values corresponding to each node in the candidate solution matrix, a target conductance matrix is generated based on the target conductance values. The target conductance matrix includes elements , For Node i and nodes j The target conductivity value between 1 and 2 ;
[0018] Calculate the transfer probability of voltage from node i to node g based on the probability transfer equation , the probability transfer equation is: , where 1≤g≤n, For Node i and the target conductance value between node g, m is the number of nodes adjacent to node i, is the target conductance value between node i and the adjacent node n;
[0019] A transfer matrix is generated based on the transfer probability of each node. After an excitation voltage is applied to the first accessible node, the Monte Carlo method is used to obtain the steady-state voltage of each node when the grounding grid satisfies the transfer matrix with the excitation voltage of the first accessible node as a constraint condition, and the steady-state voltage of the second accessible node is defined as the corresponding second voltage value.
[0020] Further, verifying whether the candidate matrix satisfies the predetermined condition comprises the following steps:
[0021] A third accessible node is selected in addition to the first accessible node and the second accessible node, a first voltage value of the third accessible node is calculated based on the alternative matrix, a second voltage value of the third accessible node is measured, and the first voltage value and the second voltage value are substituted into the loss function to calculate and obtain a verification result. If the verification result is less than a first threshold, it is determined that the alternative matrix satisfies the predetermined condition.
[0022] Further, before adding noise to the first resistance matrix, historical data of each branch is obtained, the historical data including actual resistance values of the branch at multiple historical time points, and a search space is generated based on the historical data, the search space including multiple branches;
[0023] When adding noise to the first resistance matrix, noise is only added to the elements corresponding to the branches located in the search space to generate a plurality of the candidate solution matrices. After obtaining the alternative matrix, if the alternative matrix does not meet the predetermined condition, the branches included in the search space are expanded to obtain an extended space, and noise is added to the elements corresponding to the branches located in the extended space to generate the candidate solution matrix again.
[0024] Furthermore, generating the search space comprises the following steps:
[0025] Obtain the actual resistance value of the branch at each historical time point, define the interval between adjacent historical time points as a time interval, extract a target interval from the time interval, the target interval is the time interval in which the actual resistance value increases, and calculate the degradation value of the branch based on the degradation equation , the degradation equation is, , where A is the number of target intervals, and are respectively the actual resistance values of the last and first historical time points in the historical data, C is a conditional value, when the last time interval is the target interval, the value of C is 1, otherwise it is 0, , , The first weight, the second weight and the third weight are respectively used, and this step is repeated to calculate the degradation value of each branch, and the branch whose degradation value is greater than the second threshold is defined as the target branch, and the search space is generated based on all the target branches.
[0026] Furthermore, the number of candidate solutions is set to 100, the maximum number of iterations is set to 10000, the first learning factor and the second learning factor are set to 1.5, and the inertia weight parameter is set to 0.8.
[0027] Furthermore, the first accessible node includes a first initial node and a second initial node, and the excitation voltage of the second initial node is 0.
[0028] Furthermore, the second weight is greater than the first weight, and the first weight is greater than the third weight.
[0029] The present invention also provides a grounding grid detection system based on a particle swarm algorithm, which is used to implement the above-mentioned grounding grid detection method based on a particle swarm algorithm, and the system includes:
[0030] Building a module, setting the branch intersections in the grounding grid as nodes, branches between nodes, and ideal resistance values in the branches;
[0031] An analysis module generates a first resistance matrix based on an ideal resistance value, wherein the first resistance matrix includes nodes i and nodes j The ideal resistance value between ;
[0032] The calculation module selects a first accessible node, applies an excitation voltage to the first accessible node, selects multiple second accessible nodes, obtains the first voltage value of the second accessible node by measurement, and defines the loss function as ,in, is the second resistor matrix, which includes the elements , is the target resistance value between node i and node j, t is the number of the second accessible nodes, and The second voltage value and the first voltage value of the kth second accessible node are respectively obtained, and the loss function is solved based on the excitation voltage and the first resistance matrix to obtain the second resistance matrix that minimizes the loss function. , obtaining the elements in the second resistance matrix whose values are increased compared to the first resistance matrix , defined as the target branch, and the branch corresponding to the target branch is determined as the grounding grid corrosion fault branch.
[0033] Compared with the prior art, the beneficial effects of the present invention are at least as follows:
[0034] The present invention combines energy diffusion and Markov chain to obtain the relationship between branch resistance and accessible node voltage, and then constructs the loss function of branch resistance and accessible node; after applying the excitation voltage to the first accessible node, random noise is added to the first resistance matrix through the particle swarm algorithm to generate multiple candidate solution matrices as particles, and the second resistance matrix that makes the loss function reach the minimum value is solved through continuous iteration. In each iteration process, the Monte Carlo method is used to solve the approximate steady-state solution of the diffusion process of electric energy along the circuit under different second resistance matrices, so as to obtain the target voltage that should appear at the second accessible node. After the iteration is completed, the iteration result is verified by selecting other accessible nodes again, so as to ensure the reliability of the calculation result. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a flow chart of the steps of the grounding grid detection method based on particle swarm algorithm of the present invention;
[0036] Figure 2 It is a structural schematic diagram of the grounding grid detection system based on the particle swarm algorithm of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0038] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.
[0039] like Figure 1 As shown in Figure 1, a grounding grid detection method based on particle swarm algorithm is proposed.
[0040] Step S1: Set the branch intersections in the grounding grid as nodes, there are branches between the nodes, and there are ideal resistance values in the branches.
[0041] First, a topological diagram is constructed. The topological diagram is actually the result of equating the grounding grid to a pure resistance circuit. After obtaining the topological diagram, the nodes and branches in the topological diagram are numbered, and the ideal resistance values are marked in the line segments representing the branches. The ideal resistance value is the resistance value corresponding to each branch after the grounding grid design is equivalent.
[0042] Step S2: Generate a first resistance matrix based on the ideal resistance value, the first resistance matrix includes nodes i and nodes j The ideal resistance between .
[0043] Step S3: selecting a first accessible node, applying an excitation voltage to the first accessible node, selecting a plurality of second accessible nodes, and obtaining first voltage values of the second accessible nodes by measurement;
[0044] An accessible node is a node that can be measured. Before testing, all accessible nodes are first obtained and numbered, and the first accessible node is randomly extracted from them. In this embodiment, two first initial nodes and second initial nodes are extracted, and an excitation voltage with a non-zero value is applied to the first initial node, and an excitation voltage with a value of 0 is applied to the second initial node. Then the second accessible node is extracted, and the second accessible node is a node different from the first accessible node. In this embodiment, the meter voltage value that should appear at the second accessible node under different second resistance matrices after applying the excitation voltage is obtained by Markov and Monte Carlo methods, and the first voltage value of the second accessible node is obtained by actual measurement.
[0045] Step S4: Define the loss function as ,in, is the second resistor matrix, which includes the elements , is the target resistance between node i and node j, t is the number of the second accessible nodes, and are respectively the second voltage value and the first voltage value of the kth second accessible node;
[0046] Step S5: Solve the loss function based on the excitation voltage and the first resistance matrix to obtain the second resistance matrix that minimizes the loss function. , get the elements in the second resistance matrix that have a larger value than the first resistance matrix , defined as the target branch, and the branch corresponding to the target branch is determined as the grounding grid corrosion fault branch.
[0047] If the grounding grid is not corroded, after measuring and obtaining the first voltage value, by actually solving the loss function, if a second resistance matrix can be obtained, the second resistance matrix represents the resistance values of each branch, after applying the excitation voltage, a second voltage value equal to the first voltage value can be calculated through the excitation power supply and the second resistance matrix, that is, the loss function is set to 0. In this case, it indicates that the grounding grid is not corroded; conversely, if such a resistance matrix cannot be obtained by solving the loss function, it indicates that the grounding grid is corroded.
[0048] In this embodiment, solving the loss function includes the following steps:
[0049] Setting update parameters, including the number of candidate solutions, the maximum number of iterations, the iteration speed, the first learning factor, the second learning factor, and the inertia weight parameter. In the first iteration, adding random noise values to the elements in the first resistance matrix to obtain a candidate solution matrix, repeating this step until a candidate solution matrix of the number of candidate solutions is obtained;
[0050] The corresponding second voltage value is calculated based on the candidate solution matrix, and the fitness value of the candidate solution matrix is calculated based on the loss function, and the individual optimal value and the group optimal value are determined therefrom. In the second iteration, based on the individual optimal value and the group optimal value, the candidate solution matrix is updated in combination with the first learning factor, the second learning factor, the iteration speed and the inertia weight parameter, and the group optimal value is updated based on the updated candidate solution matrix. This step is repeated until the maximum number of iterations is reached, and the candidate solution matrix corresponding to the group optimal value is defined as the candidate matrix;
[0051] If the candidate matrix does not meet the predetermined conditions, the parameters are updated, the candidate matrix is recalculated, and it is determined again whether the candidate matrix meets the predetermined conditions, and the candidate matrix that finally meets the predetermined conditions is set as the second resistance matrix.
[0052] Based on the above analysis, it can be known that after the candidate solution matrix is generated based on the first resistance matrix, the second voltage value of the second accessible node is calculated through the candidate solution matrix, and then the second voltage value is substituted into the loss function. By calculating the difference between the second voltage value and the actual voltage difference, the adaptation value of the candidate solution matrix can be obtained; this step is continuously iterated, and the goal is to find a set of second resistance matrices that make the second voltage value of each second accessible node closest to the first voltage value, that is, to minimize the loss function; after obtaining the second resistance matrix that minimizes the loss function, if the elements in the second resistance matrix are the same as the elements in the first resistance matrix, it is considered that there is no corrosion; if there are elements in the second resistance matrix that are larger than the first resistance matrix, it is considered that there is corrosion, and the branch corresponding to the increase in the element is the corroded branch.
[0053] This step is based on the particle swarm algorithm. It obtains the resistance matrix that minimizes the loss function through continuous iterative solution. Each candidate solution matrix is used as a particle to seek the optimal solution through continuous position transformation. The number of candidate solutions in this embodiment is set to 100, the maximum number of iterations is set to 10000, the first learning factor and the second learning factor are set to 1.5, and the inertia weight parameter is set to 0.8.
[0054] In the first iteration, since each element in the candidate solution matrix represents the resistance value of the branch, in order to ensure that there will be no dimensionality errors in the subsequent calculation process, the candidate solution matrix is first converted into a row vector , N is the number of candidate solutions, each row vector includes M elements, corresponding to the number of branches M; based on the row vector The resistance value in is combined with the Monte Carlo method to calculate the second voltage value, and the second voltage value is substituted into the right side of the loss function to obtain the adaptation value , define the fitness value is the individual optimal value, based on the row vector The resistance value in is combined with the above Monte Carlo method to obtain the second voltage value, and the second voltage value is substituted into the right side of the loss function to obtain the adaptation value , if the fitness value Less than value , then update the individual optimal value to the fitness value , otherwise keep the fitness value The individual optimal value is repeated until all row vectors are traversed, the individual optimal value with the smallest value is set as the group optimal value, and the next iteration is continued. Until the maximum number of iterations is reached, the final group optimal value is set as the second resistance matrix.
[0055] In this embodiment, during the iteration process, the position is the candidate solution matrix value, and the moving speed and position of the particle are updated by the following two formulas: , ,in, is the velocity of the e-th particle in the t-th iteration, is the velocity of the e-th particle in the t+1th iteration, w is the inertia weight parameter, is the fitness value of the e-th particle in the t-th iteration, is the fitness value of the e-th particle in the t+1th iteration, r1 and r2 are the first random number and the second random number, the value of r1 is between 0-1, the value of r2 is between 0-1, c1 and c2 are the first learning factor and the second learning factor, is the individual optimal value, is the optimal value of the group in the iterative process.
[0056] After reaching the maximum number of iterations, the candidate solution matrix corresponding to the optimal value of the group is defined as the alternative matrix. To further ensure the correctness of the candidate solution matrix, the alternative matrix is verified by predetermined conditions. If the verification passes, the alternative matrix is set as the second resistance matrix. Otherwise, the particle swarm algorithm is used again to solve the loss function until an alternative that meets the predetermined conditions is obtained.
[0057] Based on the target conductance values corresponding to each node in the candidate solution matrix, a target conductance matrix is generated based on the target conductance values. The target conductance matrix includes elements , For Node i and nodes j Target conductance value between .
[0058] Calculate the transfer probability of voltage from node i to node g based on the probability transfer equation , the probability transfer equation is: , where 1≤g≤n, For Node i and the target conductance value between node g, m is the number of nodes adjacent to node i, is the target conductance value between node i and its adjacent node n.
[0059] The relationship between the voltages of two nodes can be calculated through the probability transfer equation. By calculating the transfer probability between each node, the distribution process of voltage along the circuit can be regarded as a Markov process of energy diffusion. And according to the probability transfer equation, it can be known that the voltage Vi of node i and the voltage Vg of node g have the equation that satisfies , transforming the above equation we can get , after further transformation, we can get , where Vi is the voltage at node i, is the probability of voltage transfer from node i to node n, Vn is the voltage of node n, m is the number of nodes adjacent to node i, For Node i and the target conductance value between node g, For Node i and the target conductance value between node n, is the target resistance value between node i and node n, For slave nodes i The target current value flowing to node n, that is, the current flowing into the node is equal to the current flowing out of the node, proves that the Markov process in which electric energy diffuses between nodes along the circuit according to the transfer probability follows Kirchhoff's law.
[0060] A transfer matrix is generated based on the transfer probability of each node. After the excitation voltage is applied to the first accessible node, the Monte Carlo method is used to obtain the steady-state voltage of each node when the grounding grid satisfies the transfer matrix with the excitation voltage of the first accessible node as a constraint condition, and the steady-state voltage of the second accessible node is defined as the corresponding second voltage value.
[0061] The Monte Carlo method is a numerical simulation method that takes probability phenomena as the research object. It is a calculation method that obtains statistical values according to the sampling survey method to infer unknown characteristic quantities. Therefore, the ideal voltage matrix of the entire grounding grid is continuously generated by the Monte Carlo method, and finally a steady-state matrix can be obtained. The steady-state matrix includes the steady-state voltage of each node, and the steady-state voltage of the first accessible node is equal to the excitation voltage. The steady-state voltage of each node satisfies the transfer probability relationship defined in the transfer matrix. Here, the steady-state matrix is defined as Vall, and the steady-state voltage of the second accessible node is the ideal voltage value required.
[0062] In traditional schemes, although the voltage of each node can be solved by using the basic principle of circuit, the noise fluctuation caused by the external factors such as environment in the actual circuit is ignored. The energy diffusion algorithm in this scheme uses Monte Carlo method to solve the approximate steady-state solution of the diffusion process of electric energy along the circuit, so as to simulate the noise fluctuation in the actual circuit, so as to obtain the node voltage closer to the real circuit, making the subsequent detection of grounding grid fault more accurate.
[0063] In this embodiment, verifying whether the candidate matrix meets the predetermined condition includes the following steps:
[0064] In addition to the first accessible node and the second accessible node, a third accessible node is selected, a first voltage value of the third accessible node is calculated based on the alternative matrix, a second voltage value of the third accessible node is measured, and the first voltage value and the second voltage value are substituted into the loss function to calculate and obtain a verification result. If the verification result is less than the first threshold, it is determined that the alternative matrix meets the predetermined condition.
[0065] The candidate matrix can be verified twice by selecting other accessible nodes again, thereby further improving the reliability of obtaining the second resistance matrix.
[0066] Before adding noise to the first resistance matrix, historical data of each branch is obtained, the historical data including actual resistance values of the branch at multiple historical time points, and a search space is generated based on the historical data, the search space including multiple branches.
[0067] When adding noise to the first resistance matrix, noise is added only to the elements corresponding to the branches located in the search space to generate multiple candidate solution matrices. After obtaining the alternative matrix, if the alternative matrix does not meet the predetermined conditions, the branches included in the search space are expanded to obtain the extended space, and noise is added to the elements corresponding to the branches located in the extended space to generate a renewed candidate solution matrix.
[0068] Specifically, the resistance of the grounding grid can be measured every month or every 15 days to obtain the actual resistance value of each branch at multiple historical time points. By analyzing the resistance change of each branch, it is determined which branches have a tendency to be corroded, and then these branches that may be corroded are summarized to form a search space. When adding noise to the first resistance matrix, only the resistance values corresponding to the branches in the search space are added to generate multiple candidate solution matrices, which can narrow the initial search range and improve the solution speed of the particle swarm algorithm. In addition, if the second resistance matrix cannot be obtained after the first iteration, the search space is expanded, such as adding random noise to all elements in the first resistance matrix, so as to increase the initial search range of the particle swarm algorithm to obtain a suitable second resistance matrix.
[0069] In this embodiment, generating a search space includes the following steps:
[0070] Get the actual resistance value of the branch at each historical time point, define the interval between adjacent historical time points as the time interval, extract the target interval from the time interval, the target interval is the time interval when the actual resistance value increases, and calculate the degradation value of the branch based on the degradation equation , the degradation equation is, , where A is the number of target intervals, and are the actual resistance values of the last and first historical time points in the historical data, respectively. C is the conditional value. When the last time interval is the target interval, the value of C is 1, otherwise it is 0. , , The first weight, the second weight and the third weight are respectively used, and this step is repeated to calculate the degradation value of each branch, and the branch with a degradation value greater than the second threshold is defined as the target branch, and a search space is generated based on all target branches.
[0071] For example, if the time is historical time points 1-5, then the time interval 1 is between historical time points 1 and 2, and the time interval 2 is between historical time points 2 and 3. Then, determine whether each time interval is a target interval. For example, in time interval 1, the actual resistance value of the branch at historical time point 2 is greater than the actual resistance value at historical time point 1, then the time interval is the target interval. In addition, if historical time point 5 is the target interval, the corresponding conditional value is 1. Finally, the number of target intervals, the actual resistance values at historical time points 1 and 5, and the conditional value are substituted into the degradation equation to obtain the degradation value of the corresponding branch. If the branch degradation value calculated by the degradation equation is large, it is considered that there is a greater possibility of corrosion, so it is listed as a target branch and included in the search space.
[0072] In this embodiment, the second weight is greater than the first weight, and the first weight is greater than the third weight.
[0073] The second weight corresponds to whether there is a large increase in branch resistance, so the corresponding weight is larger. The third weight corresponds to whether there is a growth trend in the last time interval, and the corresponding weight is smaller.
[0074] like Figure 2 As shown, the present invention also provides a grounding grid detection system based on a particle swarm algorithm, which is used to implement the above-mentioned grounding grid detection method based on a particle swarm algorithm, and the system includes:
[0075] Building a module, setting the branch intersections in the grounding grid as nodes, branches between nodes, and ideal resistance values in the branches;
[0076] An analysis module generates a first resistance matrix based on the ideal resistance value, the first resistance matrix includes nodes i and nodes j The ideal resistance value between ;
[0077] The calculation module selects a first accessible node, applies an excitation voltage to the first accessible node, selects multiple second accessible nodes, obtains the first voltage value of the second accessible node by measurement, and defines the loss function as ,in, is the second resistor matrix, which includes the elements , is the target resistance between node i and node j, t is the number of the second accessible nodes, and The second voltage value and the first voltage value of the kth second accessible node are respectively, and the loss function is solved based on the excitation voltage and the first resistance matrix to obtain the second resistance matrix when the loss function is minimized , get the elements in the second resistance matrix that have a larger value than the first resistance matrix , defined as the target branch, and the branch corresponding to the target branch is determined as the grounding grid corrosion fault branch.
[0078] The present invention combines energy diffusion and Markov chain to obtain the relationship between branch resistance and accessible node voltage, and then constructs the loss function of branch resistance and accessible node; after applying the excitation voltage to the first accessible node, random noise is added to the first resistance matrix through the particle swarm algorithm to generate multiple candidate solution matrices as particles, and the second resistance matrix that makes the loss function reach the minimum value is solved through continuous iteration. In each iteration process, the Monte Carlo method is used to solve the approximate steady-state solution of the diffusion process of electric energy along the circuit under different second resistance matrices, so as to obtain the target voltage that should appear at the second accessible node. After the iteration is completed, the iteration result is verified by selecting other accessible nodes again, so as to ensure the reliability of the calculation result.
[0079] It is particularly noteworthy that the present invention integrates multiple measurement results through an iterative solution method to improve the accuracy of solving the resistance value of the corroded grounding grid.
Claims
1. A grounding grid detection method based on particle swarm algorithm, characterized in that: include: The branch intersections in the grounding grid are set as nodes, there are branches between the nodes, and there are ideal resistance values in the branches; A first resistance matrix is generated based on ideal resistance values, wherein the first resistance matrix includes nodes i and nodes j The ideal resistance value between ; Selecting a first accessible node, applying an excitation voltage to the first accessible node, selecting a plurality of second accessible nodes, where the second accessible nodes are nodes different from the first accessible node, and obtaining first voltage values of the second accessible nodes by measurement; The loss function is defined as ,in, is the second resistor matrix, which includes the elements , is the target resistance value between node i and node j, t is the number of the second accessible nodes, and are respectively a second voltage value and the first voltage value of the kth second accessible node; Solving the loss function based on the excitation voltage and the first resistance matrix to obtain the second resistance matrix that minimizes the loss function , obtaining the elements in the second resistance matrix whose values are increased compared to the first resistance matrix , defined as a target branch, and the target branch is determined as a grounding grid corrosion fault branch; Solving the loss function includes the following steps: Setting update parameters of the particle swarm algorithm, the update parameters including the number of candidate solutions, the maximum number of iterations, the iteration speed, the first learning factor, the second learning factor and the inertia weight parameter, in the first iteration of the particle swarm algorithm, adding random noise values to the elements in the first resistance matrix to obtain a candidate solution matrix, repeating this step until the candidate solution matrix of the number of candidate solutions is obtained; Calculate the corresponding second voltage value based on the candidate solution matrix, calculate the fitness value of the candidate solution matrix based on the loss function, determine the individual optimal value and the group optimal value therefrom, in the second iteration of the particle swarm algorithm, update the candidate solution matrix based on the individual optimal value and the group optimal value in combination with the first learning factor, the second learning factor, the iteration speed and the inertia weight parameter, update the group optimal value based on the updated candidate solution matrix, repeat this step until the maximum number of iterations is reached, and define the candidate solution matrix corresponding to the group optimal value as a candidate matrix; If the candidate matrix does not meet the predetermined condition, the update parameter is updated, the candidate matrix is recalculated, and it is determined again whether the candidate matrix meets the predetermined condition, and the candidate matrix that finally meets the predetermined condition is set as the second resistance matrix.
2. A grounding grid detection method based on particle swarm algorithm according to claim 1, characterized in that: Calculating the second voltage value comprises the following steps: Based on the target conductance values corresponding to each node in the candidate solution matrix, a target conductance matrix is generated based on the target conductance values. The target conductance matrix includes elements , For Node i and nodes j The target conductivity value between : Calculate the transfer probability of voltage from node i to node g based on the probability transfer equation , the probability transfer equation is: , where 1≤g≤n, For Node i and the target conductance value between node g, m is the number of nodes adjacent to node i, is the target conductance value between node i and the adjacent node n; A transfer matrix is generated based on the transfer probability of each node. After an excitation voltage is applied to the first accessible node, the Monte Carlo method is used to obtain the steady-state voltage of each node when the grounding grid satisfies the transfer matrix with the excitation voltage of the first accessible node as a constraint condition, and the steady-state voltage of the second accessible node is defined as the corresponding second voltage value.
3. A grounding grid detection method based on particle swarm algorithm according to claim 2, characterized in that: Verifying whether the candidate matrix satisfies the predetermined condition comprises the following steps: A third accessible node is selected in addition to the first accessible node and the second accessible node, a first voltage value of the third accessible node is calculated based on the alternative matrix, a second voltage value of the third accessible node is measured, and the first voltage value and the second voltage value are substituted into the loss function to calculate and obtain a verification result. If the verification result is less than a first threshold, it is determined that the alternative matrix satisfies the predetermined condition.
4. A grounding grid detection method based on particle swarm algorithm according to claim 1, characterized in that: Before adding noise to the first resistance matrix, historical data of each branch is obtained, the historical data including actual resistance values of the branch at multiple historical time points, and a search space is generated based on the historical data, the search space including multiple branches; When adding noise to the first resistance matrix, noise is only added to the elements corresponding to the branches located in the search space to generate a plurality of the candidate solution matrices. After obtaining the alternative matrix, if the alternative matrix does not meet the predetermined condition, the branches included in the search space are expanded to obtain an extended space, and noise is added to the elements corresponding to the branches located in the extended space to generate the candidate solution matrix again.
5. A grounding grid detection method based on particle swarm algorithm according to claim 4, characterized in that: Generating the search space comprises the following steps: Obtain the actual resistance value of the branch at each historical time point, define the interval between adjacent historical time points as a time interval, extract a target interval from the time interval, the target interval is the time interval in which the actual resistance value increases, and calculate the degradation value of the branch based on the degradation equation , the degradation equation is, , where A is the number of target intervals, and are respectively the actual resistance values of the last and first historical time points in the historical data, C is a conditional value, when the last time interval is the target interval, the value of C is 1, otherwise it is 0, , , The first weight, the second weight and the third weight are respectively used, and this step is repeated to calculate the degradation value of each branch, and the branch whose degradation value is greater than the second threshold is defined as the target branch, and the search space is generated based on all the target branches.
6. A grounding grid detection method based on particle swarm algorithm according to claim 3, characterized in that: The number of candidate solutions is set to 100, the maximum number of iterations is set to 10000, the first learning factor and the second learning factor are set to 1.5, and the inertia weight parameter is set to 0.
8.
7. A grounding grid detection method based on particle swarm algorithm according to claim 3, characterized in that: The first accessible node includes a first initial node and a second initial node, and the excitation voltage of the second initial node is 0.
8. The grounding grid detection method based on particle swarm algorithm according to claim 5 is characterized in that: The second weight is greater than the first weight, and the first weight is greater than the third weight.
9. A grounding grid detection system based on particle swarm algorithm, used to implement a grounding grid detection method based on particle swarm algorithm as claimed in any one of claims 1 to 8, characterized in that: include: Building a module, setting the branch intersections in the grounding grid as nodes, branches between nodes, and ideal resistance values in the branches; An analysis module generates a first resistance matrix based on an ideal resistance value, wherein the first resistance matrix includes nodes i and nodes j The ideal resistance value between ; A calculation module selects a first accessible node, applies an excitation voltage to the first accessible node, selects multiple second accessible nodes, where the second accessible nodes are nodes different from the first accessible nodes, obtains a first voltage value of the second accessible node by measurement, and defines a loss function as ,in, is the second resistor matrix, which includes the elements , is the target resistance value between node i and node j, t is the number of the second accessible nodes, and are respectively the second voltage value and the first voltage value of the kth second accessible node, the loss function is solved based on the excitation voltage and the first resistance matrix, when solving, the update parameters of the particle swarm algorithm are set, the update parameters include the number of candidate solutions, the maximum number of iterations, the iteration speed, the first learning factor, the second learning factor and the inertia weight parameter, in the first iteration of the particle swarm algorithm, random noise values are added to the elements in the first resistance matrix to obtain the candidate solution matrix, the process is repeated until the candidate solution matrix of the candidate solution number is obtained, the corresponding second voltage value is calculated based on the candidate solution matrix, the fitness value of the candidate solution matrix is calculated based on the loss function, the individual optimal value and the group optimal value are determined therefrom, and the particle swarm algorithm is used to calculate the fitness value of the candidate solution matrix. In the second iteration of the method, based on the individual optimal value and the group optimal value, the candidate solution matrix is updated in combination with the first learning factor, the second learning factor, the iteration speed and the inertia weight parameter, and the group optimal value is updated based on the updated candidate solution matrix. The group optimal value is updated, and the process is repeated until the maximum number of iterations is reached. The candidate solution matrix corresponding to the group optimal value is defined as an alternative matrix. If the alternative matrix does not meet the predetermined condition, the update parameter is updated, the alternative matrix is recalculated, and it is determined again whether the alternative matrix meets the predetermined condition. The alternative matrix that finally meets the predetermined condition is set as the second resistance matrix to obtain the second resistance matrix that minimizes the loss function. , obtaining the elements in the second resistance matrix whose values are increased compared to the first resistance matrix , defined as the target branch, and the branch corresponding to the target branch is determined as the grounding grid corrosion fault branch.
