Power system simulation optimization calculation method, device, equipment and readable storage medium

In the power system simulation calculation, tasks are allocated to realize parallel computing based on the time-consuming and correlation relationship of multiple threads of the target circuit and simulation tasks, which solves the problem of long simulation calculation time in the prior art and improves the simulation efficiency.

CN114896029BActive Publication Date: 2025-01-10ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210662656.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-13
Publication Date
2025-01-10
Estimated Expiration
2042-06-13

AI Technical Summary

Technical Problem

The existing power system simulation calculation methods are difficult to make rational use of computing hardware resources under multi-threaded conditions such as multi-CPU cores, multi-CPUs, and multi-computers, resulting in a long simulation calculation time and low efficiency.

Method used

By obtaining multiple threads and simulation tasks of the target circuit, the task is allocated to the thread according to the time-consuming and related relationship of the simulation task to realize parallel calculations, the allocation method with the shortest total time-consuming completion of all tasks is determined, and simulation is carried out according to this method calculate.

Benefits of technology

The simulation calculation time of power system is shortened, the simulation efficiency is improved, and the optimal allocation method is quickly determined, greatly improving the simulation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114896029B_ABST
    Figure CN114896029B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and readable storage medium for simulation optimization calculation of an electric power system. The method includes: obtaining a target circuit to be simulated and its corresponding multiple threads, and determining the simulation calculation time of each simulation task in the target circuit. According to the simulation calculation time and the correlation relationship of each simulation task, multiple allocation methods for allocating each simulation task to each thread for simulation calculation are determined. Finally, according to the simulation calculation time of each simulation task, and the electrical allocation method corresponding to each electrical component or the control allocation method corresponding to each control component in each allocation method, the target allocation method with the shortest total simulation calculation time for completing all simulation tasks is determined, and according to the target allocation method, each simulation task is allocated to each thread for simulation calculation. The present application can quickly determine the target allocation method with the shortest time from multiple allocation methods, thereby realizing the accelerated optimization of the electric power system simulation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of power systems, and more specifically, to a power system simulation optimization calculation method, device, equipment and readable storage medium. Background Art

[0002] In recent years, power system simulation calculations have increasingly relied on the powerful computing power of computing hardware systems in the hope of accelerating the solution process. Since the existing computing hardware systems have sufficient computing resources and storage resources, they have obvious advantages over the single computer calculations that were used in the past. However, with the interconnection of regional power grids, the scale of power systems continues to expand, making the scale and complexity of power system simulation calculations increasingly complex. However, the existing calculation methods do not fully consider the impact of the allocation and sequence arrangement of each simulation task on the final calculation time in multi-threaded situations such as multi-CPU cores, multi-CPUs, and multi-computers, making it difficult to achieve the theoretical and practical shortest simulation calculation time.

[0003] Therefore, how to reasonably utilize computing hardware system resources, shorten the simulation calculation time of the power system, and improve the simulation efficiency is an issue worthy of study. Summary of the invention

[0004] In view of this, the present application provides a power system simulation optimization calculation method, device, equipment and readable storage medium for rationally utilizing computing hardware system resources to shorten the simulation calculation time of the power system and improve simulation efficiency.

[0005] In order to achieve the above objectives, the proposed solution is as follows:

[0006] A power system simulation optimization calculation method, comprising:

[0007] Acquire a target circuit to be simulated and calculated and a plurality of threads corresponding thereto, wherein the threads are used for simulation calculation of the target circuit, and the target circuit includes a plurality of control elements and a plurality of electrical elements;

[0008] Determine a plurality of simulation tasks corresponding to the target circuit and the simulation calculation time consumption of each of the simulation tasks, wherein the plurality of simulation tasks include simulation calculations of each of the control elements, simulation calculations of each of the electrical elements, and matrix inversion calculations corresponding to the simulation calculations of each of the electrical elements;

[0009] According to the simulation calculation time consumption and correlation relationship of each simulation task, each simulation task is allocated to each thread for simulation calculation, and multiple allocation modes are obtained;

[0010] According to the simulation calculation time of each of the simulation tasks, as well as the electrical allocation method corresponding to each electrical component or the control allocation method corresponding to each control component in each of the allocation methods, among the multiple allocation methods, a target allocation method with the shortest total simulation calculation time for completing all of the simulation tasks is determined, and based on the target allocation method, each of the simulation tasks is allocated to each of the threads for simulation calculation.

[0011] Preferably, the association relationship between the simulation tasks includes:

[0012] The parallel relationship of the simulation tasks corresponding to each electrical component in the simulation process, the sequence and parallel relationship of the simulation tasks corresponding to each control component in the simulation process, and the sequence relationship between the simulation tasks corresponding to the matrix inversion calculation and the simulation tasks of all electrical components;

[0013] Determining one of the allocation methods of allocating each simulation task to each thread for simulation calculation according to the simulation calculation time consumption of each simulation task and the correlation between each simulation task includes:

[0014] Allocate the simulation tasks corresponding to the electrical components to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the electrical components and the parallel relationship of the simulation tasks corresponding to the electrical components during the simulation process;

[0015] Allocate the simulation tasks corresponding to the control elements to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the control elements and the sequence and parallel relationship of the simulation tasks corresponding to the control elements in the simulation process;

