Air traffic control primary radar echo display method based on OpenCL
By using OpenCL in the air-busting primary radar for parallel drawing of echo images, the problems of performance loss and memory usage in echo display are solved, and more efficient echo display performance is achieved.
Patent Information
- Application Number
- CN202411153345.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-20
AI Technical Summary
In the existing air-tube primary radar echo display method, performance losses are caused by real-time calculation of echo color, and echo afterglow is realized by saving multi-frame data and multi-layer drawing, resulting in large memory usage and serious performance losses.
Using OpenCL-based method, by generating echo arrays and time arrays, creating color tables, and using OpenCL to draw echo images in parallel, reducing memory usage and improving drawing performance.
It effectively reduces the memory usage of echo display, improves drawing performance, reduces the requirements for computer hardware performance, and improves hardware adaptability.
Smart Images

Figure CN119165482A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of air traffic control radar, and in particular is an air traffic control primary radar echo display method based on OpenCL. Background Art
[0002] In air traffic control primary radars, echo images are displayed through display software to observe the targets detected by the radar and the detection performance; and the continuity of the detected targets is observed by displaying multiple frames of echo images, namely echo afterglow. Therefore, echo display is an important function of air traffic control primary radars.
[0003] In previous echo display methods, echo colors were calculated on the fly, resulting in performance losses. Echo afterglow was typically achieved by saving multiple frames of data and rendering them layer by layer, requiring a large amount of memory. As the echo afterglow duration increased, so did the memory requirements, and rendering multiple layers incurred certain performance losses.
[0004] To this end, the present invention proposes an OpenCL-based air traffic control primary radar echo display method, which optimizes memory usage and greatly improves rendering performance. Summary of the Invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes an air traffic control primary radar echo display method based on OpenCL, which is used to solve the technical problems that in the echo display method of the prior art, there is performance loss due to the need for immediate settlement of the echo color display. In addition, since the prior art realizes echo afterglow by saving multiple frames of data and multi-layer rendering, it requires a large amount of memory and there is a performance loss in multi-layer rendering.
[0006] To achieve the above objectives, a first aspect of the present invention provides an OpenCL-based air traffic control primary radar echo display method, comprising:
[0007] S1: Generate a canvas and set basic parameters of the canvas using a graphical user interface software; the basic parameters include size and format;
[0008] S2: Generates an echo array and a time array based on the number of bits in a frame of the ATC primary radar. The echo array is used to store echo data, and the time array is used to store the time corresponding to the echo data. The echo data is the amplitude value of the ATC primary radar echo.
[0009] S3: Create a color table based on the number of wave bits in one frame of the ATC primary radar; the color table is a mapping relationship between color values and echo data;
[0010] S4: Read the echo data, write it into the echo array and update the time array;
[0011] S5: Draw the echo image on the canvas through OpenCL based on the echo array and color table;
[0012] S6: Paste the echo image onto the window of the graphical user interface software to display the echo of the air traffic control primary radar.
[0013] It should be noted that OpenCL (Open Computing Language) refers to an open computer language.
[0014] Preferably, the generating of the echo array and the time array based on the number of wave bits of one frame of the air traffic control primary radar includes:
[0015] A1: Obtain the number of wave bits per frame of the ATC primary radar, the detection range and range resolution of the ATC primary radar;
[0016] A2: Calculates the range unit based on the detection range and range resolution of the ATC primary radar;
[0017] A3: Use the number of wavelets as the first dimension and the distance unit as the second dimension to create the echo array and time array respectively.
[0018] A4: Set the data type of the echo array to byte.
[0019] A5: Set the data type of the time array to long integer.
[0020] The present invention uses a time array to record the time corresponding to the echo data, which facilitates determining the color of the echo data when drawing the echo image later, and is beneficial to reducing memory usage when displaying the echo afterglow.
[0021] Preferably, the distance calculation unit based on the detection range and range resolution of the air traffic control primary radar includes:
[0022] Extract the detection range TL and range resolution JF of the air traffic control primary radar; calculate the range unit JD using the formula JD = TL / JF.
[0023] Preferably, the step of creating a color table based on the number of wave bits of a frame of the air traffic control primary radar includes:
[0024] Obtain the number of wave bits in a frame of the air traffic control primary radar; divide the color value into color grades corresponding to the number of wave bits, each color grade corresponds to one echo data, and integrate the mapping relationship between each color grade and the corresponding echo data into a color table.
[0025] The present invention divides the color value into a corresponding number of color grades according to the number of wave bits in a frame of the air traffic control primary radar, and creates a color table by establishing a mapping relationship between the color grades and the echo data, so as to facilitate the subsequent query of the color table by the echo data to obtain the corresponding color in the process of drawing the echo image.
[0026] Preferably, the reading of echo data, writing the data into an echo array, and updating a time array comprises:
[0027] B1: Read echo data from the network or file to obtain the amplitude to be written;
[0028] B2: Calculate the remaining amplitude of the original echo data at the current time according to the echo afterglow setting time;
[0029] B3: Determine whether the remaining amplitude is greater than the amplitude to be written; if so, do not write the echo data into the echo array and the remaining amplitude remains unchanged; if not, replace the remaining amplitude with the amplitude to be written;
[0030] B4: Determines whether the echo array is updated; if so, updates the time data in the time array; if not, jumps to B1.
[0031] The present invention calculates the remaining amplitude of the original echo data at the current time according to the time set by the echo afterglow, and replaces the amplitude to be written with the remaining amplitude when the remaining amplitude is less than or equal to the amplitude to be written, which is beneficial to reducing the memory usage of the echo display.
[0032] Preferably, the calculating of the remaining amplitude of the original echo data at the current time according to the time set by the echo afterglow includes:
[0033] C1: Set the maximum amplitude and persistence time;
[0034] C2: Divide the maximum amplitude by the afterglow time to get the amplitude reduction per unit time;
[0035] C3: Calculate the time difference between the current time and each data in the time array;
[0036] C4: Multiply the amplitude reduction per unit time by the time difference to get the total amplitude reduction;
[0037] C5: Subtract the total amplitude reduction from the corresponding echo array to obtain the residual amplitude.
[0038] Preferably, drawing the echo image on the canvas through OpenCL based on the echo array and the color table includes:
[0039] D1: Get the remaining amplitude in the echo array;
[0040] D2: Input the remaining amplitude into the color table to obtain the corresponding color value;
[0041] D3: Parallel drawing of echo images on canvas using OpenCL;
[0042] D4: Fill in the corresponding color value at the corresponding position on the canvas to obtain the echo image.
[0043] The present invention obtains the color of the corresponding position of the echo data on the canvas by querying the color table. Compared with the existing technology that calculates the color corresponding to the echo data in real time, it is beneficial to improve the performance of echo display; in addition, since the echo image is drawn in parallel by using OpenCL, the performance of drawing the echo image is improved, which is beneficial to reducing the performance requirements of the echo display on the computer hardware and improving the adaptability of the hardware.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] 1. The present invention calculates the remaining amplitude of the original echo data at the current time according to the time set by the echo afterglow. When the remaining amplitude is less than or equal to the amplitude to be written, the amplitude to be written replaces the remaining amplitude, which is beneficial to reducing the memory usage of echo display.
[0046] 2. The present invention divides color values into a corresponding number of color grades according to the number of wave bits in a frame of an air traffic control primary radar, creates a color table by establishing a mapping relationship between color grades and echo data, and obtains the color of the echo data at the corresponding position on the canvas by querying the color table. Compared with the existing technology that calculates the color corresponding to the echo data in real time, this is conducive to improving the performance of echo display; in addition, since the echo image is drawn in parallel using OpenCL, the performance of drawing the echo image is improved, which is conducive to reducing the performance requirements of the echo display on the computer hardware and improving the adaptability of the hardware. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 This is an overall flow chart of the OpenCL-based air traffic control primary radar echo display method of the present invention. DETAILED DESCRIPTION
[0049] The technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0050] See also Figure 1 The first embodiment of the present invention provides an OpenCL-based air traffic control primary radar echo display method, comprising:
[0051] S1: Generate a canvas and set basic parameters of the canvas using a graphical user interface software; the basic parameters include size and format;
[0052] S2: Generates an echo array and a time array based on the number of bits in a frame of the ATC primary radar. The echo array is used to store echo data, and the time array is used to store the time corresponding to the echo data. The echo data is the amplitude value of the ATC primary radar echo.
[0053] S3: Create a color table based on the number of wave bits in one frame of the ATC primary radar; the color table is a mapping relationship between color values and echo data;
[0054] S4: Read the echo data, write it into the echo array and update the time array;
[0055] S5: Draw the echo image on the canvas through OpenCL based on the echo array and color table;
[0056] S6: Paste the echo image onto the window of the graphical user interface software to display the echo of the air traffic control primary radar.
[0057] It should be noted that OpenCL (Open Computing Language) refers to an open computer language.
[0058] For example, Qt is used as the graphical user interface software, the offline layer QImage is used as the canvas, and the QImage is drawn and displayed through QPainter in the window component QWidget; the format in the basic parameters of QImage is set to QImage::Format_ARGB32 format, and the size is set to 1600×1600.
[0059] In this embodiment, the echo array and time array are generated based on the number of wave bits of one frame of the air traffic control primary radar, including:
[0060] A1: Obtain the number of wave bits per frame of the ATC primary radar, the detection range and range resolution of the ATC primary radar;
[0061] A2: Calculates the range unit based on the detection range and range resolution of the ATC primary radar;
[0062] A3: Use the number of wavelets as the first dimension and the distance unit as the second dimension to create the echo array and time array respectively.
[0063] A4: Set the data type of the echo array to byte.
[0064] A5: Set the data type of the time array to long integer.
[0065] For example, the number of wave bits in one frame of the ATC primary radar is set to 256, the detection range TL of the ATC primary radar is 480 km, and the range resolution JF is 60 m; the range unit JD is calculated to be 8000 by the detection range and range resolution of the ATC primary radar; the echo array HB
[256]
[8000] and the time array SJ
[256]
[8000] are respectively established with the number of wave bits 256 as the length of the first dimension and the range unit 8000 as the length of the second dimension; the data type of the echo array is set to byte; and the data type of the time array is set to long integer.
[0066] The present invention uses a time array to record the time corresponding to the echo data, which facilitates determining the color of the echo data when drawing the echo image later, and is beneficial to reducing memory usage when displaying the echo afterglow.
[0067] In this embodiment, the range unit is calculated based on the detection range and range resolution of the air traffic control primary radar, including:
[0068] Extract the detection range TL and range resolution JF of the air traffic control primary radar; calculate the range unit JD using the formula JD = TL / JF.
[0069] In this embodiment, a color table is created based on the number of wave bits in a frame of the air traffic control primary radar, including:
[0070] Obtain the number of wave bits in a frame of the air traffic control primary radar; divide the color value into color grades corresponding to the number of wave bits, each color grade corresponds to one echo data, and integrate the mapping relationship between each color grade and the corresponding echo data into a color table.
[0071] For example, the number of wave bits in a frame of an air traffic control primary radar is 256, and the color value is divided into 256 color levels corresponding to the number of wave bits. Each color level corresponds to an echo data, and the mapping relationship between each color level and the corresponding echo data is integrated into a color table.
[0072] The present invention divides the color value into a corresponding number of color grades according to the number of wave bits in a frame of the air traffic control primary radar, and creates a color table by establishing a mapping relationship between the color grades and the echo data, so as to facilitate the subsequent query of the color table by the echo data to obtain the corresponding color in the process of drawing the echo image.
[0073] In this embodiment, reading echo data, writing it into the echo array, and updating the time array include:
[0074] B1: Read echo data from the network or file to obtain the amplitude to be written;
[0075] B2: Calculate the remaining amplitude of the original echo data at the current time according to the echo afterglow setting time;
[0076] B3: Determine whether the remaining amplitude is greater than the amplitude to be written; if so, do not write the echo data into the echo array and the remaining amplitude remains unchanged; if not, replace the remaining amplitude with the amplitude to be written;
[0077] B4: Determines whether the echo array is updated; if so, updates the time data in the time array; if not, jumps to B1.
[0078] Exemplarily, the remaining amplitude is set to 20db and the amplitude to be written is 18db; since the remaining amplitude of 20db is greater than the amplitude to be written of 18db, the echo data is not written to the echo array and the remaining amplitude remains unchanged; since the echo array is not updated, jump to B1.
[0079] The present invention calculates the remaining amplitude of the echo data and replaces the amplitude to be written with the remaining amplitude when the remaining amplitude is less than or equal to the amplitude to be written, which is beneficial to reducing the memory usage of the echo display.
[0080] In this embodiment, the remaining amplitude of the original echo data at the current time is calculated according to the time set by the echo afterglow, including:
[0081] C1: Set the maximum amplitude and persistence time;
[0082] C2: Divide the maximum amplitude by the afterglow time to get the amplitude reduction per unit time;
[0083] C3: Calculate the time difference between the current time and each data in the time array;
[0084] C4: Multiply the amplitude reduction per unit time by the time difference to get the total amplitude reduction;
[0085] C5: Subtract the total amplitude reduction from the corresponding echo array to obtain the residual amplitude.
[0086] For example, the maximum amplitude is set to 120db and the afterglow time is 20s. The unit time amplitude reduction is obtained by dividing the maximum amplitude by the afterglow time, which is 6db / s; the time difference between the current time and each data in the time array is set to 2s, and the unit time amplitude reduction of 6db / s is multiplied by the time difference of 2s to obtain a total amplitude reduction of 12db; the total amplitude reduction is subtracted from the corresponding echo array to obtain the residual amplitude.
[0087] In this embodiment, drawing an echo image on a canvas using OpenCL based on an echo array and a color table includes:
[0088] D1: Get the remaining amplitude in the echo array;
[0089] D2: Input the remaining amplitude into the color table to obtain the corresponding color value;
[0090] D3: Parallel drawing of echo images on canvas using OpenCL;
[0091] D4: Fill in the corresponding color value at the corresponding position on the canvas to obtain the echo image.
[0092] The present invention obtains the color of the corresponding position of the echo data on the canvas by querying the color table. Compared with the existing technology that calculates the color corresponding to the echo data in real time, it is beneficial to improve the performance of echo display; in addition, since the echo image is drawn in parallel by using OpenCL, the performance of drawing the echo image is improved, which is beneficial to reducing the performance requirements of the echo display on the computer hardware and improving the adaptability of the hardware.
[0093] The above embodiments are only used to illustrate the technical method of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.
Claims
1. A method for displaying primary radar echo of air traffic control based on OpenCL, characterized in that: include: S1: Generate a canvas and set basic parameters of the canvas through a graphical user interface software; wherein the basic parameters include size and format; S2: Generate an echo array and a time array based on the number of wave bits of one frame of the ATC primary radar; the echo array is used to store the echo data, and the time array is used to store the time corresponding to the echo data; the echo data is the amplitude value of the ATC primary radar echo; S3: Create a color table based on the number of wave bits of one frame of the ATC primary radar; wherein the color table is a mapping relationship between color values and echo data; S4: read the echo data, write it into the echo array and update the time array; S5: Draw the echo image on the canvas through OpenCL based on the echo array and color table; S6: Paste the echo image onto the window of the graphical user interface software to display the echo of the ATC primary radar.
2. The method for displaying air traffic control primary radar echo based on OpenCL according to claim 1, characterized in that: The method of generating an echo array and a time array based on the number of wave bits of one frame of the air traffic control primary radar includes: A1: Obtain the number of wave bits per frame of the ATC primary radar, the detection distance and distance resolution of the ATC primary radar; A2: Calculate the range unit based on the detection range and range resolution of the ATC primary radar; A3: Use the number of wave numbers as the length of the first dimension and the distance unit as the length of the second dimension to establish the echo array and time array respectively; A4: Set the data type of the echo array to byte; A5: Set the data type of the time array to long integer.
3. The method for displaying air traffic control primary radar echo based on OpenCL according to claim 2, characterized in that: The distance calculation unit based on the detection distance and distance resolution of the air traffic control primary radar includes: Extract the detection distance TL and distance resolution JF of the air traffic control primary radar; calculate the distance unit JD through the formula JD=TL / JF.
4. The method for displaying air traffic control primary radar echo based on OpenCL according to claim 1, characterized in that: The method of creating a color table based on the number of wave bits of one frame of the air traffic control primary radar includes: The number of wave bits of one frame of the air traffic control radar is obtained; the color value is divided into color grades corresponding to the number of wave bits, each color grade corresponds to an echo data, and the mapping relationship between each color grade and the corresponding echo data is integrated into a color table.
5. The method for displaying air traffic control primary radar echo based on OpenCL according to claim 1, characterized in that: The process of reading echo data, writing it into the echo array and updating the time array includes: B1: Read echo data from the network or file to obtain the amplitude to be written; B2: Calculate the remaining amplitude of the original echo data at the current time according to the echo afterglow setting time; B3: Determine whether the remaining amplitude is greater than the amplitude to be written; if yes, the echo data is not written into the echo array and the remaining amplitude remains unchanged; if no, the remaining amplitude is replaced by the amplitude to be written; B4: Determine whether the echo array is updated; if yes, update the time data in the time array; if no, jump to B1.
6. The method for displaying air traffic control primary radar echo based on OpenCL according to claim 5, characterized in that: The calculating the remaining amplitude of the original echo data at the current time according to the time set by the echo afterglow includes: C1: Set the maximum amplitude and persistence time; C2: Divide the maximum amplitude by the afterglow time to get the amplitude reduction per unit time; C3: Calculate the time difference between the current time and each data in the time array; C4: Multiply the amplitude reduction per unit time by the time difference to get the total amplitude reduction; C5: Subtract the total amplitude reduction from the corresponding echo array to obtain the residual amplitude.
7. The method for displaying air traffic control primary radar echo based on OpenCL according to claim 1, characterized in that: Drawing the echo image on the canvas through OpenCL based on the echo array and the color table includes: D1: Get the remaining amplitude in the echo array; D2: Input the remaining amplitude into the color table to obtain the corresponding color value; D3: Parallel drawing of echo images on canvas using OpenCL; D4: Fill in the corresponding color value at the corresponding position on the canvas to obtain the echo image.
Citation Information
Cited By
Secondary surveillance radar target tracking and airspace scanning method
CN122386290A
