GPU parallel computing method, device, equipment and medium for Prony analysis

Through the GPU parallel computing method, the timeliness of Prony analysis based on CPU in the power grid is solved, efficient trajectory data processing and oscillation analysis are realized, and the ability of grid operation safety control is improved.

CN116339981BActive Publication Date: 2025-03-04STATE GRID BEIJING ELECTRIC POWER CO +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310176558.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-14
Publication Date
2025-03-04
Estimated Expiration
2043-02-14

AI Technical Summary

Technical Problem

The Prony analysis method based on CPU is difficult to synchronously implement the analysis of a large number of electrical trajectory curves within a limited time, especially in the grid simulation calculation of large-scale new energy access, which cannot meet the timeliness of oscillation analysis.

Method used

The GPU parallel computing method is adopted to obtain and extract trajectory data, determine the logic and video memory limits of the GPU, calculate the maximum number of processing threads, dynamically allocate memory, form a GPU computing thread table, activate the parallel computing process, and complete Prony analysis.

Benefits of technology

It improves the computing efficiency of Prony analysis, can process massive trajectory data within a limited time, meets the timeliness of oscillation analysis after large-scale new energy is connected to the power grid, and improves the ability to make safety control decisions in power grid operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116339981B_ABST
    Figure CN116339981B_ABST
Patent Text Reader

Abstract

The present invention discloses a GPU parallel computing method, device, equipment and medium for Prony analysis. The method extracts the length and number of trajectory series to be Prony analyzed from trajectory data, calculates the maximum number of processing threads that meet the logical restriction constraint; calculates the maximum number of processing threads that meet the GPU video memory capacity constraint, takes the minimum value as the size of the GPU available trajectory buffer space, calculates the number of GPU processing batches according to the size of the GPU available trajectory buffer space and the length and number of trajectory series; performs batch processing, summarizes the Prony results of the analysis trajectory under all batches, and completes the Prony analysis. The method solves the problem of fast calculation of wide-area multi-point broadband oscillation characteristic indicators of large-scale access of new energy to the power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of applying modern spectral estimation theory Prony analysis to new power system simulation analysis, and specifically relates to a GPU parallel computing method, device, equipment and medium for Prony analysis. Background Art

[0002] One of the characteristics of the new power system is the access of large-scale renewable energy. The current situation that a large amount of photovoltaic and wind power at the transmitting and receiving ends must be connected to the power grid through power electronic converters has aggravated the oscillation risk of traditional power systems. Since the frequency of oscillations caused by power electronic devices ranges from a few Hz to a few kHz, the range of traditional low-frequency oscillation frequencies from 0.1Hz to 2.5Hz has been greatly expanded, thus forming a more severe broadband oscillation threat to the operation of the power grid. Considering the type and working characteristics of renewable energy, building a digital model of renewable energy during power grid simulation can pre-study or inverse the potential oscillation characteristics of the power grid, and explore the source, propagation path and degree of harm of broadband oscillations in the power grid. To achieve the above goals, it is first necessary to quickly analyze the composition and characteristic parameters of the oscillation from the massive simulation trajectory curves. Common methods for signal analysis of trajectory curves include fast Fourier transform (FFT), empirical mode decomposition, Prony analysis, Hilbert-Huang transform algorithm, etc. In recent years, new methods have been proposed, such as signal parameter estimation based on rotational invariance technology (TLS-ESPRIT), matrix bundle method, random subspace method (SSI), and neural network identification method. However, the technical reliability of the latter is still difficult to determine due to the lack of a large number of engineering practice tests.

[0003] Among the traditional trajectory analysis methods, the Prony numerical analysis method is widely used. It fits the original trajectory signal by superimposing multiple groups of attenuated black waves. It is an extension of the FFT transform and can solve the signal amplitude, attenuation factor, frequency, initial phase and other parameter values. These parameters are the basis for understanding the oscillation characteristic laws contained in the trajectory curve. At present, the CPU-based Prony numerical analysis method has been realized. For example, when calculating transient stability of the PSD power system simulation software, an embedded Prony analysis is carried out for the specified output electrical quantity; when analyzing the curve, an independent Prony analysis module can also be called to carry out oscillation analysis of the selected curve item. From the actual application effect, the oscillation characteristic Prony analysis carried out in the above scenarios is limited by the CPU principle structure and processing power, and it is difficult to simultaneously implement Prony analysis of a large number of electrical trajectory curves within a limited time. Carry out simulation calculation of power grid with large-scale renewable energy access. Due to the characteristics of renewable energy access points, wide coverage, relatively low access voltage level, small individual power generation capacity, relatively large total scale, fast installed capacity and grid-connected growth, when conducting general oscillation analysis, considering the various types of electrical outputs, a single simulation can generate hundreds or thousands of electrical quantity trajectory outputs. The CPU-based Prony analysis implementation method is difficult to meet the timeliness of oscillation analysis after large-scale renewable energy access to the power grid. Summary of the invention

[0004] The purpose of the present invention is to provide a GPU parallel computing method for Prony analysis to solve the problem that the CPU-based Prony analysis implementation method in the prior art is difficult to meet the timeliness of oscillation analysis after large-scale new energy is connected to the power grid.

[0005] To achieve the above object, the present invention adopts the following technical solution:

[0006] A GPU parallel computing method for Prony analysis includes the following steps:

[0007] Obtain trajectory data including large-scale new energy grid simulation calculations;

