Cross-spectrum tracking method based on GPU

By adopting a parallel computing method based on GPU in sonar data processing, and using CPU and GPU in collaboratively for mutual spectrum tracking processing, the problem of low computing efficiency in the prior art is solved, and more efficient and real-time data processing is achieved.

CN119512779APending Publication Date: 2025-02-25THE 715TH RES INST OF CHINA SHIPBUILDING IND CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411498232.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

When processing the increasing sonar data, the prior art has low computing efficiency and is difficult to meet the needs of large-scale data processing. Especially in the mutual spectrum tracking process, the left and right split beamforming process is computationally intensive, resulting in an increase in resource overhead and space occupation.

Method used

The parallel computing method based on GPU is adopted, through the coordinated work of CPU and GPU, the tracking information is pre-calculated and stored, the frequency domain array metadata is copied to the GPU, and the matrix point multiplication and summing operations are used to make full use of the parallel computing power of the GPU, and the calculation steps are optimized to improve efficiency.

Benefits of technology

It significantly improves the computing efficiency and real-time nature of interspectral tracking. Compared with traditional CPU computing, it reduces resource overhead and space usage, and is suitable for large-scale sonar data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512779A_ABST
    Figure CN119512779A_ABST
Patent Text Reader

Abstract

The invention discloses a cross-spectrum tracking method based on a GPU. The cross-spectrum tracking method comprises the steps that S1, all pitch angles in tracking and information needed during beam cross-spectrum calculation are calculated in advance; s2, copying the received frequency domain array element data from a CPU to a GPU, and sorting out array element number information covered by all tracking target beam sectors; s3, calculating phase shift information of array elements of a sector corresponding to a tracking beam where each current tracking target is located; s4, forming left and right sector wave beams of current wave beams of all tracking targets in the GPU by using a self-defined kernel function; s5, performing beam combination and inverse Fourier transform on the left and right beams of each tracking target to obtain time domain data of the tracking beams; and S6, performing cross-spectrum calculation on the data to obtain a compensation angle, and performing compensation on the basis of the input tracking angle to obtain a tracking angle result. The parallel advantage of the GPU is utilized, program steps are optimized, and the advantages of being high in calculation efficiency and good in real-time performance are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of acoustic data processing, and in particular relates to a cross-spectrum tracking method based on GPU. Background Art

[0002] In the current CPU development, cross-spectral tracking adopts multi-core parallel computing. In the CPU implementation based on the DSP platform, the main process includes:

[0003] 1. Pre-stored variable calculation: based on the tracking beam azimuth information and the coordinate information of the array elements participating in the tracking beam, the acoustic path difference information of the array elements participating in the beamforming in all tracking beams is pre-stored;

[0004] 2. Data reception and sorting: The acquisition system transmits the collected digital array element signals to the CPU through the network. After the data receiving thread completes data reception and sorting, it forwards the data to the tracking processing threads of each core;

[0005] 3. Phase information calculation: Each thread calculates the tracking beam information and the acoustic path difference between array elements according to the tracking target azimuth processed by the current thread, and refers to the real-time sound speed information provided by the sensor, and then completes the calculation of the phase information of each frequency point in the working frequency band of each array element in the tracking beam working sector (the beam working sector refers to the two-dimensional space formed by the connection line between all array elements participating in the beam formation in this direction and the acoustic center);

[0006] 4. Split beam forming and cross-spectrum processing: According to the calculated tracking beam information and the phase information of each array element in the working sector, frequency domain beam forming processing is performed on the left and right sector array elements covered by the sector to obtain the left and right split beam data of the current tracking azimuth of each target, and the tracking azimuth is corrected by the left and right cross-spectra;

[0007] 5. Summing and IFFT processing of left and right split beams: The left and right split beams are summed to form a combined beam, and the summation result is subjected to IFFT processing to obtain the tracking beam time domain signal for subsequent feature extraction such as DEMON / LOFAR spectrum analysis.

