Solving the trigonometric sparse equations of power systems: accelerators and methods

By determining the hierarchical dependencies of the triangular sparse matrix in the power system and solving it in parallel, the problem of low efficiency in solving the triangular sparse matrix is ​​solved, and more efficient power system computing is achieved.

CN116304489BActive Publication Date: 2026-04-03GLOBAL ENERGY INTERCONNECTION RES INST CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-16
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In existing power system calculations, the solution efficiency of triangular sparse matrices is low, and their sparsity properties are not effectively utilized.

Method used

By determining the hierarchical dependencies of each row node in the triangular sparse matrix, a parallel solution method is adopted, which utilizes multiple solution processing units to process row node data at different levels, thereby achieving parallel solution.

Benefits of technology

It improves the efficiency of solving trigonometric equations and enhances the speed and performance of power system calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116304489B_ABST
    Figure CN116304489B_ABST
Patent Text Reader

Abstract

This invention discloses an accelerator and method for solving triangular sparse equations in a power system. The accelerator includes a general-purpose processor and an acceleration processor. The general-purpose processor determines the level of each row node in the triangular sparse matrix according to the dependencies in the solution process, wherein higher-level row nodes depend on lower-level row nodes, and row nodes at the same level are independent of each other. The acceleration processor includes multiple solution processing units related to the solution. The acceleration processor performs a first solution on the triangular equations based on the non-zero elements of the lower-level row nodes, and performs a second solution on the triangular equations based on the non-zero elements of the higher-level row nodes and the result of the first solution. When there are multiple row nodes at the same level, the acceleration processor processes the data of different row nodes at the same level in parallel through multiple solution processing units to solve the triangular equations in parallel, thereby improving the solution efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of analytical computing technology, specifically to an accelerator and method for solving trigonometric sparse equations in a power system. Background Technology

[0002] Solving trigonometric equations is a frequent problem in power system calculations. In power system calculations, the coefficient matrix of a trigonometric equation system is typically a triangular sparse matrix, and its density is usually less than 1%.

[0003] Currently, when using computers to process large triangular sparse matrices to solve triangular equation systems, the properties of triangular sparse matrices cannot be effectively utilized, resulting in low efficiency in solving triangular equation systems. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide an accelerated method for solving triangular sparse equations of a power system, an accelerator for solving triangular sparse equations of a power system, and a computer-readable storage medium, which can improve the efficiency of solving triangular equations.

[0005] This invention provides a method for accelerating the solution of trigonometric sparse equations in a power system, the method comprising:

[0006] Based on the dependencies in the solution process, the hierarchy of each row node in the triangular sparse matrix is ​​determined, wherein higher-level row nodes depend on lower-level row nodes, and row nodes at the same level are independent of each other.

[0007] The trigonometric equations are solved in a first way based on the non-zero elements of the lower-level row nodes, and in a second way based on the non-zero elements of the higher-level row nodes and the result of the first solution. In the case where there are multiple row nodes in the same level, the data of different row nodes in the same level are processed in parallel by multiple different solution processing units to solve the trigonometric equations in parallel.

[0008] In another aspect, the present invention provides a method and apparatus for accelerating the solution of trigonometric sparse equations of a power system, wherein the acceleration processor includes:

[0009] A general-purpose processor is used to determine the level of each row node in the triangular sparse matrix according to the dependencies in the solution process, wherein higher-level row nodes depend on lower-level row nodes, and row nodes at the same level are independent of each other.

[0010] The solution acceleration processor includes multiple solution processing units related to the solution. The solution acceleration processor is used to perform a first solution on the trigonometric equation system based on the non-zero elements of the lower-level row nodes, and to perform a second solution on the trigonometric equation system based on the non-zero elements of the higher-level row nodes and the result of the first solution. In the case where there are multiple row nodes in the same level, the acceleration processor processes the data of different row nodes in the same level in parallel through the multiple solution processing units to solve the trigonometric equation system in parallel.

[0011] In another aspect, the present invention provides an accelerator for solving triangular sparse equations in a power system. The accelerator includes a general-purpose processor, a communication protocol interface, an acceleration processor, and a memory. The memory is used to store a computer program, which, when executed by the general-purpose processor and the acceleration processor, implements the method described above.

[0012] In another aspect, the present invention provides a computer-readable storage medium for storing a computer program that, when executed by a processor, implements the method described above.

[0013] In some embodiments of this application, the nodes of each row in the triangular sparse matrix are hierarchically divided according to the dependency relationship in the solution process. The higher-level row nodes depend on the lower-level row nodes, so that the triangular equation system can be solved in parallel according to the hierarchy, thereby improving the solution speed. Attached Figure Description

[0014] The features and advantages of the invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the invention in any way. In the drawings:

[0015] Figure 1 A flowchart illustrating an embodiment of the present application provides an accelerated method for solving the triangular sparse equations of a power system.

[0016] Figure 2 A schematic diagram of the hierarchy obtained after hierarchical partitioning of a triangular sparse matrix is ​​shown.

[0017] Figure 3 This illustration shows a flowchart of clustering elements in a hierarchical array according to an embodiment of this application;

[0018] Figure 4 A schematic diagram of a parallel statistical processing unit provided in one embodiment of this application is shown;

[0019] Figure 5 This illustration shows a schematic diagram of the division of the start and end positions of each level according to an embodiment of this application;

[0020] Figure 6 A schematic diagram of a parallel clustering processing unit provided in one embodiment of this application is shown;

[0021] Figure 7 A schematic diagram of a solution processing unit provided in one embodiment of this application is shown;

[0022] Figure 8 This illustration shows a schematic diagram of a statistical processing unit for the maximum number of non-zero elements provided in one embodiment of this application;

[0023] Figure 9 An embodiment of this application provides an accelerator for solving trigonometric sparse equations in a power system;

[0024] Figure 10 It shows Figure 9 The diagram shows the internal structure of the accelerator processor included in the diagram. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] The trigonometric equation system with the triangular sparse matrix as the coefficient matrix can be represented by the expression (1):

[0027] Lx=b(1)

[0028] Where L is a triangular sparse matrix, x is an unknown matrix, and b is a value matrix.

[0029] The following explanation uses a lower triangular sparse matrix as an example, where L, x, and b can be represented as shown below. The upper triangular sparse matrix is ​​similar to the lower triangular sparse matrix. The entire solution process for the lower triangular sparse matrix is ​​performed from row 0 to row N-1, while the entire solution process for the upper triangular sparse matrix is ​​performed from row N-1 to row 0.

[0030]

[0031] Where L has dimensions N*N, x and b have dimensions N, and n = N-1. In the trigonometric equation system:

[0032] b0 = L 00 *x0

[0033] b1 = L 10 *x0+L 11 *x1

[0034] b2 = L 20 *x0+L 21 *x1+L 22 *x2