[0008] Extracting the length and number of trajectory series to be Prony analyzed from the trajectory data;

[0009] Determine the logical restriction constraint of the stream processor SM, and calculate the maximum number of processing threads that meet the logical restriction constraint; obtain the GPU memory capacity, and calculate the maximum number of processing threads that meet the GPU memory capacity constraint based on a preset trajectory memory occupancy coefficient, the GPU memory capacity, and the length and number of trajectory sequences; use the minimum value of the maximum number of processing threads that meet the logical restriction constraint and the maximum number of processing threads that meet the GPU memory capacity constraint as the size of the GPU available trajectory buffer space, and calculate the number of GPU processing batches according to the size of the GPU available trajectory buffer space and the length and number of trajectory sequences;

[0010] Carry out batch processing based on the number of GPU processing batches, organize trajectory data according to the GPU three-level model, dynamically allocate GPU memory, transfer trajectory data to the memory block corresponding to the GPU, and form a GPU computing thread table; construct computing samples based on trajectory data, configure GPU kernel function parameters, and activate parallel computing processes;

[0011] Summarize the Prony results of the analysis tracks under all batches and complete the Prony analysis.

[0012] Furthermore, in the step of obtaining trajectory data containing large-scale new energy grid simulation calculation, the trajectory data includes trajectory electrical quantity type, trajectory channel number C T , trajectory data interval T step and the total simulation time T total ;in:

[0013]

[0014] S=C T ×S track

[0015] In the formula, S track The minimum storage space required for a single trajectory curve, the machine storage space occupied by one curve point is B T 4 bytes; T step Refers to the simulation step length; T total Refers to the total length of one simulation.

[0016] Furthermore, in the step of extracting the length and number of trajectory series to be subjected to Prony analysis from the trajectory data, filtering conditions are selected according to a preset calculation target, and the trajectory series and number to be subjected to Prony analysis are extracted from the trajectory data according to the filtering conditions; wherein the filtering conditions include voltage level, partition, bus name keyword, and variable type.

[0017] Further, in the step of determining the logical restriction constraints of the stream processor SM, the logical restriction constraints of the stream processor SM include:

[0018] Constraint 1: Grid (x, y, z) three-dimensional ordered number range 1≤x≤2 31 -1, 1≤y≤2 16 ,1≤z≤2 16 ;

[0019] Constraint 2: Block (x, y, z) three-dimensional ordered number range 1≤x≤2 10 ,1≤y≤2 10 ,1≤z≤2 6 ;

[0020] Constraint 3: The number of threads contained in a single Block (x, y, z) is no more than 2 10 ;

[0021] Constraint 4: The maximum number of Blocks (x, y, z) resident in a single SM is no more than 2 4 (16);

[0022] Constraint 5: The maximum number of Wraps resident in a single SM is no greater than 3×2 4 (48);

[0023] Constraint 6: The maximum number of threads resident in a single SM is no greater than 3×2 9 (1536);

[0024] Constraint 7: The maximum number of computing cores in a single SM is 2 N .

[0025] Further, in the steps of determining the logical restriction constraint of the stream processor SM, calculating the maximum number of processing threads satisfying the logical restriction constraint; obtaining the GPU memory capacity, and calculating the maximum number of processing threads satisfying the GPU memory capacity constraint based on a preset trace memory occupancy coefficient, the GPU memory capacity, and the length and number of the trace sequence:

[0026] The maximum number of processing threads that meet the logical restriction constraints is calculated as follows:

[0027]

[0028] In the formula, Indicates the maximum number of processing threads constrained by SM; C sm is the number of SMs;

[0029] The maximum number of processing threads that meets the GPU memory capacity constraint is calculated as follows:

[0030]

[0031] In the formula, Indicates the maximum number of processing threads constrained by GM, Ktrack is the trace memory usage coefficient, and GM is the number of video memory bytes.

[0032] Furthermore, in the step of calculating the number of GPU processing batches based on the size of the available trajectory buffer space of the GPU and the length and number of trajectory sequences, the number of GPU processing batches is calculated according to the following formula:

[0033]

[0034] Among them, C batch C is the number of batches processed by the GPU, which is an integer; selection To extract the length and number of trajectory series to be analyzed by Prony; In the formula, it represents the maximum number of processing threads constrained by GM. Indicates the maximum number of processing threads constrained by the SM.

[0035] Furthermore, after the step of activating the parallel computing process, the method further includes:

[0036] For the trajectory data, set the SVD algorithm parameters, and use the AR model to calculate the ideal fitting order and model parameters of the trajectory; construct the Heisenberg matrix, solve the roots of the AR model characteristic equation, and calculate the undetermined gain terms in the homogeneous general solution of the AR model; calculate the amplitude, damping, frequency, and initial phase parameters of the trajectory Prony analysis.

[0037] A GPU parallel computing device for Prony analysis, comprising:

[0038] An acquisition module is used to obtain trajectory data including large-scale new energy power grid simulation calculations;

[0039] An extraction module, used to extract the length and number of trajectory series to be Prony analyzed from the trajectory data;

[0040] The calculation module is used to determine the logical constraint of the stream processor SM, and calculate the maximum number of processing threads that meet the logical constraint; obtain the GPU memory capacity, and calculate the maximum number of processing threads that meet the GPU memory capacity constraint based on a preset trajectory memory occupancy coefficient, the GPU memory capacity, and the length and number of trajectory sequences; use the minimum value of the maximum number of processing threads that meet the logical constraint and the maximum number of processing threads that meet the GPU memory capacity constraint as the size of the GPU available trajectory buffer space, and calculate the number of GPU processing batches according to the size of the GPU available trajectory buffer space and the length and number of trajectory sequences;

