A calculation method and system for electric field matrix of discretized liver model

Through ILU preprocessing and block FEBS algorithm optimization, the parallelism and convergence speed of the liver model electric field matrix are improved, solving the problem of low computational efficiency in numerical simulation, significantly accelerating the calculation of induced electric fields, and promoting its clinical application. used in.

CN114996889BActive Publication Date: 2024-08-23CHINA ACADEMY OF INFORMATION & COMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110228113.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-02
Publication Date
2024-08-23
Estimated Expiration
2041-03-02

AI Technical Summary

Technical Problem

In the numerical simulation of the existing technology, the calculation efficiency of the liver model electric field matrix is ​​low, especially the insufficient parallelism of the LU matrix, which causes the calculation of the induced electric field distribution to take a long time, limiting its immediacy and accuracy in clinical applications.

Method used

The parallel-processed upper triangular matrix and lower triangular matrix are obtained through ILU preprocessing technology, and the block FEBS algorithm is used to accelerate the GPU to solve the electric field matrix in the discretized liver model, improving the parallelism and convergence speed of LU matrix calculation.

Benefits of technology

Significantly accelerates the solution of induced electric fields of active medical instruments in simulations, improves the computational efficiency of numerical simulations, and promotes its application in clinical treatment, especially the stability and speed in the presence of large-scale matrices and pathological characteristics. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114996889B
    Figure CN114996889B
Patent Text Reader

Abstract

The present invention discloses a method and system for calculating the electric field matrix of a discretized liver model, the method comprising: obtaining a discretized liver model; obtaining an initial electric field matrix according to the discretized liver model; obtaining an upper triangular matrix and a lower triangular matrix capable of parallel processing by using ILU preprocessing according to the initial electric field matrix; decomposing the matrix, performing parallel forward elimination on the decomposed lower triangular matrix using a forward elimination algorithm, and then performing parallel backward substitution on the decomposed upper triangular matrix using a backward substitution algorithm, and obtaining induced electric field distribution data according to the matrix after parallel calculation. The present invention can improve the parallelism of LU matrix calculation, thereby accelerating the calculation of induced electric field distribution in the numerical simulation process of liver stimulation by active medical instruments, and significantly accelerating the solution of induced electric field in simulation of active medical instruments, and promoting the application of numerical simulation in clinical treatment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of numerical simulation, and in particular to a calculation method and system for a discretized liver model electric field matrix. Background Art

[0002] Numerical simulation is the most commonly used non-invasive method for characterizing the induced electric fields generated by active medical devices in the liver. After the liver model is meshed and discretized, solving the resulting linear equations is very time-consuming, which usually accounts for 95% of the total numerical analysis time, which in many cases limits the immediate application of numerical simulation solutions to electric fields in clinical environments.

[0003] In the prior art, in order to modify the spectrum of the coefficient matrix to achieve faster convergence, a preprocessing technique such as incomplete lower-upper-layer (ILU) decomposition is usually used. The traditional element-by-element forward elimination and backward substitution (FEBS) algorithm used to solve the LU matrix in the incomplete lower-upper-layer (ILU) decomposition technique is highly sequential, which is a bottleneck for parallelization acceleration.

[0004] In addition, the biconjugate gradient method can be used to solve general complex linear equations. The complex linear equations used for electromagnetic field calculations are usually symmetrical. Generally speaking, the biconjugate gradient method has the advantages of less computation and faster convergence for solving complex linear equations. Although the residuals will change dramatically during the solution process, and it is possible that the residuals will increase during the iteration process, the rate of decrease will be very rapid. Usually, under the same accuracy requirements, the number of iterations of the biconjugate gradient method is only 1 / 3 of that of the conjugate gradient method, and its calculation speed is 5-6 times that of the conjugate gradient method. When the scale of the equation system is large or the coefficient matrix condition number is large, the complex matrix is ​​prone to pathological characteristics, and the biconjugate gradient method sometimes has the potential problem of non-convergence or slow convergence.

[0005] In summary, there is an urgent need for a technical solution that can solve the problems existing in the existing technology and improve the efficiency of the numerical model. Summary of the invention