[0008] With the substantial improvement of GPU parallel computing performance, the computing efficiency of traditional hardware platforms represented by CPUs is not satisfactory when implementing parallel algorithms. Traditional hardware platforms are gradually unable to keep up with the increasing scale of data processing, and the parallel implementation of algorithms based on GPU platforms is gradually showing its advantages. Taking sonar engineering as an example, in recent years, the scale of sonar arrays has grown from hundreds of yuan to thousands of yuan, and the data scale has expanded nearly 10 times. Cross-spectral tracking is a common processing method in sonar engineering. Its left and right split beam forming process is a typical parallel computing scenario. Fully tapping the parallel computing potential of cross-spectral tracking in GPU development and improving computing efficiency means less resource overhead and space occupancy, which has positive significance for engineering applications.

[0009] Under this background requirement, it is necessary to provide an implementation method of cross-spectrum tracking processing based on GPU development. Summary of the invention

[0010] In view of the shortcomings of the prior art, the present invention proposes a cross-spectrum tracking method based on GPU, which has the advantages of high computational efficiency and good real-time performance, and has significant advantages over the previous embedded development platform that only uses CPU calculations.

[0011] The technical solution of the present invention is:

[0012] The present invention provides a GPU-based cross-spectrum tracking method, comprising the following steps:

[0013] Step S1, before the tracking process starts, all the tracking information required for the tracking pitch and beam angle in the tracking cross-spectrum calculation is calculated by the CPU and GPU, and stored in the CPU in advance;

[0014] Step S2, copy the received frequency domain array data from the CPU to the GPU, and at the same time, sort out the array element numbers covered by the beam sector of all tracking targets according to the pitch angle and beam information of the current tracking target and copy them to the GPU;

[0015] Step S3, calculating the phase shift information of the array element corresponding to the sector of the tracking beam where each tracking target is currently located;

[0016] Step S4: According to the received array data, the array element number information of each tracking target and the phase shift information corresponding to the array element, tracking beamforming is performed in the GPU through a custom kernel function. Each target obtains a left sector beamforming result and a right sector beamforming result. The left and right beam data are copied to the CPU, and the cross-spectrum calculation is performed to obtain the compensation angle. The tracking angle result is compensated based on the input tracking angle.

[0017] Step S5: Combine the left and right beams of each tracking target respectively, and then use the cufft library function to perform inverse Fourier transform to obtain the time domain data of the tracking beam.

[0018] Furthermore, in the step S1, all pitch angles and beam cross-spectrum calculations required for tracking are pre-calculated. In the program initialization stage, the information required for tracking cross-spectrum calculation is obtained through the GPU kernel function and pre-stored in the CPU and GPU, specifically:

[0019] Step S101: Calculate the array element number information of each beam at each pitch angle participating in beamforming in the CPU, take the current beam angle as the reference, and the array elements covered within a certain open angle fan range are used as the array elements participating in the calculation of this tracking beam, the fan is divided into a left fan and a right fan, the two fans are divided by the beam corresponding angle direction, the number of array elements in the left and right fans is equal, and the calculated array element information is stored in the CPU;

[0020] Step S102: Calculate the acoustic path difference information corresponding to the array elements participating in the tracking beam calculation for each beam at each pitch angle in the GPU; apply for the GPU kernel function thread distribution as follows: the thread block distribution in the grid is BS, FY (number of beams, pitch angle dimension), written as dim3 grid (BS, FY), and the thread in each thread block is JYS_PICK (maximum number of array elements in the tracking sector), written as dim3block (JYS_PICK). This thread distribution allows each thread to calculate a sound path difference, and obtain the required sound path difference information through the GPU sound path difference kernel function calculation, and copy it to the CPU through the cudaMemcpy function.

[0021] Furthermore, in step S2, the frequency domain array data is copied into the GPU, and the array element number information of the corresponding sectors of all currently tracked target beams is sorted out and copied into the GPU, specifically:

[0022] Step S201: receiving array element frequency domain data, and copying it from the CPU to the GPU variable data_gpu;

[0023] In the CPU memory space, apply for a variable data_cpu of the cuComplex (complex type, two floats) type with the number of array elements × the number of frequency points to receive the array data sent by the front end. In the GPU space, apply for a variable data_gpu of the cuComplex size with the number of array elements × the number of frequency points, and copy from data_cpu to data_gpu variable through cudaMemcpy function;

