Low-delay signal real-time processing and visualization method and system based on UDP (User Datagram Protocol)

Through the low-latency signal real-time processing and visualization system based on UDP protocol, the problem of insufficient response delay and accuracy in wind turbine fault diagnosis is solved, and efficient and real-time signal processing and visual analysis are realized, suitable for real-time analysis of high-speed signals.

CN119884840AActive Publication Date: 2025-04-25HUNAN UNIV OF SCI & TECH

Patent Information

Application Number
CN202510346233.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-04-25
Estimated Expiration
2045-03-24

AI Technical Summary

Technical Problem

Traditional wind turbine fault diagnosis methods have problems of delayed response and insufficient accuracy, especially in large-scale wind farms or high-speed operation, abnormal signals cannot be identified in time, resulting in the missed optimal repair time.

Method used

The low-latency signal real-time processing and visualization system based on the UDP protocol is adopted. The data of the wind turbine transmission system is collected in real time through the efficient UDP protocol, and the real-time processing and analysis are carried out. Combined with visualization technologies such as signal waveform diagram, spectrum diagram and waterfall diagram, we can achieve delay-free and stable update of diagnostic results.

Benefits of technology

It realizes real-time acquisition and processing of signals under high sampling rates, ensuring stable and delay-free updates of signal waveforms, spectrum diagrams and waterfall diagrams, and supports dynamic plug-in mechanisms, which are suitable for real-time analysis of high-speed signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884840A_ABST
    Figure CN119884840A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer network communication and signal processing, and particularly discloses a low-delay signal real-time processing and visualization method based on a UDP (User Datagram Protocol), which comprises the following steps: S1, initializing a data receiving module, and receiving and processing data; s2, signal processing and spectrum analysis; s3, updating the oscillogram in real time and displaying a time domain signal; s4, drawing a spectrogram through the spectrum data; s5, updating the waterfall plot in real time; s6, controlling the periodicity of data acquisition and graph updating by adopting a timer; and S7, storing the image and the collected data. The invention further provides a low-delay signal real-time processing and visualization system based on the UDP. The system comprises a data receiving module, a signal processing module, a waveform display module, a spectrum analysis module, a waterfall plot module and a storage module. According to the scheme, the problems of high delay, slow display updating, complex data processing and the like in the prior art can be solved, and efficient data processing and stable graph updating are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer network communication and signal processing technology, and in particular to the field of real-time data reception, signal processing, spectrum analysis and waveform display technology based on UDP protocol. A method and system for real-time processing and visualization of low-latency signals based on UDP is provided. Background Art

[0002] Traditional wind turbine fault diagnosis methods mostly rely on vibration monitoring, temperature detection and other sensor data. However, these methods often have certain response delays and insufficient accuracy, especially in the case of large-scale wind farms or high-speed operation. They often fail to identify abnormal signals in time at the early stage of the fault, thus missing the best time for maintenance.

[0003] In order to meet the needs of efficient and safe operation of modern wind turbines, the real-time and accuracy of fault diagnosis systems have become particularly important. With the continuous expansion of the scale of wind turbines, real-time collection and processing of massive data from encoders, sensors and other equipment has become the key to early fault detection. However, traditional communication protocols such as TCP or serial communication often cannot meet the requirements of high-speed real-time data processing due to high transmission delays, resulting in slow response to fault diagnosis and affecting the timeliness of decision-making.

[0004] Therefore, how to design a real-time data reception and display system and method with low latency, efficient data processing capabilities, and stable graphics update capabilities to solve the limitations of the existing technology in real-time signal processing is an issue that urgently needs to be addressed. Summary of the invention

[0005] In order to solve the above problems, the present invention provides a UDP-based low-latency signal real-time processing and visualization method and system. Through the efficient UDP protocol, the data of encoders and sensors in the wind turbine transmission system are collected in real time to achieve instant processing and analysis of signals. In addition, combined with visualization technologies such as signal waveform diagrams, spectrum diagrams and waterfall diagrams, the diagnostic results can be updated stably without delay.

[0006] The present invention provides a UDP-based low-latency signal real-time processing and visualization system, which is characterized by comprising: The data receiving module is used to receive data packets transmitted by external devices through the UDP protocol; The signal processing module is used to perform FFT processing on the received data, calculate and output spectrum data; Waveform display module, used for real-time display of time domain signal waveform; Spectrum analysis module, used to display the spectrum of the signal in real time; Waterfall chart module, used to show the change of signal frequency over time; The storage module is used to store the images of the waveform diagram, spectrum diagram or waterfall diagram and the collected data.