[0006] In order to overcome the deficiencies of the prior art, the present invention proposes a method and system for calculating the electric field matrix of a discretized liver model. The present invention can improve the parallelism of LU matrix calculation, thereby accelerating the calculation of induced electric field distribution in the numerical simulation process of liver stimulation by active medical instruments; in order to improve the calculation efficiency and ensure the rapid convergence of the calculation, appropriate preprocessing technology can reduce the matrix condition number, improve the matrix pathological characteristics, and accelerate the convergence speed; the present invention accelerates the method of GPU solving the electric field matrix in the discretized liver model through the optimized block FEBS algorithm, which significantly accelerates the solution of the electric field induced by active medical instruments in the simulation and promotes the application of numerical simulation in clinical treatment.

[0007] In a first aspect of an embodiment of the present invention, a method for calculating a discretized electric field matrix of a liver model is proposed, the method comprising:

[0008] Obtaining a discretized liver model;

[0009] Obtaining an initial electric field matrix according to the discretized liver model;

[0010] According to the initial electric field matrix, an upper triangular matrix and a lower triangular matrix capable of parallel processing are obtained by ILU preprocessing;

[0011] The matrix is ​​decomposed, and the forward elimination algorithm is used to perform parallel forward elimination on the decomposed lower triangular matrix. Then, the backward substitution algorithm is used to perform parallel backward substitution on the decomposed upper triangular matrix. The induced electric field distribution data is obtained according to the parallel calculated matrix.

[0012] Furthermore, obtaining an initial electric field matrix according to the discretized liver model includes:

[0013] The electric field matrix equation is Fx=b, where x is a NUM×1 vector of the electric potential to be solved; b is a NUM×1 vector; F is a NUM×NUM every other diagonal matrix; and there are at most 7 non-zero elements in the F matrix.

[0014] Furthermore, the method also includes:

[0015] The matrix solving process is divided into forward elimination Ly = b and backward substitution Ux = y;

[0016] Where L is the decomposed lower triangular matrix; y is a NUM×1 vector; and U is the decomposed upper triangular matrix.

[0017] Furthermore, the matrix is ​​decomposed, including:

[0018] Decompose the matrix into three types of block matrices: matrix_A, matrix_B, and matrix_C; among them,

[0019] matrix_A(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,i·nx:(i+1)·nx-1),i=0,1,...,ny·nz-1;

[0020] matrix_B(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-1)·nx:i·nx-1),i=1,2,...,ny·nz-1;

[0021] matrix_C(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-ny)·nx:(i-ny+1)·nx-1),

[0022] i=ny,ny+1,...,ny·nz-1;

[0023] Among them, nx is the side length of the three types of matrices; for the L matrix, ny represents the number of matrix side lengths nx from the first matrix_A to the first matrix_C; nz represents the number of nx×ny in NUM.

[0024] Furthermore, the solution process of forward elimination Ly = b is:

[0025] Step 1, i=0, L(0:nx-1,:)y=b; ie, matrix_A·y(0:nx-1)=y(0:nx-1);

[0026] Step 2, i=1,2,...,ny-1,L(i·nx:(i+1)·nx-1,:)·y=b

[0027] matrix_B·y((i-1)·nx:i·nx-1)+matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1);

[0028] Step 3, i=ny,ny+1,...,ny·nz-1,L(i·nx:(i+1)·nx-1,:)·y=b

[0029] matrix_C·y((1-ny)·nx:(i-ny+1)·nx-1)+matrix_B·y((i-1)·nx:i·nx-1)

[0030] +matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1).

[0031] In a second aspect of an embodiment of the present invention, a calculation system for a discretized liver model electric field matrix is ​​proposed, the system comprising:

[0032] A model acquisition module, used for acquiring a discretized liver model;

[0033] An electric field matrix acquisition module, used for acquiring an initial electric field matrix according to the discretized liver model;

[0034] A preprocessing module, used for obtaining an upper triangular matrix and a lower triangular matrix capable of parallel processing by using ILU preprocessing according to the initial electric field matrix;