[0041] The processing module is used to carry out batch processing based on the number of GPU processing batches, organize the trajectory data according to the GPU three-level model, dynamically allocate GPU memory, transfer the trajectory data to the memory block corresponding to the GPU, and form a GPU computing thread table; construct calculation samples based on the trajectory data, configure GPU kernel function parameters, and activate the parallel computing process;

[0042] The summary module is used to summarize the Prony results of the analysis tracks under all batches and complete the Prony analysis.

[0043] An electronic device includes a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement a GPU parallel computing method for Prony analysis as described above.

[0044] A computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the GPU parallel computing method for Prony analysis is implemented.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] Aiming at the time efficiency problem of Prony analysis of simulation trajectory based on CPU, the present invention proposes a GPU high-performance parallel computing algorithm suitable for large-scale new energy calculation trajectory Prony analysis. It not only extracts the prerequisites for trajectory analysis under limited resource configuration, designs a parallel allocation strategy for batch analysis of massive trajectory oscillation, but also proposes a method for implementing complete Prony analysis on GPU. The invention has important theoretical and application value for determining the boundary capacity of GPU to handle large-scale parallel tasks, and improving the single and overall computing efficiency of multi-track Prony calculation analysis.

[0047] In order to solve the time efficiency problem of Prony analysis of simulation trajectories based on CPU implementation, the present invention proposes a high-performance parallel computing method for Prony analysis of trajectories based on a CPU+GPU hybrid architecture. Combining the differences in GPU resources and configurations, the present invention not only extracts the applicable prerequisites for trajectory analysis under limited resource configuration, designs a parallel allocation strategy for batch analysis of massive trajectory oscillations, but also proposes a method for implementing complete Prony analysis on GPU. The invention has important theoretical and application value for determining the boundary capability of GPUs in processing large-scale parallel tasks, and improving the singleness and overall computing efficiency of multi-track Prony calculation and analysis. The present invention theoretically guides the application development of high-performance Prony analysis of trajectory curves after large-scale access to new energy, and provides a means to grasp the possibility of oscillation risks in power grid operation within a limited time, which is of great significance to the decision-making of power grid operation safety control. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The drawings constituting a part of the present application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0049] Figure 1 A schematic diagram of a flow chart of a GPU parallel computing method according to an embodiment of the present invention;

[0050] Figure 2 This is a schematic diagram of the key steps of the Prony analysis GPU implementation algorithm in an embodiment of the present invention;

[0051] Figure 3 This is an example diagram of a trajectory curve case of large-scale new energy stability simulation calculation in an embodiment of the present invention;

[0052] Figure 4 This is a schematic diagram of the structural principle of SM in a GPU according to an embodiment of the present invention;

[0053] Figure 5 This is a schematic diagram of the corresponding arrangement of a single SM computing core and threads according to an embodiment of the present invention;

[0054] Figure 6 This is a structural block diagram of a GPU parallel computing device for Prony analysis according to an embodiment of the present invention;

[0055] Figure 7 The present invention is a structural block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0057] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise specified, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention.

[0058] Example 1

[0059] like Figure 1 and Figure 2 As shown, this scheme provides a GPU parallel computing method for Prony analysis, including:

[0060] S1. Obtain trajectory data containing large-scale new energy power grid simulation calculations.

[0061] Specifically, for the oscillation characteristics analysis after large-scale renewable energy access, it is necessary to screen out the voltage trajectory data of the renewable energy convergence busbar, the important voltage support nodes of the power grid, and the power trajectory data of the branches connected to them. The screened trajectory data is recorded as C selection .

[0062] Specifically, this solution performs transient simulation calculations on a large-scale renewable energy grid, such as Figure 3 In the case shown, according to the actual analysis needs, a large number of trajectory curves will be generated for nodes and branches during the calculation process, including node voltage, branch current, branch power, unit power angle, minimum frequency, minimum voltage, etc. The trajectory curves are recorded in the data file, and the data file configuration parameters are read and parsed, including the trajectory electrical quantity type, the number of trajectory channels C T , trajectory data interval T step , total simulation time T total .

[0063] To be more specific, in order to accurately calculate the data file capacity S, it is also necessary to clarify the storage precision byte size B of a single electrical data in the computing machine. T ;

[0064] The above parameter relationship satisfies the following formula:

[0065]

[0066] S=C T ×S track (2)

[0067] Explanation of the meaning of variables in the above formula: S track The minimum storage space required for a single trajectory curve, in bytes. In this solution, the trajectory is represented by a single-precision number. The machine storage space occupied by one curve point is B T 4 bytes; T step Refers to the simulation step length, in ms. In this scheme, transient simulation calculation is divided into electromechanical transient simulation and electromagnetic transient simulation. Among them, the electromechanical transient simulation step length is 10ms or 20ms; for electromagnetic transient simulation, the step length is 50μs; T total Refers to the total length of a simulation, which is consistent with the simulation step unit and is determined based on the simulation duration and calculation accuracy. T is the number of trajectory channels, and S is the data file capacity.

[0068] S2. Extract the length and number of trajectory series to be analyzed by Prony from the trajectory data.

