Sonar data processing method and system based on multi-process separation architecture, computer device and readable storage medium

By employing a multi-process separation architecture for sonar data processing, and decoupling processes using shared buffers and result queues, high real-time sonar data processing is achieved, solving the problems of blocking and poor real-time performance in traditional sonar data processing systems.

CN121412004BActive Publication Date: 2026-04-07ZHEJIANG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-29
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Traditional sonar data processing systems suffer from data processing blockage and poor real-time performance. Existing multi-threaded or multi-process solutions lack effective inter-process communication mechanisms, making it difficult to meet the requirements of high real-time processing.

Method used

A sonar data processing method based on a multi-process separation architecture is adopted. By initializing system parameters, creating a shared buffer and result queue, starting the acquisition, data processing and display processes, and transmitting parameters to the corresponding processes, the high real-time processing of data is achieved.

Benefits of technology

By decoupling the acquisition process from the data processing process, the waiting time between tasks is reduced, ensuring the real-time nature of data processing and providing efficient sonar data processing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121412004B_ABST
    Figure CN121412004B_ABST
Patent Text Reader

Abstract

The application relates to a sonar data processing method and system based on a multi-process separation architecture, a computer device and a readable storage medium. The method comprises the following steps: initializing system parameters; initializing a result queue and creating a shared buffer based on the system parameters; starting an acquisition process, a data processing process and a display process, and transmitting the system parameters to the corresponding processes; starting an acquisition device to collect the original sonar data and write the original sonar data into the shared buffer according to the received parameters by the acquisition process; obtaining the original sonar data from the shared buffer, performing data processing on the original sonar data according to the received parameters, and storing the processing result data into the result queue by the data processing process; obtaining the processing result data from the result queue, and performing display on the processing result data according to the received parameters by the display process. The method can realize high real-time processing of sonar data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a sonar data processing method, system, computer device, and readable storage medium based on a multi-process separation architecture. Background Technology

[0002] Sonar data processing is a crucial component of modern ocean exploration and underwater target identification. Sonar data processing generally refers to the technical process of extracting, converting, and interpreting useful information from underwater acoustic signals.

[0003] Traditional sonar data processing systems employ a single-process architecture, which suffers from problems such as data processing blockage and poor real-time performance. Existing multi-threaded or multi-process solutions lack effective inter-process communication mechanisms, making it difficult to meet the demands for high real-time processing.

[0004] There is currently no effective solution for achieving high real-time processing of sonar data in related technologies. Summary of the Invention

[0005] Therefore, it is necessary to provide a sonar data processing method, system, computer equipment, and readable storage medium based on a multi-process separation architecture that can achieve high real-time processing of sonar data, addressing the aforementioned technical problems.

[0006] In a first aspect, this application provides a sonar data processing method based on a multi-process separation architecture, including:

[0007] Initialize the system parameters necessary for system operation;

[0008] Initialize a result queue for storing data processing results, and create a shared buffer for caching raw sonar data based on the system parameters;

[0009] Start the acquisition process, data processing process, and display process, and transmit the parameters in the system parameters corresponding to the acquisition process, data processing process, and display process to the corresponding processes respectively;

[0010] The acquisition process starts the acquisition device to acquire the raw sonar data according to the received parameters, and writes the acquired raw sonar data into the shared buffer;

[0011] The data processing process obtains the raw sonar data from the shared buffer, processes the raw sonar data according to the received parameters, and stores the processing result data in the result queue.

[0012] The display process retrieves the processing result data from the result queue and displays the processing result data according to the received parameters.

[0013] In one embodiment, the system parameters include acquisition parameters, processing parameters, and visualization parameters;

[0014] The step of the acquisition process activating the acquisition device according to the received parameters includes: the acquisition process activating the acquisition device according to the acquisition parameters;

[0015] The data processing of the raw sonar data according to the received parameters includes: processing the raw sonar data according to the processing parameters;

[0016] The step of displaying the processing result data according to the received parameters includes: displaying the processing result data according to the visualization parameters;

[0017] The acquisition parameters include the number of samples acquired in a single acquisition and the type of transmitting unit; the processing parameters include the speed of sound in water and the signal sampling rate.

[0018] Using the number of samples acquired in a single sampling, the signal sampling rate, the type of transmitting unit, and the speed of sound in water, the time window and the maximum detection distance are obtained. The conversion formula between the number of samples acquired in a single sampling, the time window, and the maximum detection distance is as follows:

[0019]

[0020] Among them, For the time window, The number of samples collected in a single session. The signal sampling rate is... For maximum detection range, The speed of sound in water. For the aforementioned transmitting unit type, an external sound source Spontaneous and self-collected .

[0021] In one embodiment, the system parameters include the total number of slots in the shared buffer, the number of samples acquired in a single acquisition, and the number of channels in the acquisition sensor;

[0022] The process of creating a shared buffer for caching raw sonar data based on the system parameters includes: calculating the memory space required for the shared buffer based on the total number of slots in the shared buffer, the number of samples acquired in a single acquisition, and the number of channels of the acquisition sensor, and creating the shared buffer according to the memory space.

[0023] The formula for calculating memory space is:

[0024]

[0025] in, The total number of slots in the shared buffer. The number of samples collected in a single collection session. The number of channels of the acquisition sensor. The memory space for the shared buffer.

[0026] In one embodiment, the sonar data processing method based on a multi-process separation architecture further includes: initializing a data queue for storing data slot indices in the shared buffer;

[0027] The step of writing the collected raw sonar data into the shared buffer includes: writing the collected raw sonar data into a slot in the shared buffer, and storing the data slot index of the slot into the data queue;