[0035] The electric field distribution data calculation module is used to decompose the matrix, use the forward elimination algorithm to perform parallel forward elimination on the decomposed lower triangular matrix, and then use the backward substitution algorithm to perform parallel backward substitution on the decomposed upper triangular matrix, and obtain the induced electric field distribution data according to the matrix after parallel calculation.

[0036] Furthermore, the electric field matrix equation obtained by the electric field matrix acquisition module is Fx=b, wherein x is a NUM×1 vector of the electric potential to be solved; b is a NUM×1 vector; F is a NUM×NUM diagonal matrix; and there are at most 7 non-zero elements in the F matrix.

[0037] Furthermore, the electric field distribution data calculation module is specifically used for:

[0038] The matrix solving process is divided into forward elimination Ly = b and backward substitution Ux = y;

[0039] Where L is the decomposed lower triangular matrix; y is a NUM×1 vector; and U is the decomposed upper triangular matrix.

[0040] Furthermore, the electric field distribution data calculation module is specifically used for:

[0041] Decompose the matrix into three types of block matrices: matrix_A, matrix_B, and matrix_C; among them,

[0042] matrix_A(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,i·nx:(i+1)·nx-1),i=0,1,...,ny·nz-1;

[0043] matrix_B(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-1)·nx:i·nx-1),i=1,2,...,ny·nz-1;

[0044] matrix_C(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-ny)·nx:(i-ny+1)·nx-1),

[0045] i=ny,ny+1,...,ny·nz-1;

[0046] Among them, nx is the side length of the three types of matrices; for the L matrix, ny represents the number of matrix side lengths nx from the first matrix_A to the first matrix_C; nz represents the number of nx×ny in NUM.

[0047] Furthermore, the electric field distribution data calculation module is specifically used for:

[0048] The solution process of forward elimination Ly = b is:

[0049] Step 1, i=0, L(0:nx-1,:)y=b; ie, matrix_A·y(0:nx-1)=y(0:nx-1);

[0050] Step 2, i=1,2,...,ny-1,L(i·nx:(i+1)·nx-1,:)·y=b

[0051] matrix_B·y((i-1)·nx:i·nx-1)+matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1);

[0052] Step 3, i=ny,ny+1,...,ny·nz-1,L(i·nx:(i+1)·nx-1,:)·y=b

[0053] matrix_C·y((1-ny)·nx:(i-ny+1)·nx-1)+matrix_B·y((i-1)·nx:i·nx-1)

[0054] +matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1).

[0055] In a third aspect of an embodiment of the present invention, a computer device is proposed, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method for calculating a discretized electric field matrix of a liver model when executing the computer program.

[0056] In a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, a method for calculating a discretized electric field matrix of a liver model is implemented.

[0057] The method and system for calculating the electric field matrix of the discretized liver model proposed in the present invention obtain a discretized liver model; obtain an initial electric field matrix according to the discretized liver model; obtain upper and lower triangular matrices that can be processed in parallel by using ILU preprocessing according to the initial electric field matrix; decompose the lower triangular matrix, use a forward elimination algorithm to perform parallel forward elimination on the decomposed lower triangular matrix, and then use a backward substitution algorithm to perform parallel backward substitution on the decomposed upper triangular matrix, and obtain induced electric field distribution data according to the eliminated matrix. The parallelism of LU matrix calculation can be improved, thereby accelerating the calculation of induced electric field distribution in the numerical simulation process of liver stimulation by active medical instruments, and accelerating the GPU to solve the electric field matrix in the discretized liver model through the optimized block FEBS algorithm, which significantly accelerates the solution of induced electric field in simulation of active medical instruments and promotes the application of numerical simulation in clinical treatment. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0059] Figure 1 It is a schematic flow chart of a method for calculating the electric field matrix of a discretized liver model according to an embodiment of the present invention.

[0060] Figure 2 Schematic diagram of the SPFD coefficient matrix structure and L matrix non-zero elements of a specific embodiment of the present invention

[0061] Figure 3 It is a pseudo code diagram of a forward elimination algorithm according to a specific embodiment of the present invention.

[0062] Figure 4 It is a pseudo code diagram of a backward substitution algorithm according to a specific embodiment of the present invention.

[0063] Figure 5 It is a schematic diagram of the induced electric field distribution of the accelerated computing liver model simulation according to a specific embodiment of the present invention.