[0016] According to the simulation calculation time consumption of the simulation tasks corresponding to each of the electrical components and the sequence of the simulation tasks corresponding to the matrix inversion calculation and the simulation tasks of all the electrical components, the simulation tasks corresponding to the matrix inversion calculation are allocated to any one of the threads.

[0017] Preferably, according to the simulation calculation time consumption of each of the simulation tasks, and the electrical distribution mode corresponding to each electrical component or the control distribution mode corresponding to each control component in each of the distribution modes, the target distribution mode of determining the shortest total simulation calculation time consumption for completing all the simulation tasks among the multiple distribution modes includes:

[0018] Randomly sorting and numbering a plurality of the allocation methods;

[0019] The total simulation calculation time of each simulation task in the first allocation mode is subtracted from the matrix inversion calculation time to obtain the candidate time;

[0020] Starting from the second allocation method in numerical order, the total electrical time consumption of the simulation task corresponding to each electrical component in each allocation method, or the total control time consumption of the simulation task corresponding to each control component, or the comprehensive total time consumption obtained by adding the total electrical time consumption and the total control time consumption, is compared with the candidate time consumption;

[0021] After comparing all the allocation methods, a final candidate time consumption is obtained, and the allocation method corresponding to the final candidate time consumption is determined as the target allocation method.

[0022] Preferably, comparing the total electrical time consumption of the simulation task corresponding to each electrical component in each allocation mode, or the total control time consumption of the simulation task corresponding to each control component, or the comprehensive total time consumption obtained by adding the total electrical time consumption and the total control time consumption, with the candidate time consumption, comprises:

[0023] If the total electrical time consumption is greater than or equal to the candidate time consumption, the current allocation method and other allocation methods with the same electrical allocation method as the current allocation method are eliminated;

[0024] If the total control time is greater than or equal to the candidate time, the current allocation method and other allocation methods with the same control allocation method as the current allocation method are eliminated;

[0025] If the comprehensive total time consumption is less than the candidate time consumption, the total simulation calculation time consumption of each simulation task in the current allocation mode minus the matrix inversion calculation time consumption is used as the new candidate time consumption.

[0026] A power system simulation optimization computing device, comprising:

[0027] A target circuit acquisition unit, used to acquire a target circuit to be simulated and calculated and a plurality of threads corresponding thereto, wherein the threads are used for simulation calculation of the target circuit, and the target circuit includes a plurality of control elements and a plurality of electrical elements;

[0028] A simulation task determination unit, used to determine a plurality of simulation tasks corresponding to the target circuit and the simulation calculation time consumption of each of the simulation tasks, wherein the plurality of simulation tasks include the simulation calculation of each of the control elements, the simulation calculation of each of the electrical elements, and the matrix inversion calculation corresponding to the simulation calculation of each of the electrical elements;

[0029] A task allocation unit, configured to allocate each of the simulation tasks to each of the threads for simulation calculation according to the simulation calculation time consumption and correlation relationship of each of the simulation tasks, so as to obtain multiple allocation modes;

[0030] The target allocation determination unit is used to determine the target allocation method with the shortest total simulation calculation time for completing all the simulation tasks among multiple allocation methods based on the simulation calculation time of each of the simulation tasks and the electrical allocation method corresponding to each electrical component or the control allocation method corresponding to each control component in each of the allocation methods, and allocate each of the simulation tasks to each of the threads for simulation calculation based on the target allocation method.

[0031] Preferably, the association relationship between the simulation tasks includes:

[0032] The parallel relationship of the simulation tasks corresponding to each electrical component in the simulation process, the sequence and parallel relationship of the simulation tasks corresponding to each control component in the simulation process, and the sequence relationship between the simulation tasks corresponding to the matrix inversion calculation and the simulation tasks of all electrical components;

[0033] The task allocation unit comprises:

[0034] A first task allocation subunit is used to allocate the simulation tasks corresponding to the electrical components to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the electrical components and the parallel relationship between the simulation tasks corresponding to the electrical components during the simulation process;

[0035] A second task allocation subunit is used to allocate the simulation tasks corresponding to the control elements to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the control elements and the sequence and parallel relationship of the simulation tasks corresponding to the control elements in the simulation process;

[0036] The third task allocation subunit is used to allocate the simulation task corresponding to the matrix inversion calculation to any one of the threads according to the simulation calculation time corresponding to each electrical component and the sequence relationship between the simulation task corresponding to the matrix inversion calculation and the simulation tasks of all electrical components.

[0037] Preferably, the target allocation mode determination unit includes:

[0038] A sorting unit, used for randomly sorting and numbering a plurality of the allocation methods;

[0039] A subsequent time consumption determination unit is used to subtract the time consumption of matrix inversion calculation from the total simulation calculation time consumption of each simulation task in the first allocation mode to obtain a candidate time consumption;

[0040] a time consumption comparison unit, configured to compare the total electrical consumption of the simulation task corresponding to each electrical component in each allocation mode, or the total control consumption of the simulation task corresponding to each control component, or the comprehensive total consumption obtained by adding the total electrical consumption and the total control consumption, with the candidate time consumption starting from the second allocation mode in the numerical order;