[0028] The step of obtaining the raw sonar data from the shared buffer includes: obtaining the data slot index from the data queue, locating the corresponding slot in the shared buffer according to the data slot index, and obtaining the raw sonar data in the corresponding slot.

[0029] In one embodiment, the data processing of the raw sonar data according to the received parameters includes: selecting the optimal processor to perform data processing on the raw sonar data according to the received parameters.

[0030] In one embodiment, the system parameters include a gain value;

[0031] The step of the acquisition process starting the acquisition device to acquire the raw sonar data according to the received parameters includes: configuring the acquisition device for time gain compensation according to the gain value, and starting the acquisition device to acquire the raw sonar data;

[0032] The step of configuring the acquisition device for time gain compensation based on the gain value includes: converting the gain value into a hardware register control value and writing it into the corresponding register of the acquisition device for time gain compensation configuration.

[0033] In one embodiment, the data processing of the raw sonar data includes: executing a beamforming algorithm and generating three-dimensional point cloud data;

[0034] The step of displaying the processing result data includes: visualizing the generated 3D point cloud data;

[0035] The beamforming algorithm used is a frequency domain beamforming algorithm, and the calculation formula for the frequency domain beamforming algorithm is as follows:

[0036]

[0037] in, For the receiving array The time-domain received signal of each array element; The imaginary unit, It is a time variable; For a point in the imaging space To the The propagation delay of each array element; For the first The spatial coordinates of each array element; The speed of sound in water; The distance from the array element to the target point; This is the corresponding phase compensation factor; To obtain the target point by summing the frequency domain signals of all array elements after delay compensation. Beam output at the location; The total number of array elements; For the first The weighting coefficients of each array element; The energy intensity at the target point is the square of the beam output modulus. and These represent the real and imaginary parts of a complex number, respectively.

[0038] The formula for calculating the total number of target points is:

[0039]

[0040] in, This represents the total number of target points in the beam. This represents the number of sampling points. and The maximum and minimum detection distances are set. For distance resolution; and For the number of horizontal beams and the number of vertical beams.

[0041] Secondly, this application also provides a sonar data processing system based on a multi-process separation architecture, the system comprising: a configuration management module, a process management module, an acquisition module, a data processing module, and a display module;

[0042] The configuration management module is used to initialize the system parameters necessary for system operation.

[0043] The process management module is used to initialize a result queue for storing data processing results, and create a shared buffer for caching raw sonar data based on the system parameters; start the acquisition module, data processing module, and display module, and transmit the parameters in the system parameters corresponding to the acquisition module, data processing module, and display module to the corresponding modules respectively;

[0044] The acquisition module is used to start the acquisition device to acquire the raw sonar data according to the received parameters, and write the acquired raw sonar data into the shared buffer.

[0045] The data processing module is used to obtain the raw sonar data from the shared buffer, process the raw sonar data according to the received parameters, and store the processing result data into the result queue.

[0046] The display module is used to obtain the processing result data from the result queue and display the processing result data according to the received parameters.

[0047] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0048] Initialize the system parameters necessary for system operation;

[0049] Initialize a result queue for storing data processing results, and create a shared buffer for caching raw sonar data based on the system parameters;

[0050] Start the acquisition process, data processing process, and display process, and transmit the parameters in the system parameters corresponding to the acquisition process, data processing process, and display process to the corresponding processes respectively;

[0051] The acquisition process starts the acquisition device to acquire the raw sonar data according to the received parameters, and writes the acquired raw sonar data into the shared buffer;

[0052] The data processing process obtains the raw sonar data from the shared buffer, processes the raw sonar data according to the received parameters, and stores the processing result data in the result queue.

[0053] The display process retrieves the processing result data from the result queue and displays the processing result data according to the received parameters.

[0054] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0055] Initialize the system parameters necessary for system operation;

[0056] Initialize a result queue for storing data processing results, and create a shared buffer for caching raw sonar data based on the system parameters;

[0057] Start the acquisition process, data processing process, and display process, and transmit the parameters in the system parameters corresponding to the acquisition process, data processing process, and display process to the corresponding processes respectively;

[0058] The acquisition process starts the acquisition device to acquire the raw sonar data according to the received parameters, and writes the acquired raw sonar data into the shared buffer;

[0059] The data processing process obtains the raw sonar data from the shared buffer, processes the raw sonar data according to the received parameters, and stores the processing result data in the result queue.

[0060] The display process retrieves the processing result data from the result queue and displays the processing result data according to the received parameters.

[0061] The aforementioned sonar data processing method, system, computer device, and readable storage medium based on a multi-process separation architecture employ the following steps: initializing system parameters necessary for system operation; initializing a result queue for storing data processing results and creating a shared buffer for caching raw sonar data based on the system parameters; starting an acquisition process, a data processing process, and a display process, and transmitting the parameters corresponding to these processes from the system parameters to their respective processes; the acquisition process starting the acquisition device to acquire the raw sonar data according to the received parameters and writing the acquired raw sonar data into the shared buffer; the data processing process retrieving the raw sonar data from the shared buffer, processing the raw sonar data according to the received parameters, and storing the processing result data into the result queue; and the display process retrieving the processing result data from the result queue and displaying the processing result data according to the received parameters. By creating a shared buffer to cache raw sonar data, the acquisition process and the data processing process are decoupled. By initializing a result queue to store the processing results, the data processing process and the display process are further decoupled, thereby reducing the waiting time between tasks and ensuring the real-time performance of data processing. By initializing the system parameters necessary for system operation and transmitting the configuration parameters corresponding to each process to the corresponding process, a guarantee is provided for achieving high real-time processing of sonar data. Attached Figure Description

