A multi-objective heuristic power flow equation matrix optimal block calculation method and device
The block structure of the Jacobian matrix is optimized by a multi-objective genetic annealing algorithm, which solves the problem of high resource consumption of Jacobian matrix block calculation and achieves more efficient power flow calculation.
Patent Information
- Application Number
- CN202511096171.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-08-06
AI Technical Summary
In the existing technology of large-scale power system power flow calculation, the block calculation of the Jacobian matrix consumes a lot of computing resources and storage resources, resulting in low computing efficiency.
A multi-objective genetic annealing algorithm is used to construct the optimal block model of the Jacobian matrix. With the load balance and the minimum total cost of sub-matrix calculation as the goals, the block structure of the Jacobian matrix is optimized, the number of non-zero elements is reduced, and the optimal parallel matrix block strategy is provided.
The efficiency of the power flow equation matrix decomposition is improved, the storage resource consumption is reduced, the calculation speed is accelerated, and the overall efficiency of the power flow calculation is improved.
Smart Images

Figure CN120596776B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power flow calculation, in particular to a multi-objective heuristic power flow equation matrix optimal block calculation method and device. BACKGROUND
[0002] Power flow calculation is a very important analysis and calculation of power system, which calculates electrical quantities in steady-state operation of power system, including active power, reactive power and voltage distribution in power grid, according to the wiring mode, parameters and operating conditions of power system. Power flow calculation is also the basis for system safety, stability and reliability analysis, which is used to study various problems raised in system planning and operation. For the power system in planning, through power flow calculation, it can be verified whether the proposed power system planning scheme can meet the requirements of various operating modes; for the power system in operation, through power flow calculation, it can be predicted whether various load changes and network structure changes will endanger the safety of the system, whether the voltage of all buses in the system is within the allowed range, whether various components (lines, transformers, etc.) in the system will be overloaded, and what preventive measures should be taken in advance when overloading may occur, etc.
[0003] Newton-Raphson (NR) method is a basic method for solving linear algebraic equations, which is also applied in power flow calculation. With the development of computer technology, NR power flow algorithm has become a classic algorithm in power system power flow calculation, and is still the basis of various power flow algorithms. According to the operating characteristics of distribution network, NR method constructs power flow calculation model of each node in the network, generates Jacobian matrix, and solves power flow equation by using NR method to realize the solution of distribution network power flow distribution.
[0004] The existing literature (Nwankpa C, Johnson J, Nagvajara P, et al. FPGA hardware results for power system computation [C] / / 2009 IEEE / PES Power Systems Conference and Exposition.0[2023-09-26].DOI:10.1109 / PSCE.2009.4839953.) collects real-time SCADA system network and telemetry transmission data, proposes a power flow calculation FPGA system based on Newton-Raphson method, in which the solution strategy of linear equation set is matrix LU decomposition method, PCI pipeline bus architecture is adopted, and FPGA hardware is used to reduce the pivot search time to accelerate LU decomposition.
[0005] This solution uses the NR method to solve power flow. When calculating the matrix decomposition of the sparse power flow equations, it uses the traditional LU decomposition method. Because the structure of the Jacobian matrix is not optimally partitioned, direct LU decomposition will produce a large number of non-zero elements. When the network node scale n is large, the dimension of the Jacobian matrix is 2(n-1) × 2(n-1). Since each iterative solution of the equation system requires a large number of matrix operations, it consumes a large amount of FPGA chip storage and computing resources, posing a significant challenge to both computing power and storage resources. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide a multi-objective heuristic power flow equation matrix optimal block calculation method and device, which can reduce resource consumption during matrix decomposition and speed up the efficiency of power flow equation matrix decomposition.
[0007] The technical solution adopted by the present invention to solve the technical problem is to provide a multi-objective heuristic power flow equation matrix optimal block calculation method, comprising the following steps:
[0008] With the goal of load balancing and minimizing the total cost of sub-matrix calculation, an optimal block model of the Jacobian matrix is constructed;
[0009] The objective function of the Jacobian matrix optimal block model is used as the fitness function of the multi-objective genetic annealing algorithm, and the Jacobian matrix optimal block calculation is performed to obtain the optimal block partitioning structure of the Jacobian matrix.
[0010] The objective function of the Jacobian matrix optimal block model includes a load balancing objective function and a sub-matrix calculation total cost objective function. The load balancing objective function minimizes the block weight of the maximum cost weight after the matrix is partitioned, and the sub-matrix calculation total cost objective function minimizes the total cost after the matrix is partitioned. The constraint conditions of the Jacobian matrix optimal block model include a weight balance constraint condition. The weight balance constraint condition means that the calculation weight of each sub-matrix after the matrix is partitioned does not exceed the preset maximum calculation imbalance.
[0011] The calculation process of the load balancing objective function includes:
[0012] Initialize the register that records the maximum value of the node weight in K blocks and the cumulative value register of all node weights, and repeat the following process for each block:
[0013] Take out the row storage first address of the k-th block and save it to the current address register, calculate the number of nodes in the k-th block, and save it to the node number register; initialize the block node number counter and the block node weight accumulation register;
[0014] When the value of the node number counter is less than or equal to the value in the node number register, the following process is repeated: the weight of the current node is taken out from the node weight register at the address saved in the current address register and accumulated in the block node weight accumulation register, and the current address register and the node number counter are updated;
[0015] The value in the block node weight accumulation register is saved to the weight register of the kth node, the weight of the current node is accumulated in the accumulated value register of all node weights, and if the weight of the current node is greater than the current maximum node weight, the weight of the current node is taken as the current maximum node weight;
[0016] After the above process is performed, the average weight of the nodes is calculated;
[0017] Wherein, k = 1, 2, …, K.
[0018] The calculation process of the total cost objective function of the sub-matrix includes:
[0019] Set the Jacobian matrix row number counter to increase from 1 to 2(n-1), and repeat the following process to calculate the total cost of the Jacobian matrix:
[0020] The starting row address of the current row number is taken out from the Jacobian matrix row address pointer register and saved to the Jacobian address register;
[0021] The read signal of the synchronous dynamic random access memory is pulled high, the counter is set to cycle from 1 to 2, the data in the memory unit with the address saved in the Jacobian address register is read from the synchronous dynamic random access memory and saved to the data bus, and when the counter is 1 and 2, the data on the data bus is saved to the data value register and the column number value register of the Jacobian matrix respectively; The block number to which the row number and the column number of the current edge belong is taken out and saved to two registers respectively; Then compare to determine whether the values in the two registers are the same, if the values in the two registers are different, the current edge is a cut edge, and the cost of the current edge is accumulated in the matrix total cost accumulation register.
[0022] The judgment process of the weight balance constraint condition is:
[0023] Based on the preset maximum allowed imbalance ratio, the maximum allowed weight imbalance is calculated, and the following process is repeated for each block:
[0024] Save the weight of the current k-th block into a current weight register, judge whether the value in the current weight register satisfies the maximum allowed weight imbalance, if the value in the current weight register is greater than the maximum allowed weight imbalance, clear the weight balance constraint satisfaction indication register; wherein k = 1, 2,..., K, K is the number of blocks;
[0025] When the optimal block calculation of the Jacobian matrix is performed, the value of the weight balance constraint satisfaction indication register needs to be checked for each iteration of the generated block partition, if the value of the weight balance constraint satisfaction indication register is 1, it indicates that the current partition satisfies the constraint, if the value of the weight balance constraint satisfaction indication register is 0, it indicates that the current partition does not satisfy the weight balance constraint condition, and a new partition needs to be generated.
[0026] The target function of the optimal block model of the Jacobian matrix is used as the fitness function of the multi-objective genetic annealing algorithm, and the optimal block calculation of the Jacobian matrix is performed to obtain the optimal block partition structure of the Jacobian matrix, which specifically includes:
[0027] A random number in the range of [0, 1] is generated by using a random number generator, and for each chromosome The random number is used to generate a random number in the range of [0, 1] for each chromosome The random number is used to generate a random number in the range of [0, 1] for each chromosome All The single chromosome coding mode of variable dimension splicing is adopted, which is represented as Wherein, D represents the dimension of the problem to be solved, I represents the integer part of the solution to the problem to be solved, F represents the decimal part of the solution to the problem to be solved, Iter represents the iteration algebra;
[0028] The function value of each chromosome on the target function of the optimal block model of the Jacobian matrix is calculated to obtain Target function vectors;
[0029] The Target function vectors are respectively subjected to Pareto front calculation of each layer to obtain a set composed of individuals in the first Pareto front;
[0030] Based on the Target function vectors, a two-by-two comparison tournament method is used to select offspring chromosomes;
[0031] The selected offspring chromosomes are crossed with each other, and the gene positions to be crossed are randomly generated in the integer part and the decimal part according to each dimension, and a two-point crossover strategy is used for chromosome recombination to obtain the crossed chromosomes;
[0032] The crossed chromosomes are subjected to XOR operation with random numbers generated by a random number module to obtain candidate mutation chromosomes;
[0033] The candidate mutation chromosomes are compared with each individual in the set composed of the individuals in the first Pareto front, if the candidate mutation chromosomes are better than any individual in the set composed of the individuals in the first Pareto front, the candidate mutation chromosomes are accepted according to the Metropolis criterion, otherwise the set composed of the individuals in the first Pareto front is directly accepted.
[0034] It is judged whether the inner loop of simulated annealing is completed, if not, the selected offspring chromosomes are subjected to two-by-two crossover, otherwise it is judged whether the termination condition of the objective function of the matrix optimal block is met, if yes, the calculation result is output, otherwise the simulated annealing cooling process is performed and the step of calculating the function value of each chromosome on the objective function of the Jacobian matrix optimal block model is entered.
[0035] The candidate mutation chromosomes are accepted according to the Metropolis criterion, specifically including:
[0036] The average position of the individuals in the set composed of the individuals in the first Pareto front is calculated, and the Manhattan distance between the candidate mutation chromosomes and the average position is calculated.
[0037] The average Manhattan distance between all individuals in the next Pareto front adjacent to the candidate mutation chromosomes and all individuals corresponding thereto in the set composed of the individuals in the first Pareto front is calculated.
[0038] The value of the energy function of the candidate mutation chromosomes is calculated, a probability of accepting the mutation chromosomes and a random number are generated, and an enable signal for controlling the acceptance of the mutation chromosomes is generated when the random number is less than the probability of accepting the mutation chromosomes.
[0039] The technical scheme adopted by the present application to solve its technical problems is to provide a multi-objective heuristic power flow equation matrix optimal block calculation device, comprising:
[0040] A Jacobian matrix topology structure calculation module is used to construct a Jacobian matrix optimal block model with the objectives of load balancing and minimum total cost of sub-matrix calculation.
[0041] The multi-objective genetic annealing matrix optimal block calculation module is used for taking the objective function of the Jacobian matrix optimal block model as the fitness function of the multi-objective genetic annealing algorithm, and performing Jacobian matrix optimal block calculation to obtain the optimal block division structure of the Jacobian matrix.
[0042] The technical scheme adopted by the present application to solve its technical problems is to provide a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the multi-objective heuristic power flow equation matrix optimal block calculation method when executed by a processor.
[0043] The technical scheme adopted by the present application to solve its technical problems is to provide a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the multi-objective heuristic power flow equation matrix optimal block calculation method when executed by a processor.
[0044] Advantages
[0045] Compared with the prior art, the present application has the following advantages and positive effects: the present application takes load balancing and minimum total cost of sub-matrix calculation as the target, constructs a Jacobian matrix optimal block model, and uses a multi-objective genetic annealing algorithm to solve the Jacobian matrix optimal block model to obtain the optimal block division result of the Jacobian matrix, iteratively calculates the optimal block division structure of the Jacobian matrix according to the optimization target and constraint condition set by the Jacobian matrix optimal block model, and through this method, the number of non-zero element fillings generated when solving large-scale network sparse equations is minimized, an optimal parallel matrix block strategy is provided, storage resource consumption is reduced, the matrix decomposition time of power flow equations is accelerated, and the power flow calculation efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0046] Figure 1 is a schematic diagram of the multi-objective heuristic power flow equation matrix optimal block calculation device of the first embodiment of the present application;
[0047] Figure 2 is a schematic diagram of the Jacobian sub-matrix block storage format in the first embodiment of the present application;
[0048] Figure 3 is a flowchart of the multi-objective genetic annealing matrix optimal block calculation in the first embodiment of the present application;
[0049] Figure 4 is a schematic diagram of the chromosome coding in the first embodiment of the present application;
[0050] Figure 5 is a parallel implementation calculation flowchart framework diagram of MOGAOA in the first embodiment of the present application;
[0051] Figure 6is a flow chart of the MOFFM module in the first embodiment of the present application;
[0052] Figure 7 is a flow chart of the population Pareto front calculation in the first embodiment of the present application;
[0053] Figure 8 is a flow chart of the SM module calculation in the first embodiment of the present application;
[0054] Figure 9 is a flow chart of the CM module calculation in the first embodiment of the present application;
[0055] Figure 10 is a flow chart of the Cross submodule calculation in the first embodiment of the present application;
[0056] Figure 11 is a flow chart of the MM module calculation in the first embodiment of the present application;
[0057] Figure 12 is a flow chart of the MAM module calculation in the first embodiment of the present application;
[0058] Figure 13 is a flow chart of the MASM module calculation in the first embodiment of the present application;
[0059] Figure 14 is a flow chart of the Avg F1 submodule calculation in the first embodiment of the present application;
[0060] Figure 15 is a flow chart of the Dist F1 submodule calculation in the first embodiment of the present application;
[0061] Figure 16 is a flow chart of the Phi M submodule calculation in the first embodiment of the present application;
[0062] Figure 17 is a schematic diagram of the FPGA-based power flow stream parallel computing system in the fourth embodiment of the present application. DETAILED DESCRIPTION
[0063] The present application will be further described with specific embodiments. It should be understood that these embodiments are intended to illustrate the present application and are not intended to limit the scope of the present application. Furthermore, it should be understood that those skilled in the art can make various modifications or changes to the present application after reading the content taught in the present application, and these equivalent forms also fall within the scope of the appended claims of the present application.
[0064] The first embodiment of the present application relates to a multi-objective heuristic power flow equation matrix optimal block calculation device, as shown in Figure 1As shown, it includes a Jacobi matrix topology structure calculation module and a multi-objective genetic annealing matrix optimal block calculation module. The Jacobi matrix topology structure calculation module is used to construct a Jacobi matrix optimal block model with the load balance and the total cost of sub-matrix calculation as the goals. It provides the calculation process of the sub-matrix calculation total cost objective function and the load balance objective, as well as the constraint conditions of the maximum imbalance of load calculation; the multi-objective genetic annealing matrix optimal block calculation module is used to use the objective function of the Jacobi matrix optimal block model as the fitness function of the multi-objective genetic annealing algorithm, and perform Jacobi matrix optimal block calculation to obtain the optimal block division structure of the Jacobi matrix.
[0065] This embodiment designs a graph storage structure for the Jacobian matrix in power flow calculation. For a system with n nodes, the Jacobian matrix is an asymmetric matrix of 2×(n-1) dimensions and an undirected graph consisting of 2×(n-1) nodes. Each node in the graph is It consists of PQ nodes and PV nodes. , the undirected graph generated by Jacobi is express, is the vertex set, , is and The set of edges consisting of the connecting edges between .
[0066] If the partial derivative between nodes i and j in the Jacobian matrix is non-zero, then and There is an edge between ,side The weight is ,set up .vertex Weight Set to the degree of node i, the degree of the node represents the connectivity between the current node and other nodes. In the Jacobian matrix optimal block method based on multi-objective genetic annealing proposed in this embodiment, the degree of Jacobian matrix node i is Equal to the number of edges connected to node i, defined as ,in, Represents all edges adjacent to node i A collection of , If the vertex and If there is an edge between ,on the contrary, .
[0067] The optimal block partition problem of the Jacobian matrix of the tide flow calculation is defined as follows: find a matrix block partition , and meet the following conditions, so that each partition part , k = 1, 2, …, K, is a non-empty subset of the vertex set V of the original Jacobian matrix, that is . Any two partition subsets are disjoint, that is , for all 1 ≤ k < l ≤ K, and the union set of all K parts is the vertex set V of the original Jacobian matrix, that is .
[0068] For the K-block partition problem of the Jacobian matrix, the optimal partition criterion is defined as follows:
[0069] (1) Balance criterion: that is .
[0070] For all k = 1, 2, …, K, where represents the sum of all vertex weights in the k-th partition sub-matrix, , represents the average weight of the node, , represents the average value of the weight of all K parts, reflecting the load balancing of the calculation of each sub-matrix of the block partition. The decomposition calculation task amount of each sub-matrix is as close as possible, so as to improve the utilization rate of system calculation resources. is the maximum allowed imbalance ratio preset, .
[0071] (2) Minimum total calculation cost criterion: if the two endpoints of an edge are located in two different partition parts, it is called a "cut edge", otherwise it is called a "non-cut edge".
[0072] The total calculation cost of the graph partition is , the total weight of the cut edge is , where the cut edge set is .
[0073] For the above two criteria, the optimal block model of the Jacobian matrix constructed by the Jacobian matrix topology structure calculation module of the embodiment can be expressed as:
[0074] Objective function 1: ;
[0075] Objective function 2: ;
[0076] Constraint condition 1: .
[0077] Objective function 1 makes the matrix block The total cost is minimized, the data dependency between sub-matrices after matrix block division and the number of non-zero elements filled in the Jacobi matrix decomposition process are reduced, and resource consumption is reduced. Objective function 2 makes the matrix block division After that, minimizing the weight of the block with the maximum cost weight can minimize the cost of each sub-matrix and ensure that the computational workload of each sub-matrix is as balanced as possible. The constraint condition is that the matrix block After that, the calculation weight of each sub-matrix cannot exceed the preset maximum calculation imbalance.
[0078] This embodiment sets a Jacobian matrix partition number register partition[31:0][2(n-1)-1:0] to indicate the block number to which each node in the matrix belongs after the Jacobian matrix is partitioned, where n represents the number of nodes. The block number of the i-th node in the Jacobian matrix is partition[i]={k|k=1,2,…,K}, where K represents the number of blocks.
[0079] The calculation process of objective function 1 is: initial matrix block Divide the Jacobian matrix into K sub-matrices, and the block of the k-th sub-matrix It is a subset of node V. The submatrix number of node i is partition[i]={k|k=1,2,…,K}. Read the Jacobian matrix data from SDRAM in sequence and add them up to get the total cost. .set up The cumulative sum counter representing the total cost of cutting edges, reads each row of the matrix from SDRAM in turn according to the process of reading and writing the Jacobian matrix in SDRAM, determines the block sub-matrix number to which the neighbor node number belongs, and saves the cost of the current node cutting edge to the cumulative sum register The specific implementation process is as follows:
[0080] Set the Jacobian matrix row number counter row_i from 1 to 2(n-1) and repeat the following process to calculate the total cost of the Jacobian matrix.
[0081] The starting row address of the current row number row_i is taken out from the Jacobian matrix row address pointer register jacoby_row_ptr and saved to the Jacobian address register jacoby_addr, jacoby_addrjacoby_row_ptr[row_i]. The SDRAM read signal R_SDRAM_sig is pulled high, R_SDRAM_sig←1, and the cnt_t counter is set to 1 and 2 synchronously, and the data at the storage unit with the address of the Jacobian address register jacoby_addr is read out from the SDRAM and saved to the data bus RW_SDRAM_data, when the cnt_t counter is 1 and 2, the bus data is saved to the Jacobian matrix data value register jacoby_data and the column number value register jacoby_col respectively, RW_SDRAM_data←read_SDRAM[jacoby_addr], that is, jacoby_data←RW_SDRAM_data when cnt_t=1, and jacoby_col←RW_SDRAM_data when cnt_t=2. The block number to which the current edge two-end row number row_i and column number jacoby_col belong is taken out and saved to the registers and , that is , . Then the values of the registers and are compared to determine whether they belong to different partitions, if ≠ , the current edge is a cut edge, and the cost of the current edge is added to the matrix total cost accumulation sum register , that is .
[0082] As shown in Figure 2 , it is a Jacobian submatrix block storage format. For the matrix block , a row compression linear storage structure is designed to represent the node number and weight in each sub-block, the block row address pointer register p_row_ptr[31:0][K-1:0] stores the starting storage address of each divided sub-block , the weight register p_weight[31:0][n-1:0] stores the weight of each node, and the number register p_data[31:0][n-1:0] stores the block number to which each node belongs, where n is the number of nodes.
[0083] The calculation flow of the objective function 2 is as follows:
[0084] Initialize the maximum weight of nodes in the K blocks register max_w_p and the sum of all node weights register w_sum_node, i.e., max_w_p 0, w_sum_node 0. For the k-th block with block number k = 1, 2, …, K, repeat the following process in sequence:
[0085] Take the row storage starting address of the k-th block and save it to the current address register current_p_addr, i.e., current_p_addr p_row_ptr[k], calculate the number of nodes in the k-th block and save it to the p_num_node register, p_num_node p_row_ptr[k+1] - p_row_ptr[k]. Initialize the block node number counter cnt_p and the block node weight sum register w_sum_p, i.e., cnt_p 0, w_sum_p 0.
[0086] When the node number counter cnt_p is less than or equal to the number of nodes in the k-th block, i.e., the value of the node number counter is less than or equal to the value of the node number register, repeat the following process: take the weight of the current node from the node weight register p_weight at the current address register curren_p_addr and accumulate it in the block node weight sum register w_sum_p, i.e., w_sum_p w_sum_p + p_weight[curren_p_addr], update the current address register curren_p_addr and the node number counter cnt_p, i.e., curren_p_addr curren_p_addr + 1, cnt_p cnt_p + 1.
[0087] Then, save the value in the block node weight sum register w_sum_p to the weight register weight_p of the k-th node, i.e., weight_p[k] w_sum_p, and then accumulate the weight w_sum_p of the current node in the sum of all node weights register w_sum_node, i.e., w_sum_node w_sum_node + w_sum_p. If the value in the block node weight sum register w_sum_p is greater than the value in the current node weight maximum value register max_w_p, save the value in the block node weight sum register w_sum_p to the node weight maximum value register max_w_p, i.e., max_w_p w_sum_p.
[0088] After all the blocks have completed the above process, calculate the average weight of the nodes , i.e., .
[0089] The above two processes calculate the objective function 1 and the objective function 2 respectively, and in the calculation of the optimal block of the Jacobian matrix, the constraint condition 1 needs to be maintained. The judgment process of the constraint condition 1 is as follows:
[0090] Setting the maximum allowable imbalance ratio to 1.5;
[0091] Setting the weight balance constraint satisfaction indication register satisfy_w_balance to 1;
[0092] Calculating the maximum allowable weight imbalance max_w← For the block k = 1, 2, …, K, the following process is repeatedly executed in sequence:
[0093] The weight of the current kth block is saved to the current weight register current_weight_p, that is, current_weight_p←weight[k], and it is judged whether the current block weight current_weight_p satisfies the maximum allowable weight imbalance max_w. If the value in the current weight register current_weight_p is greater than the maximum allowable weight imbalance max_w, the weight balance constraint satisfaction indication register is cleared, that is, satisfy_w_balance←0.
[0094] When the optimal block of the Jacobian matrix is calculated, the block division generated by each iteration needs to check the value in the weight balance constraint satisfaction indication register satisfy_w_balance. If the value in the satisfaction indication register satisfy_w_balance is 1, it means that the current partition satisfies the constraint, and the iteration calculation can continue. If the value in the satisfaction indication register satisfy_w_balance is 0, it means that the current partition does not satisfy the weight balance constraint condition, and a new partition needs to be generated.
[0095] The multi-objective genetic annealing matrix optimal block calculation module in the embodiment adopts a heuristic method, which can make the Jacobian matrix start from an initial random block , and finally give the optimal block structure of the Jacobian matrix after algorithm optimization iteration .
[0096] The heuristic method is a multi-objective genetic annealing algorithm, and its implementation process is as shown in Figure 3 , and the specific steps are as follows:
[0097] Step 1: Perform chromosome coding. Considering the feasibility and efficiency of FPGA hardware implementation, a fixed-point decimal representation method is adopted, such asFigure 4 As shown in the figure, the specific approach is to solve the problem Dimensional variables are encoded continuously, and each dimension contains an H-bit integer part and an L-bit decimal part. Dimension variables have a total Bit by bit.
[0098] Step 2: Initialize the population ,individual Expressed as , initial temperature , the number of inner loops , the maximum number of iterations of the inner loop , mutation probability , cooling rate , population iteration algebra .
[0099] Step 3: For each individual , , calculate individual Function values on each target , forming a set of mapping values of the population on the objective function .
[0100] Step 4: Generally, the closer the solution is to the Pareto frontier, the greater the effect on population evolution. Considering the efficiency of calculation and the complexity of hardware circuit implementation, only the frontier is calculated. Pareto frontier, calculate the population objective function value set The Pareto frontier sequence of each layer , .
[0101] Step 5: Use the tournament method of pairwise comparison to calculate the chromosomes of offspring in the population For individuals and , the objective function value is and ,like ,but Entering the offspring population, if and If they are not mutually dominant, the winner is randomly selected.
[0102] Step 6: Enter the inner loop of the simulated annealing method, first perform the crossover and mutation operations of the individuals in the genetic algorithm, the crossover operator will and of The dimensional data is decomposed according to each dimension, and the gene position to be mutated is selected from the H-bit integer part and L-bit decimal part gene positions in each dimension, and then a two-point crossover operation is performed to form a new individual and ; Mutation operation according to mutation probability Select individuals to be mutated , then generate Random binary number of bits ,Will With the individual after cross Perform XOR operation to generate new individuals after mutation .
[0103] Then accept the Metropolis guidelines ,like Better than Pareto optimal frontier All individuals in , then accept Otherwise, with probability accept The Metropolis guidelines are as follows:
[0104] ;
[0105] in, The multi-objective Pareto frontier energy function is defined, which represents the generation of a new solution The change in energy after Calculate according to the following formula:
[0106] ;
[0107] here express and the optimal frontier Central location Manhattan distance. , express Middle The average position in the dimension, . The calculation is as follows:
[0108] ;
[0109] Indicates that the individual After the Frontier With the first frontier The distance metric function between . , for All solutions in and The average Manhattan distance of the corresponding recent solution , The average Manhattan distance of the corresponding recent solution
[0110] .
[0111] Step 7: judge whether the inner loop of simulated annealing is completed, if yes, go to step 8, otherwise go to step 6. Step 8: judge whether the outer loop termination condition is met, if yes, output the calculation result; otherwise, go through the simulated annealing cooling process, and go to step 3.
[0113] As shown in FIG. 1, the multi-objective genetic annealing matrix optimal block calculation module in the embodiment includes a population initialization module PIM, a multi-objective fitness function calculation module MOFFM, a Pareto front calculation module PFM, a selection module SM, a crossover module CM, a mutation module MM, a Metropolis acceptance module MAM, and a loop control module CCM. In the FPGA hardware circuit implementation, each module concurrently performs numerical calculation operations for each chromosome under the logical strategy control of the loop control module CCM. The specific process is as follows: Figure 5 First, according to the solution accuracy of the multi-objective optimization problem to be solved, the integer and decimal digits of the fixed-point decimal are determined, and the integer part is represented by
[0114] and the decimal part is represented by The population initialization unit PIM generates random numbers in the range of using a random number generator. As shown in FIG. 2, for a chromosome , a single chromosome coding mode of splicing all dimensional variable dimensions is adopted, and is represented as Figure 4 , where represents the dimension of the problem to be solved, is the integer part of the solution to the problem to be solved, is the decimal part of the solution to the problem to be solved, represents the iteration algebra. Next, all chromosomes are sorted in ascending order according to the fitness value, and the chromosome with the minimum fitness value is selected as the initial Pareto front.
[0115] Then, the Metropolis acceptance module MAM judges whether the initial Pareto front is accepted, and if not, the mutation module MM performs mutation operations on the initial Pareto front to generate a new Pareto front. After that, the selection module SM selects chromosomes from the new Pareto front according to the selection probability, and the crossover module CM performs crossover operations on the selected chromosomes to generate a new population. Finally, the Metropolis acceptance module MAM judges whether the new population is accepted, and if not, the mutation module MM performs mutation operations on the new population to generate a new population.At the same time, they are sent to the multi-objective fitness function calculation unit MOFFM respectively, and the function value of each chromosome on the objective function of the Jacobian matrix optimal block model is calculated by the multi-objective fitness function calculation unit MOFFM, that is, the function values of objective function 1 and objective function 2 are calculated, and then the function values of objective function 1 and objective function 2 are combined to obtain indivual dimensional objective function vector.
[0116] like Figure 6 As shown in the figure, the solution process of the multi-objective fitness function calculation unit MOFFM is as follows: the Split MOFFM module According to the dimension of problem variables Decompose into , and sent to the OFMK LUT unit for lookup table operation to calculate the function value on each target arrive , and then the concatenation module Concat MOFFM is used to perform bitwise combination of multiple objective function values to generate .
[0117] Then, indivual dimensional objective function vector arrive , and sent to the Pareto frontier calculation unit PFM at the same time. The Pareto frontier calculation unit PFM performs Pareto frontier calculations on the objective function vector at each layer. Considering the efficiency of FPGA hardware implementation, the frontier is calculated. The set of individuals on the Pareto frontier, ,here express The selection vector of individuals is 1, which means that the chromosome with the number is in the set of the i-th Pareto frontier. The set of individuals in the Pareto frontier is sent to the Metropolis criterion acceptance unit MAM to prepare for the calculation of acceptance probability in the subsequent simulated annealing process.
[0118] like Figure 7 As shown in the figure, the calculation process of the Pareto frontier calculation unit PFM is as follows: The multi-objective Pareto frontier calculation modules PFCM receive the remaining individual selection vector signals required to calculate the i-th frontier according to the process , calculate the optimal frontier hour, The initial signal is , indicating that all chromosomes are Pareto frontier surfaces Candidate solution, when the i-th frontier is calculated After that, it is necessary to remove the individuals that have been included in the frontier from the candidate solution set and calculate the Frontier When all the frontier solutions calculated before are needed 、 、…、 At the same time, it is sent to the AND gate to obtain the selection signal And send it to PFCM modules port, and finally find The individual number vector of the Pareto frontier. The P_ID port of the PFCM module indicates the number position of the candidate chromosome number sent to the module in the original population, and the candidate solution set signal of the i-th PFCM module Through the P_ID module, it is calculated And send it to the P_ID port.
[0119] Afterwards, the selection unit SM receives input from the population initialization unit PIM and the multi-objective fitness function unit MOFFM, and selects the offspring chromosomes using a pairwise comparison tournament method. arrive The calculation process of the selection unit SM is as follows Figure 8 As shown, the individual fitness value vector arrive First send them to two multiplexers respectively, and then and The random number generated is selected, and the number of random digits is And take the maximum value as N, select two individuals to be compared and , for the minimization optimization goal, generate the chip select signal of the winning individual And send it to the two-way selector to select the winning random number chip select signal , and then sent to the N-way individual selector to finally select the winning individual .
[0120] Then, the offspring chromosomes calculated by the selection unit SM are crossed in pairs through the crossover unit CM. The gene positions to be crossed are randomly generated at the integer and decimal positions according to each dimension, and the chromosome recombination is performed using the two-point crossover strategy. Figure 9 As shown, first and Perform splitting operations according to variable dimensions respectively, with a total of Cross-modules, Submodule calculation Cross-operation on dimensions forms and ,Will All chromosomes after crossover in the dimension are then sent to the splicing module and , and finally get the chromosome after crossover and , and then sent to the mutation unit MM block for mutation operation.
[0121] The submodule performs a two-point crossover operation in each dimension, such as Figure 10 As shown, a vector with both H and L bits set to 1 is generated, and then the integer part is shifted right by 1 to H, and the decimal part is shifted left by 1 to L. The shifted vectors are sent to two multiplexers at the same time, and the random number module and The number of bits generated is and The random number, and take the maximum value of H and L, select the random cross vector and , and then sent to the Concat HL module for bit splicing operation to form a chromosome cross vector , the other way is sent to the NOT gate to form , and The vector and Cross the integer and decimal parts respectively, and finally form the The vector after the cross in the dimension and .
[0122] In this embodiment, each mutation unit module MM is generated by a random number module. Generate random numbers ,and Perform an XOR operation, , is a candidate mutation chromosome. Random number module Generate random numbers and mutation probability Compare and generate chromosome variation enabling signals If the mutation condition is met, the chromosome is randomly mutated, otherwise the original chromosome remains unchanged, and the output is finally generated. ,like Figure 11 shown.
[0123] After that, Metropolis acceptance unit MAM is responsible for judging the energy function increment of each chromosome generated by the inner loop crossover and mutation operation, as shown in Figure 12 . The generated candidate solution is compared with other solutions in the Pareto optimal front to determine whether it is superior to them, and each solution in the front is compared with the candidate solution to determine whether it is superior to the candidate solution, and the corresponding enable signal is output. If is not true for all , then the candidate solution is directly accepted ; otherwise, the candidate solution is accepted according to the Metropolis criterion . The enable signals are simultaneously sent to the NOR module for OR operation, and the output is the enable signal , which is sent to the two-way selector module. The module D0 is the crossover and mutation candidate solution, and D1 is the solution calculated by the Metropolis acceptance unit MASM . This step finally outputs the optimal solution selected by the inner loop in a probabilistic manner at temperature T .
[0124] The calculation process of the Metropolis acceptance unit MASM is shown in Figure 13 . This module includes five sub-modules: front average position Avg F1, distance from the front average position distance Dist F1, candidate solution , adjacent next front , and distance Phi M, energy function Delta E, and exponential function Exp.
[0125] First, the average position of the individuals in the Pareto front is calculated by the Avg F1 module (i.e., the first calculation sub-unit) . Then, the Manhattan distance between the candidate solution and is calculated by the Dist F1 module (i.e., the second calculation sub-unit) . The Phi M module (i.e., the third calculation sub-unit) calculates the average Manhattan distance between the candidate solution and all solutions in the adjacent next Pareto front , and the corresponding nearest solution in , and outputs The value of the candidate solution energy function is then calculated by the Delta E module (i.e. the fourth calculation) The probability of accepting the candidate solution is then generated by the Exp module The random number generating module generates a random number The probability is compared with the random number When the random number is less than the probability , an enable signal is generated to control the acceptance of the candidate solution .
[0126] The Avg F1 submodule, as shown in Figure 14 , decomposes all individuals in the front face into to respectively according to each dimension to generate to sub-dimensional vectors, which are sequentially sent into the addition module Add and the division module Divd in each dimension respectively to obtain the average position vector in each dimension , and finally the average position vector of the front face is obtained by the module. .
[0127] Figure 15 The Dist F1 submodule, as shown in , decomposes the average positions of the candidate solution and according to each dimension, and then calculates the Manhattan distance between and in each dimension, and finally the is calculated by the Man Dist module.
[0128] Figure 16 The Phi M submodule, as shown in , calculates the nearest Manhattan distance from the individual to the front face by the Min Dist module, and then calculates the average distance . The energy function Delta E and the exponential function Exp submodule are look-up table functions.
[0129] Finally, the loop control unit CCM is responsible for the clock control, logic control, inner loop and outer loop termination conditions of the simulated annealing of the entire matrix optimal block hardware circuit. First, it is determined whether the simulated annealing inner loop is completed. If If yes, then If yes, then turn into the cross unit CM; otherwise, enter the outer loop termination condition judgment, if the matrix optimal block termination condition of the objective function is met, the calculation result is output, otherwise the simulated annealing cooling process is carried out, and the formula is obtained. If yes, then turn into the cross unit CM; otherwise, enter the outer loop termination condition judgment, if the matrix optimal block termination of the objective function is met, the calculation result is output, otherwise the simulated annealing cooling process is carried out, and the formula is obtained.
[0130] It can be found that the present application adopts a double-layer calculation framework, the upper layer designs a graph storage structure of the Jacobian matrix, is responsible for the calculation flow of the total cost objective, the load balance objective and the maximum imbalance constraint of the submatrix, and the lower layer designs a multi-objective genetic annealing Jacobian matrix optimal block division calculation flow, iteratively calculates the optimal block division structure of the Jacobian matrix according to the optimization objective and the constraint condition set by the upper layer, the method can minimize the number of non-zero element filling when solving a large-scale network sparse equation set, provides an optimal parallel matrix block strategy, reduces storage resource consumption, speeds up the matrix decomposition time of the power flow equation, and improves the power flow calculation efficiency.
[0131] The second embodiment of the present application relates to a multi-objective heuristic power flow equation matrix optimal block calculation method, comprising the following steps:
[0132] A Jacobian matrix optimal block model is constructed with the load balance and the minimum total cost of the submatrix calculation as the objective.
[0133] The objective function of the Jacobian matrix optimal block model is used as the fitness function of the multi-objective genetic annealing algorithm, and the Jacobian matrix optimal block calculation is carried out to obtain the optimal block division structure of the Jacobian matrix.
[0134] The objective function of the Jacobian matrix optimal block model includes a load balance objective function and a total cost objective function of the submatrix calculation, the load balance objective function minimizes the block weight of the maximum cost weight after matrix block, and the total cost objective function of the submatrix calculation minimizes the total cost after matrix block; the constraint condition of the Jacobian matrix optimal block model includes a weight balance constraint condition, and the weight balance constraint condition refers to that the calculation weight of each submatrix after matrix block does not exceed the maximum calculation imbalance degree set in advance.
[0135] The calculation flow of the load balance objective function includes:
[0136] The K block node weight maximum register and the cumulative value register of all node weights are initialized and set, and the following flow is repeatedly executed for each block:
[0137] The row storage start address of the kth block is taken out and saved to a current address register, the number of nodes of the kth block is calculated and saved to a node number register; a block node number counter and a block node weight accumulation sum register are initialized;
[0138] When the value of the node number counter is less than or equal to the value in the node number register, the following process is repeatedly executed: the weight of the current node is taken out from the node weight register at the address saved in the current address register and accumulated in the block node weight accumulation sum register, and the current address register and the node number counter are updated;
[0139] The value in the block node weight accumulation sum register is saved to the weight register of the kth node, and the weight of the current node is accumulated in the accumulated value register of all node weights; if the weight of the current node is greater than the current maximum node weight, the weight of the current node is taken as the current maximum node weight;
[0140] After the above process is executed, the average weight of the node is calculated;
[0141] Wherein, k = 1, 2,..., K.
[0142] The calculation process of the total cost objective function of the sub-matrix includes:
[0143] The row number counter of the Jacobian matrix is set to increase from 1 to 2(n-1), and the following process is repeatedly executed to calculate the total cost of the Jacobian matrix:
[0144] The start row address of the current row number is taken out from the Jacobian matrix row address pointer register and saved to the Jacobian address register;
[0145] The read signal of the synchronous dynamic random access memory is pulled high, and the counter is set to cycle from 1 to 2, the data in the storage unit with the address in the Jacobian address register is read from the synchronous dynamic random access memory and saved to the data bus, and when the counter is 1 and 2, the data on the data bus is saved to the data value register and the column number value register of the Jacobian matrix respectively; the block number to which the row number and the column number of the current edge belong are taken out and saved to two registers respectively; then it is compared and judged whether the values in the two registers are the same, if the values in the two registers are different, the current edge is a cut edge, and the cost of the current edge is accumulated in the matrix total cost accumulation sum register.
[0146] The judgment process of the weight balance constraint condition is:
[0147] Based on the preset maximum allowed imbalance ratio, the maximum allowed weight imbalance is calculated, and the following process is repeatedly executed for each block:
[0148] Save the weight of the current k-th block to the current weight register, and determine whether the value in the current weight register satisfies the maximum allowable weight imbalance. If the value in the current weight register is greater than the maximum allowable weight imbalance, clear the weight balance constraint satisfaction indication register; where k = 1, 2, ..., K, where K is the number of blocks;
[0149] When performing the optimal block calculation of the Jacobian matrix, the block division generated by each iteration needs to check the value of the weight balance constraint satisfaction indication register. If the value of the weight balance constraint satisfaction indication register is 1, it means that the current partition meets the constraint. If the value of the weight balance constraint satisfaction indication register is zero, it means that the current partition does not meet the weight balance constraint and a new partition needs to be regenerated.
[0150] The objective function of the Jacobian matrix optimal block model is used as the fitness function of the multi-objective genetic annealing algorithm, and the Jacobian matrix optimal block calculation is performed to obtain the optimal block partition structure of the Jacobian matrix, specifically including:
[0151] Generate using a random number generator indivual Random numbers in the range, for chromosomes Use all The single chromosome encoding mode of dimensional variable dimensional splicing is expressed as ,in, represents the dimension of the problem to be solved, is the integer part of the solution to the problem to be solved, is the fractional part of the solution to the problem to be solved, represents the algebra of iterations;
[0152] Calculate the function value of each chromosome on the objective function of the Jacobian matrix optimal block model and obtain objective function vector;
[0153] Regarding the The objective function vector is used to calculate the Pareto frontier of each layer. The set of individuals on the Pareto frontier;
[0154] Based on the The offspring chromosomes are selected by using a tournament method of pairwise comparison of the objective function vectors;
[0155] The selected offspring chromosomes are crossed in pairs, and the gene positions to be crossed are randomly generated at the integer and decimal positions according to each dimension. The chromosomes are recombined using a two-point crossover strategy to obtain the crossover chromosomes;
[0156] Perform an XOR operation on the crossover chromosome and the random number generated by the random number module to obtain the candidate mutant chromosome;
[0157] The candidate variant chromosome is compared with the Each individual in the set of individuals on the Pareto frontier is compared. If the candidate mutant chromosome is better than the previous For any individual in the set of individuals on the Pareto frontier, the candidate mutant chromosome is accepted according to the Metropolis criterion, otherwise the front is directly accepted. The set of individuals on the Pareto frontier;
[0158] Determine whether the simulated annealing inner loop is completed. If the preset number of iterations has not been reached, proceed to the step of performing pairwise crossover on the selected offspring chromosomes. Otherwise, determine whether the termination condition of the objective function of the optimal matrix partitioning is met. If so, output the calculation result. Otherwise, perform the simulated annealing cooling process and proceed to the step of calculating the function value of each chromosome on the objective function of the Jacobian matrix optimal partitioning model.
[0159] The candidate variant chromosomes accepted according to the Metropolis criteria specifically include:
[0160] Before calculation The average individual position of the set of individuals in the Pareto front surface, and calculate the Manhattan distance between the candidate variant chromosome and the average individual position;
[0161] Calculate the relationship between all individuals in the next Pareto front adjacent to the candidate mutation chromosome and the previous one. The average Manhattan distance of all corresponding individuals in the set of individuals in the Pareto front surface;
[0162] The value of the energy function of the candidate mutant chromosome is calculated, and a probability of accepting the mutant chromosome and a random number are generated. When the random number is less than the probability of accepting the mutant chromosome, an enable signal for controlling the acceptance of the mutant chromosome is generated.
[0163] A third embodiment of the present invention relates to a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the multi-objective heuristic power flow equation matrix optimal block calculation method of the second embodiment are implemented.
[0164] The fourth embodiment of the present invention relates to a power flow parallel computing system based on FPGA, such as Figure 17 As shown, it includes a multi-objective heuristic power flow equation matrix optimal block calculation device according to the first embodiment.
[0165] Those skilled in the art will appreciate that embodiments of the application can be readily used as a method, apparatus, or computer program product. Accordingly, the application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the application can take the form of a computer program product on one or more computer readable storage media (including, but not limited to, magnetic disks under a
[0166] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing each block of the flowchart
[0167] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing each block of the flowchart
[0168] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing each block of the flowchart
[0169] The application described herein is to be considered merely as illustrative of the principles of the application and is not to be limitative of the application. Any variations and modifications of the application will be readily apparent to those skilled in the art. Accordingly, the scope of the application is to be limited only by the scope of the claims.
Claims
1. A multi-objective heuristic power flow equation matrix optimal block calculation method, characterized by: The following steps are involved: With the goal of load balancing and minimizing the total cost of sub-matrix calculation, an optimal block model of the Jacobian matrix is constructed; The objective function of the Jacobian matrix optimal block model is used as the fitness function of the multi-objective genetic annealing algorithm, and the Jacobian matrix optimal block calculation is performed to obtain the optimal block partition structure of the Jacobian matrix, which specifically includes: Generate using a random number generator indivual Random numbers in the range, for chromosomes Use all The single chromosome encoding mode of dimensional variable dimensional splicing is expressed as ,in, represents the dimension of the problem to be solved, is the integer part of the solution to the problem to be solved, is the fractional part of the solution to the problem to be solved, represents the algebra of iterations; Calculate the function value of each chromosome on the objective function of the Jacobian matrix optimal block model and obtain objective function vector; Regarding the The objective function vectors are used to calculate the Pareto frontier of each layer respectively to obtain the front The set of individuals on the Pareto frontier; Based on the The offspring chromosomes are selected by using a tournament method of pairwise comparison of the objective function vectors; The selected offspring chromosomes are crossed in pairs, and the gene positions to be crossed are randomly generated at the integer and decimal positions according to each dimension. The chromosomes are recombined using a two-point crossover strategy to obtain the crossover chromosomes; Perform an XOR operation on the crossover chromosome and the random number generated by the random number module to obtain the candidate mutant chromosome; The candidate variant chromosome is compared with the Each individual in the set of individuals on the Pareto frontier is compared. If the candidate mutant chromosome is better than the previous For any individual in the set of individuals on the Pareto frontier, the candidate mutant chromosome is accepted according to the Metropolis criterion, otherwise the front is directly accepted. The set of individuals on the Pareto frontier; Determine whether the simulated annealing inner loop is completed. If the preset number of iterations has not been reached, proceed to the step of performing pairwise crossover on the selected offspring chromosomes. Otherwise, determine whether the termination condition of the objective function of the optimal matrix partitioning is met. If so, output the calculation result. Otherwise, perform the simulated annealing cooling process and proceed to the step of calculating the function value of each chromosome on the objective function of the Jacobian matrix optimal partitioning model.
2. The multi-objective heuristic power flow equation matrix optimal block calculation method according to claim 1 is characterized in that: The objective function of the Jacobian matrix optimal block model includes a load balancing objective function and a sub-matrix calculation total cost objective function. The load balancing objective function minimizes the block weight of the maximum cost weight after the matrix is partitioned, and the sub-matrix calculation total cost objective function minimizes the total cost after the matrix is partitioned. The constraint conditions of the Jacobian matrix optimal block model include a weight balance constraint condition. The weight balance constraint condition means that the calculation weight of each sub-matrix after the matrix is partitioned does not exceed the preset maximum calculation imbalance.
3. The multi-objective heuristic power flow equation matrix optimal block calculation method according to claim 2 is characterized in that: The calculation process of the load balancing objective function includes: Initialize the register that records the maximum value of the node weight in K blocks and the cumulative value register of all node weights, and repeat the following process for each block: Take out the row storage first address of the k-th block and save it to the current address register, calculate the number of nodes in the k-th block, and save it to the node number register; initialize the block node number counter and the block node weight accumulation register; When the value of the node number counter is less than or equal to the value in the node number register, the following process is repeated: the weight of the current node is taken from the node weight register at the address saved in the current address register, and is accumulated into the block node weight accumulation register, and the current address register and the node number counter are updated; Save the value in the block node weight accumulation register to the weight register of the kth node, and add the weight of the current node to the accumulated value register of all node weights; if the weight of the current node is greater than the current maximum node weight, then use the weight of the current node as the current maximum node weight; After executing the above process, calculate the average weight of the node; Where k=1,2,...,K.
4. The multi-objective heuristic power flow equation matrix optimal block calculation method according to claim 2 is characterized in that: The calculation process of the sub-matrix total cost objective function includes: Set the Jacobian matrix row number counter from 1 to 2(n-1) and repeat the following process to calculate the total cost of the Jacobian matrix: Get the starting row address of the current row number from the Jacobi matrix row address pointer register and save it to the Jacobi address register; Pull up the read signal of the synchronous dynamic random access memory, synchronously set the counter to count from 1 to 2 in a loop, read out data from the storage unit whose address is the Jacobi address register in the synchronous dynamic random access memory, and save it to the data bus. When the counter is 1 and 2, save the data on the data bus to the data value register and column number value register of the Jacobi matrix respectively; take out the block number to which the row number and column number at both ends of the current edge belong, and save them to two registers respectively; then compare and determine whether the values in the two registers are the same. If the values in the two registers are different, the current edge is a cut edge, and the cost of the current edge is accumulated to the matrix total cost accumulation register.
5. The multi-objective heuristic power flow equation matrix optimal block calculation method according to claim 2 is characterized in that: The judgment process of the weight balance constraint condition is as follows: The maximum allowable weight imbalance is calculated based on the preset maximum allowable imbalance ratio, and the following process is repeated for each block: Save the weight of the current k-th block to the current weight register, and determine whether the value in the current weight register satisfies the maximum allowable weight imbalance. If the value in the current weight register is greater than the maximum allowable weight imbalance, clear the weight balance constraint satisfaction indication register; where k = 1, 2, ..., K, where K is the number of blocks; When performing the optimal block calculation of the Jacobian matrix, the block division generated by each iteration needs to check the value of the weight balance constraint satisfaction indication register. If the value of the weight balance constraint satisfaction indication register is 1, it means that the current partition meets the constraint. If the value of the weight balance constraint satisfaction indication register is zero, it means that the current partition does not meet the weight balance constraint and a new partition needs to be regenerated.
6. The multi-objective heuristic power flow equation matrix optimal block calculation method according to claim 1 is characterized in that: The candidate variant chromosomes accepted according to the Metropolis criteria specifically include: Before calculation The average individual position of the set of individuals in the Pareto front surface, and calculate the Manhattan distance between the candidate variant chromosome and the average individual position; Calculate the relationship between all individuals in the next Pareto front adjacent to the candidate mutation chromosome and the previous one. The average Manhattan distance of all corresponding individuals in the set of individuals in the Pareto front surface; The value of the energy function of the candidate mutant chromosome is calculated, and a probability of accepting the mutant chromosome and a random number are generated. When the random number is less than the probability of accepting the mutant chromosome, an enable signal for controlling the acceptance of the mutant chromosome is generated.
7. A multi-objective heuristic power flow equation matrix optimal block calculation device, characterized in that: include: Jacobian matrix topology calculation module, used to build the Jacobian matrix optimal block model with the goal of load balancing and minimizing the total cost of sub-matrix calculation; A multi-objective genetic annealing matrix optimal block calculation module is used to use the objective function of the Jacobian matrix optimal block model as the fitness function of the multi-objective genetic annealing algorithm, and perform Jacobian matrix optimal block calculation to obtain the optimal block partition structure of the Jacobian matrix; The multi-objective genetic annealing matrix optimal block calculation module includes: Population initialization unit, used to generate random number generators indivual Random numbers in the range, for chromosomes Use all The single chromosome encoding mode of dimensional variable dimensional splicing is expressed as ,in, represents the dimension of the problem to be solved, is the integer part of the solution to the problem to be solved, is the fractional part of the solution to the problem to be solved, represents the algebra of iterations; The multi-objective fitness function calculation unit is used to calculate the function value of each chromosome on the objective function of the Jacobian matrix optimal block model, and obtain objective function vector; Pareto frontier calculation unit, used for the The objective function vectors are used to calculate the Pareto frontier of each layer respectively to obtain the front The set of individuals on the Pareto frontier; Select a unit for The offspring chromosomes are selected by using a tournament method of pairwise comparison of the objective function vectors; The crossover unit is used to cross over the selected offspring chromosomes in pairs, randomly generate the gene positions to be crossed at the integer and decimal positions according to each dimension, and use the two-point crossover strategy to perform chromosome recombination to obtain the chromosomes after crossover; The mutation unit is used to perform an XOR operation on the crossover chromosome and the random number generated by the random number module to obtain a candidate mutation chromosome; Metropolis criterion acceptance unit is used to compare the candidate variant chromosome with the previous Each individual in the set of individuals on the Pareto frontier is compared. If the candidate mutant chromosome is better than the previous For any individual in the set of individuals on the Pareto frontier, the candidate mutant chromosome is accepted according to the Metropolis criterion, otherwise the front is directly accepted. The set of individuals on the Pareto frontier; The loop control is the same, which is used to determine whether the simulated annealing inner loop is completed. If the preset number of iterations has not been reached, the process enters the crossover unit; otherwise, it determines whether the termination condition of the objective function of the optimal matrix partitioning is met. If so, the calculation result is output. Otherwise, the simulated annealing cooling process is performed and the process enters the multi-objective fitness function calculation unit.
8. The multi-objective heuristic power flow equation matrix optimal block calculation device according to claim 7, characterized in that: The objective function of the Jacobi matrix optimal block model constructed by the Jacobi matrix topology structure calculation module includes a load balancing objective function and a sub-matrix calculation total cost objective function. The load balancing objective function minimizes the block weight of the maximum cost weight after the matrix is partitioned, and the sub-matrix calculation total cost objective function minimizes the total cost after the matrix is partitioned; the constraint conditions of the Jacobi matrix optimal block model constructed by the Jacobi matrix topology structure calculation module include a weight balance constraint condition. The weight balance constraint condition means that the calculation weight of each sub-matrix after the matrix is partitioned does not exceed the preset maximum calculation imbalance.
9. The multi-objective heuristic power flow equation matrix optimal block calculation device according to claim 8, characterized in that: The calculation process of the load balancing objective function includes: Initialize the register that records the maximum value of the node weight in K blocks and the cumulative value register of all node weights. Repeat the following process for each block: Take out the row storage first address of the k-th block and save it to the current address register, calculate the number of nodes in the k-th block, and save it to the node number register; initialize the block node number counter and the block node weight accumulation register; When the value of the node number counter is less than or equal to the value in the node number register, the following process is repeated: the weight of the current node is taken from the node weight register at the address saved in the current address register, and is accumulated into the block node weight accumulation register, and the current address register and the node number counter are updated; Save the value in the block node weight accumulation register to the weight register of the kth node, and add the weight of the current node to the accumulated value register of all node weights; if the weight of the current node is greater than the current maximum node weight, then use the weight of the current node as the current maximum node weight; After executing the above process, calculate the average weight of the node; Where k=1,2,...,K.
10. The multi-objective heuristic power flow equation matrix optimal block calculation device according to claim 8, characterized in that: The calculation process of the sub-matrix total cost objective function includes: Set the Jacobian matrix row number counter from 1 to 2(n-1) and repeat the following process to calculate the total cost of the Jacobian matrix: Get the starting row address of the current row number from the Jacobi matrix row address pointer register and save it to the Jacobi address register; Pull up the read signal of the synchronous dynamic random access memory, synchronously set the counter to count from 1 to 2 in a loop, read out data from the storage unit whose address is the Jacobi address register in the synchronous dynamic random access memory, and save it to the data bus. When the counter is 1 and 2, save the data on the data bus to the data value register and column number value register of the Jacobi matrix respectively; take out the block number to which the row number and column number at both ends of the current edge belong, and save them to two registers respectively; then compare and determine whether the values in the two registers are the same. If the values in the two registers are different, the current edge is a cut edge, and the cost of the current edge is accumulated to the matrix total cost accumulation register.
11. The multi-objective heuristic power flow equation matrix optimal block calculation device according to claim 8, characterized in that: The judgment process of the weight balance constraint condition is as follows: The maximum allowable weight imbalance is calculated based on the preset maximum allowable imbalance ratio, and the following process is repeated for each block: Save the weight of the current k-th block to the current weight register, and determine whether the value in the current weight register satisfies the maximum allowable weight imbalance. If the value in the current weight register is greater than the maximum allowable weight imbalance, clear the weight balance constraint satisfaction indication register; where k = 1, 2, ..., K, where K is the number of blocks; When performing the optimal block calculation of the Jacobian matrix, the block division generated by each iteration needs to check the value of the weight balance constraint satisfaction indication register. If the value of the weight balance constraint satisfaction indication register is 1, it means that the current partition meets the constraint. If the value of the weight balance constraint satisfaction indication register is zero, it means that the current partition does not meet the weight balance constraint and a new partition needs to be regenerated.
12. The multi-objective heuristic power flow equation matrix optimal block calculation device according to claim 7, characterized in that: The Metropolis criteria accept units including: The first calculation subunit is used to calculate the front The average position of individuals in a set of individuals on the Pareto front surface; a second calculation subunit is used to calculate the Manhattan distance between the candidate variant chromosome and the average position of the individuals; The third calculation subunit is used to calculate the relationship between all individuals in the next Pareto front adjacent to the candidate mutation chromosome and the previous one. The average Manhattan distance of all corresponding individuals in the set of individuals in the Pareto front surface; The fourth computing subunit is used to calculate the value of the energy function of the candidate mutant chromosome, and generate a probability of accepting the mutant chromosome and a random number, and when the random number is less than the probability of accepting the mutant chromosome, generate an enable signal for controlling the acceptance of the mutant chromosome.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the multi-objective heuristic power flow equation matrix optimal block calculation method as described in any one of claims 1 to 6 are implemented.
14. A FPGA-based power flow parallel computing system, characterized in that: It comprises a multi-objective heuristic power flow equation matrix optimal block calculation device as described in any one of claims 7-12.
Citation Information
Patent Citations
Krylov subspace dimensionality reduction power flow calculation solving system
CN119719586A
Matrix decomposition device and matrix decomposition method
US20190042543A1