UDP-based low-latency signal real-time processing and visualization method and system

Through the real-time signal processing and visualization system based on the UDP protocol, the problems of delay and insufficient accuracy in wind turbine fault diagnosis are solved, and instant processing and stable updating of signals are achieved, which is suitable for real-time analysis of high-speed signals.

CN119884840BActive Publication Date: 2025-09-05HUNAN UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional wind turbine fault diagnosis methods have problems with response delay and insufficient accuracy, especially in large-scale wind farms or high-speed operation. Abnormal signals cannot be identified in time, resulting in missed maintenance opportunities.

Method used

A low-latency real-time signal processing and visualization system based on the UDP protocol is used. Data is received through QUdpSocket, the FFTTool class is used for Fourier transform, and the QCustomPlot class is used to draw waveforms, spectra, and waterfall charts, realizing instant processing and stable updating of signals.

Benefits of technology

It achieves stable and delay-free update of signals at high sampling rates, supports dynamic plug-in mechanism, has low latency and efficient data processing capabilities, and is suitable for real-time analysis of high-speed signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884840B_ABST
    Figure CN119884840B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of computer network communications and signal processing, and specifically discloses a low-latency signal real-time processing and visualization method based on UDP, comprising the following steps: S1, initializing a data receiving module to receive and process data; S2, signal processing and spectrum analysis; S3, updating the waveform graph in real time and displaying the time domain signal; S4, drawing a spectrum graph through spectrum data; S5, updating the waterfall graph in real time; S6, using a timer to control the periodicity of data acquisition and graphic updates; S7, saving images and collected data. The present invention also provides a low-latency signal real-time processing and visualization system based on UDP, comprising a data receiving module, a signal processing module, a waveform display module, a spectrum analysis module, a waterfall graph module, and a storage module. This solution can solve the problems of high latency, slow display updates, and complex data processing in the prior art, and achieve efficient data processing and stable graphic updates.
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 more specifically to the field of real-time data reception, signal processing, spectrum analysis, and waveform display technology based on the 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 rely heavily on vibration monitoring, temperature detection, and other sensor data. However, these methods often suffer from response delays and inaccuracy, especially in large-scale wind farms or high-speed operations. They often fail to identify abnormal signals in the early stages of a fault, leading to missed opportunities for repair.

[0003] To meet the demands of efficient and safe operation of modern wind turbines, the real-time and accurate performance of fault diagnosis systems has become crucial. As wind turbines continue to expand in size, real-time acquisition and processing of massive amounts of data from encoders, sensors, and other devices has become crucial for early fault detection. However, traditional communication protocols, such as TCP or serial communication, often fail to meet the requirements of high-speed, real-time data processing due to high transmission latency. This results in delayed fault diagnosis and impacts 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 existing technologies in real-time signal processing is an urgent problem that needs to be solved. Summary of the Invention

[0005] 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, and the instant processing and analysis of signals are realized. In combination 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:

[0007] Data receiving module, used to receive data packets transmitted by external devices through UDP protocol;

[0008] The signal processing module is used to perform FFT processing on the received data, calculate and output spectrum data;

[0009] Waveform display module, used to display the time domain signal waveform in real time;

[0010] Spectrum analysis module, used to display the spectrum of the signal in real time;

[0011] Waterfall chart module, used to show how the signal frequency changes over time;

[0012] The storage module is used to save the image of the waveform diagram, spectrum diagram or waterfall diagram and the collected data.

[0013] Furthermore, the data receiving module includes:

[0014] QUdpSocket class, used to receive data packets through the UDP protocol and trigger the readyRead() signal;

[0015] Data buffer area, used to store received signal data, data storage adopts FIFO mode;

[0016] 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;

[0017] 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;

[0018] 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;

[0019] 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 automatically adjusts the coordinate axis using the rescaleAxes() method;

[0020] A storage module is used to save images of waveforms, spectrograms, or waterfall graphs.

[0021] 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, includes the following steps:

[0022] S1. Initialize the data receiving module to receive and process data;

[0023] S2, signal processing and spectrum analysis;

[0024] S3, update the waveform in real time and display the time domain signal;

[0025] S4, drawing a spectrum graph using the spectrum data;

[0026] S5. Update the waterfall chart in real time;

[0027] S6, data collection and graphics update;

[0028] S7. Save the waveform graph, spectrum graph, or waterfall graph image and the collected data.

[0029] Furthermore, step S1 includes the following sub-steps:

[0030] 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;

[0031] S12. Receive and parse the data packet. When the data packet is received, the readyRead() signal is triggered, and the data packet content is obtained through the QUdpSocket::readDatagram() method. The data is then passed to the slot function to be parsed into valid signal data.

[0032] 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 stored in the wave_data_buffer cache area through 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 the wave_data_buffer buffer in sequence and saved in FIFO mode.

[0033] S14, data cache uses QVector <double>To store the real-time collected signal data; manage the data queue through pop_front() and append();

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

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

[0036] Furthermore, step S2 includes the following sub-steps:

[0037] S21. Initialize FFT tool; initialize FFT tool class FFTTool <double>, prepare input data for FFT calculation;

[0038] S22, input signal data: the signal data obtained from the data receiving module is passed from the wave_data_buffer to the FFT tool class as the input signal;

[0039] 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;

[0040] S24, obtain spectrum data; after FFT calculation, obtain frequency domain signal data and save the result in FFT_result_array;

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

[0042] Furthermore, step S3 includes the following sub-steps:

[0043] 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;

[0044] S32. Add data to the graph; whenever new data is received, add the data point to the waveform graph via 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;

[0045] S33, updating the coordinate axis range;

[0046] 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;

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

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

[0049] Furthermore, step S4 includes the following sub-steps:

[0050] S41. Initialize the spectrum graph display module; use the QCustomPlot class to create the spectrum graph display control graph_spectrum, and initialize the coordinate axis and graph area;

[0051] 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 over time.

[0052] S43. Use the pop_front() and append() methods to manage the storage of historical data and maintain data fluidity;

[0053] S44, plotting spectrum data;

[0054] 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 amplitude and the horizontal axis represents frequency;

[0055] 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;

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

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

[0058] Furthermore, step S5 includes the following sub-steps:

[0059] 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 spectrum over time in a two-dimensional matrix;

[0060] S52. Update the waterfall chart data. Each time new spectrum data is received, call graph_waterfall->data()->setCell(x,y,FT_result_array[y][x]); to update the display data of the waterfall chart.

[0061] 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;

[0062] 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;

[0063] S55, waterfall chart update completed; use graph_waterfall->data()->

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

[0065] Furthermore, step S6 includes the following sub-steps:

[0066] S61, timer_data timer and timer_plot timer are connected to the corresponding slot function through the connect method to trigger data collection and graph update; among them, the timer_data timer is started by timer_data.start(sample_time), and obtains new data from the data source at regular intervals with sample_time as the interval period; 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 graph display at regular intervals;

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

[0068] Furthermore, step S7 includes the following sub-steps:

[0069] S71. The user clicks the "Save Graphics" button to save the current graphic as a file. Supported file formats include PNG, JPG, and 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.

[0070] S72. When saving, the system determines the saving format based on 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 default saving format is PNG and .png is automatically added;

[0071] S73. The user clicks the "Save Data" button to select a path to save the binary data; the file is saved in .bin format, and the save location is selected using QFileDialog::getSaveFileName();

[0072] 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;

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

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

[0075] Compared with the prior art, the present invention can achieve the following beneficial effects:

[0076] 1. The present invention can acquire 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.

[0077] 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 mode of the spectrum graph. The system automatically loads the corresponding plug-in through the configuration file without modifying the existing code, realizing modular expansion and customization requirements.

[0078] 3. The present invention has low latency, efficient data processing capabilities, and stable graphics update functions. 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