[0062] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0063] Figure 1 This is a flowchart illustrating a sonar data processing method based on a multi-process separation architecture in one embodiment.

[0064] Figure 2 This is a schematic diagram of the process manager's workflow in an example embodiment;

[0065] Figure 3 In one example embodiment, a graphical interface is provided to specify a channel time-domain signal waveform.

[0066] Figure 4 This is a 3D point cloud image of a target detected by a graphical interface in an example embodiment;

[0067] Figure 5This is a time-domain signal waveform diagram of a specified channel after enabling the post-processing algorithm in an example embodiment;

[0068] Figure 6 This is a sample embodiment of a 3D point cloud image of a target after enabling the post-processing algorithm;

[0069] Figure 7 This is a flowchart illustrating a sonar data processing method based on a multi-process separation architecture in an example embodiment.

[0070] Figure 8 This is a block diagram of a sonar data processing system based on a multi-process separation architecture in one embodiment;

[0071] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0072] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0073] In one embodiment, such as Figure 1 As shown, a sonar data processing method based on a multi-process separation architecture is provided. This embodiment illustrates the method by applying it to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0074] Step 101: Initialize the system parameters necessary for system operation.

[0075] Optionally, before initializing the system parameters necessary for system operation, the system may also include creating a global configuration object containing the system parameters necessary for system operation;

[0076] Optionally, initializing the system parameters necessary for system operation includes iterating through the attributes of the command-line argument object and updating the global configuration object with any parameters that have values, thereby completing the initialization of system parameters. Furthermore, the existence of parameters with values ​​can be checked using a built-in Python function, hasattr().

[0077] Optionally, the system parameters necessary for the operation of the system are managed uniformly and can be configured by the user.

[0078] Among them, the system parameters necessary for the system to operate may include monitoring parameters.

[0079] Step 102: Initialize the result queue for storing data processing results, and create a shared buffer for caching raw sonar data based on the system parameters.

[0080] Optionally, an initialization stop event is also included to notify each process that it is ready to exit.

[0081] Optionally, when a stop event is triggered, the following actions are taken: wait for each process to exit normally; if the wait times out, force termination; clean up the shared buffer, and record key events and exceptions during the stop process.

[0082] Step 103: Start the acquisition process, data processing process, and display process, and transmit the parameters in the system parameters corresponding to the acquisition process, data processing process, and display process to the corresponding processes respectively.

[0083] Optionally, before starting the acquisition process, data processing process, and display process, the following steps may be included: initializing the reference variables for each process; setting the default monitoring interval and logger; and creating the data directory, results directory, and log directory.

[0084] Optionally, starting the acquisition process, data processing process, and display process includes starting them sequentially. Specifically, the acquisition process is started first, followed by the data processing process, and finally the display process.

[0085] Optionally, it also includes starting a monitoring process, transmitting the parameters in the system parameters that correspond to the monitoring process to the monitoring process, for monitoring the operation of each process.

[0086] Optionally, after starting the acquisition process, data processing process, and display process, the system may also record system startup information, acquisition parameters, processor type, and data storage status.

[0087] Optionally, the acquisition process, data processing process, and display process are managed uniformly through a process manager.

[0088] In one example embodiment, such as Figure 2As shown, when using a process manager to uniformly manage the acquisition process, data processing process, and display process, the process manager's workflow is as follows: Before starting the process, the `init()` method is used to save configuration parameters, set visualization options, and initialize process and communication component references to `None`; the `start()` method is used to start the process, including creating the necessary working directory, recording system configuration logs, initializing the shared memory buffer, creating an inter-process communication queue, and creating process control events; the acquisition process, data processing process, and display process are started sequentially; during process execution, the acquisition process is controlled to acquire data from the hardware, store the acquired data into the shared memory buffer, the processing process is controlled to read data from the shared buffer and process it, the processing results are passed to the display process, and the display process is controlled to perform visualization; the process is stopped using the `stop()` method, including setting a stop event signal, waiting for each process to terminate naturally after the stop event is triggered, forcibly terminating processes that have not terminated normally, and cleaning up shared buffer resources.

[0089] By transmitting the configuration parameters corresponding to each process from the system parameters necessary for system operation to the corresponding process, a guarantee is provided for achieving high real-time processing of sonar data.

[0090] Step 104: The acquisition process starts the acquisition device to acquire the raw sonar data according to the received parameters, and writes the acquired raw sonar data into the shared buffer.

[0091] Optionally, before starting the acquisition device to acquire the raw sonar data, the following steps are performed: opening the necessary device files and performing memory mapping to enable direct access to hardware registers; configuring the acquisition device according to the received parameters.

[0092] Optionally, during the process of starting the acquisition device to acquire the raw sonar data, the following steps are performed: starting the analog-to-digital converter to convert the continuously changing analog sonar echo signal into a discrete digital signal, and transferring the acquired digital signal to the system memory via DMA technology.

[0093] Optionally, after acquiring the raw sonar data, the raw sonar data is preprocessed, and the preprocessed raw sonar data is written to a shared buffer. The preprocessing includes: sorting the raw sonar data; converting unsigned integers in the raw sonar data into signed integers. Writing the preprocessed raw sonar data to the shared buffer includes writing the processed data into the shared buffer in matrix form.

[0094] By writing the raw sonar data into the shared buffer, basic data support is provided for subsequent data processing.

[0095] Step 105: The data processing process obtains the raw sonar data from the shared buffer, processes the raw sonar data according to the received parameters, and stores the processing result data in the result queue.