[0041] The target allocation mode selection unit is used to obtain a final candidate time consumption after comparing all the allocation modes, and determine the allocation mode corresponding to the final candidate time consumption as the target allocation mode.

[0042] Preferably, the time-consuming comparison unit comprises:

[0043] A first time consumption comparison subunit is used to eliminate the current allocation mode and other allocation modes having the same electrical allocation mode as the current allocation mode if the total electrical consumption time is greater than or equal to the candidate consumption time;

[0044] A second time consumption comparison subunit is used to eliminate the current allocation mode and other allocation modes having the same control allocation mode as the current allocation mode if the total control consumption time is greater than or equal to the candidate consumption time;

[0045] The third time consumption comparison subunit is used to subtract the time consumption of matrix inversion calculation from the total simulation calculation time of each simulation task in the current allocation mode if the comprehensive total time consumption is less than the candidate time consumption, and the obtained time consumption is used as the new candidate time consumption.

[0046] A power system simulation optimization computing device, comprising a memory and a processor;

[0047] The memory is used to store programs;

[0048] The processor is used to execute the program to implement each step of the above-mentioned power system simulation optimization calculation method.

[0049] A readable storage medium stores a computer program, which, when executed by a processor, implements each step of the above-mentioned power system simulation optimization calculation method.

[0050] It can be seen from the above scheme that the power system simulation optimization calculation method provided by the present application can first obtain the target circuit to be simulated and calculated, and the target circuit includes multiple control elements and multiple electrical elements, so that multiple simulation tasks corresponding to the target circuit can be determined, wherein the simulation calculation of each control element is used as a simulation task, the simulation calculation of each electrical element is also used as a simulation task, and the matrix inversion calculation corresponding to the simulation calculation of each electrical element can be used as a simulation task; then the simulation calculation time of each simulation task can be determined, and then the multiple threads used for the simulation calculation of the target circuit can be determined from the computer hardware resources, and then the multiple allocation methods of each simulation task to each thread for simulation calculation can be determined according to the simulation calculation time of each simulation task and the correlation between each simulation task. Obviously, allocating each simulation task to each thread for simulation calculation can realize parallel simulation calculation, which is shorter and more efficient than serial simulation. Finally, according to the simulation calculation time of each simulation task, as well as the electrical distribution method corresponding to each electrical component in each distribution method or the control distribution method corresponding to each control component, among multiple distribution methods, the target distribution method with the shortest total simulation calculation time for completing all simulation tasks is determined, and based on the target distribution method, each simulation task is allocated to each thread for simulation calculation.

[0051] It can be seen that the method of the present application can not only perform simulation calculations on various simulation tasks in parallel, but also quickly determine the target allocation method with the shortest total simulation calculation time from multiple allocation methods, and use it as the simulation calculation method for the current simulation step. On the basis of effectively shortening the simulation calculation time of the power system, it further shortens the time for determining the optimal allocation method, thereby greatly improving the simulation efficiency of the power system. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0053] Figure 1 A schematic diagram of a flow chart of a power system simulation optimization calculation method provided in an embodiment of the present application;

[0054] Figure 2 A schematic diagram of the structure of a target circuit to be simulated disclosed in an embodiment of the present application;

[0055] Figure 3 A schematic diagram of a simulation calculation relationship of a target circuit disclosed in an embodiment of the present application;

[0056] Figure 4a -b is a schematic diagram of two simulation task allocation methods disclosed in the embodiments of the present application;

[0057] Figure 5 A schematic diagram of the structure of a power system simulation optimization computing device disclosed in an embodiment of the present application;

[0058] Figure 6 A hardware structure block diagram of a power system simulation optimization computing device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0060] Next, the power system simulation optimization calculation method of this application is introduced in detail. Please refer to Figure 1 , Figure 1 A schematic diagram of a flow chart of a power system simulation optimization calculation method provided in an embodiment of the present application, the method comprising:

[0061] Step S100: obtaining a target circuit to be simulated and a plurality of threads corresponding thereto, wherein the threads are used for simulation of the target circuit, and the target circuit includes a plurality of control elements and a plurality of electrical elements.

[0062] Specifically, the simulation duration of each simulation step can be arbitrarily set by the user, such as tens of microseconds or hundreds of microseconds, and the acquired target circuit needs to complete at least one simulation calculation at the current simulation step.

[0063] The target circuit is a circuit that needs to be simulated and calculated, which may be a partial circuit in a regional power grid or another manually specified circuit. The target circuit may include multiple control elements and multiple electrical elements.

[0064] For an intuitive introduction to the simulation circuit, please refer to Figure 2 , the figure shows an optional target circuit to be simulated.

[0065] The various control elements of the target circuit can be expressed as Figure 2The control1~control4 in the target circuit can be referred to as C1~C4 respectively; and the controlled voltage source DC, the resistor R, the capacitor C, and the inductor L are the electrical components in the target circuit, which can be referred to as P1~P4 respectively. The simulation of the target circuit by the current simulation step can be based on the connection relationship of the target circuit, and the simulation calculations of the control components C1~C4 and the electrical components P1~P4 are performed in a certain order.

[0066] In addition, in actual simulation calculations, there are situations where multiple CPU cores, multiple CPUs, and multiple computer resources can be used for simulation, so multiple threads of hardware resources for target circuit simulation calculations can be determined.