[0035] b3 = L 30 *x0+L 31 *x1+L 32 *x2+L 33 *x3

[0036] ...

[0037] b n =L n0 *x0+L n1 *x1+L n2 *x2+L n3 *x3+…++L nn *x n

[0038] From b0 to b above n As can be seen from the expression, the solution formula for the trigonometric equation system can be shown in expression (2):

[0039]

[0040] To more clearly illustrate the technical solution of this application, a specific triangular sparse equation system will be used in the solution description. In this specific triangular sparse equation system, the triangular sparse matrix L is a lower triangular coefficient matrix with a dimension of 10*10, and the dimensions of x and b are 10. Specifically, the triangular sparse matrix L is shown in expression (3).

[0041]

[0042] The following is a description of the scheme proposed in this application.

[0043] Normally, before solving the trigonometric equation system, the trigonometric sparse matrix L and the value matrix b of the trigonometric equation system need to be stored in a computing device (such as a computer or a power system control device) so that the computing device can solve the trigonometric equation system based on the trigonometric sparse matrix L and the value matrix b, based on the above expression (2).

[0044] Considering that most elements in the triangular sparse matrix L have a value of 0, in order to reduce the amount of data stored, row compression can be used to store the non-zero elements of each row in the triangular sparse matrix L sequentially.

[0045] Read the non-zero elements of each row sequentially from row 0 to row (N-1) and save them to the element array Ld. The array Ld can be as shown in expression (4).