[0096] Optionally, the raw sonar data is preprocessed, including: performing data shape verification and converting it to a (number of sensors, number of samples) format; performing data validity checks; and extracting time-domain signals.

[0097] Optionally, the processing result of the original sonar data is encapsulated, and the encapsulation process includes encapsulating the processing result into a standard data dictionary structure.

[0098] Step 106: The display process retrieves the processing result data from the result queue and displays the processing result data according to the received parameters.

[0099] In the aforementioned sonar data processing method based on a multi-process separation architecture, the acquisition process and the data processing process are decoupled by creating a shared buffer to cache the raw sonar data. The data processing process and the display process are further decoupled by initializing a result queue to store the processing results, thereby reducing the waiting time between tasks and ensuring the real-time performance of data processing. By initializing the system parameters necessary for system operation and transmitting the configuration parameters corresponding to each process to the corresponding process, a guarantee is provided for achieving high real-time processing of sonar data.

[0100] In one embodiment, the system parameters include acquisition parameters, processing parameters, and visualization parameters; the step of the acquisition process starting the acquisition device according to the received parameters includes: the acquisition process starting the acquisition device according to the acquisition parameters; the step of processing the raw sonar data according to the received parameters includes: processing the raw sonar data according to the processing parameters; the step of displaying the processed result data according to the received parameters includes: displaying the processed result data according to the visualization parameters; the acquisition parameters include the number of samples acquired in a single acquisition and the type of transmitting unit, and the processing parameters include the speed of sound in water and the signal sampling rate;

[0101] Using the number of samples acquired in a single sampling, the signal sampling rate, the type of transmitting unit, and the speed of sound in water, the time window and the maximum detection distance are obtained. The conversion formula between the number of samples acquired in a single sampling, the time window, and the maximum detection distance is as follows:

[0102]

[0103] Among them, For the time window, The number of samples collected in a single session. The signal sampling rate is... For maximum detection range, The speed of sound in water. For the aforementioned transmitting unit type, an external sound source Spontaneous and self-collected .

[0104] Optionally, the acquisition parameters may also include transmission frequency, transmission voltage, number of transmission pulses, signal gain, number of acquisitions, acquisition interval, number of sensors, and acquisition file saving settings.

[0105] Optionally, the processing parameters may also include processor type, signal center frequency, distance resolution, beam intensity threshold, and sound source coordinate settings.

[0106] Optionally, the visualization parameters include time-domain signal visualization switch parameters, point cloud visualization activation switch parameters, maximum entropy threshold method switch parameters, density clustering method switch parameters, spherical coordinate hierarchical switch, color mapping related parameters, and detection range spherical sector auxiliary line switch parameters.

[0107] In one exemplary embodiment, it is assumed that the number of samples collected in a single session is... The signal sampling rate is 40000. If the frequency is 4e6Hz, then the calculated time window is... The maximum detection range was calculated to be 0.01s. It is 3.75m.

[0108] In one embodiment, the system parameters include the total number of slots in the shared buffer, the number of samples acquired in a single acquisition, and the number of channels of the acquisition sensor; the creation of the shared buffer for caching raw sonar data based on the system parameters includes: calculating the memory space required for the shared buffer based on the total number of slots in the shared buffer, the number of samples acquired in a single acquisition, and the number of channels of the acquisition sensor, and creating the shared buffer according to the memory space;

[0109] The formula for calculating memory space is:

[0110]

[0111] in, The total number of slots in the shared buffer. The number of samples collected in a single collection session. The number of channels of the acquisition sensor. The memory space for the shared buffer.

[0112] The total number of slots in the shared buffer can be expanded according to hardware performance.

[0113] The total number of data elements stored in each shared buffer slot is the product of the number of samples acquired in a single acquisition and the number of channels of the acquisition sensor. This total number of data elements stored in each shared buffer slot is denoted as... .

[0114] In one exemplary embodiment, it is assumed that the number of samples collected in a single session is... The number of channels for data acquisition is 40,000. If the value is 576, then the total number of data elements stored in each buffer slot is 576. If the shared buffer stores a NumPy array in float32 format, and the total number of slots in the shared buffer is set to 50, then the memory space of the shared buffer... .

[0115] By creating a shared buffer, the acquisition process and the data processing process can be decoupled, ensuring the real-time performance of data processing.

[0116] In one embodiment, the sonar data processing method based on a multi-process separation architecture further includes: initializing a data queue for storing data slot indices in the shared buffer; writing the acquired raw sonar data into the shared buffer includes: writing the acquired raw sonar data into a slot in the shared buffer, and storing the data slot index of the slot into the data queue; retrieving the raw sonar data from the shared buffer includes: retrieving the data slot index from the data queue, locating the corresponding slot in the shared buffer according to the data slot index, and retrieving the raw sonar data in the corresponding slot.

[0117] The data processing process directly accesses the raw sonar data collected in the shared buffer through the data slot index. Since the raw sonar data collected is always kept in the shared buffer, zero-copy data transfer can be achieved, ensuring the real-time performance of data processing.

[0118] Optionally, raw sonar data can be discarded when the shared buffer is full to avoid memory overflow.

[0119] In one embodiment, the data processing of the raw sonar data according to the received parameters includes: selecting the optimal processor to perform data processing on the raw sonar data according to the received parameters.

[0120] Optionally, the optimal processor is selected based on the processor type in the processing parameters. The processor includes CPU processors and GPU processors.

[0121] Optionally, selecting the optimal processor based on the processor type in the processing parameters includes: determining whether the hardware resources corresponding to the selected processor type meet the conditions based on the processor type in the processing parameters; if the conditions are not met, switching is performed to select the optimal processor. The conditions include hardware conditions and / or performance conditions for effectively completing the target task.