[0064] Figure 6 It is a schematic diagram of the induced electric field distribution of the accelerated calculation homogeneous sphere model simulation according to a specific embodiment of the present invention.

[0065] Figure 7 4 is a schematic diagram of a computing system architecture for a discretized liver model electric field matrix according to an embodiment of the present invention.

[0066] Figure 8It is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0067] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0068] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0069] According to an embodiment of the present invention, a method and system for calculating the electric field matrix of a discretized liver model are proposed, which can improve the parallelism of LU matrix calculation, thereby accelerating the calculation of the induced electric field distribution in the numerical simulation process of liver stimulation by active medical instruments. The present invention accelerates the GPU to solve the electric field matrix in the discretized liver model through an optimized block FEBS algorithm, significantly accelerates the solution of the induced electric field of active medical instruments in the simulation, and promotes the application of numerical simulation in clinical treatment. When solving the electric field in the discretized liver model, the preprocessing technology of ILU decomposition is usually used to solve the obtained linear equations. The present invention develops an optimized block FEBS (B-FEBS) algorithm by dividing the matrix in the ILU decomposition technology into uniformly distributed matrix blocks that can be calculated in parallel.

[0070] In the embodiments of the present invention, the following terms need to be explained:

[0071] FEBS: Element-wise forward elimination and backward substitution algorithm;

[0072] B-FEBS: Block-optimized FEBS algorithm;

[0073] GPU: general purpose processor;

[0074] ILU: incomplete lower-upper-layer decomposition;

[0075] LU matrix: the lower triangular matrix L and the upper triangular matrix obtained by the ILU algorithm U ;

[0076] BICG: Biconjugate gradient method;

[0077] BICGSTAB: The Preconditioned Stabilized Biconjugate Gradient Method, a Krylov subspace method.

[0078] The principle and spirit of the present invention are explained in detail below with reference to several representative embodiments of the present invention.

[0079] Figure 1 FIG. 1 is a flow chart of a method for calculating the electric field matrix of a discretized liver model according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0080] Step S101, obtaining a discretized liver model;

[0081] Step S102, obtaining an initial electric field matrix according to the discretized liver model;

[0082] Step S103, according to the initial electric field matrix, using ILU preprocessing to obtain a lower triangular electric field matrix L and an upper triangular electric field matrix U that can be processed in parallel;

[0083] Step S104, decomposing the matrix, using the forward elimination algorithm to perform parallel forward elimination on the decomposed lower triangular electric field matrix L, and then using the backward substitution algorithm to perform parallel backward substitution on the upper triangular matrix U, and obtaining the induced electric field distribution data according to the eliminated matrix.

[0084] In step S101 of this embodiment, obtaining an initial electric field matrix according to the discretized liver model includes:

[0085] refer to Figure 2 , is a schematic diagram of the SPFD coefficient matrix structure and L matrix non-zero elements of a specific embodiment of the present invention. (a) SPFD coefficient matrix structure, (b) L matrix non-zero elements are represented by dotted lines.

[0086] The electric field matrix equation is Fx=b, where x is a NUM×1 vector of the electric potential to be solved; b is a NUM×1 vector (in (b)); F is a NUM×NUM diagonal matrix; and there are at most 7 non-zero elements in the F matrix.

[0087] In this embodiment, the method further includes:

[0088] The matrix solving process is divided into forward elimination Ly = b and backward substitution Ux = y;

[0089] L is the decomposed lower triangular matrix; y is a NUM×1 vector; U is the decomposed upper triangular matrix.

[0090] In step S104 of this embodiment, the matrix is ​​decomposed, including:

[0091] Decompose the matrix into three parts: matrix_A, matrix_B, and matrix_C; among them,

[0092] matrix_A(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,i·nx:(i+1)·nx-1),i=0,1,...,ny·nz-1;

[0093] matrix_B(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-1)·nx:i·nx-1),i=1,2,…,ny·nz-1;

[0094] matrix_C(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-ny)·nx:(i-ny+1)·nx-1),

[0095] i=ny,ny+1,...,ny·nz-1;