[0067] The above-mentioned threads may be threads of a manually specified number, or may be idle and actually available threads. The number of threads depends on the specific situation.

[0068] In an optional implementation, the number of threads can be the same as the maximum value of the number of electrical components and the number of control components that can be processed in parallel, that is, the number of threads can be guaranteed to meet the maximum number of parallel simulation calculations of electrical components or control components.

[0069] Step S110: determining a plurality of simulation tasks corresponding to the target circuit and the simulation calculation time consumption of each of the simulation tasks.

[0070] Specifically, the simulation calculation of each control element can be used as a simulation task, the simulation calculation of each electrical element can also be used as a simulation task, and the matrix inversion calculation corresponding to the simulation calculation of each electrical element can be used as a simulation task. Therefore, multiple simulation tasks can include the simulation calculation of each control element, the simulation calculation of each electrical element and the matrix inversion calculation.

[0071] The matrix inversion calculation introduced above can be an N*N matrix inversion calculation whose dimension is the number of electrical components. Figure 2 For example, a target circuit includes 4 electrical components, and the matrix inversion calculation of the target circuit can be the inversion calculation of a 4*4 matrix. In addition, the matrix inversion calculation can be performed only once per simulation step, and the corresponding simulation calculation time is generally positively correlated with the matrix dimension N.

[0072] Specifically, each simulation task takes a certain amount of time in simulation calculation, and the specific duration varies according to the characteristics of each component and the connection relationship of the target circuit.

[0073] The simulation calculation of the electrical components introduced above can be the solution calculation time of the historical current of each electrical component.

[0074] In addition, the above-mentioned control elements and electrical elements are the computing subjects of the target circuit simulation calculation. According to the pre-set communication relationship, communication may occur after the calculation of any two computing subjects is completed. The amount of communication data depends on the actual situation, and the communication time is generally much shorter than the simulation calculation time.

[0075] Step S120: allocating each of the simulation tasks to each of the threads for simulation calculation according to the simulation calculation time consumption and correlation relationship of each of the simulation tasks, and obtaining a plurality of allocation modes.

[0076] Specifically, each simulation task may be allocated to each thread for simulation according to the simulation calculation time consumption of each simulation task, and the simulation sequence relationship of the allocated simulation tasks may satisfy the association relationship between each simulation task.

[0077] Step S130: Determine, among the multiple allocation methods, a target allocation method that has the shortest total simulation calculation time required to complete all the simulation tasks.

[0078] Specifically, there can be multiple threads and simulation tasks, so there will be multiple ways to allocate each simulation task on each thread. Therefore, according to the simulation calculation time of each simulation task, and the electrical allocation method corresponding to each electrical component or the control allocation method corresponding to each control component in each allocation method, the allocation method with the shortest total simulation calculation time can be selected from multiple allocation methods as the target allocation method. Among them, the electrical allocation method of each allocation method can be the allocation method of the simulation tasks corresponding to each electrical component on multiple threads, and the control allocation method can be the allocation method of the simulation tasks corresponding to each control component on multiple threads.

[0079] Then, each simulation task can be allocated to each thread for simulation calculation according to the target allocation method.

[0080] It can be seen from the above scheme that the present application first determines the simulation calculation time of each control element and electrical element of the target circuit and the time of the matrix inversion calculation corresponding to each electrical element, and then determines the simulation task allocation method with the shortest total simulation calculation time as the target allocation method based on the multiple threads used for simulation calculation. Obviously, the present application further selects the target allocation method with the shortest time from multiple allocation methods based on the simulation calculation time of each simulation task and the electrical allocation method corresponding to each electrical element in each allocation method or the control allocation method corresponding to each control element, and performs simulation calculation according to the target allocation method, which can shorten the overall time of the power system simulation process and accelerate the power system simulation process.

[0081] In some embodiments of the present application, the above-mentioned step S120 is introduced: according to the simulation calculation time and the correlation relationship of each of the simulation tasks, each of the simulation tasks is allocated to each of the threads for simulation calculation, and a plurality of allocation methods are obtained. The correlation relationship between the various simulation tasks introduced above can be referred to the following description.

[0082] Specifically, the association relationship between each simulation task may include: the parallel relationship of the simulation tasks corresponding to each electrical component in the simulation process, the sequence relationship and parallel relationship of the simulation tasks corresponding to each control component in the simulation process, and the sequence relationship between the simulation task corresponding to the matrix inversion calculation and the simulation tasks of all electrical components.

[0083] Among them, the simulation tasks corresponding to various electrical components can be processed simultaneously in different threads, or can be processed successively in the same thread. The specific processing sequence relationship can be determined according to actual conditions.

[0084] Because the matrix inversion calculation can be performed only once in each simulation step, the simulation task corresponding to the matrix inversion calculation and the simulation tasks of all electrical components can be in the order of: first complete the simulation tasks corresponding to all electrical components, and then process the simulation tasks corresponding to the matrix inversion calculation.

[0085] In addition, the connection relationships between the control elements in different target circuits are different. The simulation calculation sequence of the control elements of each target circuit can be determined by the circuit connection relationship, and the parallel relationship obtained by simulation calculation can conform to the logical relationship of the circuit connection relationship.