[0122] Optionally, the switching can be supported through a unified interface design. This unified interface design includes having all processors inherit from an abstract base class.

[0123] Optionally, after selecting the optimal processor, the method further includes automatic parameter adaptation. This automatic parameter adaptation involves obtaining processor-specific parameters to ensure that each processor receives the optimal configuration.

[0124] By selecting the optimal processor, high real-time processing of sonar data can be supported.

[0125] In one embodiment, the system parameters include a gain value; the step of the acquisition process starting the acquisition device to acquire the raw sonar data according to the received parameters includes: configuring the acquisition device for time gain compensation according to the gain value, and starting the acquisition device to acquire the raw sonar data; the step of configuring the acquisition device for time gain compensation according to the gain value includes: converting the gain value into a hardware register control value, and writing it into the corresponding register of the acquisition device for time gain compensation configuration.

[0126] The gain value and the hardware register control value are converted using the following formula:

[0127]

[0128] in, This is a hardware register control value. This is the gain value.

[0129] Time gain compensation can effectively compensate for the attenuation of sonar signals due to increased propagation distance, thereby improving the quality of the original sonar data.

[0130] In one embodiment, the data processing of the raw sonar data includes: executing a beamforming algorithm and generating three-dimensional point cloud data; the display of the processing result data includes: visualizing the generated three-dimensional point cloud data.

[0131] The beamforming algorithm used is a frequency domain beamforming algorithm, and the calculation formula for the frequency domain beamforming algorithm is as follows:

[0132]

[0133] in, For the receiving array The time-domain received signal of each array element; The imaginary unit, It is a time variable; For a point in the imaging space To the The propagation delay of each array element; For the first The spatial coordinates of each array element; The speed of sound in water; The distance from the array element to the target point; This is the corresponding phase compensation factor; To obtain the target point by summing the frequency domain signals of all array elements after delay compensation. Beam output at the location; The total number of array elements; For the first The weighting coefficients of each array element; The energy intensity at the target point is the square of the beam output modulus. and These represent the real and imaginary parts of a complex number, respectively.

[0134] The formula for calculating the total number of target points is:

[0135]

[0136] in, This represents the total number of target points in the beam. This represents the number of sampling points. and The maximum and minimum detection distances are set. For distance resolution; and For the number of horizontal beams and the number of vertical beams.

[0137] in, and Based on the maximum detection distance Configure the settings.

[0138] Optionally, displaying the processing result data further includes: visually displaying the time-domain signal extracted from the acquired raw sonar data by the data processing process.

[0139] Optionally, the visualization display includes using a dual-mode visualization engine to simultaneously and independently visualize the generated 3D point cloud data and the time-domain signal extracted from the data processing process. The visualization display of the 3D point cloud data can be implemented based on the PyQtGraph.opengl framework, and the visualization display of the time-domain signal can be implemented based on the PyQtGraph framework.

[0140] Optionally, the graphical interface for visualization is built on the PySide6 graphics framework and adopts a single inheritance and independent encapsulation of the interface to achieve effective separation of business code and interface code, and uses an asynchronous architecture to ensure the smoothness of the graphical interface.

[0141] Optionally, intelligent post-processing algorithms can be employed to enhance the visualization quality and performance. These intelligent post-processing algorithms include a maximum entropy algorithm, a density clustering algorithm, and a Peak downsampling algorithm, with algorithm parameters adjustable by the user. Combining the maximum entropy algorithm and the density clustering algorithm can improve the display quality of 3D point cloud data visualization, while utilizing the Peak downsampling algorithm can improve the display performance of time-domain signals.

[0142] In one exemplary embodiment, it is assumed that the calculated maximum detection range 3.75m, number of horizontal beams The number of vertical beams is 128. The distance resolution is 128. Set to 0.015m, set and The distances from the sampling points are 4.2m and 2m respectively. Total number of target points in the beam .

[0143] In another exemplary embodiment, when the original_points of the time domain data is 40,000 and the screen_width is 1920 pixels, and the Peak downsampling algorithm is used for processing, the time domain data downsampling factor is set to 50, then the number of retained points is... The amount of data has decreased This can significantly reduce interface lag during graphical visualization.

[0144] In another example embodiment, if the system parameters necessary for system operation are uniformly initialized and configured, the number of samples collected per instance among the collectable parameters of the system parameters necessary for system operation... The value is 26000, the transmission frequency is 0.5MHz, and the transmission unit type is self-transmitting and self-receiving. The transmit voltage is 710V, the signal gain is 48dB, the number of acquisitions is 1, the acquisition interval is 0.01s, the number of sensors N is 576, and the corresponding number of acquisition sensor channels is... The value is 576, the water sound velocity in the data processing parameters is 1500 m / s, and the signal sampling rate is... The system parameters are: 4e6Hz, GPU type, signal center frequency 0.5e6Hz, distance resolution 0.015m, beam strength threshold -25dB, and sound source coordinates (-0.06, -0.1895, 0). The visualization parameters include: time-domain signal visualization switch set to True (None if time-domain signal visualization is disabled or extraction fails); point cloud visualization activation switch set to True (None if point cloud visualization is disabled or extraction fails); maximum entropy threshold method switch set to None (True if maximum entropy threshold method is not disabled); and density clustering method switch set to None (True if density clustering method is not disabled). The parameters corresponding to the acquisition process, data processing process, and display process are transmitted to their respective processes. The time-domain signal extracted from the raw sonar data by the data processing process and the generated 3D point cloud data are visualized using the display process. Figure 3 The graphical interface displays the time-domain signal waveform of a specified channel. Figure 4 This demonstrates a 3D point cloud map of the target detected via a graphical interface. By employing an intelligent post-processing algorithm, the visualization quality and performance can be enhanced by setting the density clustering method's on / off parameter to True. The enhanced effect is shown below. Figure 5 and Figure 6 As shown, Figure 5 To display the time-domain signal waveform of a specified channel after enabling the intelligent post-processing algorithm. Figure 6 To detect the target's 3D point cloud map after enabling the intelligent post-processing algorithm.