[0069] In this scheme, the screening conditions are selected according to the preset calculation objectives, and the trajectory series and quantity to be analyzed by Prony are extracted from the trajectory data according to the screening conditions; the screening conditions include voltage level, partition, bus name keywords, etc. By screening the trajectory curves suitable for Prony analysis, it is not only helpful to obtain relatively accurate oscillation parameters and quickly understand the distribution of oscillation in the system, but also helps to save the total calculation time.

[0070] S3. Determine the logical restriction constraints of the stream processor SM, and calculate the maximum number of processing threads that meet the logical restriction constraints; obtain the GPU memory capacity, and calculate the maximum number of processing threads that meet the GPU memory capacity constraint based on the preset trajectory memory occupancy coefficient, GPU memory capacity, and the length and number of trajectory sequences; use the minimum value of the maximum number of processing threads that meet the logical restriction constraints and the maximum number of processing threads that meet the GPU memory capacity constraint as the size of the GPU available trajectory buffer space, and calculate the number of GPU processing batches based on the size of the GPU available trajectory buffer space and the length and number of trajectory sequences.

[0071] Specifically, in this solution, the GPU memory capacity is extracted by reading the GPU card capability information.

[0072] It should be noted that the GPU constructs a three-level parallel processing model, namely, the grid, the block and the thread. The goal of the present invention is to correspond the Prony analysis of each trajectory curve to a single thread. There are many types of GPU chips. In order to make the Prony analysis universally adapt to the GPU three-level parallel processing model, the differences between different GPU models need to be considered to prevent instability in the loading, calculation, and aggregation processes.

[0073] This solution mainly deals with three aspects of problems: the logical boundaries of the three-level model, the physical capabilities of the chip, and the thread optimization allocation for quantitative trajectory scale. The specific constraint data of this invention comes from the GeForce RTX 3060TI produced by NVIDIA, and other GPUs can also obtain similar parameter limits according to the product description.

[0074] (1) Logical boundaries of the three-level model

[0075] The parallel processing boundary of the three-level model is mainly controlled by the SM (Streaming Multiprocessor), which is represented by the second-level 3D ordered numbers, pointing to the grid (x, y, z) and the block (x, y, z). The smallest scheduling unit when the SM is running is Wrap.

[0076] SM must satisfy the following logical constraints:

[0077] Constraint 1: Grid (x, y, z) three-dimensional ordered number range 1≤x≤231 -1, 1≤y≤2 16 ,1≤z≤2 16 ;

[0078] Constraint 2: Block (x, y, z) three-dimensional ordered number range 1≤x≤2 10 ,1≤y≤2 10 ,1≤z≤2 6 ;

[0079] Constraint 3: The number of threads contained in a single Block (x, y, z) is no more than 2 10 ;

[0080] Constraint 4: The maximum number of Blocks (x, y, z) resident in a single SM is no more than 2 4 (16);

[0081] Constraint 5: The maximum number of Wraps resident in a single SM is no greater than 3×2 4 (48);

[0082] Constraint 6: The maximum number of threads resident in a single SM is no greater than 3×2 9 (1536);

[0083] Constraint 7: The maximum number of computing cores in a single SM is 2 N , the value of N depends on the GPU model.

[0084] like Figure 4 The figure shows the schematic diagram of the SM structure principle in the GPU. Different GPU chips have different numbers of SMs and can process different upper limits of parallel threads. The maximum number of threads is 1536 times the number of SMs (C sm ×3×2 9 ). When implementing Grid(x,y,z) and Block(x,y,z) dimension segmentation and thread optimization arrangement, the above 7 constraints must be met, otherwise it will cause calculation abnormalities.

[0085] (2) Physical capabilities of specific chips

[0086] like Figure 5 The figure shows the corresponding schematic diagram of the single SM computing core and thread arrangement. Considering the physical processing capability of the SM, the number of single Prony analysis trajectories satisfies the following formula:

[0087]

[0088] In the formula, Indicates the maximum number of processing threads that meet the logical constraints of the SM. For example, C sm is equal to 38, and the parallel number is 58368; C smis the number of SMs.

[0089] In addition to SM, the physical constraints on the parallel number of Prony analysis are also the constraints of the video memory GM (Global Memory).

[0090] Considering the carrying capacity of GM, combining the trajectory occupancy and computing consumption on GM, take an appropriate proportional coefficient K track , determine the number of trajectories processed simultaneously at a single time, the calculation formula is as follows:

[0091]

[0092] In the formula, Indicates the maximum number of processing threads constrained by the GPU memory capacity; K track is the memory usage coefficient of the trace, which can be around 0.2; GM is the number of bytes of video memory.

[0093] The principle of GPU single processing parallelism is:

[0094] (3) Thread Optimization Allocation for Quantitative Trajectory Scale

[0095] After determining the maximum number of parallel tracks that can be processed at a time, two more steps need to be taken:

[0096] 1) Calculate the batch size of the analysis trajectory selected in step S2, and the calculation formula is as follows:

[0097]

[0098] Among them, C batch C is the number of batches processed by the GPU, which is an integer; selection To extract the length and number of trajectory series to be analyzed by Prony; In the formula, it represents the maximum number of processing threads constrained by GM. Indicates the maximum number of processing threads constrained by the SM.

[0099] Considering that Prony analysis cannot split the single trajectory calculation process, rounding is required when calculating the batch quantity, especially when C is calculated by formula (5). batch , when satisfied When batch Used after incrementing by 1.