[0079] Figure 1 is a schematic diagram of a process flow for receiving and processing real-time data provided by an embodiment of the present invention;

[0080] Figure 2 is a flow chart of signal processing and spectrum analysis according to an embodiment of the present invention;

[0081] Figure 3 is a waveform display flow chart provided according to an embodiment of the present invention;

[0082] Figure 4 is a schematic block diagram of a spectrum graph display process according to an embodiment of the present invention;

[0083] Figure 5 is a schematic block diagram of a waterfall chart display process according to an embodiment of the present invention;

[0084] Figure 6 is a schematic block diagram of an image update process provided according to an embodiment of the present invention;

[0085] 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

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

[0087] A UDP-based low-latency signal real-time processing and visualization system, comprising:

[0088] 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. The data storage adopts the FIFO method.

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

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

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

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

[0093] A storage module is used to save images of waveforms, spectrograms, or waterfall graphs.

[0094] 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, includes the following steps:

[0095] S1. Initialize the data receiving module to receive and process data.

[0096] Step S1 includes the following sub-steps:

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

[0098] S12. Receive and parse the data packet. When the data packet is received, the readyRead() signal is triggered, and the data packet content is obtained through the QUdpSocket::readDatagram() method. The data is then passed to the slot function to be parsed into valid signal data.

[0099] 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 stored in the wave_data_buffer cache area through 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 sequentially in the wave_data_buffer cache and saved in FIFO mode.

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

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

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

[0103] S2. Signal processing and spectrum analysis.

[0104] Step S2 includes the following sub-steps:

[0105] S21. Initialize FFT tool; initialize FFT tool class FFTTool <double>, prepare input data for FFT calculation.

[0106] S22, input signal data: the signal data obtained from the data receiving module is passed from the wave_data_buffer to the FFT tool class as the input signal;

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

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

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

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

[0111] Step S3 includes the following sub-steps:

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

[0113] S32. Add data to the graph. Whenever new data is received, add the data point to the waveform graph via graph_wave->addData(current_time, value[0]). current_time is the current timestamp, so that the horizontal axis of the graph is displayed in time.

[0114] S33, update the coordinate axis range,

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

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

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

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

[0119] Step S4 includes the following sub-steps:

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

[0121] S42. Calculate the spectrum data. The result of each FFT analysis is stored in FFT_result_array, which is a two-dimensional array that stores the amplitude of each frequency component as it changes over time.

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

[0123] S44, plotting spectrum data;

[0124] Add the FFT analysis results to the spectrum graph via 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. In the spectrum graph, the vertical axis represents amplitude and the horizontal axis represents frequency.

[0125] S45, updating the coordinate axis range;

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

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

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

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

[0130] Step S5 includes the following sub-steps:

[0131] 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 spectrum over time in a two-dimensional matrix.

[0132] S52. Update the waterfall chart data. Each time new spectrum data is received, call graph_waterfall->data()->setCell(x,y,FT_result_array[y][x]); to update the display data of the waterfall chart.

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

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

[0135] S55, waterfall chart update completed; use

[0136] 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. Users can see how the signal spectrum changes over time.

[0137] S6. Use a timer to control the periodicity of data collection and graph updating. Step S6 includes the following sub-steps:

[0138] 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 obtains new data from the data source at regular intervals with sample_time as the interval period; 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.

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

[0140] S7, save the currently collected data and the generated image as a file. Step S7 includes the following sub-steps:

[0141] S71. By clicking the "Save Graphics" button, the user can save the currently displayed graphic as a file. The system supports common file formats such as PNG, JPG, and PDF. The file saving operation is implemented using the QFileDialog::getSaveFileName() method. The user can select the location and format for saving the file in the pop-up file save dialog box. After the user selects the file path and format, the system saves the graphic to the specified file location.

[0142] 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 system will call the savePdf() method to save the graphic as a PDF file. If the user does not specify a file extension, the system will save the file in PNG format by default and automatically add the .png suffix.

[0143] 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().