[0007] Furthermore, the data receiving module includes: QUdpSocket class, used to receive data packets through UDP protocol and trigger readyRead() signal; Data buffer area, used to store received signal data, data storage adopts FIFO mode; The signal processing module performs Fourier transform through the FFTTool class, calculates the amplitude of the frequency component, and saves the result in FFT_result_array; The waveform display module uses the graph_wave object of the QCustomPlot class to draw a real-time waveform graph and updates the horizontal axis range to maintain the continuity of the display time; The spectrum analysis module draws the spectrum graph through the graph_spectrum object of the QCustomPlot class, and automatically adjusts the coordinate axis to ensure the complete display of the spectrum data; The waterfall chart module draws a waterfall chart through the graph_waterfall object of the QCustomPlot class, updates the spectrum display according to the latest data, and uses the rescaleAxes() method to automatically adjust the coordinate axis; A storage module is used to save images of waveform graphs, spectrum graphs or waterfall graphs.

[0008] A UDP-based low-latency signal real-time processing and visualization method, which is operated using the above-mentioned low-latency signal real-time processing and visualization system, comprises the following steps: S1, initialize the data receiving module to receive and process data; S2, signal processing and spectrum analysis; S3, update the waveform in real time and display the time domain signal; S4, drawing a spectrum diagram using the spectrum data; S5. Update the waterfall chart in real time; S6, data collection and graphics update; S7. Save the image of the waveform graph, spectrum graph or waterfall graph and the collected data.

[0009] Furthermore, step S1 includes the following sub-steps: S11, initialize the UDP communication module; initialize the QUdpSocket object, bind it to the specified port, set it to receive mode, and wait for data transmitted by the external device; S12, receiving and parsing data packets; when a data packet is received, the readyRead() signal is triggered, the data packet content is obtained through the QUdpSocket::readDatagram() method, and then the data is passed to the slot function to be parsed into valid signal data; S13, store the data in the cache; store the parsed data in the wave_data_buffer cache area, the wave_data_buffer cache area is connected to the QVector <double>The type stores the received signal data. The size of the buffer is controlled by wave_data_buffer_length. The data is stored in order in the wave_data_buffer buffer and saved in FIFO mode. S14, data cache uses QVector <double>To store the real-time collected signal data; manage the data queue through pop_front() and append(); S15, check the validity of the data; if the data is valid, proceed to the next step, otherwise discard the data packet; S16. Transfer valid signal data to the signal processing module.

[0010] Furthermore, step S2 includes the following sub-steps: S21. Initialize FFT tool; Initialize FFT tool class FFTTool <double>, prepare input data for FFT calculation; S22, input signal data: the signal data obtained from the data receiving module is passed from wave_data_buffer to the FFT tool class as an input signal; S23, perform FFT transformation; call FFTTool::FFT_amplitude() method to perform Fourier transform, receive data in wave_data_buffer and calculate its frequency domain representation, convert the time domain signal into a frequency domain signal, and calculate the amplitude information of each frequency component; S24, obtaining spectrum data; after FFT calculation, obtaining frequency domain signal data, and saving the result in FFT_result_array; S25, transferring the spectrum data; transferring the calculated spectrum data to the spectrum display module to draw a spectrum graph.

[0011] Furthermore, step S3 includes the following sub-steps: S31, initialize the waveform display module; use the QCustomPlot class to create a waveform display control graph_wave, initialize the graph area and set the coordinate axis; S32, add data to the graph; whenever new data is received, add the data point to the waveform graph through graph_wave->addData(current_time, value[0]), where current_time is the current timestamp, so that the horizontal axis of the graph is displayed in time; S33, updating the coordinate axis range; Dynamically update the range of the horizontal axis through graph_wave->keyAxis()->setRange(current_time, 8000, Qt::AlignRight) to maintain the continuity of the displayed time; the horizontal axis of the waveform graph is the time axis, and the vertical axis is the signal amplitude; S34, redraw the waveform graph; call ui->waveWidget->replot() to refresh the waveform graph to update the displayed content; S35. Graphic update is completed; the real-time display of the waveform is completed, and the user can see the real-time changes of the signal.

[0012] Furthermore, step S4 includes the following sub-steps: S41. Initialize the spectrum graph display module; use the QCustomPlot class to create a spectrum graph display control graph_spectrum, and initialize the coordinate axis and graph area; S42, calculate the spectrum data; the result of each FFT analysis will be stored in FFT_result_array, which is a two-dimensional array that will store the amplitude of each frequency component changing with time; S43, use pop_front() and append() methods to manage the storage of historical data and maintain data fluidity; S44, plotting spectrum data; Add the FFT analysis results to the spectrum graph through graph_spectrum->addData(freq_step * i, FFT_output[i]), where freq_step is the calculated frequency step size so that the horizontal axis is displayed in frequency units; the vertical axis in the spectrum graph represents the amplitude and the horizontal axis represents the frequency; S45. Update the axis range; use graph_spectrum->rescaleValueAxis(false, true) to automatically scale the vertical axis, and use graph_spectrum->rescaleKeyAxis(false) to update the horizontal axis range so that all spectra are visible; S46. Redraw the spectrum graph; call ui->spectrumWidget->replot(); refresh the spectrum graph to display the latest spectrum information; S47, the spectrum graph is updated; the real-time display of the spectrum graph is completed, and the user can see the frequency components and changes of the signal.