[0100] 2) Yes The results are optimized in Grid(x,y,z) and Block(x,y,z) in SM. To achieve the best overall GPU thread scheduling, Prony parallel analysis is used as 2 NAssign the work sequence of the unit to the SM, so that at most one set of SMs will run non-optimally, and the other SMs will maintain the optimal thread and run at the highest efficiency. N Distributing SM work tasks can keep the overall computing efficiency optimized.

[0101] S4. Carry out batch processing based on the number of GPU processing batches, organize the trajectory data according to the GPU three-level model, dynamically allocate GPU memory, transfer the trajectory data to the memory block corresponding to the GPU, and form a GPU computing thread table; construct calculation samples based on the trajectory data, configure GPU kernel function parameters, and activate the parallel computing process.

[0102] Specifically, when batch processing is carried out, a batch processing counter is set. When the counter value is less than C batch When a batch of trajectory curve data is organized on the CPU chip, the trajectory curve data is first reorganized according to the GPU three-level model. Suppose the number of trajectories processed at a time is C k (k=1,…,C batch ), for easy operation and understanding, the GPU uses a one-dimensional dynamic change mode for thread encoding Grid and Block values, which are Grid(x,1,1), and the value of x can range from 1 to C. sm , Block(x',1,1), the value of x' can range from 1 to 16, and the value of x×x′-1 is used as the index of the trajectory data and the index of the Prony analysis thread. The maximum number of trajectories processed by a single GPU is 16×C sm If the value is less than value, then the denominator of formula (5) can be taken as 16×C sm Fixed value (after GPU model is selected C sm is a constant). The trajectory data index table is stored in the order of data address and data size structure. After the data is organized, it is loaded into the GM of the GPU according to the index order, and the corresponding kernel function is configured to activate the processing process of Prony analysis on the GPU.

[0103] Specifically, the calculation process in the GPU is as follows:

[0104] For the trajectory data, set the SVD algorithm parameters, and use the AR model to calculate the ideal fitting order and model parameters of the trajectory; construct the Heisenberg matrix, solve the roots of the AR model characteristic equation, and calculate the undetermined gain terms in the homogeneous general solution of the AR model; calculate the amplitude, damping, frequency, and initial phase parameters of the trajectory Prony analysis.

[0105] Specifically, for the trajectory data, the SVD algorithm parameters are set, and the AR model is used to calculate the ideal fitting order and model parameters of the trajectory. The steps are as follows:

[0106] Suppose a trajectory curve V contains N calculated output points (x1, x2, ..., x N ), the following uses this trajectory to illustrate the algorithm for calculating Prony parameters in a single thread in the GPU. The Prony analysis of a curve trajectory is to decompose the trajectory into a series of damped harmonic superpositions (see 6-1).

[0107]

[0108] The SVD method is used to calculate the order of the AR model, and the sampling data is used to fit an autoregressive (AR) model. Formula (6-2) is the general expression of the p-order AR model.

[0109]

[0110] Where p is the model fitting order, a i is the regression coefficient.

[0111] The Hankel matrix constructed from the sample data is shown in equation (7). When n is greater than the actual model order p of the system, R(A) = p.

[0112]

[0113] Substituting the curve trajectory data into equation (6-2) yields equation (8), denoted as Aa = b:

[0114]

[0115] The singular value decomposition expression of matrix A is shown in formula (9):

[0116] A=UΣV T (9)

[0117] When round-off errors and noise are not considered, the order of Prony's model fitting, p, is equal to the rank of matrix A. After performing singular value decomposition on matrix A, its ranking values ​​are δ1,…,δ n If the rank is k, then δ1,…,δ k >0 and δ k+1 , …, δ n = 0, but there is always noise interference in the actual data, and there are rounding errors in the calculation process, so the results are likely to be δ1,…,δ n > 0, but it contains singular values ​​very close to 0. In order to determine the model fitting order of Prony, the normalized ratio method is used to determine the calculation formula of the AR model order, as shown in formula (10).

[0118]

[0119] According to the accuracy requirement, a threshold value very close to 1 is set, such as 0.96. After taking an initial value, the k value is continuously increased. When v(k) is just greater than the threshold k, it is taken as the order p of the AR model.

[0120] Next, the least squares method is used to solve the AR model parameter vector ai. First, the coefficient matrix A is rearranged according to the order p to generate the matrix

[0121]

[0122]

[0123]

[0124] At this time, the known trajectory data is constructed Satisfies the equation:

[0125]

[0126] Parameter vector The calculation result of is derived from formula (14):

[0127]

[0128] So far, the model fitting order p and regression coefficient a of the AR model have been obtained. i .

[0129] More specifically, the Heisenberg matrix is ​​constructed, the roots of the characteristic equation of the AR model are solved, and the undetermined gain terms in the homogeneous general solution of the AR model are calculated. The steps are as follows:

[0130] First, establish the characteristic equation of the AR model:

[0131] λ p +a1λ p-1 +...+a p-1 λ p +a p =0 (16)

[0132] Construct the Heisenberg matrix:

[0133]

[0134] The roots of the matrix characteristic polynomial are the solutions of the high-order algebraic equation of formula (16). The QR method is used to solve the Heisenberg matrix. The specific process is as follows:

[0135] (1) Let C1 = C;

[0136] (2) Construct an orthogonal matrix Qk and the reversible upper triangular matrix R k , when k=1,2,…, calculate respectively:

[0137]

[0138] (3) From the above formula, we can deduce C k , C k+1 There is a relationship between:

[0139]

[0140] Description C k+1 With C k Therefore, given the error accuracy, C k+1 It converges to the inverse triangular matrix. When the diagonal element of the inverse triangular matrix is ​​a first-order square matrix, it corresponds to a real eigenvalue; when the diagonal element is a second-order square matrix, it corresponds to a pair of conjugate eigenvalues. After deducing to the pth order, we get all the eigenroots of the Hessian matrix λ1,...,λ p The characteristic roots reflect the damping and frequency characteristics of the AR model equation 6-1.

[0141] Find λ1,...,λ p The eigenvalue of is also the solution of the high-order algebraic equation (16). According to the difference equation theory, the homogeneous general solution of equation (6-2) can be written as:

[0142]

[0143] Among them, [G1,G2,…,G p ] T is the gain vector, which is related to the amplitude and initial phase angle in the AR model formula (6-1) and is the quantity to be determined.

[0144] Since the curve trajectory data point sequence is also a solution to the homogeneous equation, it also satisfies equation (20) and can form a matrix equation:

[0145]

[0146] In formula 21, λ1,...,λ p and x(i) are known, and the least squares method is used again to solve the gain G=[G1,G2,…,G p ] T .

[0147] More specifically, calculate the amplitude, damping, frequency, and initial phase parameters of the trajectory Prony analysis. The steps are as follows:

[0148] Using characteristic root λ i Calculate damping and frequency using gain G iCalculate the amplitude and initial phase factor. Let A i , δ i , f i They are the amplitude, initial phase, damping and frequency corresponding to the trajectory curve, which are calculated in sequence by the following formulas:

[0149]

[0150] S5. Summarize the Prony results of the analysis tracks in all batches and complete the Prony analysis.

[0151] Further, after summarizing and analyzing the Prony results of the trajectory, post-processing comprehensive operations such as sorting and classification are carried out

[0152] Prony analysis of a single batch of trajectory curves is done in parallel on the GPU, and the The oscillation characteristic parameters of the curves are formed into curve indexes, formatted and transferred to the GPU buffer to complete the Prony analysis of the trajectory curves of a single batch. The batch counter is increased by 1. If it is not greater than C batch , then organize a new batch of trajectory data in order, go back to step S4, download the allocated data to the GPU, start the subsequent process, and repeat the operation with a different batch of data until all the selected trajectories are analyzed.

[0153] In the process of multiple batch processing, except that the number of trajectories processed in the last batch may be insufficient, the number of trajectories processed in other batches is always the same. Due to the differences in the oscillation characteristics contained in the selected trajectory curves, the time consumed in the calculation of the AR model order and coefficient process in a single batch is also different. Therefore, when multiple batches are looped, it is necessary to wait until the analysis results of all trajectory curves of a batch are sent to the CPU before the operation of the next batch can be started. Considering this, try to organize the same type of trajectories in adjacent batches for calculation, which is conducive to the synchronization of calculations within a single batch and can also help improve the calculation efficiency. When all the selected trajectory curves are analyzed, it is necessary to use the oscillation mode f i Taking the oscillation characteristics of different curves as the main factor, a comparative analysis is conducted to summarize the potential oscillation modes and risk severity under the current working conditions of the power grid.

[0154] Example 2

[0155] like Figure 6 As shown, a GPU parallel computing device for Prony analysis includes:

[0156] The acquisition module is used to obtain trajectory data containing large-scale new energy power grid simulation calculations.

[0157] In the acquisition module, the trajectory data includes the trajectory electrical quantity type, the number of trajectory channels C T, trajectory data interval T step and the total simulation time T total ;in:

[0158]

[0159] S=C T ×S track

[0160] In the formula, S track The minimum storage space required for a single trajectory curve, the machine storage space occupied by one curve point is B T 4 bytes; T step Refers to the simulation step length; T total Refers to the total length of one simulation.

[0161] The extraction module is used to extract the length and number of trajectory series to be analyzed by Prony from the trajectory data.

[0162] In the extraction module, the filtering conditions are selected according to the preset calculation target, and the trajectory series and quantity to be analyzed by Prony are extracted from the trajectory data according to the filtering conditions; the filtering conditions include voltage level, partition, bus name keyword, and variable type.

[0163] The calculation module is used to determine the logical constraints of the stream processor SM and calculate the maximum number of processing threads that meet the logical constraints; obtain the GPU memory capacity, and calculate the maximum number of processing threads that meet the GPU memory capacity constraint based on a preset trajectory memory occupancy coefficient, the GPU memory capacity, and the length and number of trajectory sequences; use the minimum value of the maximum number of processing threads that meet the logical constraints and the maximum number of processing threads that meet the GPU memory capacity constraint as the size of the GPU available trajectory buffer space, and calculate the number of GPU processing batches based on the size of the GPU available trajectory buffer space and the length and number of trajectory sequences.

[0164] In the computing module, the logical constraints of the stream processor SM include:

[0165] Constraint 1: Grid (x, y, z) three-dimensional ordered number range 1≤x≤2 31 -1, 1≤y≤2 16 ,1≤z≤2 16 ;

[0166] Constraint 2: Block (x, y, z) three-dimensional ordered number range 1≤x≤2 10 ,1≤y≤2 10 ,1≤z≤2 6 ;

[0167] Constraint 3: The number of threads contained in a single Block (x, y, z) is no more than 210 ;

[0168] Constraint 4: The maximum number of Blocks (x, y, z) resident in a single SM is no more than 2 4 (16);

[0169] Constraint 5: The maximum number of Wraps resident in a single SM is no greater than 3×2 4 (48);

[0170] Constraint 6: The maximum number of threads resident in a single SM is no greater than 3×2 9 (1536);

[0171] Constraint 7: The maximum number of computing cores in a single SM is 2 N .

[0172] The maximum number of processing threads that meets the logical restriction constraints is calculated as follows:

[0173]

[0174] In the formula, Indicates the maximum number of processing threads constrained by SM; C sm is the number of SMs;

[0175] The maximum number of processing threads that meets the GPU memory capacity constraint is calculated as follows:

[0176]

[0177] In the formula, Indicates the maximum number of processing threads constrained by GM, K track is the trace memory usage coefficient, and GM is the number of video memory bytes.

[0178] The number of GPU processing batches is calculated as follows:

[0179]

[0180] Among them, C batch C is the number of batches processed by the GPU, which is an integer; selection To extract the length and number of trajectory series to be analyzed by Prony; In the formula, it represents the maximum number of processing threads constrained by GM. Indicates the maximum number of processing threads constrained by the SM.

[0181] The processing module is used to carry out batch processing based on the number of GPU processing batches, organize the trajectory data according to the GPU three-level model, dynamically allocate GPU memory, transfer the trajectory data to the memory block corresponding to the GPU, and form a GPU computing thread table; construct calculation samples based on the trajectory data, configure GPU kernel function parameters, and activate the parallel computing process;

[0182] The processing module is also used to set the SVD algorithm parameters for the trajectory data, and use the AR model to calculate the ideal fitting order and model parameters of the trajectory; construct the Heisenberg matrix, solve the roots of the characteristic equation of the AR model, and calculate the undetermined gain terms in the homogeneous general solution of the AR model; calculate the amplitude, damping, frequency, and initial phase parameters of the trajectory Prony analysis.

[0183] The summary module is used to summarize the Prony results of the analysis tracks under all batches and complete the Prony analysis.

[0184] Example 3

[0185] like Figure 7 As shown, the present invention also provides an electronic device 100 for implementing a GPU parallel computing method for Prony analysis in Example 1; the electronic device 100 includes a memory 101, at least one processor 102, a computer program 103 stored in the memory 101 and executable on the at least one processor 102, and at least one communication bus 104. The memory 101 can be used to store the computer program 103, and the processor 102 implements the steps of a GPU parallel computing method for Prony analysis in Example 1 by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101.

[0186] The memory 101 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data (such as audio data) created according to the use of the electronic device 100, etc. In addition, the memory 101 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.

[0187] At least one processor 102 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 102 may be a microprocessor or any conventional processor, etc. The processor 102 is the control center of the electronic device 100, and uses various interfaces and lines to connect various parts of the entire electronic device 100.

[0188] The memory 101 in the electronic device 100 stores a plurality of instructions to implement a GPU parallel computing method for Prony analysis, and the processor 102 can execute the plurality of instructions to implement:

[0189] Obtain trajectory data including large-scale new energy grid simulation calculations;

[0190] Extract the length and number of trajectory series to be analyzed by Prony from the trajectory data;

[0191] Determine the logical constraints of the stream processor SM, and calculate the maximum number of processing threads that meet the logical constraints; obtain the GPU memory capacity, and calculate the maximum number of processing threads that meet the GPU memory capacity constraints based on the preset trajectory memory occupancy coefficient, GPU memory capacity, and the length and number of trajectory sequences; use the minimum value of the maximum number of processing threads that meet the logical constraints and the maximum number of processing threads that meet the GPU memory capacity constraints as the size of the GPU available trajectory buffer space, and calculate the number of GPU processing batches based on the size of the GPU available trajectory buffer space and the length and number of trajectory sequences;

[0192] Carry out batch processing based on the number of GPU processing batches, organize trajectory data according to the GPU three-level model, dynamically allocate GPU memory, transfer trajectory data to the memory block corresponding to the GPU, and form a GPU computing thread table; construct computing samples based on trajectory data, configure GPU kernel function parameters, and activate parallel computing processes;

[0193] Summarize the Prony results of the analysis tracks under all batches and complete the Prony analysis.

[0194] Example 4

[0195] If the module / unit integrated in the electronic device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory and read-only memory (ROM, Read-Only Memory).

[0196] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0197] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0198] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0199] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0200] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0201] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A GPU parallel computing method for Prony analysis, characterized in that: The following steps are involved: Obtain trajectory data including large-scale new energy grid simulation calculations; Extracting the length and number of trajectory series to be Prony analyzed from the trajectory data; Determine the logical restriction constraint of the stream processor SM, and calculate the maximum number of processing threads that meet the logical restriction constraint; obtain the GPU memory capacity, and calculate the maximum number of processing threads that meet the GPU memory capacity constraint based on a preset trajectory memory occupancy coefficient, the GPU memory capacity, and the length and number of trajectory sequences; use the minimum value of the maximum number of processing threads that meet the logical restriction constraint and the maximum number of processing threads that meet the GPU memory capacity constraint as the size of the GPU available trajectory buffer space, and calculate the number of GPU processing batches according to the size of the GPU available trajectory buffer space and the length and number of trajectory sequences; Carry out batch processing based on the number of GPU processing batches, organize trajectory data according to the GPU three-level model, dynamically allocate GPU memory, transfer trajectory data to the memory block corresponding to the GPU, and form a GPU computing thread table; construct computing samples based on trajectory data, configure GPU kernel function parameters, and activate parallel computing processes; Summarize the Prony results of the analysis tracks under all batches and complete the Prony analysis.