[0096] Among them, nx is the side length of the three types of matrices; ny represents the number of matrix side lengths nx from the first matrix_A to the first matrix_C (for L matrix), and nz represents the number of nx×ny in NUM.

[0097] In step S104 of this embodiment, the process of solving the forward elimination Ly=b is:

[0098] Step 1, i=0, L(0:nx-1,:)y=b; ie, matrix_A·y(0:nx-1)=y(0:nx-1);

[0099] Step 2, i=1,2,...,ny-1,L(i·nx:(i+1)·nx-1,:)·y=b

[0100] matrix_B·y((i-1)·nx:i·nx-1)+matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1);

[0101] Step 3, i=ny,ny+1,...,ny·nz-1,L(i·nx:(i+1)·nx-1,:)·y=b

[0102] matrix_C·y((1-ny)·nx:(i-ny+1)·nx-1)+matrix_B·y((i-1)·nx:i·nx-1)

[0103] +matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1).

[0104] By utilizing the sparse property of every other diagonal of the LU coefficient matrix, the matrix is ​​divided into three types of matrices, and the matrices of the forward elimination and backward substitution (FEBS) algorithm are operated in parallel, which enhances the parallel processing capability of the GPU for the required unknowns, thereby speeding up the calculation of the originally highly sequential forward elimination and backward substitution (FEBS) algorithm in the parallel process.

[0105] The pseudo code for LU matrix iteration is as follows Figure 3 and Figure 4 , where “*” indicates porting the process to the GPU for multi-threaded computing. Figure 3 is the forward elimination algorithm (Ly=b), Figure 4 It is a backward substitution algorithm (Ux=y).

[0106] It should be noted that, although the operations of the method of the present invention are described in a specific order in the above embodiments and the accompanying drawings, this does not require or imply that the operations must be performed in the specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0107] In order to explain the calculation method of the electric field matrix of the discretized liver model more clearly, a specific embodiment is used for illustration below. However, it should be noted that the embodiment is only for better illustrating the present invention and does not constitute an improper limitation to the present invention.

[0108] In the numerical experiments calculated by the present invention, the simulation platform includes 2 Xeon E5-2630 CPUs (Intel, Santa Clara, CA; 2.2 GHz, 6 cores per CPU), 64 GB RAM and 1 TESLA K40C GPU (NVIDIA, Santa Clara, CA; 850 MHz, 12 GB RAM and 2880 cores). The operating system is CentOS x64 7.0 (Red Hat, Raleigh, NC). The routines are coded in C++ and compiled using gcc 4.8.5. The compiler is CUDA 9.0 NVCC (NVIDIA).

[0109] During the verification process, the code of the preprocessed dual conjugate gradient stabilization method in the CUDA toolkit (which does not have the function of optimizing the exported alternate diagonal matrix) was modified into the B-FEBS code, and the coupling of B-FEBS and CUDA was realized. The matrix processing capabilities of B-FEBS and CUDA routines were compared. The computational time cost of the program for matrix parallel calculation is: 2nx·ny·nz·t+4ny·nz·t-2ny·t-2t, and the cost of routine serial calculation is 6nx·ny·nz·t-2nx·ny·t-2nx·t. The theoretical acceleration is:

[0110]

[0111] When the number of grids approaches infinity, the acceleration approaches 3, and the calculated solution speed increases by 2.48-2.69 times.

[0112] The calculation of the electric field in the liver during stimulation with an active medical device (including a liver model reconstructed using enhanced magnetic resonance imaging (MRI) data from a human clinical trial and a homogenized sphere model) was then implemented in ILU-BiCGSTab and verified by repeating the calculations with the very low frequency solver of SEMCAD X V14.8, and the time savings in the overall electric field solution process were compared. The overall speedup of ILU-BiCGSTab depends on the number of iterations required for convergence, ranging from 1.19 (2.75 MCells) to 1.56 (27 MCells).