[0013] Furthermore, step S5 includes the following sub-steps: S51, initialize the waterfall chart display module; use the QCustomPlot class to create a waterfall chart control graph_waterfall, initialize the graph area and coordinate axis, and set the frequency range and time range; the waterfall chart display module displays the change of the signal spectrum over time in a two-dimensional matrix through the graph_waterfall class object; S52, update the waterfall chart data; each time after receiving new spectrum data, call graph_waterfall->data()->setCell(x,y,FT_result_array[y][x]); to update the display data of the waterfall chart; S53, automatically adjust the coordinate axis; use the graph_waterfall->rescaleAxes() method to automatically adjust the coordinate axis so that the displayed spectrum data is complete; S54. Redraw the waterfall chart; call ui->waterfallWidget->replot() to refresh the waterfall chart to show the dynamic process of signal spectrum changing over time; S55, waterfall chart update completed; use graph_waterfall->data()-> setValueRange(QCPRange(nowtime-waterfall_time_max, nowtime)) sets the display range of the waterfall chart based on the current time and the maximum time range, so that users can see how the signal spectrum changes over time.

[0014] Furthermore, step S6 includes the following sub-steps: S61, timer_data timer and timer_plot timer are connected to the corresponding slot function through the connect method to trigger data collection and graphics update; among them, the timer_data timer is started by timer_data.start(sample_time), and takes sample_time as the interval period to obtain new data from the data source regularly; each time the timer is triggered, the timer_data_timeout_solt() slot function is called to add the new data to the wave_data_buffer; the timer_plot timer is responsible for updating the graphics display at regular intervals; S62. Start the timer through timer_plot.start(FFT_period), call the timer_plot_timeout_solt() slot function, and redraw the waveform graph, spectrum graph and waterfall graph; each time the timer is triggered, refresh the waveform graph display through ui->waveWidget->replot(), refresh the spectrum graph display through ui->spectrumWidget->replot(), and refresh the waterfall graph display through ui->waterfallWidget->replot(), so that the graphics are synchronized with the signal data.

[0015] Furthermore, step S7 includes the following sub-steps: S71. The user saves the current graphic as a file by clicking the "Save Graphics" button. Supported file formats include PNG, JPG, or PDF. File saving is implemented through the QFileDialog::getSaveFileName() method. After the user selects the file path and format, the graphic will be saved to the specified location. S72. When saving, the system determines the saving format according to the file extension: if the file ends with .png, call savePng() to save it as a PNG file; if the file ends with .jpg or .jpeg, call saveJpg() to save it as a JPG file; if the file ends with .pdf, call savePdf() to save it as a PDF file; if no suffix is ​​specified, the file is saved in PNG format by default and .png is automatically added; S73. The user clicks the "Save Data" button to select the path to save the binary data; the file is saved in .bin format, and QFileDialog::getSaveFileName() is used to select the save location; S74, the received data will be saved in real time to a file in the specified path, using the append mode to ensure that the data is not lost; S75. During the saving process, the number of bytes will be displayed in real time. If an error occurs, the system will prompt the user; S76. When the user stops saving data, the file will be safely closed and the "Start Collection" button will be restored, waiting for the next operation.

[0016] Compared with the prior art, the present invention can achieve the following beneficial effects: 1. The present invention can collect and process signals in real time at a sampling rate of up to tens of MHz, ensuring that the signal waveform, spectrum and waterfall diagrams can be updated stably and without delay.

[0017] 2. The present invention supports a dynamic plug-in mechanism. Users can freely add new signal processing algorithms, display effects or control modules as needed. For example, users can add new filter modules or expand the display method of the spectrum graph. The system automatically loads the corresponding plug-in through the configuration file without modifying the existing code, thereby realizing modular expansion and customization requirements.