2. The GPU parallel computing method according to claim 1, characterized in that: In the step of obtaining trajectory data containing large-scale new energy grid simulation calculation, the trajectory data includes trajectory electrical quantity type, trajectory channel number C T , trajectory data interval T step and the total simulation time T total ; in: In the formula, S track The minimum storage space required for a single trajectory curve, the machine storage space occupied by one curve point is B T 4 bytes; T step Refers to the simulation step length; T total Refers to the total length of one simulation; S is the size of the data file.

3. The GPU parallel computing method according to claim 1, characterized in that: In the step of extracting the length and quantity of trajectory series to be subjected to Prony analysis from the trajectory data, a filtering condition is selected according to a preset calculation target, and the trajectory series and quantity to be subjected to Prony analysis are extracted from the trajectory data according to the filtering condition; wherein the filtering condition includes voltage level, partition, bus name keyword and variable type.

4. The GPU parallel computing method according to claim 1, characterized in that: In the step of determining the logical restriction constraints of the stream processor SM, the logical restriction constraints of the stream processor SM simultaneously satisfy the following conditions: Constraint 1: Grid (x, y, z) three-dimensional ordered number range 1≤x≤2 31 -1, 1≤y≤2 16 and 1≤z≤2 16 ; Constraint 2: Block (x, y, z) three-dimensional ordered number range 1≤x≤2 10 ,1≤y≤2 10 and 1≤z≤2 6 ; Constraint 3: The number of threads contained in a single Block (x, y, z) is no more than 2 10 ; Constraint 4: The maximum number of Blocks (x, y, z) resident in a single SM is no more than 2 4 (16); Constraint 5: The maximum number of Wraps resident in a single SM is no greater than 3×2 4 (48); Constraint 6: The maximum number of threads resident in a single SM is no greater than 3×2 9 (1536); Constraint 7: The maximum number of computing cores in a single SM is 2 N .