[0024] Step S202: Calculate the array element sector information required for cross-spectrum tracking of each target according to the current pitch angle, beam and pre-stored information of each tracked target, and copy it to GPU variables zy_num_need_l and zy_num_need_r;

[0025] In the GPU space, apply for the number of tracking targets × the maximum number of array elements in the tracking sector. The int type variables zy_num_need_l and zy_num_need_r correspond to the array element number information selected for the left and right sectors respectively. According to the pre-stored tracking information and the pitch and beam information of the current tracking target, the array element number information required for each tracking target is sorted out, and copied from the CPU to the zy_num_need_l and zy_num_need_r variables of the GPU through the cudaMemcpy function.

[0026] Further, in step S3, according to the pre-stored information and the pitch angle, beam information, and sound speed information of the currently tracked target, the phase shift information of each target participating in the tracking beamforming is calculated in the GPU, which is recorded as xiangyi_gpu_l and xiangyi_gpu_r, specifically:

[0027] Calculate the phase shift information of the array element corresponding to the tracking beam where each current tracking target is located, apply for the number of tracking targets × the maximum number of array elements in the tracking sector float type variables timedelay_gpu_l and timedelay_gpu_r in the GPU space, apply for the number of tracking targets × the maximum number of array elements in the tracking sector × the number of frequency points cuComplex type variables xiangyi_gpu_l and xiangyi_gpu_r, calculate the time delay information corresponding to all current tracking targets in the CPU according to the pre-stored sound path difference information and the sound speed information given by the sensor (the time delay is equal to the sound path difference divided by the sound speed), and copy the time delay information from the CPU to the GPU timedelay_gpu_l and timedelay_gpu_r variables through the cudaMemcpy function, and then calculate the phase shift information of all tracking targets through the user-defined phase shift calculation kernel function and store it in the xiangyi_gpu_l and xiangyi_gpu_r variables.

[0028] Furthermore, in step S4, a custom kernel function is used in the GPU to perform left and right fan beamforming of the current beam of all tracking targets. The custom kernel function includes a matrix dot multiplication kernel function and a summation kernel function, specifically:

[0029] Step S401: Calculate the element-by-element multiplication of the array data matrix and the phase shift information matrix in the GPU kernel function, and record the results as d_dataout_l and d_dataout_r;

[0030] The thread distribution of the GPU kernel function application is as follows: the thread block distribution in the grid is TRACKER_NUM, JYS_PICK (number of tracked targets, maximum number of array elements in the tracking beam sector), written as dim3 grid(TRACKER_NUM, JYS_PICK), and the thread in each thread block is FFTN (number of frequency points), written as dim3 block(FFTN), each thread is responsible for a complex-complex multiplication; apply for cuComplex type variables d_dataout_l and d_dataout_r of tracking target number × maximum number of array elements in the tracking sector × number of frequency points in the GPU space, use data_gpu, zy_num_need_l, zy_num_need_r and xiangyi_gpu variables as the input of the matrix point multiplication kernel function, calculate the point-to-point multiplication (note that this is complex-complex multiplication) of array element (array element in the tracking beam sector) data and phase data, and store the left and right sector results in variables d_dataout_l and d_dataout_r respectively;

[0031] Step S402: In the GPU kernel function, sum the data of different array elements at the same frequency point under the same target of d_dataout_l and d_dataout_r to obtain d_dataSum_l and d_dataSum_r;

[0032] The distribution of threads for applying for GPU kernel function is as follows: the thread block distribution in the grid is TRACKER_NUM (number of tracking targets), written as dim3 grid(TRACKER_NUM), the thread in each thread block is FFTN (number of frequency points), written as dim3block(FFTN), and each thread is responsible for adding the corresponding results of all array elements of a certain frequency point of the current tracking target; then apply for the number of tracking targets × the number of frequency points of cuComplex type variables d_dataSum_l and d_dataSum_r in the GPU space, sum d_dataout_l and d_dataout_r in the custom summation kernel function, add the results of different array elements at the same frequency point of each tracking target, and store the results in d_dataSum_l and d_dataSum_r, that is, the left and right beam results of all tracking targets.