[0086] Next, we will use specific examples to introduce the order and parallel relationship of the simulation tasks corresponding to each control element. For details, please refer to Figure 3 , Figure 3 for Figure 2 A schematic diagram showing the simulation calculation relationship of the target circuit.

[0087] Among them, P1~P4 correspond to Figure 2 Each electrical component in, R is the matrix inversion calculation of each electrical component.

[0088] C1~C4 corresponds to Figure 2 In the control elements of control1~control4, it can be known from the connection relationship of the target circuit that the control element C2 must wait for C1 before starting the simulation, and C4 must wait for C2 and C3 before starting the simulation. Therefore, the following can be obtained: Figure 3 The simulation calculation order and parallel relationship of the two branch lines shown are: C1-C2-C4, C3-C4.

[0089] Then, the above-mentioned step S120: allocating each simulation task to each thread for simulation calculation according to the simulation calculation time consumption and correlation relationship of each simulation task to obtain multiple allocation methods may include:

[0090] S1. Allocate the simulation tasks corresponding to the electrical components to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the electrical components and the parallel relationship of the simulation tasks corresponding to the electrical components during the simulation process.

[0091] S2. Allocate the simulation tasks corresponding to the control elements to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the control elements, and the sequence and parallel relationship of the simulation tasks corresponding to the control elements in the simulation process.

[0092] S3. Allocate the simulation task corresponding to the matrix inversion calculation to any one of the threads according to the simulation calculation time consumption of the simulation task corresponding to each of the electrical components and the sequence relationship between the simulation task corresponding to the matrix inversion calculation and the simulation tasks of all the electrical components.

[0093] It can be seen from the above scheme that listing the association relationships among various simulation tasks makes it easier to allocate each simulation task to each thread for processing according to the association relationships.

[0094] In some embodiments of the present application, the above-mentioned step S130 is introduced: a process of determining a target allocation method with the shortest total simulation calculation time for completing all the simulation tasks among multiple allocation methods. Next, this process will be further explained.

[0095] Specifically, we can first introduce the allocation method of this process:

[0096] The simulation tasks include simulation calculations of electrical components, matrix calculations of electrical components, and simulation calculations of control components. The matrix calculations can be performed after the simulation calculations of each electrical component are completed, and the simulation calculations of the control components need to be divided into several parallel branches according to the connection relationship of the target circuit. Based on the above simulation sequence and logic, all allocation methods of the simulation tasks in each thread are determined.

[0097] Next, we will introduce the above allocation method with a specific example. Figure 3 Taking the schematic diagram of the simulation calculation relationship shown as an example, two optional simulation task allocation methods of the target circuit are introduced.

[0098] refer to Figure 4a -b, which shows two optional simulation task allocation methods for the target circuit. It can be seen that Figure 4aThe order of each simulation task is fully considered. Figure 4b The allocation method shown has a shorter simulation end time and a relatively higher simulation efficiency.

[0099] Then, you can traverse the multiple allocation methods obtained and select the allocation method with the shortest total simulation calculation time. The traversal process can refer to the following instructions:

[0100] S1. Randomly sort and number multiple allocation methods.

[0101] Specifically, in order to better perform the traversal process, multiple allocation methods can be used for sorting, and the sorting basis can be random or according to user-specified rules.

[0102] S2. Subtract the time consumed for matrix inversion calculation from the total simulation calculation time consumed for each simulation task in the first allocation method to obtain a candidate time consumed.

[0103] According to each allocation method, each simulation task is allocated and simulation calculation is performed. Then, each allocation method may correspond to a total simulation calculation time for completing all simulation tasks. The total time may be subtracted from the time of matrix inversion calculation to obtain the candidate time.

[0104] S3. Starting from the second allocation method in numerical order, the total electrical time consumption of the simulation task corresponding to each electrical component in each allocation method, or the total control time consumption of the simulation task corresponding to each control component, or the comprehensive total time consumption obtained by adding the total electrical time consumption and the total control time consumption, is compared with the candidate time consumption.

[0105] Under each allocation method, the time required to complete the simulation tasks corresponding to all electrical components can be used as the total electrical time, and the time required to complete the simulation tasks corresponding to all control components can be used as the total control time. The total electrical time and the total control time are added together to obtain the comprehensive total time.

[0106] Starting from the second allocation method in numerical order, the total electrical time, the total control time, or the comprehensive time of each allocation method is compared with the candidate time obtained in step S2.

[0107] S4. After comparing all allocation methods, a final candidate time consumption is obtained, and the allocation method corresponding to the final candidate time consumption is determined as the target allocation method.

[0108] Further, the above step S3 is described in detail, and specifically, the following situations may be included:

[0109] If the total electrical time consumption is greater than or equal to the candidate time consumption, it can be said that the electrical allocation method in the current allocation method is inferior to the electrical allocation method in the allocation method corresponding to the candidate time consumption. Then the current allocation method and other allocation methods with the same electrical allocation method as the current allocation method can be eliminated, and the eliminated allocation methods may no longer participate in the subsequent comparison process with the candidate time consumption.

[0110] If the total control time is greater than or equal to the candidate time, it can be said that the control allocation method in the current allocation method is inferior to the control allocation method in the allocation method corresponding to the candidate time, so the current allocation method and other allocation methods with the same control allocation method as the current allocation method can be eliminated;