[0018] 3. The present invention has low latency, efficient data processing capability, and stable graphics update function. It can display the time domain waveform, frequency domain characteristics, and dynamic changes of the signal in real time, and can be applied to real-time analysis of high-speed signals. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a schematic diagram of a real-time data receiving and processing flow according to an embodiment of the present invention; Figure 2 is a flowchart of signal processing and spectrum analysis provided according to an embodiment of the present invention; Figure 3 is a waveform display flow chart provided according to an embodiment of the present invention; Figure 4 is a schematic block diagram of a spectrum graph display process provided according to an embodiment of the present invention; Figure 5 is a schematic block diagram of a waterfall chart display process provided according to an embodiment of the present invention; Figure 6 is a schematic block diagram of an image update process provided according to an embodiment of the present invention; Figure 7 It is a schematic block diagram of a data image storage process provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the following Figure 1-7 It should be understood that the specific embodiments described herein are only used to explain the present invention and do not constitute a limitation of the present invention.

[0021] A low-latency signal real-time processing and visualization system based on UDP, characterized by comprising: The data receiving module is used to receive data packets transmitted by external devices through the UDP protocol. The data receiving module includes: the QUdpSocket class, which is used to receive data packets through the UDP protocol and trigger the readyRead() signal; the data buffer area, which is used to store the received signal data, and the data storage adopts the FIFO method.

[0022] The signal processing module is used to perform FFT processing on the received data, calculate and output the spectrum data. The signal processing module performs Fourier transform through the FFTTool class, calculates the amplitude of the frequency component, and saves the result in FFT_result_array.

[0023] The waveform display module is used to display the time domain signal waveform in real time. The waveform display module uses the graph_wave object of the QCustomPlot class to draw the real-time waveform graph and updates the horizontal axis range to maintain the continuity of the display time.

[0024] The spectrum analysis module is used to display the spectrum graph of the signal in real time. The spectrum analysis module draws the spectrum graph through the graph_spectrum object of the QCustomPlot class and automatically adjusts the coordinate axis to ensure the complete display of the spectrum data.

[0025] The waterfall chart module is used to show how the signal frequency changes over time. The waterfall chart module draws a waterfall chart through the graph_waterfall object of the QCustomPlot class, updates the spectrum display according to the latest data, and uses the rescaleAxes() method to automatically adjust the coordinate axis.

[0026] A storage module is used to save images of waveform graphs, spectrum graphs or waterfall graphs.

[0027] A UDP-based low-latency signal real-time processing and visualization method, which is operated using the above-mentioned low-latency signal real-time processing and visualization system, comprises the following steps: S1. Initialize the data receiving module to receive and process data.

[0028] Step S1 includes the following sub-steps: S11. Initialize the UDP communication module; initialize the QUdpSocket object, bind it to the specified port, set it to receive mode, and wait for receiving data transmitted by the external device.

[0029] S12, receiving and parsing data packets; when a data packet is received, the readyRead() signal is triggered, the data packet content is obtained through the QUdpSocket::readDatagram() method, and then the data is passed to the slot function to be parsed into valid signal data.

[0030] S13, store the data in the cache; store the parsed data in the wave_data_buffer cache area, the wave_data_buffer cache area is connected to the QVector <double>The type stores the received signal data, and the size of the buffer is controlled by wave_data_buffer_length; the data is stored in sequence in the wave_data_buffer cache and saved in FIFO mode.

[0031] S14, data cache uses QVector <double>To store the signal data collected in real time. Use pop_front() and append() to manage the data queue, maintain a fixed length cache, and avoid memory overflow.

[0032] S15, check the validity of the data; if the data is valid, proceed to the next step, otherwise discard the data packet.

[0033] S16. Transfer valid signal data to the signal processing module.

[0034] S2. Signal processing and spectrum analysis.

[0035] Step S2 includes the following sub-steps: S21. Initialize FFT tool; Initialize FFT tool class FFTTool <double>, prepare input data for FFT calculation.

[0036] S22, input signal data: the signal data obtained from the data receiving module is passed from wave_data_buffer to the FFT tool class as an input signal; S23, perform FFT transformation; call FFTTool::FFT_amplitude() method to perform Fourier transform, receive the data in wave_data_buffer and calculate its frequency domain representation, convert the time domain signal into a frequency domain signal, and calculate the amplitude information of each frequency component.

[0037] S24, obtaining spectrum data; after FFT calculation, obtaining frequency domain signal data, and saving the result in FFT_result_array.

[0038] S25, transferring the spectrum data; transferring the calculated spectrum data to the spectrum display module to draw a spectrum graph.

[0039] S3. Update the waveform in real time and display the time domain signal.

[0040] Step S3 includes the following sub-steps: S31. Initialize the waveform graph display module; use the QCustomPlot class to create a waveform graph display control graph_wave, initialize the graph area and set the coordinate axis.

[0041] S32, add data to the graph; whenever new data is received, add the data point to the waveform graph through graph_wave->addData(current_time, value[0]), where current_time is the current timestamp, so that the horizontal axis of the graph is displayed in time.