[0145] In one example embodiment, a sonar data processing method based on a multi-process separation architecture is provided. Figure 7 The flowchart of this method includes the following steps:

[0146] S701 initializes the system parameters necessary for system operation;

[0147] S702, initialize the result queue for storing data processing results, create a shared buffer for caching raw sonar data based on the system parameters, initialize the stop event, and initialize the data queue for storing data slot indices in the shared buffer;

[0148] S703, start the acquisition process, data processing process and display process, and transmit the parameters in the system parameters corresponding to the acquisition process, data processing process and display process to the corresponding processes respectively;

[0149] S704, the acquisition process configures the acquisition device for time gain compensation based on the received parameters, and starts the acquisition device to acquire the raw sonar data;

[0150] S705, the acquisition process writes the acquired raw sonar data into the slots in the shared buffer and stores the data slot index of the slots into the data queue;

[0151] S706, the data processing process selects the optimal processor based on the received parameters;

[0152] S707, the data processing process uses the optimal processor to obtain the data slot index from the data queue, and locates the corresponding slot in the shared buffer according to the data slot index, and obtains the original sonar data in the corresponding slot written in step S705;

[0153] S708, the data processing process uses the optimal processor to perform data preprocessing on the raw sonar data, the data preprocessing including extracting the time domain signal of the raw sonar data;

[0154] S709, the data processing process uses the optimal processor to perform a frequency domain beamforming algorithm on the raw sonar data after data preprocessing, and generates three-dimensional point cloud data.

[0155] S710, the data processing process uses the optimal processor to encapsulate and process the time-domain signal and the three-dimensional point cloud data;

[0156] S711, The data processing process uses the optimal processor to store the time-domain signal and the three-dimensional point cloud data after result encapsulation into the result queue.

[0157] S712, the display process retrieves the time-domain signal and three-dimensional point cloud data stored in step S711 from the result queue;

[0158] S713, the display process visualizes the generated 3D point cloud data and / or visualizes the time domain signal based on the received parameters.

[0159] Steps S704 and S705 are performed independently by the acquisition process; steps S706 to S711 are performed independently by the data processing process; and steps S712 and S713 are performed independently by the display process.

[0160] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0161] In one embodiment, a sonar data processing system based on a multi-process separation architecture is also provided, such as... Figure 8 As shown, the system includes: a configuration management module 81, a process management module 82, a data acquisition module 83, a data processing module 84, and a display module 85;

[0162] The configuration management module 81 is used to initialize the system parameters necessary for system operation.

[0163] The process management module 82 is used to initialize a result queue for storing data processing results, and create a shared buffer for caching raw sonar data based on the system parameters; start the acquisition module, data processing module, and display module, and transmit the parameters in the system parameters corresponding to the acquisition module, data processing module, and display module to the corresponding modules respectively;

[0164] The acquisition module 83 is used to start the acquisition device to acquire the raw sonar data according to the received parameters, and write the acquired raw sonar data into the shared buffer.

[0165] The data processing module 84 is used to obtain the raw sonar data from the shared buffer, process the raw sonar data according to the received parameters, and store the processing result data into the result queue.

[0166] The display module 85 is used to obtain the processing result data from the result queue and display the processing result data according to the received parameters.

[0167] In the aforementioned sonar data processing system based on a multi-process separation architecture, the acquisition module and the data processing module are decoupled by creating a shared buffer to cache the raw sonar data. The data processing module and the display module are further decoupled by initializing a result queue to store the processing results, thereby reducing the waiting time between tasks and ensuring the real-time performance of data processing. By initializing the system parameters necessary for system operation and transmitting the configuration parameters corresponding to each module to the corresponding modules, a guarantee is provided for achieving high real-time processing of sonar data.

[0168] Furthermore, the process management module 82 is also used to initialize a data queue for storing data slot indices in the shared buffer.

[0169] Furthermore, the acquisition module 83 is also used to write the acquired raw sonar data into the slots in the shared buffer, and store the data slot index of the slots into the data queue.

[0170] Furthermore, the data processing module 84 is also used to obtain the data slot index from the data queue, locate the corresponding slot in the shared buffer according to the data slot index, and obtain the raw sonar data in the corresponding slot.

[0171] Furthermore, the system also includes a shared memory buffer module for managing slots in the shared buffer.

[0172] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a sonar data processing method based on a multi-process separation architecture.

[0173] Those skilled in the art will understand that Figure 9The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0174] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: initializing system parameters necessary for system operation; initializing a result queue for storing data processing results, and creating a shared buffer for caching raw sonar data based on the system parameters; starting an acquisition process, a data processing process, and a display process, and transmitting parameters from the system parameters corresponding to the acquisition process, the data processing process, and the display process to their respective processes; the acquisition process starting an acquisition device to acquire the raw sonar data according to the received parameters, and writing the acquired raw sonar data into the shared buffer; the data processing process retrieving the raw sonar data from the shared buffer, processing the raw sonar data according to the received parameters, and storing the processing result data into the result queue; and the display process retrieving the processing result data from the result queue and displaying the processing result data according to the received parameters.