[0111] If the comprehensive total time consumption is less than the candidate time consumption, it can be said that the current allocation method is better than the allocation method corresponding to the candidate time consumption. Then the total simulation calculation time consumption of each simulation task of the current allocation method minus the matrix inversion calculation time consumption can be used as the new candidate time consumption.

[0112] It can be seen from the above scheme that according to the above time analysis, the allocation method with the shortest time and the target simulation calculation method can be obtained by traversing all allocation methods in sequence, thereby achieving optimized acceleration of simulation calculation.

[0113] The power system simulation optimization calculation device provided in the embodiment of the present application is described below. The power system simulation optimization calculation device described below and the power system simulation optimization calculation method described above can be referenced to each other.

[0114] First, combine Figure 5 The power system simulation optimization computing device is introduced, such as Figure 5 As shown, the power system simulation optimization computing device may include:

[0115] A target circuit acquisition unit 100 is used to acquire a target circuit to be simulated and a plurality of threads corresponding thereto, wherein the threads are used for simulation of the target circuit, and the target circuit includes a plurality of control elements and a plurality of electrical elements;

[0116] A simulation task determination unit 110 is used to determine a plurality of simulation tasks corresponding to the target circuit and a simulation calculation time consumption of each of the simulation tasks, wherein the plurality of simulation tasks include simulation calculations of each of the control elements, simulation calculations of each of the electrical elements, and matrix inversion calculations corresponding to the simulation calculations of each of the electrical elements;

[0117] The task allocation unit 120 is used to allocate each of the simulation tasks to each of the threads for simulation calculation according to the simulation calculation time consumption and correlation relationship of each of the simulation tasks, so as to obtain multiple allocation modes;

[0118] The target allocation determination unit 130 is used to determine the target allocation method with the shortest total simulation calculation time for completing all the simulation tasks among multiple allocation methods based on the simulation calculation time of each of the simulation tasks and the electrical allocation method corresponding to each electrical component or the control allocation method corresponding to each control component in each of the allocation methods, and allocate each of the simulation tasks to each of the threads for simulation calculation based on the target allocation method.

[0119] Optionally, the association relationship between the simulation tasks includes:

[0120] The parallel relationship of the simulation tasks corresponding to each electrical component in the simulation process, the sequence and parallel relationship of the simulation tasks corresponding to each control component in the simulation process, and the sequence relationship between the simulation tasks corresponding to the matrix inversion calculation and the simulation tasks of all electrical components;

[0121] The task allocation unit comprises:

[0122] A first task allocation subunit is used to allocate the simulation tasks corresponding to the electrical components to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the electrical components and the parallel relationship between the simulation tasks corresponding to the electrical components during the simulation process;

[0123] A second task allocation subunit is used to allocate the simulation tasks corresponding to the control elements to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the control elements and the sequence and parallel relationship of the simulation tasks corresponding to the control elements in the simulation process;

[0124] The third task allocation subunit is used to allocate the simulation task corresponding to the matrix inversion calculation to any one of the threads according to the simulation calculation time corresponding to each electrical component and the sequence relationship between the simulation task corresponding to the matrix inversion calculation and the simulation tasks of all electrical components.

[0125] Optionally, the target allocation mode determination unit includes:

[0126] A sorting unit, used for randomly sorting and numbering a plurality of the allocation methods;

[0127] A subsequent time consumption determination unit is used to subtract the time consumption of matrix inversion calculation from the total simulation calculation time of each simulation task in the first allocation mode to obtain a candidate time consumption;

[0128] a time consumption comparison unit, configured to compare the total electrical consumption of the simulation task corresponding to each electrical component in each allocation mode, or the total control consumption of the simulation task corresponding to each control component, or the comprehensive total consumption obtained by adding the total electrical consumption and the total control consumption, with the candidate time consumption starting from the second allocation mode in the numerical order;

[0129] The target allocation mode selection unit is used to obtain a final candidate time consumption after comparing all the allocation modes, and determine the allocation mode corresponding to the final candidate time consumption as the target allocation mode.

[0130] Optionally, the time-consuming comparison unit includes:

[0131] A first time consumption comparison subunit is used to eliminate the current allocation mode and other allocation modes having the same electrical allocation mode as the current allocation mode if the total electrical consumption time is greater than or equal to the candidate consumption time;

[0132] A second time consumption comparison subunit is used to eliminate the current allocation mode and other allocation modes having the same control allocation mode as the current allocation mode if the total control consumption time is greater than or equal to the candidate consumption time;

[0133] The third time consumption comparison subunit is used to subtract the time consumption of matrix inversion calculation from the total simulation calculation time of each simulation task in the current allocation mode if the comprehensive total time consumption is less than the candidate time consumption, and the obtained time consumption is used as the new candidate time consumption.

[0134] The power system simulation optimization computing device provided in the embodiment of the present application can be applied to power system simulation optimization computing equipment. Figure 6 The hardware structure diagram of the power system simulation optimization computing device is shown in FIG. Figure 6 ,The hardware structure of the power system simulation optimization computing device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;

[0135] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;

[0136] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;

[0137] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0138] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:

[0139] Acquire a target circuit to be simulated and calculated and a plurality of threads corresponding thereto, wherein the threads are used for simulation calculation of the target circuit, and the target circuit includes a plurality of control elements and a plurality of electrical elements;

[0140] Determine a plurality of simulation tasks corresponding to the target circuit and the simulation calculation time consumption of each of the simulation tasks, wherein the plurality of simulation tasks include simulation calculations of each of the control elements, simulation calculations of each of the electrical elements, and matrix inversion calculations corresponding to the simulation calculations of each of the electrical elements;

[0141] According to the simulation calculation time consumption and correlation relationship of each simulation task, each simulation task is allocated to each thread for simulation calculation, and multiple allocation modes are obtained;

[0142] According to the simulation calculation time of each of the simulation tasks, as well as the electrical allocation method corresponding to each electrical component or the control allocation method corresponding to each control component in each of the allocation methods, among the multiple allocation methods, a target allocation method with the shortest total simulation calculation time for completing all of the simulation tasks is determined, and based on the target allocation method, each of the simulation tasks is allocated to each of the threads for simulation calculation.

[0143] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0144] The embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0145] Acquire a target circuit to be simulated and calculated and a plurality of threads corresponding thereto, wherein the threads are used for simulation calculation of the target circuit, and the target circuit includes a plurality of control elements and a plurality of electrical elements;

[0146] Determine a plurality of simulation tasks corresponding to the target circuit and the simulation calculation time consumption of each of the simulation tasks, wherein the plurality of simulation tasks include simulation calculations of each of the control elements, simulation calculations of each of the electrical elements, and matrix inversion calculations corresponding to the simulation calculations of each of the electrical elements;

[0147] According to the simulation calculation time consumption and correlation relationship of each simulation task, each simulation task is allocated to each thread for simulation calculation, and multiple allocation modes are obtained;

[0148] According to the simulation calculation time of each of the simulation tasks, as well as the electrical allocation method corresponding to each electrical component or the control allocation method corresponding to each control component in each of the allocation methods, among the multiple allocation methods, a target allocation method with the shortest total simulation calculation time for completing all of the simulation tasks is determined, and based on the target allocation method, each of the simulation tasks is allocated to each of the threads for simulation calculation.

[0149] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0150] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0151] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0152] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A power system simulation optimization calculation method, characterized in that: include: Acquire a target circuit to be simulated and calculated and a plurality of threads corresponding thereto, wherein the threads are used for simulation calculation of the target circuit, and the target circuit includes a plurality of control elements and a plurality of electrical elements; Determine a plurality of simulation tasks corresponding to the target circuit and the simulation calculation time consumption of each of the simulation tasks, wherein the plurality of simulation tasks include simulation calculations of each of the control elements, simulation calculations of each of the electrical elements, and matrix inversion calculations corresponding to the simulation calculations of each of the electrical elements; According to the simulation calculation time consumption and correlation relationship of each simulation task, each simulation task is allocated to each thread for simulation calculation, and multiple allocation modes are obtained; According to the simulation calculation time of each of the simulation tasks, as well as the electrical allocation method corresponding to each electrical component or the control allocation method corresponding to each control component in each of the allocation methods, among the multiple allocation methods, a target allocation method with the shortest total simulation calculation time for completing all of the simulation tasks is determined, and based on the target allocation method, each of the simulation tasks is allocated to each of the threads for simulation calculation.

2. The method according to claim 1, characterized in that The association relationship between the simulation tasks includes: The parallel relationship of the simulation tasks corresponding to each electrical component in the simulation process, the sequence and parallel relationship of the simulation tasks corresponding to each control component in the simulation process, and the sequence relationship between the simulation tasks corresponding to the matrix inversion calculation and the simulation tasks of all electrical components; Determining one of the allocation methods of allocating each simulation task to each thread for simulation calculation according to the simulation calculation time consumption of each simulation task and the correlation between each simulation task includes: Allocate the simulation tasks corresponding to the electrical components to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the electrical components and the parallel relationship of the simulation tasks corresponding to the electrical components during the simulation process; Allocate the simulation tasks corresponding to the control elements to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the control elements and the sequence and parallel relationship of the simulation tasks corresponding to the control elements in the simulation process; According to the simulation calculation time consumption of the simulation tasks corresponding to each of the electrical components and the sequence relationship between the simulation tasks corresponding to the matrix inversion calculation and the simulation tasks of all the electrical components, the simulation tasks corresponding to the matrix inversion calculation are allocated to any one of the threads.

3. The method according to claim 1, characterized in that According to the simulation calculation time consumption of each of the simulation tasks, and the electrical distribution mode corresponding to each electrical component or the control distribution mode corresponding to each control component in each of the distribution modes, the target distribution mode of determining the shortest total simulation calculation time consumption for completing all the simulation tasks among the multiple distribution modes includes: Randomly sorting and numbering a plurality of the allocation methods; The total simulation calculation time of each simulation task in the first allocation mode is subtracted from the matrix inversion calculation time to obtain the candidate time; Starting from the second allocation method in numerical order, the total electrical time consumption of the simulation task corresponding to each electrical component in each allocation method, or the total control time consumption of the simulation task corresponding to each control component, or the comprehensive total time consumption obtained by adding the total electrical time consumption and the total control time consumption, is compared with the candidate time consumption; After comparing all the allocation methods, a final candidate time consumption is obtained, and the allocation method corresponding to the final candidate time consumption is determined as the target allocation method.