[0042] S33, update the coordinate axis range, Dynamically update the range of the horizontal axis through graph_wave->keyAxis()->setRange(current_time, 8000, Qt::AlignRight) to maintain the continuity of the displayed time; among them, the horizontal axis of the waveform graph is the time axis and the vertical axis is the signal amplitude.

[0043] S34, redraw the waveform graph; call ui->waveWidget->replot() to refresh the waveform graph to update the displayed content.

[0044] S35. Graphic update is completed; the real-time display of the waveform is completed, and the user can see the real-time changes of the signal.

[0045] S4. Draw a spectrum diagram using the spectrum data.

[0046] Step S4 includes the following sub-steps: S41. Initialize the spectrum graph display module; use the QCustomPlot class to create a spectrum graph display control graph_spectrum, and initialize the coordinate axis and graph area.

[0047] S42, calculate the spectrum data; the result of each FFT analysis will be stored in FFT_result_array, which is a two-dimensional array that stores the amplitude of each frequency component changing with time.

[0048] S43, pop_front() and append() methods are used to manage the storage of historical data and maintain data fluidity.

[0049] S44, plotting spectrum data; Add the FFT analysis results to the spectrum graph through graph_spectrum->addData(freq_step * i, FFT_output[i]), where freq_step is the calculated frequency step so that the horizontal axis is displayed in frequency units; in the spectrum graph, the vertical axis represents the amplitude and the horizontal axis represents the frequency.

[0050] S45, updating the coordinate axis range; Use graph_spectrum->rescaleValueAxis(false, true) to automatically scale the ordinate axis and graph_spectrum->rescaleKeyAxis(false) to update the abscissa range so that all spectra are visible.

[0051] S46. Redraw the spectrum graph; call ui->spectrumWidget->replot(); to refresh the spectrum graph and display the latest spectrum information.

[0052] S47, the spectrum graph is updated; the real-time display of the spectrum graph is completed, and the user can see the frequency components and changes of the signal.

[0053] S5. Update the waterfall chart in real time.

[0054] Step S5 includes the following sub-steps: S51. Initialize the waterfall chart display module; use the QCustomPlot class to create a waterfall chart control graph_waterfall, initialize the graph area and coordinate axes, and set the frequency range and time range; the waterfall chart display module uses the graph_waterfall class object to display the change of the signal's spectrum over time in a two-dimensional matrix.

[0055] S52, update the waterfall chart data; each time after receiving new spectrum data, call graph_waterfall->data()->setCell(x,y,FT_result_array[y][x]); to update the display data of the waterfall chart.

[0056] S53. Automatically adjust the coordinate axis; use the graph_waterfall->rescaleAxes() method to automatically adjust the coordinate axis so that the displayed spectrum data is complete.

[0057] S54. Redraw the waterfall chart; call ui->waterfallWidget->replot() to refresh the waterfall chart to show the dynamic process of signal spectrum changing over time.

[0058] S55, waterfall chart update completed; use graph_waterfall->data()->setValueRange(QCPRange(nowtime-waterfall_time_max, nowtime)) sets the display range of the waterfall chart according to the current time and the maximum time range. Users can see how the signal spectrum changes over time.

[0059] S6, using a timer to control the periodicity of data collection and graphics update. Step S6 includes the following sub-steps: S61, timer_data timer and timer_plot timer are connected to the corresponding slot functions through the connect method to trigger data collection and graphics update; among them, the timer_data timer is started by timer_data.start(sample_time), and takes sample_time as the interval period to obtain new data from the data source at regular intervals; each time the timer is triggered, the timer_data_timeout_solt() slot function is called to add the new data to the wave_data_buffer; the timer_plot timer is responsible for updating the graphics display at regular intervals.

[0060] S62. Start the timer through timer_plot.start(FFT_period), call the timer_plot_timeout_solt() slot function, and redraw the waveform graph, spectrum graph and waterfall graph; each time the timer is triggered, refresh the waveform graph display through ui->waveWidget->replot(), refresh the spectrum graph display through ui->spectrumWidget->replot(), and refresh the waterfall graph display through ui->waterfallWidget->replot(), so that the graphics are synchronized with the signal data.

[0061] S7, saving the currently collected data and the generated image as a file. Step S7 includes the following sub-steps: S71. By clicking the "Save Graphics" button, the user can save the currently displayed graphics as a file. The system supports common file formats such as PNG, JPG, and PDF. The file saving operation is implemented through the QFileDialog::getSaveFileName() method. The user can select the location and format of the saved file in the pop-up file save dialog box. After the user selects the file path and format, the system will save the graphics to the specified file location.