[0033] Further, in step S5, the left and right beam results of the same target d_dataSum_l and d_dataSum_r are added, and the cufftExecC2C function in the cufft library performs parallel IFFT (inverse Fourier transform) calculation to obtain the time domain data of the tracking beam, specifically:

[0034] The cufft library function is used to perform inverse Fourier transform on the combined tracking beam to obtain the time domain data of the tracking beam. First, a cuComplex type variable d_dataSum_lr of the number of tracking targets × the number of frequency points is applied in the GPU space, and the results of the left and right beams of each target are added together to obtain d_dataSum_lr. Then, the cufftExecC2C function in the cufft library is used to perform parallel IFFT calculations to obtain the time domain data of all target tracking beams.

[0035] The beneficial effects of the present invention are:

[0036] 1. Separate logic and calculation as much as possible. The calculation part takes advantage of the parallelism of GPU, which greatly improves the calculation efficiency in the algorithm engineering implementation and has better real-time performance than traditional cross-spectrum tracking.

[0037] 2. During the GPU computing process, the program steps are optimized. For example, in the beamforming part, the multiplication and summation are implemented by dividing them into two kernel functions: multiplication and summation. This fully utilizes the parallel advantages of the GPU and makes the GPU computing steps more detailed and more efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a workflow diagram of the present invention implementing cross-spectrum tracking through GPU;

[0039] Figure 2 This is a diagram of the storage structure of the pre-stored array element number information of S1;

[0040] Figure 3 This is a schematic diagram of S201 copying array data from CPU to GPU;

[0041] Figure 4 A schematic diagram showing the arrangement of array element numbers for all tracking targets involved in tracking beamforming in S202;

[0042] Figure 5 It is a schematic diagram of the phase shift information corresponding to the time delay of S3;

[0043] Figure 6 A schematic diagram of the point multiplication of the calculated array data and phase data in S401;

[0044] Figure 7 This is a schematic diagram of summing up the array element results of S402. DETAILED DESCRIPTION

[0045] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0046] Existing cross-spectrum tracking technology is mainly developed based on embedded platforms and is multi-core parallel computing. Each core has limited computing resources and is generally only responsible for one or more tracker calculations. Therefore, in the face of increasing tracking target needs, the demand can only be met by adding CPU boards. This will increase the complexity of the system, so how to improve computing efficiency becomes very important.

[0047] In the hardware architecture using CPU+GPU, the computing part is placed in the GPU, and the logical calculation or small-scale calculation is placed in the CPU, which can improve the computing efficiency. Through the CPU development time measurement, it is found that the main time consumption is concentrated in the left and right split beam forming parts. After analyzing the implementation process of the cross-spectrum tracking process, the present invention adopts the method of changing from the parallel method of calculating multiple tracking targets separately on the DSP platform with multiple threads to the simultaneous calculation of multiple targets with large calculation amount using GPU, and the logical calculation using CPU calculation structure to optimize and improve the implementation process of the tracking process. Considering that the split beam forming calculation occupies most of the time of cross-spectrum tracking, the present invention proposes to further compress the processing time of beam forming on the GPU platform by kernel function calculation, thereby greatly improving the computational efficiency of the cross-spectrum tracking process.

[0048] In the present invention, the input data is the frequency domain array data after FFT processing of the time domain array data collected by the acquisition system. The processing process of Fourier transforming the time domain signal to obtain the frequency domain signal is not within the scope of the present invention and will not be discussed.

[0049] like Figure 1 As shown, the present invention provides a GPU-based cross-spectrum tracking method, and a specific implementation method of an embodiment is as follows:

[0050] Step S1: Pre-calculate all the pitch angles and beam cross-spectrum information required for tracking. In the initialization phase of the program, the information required for tracking cross-spectrum calculation is obtained through the GPU kernel function and pre-stored in the CPU and GPU. Specifically:

[0051] Step S101: Calculate the array element number information of each beam participating in beamforming at each pitch angle in the CPU. Usually, the array element covered within a certain open angle fan range based on the current beam angle is used as the array element participating in the calculation of this tracking beam. The open angle is determined according to the actual situation. The reference value can be 100°. The fan is divided into a left fan and a right fan. The two fans are roughly divided by the direction of the beam corresponding angle. The number of array elements in the left and right fans is equal. The calculated array element information is stored in the CPU. The storage structure is shown in FIG. Figure 2 .