[0113] In order to verify the correctness of the calculation results, the calculation indicators selected in the experiment are the peak electric field and the 99th percentile electric field. It is observed in the experiment that the calculation results of the method of the present invention are very different. For example, the maximum difference in the peak electric field is about 2%, while the difference in the 99th percentile electric field of all simulated liver models is less than 1%. The electric field distributions calculated by the two solvers are almost the same. Reference Figure 5 , which is a schematic diagram of the distribution of the induced electric field for the accelerated calculation of the liver model simulation in a specific embodiment of the present invention. Figure 6 , which is a schematic diagram of the distribution of the induced electric field of a homogeneous sphere model according to a specific embodiment of the present invention.

[0114] Comparing different simulation situations, the following conclusions can be drawn:

[0115] The overall speedup of the heterogeneous liver model is significant compared to the homogeneous sphere model. This result is because the heterogeneous distribution of tissue will change the spectrum of the coefficient matrix and require more iterations. Since each iteration includes a matrix solution (an operation that requires optimization), more iterations indicate more time savings.

[0116] Due to the memory limitation of GPU, the experiments did not use the resolution less than 1mm. 3 The maximum acceleration of the matrix solution can theoretically be 3 if an infinite number of grids are used.

[0117] The highly sequential FEBS algorithm was parallelized during the electric field calculation process, which accelerated the electric field calculation. When using B-FEBS for matrix solution, the speed of upper and lower matrix solution was increased by 2.48-2.69 times compared with the routines in the CUDA library. Most of the current research on accelerating electric field simulation focuses on the parallelization of Krylov iteration methods using multiple CPU nodes, GPUs or multi-scale grids. ILU preconditioners are widely used in Krylov iteration methods, so the proposed method can be easily incorporated into the internal solver to speed up the simulation.

[0118] After introducing the method of the exemplary embodiment of the present invention, next, refer to Figure 7 A calculation system for a discretized liver model electric field matrix according to an exemplary embodiment of the present invention is introduced.

[0119] The implementation of the computing system of the electric field matrix of the discretized liver model can refer to the implementation of the above method, and the repetition will not be repeated. The term "module" or "unit" used below can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented with software, hardware, or the implementation of a combination of software and hardware is also possible and conceived.

[0120] Based on the same inventive concept, the present invention also proposes a calculation system for the electric field matrix of a discretized liver model, such as Figure 7 As shown, the system includes:

[0121] A model acquisition module 710 is used to acquire a discretized liver model;

[0122] An electric field matrix obtaining module 720, configured to obtain an initial electric field matrix according to the discretized liver model;

[0123] A preprocessing module 730 is used to obtain an upper triangular matrix and a lower triangular matrix capable of parallel processing by using ILU preprocessing according to the initial electric field matrix;

[0124] The electric field distribution data calculation module 740 is used to decompose the matrix, use the forward elimination algorithm to perform parallel forward elimination on the decomposed lower triangular matrix, and then use the backward substitution algorithm to perform parallel backward substitution on the decomposed upper triangular matrix, and obtain the induced electric field distribution data according to the parallel calculated matrix.

[0125] Furthermore, the electric field matrix equation obtained by the electric field matrix acquisition module 720 is Fx=b, wherein x is a NUM×1 vector of the electric potential to be solved; b is a NUM×1 vector; F is a NUM×NUM diagonal matrix; and there are at most 7 non-zero elements in the F matrix.

[0126] Furthermore, the preprocessing module 730 is specifically used for:

[0127] The matrix solving process is divided into forward elimination Ly = b and backward substitution Ux = y;

[0128] L is the decomposed lower triangular matrix; y is a NUM×1 vector; U is the decomposed upper triangular matrix.

[0129] Furthermore, the electric field distribution data calculation module 740 is specifically used for:

[0130] Decompose the matrix into three parts: matrix_A, matrix_B, and matrix_C; among them,

[0131] matrix_A(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,i·nx:(i+1)·nx-1),i=0,1,...,ny·nz-1;

[0132] matrix_B(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-1)·nx:i·nx-1),i=1,2,...,ny·nz-1;

[0133] matrix_C(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-ny)·nx:(i-ny+1)·nx-1),

[0134] i=ny,ny+1,...,ny·nz-1;

[0135] Among them, nx is the side length of the three types of matrices; ny represents the number of matrix side lengths nx from the first matrix_A to the first matrix_C (for L matrix), and nz represents the number of nx×ny in NUM.