[0175] In one embodiment, the system parameters include acquisition parameters, processing parameters, and visualization parameters. When the processor executes the computer program, it further implements the following steps: The step of the acquisition process starting the acquisition device according to the received parameters includes: the acquisition process starting the acquisition device according to the acquisition parameters; the step of processing the raw sonar data according to the received parameters includes: processing the raw sonar data according to the processing parameters; the step of displaying the processed result data according to the received parameters includes: displaying the processed result data according to the visualization parameters; the acquisition parameters include the number of samples acquired in a single acquisition and the type of transmitting unit; the processing parameters include the speed of sound in water and the signal sampling rate; the time window and maximum detection distance are obtained using the number of samples acquired in a single acquisition, the signal sampling rate, the type of transmitting unit, and the speed of sound in water; the conversion formula between the number of samples acquired in a single acquisition and the time window and the maximum detection distance is:

[0176]

[0177] Among them, For the time window, The number of samples collected in a single session. The signal sampling rate is... For maximum detection range, The speed of sound in water. For the aforementioned transmitting unit type, an external sound source Spontaneous and self-collected .

[0178] In one embodiment, the system parameters include the total number of slots in the shared buffer, the number of samples acquired in a single acquisition, and the number of channels of the acquisition sensor. When the processor executes the computer program, it further implements the following steps: the creation of a shared buffer for caching raw sonar data based on the system parameters includes: calculating the memory space required for the shared buffer based on the total number of slots in the shared buffer, the number of samples acquired in a single acquisition, and the number of channels of the acquisition sensor, and creating the shared buffer according to the memory space.

[0179] The formula for calculating memory space is:

[0180]

[0181] in, The total number of slots in the shared buffer. The number of samples collected in a single collection session. The number of channels of the acquisition sensor. The memory space for the shared buffer.

[0182] In one embodiment, when the processor executes the computer program, it further performs the following steps: initializing a data queue for storing data slot indices in the shared buffer; writing the acquired raw sonar data into the shared buffer includes: writing the acquired raw sonar data into a slot in the shared buffer, and storing the data slot index of the slot into the data queue; retrieving the raw sonar data from the shared buffer includes: retrieving the data slot index from the data queue, locating the corresponding slot in the shared buffer according to the data slot index, and retrieving the raw sonar data in the corresponding slot.

[0183] In one embodiment, when the processor executes the computer program, it further performs the following steps: the data processing of the raw sonar data according to the received parameters includes: selecting the optimal processor to perform data processing on the raw sonar data based on the received parameters.

[0184] In one embodiment, the system parameters include a gain value, and the processor, when executing the computer program, further implements the following steps: the acquisition process starting the acquisition device to acquire the raw sonar data according to the received parameters includes: configuring the acquisition device for time gain compensation according to the gain value, and starting the acquisition device to acquire the raw sonar data; the configuration of the acquisition device for time gain compensation according to the gain value includes: converting the gain value into a hardware register control value, and writing it into the corresponding register of the acquisition device for time gain compensation configuration.

[0185] In one embodiment, the system parameters include a gain value, and the processor, when executing the computer program, further implements the following steps: the data processing of the raw sonar data includes: executing a beamforming algorithm and generating three-dimensional point cloud data; the display of the processing result data includes: visualizing the generated three-dimensional point cloud data.

[0186] The beamforming algorithm used is a frequency domain beamforming algorithm, and the calculation formula for the frequency domain beamforming algorithm is as follows:

[0187]

[0188] in, For the receiving array The time-domain received signal of each array element; The imaginary unit, It is a time variable; For a point in the imaging space To the The propagation delay of each array element; For the first The spatial coordinates of each array element; The speed of sound in water; The distance from the array element to the target point; This is the corresponding phase compensation factor; To obtain the target point by summing the frequency domain signals of all array elements after delay compensation. Beam output at the location; The total number of array elements; For the first The weighting coefficients of each array element; The energy intensity at the target point is the square of the beam output modulus. and These represent the real and imaginary parts of a complex number, respectively.

[0189] The formula for calculating the total number of target points is:

[0190]

[0191] in, This represents the total number of target points in the beam. This represents the number of sampling points. and The maximum and minimum detection distances are set. For distance resolution; and For the number of horizontal beams and the number of vertical beams.

[0192] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program performs the following steps: initializing system parameters necessary for system operation; initializing a result queue for storing data processing results, and creating a shared buffer for caching raw sonar data based on the system parameters; starting an acquisition process, a data processing process, and a display process, and transmitting the parameters in the system parameters corresponding to the acquisition process, the data processing process, and the display process to the corresponding processes respectively; the acquisition process starting an acquisition device to acquire the raw sonar data according to the received parameters, and writing the acquired raw sonar data into the shared buffer; the data processing process retrieving the raw sonar data from the shared buffer, processing the raw sonar data according to the received parameters, and storing the processing result data into the result queue; and the display process retrieving the processing result data from the result queue and displaying the processing result data according to the received parameters.

[0193] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0194] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0195] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0196] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A sonar data processing method based on a multi-process separation architecture, characterized in that, include: Initialize the system parameters necessary for system operation; Initialize a result queue for storing data processing results, and create a shared buffer for caching raw sonar data based on the system parameters; Start the acquisition process, data processing process, and display process, and transmit the parameters in the system parameters corresponding to the acquisition process, data processing process, and display process to the corresponding processes respectively; The acquisition process starts the acquisition device to acquire the raw sonar data according to the received parameters, and writes the acquired raw sonar data into the shared buffer; The data processing process obtains the raw sonar data from the shared buffer, processes the raw sonar data according to the received parameters, and stores the processing result data in the result queue. The display process retrieves the processing result data from the result queue and displays the processing result data according to the received parameters; The system parameters include the total number of slots in the shared buffer, the number of samples collected in a single acquisition, and the number of channels in the acquisition sensors; The process of creating a shared buffer for caching raw sonar data based on the system parameters includes: calculating the memory space required for the shared buffer based on the total number of slots in the shared buffer, the number of samples acquired in a single acquisition, and the number of channels of the acquisition sensor, and creating the shared buffer according to the memory space. The formula for calculating memory space is: ; in, The total number of slots in the shared buffer. The number of samples collected in a single collection session. The number of channels of the acquisition sensor. The memory space for the shared buffer.