[0144] S74. When receiving data, the system saves the received binary data to the specified file in real time. If the system is in the saving state during data reception and the user has specified a save path, the system uses a QFile object to open the file in the specified path and writes the received data using the append mode (QIODevice::Append). This process ensures real-time data storage without any data loss.

[0145] S75. The number of bytes in the data being saved will be updated in real time and displayed on the user interface, allowing users to monitor the progress of the save. If any errors are encountered during the save process, the system will display corresponding error messages to help users resolve the issues promptly.

[0146] S76. When the user decides to stop saving data, the system stops receiving data and closes the file. The file is securely closed, ensuring that all received data is fully saved. The "Start Collection" button on the user interface also returns to its initial state, allowing the user to restart the data collection and saving process.

[0147] To further optimize real-time performance, the present invention adopts a multi-threading mechanism, distributing operations such as data acquisition, FFT calculation, and graphics update to different threads. This can fully utilize multi-core processors and 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 updates, and race conditions will not occur.

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

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

[0150] The update method of the waterfall chart adopts "rolling" update, which only updates the new data each time and displays it in a rolling manner, thus avoiding the repeated drawing of a large amount of historical data and improving system performance.

[0151] 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, 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.

[0152] 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, software compatibility is guaranteed. In order to improve the real-time response capability of the system, the data acquisition module is further optimized, and asynchronous I / O technology is used to process data reception from external devices. UDP data packets are received in a non-blocking manner, which can avoid delays in the data transmission process, thereby ensuring that the system can maintain low-latency signal display and processing under high-frequency data acquisition.

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

[0154] In order to improve the flexibility and scalability of the system, the present invention supports a dynamic plug-in mechanism, and 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 mode 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.

[0155] Although the embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.< / double> < / double> < / double> < / double> < / double> < / double>

Claims

1. A UDP-based low-latency signal real-time processing and visualization method, characterized in that: Operates through a UDP-based low-latency real-time signal processing and visualization system, which includes: 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 to display the time domain signal waveform in real time; Spectrum analysis module, used to display the spectrum of the signal in real time; Waterfall chart module, used to show how the signal frequency changes over time; A storage module for storing generated images and collected data; The method 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 graph 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 saving the collected data and generated images; 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. Receive and parse the data packet. When the data packet is received, the readyRead() signal is triggered, and the data packet content is obtained through the QUdpSocket::readDatagram() method. The data is then 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 stored in the wave_data_buffer cache area through 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 the wave_data_buffer buffer in sequence 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.

2. The UDP-based low-latency signal real-time processing and visualization method according to claim 1, 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 the wave_data_buffer to the FFT tool class as the 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; S24, obtain spectrum data; after FFT calculation, obtain frequency domain signal data and save 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.

3. The UDP-based low-latency signal real-time processing and visualization method according to claim 2, 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 via 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.

4. The UDP-based low-latency signal real-time processing and visualization method according to claim 3, 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 the 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 amplitude and the horizontal axis represents frequency; S45, updating the coordinate 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 and 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.

5. The UDP-based low-latency signal real-time processing and visualization method according to claim 4, 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 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 spectrum over time in a two-dimensional matrix; S52. Update the waterfall chart data. Each time new spectrum data is received, 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. The user can see how the signal spectrum changes over time.

6. The UDP-based low-latency signal real-time processing and visualization method according to claim 5, 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 graph update; among them, the timer_data timer is started by timer_data.start(sample_time), and obtains new data from the data source at regular intervals with sample_time as the interval period; 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 graph 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.

7. The UDP-based low-latency signal real-time processing and visualization method according to claim 6, characterized in that: Step S7 includes the following sub-steps: S71. The user clicks the "Save Graphics" button to save the current graphic as a file. Supported file formats include PNG, JPG, and 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 based on 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 default saving format is PNG and .png is automatically added; S73. The user clicks the "Save Data" button to select a path to save the binary data; the file is saved in .bin format, and the save location is selected using QFileDialog::getSaveFileName(); 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

  • 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