[0062] S72. When saving a file, the system automatically selects the saving format by judging the file extension. If the file name selected by the user ends with .png, the system will call the savePng() method to save the graphic as a PNG format file; if the file name ends with .jpg or .jpeg, the system will call the saveJpg() method to save it as a JPG format file; if the file name ends with .pdf, the savePdf() method will be called to save the graphic as a PDF file. If the user does not specify the file extension, the system will save the file in PNG format by default and automatically add the .png suffix.

[0063] S73. During the data reception process, through the QFileDialog::getSaveFileName() method, the user can specify the file path for saving binary data by selecting the "Save Data" button; the file is saved in .bin format, and the save location is selected using QFileDialog::getSaveFileName().

[0064] S74. When receiving data, the system will save the received binary data to the specified file in real time. If the system is in the saving state during the data receiving process and the user has specified the saving path, the system will use the QFile object to open the file in the specified path and write the received data through the append mode (QIODevice::Append). This process ensures the real-time saving of data without losing any data.

[0065] S75. The number of bytes during data saving will be updated in real time and displayed on the user interface to ensure that users can monitor the saving progress. If any error is encountered during the saving process, the system will display the corresponding error prompt to help users solve the problem in time.

[0066] S76. When the user decides to stop saving data, the system will stop receiving data and close the file. At this time, the file will be safely closed to ensure that all received data has been completely saved. The "Start Collection" button on the user interface will also return to its initial state, waiting for the user to restart the data collection and saving process.

[0067] In order to further optimize the real-time performance, the present invention adopts a multi-threading mechanism to distribute operations such as data acquisition, FFT calculation and graphics update to different threads. In this way, multi-core processors can be fully utilized to avoid performance bottlenecks caused by single-threaded operations. In a multi-threaded environment, all graphics update operations are executed in the main thread. By using QMetaObject::invokeMethod(), thread safety is ensured during graphics update, and no race conditions will occur.

[0068] The system uses smart pointers to manage memory, ensuring that each graphic object and data object automatically releases memory when it is no longer in use, avoiding memory leaks and unnecessary resource usage. Data acquisition, signal processing, and graphics drawing are three independent tasks, which are executed synchronously through timers to ensure that data and graphics are updated at the same time, avoiding data asynchrony due to delays.

[0069] The spectrum graph is updated frame by frame, and only the frequency data in the display area is updated each time, avoiding drawing the entire graph each time and improving display efficiency.

[0070] The waterfall chart is updated in a "scrolling" manner, where only new data is updated each time and displayed in a scrolling manner, thus avoiding the repeated drawing of a large amount of historical data and improving system performance.

[0071] The present invention responds to user operations through an event-driven mechanism, ensuring that when the user clicks a button or selects an operation, the system can immediately respond and execute the corresponding operation, thereby ensuring a good user experience. The system architecture of the present invention has good scalability, and users can add more signal processing modules, display modules or other functional modules as needed, such as adding filters, time-frequency analysis, etc.

[0072] The system of the present invention supports multi-platform operation, including operating systems such as Windows and Linux. By using the cross-platform Qt framework, the compatibility of software is guaranteed. In order to improve the real-time response capability of the system, the data acquisition module is further optimized, and the asynchronous I / O technology is used to process the data reception from the external device. The UDP data packets are received in a non-blocking manner, which can avoid the delay in the data transmission process, thereby ensuring that the system can still maintain low-latency signal display and processing under high-frequency data acquisition.

[0073] After testing, the present invention can collect and process signals in real time at a sampling rate of up to tens of MHz, ensuring that the signal waveform, spectrum diagram and waterfall diagram can be updated stably and without delay.

[0074] In order to improve the flexibility and scalability of the system, the present invention supports a dynamic plug-in mechanism. Users can freely add new signal processing algorithms, display effects or control modules as needed. For example, users can add new filter modules, or expand the display method of the spectrum graph. The system automatically loads the corresponding plug-in through the configuration file without modifying the existing code, thereby realizing modular expansion and customization requirements.

[0075] Although the embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. Those skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.< / double> < / double> < / double> < / double> < / double> < / double>

Claims

1. A low-latency signal real-time processing and visualization system based on UDP, characterized by: include: A data receiving module is used to receive data packets transmitted by an external device through the UDP protocol; The signal processing module is used to perform FFT processing on the received data, calculate and output spectrum data; Waveform display module, used for real-time display of time domain signal waveform; Spectrum analysis module, used to display the spectrum of the signal in real time; Waterfall chart module, used to show the change of signal frequency over time; The storage module is used to store the generated images and collected data.