[0046] Ld[0:NNZ-1]=(Ld0,Ld1,Ld2,…,Ld NNZ-1 (4)

[0047] Take the triangular sparse matrix L shown in expression (3) as an example. The number of non-zero elements in the triangular sparse matrix L is 20, so NNZ is 20. The array Ld can be as shown in expression (5).

[0048] Ld[0:20-1]=(L 00 ,L 11 ,L 20 ,L 21 ,L 22 ,L 33 ,L 41 ,L 44 ,L 55 ,L 61 ,L 64 ,L 65 ,L 66 ,L 73 ,L 77 ,L 80 ,L 88 ,L 93 ,L 97 ,L 99 (5)

[0049] Furthermore, to facilitate the differentiation of elements in each row of the triangular sparse matrix L within the element array Ld, a corresponding position array Lp is also set up. The position array Lp is used to store the starting position of each row element in the triangular sparse matrix L within the array Ld, and the ending position of the last row element in the array Ld plus 1. The last two elements of Ld are used to store the starting and ending positions of the last row element in the triangular sparse matrix L within the array Ld plus 1. For an N*N dimensional triangular sparse matrix L, the position array Lp has N+1 corresponding elements. The position array Lp can be represented as shown in expression (6).

[0050] Lp[0:N]=(Lp0,Lp1,Lp2,…,Lp N (6)

[0051] In expression (6), except for the last two elements, Lp i This represents the i-th row in the triangular sparse matrix L, starting from the Lp-th element in the element array Ld. iStarting with one element. Take the triangular sparse matrix L shown in expression (3) as an example. The array Ld corresponding to the triangular sparse matrix L is shown in expression (5). The position array Lp can be shown in expression (7).

[0052] Lp[0:10]=(0,1,2,5,6,8,9,13,15,17,20) (7)

[0053] Take element 5 in array Ld as an example. It represents the 3rd row in the triangular sparse matrix L, starting from the 5th element in the element array Ld.

[0054] Furthermore, to facilitate the differentiation of elements in each column of the triangular sparse matrix L within the array Ld, a corresponding column index array Lj is also set up. The column index array Lj is used to store the column index of each element in the array Ld within the triangular sparse matrix L. The column index array Lj can be represented as shown in expression (8).

[0055] Lj[0:NNZ-1]=(Lj0,Ljd1,Lj2,…,Lj NNZ-1 (8)

[0056] Take the triangular sparse matrix L shown in expression (3) as an example. The array Ld corresponding to the triangular sparse matrix L is shown in expression (5). The column index array Lj can be shown in expression (9).

[0057] Lj[0:20-1]=(0,1,0,1,2,3,1,4,5,1,4,5,6,3,7,0,8,3,7,9) (9)

[0058] Thus, by combining the arrays Ld, Lp, and Lj, the dimensions of the triangular sparse matrix L and the values ​​of each element can be determined.

[0059] Based on the stored triangular sparse matrix L and value matrix b, the solution to the triangular sparse equation system can begin.

[0060] Please see Figure 1 This is a flowchart illustrating an embodiment of an accelerated method for solving triangular sparse equations in a power system. The accelerated method for solving triangular sparse equations in a power system can be applied to accelerators. Accelerators include, but are not limited to, various types of computer equipment (such as desktop computers and tablets), and power system control equipment. Figure 1 The method includes the following steps:

[0061] Step S11: Determine the level of each row node in the triangular sparse matrix L according to the dependency relationship in the solution process. The row nodes of higher levels depend on the row nodes of lower levels, and the row nodes of the same level are independent of each other.

[0062] Here, a row node refers to a row in the triangular sparse matrix. One row is one row node.

[0063] In some embodiments, the dependency relationship in the solution process refers to whether solving the trigonometric equations based on one row node of the trigonometric sparse matrix requires the solution results of other row nodes. For any row node, if solving the trigonometric sparse equations based on that row node requires the solution results of one or more other row nodes, then that row node has a dependency relationship with one or more other row nodes; conversely, if solving the trigonometric sparse equations based on that row node does not require the solution results of other row nodes, then that row node has no dependency relationship with other row nodes.

[0064] Taking the triangular sparse matrix L in expression (3) as an example. Combining the solution formula for the triangular equation system in expression (2), it can be seen that when solving the triangular equation system based on the triangular sparse matrix L shown in expression (3):

[0065] When solving the trigonometric equations (x0, x1, x3, x5) based on the 0th, 1st, 3rd, and 5th row nodes in the trigonometric sparse matrix L, it is not necessary to rely on the solution results of other row nodes;

[0066] When solving the trigonometric equations based on the second row node of the trigonometric sparse matrix L (solving x2), it depends on the solution results of the 0th and 1st row nodes (i.e., it depends on x0 and x1). ......

[0068] When solving the trigonometric equations based on the 9th row node of the trigonometric sparse matrix L (solving x9), the solution depends on the results of the 3rd and 7th row nodes (i.e., it depends on x3 and x7).

[0069] In this embodiment, the row node that does not depend on other row nodes is taken as the lowest level row node. Then, according to the dependency relationship between row nodes, the remaining row nodes are further divided into levels, so that the higher level row nodes depend on the lower level row nodes, and the row nodes at the same level are independent of each other (i.e., they do not depend on each other).

[0070] See also Figure 2 , is a schematic diagram of the hierarchy obtained after performing hierarchical partitioning on the triangular sparse matrix L in expression (3). Figure 2 In the diagram, the number within each circle represents the row node number. Arrows indicate dependencies. From Figure 2It can be seen that after hierarchically partitioning the triangular sparse matrix L in expression (3), the row nodes in the triangular sparse matrix L can be divided into 3 levels. The row nodes of the 0th level do not depend on the row nodes of other levels, the row nodes of the 1st level depend on at least some of the row nodes of the 0th level, and the row nodes of the 2nd level depend on at least some of the row nodes of the 0th and 1st levels. Within the same level, the row nodes are independent of each other.

[0071] In some embodiments, after determining the level of each row node in the triangular sparse matrix L, the level to which each row node belongs can be written sequentially, starting from the beginning of the pre-created level array Levels.

[0072] Specifically, the elements in the Levels array correspond one-to-one with the row nodes of the triangular sparse matrix L, and each element is used to store the level of a row node.

[0073] In this embodiment, the i-th element in the level array Levels corresponds to the i-th row node, and each element is used to store the level of the corresponding row node in the triangular sparse matrix L, that is, the i-th element stores the level of the i-th row node. The level array Levels can be as shown in expression (9).

[0074] Levels[0:N-1]=(Le0,Le1,Le2,…,Le N-1 (9)

[0075] Among them, Le0, Le1, Le2, ..., Le N-1 These represent the levels of the nodes in the 0th, 1st, 2nd, ..., N-1th rows of the triangular sparse matrix L, respectively.

[0076] Take the triangular sparse matrix L in expression (3) as an example. The level array Levels of the triangular sparse matrix L can be shown in expression (10).

[0077] Levels[0:10-1]=(0,0,1,0,1,0,2,1,1,2) (10)

[0078] That is, the level of the 0th row node is 0, the level of the 1st row node is 0, the level of the 2nd row node is 1, and so on.

[0079] In some embodiments, based on the obtained level array Levels, the elements in the level array Levels can be clustered according to the level to obtain the category array Rowsort, so as to facilitate continuous processing of rows at the same level during the solution process.

[0080] Specifically, the categorical array Rowsort can be used to store the row node index of each element in the hierarchical array Levels. The row node indexes corresponding to elements at the same level are stored in a contiguous region of the categorical array Rowsort, thus clustering the elements in the hierarchical array Levels according to their levels.

[0081] Take the triangular sparse matrix L in expression (3) as an example. The level array Levels of the triangular sparse matrix L is shown in expression (10). Then the category array Rowsort can be shown in expression (11).

[0082] Rowsort[0:10-1]=(0,1,3,5,2,4,7,8,6,9) (11)

[0083] In the Rowsort array, elements 0 to 3 represent the row node number corresponding to the element at level 0 in the Levels array, elements 4 to 7 represent the row node number corresponding to the element at level 1 in the Levels array, and elements 8 to 9 represent the row node number corresponding to the element at level 2 in the Levels array.

[0084] The following details how to cluster elements in the Levels array.

[0085] Please see Figure 3 This is a schematic diagram illustrating the process of clustering elements in a hierarchical array Levels, provided as an embodiment of this application. Figure 3 The process shown may specifically include the following steps:

[0086] Step S31: Count the number of row nodes in each level of the level array Levels.

[0087] Specifically, a statistical array Levels_p can be created. Based on the total number of levels max_level of row nodes in the triangular sparse matrix L, max_level+1 storage spaces are allocated to the statistical array Levels_p. Except for the 0th storage space, the other storage spaces correspond one-to-one with the levels of the row nodes, and each storage space is used to count the number of row nodes at the corresponding level in the level array Levels.

[0088] In this embodiment, the statistical array Levels_p can be as shown in expression (12).

[0089] Levels_p[0:max_level]=(P0,P1,P2,…,P max_level-1 (12)

[0090] Among them, P0 can be fixedly assigned the value 0, and P1, P2, ..., P max_level-1 These are used to count the number of row nodes in the 0th, 1st, ..., max_level-1th levels of the Levels array.

[0091] After traversing the level array Levels, the first element in the statistics array Levels_p is the number of row nodes at level 0, the second element is the number of row nodes at level 1, and the third element is the number of row nodes at level 2.

[0092] For the triangular sparse matrix L in expression (3), the final statistical array Levels_p can be shown in expression (14).

[0093] Levels_p[0:3]=(0,4,4,2) (14)

[0094] Expression (14) indicates that in the level array Levels, the number of row nodes at level 0 is 4, the number of row nodes at level 1 is 4, and the number of row nodes at level 2 is 2.

[0095] In some embodiments, to accelerate the statistical process, when counting the number of row nodes at each level in the hierarchical array Levels, the hierarchical array Levels can be divided into multiple second array segments. Multiple parallel statistical processing units can then perform parallel counting of the number of row nodes at each level within these second array segments. During parallel counting, different parallel statistical processing units process different second array segments. Finally, the statistical results of the multiple second array segments are summed to obtain the number of row nodes at each level in the hierarchical array Levels.

[0096] For details, please refer to the following: Figure 4 This is a schematic diagram of a parallel statistical processing unit provided in one embodiment of this application. Figure 4 In this example, the hierarchical array Levels is divided into four second array segments: Levels[0:n1-1], Levels[n1:n2-1], Levels[n2:n3-1], and Levels[n3:N-1]. Adjacent second array segments are connected end-to-end but do not overlap. The parallel statistical processing unit 31 may include a first-level parallel statistical processing unit 311, a second-level parallel statistical processing unit 312, and a third-level parallel statistical processing unit 313.

[0097] Each second array segment corresponds to a first-level parallel statistical processing unit 311. A sub-statistical array Levels_pi can be set for each first-level parallel statistical processing unit 311. The sub-statistical array Levels_pi has the same format as the statistical array Levels_p. Each first-level parallel statistical processing unit 311 can be used to count the number of row nodes at each level in the corresponding second array segment. For example, the first first-level parallel statistical processing unit 311 counts the number of row nodes at each level in the second array segment Levels[0:n1-1], and the second first-level parallel statistical processing unit 311 counts the number of row nodes at each level in the second array segment Levels[n1:n2-1].

[0098] in, Figure 4 Region 1 shows a schematic diagram of the statistical process of one of the first-level parallel statistical processing units 311. In Region 1, the first-level parallel statistical processing unit 311 is used to count the number of row nodes at each level in the second array segment Levels[0:n1-1]. Here, idx is an index variable. The initial value of idx can be 0. levels[idx] can represent the idx-th element in the second array segment Levels[0:n1-1]. Levels_p[levels[idx]] can represent the element in the statistical array Levels_p corresponding to the level of the idx-th element. The first-level parallel statistical processing unit 311 searches for the level of the idx-th element in the second array segment Levels[0:n1-1]. After finding it, in the corresponding sub-statistical array Levels_pi, the value of Levels_p[levels[idx]] is incremented by 1. This completes one search. Then, idx is incremented by 1, and the search for the level of the next element in the second array segment Levels[0:n1-1] continues.

[0099] After all the first-level parallel statistical processing units 311 have completed the statistics for their respective second array segments, the second-level parallel statistical processing unit 312 adds the statistical results of the first-level parallel statistical processing units 311 to obtain the statistical array Levels_p. Specifically, the sub-statistical arrays Levels_pi of all the first-level parallel statistical processing units 311 are added together according to their hierarchical correspondence.

[0100] by Figure 4 For example, this process can be represented as expression (15).

[0101] Levels_p=Levels_p1+Levels_p2+Levels_p3+Levels_p4 (15)

[0102] This means that the statistical arrays Levels_p1, Levels_p2, Levels_p3, and Levels_p4 of the four first-level parallel statistical processing units 311 are added together to obtain the statistical array Levels_p.

[0103] To facilitate subsequent calculations, the following operations are also performed on the statistical array Levels_p by a three-level parallel statistical processing unit 313:

[0104] For any level, the number of row nodes at that level is summed with the number of row nodes at all lower levels below that level to obtain the summation result for that level.

[0105] Taking the triangular sparse matrix L in expression (3) as an example, the statistical array Levels_p of the number of row nodes in each level is shown in expression (14) above. The number of row nodes in the lower level is accumulated to the higher level, and the statistical array Levels_p after accumulation is shown in expression (16).

[0106] Levels_p[0:3]=(0,4,8,10) (16)

[0107] Step S32: Determine the starting and ending positions of the row node sequence number in the Rowsort array based on the number of row nodes in each level.

[0108] Specifically, starting from the beginning of the Rowsort array, based on the accumulated results, we can determine the starting and ending positions of the row node numbers for each level within the Rowsort categorical array.

[0109] See also Figure 5 This is a schematic diagram illustrating the division of the start and end positions of row node numbers at various levels according to an embodiment of this application. Figure 5 Take the triangular sparse matrix L in expression (3) as an example. The statistical array Levels_p after the triangular sparse matrix L is accumulated is shown in expression (16). Combining with expression (16), the position range of level 0 in Rowsort is [0,4), the position range of level 1 in Rowsort is [4,8), and so on.

[0110] In this embodiment, in the statistical array Levels_p after accumulation, the i-th element and the (i+1)-th element are used to define the start and end positions of the i-th level in the category array Rowsort. The storage location range of the i-th level in Rowsort is [Levels_p[i], Levels_p[i+1]).

[0111] Step S33: For any level, based on the target start position and target end position of the element in the Rowsort array, write the index of the row node of that level in the Levels array between the target start position and the target end position to cluster the elements of that level.

[0112] For example, assuming that the storage range of the 0th level in the Rowsort array is [0,4), then the index of the row node of the 0th level in the Levels array can be written into the 0th to 4th positions (excluding the 4th position) of the Rowsort array.

[0113] Take the triangular sparse matrix L in expression (3) as an example. The level array Levels of the triangular sparse matrix L is shown in expression (10). The statistical array Levels_p after accumulation is shown in expression (16). Based on this, when traversing the level array Levels, if the element of the i-th level is reached, the element index is written between the start and end positions of the i-th level in the category array Rowsort. Finally, the clustering result is obtained as shown in expression (11).

[0114] In some embodiments, in order to improve clustering efficiency, the level array Levels can be divided into multiple first array segments, and the elements in the multiple first array segments can be clustered in parallel by multiple parallel clustering processing units to obtain the array Rowsort. In the parallel clustering, different parallel clustering processing units are used to process different first array segments.

[0115] See also Figure 6 This is a schematic diagram of a parallel clustering processing unit provided in one embodiment of this application. Figure 6 In this example, the hierarchical array Levels is divided into four first array segments: levels[0:n1-1], levels[n1:n2-1], levels[n2:n3-1], and levels[n3:N-1]. Adjacent first array segments are connected end-to-end but do not overlap. Each first array segment corresponds to a parallel clustering processing unit 51. During parallel clustering, the start and end positions of each first array segment within the hierarchical array Levels, along with the data within the corresponding array segment, can be loaded into the corresponding parallel clustering processing unit 51 for processing. For example, loading 0, n1-1, and levels[0,n1-1] into the first parallel clustering processing unit 51 indicates that the first parallel clustering processing unit 51 clusters the elements from 0 to n1-1 in the hierarchical array Levels.

[0116] All parallel clustering processing units 51 can share the array Rowsort and the statistical array Levels_p. Since multiple parallel clustering processing units 51 can write row node numbers into the row sort array, conflicts may occur. This conflict can be resolved by using a loop-waiting method. In addition, the Rowsort array region corresponding to each level also needs to record the number of data already saved in that region. Therefore, an index array levelidx can be set. According to the total number of row nodes in the triangular sparse matrix L, max_level storage spaces can be allocated to the index array levelidx. Each position is used to record the number of row node numbers already written in a level region of Rowsort. The index array levelidx can be as shown in expression (17).

[0117] levelidx[0:max_level-1]=(id0,id1,id2,…,id max_level-1 (17)

[0118] id0, id1, id2, ..., id max_level-2 Used to store the number of row node numbers that have been written in the 0th, 1st, 2nd, ..., max_level-1 level regions of the categorical array Rowsort.

[0119] Specifically, the values ​​of each element in the index array levelidx are initialized to 0. Before each parallel clustering processing unit 51 writes a row node number to a level region in the rowsort array, it first reads the value of the element corresponding to the level region in the index array levelidx, and determines the position of the row node number to be written in the class array Rowsort according to the value. At the same time, the value of the element corresponding to the level region in the index array levelidx is incremented by 1.

[0120] To facilitate understanding, an example is given below. Assume that max_level is 3. Then the initialized index array levelidx can be as shown in expression (18).

[0121] levelidx[0:3-1]=(0,0,0) (18)

[0122] The 0th element can be used to store the number of row node numbers that have been written in the 0th level region of the categorical array Rowsort, the 1st element can be used to store the number of row node numbers that have been written in the 1st level region of the categorical array Rowsort, and the 2nd element can be used to store the number of row node numbers that have been written in the 2nd level region of the categorical array Rowsort.

[0123] During parallel clustering, assuming the first parallel clustering unit 51 finds a level 0 element in the first array segment levels[0:n1-1], it first queries the value of the 0th element in the index array levelidx. Assuming the value of the 0th element in the index array levelidx is 0, the first parallel clustering unit 51 writes the element index of the 0th level element into the 0th storage space of the 0th level region in the category array Rowsort, and simultaneously updates the value of the 0th element in the index array levelidx to 1.

[0124] And so on.

[0125] exist Figure 6 Region 1 illustrates the internal structure of one of the parallel clustering processing units 51. In Region 1, the parallel clustering processing unit 51 is used to cluster elements in the first array segment Levels[n1:n2-1] according to levels. `idx` is an index variable. The initial value of `idx` is 0. `levels[idx]` can represent the `idx`-th storage location in the first array segment Levels[n1:n2-1]. For ease of description, it is assumed here that the level of the `idx`-th element is `levels[idx]`. `Levels_p[levels[idx]]` represents the starting position of the `levels[idx]`-th level region in the category array Rowsort. `levelidx[levels[idx]]` represents the number of row node numbers already written in the `levels[idx]`-th level region in the category array Rowsort. It's understandable that adding levelidx[levels[idx]] to Levels_p[levels[idx]] indicates the writing position of the row node number corresponding to the idx-th element in the category array Rowsort. When writing the element index of the idx-th element at the corresponding position in the category array Rowsort, the index array levelidx[levels[idx]] is incremented by 1, and then idx is incremented by 1.

[0126] After the above operations, the row node numbers can be clustered according to the elements in the Levels array in order from low level to high level, resulting in the Rowsort array.

[0127] Step S12: Based on the non-zero elements of the lower-level row nodes, the trigonometric equations are solved in the first way, and based on the non-zero elements of the higher-level row nodes and the result of the first solution, the trigonometric equations are solved in the second way. In the case that there are multiple row nodes in the same level, the data of different row nodes in the same level are processed in parallel by multiple different solution processing units to solve the trigonometric equations in parallel.

[0128] As described in step S11 regarding row node dependencies, the lowest-level (level 0) row nodes have no dependencies on other row nodes. Therefore, the trigonometric equations can be solved first based on the lowest-level row nodes. Based on the solution at the lowest level, the trigonometric equations can then be solved sequentially based on row nodes at other levels, from lower to higher levels.

[0129] Since the row nodes in the triangular sparse matrix L have been clustered in order from low level to high level in the above-mentioned category array Rowsort, the row nodes of each level in the triangular sparse matrix L can be determined by the category array Rowsort.

[0130] Furthermore, since there is no dependency between row nodes at the same level in a triangular sparse matrix L, the data of different row nodes at the same level can be processed in parallel by different solution processing units to solve the triangular equation system in parallel.

[0131] See also Figure 7 This is a schematic diagram of a solution processing unit provided in one embodiment of this application. Figure 7 In this context, `levelsi` represents the i-th level. For example, in a triangular sparse matrix L, `levelsi` represents the non-zero element of the row node at the i-th level; in the value matrix b, `levelsi` represents the value corresponding to the row node at the i-th level; and in the unknown matrix x, `levels0` represents the unknown corresponding to the row node at the 0-th level. The triangular sparse matrix L uses row-compressed storage as described above and is denoted by Lp, Ld, and Lj.

[0132] Multiple solution processing units 61 are configured. Each solution processing unit 61 solves the trigonometric equation system based on a triangular sparse matrix L and a value matrix b. Each solution processing unit 61 includes a first storage unit L. ′ Second storage unit x ′ Third storage unit b ′ ", fourth storage unit b". Where:

[0133] First storage unit L ′ This is used to store the non-zero elements of the target row nodes in the triangular sparse matrix L, which are to be solved. First storage unit L ′It can include max_dep*2 storage spaces. max_dep floating-point storage spaces are used to store the loaded row of non-zero elements, and max_dep unsigned integer storage spaces are used to store their corresponding column indices. The 2*max_dep storage spaces may not be fully utilized during calculation; they are used according to the actual situation. The method for determining the number of storage spaces max_dep will be explained later and will not be repeated here.

[0134] The second storage unit x′ is used to store the solved x. The second storage unit x′ includes N floating-point storage spaces.

[0135] The third storage unit b′ is used to store the values ​​in the value matrix b. The third storage unit b′ includes a floating-point storage space.

[0136] The fourth storage unit b″ is used to store intermediate calculation results. The fourth storage unit b″ includes a floating-point storage space.

[0137] The solution process will be explained below using the trigonometric equations in expression (2) above.

[0138] 1) Solve the trigonometric equations based on the row nodes at level 0 in the trigonometric sparse matrix L.

[0139] By directly inputting the elements and corresponding values ​​of the row nodes into the solution processing unit 61, the corresponding x can be calculated. Specifically, when the triangular sparse matrix L includes multiple row nodes at level 0, each solution processing unit 61 can calculate x based on the elements and corresponding values ​​b of one row node during a single solution process. i Solving for x yields a value. The obtained x can be stored simultaneously in the unknown array x in memory and in the second memory cell x′.

[0140] Taking the triangular sparse matrix L in expression (3) as an example. In the triangular sparse matrix L, the 0th, 1st, 3rd, and 5th row nodes are row nodes at level 0. Then:

[0141] Input the element and value b0 of the 0th row node into the first solution processing unit 61;

[0142] Input the element and value b1 of the first row node into the second solution processing unit 61.

[0143] Input the element and value b3 of the third row node into the third solution processing unit 61;

[0144] Input the element and value b5 of the 5th row node into the fourth solution processing unit 61.

[0145] After the first solution processing unit 61 solves for x0, it stores x0 from the 0th storage location of x′ to the 0th position in the unknown array x;

[0146] After the second solution processing unit 61 solves for x1, it stores x1 from the first storage location of x′ to the first position in the unknown array x;

[0147] After the third solution processing unit 61 solves for x3, it stores x3 from the third storage location of x′ to the third position in the unknown array x.

[0148] After the fourth solution processing unit 61 solves for x5, it stores x5 from the 5th storage location of x′ to the 5th position in the unknown array x.

[0149] It should be noted that if the number of solution processing units 61 is less than the number of row nodes, the solution is performed in parallel multiple times. For example, in a triangular sparse matrix L, there are 4 row nodes at level 0, but only three solution processing units 61. Therefore, the trigonometric equations can be solved first based on the first 3 row nodes, and then the trigonometric equations can be solved again based on the 4th row node.

[0150] 2) Solve the trigonometric equations based on the row nodes of the first level in the trigonometric sparse matrix L.

[0151] Since the first level in the triangular sparse matrix L depends on the 0th level, the solution result of the 0th level needs to be read from the unknown array x and stored in the second storage unit x′ of each first solution processing unit 61. Because each solution processing unit 61 has already saved its solution result to the second storage unit x′ during the 0th level solution process, only incremental fetching is needed here.

[0152] Taking the triangular sparse matrix L in expression (3) as an example, in the solution process at level 0:

[0153] x1, x3, and x5 are read into the second storage unit x′ of the first solution processing unit 61.

[0154] x0, x1, and x5 are read into the second storage unit x′ of the second solution processing unit 61.

[0155] And so on.

[0156] After the data is retrieved, the value b corresponding to the element of the first-level row node can be obtained. i The input is fed into the solution processing unit 61, which then processes the data based on the elements of the first-level row nodes and their corresponding values ​​b. iThe solution results for level 0 are used to continue solving the trigonometric equations to obtain the solution results for level 1 (similar to the solution process for level 0, which will not be described here).

[0157] 3) Solve the trigonometric equations based on the row nodes of the second level in the trigonometric sparse matrix L.

[0158] Since the second level in the triangular sparse matrix L depends on the 0th and 1st levels, the solution results of the 0th and 1st levels need to be read from the unknown array x and stored in the second storage unit x′ of each first solution processing unit 61. However, since the solution results of the 0th level have already been read in the solution process of the 1st level, only the solution results of the 1st level need to be read incrementally here (see the retrieval process of the 1st level, which will not be repeated here).

[0159] After the data reading is complete, the value b corresponding to the element of the second-level row node can be retrieved. i The input is given to the solution processing unit 61, which then processes the data based on the elements of the second-level row nodes and their corresponding values ​​b. i The solutions for the first and second levels are used to solve the trigonometric equations, yielding the solution for the second level (similar to the solution for the first level, and will not be described here).

[0160] And so on.

[0161] Furthermore, as can be seen from the solution formula for the trigonometric equation system in expression (2), the process of solving the trigonometric equation system requires performing a division operation on the diagonal elements of the trigonometric sparse matrix L. This division operation is performed on accelerated processors (see [link to relevant documentation]). Figure 9 The computation speed on a general-purpose processor is typically slow. Therefore, in some embodiments, when solving systems of trigonometric equations, the computation is first performed on a general-purpose processor (see [link to documentation]). Figure 9 The diagonal elements of the triangular sparse matrix L are transformed into their reciprocals, and the triangular equations are solved based on the transformed triangular sparse matrix L. Furthermore, during the solution of the equations, division operations on the processor can be converted into multiplication operations, thereby improving computational speed.

[0162] The following uses one of the solution processing units, 61, as an example, combined with... Figure 6 In region 1, the solution process will be explained in detail.

[0163] In some embodiments, the solution processing unit 61 includes a processing unit pair consisting of a first solution processing unit 611 and a second solution processing unit 612. When solving the trigonometric sparse equation system, the first solution processing unit 611 can perform a first operation in the solution process to obtain a first operation result. Based on the first operation result, the second solution processing unit 612 can perform a second operation in the solution process.

[0164] In this embodiment, the first operation is a multiplication operation, and the second operation is a subtraction operation (by converting it into an operation of adding a negative number).

[0165] Take the triangular sparse matrix L in expression (3) as an example. When solving the triangular equation system based on the elements of the 6th row node in the triangular sparse matrix L, the solution formula is shown in expression (19).

[0166] x6=(b6-L 61 *x1-L 64 *x4-L 65 *x5) / L 66 (19)

[0167] Before solving, store b6 in the value matrix b to the third storage unit b′, store the solved x to the second storage unit x′ (see the above description), and store the non-zero element of the 6th row node in the triangular sparse matrix L to the first storage unit L′ (the 6th row node has four non-zero elements).

[0168] When solving:

[0169] The first solution processing unit 611 executes b″=L 61 *x1;

[0170] The second storage unit 612 executes b′=b′-b″, while the first solution processing unit 611 executes b″=L 64 *x4;

[0171] The second storage unit 612 executes b′=b′-b″, while the first solution processing unit 611 executes b″=L 65 *x5;

[0172] The second storage unit 612 executes b′=b′-b″;

[0173] At this point, b′=b6-L 61 *x1-L 64 *x4-L 65 *x5, store the value of b′ in the 6th storage location of x′ (i.e., x′6), and the first solution processing unit 611 executes x′6=x′6*L 66Solve for the unknown x6. Then, save the solution to the unknown array x.

[0174] This design of the first solution processing unit 611 and the second solution processing unit 612 can avoid read / write conflicts to the third storage unit b′ during the solution process, reduce read / write waiting time, and improve computational efficiency.

[0175] The following explains how to determine the number of storage spaces (i.e., max_dep) in the first storage unit L′.

[0176] In some embodiments, to improve computational efficiency, the row nodes in the triangular sparse matrix L can be divided into multiple row node groups. Multiple third processing units process these row node groups in parallel to obtain the number of non-zero elements in each row node group, and the number of the largest non-zero element in each row node group. From the largest non-zero element counts in each row node group, the largest non-zero element is selected as the maximum storage space (max_dep) reserved for L′ during the solution process.

[0177] Specifically, since the position array Lp is used to store the starting position of the non-zero element of each row node in the triangular sparse matrix L in the array Ld, and the ending position of the last row element in the array Ld, the result of subtracting the i+1th element from the i-th element in the position array Lp can represent the number of non-zero elements in the i-th row node of the triangular sparse matrix L.

[0178] Therefore, dividing the row nodes in the triangular sparse matrix L into multiple row node groups can be transformed into dividing the position array Lp into multiple third array segments, with adjacent array segments overlapping at the beginning and end. Each array segment is a row node group. Then, the number of non-zero elements in each row node group can be counted in each third array segment.

[0179] See also Figure 8 This is a schematic diagram of a statistical processing unit for the maximum number of non-zero elements provided in one embodiment of this application. Figure 8 In this example, the position array Lp is divided into four third array segments: [0:n1], [n1:n2], [n2:n3], and [n3:N-1]. Each statistical processing unit 71 corresponds to one third array segment.

[0180] Figure 8Region 1 in the diagram illustrates the flowchart of statistical processing unit 71. Statistical processing unit 71 in Region 1 sequentially subtracts the (i+1)th element from the ith element in the third array segment [0:n1] to obtain the number of non-zero elements in each row node. Then, it compares the counts of any two adjacent non-zero elements and retains the count with the largest value. It can be understood that through this layer-by-layer pairwise comparison, the maximum number of non-zero elements in the third array segment [0:n1] can be determined. Similarly, other statistical processing units 71 can also obtain the maximum number of non-zero elements in their respective third array segments. Furthermore, by performing layer-by-layer pairwise comparisons of the maximum number of non-zero elements in each statistical processing unit 71, the maximum number of non-zero elements in each row of the entire matrix is ​​obtained.

[0181] In some embodiments of this application, the nodes of each row in the triangular sparse matrix are hierarchically divided according to the dependency relationship in the solution process. The higher-level row nodes depend on the lower-level row nodes, so that the triangular equation system can be solved in parallel according to the hierarchy, thereby improving the solution speed.

[0182] Please see Figure 9 This application provides an embodiment of an accelerator for solving triangular sparse equations in a power system. The accelerator includes a general-purpose processor 81, an accelerator processor 82, a memory 84, and a communication protocol interface 83. The general-purpose processor 81 and the memory 84 are connected to the accelerator processor 82 via the communication protocol interface 83.

[0183] The general-purpose processor 82 can be a central processing unit (CPU) used to determine the level of each row node in the triangular sparse matrix L according to the dependencies in the solution process. The higher-level row nodes depend on the lower-level row nodes, and the row nodes at the same level are independent of each other.

[0184] Specifically, the general-purpose processor 82 is used to perform at least some of the following operations:

[0185] Read the triangular sparse matrix L and generate the element array Ld, position array Lp, and column index array Lj corresponding to the triangular sparse matrix L;

[0186] When generating the element array Ld, take the reciprocal of the non-zero diagonal elements of the triangular sparse matrix L;

[0187] In the triangular sparse matrix L, the levels to which each row node belongs are traversed sequentially according to the order of the row nodes, and the levels to which each row node belongs are written sequentially starting from the beginning of the pre-created level array Levels.

[0188] Calculate the total number of levels (max_level) of nodes in a row of a triangular sparse matrix L.

[0189] The memory is used to store computer programs. As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods in the embodiments of this invention. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the methods in the above-described embodiments.

[0190] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0191] See also Figure 10 ,for Figure 9 The diagram shows the internal structure of the accelerator included in the solver. The accelerator includes a control unit 821, a preprocessing unit 822, multiple solver processing units 823 related to the solver, and an on-chip storage unit 824. The solver processing units 823 perform a first solution to the trigonometric equations based on the non-zero elements of lower-level row nodes, and a second solution to the trigonometric equations based on the non-zero elements of higher-level row nodes and the result of the first solution. Where multiple row nodes exist at the same level, the solver processing units 823 process data from different row nodes at the same level in parallel to solve the trigonometric equations in parallel.

[0192] The control unit 821 is connected to the general-purpose processor 81 and memory 84 external to the accelerator processor 82 via the communication protocol interface 83, and is also connected to the preprocessing unit 822, the solver unit 823, and the on-chip storage unit 824 internal to the accelerator processor 82 via the communication protocol interface 83. The control unit 821 receives control signals sent externally via the communication protocol interface 83 and transmits the processing results of the accelerator processor 82 to the general-purpose processor 82 via the communication protocol interface 83. The control unit 821 is also responsible for controlling the specific calculation processes of the preprocessing unit 822 and the solver unit 823.

[0193] The on-chip memory unit 824 is used to store relevant data, intermediate results and final solution results.

[0194] The preprocessing unit 822 includes a calculation unit 8221, a statistics unit 8222, and a clustering unit 8223. The specific functions of each unit are as follows:

[0195] The computing unit 8221 is connected to the control unit 821 and the on-chip storage unit 824. During the computation process of the computing unit 8221, it first loads the position array Lp and dimension N of the triangular sparse matrix L from the on-chip storage unit 824. The control unit 821 controls the computing unit 8221 to count the maximum non-zero element count of the row nodes in the triangular sparse matrix L in parallel. After the calculation is completed, the maximum non-zero element count is stored back to the on-chip storage unit 824. The maximum non-zero element count is used to estimate how much space to reserve when solving the triangular sparse matrix L. This unit can be omitted when computing resources are sufficient.

[0196] The statistics unit 8222 is connected to the control unit 821 and the on-chip storage unit 824. During the calculation process, the statistics unit 8222 loads the level array Levels of the triangular sparse matrix L, the total number of levels max_level, and the dimension N of the triangular sparse matrix L from the on-chip storage unit 824. The control unit 821 controls the statistics unit 8222 to count the number of nodes in each level in a block-parallel manner. The statistics unit 8222 integrates the results of multiple blocks through multi-level vector addition. The control unit 821 controls the statistics unit 8222 to accumulate the number of nodes in each level to the subsequent levels and store the statistics array Levels_p back to the on-chip storage unit 824 for subsequent clustering of row nodes.

[0197] Clustering unit 8223 is connected to control unit 821 and on-chip storage unit 824. Clustering unit 8223 loads the level array Levels, the statistical array Levels_p, and the dimension N of the triangular sparse matrix L from on-chip storage unit 824. Control unit 821 controls clustering unit 8223 to cluster nodes in blocks and in parallel according to their level, and saves the category array Rowsort to on-chip storage unit 824.

[0198] The solution processing unit 823 performs parallel computation to solve the triangular sparse matrix L. The solution processing unit 823 is connected to the control unit 821 and the on-chip storage unit 824. The solution processing unit 823 loads the element array Ld, position array Lp, column index Lj, category array Rowsort, statistics array Levels_p, and storage space count max_dep of the triangular sparse matrix L from the on-chip storage unit 824. The control unit 821 controls the solution processing unit 823 to load n rows from the lowest level to be calculated, according to the Rowsort order of the category array, for computation. If the number of uncalculated rows in the lowest level to be calculated is less than n rows, all remaining uncalculated rows in that level are loaded for computation. After all levels are calculated, the required solution x is obtained.

[0199] Specifically, clustering unit 8223 includes multiple parallel clustering processing units. Clustering unit 8223 is specifically used to divide the level array Levels into multiple first array segments, and to perform parallel clustering on the elements in the multiple first array segments through the multiple parallel clustering processing units to obtain the category array Rowsort. During parallel clustering, different parallel clustering processing units are used to process different first array segments; and / or

[0200] The statistics unit 8222 includes multiple parallel statistics processing units. The statistics unit 8222 is used to divide the hierarchical array Levels into multiple second array segments, and to perform parallel statistics on the number of row nodes at each level in the multiple second array segments through the multiple parallel statistics processing units. During parallel statistics, different parallel statistics processing units are used to process different second array segments; and to sum the statistical results of the multiple second array segments to obtain the number of row nodes at each level in the hierarchical array Levels; and / or

[0201] The calculation unit 8221 includes multiple statistical processing units. The calculation unit 8221 is used to divide the row nodes in the triangular sparse matrix L into multiple row node groups, and to process the multiple row node groups in parallel through multiple statistical processing units to obtain the number of non-zero elements in each row node group, and the number of non-zero elements with the largest value in each row node group; and to determine the number of non-zero elements with the largest value among the number of non-zero elements with the largest value in each row node group.

[0202] The solution processing unit 823 includes a first solution processing unit and a second solution processing unit; the first solution processing unit is used to perform a first operation in the solution process to obtain a first operation result; the second solution processing unit is used to perform a second operation in the solution process based on the first operation result.

[0203] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for accelerating the solution of trigonometric sparse equations in a power system, characterized in that, The method includes: Based on the dependencies in the solution process, the hierarchy of each row node in the triangular sparse matrix is ​​determined. Higher-level row nodes depend on lower-level row nodes, and row nodes at the same level are independent of each other. After determining the level of each row node in the triangular sparse matrix, the levels to which each row node belongs are traversed sequentially in the order of the row nodes in the triangular sparse matrix. Starting from the beginning of the pre-created level array, the levels to which each row node belongs are written sequentially, and the elements in the level array are clustered according to the level to obtain a category array. Based on the category array, row nodes at each level are distinguished. Based on the non-zero elements of the lower-level row nodes, the trigonometric equations are solved in the first way. Based on the non-zero elements of the higher-level row nodes and the result of the first solution, the trigonometric equations are solved in the second way. In the case where there are multiple row nodes at the same level, the data of different row nodes at the same level are processed in parallel by multiple different solution processing units to solve the trigonometric equations in parallel. The step of clustering the elements in the hierarchical array according to the hierarchy to obtain a category array includes: The hierarchical array is divided into multiple first array segments, and the elements in the multiple first array segments are clustered in parallel by multiple parallel clustering processing units to obtain the category array. In the parallel clustering, different parallel clustering processing units are used to process different first array segments. And / or, count the number of row nodes in each level of the hierarchical array; determine the start and end positions of the row node numbers in the category array based on the number of row nodes in each level; for any level, based on the target start and target end positions of the row node numbers in the category array, write the row node numbers of that level in the hierarchical array between the target start and target end positions to cluster the elements of that level.

2. The method as described in claim 1, characterized in that, The counting of row nodes at each level in the hierarchical array includes: The hierarchical array is divided into multiple second array segments; The number of row nodes at each level in the multiple second array segments is counted in parallel by multiple parallel statistical processing units, wherein different parallel statistical processing units are used to process different second array segments during parallel statistics. The statistical results of the multiple second array segments are added together to obtain the number of row nodes at each level in the hierarchical array.

3. The method as described in claim 2, characterized in that, The step of determining the start and end positions of the row node sequence number in the category array based on the number of row nodes at each level includes: For any level, the number of row nodes at that level is summed with the number of row nodes at all lower levels below that level to obtain the summation result for that level. Starting from the beginning of the category array, the starting and ending positions of the row nodes of each level in the category array are determined according to the accumulated result.

4. The method as described in claim 1, characterized in that, Solving the system of trigonometric equations includes: The diagonal elements of the triangular sparse matrix are transformed into their reciprocals, and the triangular equations are solved based on the transformed triangular sparse matrix.

5. The method as described in claim 1, characterized in that, The non-zero elements of the target row nodes to be solved in the triangular sparse matrix are stored in a storage space, and the number of storage spaces is determined based on the following method: Divide the row nodes in the triangular sparse matrix into multiple row node groups; The multiple row node groups are processed in parallel by multiple statistical processing units to obtain the number of non-zero elements in each row node group and the number of non-zero elements with the largest value in each row node group. Among the number of non-zero elements with the largest value corresponding to each row node group, the number of non-zero elements with the largest value is selected as the number of storage spaces.

6. The method as described in claim 1, characterized in that, The solution processing unit includes a first solution processing unit and a second solution processing unit; solving the trigonometric equation system includes: The first calculation result is obtained by performing the first calculation operation in the solution process by the first solution processing unit. Based on the first calculation result, the second calculation operation in the solution process is executed by the second solution processing unit.

7. An accelerator for solving trigonometric sparse equations in a power system, characterized in that, The solver accelerator includes: A general-purpose processor is used to determine the level of each row node in a triangular sparse matrix according to the dependencies in the solution process, wherein higher-level row nodes depend on lower-level row nodes, and row nodes at the same level are independent of each other. Clustering nodes are used to, after determining the level of each row node in the triangular sparse matrix, sequentially traverse the level to which each row node belongs in the order of the row nodes in the triangular sparse matrix, and write the level to which each row node belongs sequentially starting from the beginning of a pre-created level array, and cluster the elements in the level array according to the level to obtain a category array; specifically, when clustering the elements in the level array according to the level, the level array is divided into multiple first array segments, and the elements in the multiple first array segments are clustered in parallel by multiple parallel clustering processing units. To obtain the category array, wherein, during parallel clustering, different parallel clustering processing units are used to process different first array segments, and / or, the number of row nodes at each level in the hierarchical array is counted; based on the number of row nodes at each level, the start and end positions of the row node indices at each level in the category array are determined; for any level, based on the target start and target end positions of the row node indices at that level in the category array, the indices of the row nodes at that level are written between the target start and target end positions to cluster the elements at that level; An accelerator processor includes multiple solution processing units related to solving the problem. The accelerator processor is used to perform a first solution to the trigonometric equation system based on the non-zero elements of the lower-level row nodes, and a second solution to the trigonometric equation system based on the non-zero elements of the higher-level row nodes and the result of the first solution. In the case where there are multiple row nodes at the same level, the accelerator processor processes the data of different row nodes at the same level in parallel through the multiple solution processing units to solve the trigonometric equation system in parallel.

8. The solver accelerator as described in claim 7, characterized in that, The general-purpose processor is also used to traverse the levels to which each row node belongs in the triangular sparse matrix according to the order of the row nodes, and to write the levels to which each row node belongs in sequence starting from the beginning of the pre-created level array.

9. The solver accelerator as described in claim 8, characterized in that: The accelerated processor further includes a clustering unit, which comprises multiple parallel clustering processing units. Specifically, the clustering unit is used to divide the hierarchical array into multiple first array segments, and to perform parallel clustering on the elements in the multiple first array segments through the multiple parallel clustering processing units to obtain a category array. During parallel clustering, different parallel clustering processing units are used to process different first array segments; and / or The accelerated processor further includes a statistics unit, which comprises multiple parallel statistics processing units. The statistics unit is used to divide the hierarchical array into multiple second array segments, and to perform parallel statistics on the number of row nodes at each level in the multiple second array segments using the multiple parallel statistics processing units. During parallel statistics, different parallel statistics processing units are used to process different second array segments; and to sum the statistical results of the multiple second array segments to obtain the number of row nodes at each level in the hierarchical array; and / or The accelerated processor further includes a computing unit, which includes multiple statistical processing units. The computing unit is used to divide the row nodes in the triangular sparse matrix into multiple row node groups, and to perform parallel processing on the multiple row node groups through the multiple statistical processing units to obtain the number of non-zero elements in each row node group, and the number of non-zero elements with the largest value in each row node group; and to determine the number of non-zero elements with the largest value among the number of non-zero elements with the largest value in each row node group.

10. The solver accelerator as described in claim 7, characterized in that, The solution processing unit includes a first solution processing unit and a second solution processing unit; The first solution processing unit is used to perform the first operation in the solution process and obtain the first operation result; The second solution processing unit is used to perform a second operation in the solution process based on the first calculation result.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • A DAG-based power system sparse matrix parallel solution method and system

    CN108985622A

  • Lower trigonometric equation parallel solving method for structural grid sparse matrix

    CN111079078A