[0052] Step S102: Calculate the acoustic path difference information corresponding to the array elements participating in the tracking beam calculation for each beam at each pitch angle in the GPU; apply for the GPU kernel function thread distribution as follows: the thread block distribution in the grid is BS, FY (number of beams, pitch angle dimension), written as dim3 grid (BS, FY), and the thread in each thread block is JYS_PICK (maximum number of array elements in the tracking sector), written as dim3block (JYS_PICK). This thread distribution allows each thread to calculate a sound path difference, making full use of the GPU multi-threaded computing advantage. Under this thread distribution, the required sound path difference information is calculated by the GPU sound path difference kernel function, and copied to the CPU through the cudaMemcpy function. The storage structure is the same as Figure 2 Same (just change Figure 2 The array element number in the data structure is replaced by the sound path difference corresponding to the array element).

[0053] In step 1, the GPU acoustic path difference kernel function is used to calculate the acoustic path difference corresponding to the array elements participating in beamforming in each beam direction. Specifically, in the left-hand coordinate system, assuming that the current thread calculates the acoustic path difference of a certain array element at a pitch angle of (The pitch angle is 0 degrees on the horizontal plane, a positive rotation toward the Z axis is a pitch angle greater than 0, and a negative rotation toward the Z axis is an elevation angle less than 0), and the azimuth angle is θ e (The azimuth angle is 0 degrees in the positive direction of the X axis, and the angle increases clockwise, with a maximum of 360 degrees). The coordinates of this array element are (x e ,y e ,z e ), at this time, the acoustic path difference of the array element in the direction of the current pitch angle and horizontal angle relative to the origin of the coordinate system is:

[0054]

[0055] Since the GPU sound path difference kernel function runs on multiple GPU threads, each thread is responsible for calculating the sound path difference of an array element in one direction, thereby realizing GPU parallel calculation to obtain the sound path differences of all array elements in all directions.

[0056] Step S2: copy the frequency domain array data into the GPU, and sort out the array element number information of all the currently tracked target beams corresponding to the sector, and copy it to the GPU, specifically:

[0057] Step S201: receiving array element frequency domain data, and copying it from the CPU to the GPU variable data_gpu;

[0058] In the CPU memory space, apply for a variable data_cpu of the cuComplex (complex type, two float) type with the number of array elements × the number of frequency points to receive the array data sent by the front end. In the GPU space, apply for a variable data_gpu of the cuComplex size with the number of array elements × the number of frequency points. Use the cudaMemcpy function to copy from data_cpu to data_gpu variable. The schematic diagram is as follows Figure 3 As shown;

[0059] S202: Calculate the array element sector information required for cross-spectrum tracking of each target according to the current pitch angle, beam and pre-stored information of each tracked target, and copy it to GPU variables zy_num_need_l and zy_num_need_r;

[0060] In the GPU space, apply for the number of tracking targets × the maximum number of tracking sector array elements. The int type variables zy_num_need_l and zy_num_need_r correspond to the array element number information selected for the left and right sectors respectively. According to the pre-stored tracking information and the pitch and beam information of the current tracking target, the array element number information required for each tracking target is sorted out. See the schematic diagram Figure 4 , copied from the CPU to the zy_num_need_l and zy_num_need_r variables of the GPU through the cudaMemcpy function.

[0061] Step S3: According to the pre-stored information and the pitch angle, beam information, and sound speed information of the current tracking target, the phase shift information of each target participating in the tracking beamforming is calculated in the GPU, which is recorded as xiangyi_gpu_l and xiangyi_gpu_r, specifically:

[0062] Calculate the phase shift information of the array element corresponding to the tracking beam where each current tracking target is located, apply for the number of tracking targets × the maximum number of array elements in the tracking sector float type variables timedelay_gpu_l and timedelay_gpu_r in the GPU space, apply for the number of tracking targets × the maximum number of array elements in the tracking sector × the number of frequency points cuComplex type (complex type, two float) variables xiangyi_gpu_l and xiangyi_gpu_r, calculate the time delay information corresponding to all current tracking targets in the CPU according to the pre-stored sound path difference information and the sound speed information given by the sensor (the time delay is equal to the sound path difference divided by the sound speed), and copy the time delay information from the CPU to the GPU timedelay_gpu_l and timedelay_gpu_r variables through the cudaMemcpy function, and then calculate the phase shift information of all tracking targets through the user-defined phase shift calculation kernel function and store it in the xiangyi_gpu_l and xiangyi_gpu_r variables. The corresponding relationship is shown in Figure 5 , note that each phase shift information is a complex number (e -j2πfτ , f is frequency, τ is delay), when calculating the real and imaginary parts of the phase shift in the kernel function, using __cosf and __sinf will improve the calculation efficiency.

[0063] In the custom phase shift calculation kernel function of step S3, all threads are responsible for calculating the phase shift corresponding to different delays and frequencies. Each thread inputs the delay information and outputs the phase shift information corresponding to the current frequency point. Specifically, the frequency corresponding to the frequency point calculated by a thread is f e , input delay τ e When the phase shift of the thread output is Or expressed as (cos(2πf e τ e )+i(-sin(2πf e τ e )), where the real part and the imaginary part are separated and assigned to a float variable.

[0064] Step S4: Use a custom kernel function in the GPU to perform left and right fan beamforming of the current beam of all tracking targets. The custom kernel function includes a matrix dot multiplication kernel function and a sum kernel function, specifically:

[0065] Step S401: Calculate the element-by-element multiplication of the array data matrix and the phase shift information matrix in the GPU kernel function, and record the results as d_dataout_l and d_dataout_r;

[0066] The distribution of threads for applying for GPU kernel function is as follows: the distribution of thread blocks in the grid is TRACKER_NUM, JYS_PICK (number of tracking targets, maximum number of array elements in the tracking beam sector), written as dim3 grid(TRACKER_NUM, JYS_PICK), the thread in each thread block is FFTN (number of frequency points), written as dim3 block(FFTN), and each thread is responsible for multiplying a complex number by a complex number. In the GPU space, apply for variables d_dataout_l and d_dataout_r of the cuComplex type (complex type, two floats) of the number of tracking targets × maximum number of array elements in the tracking sector × number of frequency points, use data_gpu, zy_num_need_l, zy_num_need_r and xiangyi_gpu variables as the input of the matrix point multiplication kernel function, calculate the point-to-point multiplication result of the array element (array element in the tracking beam sector) data and the phase data, and realize the phase shift of the frequency domain data by multiplying the two complex numbers at the corresponding positions, such as Figure 6 As shown, the left sector and right sector results are stored in variables d_dataout_l and d_dataout_r respectively;

[0067] Step S402: In the GPU kernel function, sum the data of different array elements at the same frequency point under the same target of d_dataout_l and d_dataout_r to obtain d_dataSum_l and d_dataSum_r;

[0068] The thread distribution of the GPU kernel function is as follows: the thread block distribution in the grid is TRACKER_NUM (number of tracking targets), written as dim3 grid (TRACKER_NUM), the thread in each thread block is FFTN (number of frequency points), written as dim3block (FFTN), and each thread is responsible for adding the corresponding results of all array elements of a certain frequency point of the current tracking target. Then apply for the number of tracking targets × the number of frequency points of cuComplex type variables d_dataSum_l and d_dataSum_r in the GPU space, and sum d_dataout_l and d_dataout_r in the custom summation kernel function (add all numbers corresponding to the same frequency point), and add the results of different array elements at the same frequency point of each tracking target, such as Figure 7 As shown, the results are stored in d_dataSum_l and d_dataSum_r, that is, the left and right beam results of all tracked targets. The left and right beam data d_dataSum_l and d_dataSum_r are copied to CPU variables, and the cross-spectrum calculation is performed to obtain the compensation angle, which is compensated based on the input tracking angle to obtain the tracking angle result.

[0069] Step S5: Add the left and right beam results of the same target d_dataSum_l and d_dataSum_r, and perform parallel IFFT (inverse Fourier transform) calculation using the cufftExecC2C function in the cufft library to obtain the time domain data of the tracking beam, specifically:

[0070] The cufft library function is used to perform inverse Fourier transform on the combined tracking beam to obtain the time domain data of the tracking beam. First, a cuComplex type variable d_dataSum_lr of the number of tracking targets × the number of frequency points is applied in the GPU space, and the results of the left and right beams of each target are added together to obtain d_dataSum_lr. Then, the cufftExecC2C function in the cufft library is used to perform parallel IFFT calculations to obtain the time domain data of all target tracking beams.

[0071] It should be noted that the above embodiments are merely preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. All equivalent modifications made on the basis of the above embodiments belong to the protection scope of the present invention.

Claims

1. A GPU-based cross-spectrum tracking method, characterized in that: The steps include: Step S1, before the tracking process starts, all the tracking information required for the tracking pitch and beam angle in the tracking cross-spectrum calculation is calculated by the CPU and GPU, and stored in the CPU in advance; Step S2, copy the received frequency domain array data from the CPU to the GPU, and at the same time, sort out the array element numbers covered by the beam sector of all tracking targets according to the pitch angle and beam information of the current tracking target and copy them to the GPU; Step S3, calculating the phase shift information of the array element corresponding to the sector of the tracking beam where each tracking target is currently located; Step S4: According to the received array data, the array element number information of each tracking target and the phase shift information corresponding to the array element, tracking beamforming is performed in the GPU through a custom kernel function. Each target obtains a left sector beamforming result and a right sector beamforming result. The left and right beam data are copied to the CPU, and the cross-spectrum calculation is performed to obtain the compensation angle. The tracking angle result is compensated based on the input tracking angle. Step S5: Combine the left and right beams of each tracking target respectively, and then use the cufft library function to perform inverse Fourier transform to obtain the time domain data of the tracking beam.

2. The GPU-based cross-spectrum tracking method according to claim 1, characterized in that: In step S1, all pitch angles and beam cross-spectrum calculations required for tracking are pre-calculated. In the program initialization phase, the information required for tracking cross-spectrum calculation is obtained through the GPU kernel function and pre-stored in the CPU and GPU. Specifically, Step S101: Calculate the array element number information of each beam at each pitch angle participating in beamforming in the CPU, take the current beam angle as the reference, and the array elements covered within a certain open angle fan range are used as the array elements participating in the calculation of this tracking beam, the fan is divided into a left fan and a right fan, the two fans are divided by the beam corresponding angle direction, the number of array elements in the left and right fans is equal, and the calculated array element information is stored in the CPU; Step S102: Calculate the acoustic path difference information corresponding to the array elements participating in the tracking beam calculation for each beam at each pitch angle in the GPU; apply for the GPU kernel function thread distribution as follows: the thread block distribution in the grid is BS, FY, written as dim3 grid (BS, FY), and the thread in each thread block is JYS_PICK, written as dim3 block (JYS_PICK). This thread distribution allows each thread to calculate a sound path difference, and obtain the required sound path difference information through the GPU sound path difference kernel function calculation, and copy it to the CPU through the cudaMemcpy function.

3. The GPU-based cross-spectrum tracking method according to claim 1, characterized in that: In step S2, the frequency domain array data is copied into the GPU, and the array element number information of all the currently tracked target beams corresponding to the sectors is sorted out and copied to the GPU, specifically: Step S201: receiving array element frequency domain data, and copying it from the CPU to the GPU variable data_gpu; In the CPU memory space, apply for a cuComplex variable data_cpu of the number of array elements × the number of frequency points to receive the array data sent by the front end. In the GPU space, apply for a cuComplex variable data_gpu of the size of the number of array elements × the number of frequency points, and copy the variable data_cpu to the data_gpu variable through the cudaMemcpy function. Step S202: Calculate the array element sector information required for cross-spectrum tracking of each target according to the current pitch angle, beam and pre-stored information of each tracked target, and copy it to GPU variables zy_num_need_l and zy_num_need_r; In the GPU space, apply for the number of tracking targets × the maximum number of array elements in the tracking sector. The int type variables zy_num_need_l and zy_num_need_r correspond to the array element number information selected for the left and right sectors respectively. According to the pre-stored tracking information and the pitch and beam information of the current tracking target, the array element number information required for each tracking target is sorted out, and copied from the CPU to the zy_num_need_l and zy_num_need_r variables of the GPU through the cudaMemcpy function.

4. The GPU-based cross-spectrum tracking method according to claim 1, characterized in that: In step S3, according to the pre-stored information and the pitch angle, beam information, and sound speed information of the current tracked target, the phase shift information of each target participating in the tracking beamforming is calculated in the GPU, which is recorded as xiangyi_gpu_l and xiangyi_gpu_r, specifically: Calculate the phase shift information of the array element corresponding to the tracking beam where each current tracking target is located, apply for the number of tracking targets × the maximum number of array elements in the tracking sector float type variables timedelay_gpu_l and timedelay_gpu_r in the GPU space, apply for the number of tracking targets × the maximum number of array elements in the tracking sector × the number of frequency points cuComplex type variables xiangyi_gpu_l and xiangyi_gpu_r, calculate the time delay information corresponding to all current tracking targets in the CPU according to the pre-stored sound path difference information and the sound speed information given by the sensor, and copy the delay information from the CPU to the GPU timedelay_gpu_l and timedelay_gpu_r variables through the cudaMemcpy function, and then calculate the phase shift information of all tracking targets through the user-defined phase shift calculation kernel function and store it in the xiangyi_gpu_l and xiangyi_gpu_r variables.

5. The GPU-based cross-spectrum tracking method according to claim 1, characterized in that: In step S4, a custom kernel function is used in the GPU to perform left and right sector beamforming of the current beam of all tracking targets. The custom kernel function includes a matrix dot multiplication kernel function and a summation kernel function, specifically: Step S401: Calculate the element-by-element multiplication of the array data matrix and the phase shift information matrix in the GPU kernel function, and record the results as d_dataout_l and d_dataout_r; Apply for GPU kernel function thread distribution: the thread block distribution in the grid is TRACKER_NUM, JYS_PICK, written as dim3grid(TRACKER_NUM, JYS_PICK), the thread in each thread block is FFTN, written as dim3block(FFTN), and each thread is responsible for a complex number multiplication by a complex number; apply for tracking target number × maximum number of array elements in the tracking sector × number of frequency points cuComplex type variables d_dataout_l and d_dataout_r in the GPU space, use data_gpu, zy_num_need_l, zy_num_need_r and xiangyi_gpu variables as the input of the matrix dot multiplication kernel function, calculate the point-to-point multiplication result of the array data and phase data, and store the left and right sector results in variables d_dataout_l and d_dataout_r respectively; Step S402: In the GPU kernel function, sum the data of different array elements at the same frequency point under the same target of d_dataout_l and d_dataout_r to obtain d_dataSum_l and d_dataSum_r; The thread distribution of the GPU kernel function is applied as follows: the thread block distribution in the grid is TRACKER_NUM, written as dim3grid(TRACKER_NUM), the thread in each thread block is FFTN, written as dim3 block(FFTN), and each thread is responsible for adding the corresponding results of all array elements of a certain frequency point of the current tracking target; then apply for cuComplex type variables d_dataSum_l and d_dataSum_r of the number of tracking targets × the number of frequency points in the GPU space, sum d_dataout_l and d_dataout_r in the custom summation kernel function, add the results of different array elements at the same frequency point of each tracking target, and store the results in d_dataSum_l and d_dataSum_r, that is, the left and right beam results of all tracking targets.

6. The GPU-based cross-spectrum tracking method according to claim 1, characterized in that: In step S5, the left and right beam results of the same target d_dataSum_l and d_dataSum_r are added together, and the cufftExecC2C function in the cufft library performs parallel IFFT calculation to obtain the time domain data of the tracking beam, specifically: The cufft library function is used to perform inverse Fourier transform on the combined tracking beam to obtain the time domain data of the tracking beam. First, a cuComplex type variable d_dataSum_lr of the number of tracking targets × the number of frequency points is applied in the GPU space, and the results of the left and right beams of each target are added together to obtain d_dataSum_lr. Then, the cufftExecC2C function in the cufft library is used to perform parallel IFFT calculations to obtain the time domain data of all target tracking beams.