Multi-microgrid topology optimization method based on matrix differential evolution algorithm
Through the matrix-based differential evolution algorithm and mixed integer linear programming model, the multi-micro grid topology structure is optimized in real time, and the rapid self-healing problem of the power grid in the event of failure is solved, load balancing and efficient adjustment of energy flow is achieved, and the stability and emergency response capabilities of the power grid are improved.
Patent Information
- Application Number
- CN202510309876.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-07-11
AI Technical Summary
The topological design and optimization of multi-micro grids have challenges in ensuring grid stability and adaptability, especially in the face of faults and extreme events, it is difficult for the prior art to achieve efficient topological adjustment and energy flow optimization.
The differential evolution algorithm based on matrix and a mixed integer linear planning model are adopted to generate the grid topology matrix, detect faults in real time, quickly locate damaged areas, and adjust energy flow, optimize repair time and cost to ensure stable operation of the grid.
It realizes the rapid self-healing ability of multi-micro grids in the event of failure, reduces the power interruption time and impact range, optimizes load balancing and energy loss, and improves the robustness and emergency response capabilities of the power grid.
Smart Images

Figure CN120296914A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power grid planning, and particularly relates to a multi - microgrid topology optimization method based on a matrix - based differential evolution algorithm. Background Art
[0002] With the rapid development of renewable energy and the gradual application of power grid intelligent technologies, the traditional power system is transforming towards a more decentralized, flexible, and intelligent multi - microgrid structure. A microgrid is a small - scale power system composed of local power generation, energy storage, loads, and distribution networks, which can operate independently under catastrophic events such as main grid failures or extreme weather. The deployment of microgrids can not only improve the reliability and self - sufficiency of energy but also optimize energy efficiency, especially in remote areas and regions with large load fluctuations.
[0003] However, the operation of multi - microgrids faces many challenges, especially in the design and optimization of the topological structure. Due to the high dynamics and uncertainty of the composition and operating environment of microgrids, how to optimize its topological structure while ensuring grid stability, making it have better robustness and adaptability, is an important topic in current power system research.
[0004] To solve this problem, the matrix - based differential evolution algorithm has become an effective optimization method. This is an optimization algorithm based on simulating natural selection and genetic evolution, with strong global search ability, which can effectively explore the solution space and avoid falling into local optimal solutions. In multi - microgrid topology optimization, by simulating the adjustment process of the multi - microgrid topology, not only can the connectivity of the power grid be optimized, but also load balancing, energy efficiency, and post - fault self - healing ability can be improved.
[0005] In addition, as a commonly used method in optimization solving, the mixed - integer linear programming model can handle maintenance scheduling and energy flow problems in the power grid through an accurate mathematical model. The optimization method combining the differential evolution algorithm and the mixed - integer linear programming model can not only enhance the recovery ability of the power grid in the face of faults and extreme events but also ensure the overall stability and operation efficiency of the system while minimizing costs and repair times.
[0006] Therefore, the multi - microgrid topology structure optimization method combining the matrix - based differential evolution algorithm and the mixed - integer linear programming can provide an efficient and reliable solution for complex power systems, promoting the wide application of smart grids. Summary of the Invention
[0007] In view of this, the objective of the present invention is to propose a multi - microgrid topology optimization method based on a matrix - based differential evolution algorithm, which is characterized by including the following steps:
[0008] Step 1, generate the basic topological matrix of the power grid and perform preliminary power grid optimization through an improved differential evolution algorithm;
[0009] Step 2, during the operation of the power grid, detect problems such as faults or load imbalance in real time through sensors and monitoring systems, and automatically start topological adjustment when the problems are found;
[0010] Step 3, after a problem occurs, quickly locate the damaged area, repair the damaged area and adjust the energy flow to restore the normal operation of the power grid;
[0011] During the process of repairing the damaged area and adjusting the energy flow, an improved mixed-integer linear programming model is used to coordinate the repair and energy flow, and optimize to reduce the repair time and cost.
[0012] Specifically, the generation of the basic topological matrix of the power grid and the preliminary optimization through the differential evolution algorithm include the following steps:
[0013] Represent the connection relationship of the power grid in matrix form. Assume that the power grid consists of N nodes and M connecting lines, and the topology of the power grid is represented by an N×N adjacency matrix A. The element a ij in the adjacency matrix represents the connection relationship between node i and node j:
[0014]
[0015] Among them, if there is a direct connection between node i and node j, then a ij = 1, otherwise a ij = 0;
[0016] The goals of the preliminary power grid optimization include: optimal connectivity: ensure that each node of each microgrid can be topologically connected reasonably; load balancing: avoid overloading or power shortage of some nodes by adjusting the topological structure; system recovery time: be able to quickly return to a stable operation state after the power grid fails; energy loss: minimize the energy loss in the power grid and optimize the transmission path;
[0017] The optimization objective function is:
[0018] F(A) = w1f1(A) + w2f2(A) + w3f3(A) + w4f4(A)
[0019] Among them, f1(A) is a connectivity metric function representing the connectivity of the topology, f2(A) is a load balancing metric function measuring the uniformity of the load of each node, f3(A) is a recovery time function measuring the time from failure to recovery of the system, f4(A) is an energy loss function measuring the total energy loss during the operation of the power grid, and w1, w2, w3, w4 are weight coefficients used to balance the influence of different objectives;
[0020] The improved differential evolution algorithm described above includes the following steps:
[0021] Step 101, initialize each individual in the population as a random power grid topology matrix A, and each individual represents a possible power grid topology solution;
[0022] Step 102, for each individual, use F(A) to evaluate its performance. An individual with a higher fitness indicates that the power grid performs better on each objective under the current power grid topology;
[0023] Step 103, for each individual A in the population i , generate a mutant individual V according to the differential evolution strategy i :
[0024] V i = A r + F·(A p - A q )
[0025] where A r , A p , A q are three random individuals in the population, and F is a scaling factor that controls the mutation step size;
[0026] Step 104, generate a crossover individual C i , which is formed by selecting genes from the original individual A i and the mutant individual V i :
[0027] C i = cross(A i , V i )
[0028] Step 105, select the new generation of individuals according to F(A). If the fitness of the crossover individual C i is better than that of the original individual A i , then replace the original individual:
[0029]
[0030] Repeat the above steps 103 to 105 until the preset termination condition is met, the fitness converges to the specified threshold, or the number of iterations reaches the threshold.
[0031] Specifically, the connectivity metric function is used to calculate the shortest path between each node and other nodes to ensure the full connectivity of the power grid, and the sum of the shortest paths is used as the connectivity index:
[0032]
[0033] Among them, dist(i, j) is the shortest path from node i to node j;
[0034] The load - balancing metric function evaluates the load - balancing performance based on the load distribution. Assume that the load of each node is L i , and the load - balancing metric is the variance of the loads of each node:
[0035]
[0036] Among them, is the mean value of the load;
[0037] The recovery - time function is the time from a fault to the restoration of normal operation, which is calculated by simulating the repair time after a fault occurs. The recovery - time function is expressed as:
[0038]
[0039] Among them, repair_time(k) is the time required to repair the k - th line, and K is the value of all lines in the fault;
[0040] The energy - loss function is estimated by the power flow of each line in the power grid and the impedance of the line:
[0041]
[0042] Among them, P ij is the power flow from node i to node j, and R ij is the resistance of the line.
[0043] The problem of detecting faults or load - imbalance situations includes voltage - deviation detection, load - imbalance detection, and power - flow anomaly detection. For the voltage - deviation detection, when the voltage V of a node i exceeds the normal range, it is considered that the node has a fault or imbalance. For the load - imbalance detection, by comparing the loads L of each node i with the difference of the expected load, the load - imbalance area is detected; for the power - flow anomaly detection, by calculating the difference between the power flow of each line and the expected value, the abnormal power flow is detected;
[0044] The described topology adjustment includes the following means: Select a backup power source: If some nodes or lines fail, the system will select a backup power source to supplement the load in the fault area; Switch the current path: Use intelligent switching devices to switch the current from the faulty line or node to the backup path to avoid power outages in the power grid; Adjust the load distribution: Adjust the load distribution of each node in the power grid to ensure load balance, and optimize the energy flow by adjusting the topology structure so that nodes with excessive load no longer bear too much load; After topology reconstruction, it is necessary to recalculate the power flow P in the power grid ij After optimization, the power flow reduces energy losses and maintains the stability of the power grid.
[0045] Furthermore, the use of an improved mixed-integer linear programming model to coordinate maintenance and energy flow includes the following steps:
[0046] Define the following variables, maintenance decision variables, maintenance time variables, maintenance cost variables, power flow variables, and switch operation variables. The maintenance decision variable r ij,t refers to defining the repair status of each line or component. r ij,t is a Boolean variable indicating whether line i-j is repaired at time t. The maintenance time variable refers to the time T repair (i,j) required to repair each line. T repair (i,j) represents the time required to repair line (i,j). The maintenance cost variable refers to the cost of repairing each line, C repair (i,j) represents the cost required to repair line (i,j). The power flow variable represents the power flow P ij,t in each line of the power grid. P ij,t represents the power flow from node i to node j. The switch operation variable: indicates whether it is necessary to operate the switches of the power grid to reconfigure the topology after a fault occurs:
[0047]
[0048] The objective function is expressed as:
[0049]
[0050] where: w1, w2, w3 are weight coefficients used to balance the impacts of repair cost, repair time, and energy loss. P ij, t R ij is the product of the power flow and the line resistance, representing energy loss;
[0051] Constraint conditions are defined:
[0052] Maintenance time constraint, the time to repair each line cannot exceed the given maximum repair time:
[0053]
[0054] Among them, T max is the maximum repair time for each line;
[0055] Maintenance resource constraint: The number of available maintenance teams in the system is limited. Therefore, only a limited number of maintenance tasks can be arranged at each moment:
[0056]
[0057] Among them, R max is the maximum number of maintenance teams;
[0058] Switch operation constraint: The topological reconfiguration of the power grid needs to be based on switch operations. At each moment, the switch operations must satisfy the physical constraints of the system, and the current does not exceed the maximum carrying capacity of the line:
[0059]
[0060] Among them, P max is the maximum power carrying capacity of the line;
[0061] Power flow balance constraint: Each node in the power grid must satisfy the power balance constraint to ensure the balance of all incoming and outgoing powers:
[0062]
[0063] Among them, L i is the load demand of node i;
[0064] Power grid connectivity constraint: When a line fails, the system restores the connectivity of the power grid through switch operations. If line i - j fails, the switch operations must ensure the connectivity of the power grid:
[0065] s ij,t = 1 if r ij,t = 1
[0066] This means that if line i - j is repaired, the switch of this line must be closed;
[0067] Use an optimization solver to solve the improved mixed - integer linear programming model to obtain the optimal solution, including the repair time, repair order, switch operations, and power flow of each line;
[0068] Execute repairs and topological adjustments. According to the optimization results, coordinate the maintenance teams for repairs, and at the same time adjust the power grid topology through switch operations to restore the normal operation of the power grid;
[0069] During the repair process, continuously monitor the power grid status, and adjust the repair plan and energy flow in real - time to ensure the efficiency of power grid restoration.
[0070] Further, the use of an improved mixed-integer linear programming model to coordinate maintenance and energy flow includes the following steps:
[0071] Initialize the power grid topology matrix A, and according to the state and topology of the existing power grid, initialize the adjacency matrix A and the power flow matrix P; Initialize the maintenance decision variable: Set each line r ij,t as a binary variable, indicating whether the line i-j is repaired at time t: r ij,t ∈{0,1}; Initialize the objective function, comprehensively considering the repair cost, repair time, and power flow loss objectives:
[0072]
[0073] where w1, w2, and w3 are weight coefficients, corresponding to the repair cost, repair time, and energy loss respectively;
[0074] Global optimization stage: Generate an initial population randomly or based on the current situation of the power grid. Each individual represents a possible power grid topology configuration. Each individual consists of the adjacency matrix A, the maintenance decision r ij,t and the power flow matrix P ij,t ; Calculate the fitness function: For each individual, calculate the objective function F(A). According to the weighted sum of the repair cost, repair time, and energy loss objectives, obtain the fitness of this individual; Selection operation: Select suitable individuals according to the fitness function to enter the next generation; Mutation and crossover operations: Generate new individuals through the differential evolution algorithm; Mutation operation: Generate a mutant individual V i : V i =A r +F·(A p -A q ) where A r , A p , A q are three randomly selected individuals, and F is the scaling factor; Crossover operation: Generate a crossover individual C i , by selecting genes from the original individual and the mutant individual for crossover; Fitness evaluation and selection: Calculate the fitness of the new individuals, and select and retain the better individuals according to the fitness to form a new population;
[0075] Local optimization stage, based on the global optimization solution, use a heuristic search method to further optimize the maintenance decision r ij,t and the power flow P ij,t , by gradually adjusting the connection of the power grid, optimizing the maintenance order, reducing the repair time and cost; Adjust the maintenance decision and energy flow: According to the output of the heuristic method, adjust the maintenance order and power flow to ensure the stability of the power grid during the repair process and minimize the energy loss;
[0076] Integer constraint processing stage, process integer constraints, and repair decision variable r ij,t is a binary integer variable. Use the branch and bound method for search. In the branching stage, divide the solution space based on the current solution to generate sub-problems. In the bounding stage, use the upper and lower bounds of the constraint conditions and the objective function to prune, exclude solutions that do not meet the conditions, narrow the search range, and accurately solve the optimal solution: Iteratively process integer constraints through the branch and bound method, gradually narrow the solution space, and finally find the optimal solution that meets the integer constraints.
[0077] Preferably, the heuristic search method further optimizes the repair decision r ij,t and power flow P ij,t , including the following steps:
[0078] Adjust the repair order based on the heuristic method: Calculate the urgency of the faulty line, and calculate the weight factor of the impact of each faulty line on the system:
[0079]
[0080] where, is the power flow of the line under normal conditions, T repair (i, j) is the repair time, C repair (i, j) is the repair cost, and α, β, γ are weight coefficients;
[0081] Sort the faulty lines in descending order according to W ij to form the repair priority, and sequentially select the line with the greatest impact for priority repair;
[0082] Adjust power flow optimization: Initialize the power flow optimization objective: where ε is the set of all available power grid lines, and P ij,t is the power flow of line (i, j); Calculate the current load imbalance, and calculate the current inflow and outflow of each node: Calculate the load imbalance: If Unbalance > threshold, the power flow needs to be adjusted; Identify the overloaded line. If the power flow of a certain line (i, j) exceeds the allowable range: Then adjust the power distribution and transfer part of the load to other lines; Power flow adjustment strategy, find an alternative path: Find an alternative path (k, l) that can share the load: Adjust the power flow: where ΔP is a preset value.
[0083] The beneficial effects of the present invention are as follows: The scheme introduces a differential evolution algorithm in the power grid topology optimization, which can handle complex optimization problems with high dimensions and non-linearity, and adapt to the power grid topology design under various complex environments; combined with intelligent switches and distributed generation devices, the power grid can quickly self-heal in the event of a disaster, reducing the power interruption time and the impact range; through a multi-objective optimization model, the repair cost, energy loss, and system recovery time are comprehensively considered to maximize the economy and emergency response ability of the power grid. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 The overall flowchart showing the multi-microgrid topology optimization method is shown. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0085] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0086] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0087] As Figure 1 shown, this embodiment proposes a multi-microgrid topology optimization method based on a matrix-based differential evolution algorithm, which is characterized by including the following steps:
[0088] Step 1, generate the basic topology matrix of the power grid and perform preliminary power grid optimization through an improved differential evolution algorithm;
[0089] Step 2, during the operation of the power grid, detect problems such as faults or load imbalance in real time through sensors and monitoring systems, and automatically start topology adjustment when the problems are found;
[0090] Step 3, after a problem occurs, quickly locate the damaged area, repair the damaged area and adjust the energy flow to restore the normal operation of the power grid;
[0091] During the process of repairing the damaged area and adjusting the energy flow, an improved mixed integer linear programming model is used to coordinate the repair and energy flow to optimize and reduce the repair time and cost.
[0092] Specifically, the generation of the basic topology matrix of the power grid and the preliminary optimization through the differential evolution algorithm include the following steps:
[0093] The connection relationship of the power grid is represented in matrix form. Assuming that the power grid consists of N nodes and M connecting lines, the topology of the power grid is represented by an N×N adjacency matrix A, and the element a in the adjacency matrix ij represents the connection relationship between node i and node j:
[0094]
[0095] Among them, if there is a direct connection between node i and node j, then a ij = 1, otherwise a ij = 0;
[0096] The goals of the preliminary power grid optimization include: Optimal connectivity: Ensure that nodes in each microgrid can be topologically connected reasonably; Load balancing: Avoid overloading or power shortage of some nodes by adjusting the topology; System recovery time: Be able to quickly return to a stable operating state after a power grid failure; Energy loss: Minimize the energy loss in the power grid and optimize the transmission path;
[0097] The optimization objective function is:
[0098] F(A)=w1f1(A)+w2f2(A)+w3f3(A)+w4f4(A)
[0099] Among them, f1(A) is a connectivity metric function representing the connectivity of the topology, f2(A) is a load balancing metric function measuring the uniformity of the load of each node, f3(A) is a recovery time function measuring the time from failure to recovery of the system, f4(A) is an energy loss function measuring the total energy loss during the operation of the power grid, and w1, w2, w3, w4 are weight coefficients used to balance the influence of different objectives;
[0100] The improved differential evolution algorithm includes the following steps:
[0101] Step 101, Initialize each individual in the population as a random power grid topology matrix A, and each individual represents a possible power grid topology solution;
[0102] Step 102, For each individual, use F(A) to evaluate its performance. An individual with a higher fitness indicates that the power grid performs better in each objective under the current power grid topology;
[0103] Step 103, For each individual A in the population i , generate a mutant individual V according to the differential evolution strategy i :
[0104] V i =A r +F·(A p -Aq )
[0105] Among them, A r , A p , A q are three random individuals in the population, and F is the scaling factor that controls the mutation step size;
[0106] Step 104: Generate the crossover individual C i , which is formed by selecting genes from the original individual A i and the mutated individual V i :
[0107] C i = cross(A i , V i )
[0108] Step 105: Select the new generation of individuals according to F(A). If the fitness of the crossover individual C i is better than that of the original individual A i , then replace the original individual:
[0109]
[0110] Repeat the above steps 103 to 105 until the preset termination condition is met, the fitness converges to the specified threshold or the number of iterations reaches the threshold.
[0111] Specifically, the connectivity metric function is used to calculate the shortest path between each node and other nodes to ensure the full connectivity of the power grid, and the sum of the shortest paths is used as the connectivity index:
[0112]
[0113] Among them, dist(i, j) is the shortest path from node i to node j;
[0114] The load balancing metric function evaluates the load balancing according to the load distribution. Assuming that the load of each node is L i , the load balancing metric is the variance of the loads of each node:
[0115]
[0116] Among them, is the mean value of the loads;
[0117] The recovery time function is the time from the fault to the restoration of normal operation, which is calculated by simulating the repair time after the fault occurs. The recovery time function is expressed as:
[0118]
[0119] Among them, repair_time(k) is the time required to repair the k-th line, and K is all the line values in the fault;
[0120] The described energy loss function is estimated by the power flow of each line in the power grid and the impedance of the line:
[0121]
[0122] Among them, P ij is the power flow from node i to node j, and R ij is the resistance of the line.
[0123] The problem of detecting faults or load imbalances includes voltage deviation detection, load imbalance detection, and power flow anomaly detection. For the voltage deviation detection, when the voltage V of a node i exceeds the normal range, it is considered that the node has a fault or imbalance. For the load imbalance detection, by comparing the load L of each node i with the difference in the expected load, the load imbalance area is detected; for the power flow anomaly detection, by calculating the difference between the power flow of each line and the expected value, the abnormal power flow is detected;
[0124] The described topology adjustment includes the following means: Select a backup power source: If some nodes or lines fail, the system will select a backup power source to supplement the load in the fault area; Switch the current path: Use intelligent switching equipment to switch the current from the faulty line or node to the backup path to avoid power outage in the power grid; Adjust the load distribution: Adjust the load distribution of each node in the power grid to ensure load balance, and optimize the energy flow by adjusting the topology structure so that the nodes with excessive load no longer bear too much load; After topology reconstruction, it is necessary to recalculate the power flow P ij in the power grid. The optimized power flow reduces energy loss and maintains the stability of the power grid.
[0125] Furthermore, the use of an improved mixed-integer linear programming model to coordinate maintenance and energy flow includes the following steps:
[0126] Define the following variables, maintenance decision variables, maintenance time variables, maintenance cost variables, power flow variables, and switch operation variables. The maintenance decision variable r ij,t refers to defining the repair status of each line or component. r ij,t is a Boolean variable indicating whether the line i-j is repaired at time t. The maintenance time variable refers to the time T repair (i,j) required to repair each line. T repair (i,j) represents the time required to repair the line (i,j). The maintenance cost variable refers to the cost of repairing each line, Crepair (i, j) represents the cost required to repair line (i, j), and the power flow variable represents the power flow P of each line in the power grid ij,t , P ij,t represents the power flow from node i to node j, and the switch operation variable: indicates whether it is necessary to operate the switches of the power grid to reconfigure the topology after a fault occurs:
[0127]
[0128] The objective function is expressed as:
[0129]
[0130] where: w1, w2, w3 are weight coefficients used to balance the impacts of repair cost, repair time, and energy loss, P ij, t R ij is the product of the power flow and the line resistance, representing the energy loss;
[0131] The constraint conditions are defined as:
[0132] The repair time constraint, the time to repair each line cannot exceed the given maximum repair time:
[0133]
[0134] where, T max is the maximum repair time for each line;
[0135] The repair resource constraint, the number of available repair teams in the system is limited, so only a limited number of repair tasks can be arranged at each moment:
[0136]
[0137] where, R max is the maximum number of repair teams;
[0138] The switch operation constraint, the topological reconfiguration of the power grid needs to be based on switch operations. At each moment, the switch operations must satisfy the physical constraints of the system, and the current does not exceed the maximum carrying capacity of the line:
[0139]
[0140] where, P max is the maximum power carrying capacity of the line;
[0141] The power flow balance constraint, each node in the power grid must satisfy the power balance constraint to ensure the balance of all incoming and outgoing powers:
[0142]
[0143] Among them, L i is the load demand of node i;
[0144] Grid connectivity constraint. When a line fails, the system restores the grid connectivity through switch operations. If line i-j fails, the switch operations must ensure grid connectivity:
[0145] s ij,t = 1 if r ij,t = 1
[0146] This means that if line i-j is repaired, the switch of this line must be closed;
[0147] Use an optimization solver to solve the improved mixed-integer linear programming model to obtain the optimal solution, including the repair time, repair order, switch operations, and power flow of each line;
[0148] Execute repairs and topology adjustments. According to the optimization results, coordinate the repair teams to perform repairs, and at the same time adjust the grid topology through switch operations to restore the normal operation of the grid;
[0149] During the repair process, continuously monitor the grid status, and adjust the repair plan and energy flow in real time to ensure the efficiency of grid restoration.
[0150] Furthermore, using the improved mixed-integer linear programming model to coordinate repairs and energy flow includes the following steps:
[0151] Initialize the grid topology matrix A. According to the status and topology of the existing grid, initialize the adjacency matrix A and the power flow matrix P; Initialize the repair decision variables: Set each line r ij,t as a binary variable, indicating whether line i-j is repaired at time t: r ij,t ∈ {0, 1}; Initialize the objective function, comprehensively considering the repair cost, repair time, and power flow loss objectives:
[0152]
[0153] Among them, w1, w2, and w3 are weight coefficients, corresponding to the repair cost, repair time, and energy loss respectively;
[0154] Global optimization stage: Generate an initial population randomly or based on the current grid status. Each individual represents a possible grid topology configuration. Each individual consists of the adjacency matrix A, the repair decision r ij,t and the power flow matrix P ij,tComposition; calculating the fitness function: For each individual, calculate the objective function F(A), and obtain the fitness of the individual according to the weighted sum of the repair cost, repair time, and energy loss target; Selection operation: Select suitable individuals according to the fitness function to enter the next generation; Mutation and crossover operations: Generate new individuals through the differential evolution algorithm; Mutation operation: Generate a mutant individual V i : V i = A r + F·(A p - A q ) where A r , A p , A q are three randomly selected individuals, and F is the scaling factor; Crossover operation: Generate a crossover individual C i , by selecting genes from the original individual and the mutant individual for crossover; Fitness evaluation and selection: Calculate the fitness of the new individuals, and select and retain the better individuals according to the fitness to form a new population;
[0155] Local optimization stage, based on the global optimization solution, use the heuristic search method to further optimize the repair decision r ij,t and the power flow P ij,t , by gradually adjusting the connection of the power grid, optimizing the repair sequence, and reducing the repair time and cost; Adjusting the repair decision and the energy flow: According to the output of the heuristic method, adjust the repair sequence and the power flow to ensure the stability of the power grid during the repair process and minimize the energy loss;
[0156] Integer constraint handling stage, handling integer constraints, the repair decision variable r ij,t is a binary integer variable, and the branch and bound method is used for searching. In the branching stage, the solution space is partitioned based on the current solution to generate sub-problems. In the bounding stage, the upper and lower bounds of the constraint conditions and the objective function are used to prune, excluding the solutions that do not meet the conditions, narrowing the search scope, and accurately solving the optimal solution: Iteratively process the integer constraints through the branch and bound method, gradually narrow the solution space, and finally find the optimal solution that meets the integer constraints.
[0157] Preferably, the heuristic search method further optimizes the repair decision r ij,t and the power flow P ij,t , including the following steps:
[0158] Adjusting the repair sequence based on the heuristic method: Calculate the urgency of the faulty line, and calculate the weight factor of the impact of each faulty line on the system:
[0159]
[0160] where, is the power flow of the line under normal conditions, T repair(i,j) is the repair time, C repair (i,j) is the repair cost, and α, β, and γ are weight coefficients;
[0161] According to W ij Sort the faulty lines in descending order to form the repair priority, and sequentially select the lines with the greatest impact for priority repair;
[0162] Adjust power flow optimization: Initialize the power flow optimization objective: where ε is the set of all available power grid lines, and P ij,t is the power flow of line (i,j); Calculate the current load imbalance, and calculate the current inflow and outflow of each node: Calculate the load imbalance: If Unbalance > threshold, the power flow needs to be adjusted; Identify overloaded lines. If the power flow of a certain line (i,j) exceeds the allowable range: Then adjust the power distribution to transfer part of the load to other lines; Power flow adjustment strategy, find an alternative path: Find an alternative path (k,l) that can share the load: Adjust the power flow: where ΔP is a preset value.
[0163] As used herein, the term "preferred" is intended to be used as an example, illustration, or exemplification. Any aspect or design described as "preferred" herein need not be construed as more advantageous than other aspects or designs. On the contrary, the use of the term "preferred" is intended to present concepts in a specific manner. As used in this application, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X uses A or B" means any one of the permutations is naturally included. That is, if X uses A; X uses B; or X uses both A and B, then "X uses A or B" is satisfied in any of the foregoing examples.
[0164] Moreover, although the present disclosure has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art based on a reading and understanding of this specification and the drawings. The present disclosure includes all such modifications and variations and is limited only by the scope of the appended claims. In particular with respect to the various functions performed by the above-described components (e.g., elements, etc.), the terms used to describe such components are intended to correspond to any component that performs the specified function of the component (e.g., it is functionally equivalent), unless otherwise indicated, even if structurally different from the disclosed structure that performs the functions in the exemplary implementations of the present disclosure shown herein. Additionally, although a particular feature of the present disclosure has been disclosed with respect to only one of several implementations, such feature may be combined with one or other features of other implementations as may be desired and advantageous for a given or particular application. Further, insofar as the terms "comprising," "having," "containing," or any variation thereof are used in a particular embodiment or claim, such terms are intended to be inclusive in a manner similar to the term "including."
[0165] Each functional unit in the embodiments of the present invention may be integrated into one processing module, may exist separately physically for each unit, or may be integrated into one module with two or more units. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. When the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disc, or the like. Each of the above-mentioned devices or systems may execute the storage method in the corresponding method embodiment.
[0166] In summary, the above embodiments are one implementation manner of the present invention, but the implementation manner of the present invention is not limited by the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made under the premise of departing from the spirit and principle of the present invention shall be equivalent replacement manners and are all included in the protection scope of the present invention.
Claims
1. A multi - microgrid topology optimization method based on a matrix - based differential evolution algorithm, characterized in that, It includes the following steps: Step 1: Generate the basic topology matrix of the power grid and conduct preliminary power grid optimization through an improved differential evolution algorithm; Step 2: During the operation of the power grid, detect problems such as faults or load imbalance in real time through sensors and monitoring systems. When such problems are detected, automatically initiate topology adjustment; Step 3: After a problem occurs, quickly locate the damaged area, repair the damaged area and adjust the energy flow to restore the normal operation of the power grid; During the process of repairing the damaged area and adjusting the energy flow, use an improved mixed-integer linear programming model to coordinate maintenance and energy flow, and optimize to reduce the repair time and cost.
2. A multi - microgrid topology optimization method based on a matrix - based differential evolution algorithm according to claim 1, characterized in that The generation of the basic topology matrix of the power grid and the preliminary optimization through the differential evolution algorithm include the following steps: The connection relationship of the power grid is represented in matrix form. Assuming that the power grid consists of N nodes and M connecting lines, the topology of the power grid is represented by an N×N adjacency matrix A, and the element a in the adjacency matrix ij represents the connection relationship between node i and node j: Among them, if there is a direct connection between node i and node j, then a ij = 1, otherwise a ij = 0; The goals of the preliminary power grid optimization include: Optimal connectivity: Ensure that all nodes of each microgrid can be topologically connected reasonably; Load balancing: Avoid overloading or power shortage of some nodes by adjusting the topology structure; System recovery time: Be able to quickly return to a stable operating state after a power grid fault; Energy loss: Minimize the energy loss in the power grid and optimize the transmission path; The optimization objective function is: F(A) = w1f1(A) + w2f2(A) + w3f3(A) + w4f4(A) Where, f1(A) is the connectivity metric function, representing the connectivity of the topology, f2(A) is the load balancing metric function, measuring the uniformity of the load of each node, f3(A) is the recovery time function, measuring the time from fault to recovery of the system, f4(A) is the energy loss function, measuring the total energy loss during the operation of the power grid, and w1, w2, w3, w4 are weight coefficients used to balance the influence of different objectives; The improved differential evolution algorithm includes the following steps: Step 101: Initialize each individual in the population as a random power grid topology matrix A, and each individual represents a possible power grid topology solution; Step 102: For each individual, use F(A) to evaluate its performance. An individual with a higher fitness indicates that the power grid performs better in each objective under the current power grid topology; Step 103, for each individual A in the population i , generate a mutant individual V according to the differential evolution strategy i : V i = A r + F·(A p - A q ) Among them, A r , A p , A q are three random individuals in the population, and F is the scaling factor that controls the mutation step size; Step 104, by selecting genes from the original individual A i and the mutant individual V i to generate the crossover individual C i , cross is the generation operation for the crossover individual: C i = cross(A i , V i ) Step 105, select a new generation of individuals according to F(A). If the fitness of the crossover individual C i is better than that of the original individual A i , then replace the original individual: Repeat the above steps 103 to 105 until the preset termination condition is met, that is, the fitness converges to a specified threshold or the number of iterations reaches the threshold.
3. A multi - microgrid topology optimization method based on a matrix - based differential evolution algorithm according to claim 2, characterized in that, The connectivity metric function is used to calculate the shortest path between each node and other nodes to ensure the full connectivity of the power grid, and the sum of the shortest paths is used as the connectivity index: Where, dist(i,j) is the shortest path from node i to node j; The load balancing metric function evaluates the load balancing performance based on the load distribution. Assume that the load of each node is L i , and the load balancing metric is the variance of the loads of all nodes: Among them, is the mean value of the load; The recovery time function is the time from fault to normal operation, which is calculated by simulating the repair time after a fault occurs. The recovery time function is expressed as: Where, repair_time(k) is the time required to repair the kth line, and K is all the line values in the fault; The energy loss function is estimated by the power flow of each line in the power grid and the impedance of the line: Among them, P ij is the power flow of the line from node i to node j, and R ij is the resistance of the line.
4. A multi - microgrid topology optimization method based on a matrix - based differential evolution algorithm according to claim 2, characterized in that, The problems of detecting faults or load imbalance conditions include voltage deviation detection, load imbalance detection, and abnormal power flow detection. For the voltage deviation detection, when the voltage of a node exceeds the normal range, it is considered that the node has a fault or imbalance. For the load imbalance detection, by comparing the differences between the loads of each node and the expected loads, the load imbalance area is detected. For the abnormal power flow detection, by calculating the differences between the power flows of each line and the expected values, the abnormal power flows are detected. The topology adjustment includes the following means: Selecting a backup power source: If some nodes or lines fail, the system will select a backup power source to supplement the load in the fault area; Switching the current path: Using intelligent switching devices, the current is switched from the faulty line or node to the backup path to avoid power outage of the power grid; Adjusting the load distribution: Adjusting the load distribution of each node in the power grid to ensure load balance, and optimizing the energy flow by adjusting the topology structure so that the nodes with heavy loads no longer bear excessive loads; After the topology reconstruction, it is necessary to recalculate the power flow in the power grid. The optimized power flow reduces energy losses and maintains the stability of the power grid.
5. A multi - microgrid topology optimization method based on a matrix - based differential evolution algorithm according to claim 4, characterized in that, The use of an improved mixed-integer linear programming model to coordinate maintenance and energy flow includes the following steps: Define the following variables: maintenance decision variable, maintenance time variable, maintenance cost variable, power flow variable, and switch operation variable. The maintenance decision variable r ij,t refers to defining the repair status of each line or component, r ij,t is a Boolean variable indicating whether line (i,j) is repaired at time t. The maintenance time variable refers to the time T repair (i,j) required to repair each line, T repair (i,j) represents the time required to repair line (i,j). The maintenance cost variable refers to the cost of repairing each line, C repair (i,j) represents the cost required to repair line (i,j). The power flow variable represents the power flow P ij,t in each line of the power grid, P ij,t represents the power flow from node i to node j. The switch operation variable s ij,t indicates whether it is necessary to operate the switches of the power grid to reconfigure the topology after a fault occurs: The objective function is expressed as: where: w 11 , w 12 , w 13 are weight coefficients used to balance the impacts of repair cost, repair time, and energy loss, and P ij,t R ij is the product of the power flow and the line resistance, representing the energy loss; The constraint conditions are defined: Maintenance time constraint: The time to repair each line cannot exceed the given maximum repair time. Among them, T max is the maximum repair time for each line; Maintenance resource constraint: The number of maintenance teams available in the system is limited, so only a limited number of maintenance tasks can be arranged at each moment. Among them, R max is the maximum number of maintenance teams; Switch operation constraint: The topology reconstruction of the power grid needs to be based on switch operations. At each moment, the switch operations must meet the physical constraints of the system, and the current does not exceed the maximum carrying capacity of the line. Among them, P max is the maximum power carrying capacity of the line; Power flow balance constraint: Each node in the power grid must meet the power balance constraint to ensure the balance of all incoming and outgoing powers. where L i is the load demand of node i; Power grid connectivity constraint: When a line fails, the system restores the connectivity of the power grid through switch operations. If line (i,j) fails, the switch operations must ensure the connectivity of the power grid. s ij,t = 1 if r ij,t = 1 This means that if line (i,j) is repaired, the switch of this line must be closed. Using an optimization solver to solve the improved mixed-integer linear programming model to obtain the optimal solution, including the repair time, repair order, switch operations, and power flow of each line. Performing repairs and topology adjustment, according to the optimization results, coordinating the maintenance teams to perform repairs, and at the same time adjusting the power grid topology through switch operations to restore the normal operation of the power grid. During the repair process, continuously monitor the power grid status, and adjust the repair plan and energy flow in real time to ensure the efficiency of the power grid restoration.
6. A multi - microgrid topology optimization method based on a matrix - based differential evolution algorithm according to claim 5, characterized in that The use of an improved mixed-integer linear programming model to coordinate maintenance and energy flow includes the following steps: Initialize the power grid topology matrix A. According to the status and topology of the existing power grid, initialize the adjacency matrix A and the power flow matrix P; Initialize the maintenance decision variables: Set each line r ij,t as a binary variable, indicating whether the line (i, j) is repaired at time t: r ij,t ∈ {0, 1}; Initialize the objective function Z, comprehensively considering the repair cost, repair time, and power flow loss objectives; Global optimization stage: Generate an initial population randomly or based on the current power grid status. Each individual represents a possible power grid topological configuration, and each individual consists of an adjacency matrix A, a maintenance decision r ij,t and a power flow matrix P ij,t ; Calculate the fitness function: For each individual, calculate the objective function Z, which is the weighted sum of the repair cost, repair time, and energy loss target, to obtain the fitness of this individual; Selection operation: Select suitable individuals according to the fitness function to enter the next generation; Mutation and crossover operations: Generate new individuals through the differential evolution algorithm; Mutation operation: Generate a mutant individual V i : V i = A r + F·(A p - A q ) where A r , A p , A q are three randomly selected individuals, and F is the scaling factor; Crossover operation: Generate a crossover individual C i , by selecting genes from the original individuals and mutant individuals for crossover; Fitness evaluation and selection: Calculate the fitness of the new individuals, and select and retain the better individuals according to the fitness to form a new population; In the local optimization phase, based on the globally optimized solution, a heuristic search method is used to further optimize the maintenance decision r ij,t and the power flow P ij,t , by gradually adjusting the connections of the power grid, optimizing the maintenance sequence, reducing the repair time and cost; adjusting the maintenance decision and the energy flow: according to the output of the heuristic method, adjusting the maintenance sequence and the power flow to ensure the stability of the power grid during the repair process and minimizing the energy loss to the greatest extent; Integer constraint handling stage, handling integer constraints, maintaining decision variable r ij,t is a binary integer variable. The branch and bound method is used for searching. In the branching stage, the solution space is partitioned based on the current solution to generate sub-problems. In the bounding stage, the upper and lower bounds of the constraint conditions and the objective function are used to prune, excluding solutions that do not meet the conditions and narrowing the search scope to accurately solve the optimal solution: By iteratively processing integer constraints through the branch and bound method, the solution space is gradually narrowed, and finally the optimal solution that meets the integer constraints is found.
7. A multi-microgrid topology optimization method based on a matrix-based differential evolution algorithm according to claim 6, characterized in that, The heuristic search method described above further optimizes the maintenance decision r ij,t and the power flow P ij,t , including the following steps: Adjusting the repair order based on heuristic methods: Calculating the urgency of the faulty lines and calculating the weight factors of the impacts of each faulty line on the system. Among them, is the power flow of the line under normal conditions, and α, β, γ are weight coefficients; According to W ij Sort the faulty lines in descending order to form the repair priority, and sequentially select the lines with the greatest impact for priority repair; Adjust power flow optimization: Initialize the power flow optimization objective: min∑ (i,j)∈ε P ij,t R ij , where ε is the set of all available grid lines; calculate the current load imbalance, calculate the current inflow and outflow of each node, calculate the load imbalance Unbalance, if Unbalance > threshold, the power flow needs to be adjusted, and threshold represents the preset threshold; identify overloaded lines, if the power flow of a certain line (i,j) exceeds the allowable range then adjust the power distribution and transfer part of the load to other lines; power flow adjustment strategy, find alternative paths: find alternative paths that can share the load.