2. The method according to claim 1, characterized in that, The system parameters include acquisition parameters, processing parameters, and visualization parameters; The step of the acquisition process activating the acquisition device according to the received parameters includes: the acquisition process activating the acquisition device according to the acquisition parameters; The data processing of the raw sonar data according to the received parameters includes: processing the raw sonar data according to the processing parameters; The step of displaying the processing result data according to the received parameters includes: displaying the processing result data according to the visualization parameters; The acquisition parameters include the number of samples acquired in a single acquisition and the type of transmitting unit; the processing parameters include the speed of sound in water and the signal sampling rate. Using the number of samples acquired in a single sampling, the signal sampling rate, the type of transmitting unit, and the speed of sound in water, the time window and the maximum detection distance are obtained. The conversion formula between the number of samples acquired in a single sampling, the time window, and the maximum detection distance is as follows: ; ; ; Among them, For the time window, The number of samples collected in a single session. The signal sampling rate is... For maximum detection range, The speed of sound in water. For the aforementioned transmitting unit type, an external sound source Spontaneous and self-collected .

3. The method according to claim 1, characterized in that, Also includes: Initialize the data queue used to store the data slot indices in the shared buffer; The step of writing the collected raw sonar data into the shared buffer includes: writing the collected raw sonar data into a slot in the shared buffer, and storing the data slot index of the slot into the data queue; The step of obtaining the raw sonar data from the shared buffer includes: obtaining the data slot index from the data queue, locating the corresponding slot in the shared buffer according to the data slot index, and obtaining the raw sonar data in the corresponding slot.

4. The method according to claim 1, characterized in that, The data processing of the raw sonar data based on the received parameters includes: selecting the optimal processor based on the received parameters to perform data processing on the raw sonar data.

5. The method according to claim 1, characterized in that, The system parameters include the gain value; The step of the acquisition process starting the acquisition device to acquire the raw sonar data according to the received parameters includes: configuring the acquisition device for time gain compensation according to the gain value, and starting the acquisition device to acquire the raw sonar data; The step of configuring the acquisition device for time gain compensation based on the gain value includes: converting the gain value into a hardware register control value and writing it into the corresponding register of the acquisition device for time gain compensation configuration.

6. The method according to claim 1, characterized in that, The data processing of the raw sonar data includes: executing a beamforming algorithm and generating three-dimensional point cloud data; The step of displaying the processing result data includes: visualizing the generated 3D point cloud data; The beamforming algorithm used is a frequency domain beamforming algorithm, and the calculation formula for the frequency domain beamforming algorithm is as follows: in, For the receiving array The time-domain received signal of each array element; The imaginary unit, It is a time variable; For a point in the imaging space To the The propagation delay of each array element; For the first The spatial coordinates of each array element; The speed of sound in water; The distance from the array element to the target point; This is the corresponding phase compensation factor; To obtain the target point by summing the frequency domain signals of all array elements after delay compensation. Beam output at the location; The total number of array elements; For the first The weighting coefficients of each array element; The energy intensity at the target point is the square of the beam output modulus. and These represent the real and imaginary parts of a complex number, respectively. The formula for calculating the total number of target points is: ; ; in, This represents the total number of target points in the beam. This represents the number of sampling points. and The maximum and minimum detection distances are set. For distance resolution; and For the number of horizontal beams and the number of vertical beams.

7. A sonar data processing system based on a multi-process separation architecture, characterized in that, The system includes: a configuration management module, a process management module, a data acquisition module, a data processing module, and a display module; wherein, The configuration management module is used to initialize the system parameters necessary for system operation; The process management module is used to initialize a result queue for storing data processing results, and create a shared buffer for caching raw sonar data based on the system parameters; start the acquisition module, data processing module, and display module, and transmit the parameters in the system parameters corresponding to the acquisition module, data processing module, and display module to the corresponding modules respectively; The acquisition module is used to start the acquisition device to acquire the raw sonar data according to the received parameters, and write the acquired raw sonar data into the shared buffer. The data processing module is used to obtain the raw sonar data from the shared buffer, process the raw sonar data according to the received parameters, and store the processing result data into the result queue. The display module is used to obtain the processing result data from the result queue and display the processing result data according to the received parameters; The system parameters include the total number of slots in the shared buffer, the number of samples collected in a single acquisition, and the number of channels in the acquisition sensors; The process of creating a shared buffer for caching raw sonar data based on the system parameters includes: calculating the memory space required for the shared buffer based on the total number of slots in the shared buffer, the number of samples acquired in a single acquisition, and the number of channels of the acquisition sensor, and creating the shared buffer according to the memory space. The formula for calculating memory space is: ; in, The total number of slots in the shared buffer. The number of samples collected in a single collection session. The number of channels of the acquisition sensor. The memory space for the shared buffer.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Upper computer system suitable for underwater sonar imaging and control method of upper computer system

    CN109407581A

  • High-performance multi-beam data acquisition system and method

    CN111556129A