4. The method according to claim 3, characterized in that The comparing the total electrical time consumption of the simulation task corresponding to each electrical component in each allocation mode, or the total control time consumption of the simulation task corresponding to each control component, or the comprehensive total time consumption obtained by adding the total electrical time consumption and the total control time consumption, with the candidate time consumption includes: If the total electrical time consumption is greater than or equal to the candidate time consumption, the current allocation method and other allocation methods with the same electrical allocation method as the current allocation method are eliminated; If the total control time is greater than or equal to the candidate time, the current allocation method and other allocation methods with the same control allocation method as the current allocation method are eliminated; If the comprehensive total time consumption is less than the candidate time consumption, the total simulation calculation time consumption of each simulation task in the current allocation mode minus the matrix inversion calculation time consumption is used as the new candidate time consumption.

5. A power system simulation optimization calculation device, characterized in that: include: A target circuit acquisition unit, used to acquire a target circuit to be simulated and calculated and a plurality of threads corresponding thereto, wherein the threads are used for simulation calculation of the target circuit, and the target circuit includes a plurality of control elements and a plurality of electrical elements; A simulation task determination unit, used to determine a plurality of simulation tasks corresponding to the target circuit and the simulation calculation time consumption of each of the simulation tasks, wherein the plurality of simulation tasks include the simulation calculation of each of the control elements, the simulation calculation of each of the electrical elements, and the matrix inversion calculation corresponding to the simulation calculation of each of the electrical elements; A task allocation unit, configured to allocate each of the simulation tasks to each of the threads for simulation calculation according to the simulation calculation time consumption and correlation relationship of each of the simulation tasks, so as to obtain multiple allocation modes; The target allocation determination unit is used to determine the target allocation method with the shortest total simulation calculation time for completing all the simulation tasks among multiple allocation methods based on the simulation calculation time of each of the simulation tasks and the electrical allocation method corresponding to each electrical component or the control allocation method corresponding to each control component in each of the allocation methods, and allocate each of the simulation tasks to each of the threads for simulation calculation based on the target allocation method.

6. The device according to claim 5, characterized in that The association relationship between the simulation tasks includes: The parallel relationship of the simulation tasks corresponding to each electrical component in the simulation process, the sequence and parallel relationship of the simulation tasks corresponding to each control component in the simulation process, and the sequence relationship between the simulation tasks corresponding to the matrix inversion calculation and the simulation tasks of all electrical components; The task allocation unit comprises: A first task allocation subunit is used to allocate the simulation tasks corresponding to the electrical components to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the electrical components and the parallel relationship between the simulation tasks corresponding to the electrical components during the simulation process; A second task allocation subunit is used to allocate the simulation tasks corresponding to the control elements to the threads according to the simulation calculation time consumption of the simulation tasks corresponding to the control elements and the sequence and parallel relationship of the simulation tasks corresponding to the control elements in the simulation process; The third task allocation subunit is used to allocate the simulation task corresponding to the matrix inversion calculation to any one of the threads according to the simulation calculation time corresponding to each electrical component and the sequence relationship between the simulation task corresponding to the matrix inversion calculation and the simulation tasks of all electrical components.

7. The device according to claim 5, characterized in that The target allocation mode determination unit includes: A sorting unit, used for randomly sorting and numbering a plurality of the allocation methods; A subsequent time consumption determination unit is used to subtract the time consumption of matrix inversion calculation from the total simulation calculation time consumption of each simulation task in the first allocation mode to obtain a candidate time consumption; a time consumption comparison unit, configured to compare the total electrical consumption of the simulation task corresponding to each electrical component in each allocation mode, or the total control consumption of the simulation task corresponding to each control component, or the comprehensive total consumption obtained by adding the total electrical consumption and the total control consumption, with the candidate time consumption starting from the second allocation mode in the numerical order; The target allocation mode selection unit is used to obtain a final candidate time consumption after comparing all the allocation modes, and determine the allocation mode corresponding to the final candidate time consumption as the target allocation mode.

8. The device according to claim 7, characterized in that The time-consuming comparison unit comprises: A first time consumption comparison subunit is used to eliminate the current allocation mode and other allocation modes having the same electrical allocation mode as the current allocation mode if the total electrical consumption time is greater than or equal to the candidate consumption time; A second time consumption comparison subunit is used to eliminate the current allocation mode and other allocation modes having the same control allocation mode as the current allocation mode if the total control consumption time is greater than or equal to the candidate consumption time; The third time consumption comparison subunit is used to subtract the time consumption of matrix inversion calculation from the total simulation calculation time of each simulation task in the current allocation mode if the comprehensive total time consumption is less than the candidate time consumption, and the obtained time consumption is used as the new candidate time consumption.

9. A power system simulation optimization computing device, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the power system simulation optimization calculation method as claimed in any one of claims 1 to 4.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the power system simulation optimization calculation method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Graphics processor memory management method for power electronics transient simulation acceleration

    CN109271250A

  • Power network simulation method and system containing large-scale power electronic equipment

    CN111709107A