2. The UDP-based low-latency signal real-time processing and visualization system according to claim 1, characterized in that: The data receiving module includes: QUdpSocket class, used to receive data packets through UDP protocol and trigger readyRead() signal; Data buffer area, used to store received signal data, data storage adopts FIFO mode; The signal processing module performs Fourier transform through the FFTTool class, calculates the amplitude of the frequency component, and saves the result in FFT_result_array; The waveform display module uses the graph_wave object of the QCustomPlot class to draw a real-time waveform graph and updates the horizontal axis range to maintain the continuity of the display time; The spectrum analysis module draws the spectrum graph through the graph_spectrum object of the QCustomPlot class, and automatically adjusts the coordinate axis to ensure the complete display of the spectrum data; The waterfall chart module draws a waterfall chart through the graph_waterfall object of the QCustomPlot class, updates the spectrum display according to the latest data, and uses the rescaleAxes() method to automatically adjust the coordinate axis; A storage module is used to save images of waveform graphs, spectrum graphs or waterfall graphs.

3. A method for real-time processing and visualization of low-latency signals based on UDP, which is operated by the real-time processing and visualization system of low-latency signals in claim 2, characterized in that: The steps include: S1, initialize the data receiving module to receive and process data; S2, signal processing and spectrum analysis; S3, update the waveform in real time and display the time domain signal; S4, drawing a spectrum diagram using the spectrum data; S5. Update the waterfall chart in real time; S6. Use a timer to control the periodicity of data collection and graphics update; S7. locally save the collected data and generated images.

4. The UDP-based low-latency signal real-time processing and visualization method according to claim 3, characterized in that: Step S1 includes the following sub-steps: S11, initialize the UDP communication module; initialize the QUdpSocket object, bind it to the specified port, set it to receive mode, and wait for data transmitted by the external device; S12, receiving and parsing data packets; when a data packet is received, the readyRead() signal is triggered, the data packet content is obtained through the QUdpSocket::readDatagram() method, and then the data is passed to the slot function to be parsed into valid signal data; S13, store the data in the cache; store the parsed data in the wave_data_buffer cache area, the wave_data_buffer cache area is connected to the QVector <double> The type stores the received signal data. The size of the buffer is controlled by wave_data_buffer_length. The data is stored in order in the wave_data_buffer buffer and saved in FIFO mode.< / double> S14, data cache uses QVector <double> To store the real-time collected signal data; manage the data queue through pop_front() and append();< / double> S15, check the validity of the data; if the data is valid, proceed to the next step, otherwise discard the data packet; S16. Transfer valid signal data to the signal processing module.

5. The UDP-based low-latency signal real-time processing and visualization method according to claim 4, characterized in that: Step S2 includes the following sub-steps: S21. Initialize FFT tool; Initialize FFT tool class FFTTool <double> , prepare input data for FFT calculation;< / double> S22, input signal data: the signal data obtained from the data receiving module is passed from wave_data_buffer to the FFT tool class as an input signal; S23, perform FFT transformation; call FFTTool::FFT_amplitude() method to perform Fourier transform, receive data in wave_data_buffer and calculate its frequency domain representation, convert the time domain signal into a frequency domain signal, and calculate the amplitude information of each frequency component; S24, obtaining spectrum data; after FFT calculation, obtaining frequency domain signal data, and saving the result in FFT_result_array; S25, transferring the spectrum data; transferring the calculated spectrum data to the spectrum display module to draw a spectrum graph.

6. The UDP-based low-latency signal real-time processing and visualization method according to claim 5, characterized in that: Step S3 includes the following sub-steps: S31, initialize the waveform display module; use the QCustomPlot class to create a waveform display control graph_wave, initialize the graph area and set the coordinate axis; S32, add data to the graph; whenever new data is received, add the data point to the waveform graph through graph_wave->addData(current_time, value[0]), where current_time is the current timestamp, so that the horizontal axis of the graph is displayed in time; S33, updating the coordinate axis range; Dynamically update the range of the horizontal axis through graph_wave->keyAxis()->setRange(current_time, 8000, Qt::AlignRight) to maintain the continuity of the displayed time; the horizontal axis of the waveform graph is the time axis, and the vertical axis is the signal amplitude; S34, redraw the waveform graph; call ui->waveWidget->replot() to refresh the waveform graph to update the displayed content; S35. Graphic update is completed; the real-time display of the waveform is completed, and the user can see the real-time changes of the signal.