[0136] Furthermore, the electric field distribution data calculation module 740 is specifically used for:

[0137] The solution process of forward elimination Ly = b is:

[0138] Step 1, i=0, L(0:nx-1,:)y=b; ie, matrix_A·y(0:nx-1)=y(0:nx-1);

[0139] Step 2, i=1,2,...,ny-1,L(i·nx:(i+1)·nx-1,:)·y=b

[0140] matrix_B·y((i-1)·nx:i·nx-1)+matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1);

[0141] Step 3, i=ny,ny+1,...,ny·nz-1,L(i·nx:(i+1)·nx-1,:)·y=b

[0142] matrix_C·y((1-ny)·nx:(i-ny+1)·nx-1)+matrix_B·y((i-1)·nx:i·nx-1)

[0143] +matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1).

[0144] It should be noted that, although several modules of the computing system of the electric field matrix of the discretized liver model are mentioned in the above detailed description, this division is only exemplary and non-mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules described above can be embodied in one module. On the contrary, the features and functions of a module described above can be further divided into being embodied by multiple modules.

[0145] Based on the above invention concept, Figure 8 As shown, the present invention also proposes a computer device 800, including a memory 810, a processor 820, and a computer program 830 stored in the memory 810 and executable on the processor 820, wherein the processor 820 implements the aforementioned method for calculating the electric field matrix of the discretized liver model when executing the computer program 830.

[0146] Based on the aforementioned inventive concept, the present invention proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the calculation method of the aforementioned discretized liver model electric field matrix is ​​implemented.

[0147] The calculation method and system of the electric field matrix of the discretized liver model proposed by the present invention obtain the discretized liver model; obtain the initial electric field matrix according to the discretized liver model; obtain the upper and lower triangular matrices that can be processed in parallel by using ILU preprocessing according to the initial electric field matrix; decompose the lower triangular matrix, use the forward elimination algorithm to perform parallel forward elimination on the decomposed lower triangular matrix, and then use the backward substitution algorithm to perform parallel backward substitution on the upper triangular matrix, and obtain the induced electric field distribution data according to the eliminated matrix. The parallelism of LU matrix calculation can be improved, thereby accelerating the calculation of induced electric field distribution in the numerical simulation process of liver stimulation by active medical instruments, and accelerating the GPU to solve the electric field matrix in the discretized liver model through the optimized block FEBS algorithm, which significantly accelerates the solution of induced electric field in simulation of active medical instruments and promotes the application of numerical simulation in clinical treatment.

[0148] 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.

[0149] The present invention is described with reference to flowcharts and / or block diagrams of methods 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 generate 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.

[0150] 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 comprising 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.

[0151] 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. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0152] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for calculating the electric field matrix of a discretized liver model, characterized in that: The method includes: Obtaining a discretized liver model; Obtaining an initial electric field matrix according to the discretized liver model; According to the initial electric field matrix, an upper triangular matrix and a lower triangular matrix capable of parallel processing are obtained by ILU preprocessing; The matrix is ​​decomposed, and the forward elimination algorithm is used to perform parallel forward elimination on the decomposed lower triangular matrix. Then, the backward substitution algorithm is used to perform parallel backward substitution on the decomposed upper triangular matrix. The induced electric field distribution data is obtained according to the parallel calculated matrix.

2. The method for calculating the electric field matrix of the discretized liver model according to claim 1, characterized in that: Obtaining an initial electric field matrix according to the discretized liver model includes: The electric field matrix equation is Fx=b, where x is a NUM×1 vector of the electric potential to be solved; b is a NUM×1 vector; F is a NUM×NUM every other diagonal matrix; and there are at most 7 non-zero elements in the F matrix.

3. The method for calculating the electric field matrix of the discretized liver model according to claim 2, characterized in that: The method further includes: The matrix solving process is divided into forward elimination Ly = b and backward substitution Ux = y; Where L is the decomposed lower triangular matrix; y is a NUM×1 vector; and U is the decomposed upper triangular matrix.