5. The GPU parallel computing method according to claim 1, characterized in that: In the steps of determining the logical restriction constraint of the stream processor SM, calculating the maximum number of processing threads satisfying the logical restriction constraint; obtaining the GPU memory capacity, and calculating the maximum number of processing threads satisfying the GPU memory capacity constraint based on a preset trace memory occupancy coefficient, the GPU memory capacity, and the length and number of trace series: The maximum number of processing threads that meet the logical restriction constraints is calculated as follows: In the formula, Indicates the maximum number of processing threads constrained by SM; C sm is the number of SMs; The maximum number of processing threads that meets the GPU memory capacity constraint is calculated as follows: In the formula, S track The minimum storage space required for a single trajectory curve. Indicates the maximum number of processing threads constrained by GM, K track is the trace memory usage coefficient, and GM is the number of video memory bytes.

6. The GPU parallel computing method according to claim 1, characterized in that: According to the size of the GPU available trajectory buffer space and the length and number of trajectory sequences, in the step of calculating the number of GPU processing batches, the number of GPU processing batches is calculated according to the following formula: Among them, C batch C is the number of batches processed by the GPU, which is an integer; selection To extract the length and number of trajectory series to be analyzed by Prony; Indicates the maximum number of processing threads constrained by GM. Indicates the maximum number of processing threads constrained by the SM.