7. The UDP-based low-latency signal real-time processing and visualization method according to claim 6, characterized in that: Step S4 includes the following sub-steps: S41. Initialize the spectrum graph display module; use the QCustomPlot class to create a spectrum graph display control graph_spectrum, and initialize the coordinate axis and graph area; S42, calculate the spectrum data; the result of each FFT analysis will be stored in FFT_result_array, which is a two-dimensional array that will store the amplitude of each frequency component changing with time; S43, use pop_front() and append() methods to manage the storage of historical data and maintain data fluidity; S44, plotting spectrum data; Add the FFT analysis results to the spectrum graph through graph_spectrum->addData(freq_step * i, FFT_output[i]), where freq_step is the calculated frequency step size so that the horizontal axis is displayed in frequency units; the vertical axis in the spectrum graph represents the amplitude and the horizontal axis represents the frequency; S45, updating the coordinate axis range; Use graph_spectrum->rescaleValueAxis(false, true) to automatically scale the ordinate axis, and use graph_spectrum->rescaleKeyAxis(false) to update the abscissa range so that all spectra are visible; S46. Redraw the spectrum graph; call ui->spectrumWidget->replot(); refresh the spectrum graph to display the latest spectrum information; S47, the spectrum graph is updated; the real-time display of the spectrum graph is completed, and the user can see the frequency components and changes of the signal.

8. The UDP-based low-latency signal real-time processing and visualization method according to claim 7, characterized in that: Step S5 includes the following sub-steps: S51, initialize the waterfall chart display module; use the QCustomPlot class to create a waterfall chart control graph_waterfall, initialize the graph area and coordinate axis, and set the frequency range and time range; the waterfall chart display module displays the change of the signal spectrum over time in a two-dimensional matrix through the graph_waterfall class object; S52, update the waterfall chart data; each time after receiving new spectrum data, call graph_waterfall->data()->setCell(x,y,FT_result_array[y][x]); to update the display data of the waterfall chart; S53, automatically adjust the coordinate axis; use the graph_waterfall->rescaleAxes() method to automatically adjust the coordinate axis so that the displayed spectrum data is complete; S54. Redraw the waterfall chart; call ui->waterfallWidget->replot() to refresh the waterfall chart to show the dynamic process of signal spectrum changing over time; S55, waterfall chart update completed; use graph_waterfall->data()->setValueRange(QCPRange(nowtime - waterfall_time_max, nowtime)) sets the display range of the waterfall graph according to the current time and the maximum time range. Users can see how the signal spectrum changes over time.

9. The UDP-based low-latency signal real-time processing and visualization method according to claim 8, characterized in that: Step S6 includes the following sub-steps: S61, timer_data timer and timer_plot timer are connected to the corresponding slot function through the connect method to trigger data collection and graphics update; among them, the timer_data timer is started by timer_data.start(sample_time), and takes sample_time as the interval period to obtain new data from the data source regularly; each time the timer is triggered, the timer_data_timeout_solt() slot function is called to add the new data to the wave_data_buffer; the timer_plot timer is responsible for updating the graphics display at regular intervals; S62. Start the timer through timer_plot.start(FFT_period), call the timer_plot_timeout_solt() slot function, and redraw the waveform graph, spectrum graph and waterfall graph; each time the timer is triggered, refresh the waveform graph display through ui->waveWidget->replot(), refresh the spectrum graph display through ui->spectrumWidget->replot(), and refresh the waterfall graph display through ui->waterfallWidget->replot(), so that the graphics are synchronized with the signal data.

10. The UDP-based low-latency signal real-time processing and visualization method according to claim 9, characterized in that: Step S7 includes the following sub-steps: S71. The user saves the current graphic as a file by clicking the "Save Graphics" button. Supported file formats include PNG, JPG, or PDF. File saving is implemented through the QFileDialog::getSaveFileName() method. After the user selects the file path and format, the graphic will be saved to the specified location. S72. When saving, the system determines the saving format according to the file extension: if the file ends with .png, call savePng() to save it as a PNG file; if the file ends with .jpg or .jpeg, call saveJpg() to save it as a JPG file; if the file ends with .pdf, call savePdf() to save it as a PDF file; if no suffix is ​​specified, the file is saved in PNG format by default and .png is automatically added; S73. The user clicks the "Save Data" button to select the path to save the binary data; the file is saved in .bin format, and QFileDialog::getSaveFileName() is used to select the save location; S74, the received data will be saved in real time to a file in the specified path, using the append mode to ensure that the data is not lost; S75. During the saving process, the number of bytes will be displayed in real time. If an error occurs, the system will prompt the user; S76. When the user stops saving data, the file will be safely closed and the "Start Collection" button will be restored, waiting for the next operation.

Citation Information

Patent Citations

  • An arbitrary signal generation system based on matlab and Qt combination and a method thereof

    CN109710023A

  • Implementation method of real-time frequency spectrum monitoring equipment

    CN112198365A

  • Method for collecting and analyzing radio signals in air by using unmanned aerial vehicle and software radio

    CN114035214A

  • Real-time transmission protocol stack based on FPGA (Field Programmable Gate Array) and hardware implementation method thereof

    CN115996216A

  • Unmanned aerial vehicle data link waveform and frequency spectrum monitoring method

    CN117498963A

Cited By

  • Multi-channel dynamic display three-axis wireless sensor data processing system

    CN120614648A