4. The method for calculating the electric field matrix of the discretized liver model according to claim 3, characterized in that: Decompose the matrix, including: Decompose the matrix into three types of block matrices: matrix_A, matrix_B, and matrix_C; among them, matrix_A(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,i·nx:(i+1)·nx-1),i=0,1,...,ny·nz-1; matrix_B(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-1)·nx:i·nx-1),i=1,2,...,ny·nz-1; matrix_C(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-ny)·nx:(i-ny+1)·nx-1),i=ny,ny+1,...,ny·nz-1; Among them, nx is the side length of the three types of matrices; for L matrix, ny represents the number of matrix side lengths nx from the first matrix_A to the first matrix_C; nz represents the number of nx×ny in NUM; The solution process of forward elimination Ly = b is: Step 1, i=0, L(0:nx-1,:)y=b; ie, matrix_A·y(0:nx-1)=y(0:nx-1); Step 2, i=1,2,...,ny-1,L(i·nx:(i+1)·nx-1,:)·y=b matrix_B·y((i-1)·nx:i·nx-1)+matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1); Step 3, i=ny,ny+1,...,ny·nz-1,L(i·nx:(i+1)·nx-1,:)·y=b matrix_C·y((1-ny)·nx:(i-ny+1)·nx-1)+matrix_B·y((i-1)·nx:i·nx-1)+matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1).

5. A calculation system for discretized liver model electric field matrix, characterized in that: The system includes: A model acquisition module, used for acquiring a discretized liver model; An electric field matrix acquisition module, used for acquiring an initial electric field matrix according to the discretized liver model; A preprocessing module, used for obtaining an upper triangular matrix and a lower triangular matrix capable of parallel processing by using ILU preprocessing according to the initial electric field matrix; The electric field distribution data calculation module is used to decompose the matrix, use the forward elimination algorithm to perform parallel forward elimination on the decomposed lower triangular matrix, and then use the backward substitution algorithm to perform parallel backward substitution on the decomposed upper triangular matrix, and obtain the induced electric field distribution data according to the matrix after parallel calculation.

6. The calculation system of the electric field matrix of the discretized liver model according to claim 5, characterized in that: The electric field matrix equation obtained by the electric field matrix acquisition module is Fx=b, wherein x is a NUM×1 vector of the electric potential to be solved; b is a NUM×1 vector; F is a NUM×NUM diagonal matrix; and there are at most 7 non-zero elements in the F matrix.

7. The calculation system of the electric field matrix of the discretized liver model according to claim 6, characterized in that: The electric field distribution data calculation module is specifically used for: The matrix solving process is divided into forward elimination Ly = b and backward substitution Ux = y; Where L is the decomposed lower triangular matrix; y is a NUM×1 vector; and U is the decomposed upper triangular matrix.

8. The calculation system of the electric field matrix of the discretized liver model according to claim 7, characterized in that: The electric field distribution data calculation module is specifically used for: Decompose the matrix into three types of block matrices: matrix_A, matrix_B, and matrix_C; among them, matrix_A(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,i·nx:(i+1)·nx-1),i=0,1,...,ny·nz-1; matrix_B(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-1)·nx:i·nx-1),i=1,2,...,ny·nz-1; matrix_C(0:nx-1,0:nx-1)=L(i·nx:(i+1)·nx-1,(i-ny)·nx:(i-ny+1)·nx-1),i=ny,ny+1,...,ny·nz-1; Among them, nx is the side length of the three types of matrices; for L matrix, ny represents the number of matrix side lengths nx from the first matrix_A to the first matrix_C; nz represents the number of nx×ny in NUM; The solution process of forward elimination Ly = b is: Step 1, i=0, L(0:nx-1,:)y=b; ie, matrix_A·y(0:nx-1)=y(0:nx-1); Step 2, i=1,2,...,ny-1,L(i·nx:(i+1)·nx-1,:)·y=b matrix_B·y((i-1)·nx:i·nx-1)+matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1); Step 3, i=ny,ny+1,...,ny·nz-1,L(i·nx:(i+1)·nx-1,:)·y=b matrix_C·y((1-ny)·nx:(i-ny+1)·nx-1)+matrix_B·y((i-1)·nx:i·nx-1) +matrix_A·y(i·nx:(i+1)·nx-1)=b(i·nx:(i+1)·nx-1).

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.