7. The GPU parallel computing method according to claim 1, characterized in that: After the step of activating the parallel computing process, it also includes: According to the trajectory data, the SVD algorithm parameters are set, and the ideal fitting order and model parameters of the trajectory are calculated using the AR model. The Heisenberg matrix is ​​constructed to solve the roots of the characteristic equation of the AR model and calculate the undetermined gain terms in the homogeneous general solution of the AR model. The amplitude, damping, frequency and initial phase parameters of the Prony analysis of the trajectory are calculated.

8. A GPU parallel computing device for Prony analysis, characterized in that: include: An acquisition module is used to obtain trajectory data including large-scale new energy power grid simulation calculations; An extraction module, used to extract the length and number of trajectory series to be Prony analyzed from the trajectory data; The calculation module is used to determine the logical constraint of the stream processor SM, and calculate the maximum number of processing threads that meet the logical constraint; obtain the GPU memory capacity, and calculate the maximum number of processing threads that meet the GPU memory capacity constraint based on a preset trajectory memory occupancy coefficient, the GPU memory capacity, and the length and number of trajectory sequences; use the minimum value of the maximum number of processing threads that meet the logical constraint and the maximum number of processing threads that meet the GPU memory capacity constraint as the size of the GPU available trajectory buffer space, and calculate the number of GPU processing batches according to the size of the GPU available trajectory buffer space and the length and number of trajectory sequences; The processing module is used to carry out batch processing based on the number of GPU processing batches, organize the trajectory data according to the GPU three-level model, dynamically allocate GPU memory, transfer the trajectory data to the memory block corresponding to the GPU, and form a GPU computing thread table; construct calculation samples based on the trajectory data, configure GPU kernel function parameters, and activate the parallel computing process; The summary module is used to summarize the Prony results of the analysis tracks under all batches and complete the Prony analysis.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement a GPU parallel computing method for Prony analysis as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, a GPU parallel computing method for Prony analysis as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • An intelligent vehicle GPU parallel acceleration trajectory planning method

    CN109885891A

  • Dynamic vibration sensor optics distortion prediction

    CN113596437A