High-speed voltage acquisition device and method

By using a high-speed voltage acquisition device and method, combined with analog SPI communication, data compression and queue buffering, the technical bottleneck of long-distance signal acquisition on the explosion-proof valve test bench was solved, realizing high-speed signal acquisition and reliable transmission at 10kHz, thus improving the accuracy and reliability of explosion-proof valve testing.

CN120994114AActive Publication Date: 2025-11-21UNIV OF SHANGHAI FOR SCI & TECH
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202511508140.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2025-11-21
Estimated Expiration
2045-10-22

AI Technical Summary

Technical Problem

Existing explosion-proof valve test benches cannot achieve high-speed acquisition of pressure sensor signals at long distances. Existing communication modules have limited distance and sampling rates that cannot meet the 10kHz requirement. Furthermore, long-distance cable transmission is susceptible to electromagnetic interference, which can lead to signal distortion.

Method used

A high-speed voltage acquisition device is adopted, including a microcontroller (MCU), an analog-to-digital converter (ADC), a W5500 Ethernet module, and a female connector. It achieves long-distance high-speed signal acquisition through simulated SPI communication, data compression and queue buffering, combined with the UDP protocol. Lightweight neural networks are used for data compression and decoding to ensure the continuity and reliability of data transmission.

Benefits of technology

It achieves high-speed signal acquisition at 10kHz at distances of 30 meters or even 100 meters, reduces data transmission volume, avoids signal distortion, improves the accuracy and reliability of acquisition, and meets the high-performance requirements of explosion-proof valve test benches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994114A_ABST
    Figure CN120994114A_ABST
Patent Text Reader

Abstract

The invention provides a high-speed voltage acquisition device and method, and relates to the technical field of industrial automatic testing. The device comprises a lower computer, an ADC (Analog to Digital Converter), an upper computer, an Ethernet module and a female header connector, the ADC is connected with the pressure sensor interface through the female header connector and is used for acquiring voltage data; the lower computer comprises an MCU (Microprogrammed Control Unit), the MCU is electrically connected with the ADC, and the MCU sends data to the ADC and receives the data sent by the ADC in a mode of simulating an SPI (Serial Peripheral Interface); the receiving module is used for receiving voltage data, compressing the received voltage data and then sending the compressed data to the upper computer through the Ethernet module; and the upper computer performs data analysis on the compressed data and converts the compressed data into an actual voltage value. Through the high-speed voltage acquisition device, high-speed and reliable acquisition and transmission of pressure sensor signals at a sampling rate of 10 kHz under a communication distance of 100 meters are realized, data transmission efficiency and signal restoration precision are significantly improved, and MCU resource consumption is reduced at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial automation testing technology, specifically to a high-speed voltage acquisition device and method. Background Technology

[0002] In the field of industrial production and safety assurance, explosion-proof valves are critical safety equipment, and the accurate evaluation and monitoring of their performance is of paramount importance. Explosion-proof valve test benches, as specialized equipment for testing, evaluating, and verifying the performance of explosion-proof valves, can simulate extreme working conditions and comprehensively test key parameters such as opening pressure, sealing performance, pressure resistance, and response time. This provides crucial data for the design, manufacturing, improvement, and safety of explosion-proof valves in practical applications.

[0003] In the testing of explosion-proof valves, the acquisition of pressure sensor signals is one of the core aspects. Pressure sensors can sense real-time pressure changes in the environment in which the explosion-proof valve is located and convert them into electrical signals. Accurate and high-speed acquisition of these pressure signals is irreplaceable for precisely analyzing the performance of the explosion-proof valve under different operating conditions, promptly identifying potential safety hazards, and optimizing the design parameters of the explosion-proof valve. However, existing explosion-proof valve test benches require high-speed acquisition of pressure sensor signals at a distance of 30 meters because the pressure sensors output 0-5V voltage signals (analog signals), requiring high-speed acquisition with a sampling rate of 10kHz (i.e., 10,000 data points per second). Existing LabVIEW modules based on USB 3.0 communication are limited to a maximum communication distance of 5 meters and cannot meet this requirement; while ordinary data acquisition modules generally only have a 10Hz sampling rate, far below the 10kHz sampling rate requirement. Summary of the Invention

[0004] To address the technical challenges of existing explosion-proof valve test benches requiring long-distance, high-speed acquisition of pressure sensor signals, where current communication distances cannot achieve long-distance transmission and the sampling rate of ordinary data acquisition modules cannot meet the high-speed acquisition requirements, this invention proposes a high-speed voltage acquisition device and method.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A high-speed voltage acquisition device, the device comprising: a lower-level computer, an analog-to-digital converter (ADC), a upper-level computer, a W5500 Ethernet module, and a female connector; The ADC connects to the pressure sensor interface via a female connector and is used to acquire voltage data. The lower-level machine includes a microcontroller (MCU), which is electrically connected to the ADC. It sends data to and receives data from the ADC using an analog SPI method. It also compresses the received voltage data and then sends the compressed data to the upper-level machine through the W5500 Ethernet module. The host computer receives compressed data sent by the MCU through the W5500 Ethernet module via the Ethernet network card, and parses the data to convert it into actual voltage values.

[0006] On the other hand, the present invention also provides a data acquisition method applied to the above-mentioned high-speed voltage acquisition device, the method comprising: Initialize and configure the power supply of the high-speed voltage acquisition device; Collect voltage data from the pressure sensor; The collected voltage data is cached using a queue data structure and then compressed. The compressed data is then transmitted to the host computer. The host computer receives the compressed data and parses it to obtain the actual voltage value.

[0007] Compared with the prior art, the beneficial effects of the present invention are: 1. Achieving Long-Distance High-Speed ​​Signal Acquisition: In existing technologies, the maximum communication distance of LabVIEW modules based on USB 3.0 communication is only 5 meters, which cannot meet the requirement of long-distance transmission of 30 meters. This invention not only achieves the goal of high-speed data transmission at a distance of 30 meters, but also extends the communication distance to 100 meters, fully meeting the needs of industrial scenarios such as explosion-proof valve test benches for long-distance signal acquisition. Furthermore, the sampling rate of ordinary data acquisition modules is typically only 10Hz, far below the 10kHz sampling rate requirement. The ADS8698-ISO module used in this invention has a sampling rate of 500ksps, and combined with the efficient communication of the MCU, it achieves 8-channel 10kHz high-speed signal acquisition, accurately capturing the transient characteristics of pressure changes.

[0008] 2. Efficient Data Processing and Caching: Employing a separate encoding / decoding architecture, data compression is achieved through a lightweight neural network, achieving a compression ratio of nearly 40:1. This significantly reduces data transmission volume and avoids the problem of SPI transmission blocking ADC acquisition. Furthermore, a queue data structure is used to cache the acquired data, which is then packaged and sent every 10ms, resolving the contradiction between "acquisition rate > network transmission rate" and ensuring the continuity and real-time performance of data transmission.

[0009] 3. Reliable Communication Protocol Selection: Compared to TCP, UDP has lower header overhead (saving approximately 20%), is simpler to implement in embedded systems, and avoids data backlog issues. Combined with the W5500 Ethernet module, it ensures reliable 10ms timed transmission, meeting real-time requirements.

[0010] 4. High-precision signal restoration and storage: The host computer receives UDP data packets and uses PC computing power to perform high-precision decoding, restoring the compressed data to the actual voltage value and storing it in a MySQL database, ensuring data integrity and traceability. The decoder employs a four-layer neural network structure, effectively learning low-dimensional latent representations, achieving feature decompression and information reconstruction, maintaining consistency between input and output, and improving the accuracy of signal restoration.

[0011] 5. Low resource consumption and high adaptability: Addressing the resource constraints of MCUs, a structured pruning optimization strategy is employed, significantly reducing the number of neural network parameters and computational complexity while maintaining high model accuracy. Furthermore, quantization further reduces the numerical precision of model weights and activation values, decreasing storage space and transmission bandwidth requirements. Simultaneously, the impact of quantization errors on system accuracy is minimized, ensuring system stability and reliability.

[0012] 6. Improved Testing Accuracy and Reliability: Through high-speed, long-distance signal acquisition and transmission, the transient characteristics of pressure changes in explosion-proof valves under different operating conditions were accurately captured, providing reliable data support for performance evaluation and fault diagnosis of explosion-proof valves. This avoids the problem of signal distortion caused by electromagnetic interference when transmitting analog signals directly over long distances via cables, thus improving the accuracy and reliability of test results.

[0013] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description

[0014] Figure 1 This is a schematic diagram of the ADS8698-ISO module structure according to Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the interface circuit between the ADS8698-ISO module and the MCU according to Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the interface circuit between the ADS8698-ISO module and an external voltage sensor according to Embodiment 1 of the present invention. Figure 4 This is a flowchart of a high-speed voltage acquisition method according to Embodiment 2 of the present invention; Figure 5 This is a schematic diagram of an autoencoder model according to Embodiment 2 of the present invention; Figure 6This is a diagram of the voltage acquisition communication data format according to Embodiment 2 of the present invention. Detailed Implementation

[0015] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings, so as to more clearly understand the purpose, features and advantages of this invention. It should be understood that the embodiments shown in the drawings are not intended to limit the scope of this invention, but are only for illustrating the essential spirit of the technical solutions of this invention. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.

[0016] Unless the context requires otherwise, throughout the specification and claims, the word “comprising” and its variations, such as “including” and “having”, shall be understood to have an open, inclusive meaning, that is, to be interpreted as “including, but not limited to”.

[0017] Throughout this specification, references to "an embodiment" or "an embodiment" indicate that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Therefore, the appearance of "in an embodiment" or "an embodiment" in various places throughout the specification does not necessarily refer to the same embodiment. Furthermore, a particular feature, structure, or characteristic may be combined in any manner in one or more embodiments.

[0018] The singular forms “a” and “the” used in this specification and the appended claims include plural references unless otherwise expressly stated herein. It should be noted that the term “or” is generally used to mean “and / or” unless otherwise expressly stated herein.

[0019] In the following description, in order to clearly demonstrate the structure and working method of the present invention, a number of directional terms will be used. However, terms such as "front", "back", "left", "right", "outside", "inside", "outward", "inward", "up", and "down" should be understood as convenient terms and not as limiting terms.

[0020] The implementation details of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The following content is only for the convenience of understanding the implementation details and is not necessary for implementing this solution.

[0021] In the field of industrial automation testing and monitoring, especially in scenarios involving the performance testing of critical equipment such as explosion-proof valves, stringent requirements are placed on the high-speed, long-distance acquisition and transmission of sensor signals. Taking existing explosion-proof valve test benches as an example, they need to acquire the 0-5V voltage signal (analog signal) output by the pressure sensor at a high-speed sampling rate of 10kHz at a distance of 30 meters to accurately capture the transient characteristics of pressure changes and provide reliable data support for the performance evaluation and fault diagnosis of explosion-proof valves.

[0022] However, current technical solutions have significant limitations. On the one hand, while LabVIEW modules based on USB 3.0 communication possess high-speed data transmission capabilities, their maximum communication distance is only 5 meters, which is insufficient to meet the requirement of long-distance transmission of 30 meters. On the other hand, the sampling rate of ordinary data acquisition modules is typically only 10Hz, far from the high-speed sampling requirement of 10kHz, making it impossible to accurately capture transient changes in pressure signals. Furthermore, if analog signals are directly transmitted via long-distance cables, they are not only susceptible to electromagnetic interference leading to signal distortion, but also suffer from reduced acquisition accuracy due to signal attenuation, thus affecting the accuracy and reliability of the test results.

[0023] To overcome the aforementioned technical bottlenecks, this invention proposes a novel high-speed voltage acquisition device. By integrating core technologies such as multi-channel high-speed acquisition (e.g., providing 8 voltage acquisition channels to acquire pressure sensor signals (1-5V) at a frequency of 10kHz), efficient data processing, lightweight data transmission, and intelligent analysis by the host computer, it achieves high-speed acquisition and reliable transmission of pressure sensor signals at a distance of 30 meters or even 100 meters at 10kHz, providing a high-performance and high-reliability signal acquisition solution for industrial scenarios such as explosion-proof valve test benches.

[0024] Example 1 This embodiment discloses a high-speed voltage acquisition device, which is mainly used in industrial scenarios such as explosion-proof valve test benches. This device meets the stringent requirements for high-speed, long-distance acquisition and transmission of pressure sensor signals in industrial settings.

[0025] refer to Figures 1 to 3 A high-speed voltage acquisition device includes a microcontroller (MCU), an analog-to-digital converter (ADC), a host computer, a W5500 Ethernet module, and a female connector.

[0026] The hardware design of the high-speed voltage acquisition device adopts a modular, layered stacking design. Specifically, the ADC uses the ADS8698-ISO module (integrating SPI digital isolation and high-performance voltage regulation circuitry). The ADS8698 is an 8-channel, 18-bit resolution, 500ksps sampling rate successive approximation register (SAR) analog-to-digital converter (ADC) from Texas Instruments (TI). The ADS8698's 8 channels, 18-bit resolution, and 500ksps sampling rate directly match the high-speed voltage acquisition device's requirement of "8 voltage acquisition channels + 10kHz sampling rate," with a range configuration of 0-5.12V, covering the 1-5V output range of the pressure sensor, ensuring signal acquisition accuracy. The high-speed voltage acquisition device uses a DC-DC power module K7805-2000R3 to convert the 24V DC input power to a 5V DC output. Figure 1 As shown, a 5V DC power supply is connected to the ADS8698-ISO module to power it. The ADS8698-ISO module is connected to the pressure sensor interface via a female connector.

[0027] The MCU uses an STM32F407ZGT6 chip, which sends data to and receives data from the ADC via simulated SPI. The MCU's PD8, PD9, PD10, PD11, PD13, and PD15 pins are connected to the SPI interface communication pins SDO, DAISY, SCLK, CS, RESET, and SDI of the ADS8698-ISO module, establishing the electrical connection between the MCU and the ADC. This simulated SPI data transmission means manually simulating the SPI protocol timing signals using the MCU's general-purpose input / output (GPIO) ports, rather than relying on a hardware SPI peripheral, to achieve communication with the ADC.

[0028] The time required for the MCU to read data from the 8-channel ADC using simulated SPI includes: single-channel time (chip select time, 1 GPIO write operation), time to write two bytes of data (including 24 GPIO write operations and 8 register operations), time to read 18 bits of data (including 36 GPIO write operations, 18 GPIO read operations, and 18 register and conditional operations), and chip select deselect time (1 GPIO write operation). By achieving efficient communication between the MCU and the ADC through simulated SPI, with the GPIO set to 50MHz, the time for a single channel is approximately 2.34µs, and the data reading time for all 8 channels is approximately 18.72µs, far lower than the 10kHz sampling period (100μs), meeting real-time requirements.

[0029] In some embodiments, the data processing and caching architecture of the high-speed voltage acquisition device employs data compression and queue concatenation techniques. Since 18-bit ADC data requires 3 bytes, it is stored using uint32_t (32-bit unsigned integer) and converted to floating-point voltage using formulas, reducing storage overhead. To resolve the contradiction of "acquisition rate > network transmission rate," a queue data structure is used to cache data, which is then sent in packets every 10ms. Without compression, 8 channels × 10kHz × 3 bytes / sample = 2400 bytes / 10ms; adding the header / checksum, the total transmission volume is approximately 2407 bytes. Compression techniques (such as separate encoding / decoding) can reduce the data volume and prevent SPI transmission (2407 bytes at a 42MHz clock speed requires approximately 457μs) from blocking ADC acquisition (a new acquisition needs to be started every 100μs). Without compression or queue caching, direct transmission would cause the CPU to be blocked for a long time, affecting sampling continuity.

[0030] In some embodiments, the high-speed voltage acquisition device selects the UDP protocol for data transmission. Compared to TCP, which requires handling connection, retransmission, and congestion control, UDP has lower header overhead (saving approximately 20%), and its embedded implementation is simpler, avoiding data accumulation. Combined with the W5500 Ethernet module, data is converted into Ethernet frames via the SPI interface for transmission, ensuring the reliability of 10ms timed transmissions.

[0031] The host computer receives compressed data sent by the MCU via the W5500 Ethernet module through its Ethernet network card, and performs data parsing and storage: the host computer parses the UDP packets sent by the MCU, extracts the 8-channel voltage data (including compression identifiers), converts it into actual voltage values, and finally stores it in the MySQL database. This process must strictly match the data packaging format (such as message header, number of data items, checksum) of the MCU (lower-level computer) to ensure data integrity.

[0032] The novel high-speed voltage acquisition device in this embodiment is applied to industrial scenarios such as explosion-proof valve test benches. Through a modular and layered hardware design, it adopts an ADC and MCU adapted to meet the requirements and achieves efficient communication. It uses data compression and queue splicing technology to solve the contradiction between acquisition and transmission rates. The UDP protocol is selected in conjunction with the W5500 Ethernet module to ensure reliable data transmission. The host computer accurately parses and stores the data, meeting the stringent requirements for high-speed acquisition and reliable transmission of pressure sensor signals at a distance of 30 meters at 10kHz.

[0033] Example 2 Based on Example 1, the W5500 Ethernet module connects to the MCU via SPI, then converts the data into Ethernet transmission and reception. In the STM32F407ZGT6 chip, the SPI clock frequency is 42MHz, so the fastest transmission time per byte is: 2407 bytes transfer time: This will affect the 100µs ADC acquisition, so a separate encoding and decoding architecture was designed.

[0034] The separate encoding / decoding architecture achieves data compression through a lightweight neural network and allocates tasks based on the differences in device computing power: the lower-level machine (MCU) with limited computing power focuses on data acquisition and compression. The encoder in the MCU adopts a three-layer neural network structure. The upper-level machine (PC) is responsible for high-precision decoding and storage, and the decoder adopts a four-layer neural network structure. The system employs an intelligent model pruning strategy and a reliable transmission protocol, significantly reducing MCU resource consumption and ensuring data transmission reliability while maintaining a compression ratio of nearly 40:1.

[0035] This embodiment provides a voltage acquisition method based on the high-speed voltage acquisition device of Embodiment 1. This method employs a separate encoding / decoding architecture, such as... Figure 4 As shown, the method specifically includes the following steps: Step 1: Initialization and power configuration.

[0036] The 24V DC input power is converted to 5V DC output using a K7805-2000R3 DC-DC power module. This 5V DC power is then connected to the ADS8698-ISO module to power it. The hardware of the high-speed voltage acquisition device is then initialized.

[0037] Step 2: Collect voltage data from the pressure sensor.

[0038] Voltage acquisition is performed on each single channel, including the following steps: Chip Select: The MCU performs one GPIO write operation to select a specific channel of the ADS8698-ISO module.

[0039] Write data: The MCU performs 24 GPIO write operations and 8 register operations to send control commands or configuration data to the ADC.

[0040] Reading data: The MCU performs 36 GPIO write operations, 18 GPIO read operations, and 18 register and judgment operations to read 18-bit voltage data from the ADC.

[0041] Deselect chip: The MCU performs one GPIO write operation to end the acquisition of the current channel.

[0042] Multi-channel voltage acquisition: Repeat the single-channel voltage acquisition steps to complete the voltage acquisition of all 8 channels in sequence.

[0043] Efficient communication between the MCU and ADC is achieved by simulating SPI. With GPIO set to 50MHz, the time for a single channel is about 2.34µs, and the total data reading time for 8 channels is about 18.72µs, which meets the real-time requirement of a 10kHz sampling period (100μs).

[0044] Step 3: Cache and compress the collected voltage data.

[0045] The lower-level machine (MCU) stores the raw 18-bit ADC data acquired from the ADC into a uint32_t variable (32-bit unsigned integer). It uses a queue data structure to buffer the acquired data. When dequeuing, it uses a formula conversion to convert the integer data into floating-point voltage data. Each channel applies compression technology to compress the floating-point voltage data buffered within 10ms before preparing it for transmission, reducing storage overhead.

[0046] Specifically, each channel generates 100 floating-point voltage data points (1-5V) within 10ms using a formula. These are then compressed into a 10-byte feature vector by a pruned lightweight neural network, converting the 100 floating-point voltage data points into 10 8-bit integers (0-255), achieving a compression ratio of approximately 40:1. The lightweight encoder employs a 3-layer MLP network (100→32→16→10), and through pruning and quantization optimization, it is adapted to the low-computing-power environment of MCUs.

[0047] In some embodiments, the lower-level machine employs compression technology, including the following steps: S3-1, Neural Network Pre-training.

[0048] The neural network is trained using a series of simulated voltage data, consisting of floating-point voltage readings acquired in real-world circuit environments, with values ​​stable between 1 and 5V. The data acquisition process covers various operating conditions and load scenarios, including different temperature environments, power supply fluctuations, and signal noise interference, ensuring the diversity and representativeness of the training data. This high-quality dataset enables the autoencoder to learn the essential characteristics and distribution patterns of the voltage signal, thus maintaining high fidelity during compression and reconstruction. Furthermore, an "online calibration / domain adaptation mechanism" (periodically embedding a small number of original samples for lightweight recalibration) is employed as a robustness measure.

[0049] The encoder and decoder employ an asymmetric design to balance compression efficiency and reconstruction accuracy. The autoencoder model is as follows: Figure 5As shown, the encoder is responsible for progressively compressing the 100-dimensional floating-point data input from the lower-level machine (MCU) into a low-dimensional latent space. The encoder employs a three-layer neural network structure: the input first undergoes a linear mapping from 100 to 32 and is activated by ReLU (Rectified Linear Unit), followed by linear layers from 32 to 16 and then from 16 to 10, also activated by ReLU. Finally, the latent layer outputs 10-dimensional features, and the representation range is constrained by the Tanh function. Therefore, the encoder compresses 100-dimensional floating-point data into 10-dimensional byte data, greatly reducing the communication burden.

[0050] S3-2. Apply the pruning algorithm to the pre-trained neural network model.

[0051] Subsequently, considering the limited resources of the MCU, a pruning algorithm was adopted on the pre-trained neural network model to minimize the amount of computation and memory usage while ensuring accuracy. The model pruning stage is after the autoencoder has completed 26 epochs of pre-training. Here, epoch represents the process during neural network training where the entire dataset is completely input and propagates forward and backward once.

[0052] To improve the real-time performance and computational efficiency of embedded deployments, this embodiment employs a structured pruning optimization strategy, significantly reducing the number of neural network parameters and computational complexity. Structured pruning is a technique that systematically removes entire layers, channels, or rows / columns of weighted connections from a neural network. Its core principle is to reduce the number of model parameters and computational complexity in a rule-based manner while maintaining hardware friendliness.

[0053] This embodiment employs a structured pruning optimization strategy, the implementation of which is divided into three key stages: First, the model is pre-trained using a complete autoencoder architecture on a collected 1-5V voltage dataset to learn effective feature representations and reconstruction patterns from the input data. In this stage, the Adam optimizer and mean squared error loss function are used, and all weight parameters are updated through batch gradient descent to ensure the model achieves a good initial performance foundation.

[0054] Subsequently, differentiated pruning operations are performed, employing an asymmetric pruning strategy based on the different deployment environments and functional requirements of the encoder and decoder. For the encoder portion, which will run on a resource-constrained MCU, a more aggressive pruning ratio of 20%-50% is adopted, significantly reducing the number of parameters and computational requirements. The pruning process is based on a weighting principle, retaining the weight connection with the largest absolute value (1-pruning ratio) at each layer, and setting the rest to zero, forming a sparse network structure.

[0055] Finally, fine-tuning training with mask constraints is performed to further optimize the remaining parameters on the pruned sparse architecture. A mask protection mechanism is introduced during fine-tuning, reapplying the pruned mask after each training step to ensure that pruned weights remain at zero values, preventing gradient updates from restoring redundant connections. This stage allows the model to maintain high sparsity while gradually recovering the accuracy loss caused by pruning, ultimately resulting in a lightweight yet high-performance neural network model that meets the real-time voltage signal processing requirements of embedded systems.

[0056] S3-3. Quantize the pruned neural network model.

[0057] Quantization of a structured pruning neural network model involves reducing the numerical precision of model weights and activation values ​​(e.g., converting them from 32-bit floating-point numbers to 8-bit integers). This process maintains the lightweight advantage of the pruned model while further compressing storage space and improving hardware computing efficiency, while also weighing the impact of quantization errors on system accuracy.

[0058] This implementation enables bidirectional conversion between floating-point numbers in the range [-1, 1] and 8-bit integers, adapting to varying storage and transmission requirements. On the lower-level device (MCU), the conversion from floating-point to 8-bit integers (quantization) is implemented, mapping floating-point numbers in the range [-1, 1] proportionally to [0, 255], compressing the data bit width to save storage space (from 32-bit floating-point to 8-bit integer) and transmission bandwidth. The quantization formula is as follows: ; in, round The function is a rounding function, where x represents the normalized value of the input signal, usually between [-1, 1], and Q(x) represents the quantized integer value, ranging from [0, 255].

[0059] Finally, the trained neural network model is ported to the MCU. Zero weights are skipped by pruning masks to reduce multiplication operations. The MCU first loads the pruned parameters trained in Python using C language and then implements the encoder program.

[0060] Step 4: Transmit the compressed data to the host computer.

[0061] During the process of transmitting compressed data to the host computer, the compressed data needs to be encapsulated using a standardized data packet format to ensure communication reliability and parsing efficiency, such as... Figure 6 As shown, the data packet structure includes: 1. Frame header: 4 bytes (0xAA, 0xBB, 0xCC, 0xDD); 2. Data length: 2 bytes (indicating the number of subsequent valid data bytes); 3. Data field; 4. Checksum: 1 byte (cumulative checksum).

[0062] Specifically, the data packet structure adopts a layered design: the frame header is a 4-byte fixed identifier (0xAA, 0xBB, 0xCC, 0xDD) used to synchronize the receiver and identify the start of the data packet; the data length field occupies 2 bytes, explicitly indicating the number of valid bytes in the subsequent data fields in unsigned integer form, supporting dynamic length data transmission; the data field carries the actual compressed measurement data (such as multi-channel voltage sampling values), and its content and length are dynamically defined by the upper-layer protocol; the checksum is a 1-byte cumulative sum, generated by summing all bytes in the data field bit by bit and taking the lower 8 bits, used by the receiver to verify data integrity, and triggering a retransmission mechanism if the check fails. This format balances communication efficiency (fixed length field occupies 6 bytes) and flexibility (variable data field length), and is suitable for high-speed, reliable data interaction scenarios between embedded systems and host computers.

[0063] The data packet structure also uses big-endian storage for multi-byte data. Big-endian storage means that the most significant byte of the data is stored in memory or at the low address (or starting position) of the data packet, and the remaining bytes are arranged in descending order of weight. In addition, a queue management method is used during data transmission. That is, to ensure successful data transmission, after C# successfully receives a data packet, it sends an acknowledgment signal. After the MCU receives the data transmission success signal, it removes the transmitted data from the queue.

[0064] In some embodiments, the UDP protocol is selected for data transmission to the host computer due to its low header overhead, simple embedded implementation, and ability to avoid data accumulation. The MCU sends data to the W5500 Ethernet module via the SPI interface. The W5500 Ethernet module converts the data into Ethernet frames and sends them to the host computer according to the UDP protocol to ensure the reliability of the 10ms timed transmission. After data compression, each channel corresponds to 10 bytes of data. The system sends these 10 bytes of channel data every 10ms using the UDP protocol, for a total of 80 bytes of data sent across 8 channels.

[0065] Step 5: The host computer receives the compressed data and parses it to obtain the actual voltage value.

[0066] The host computer utilizes PC computing power to achieve high-precision decoding, receiving and reconstructing data. This is implemented using C# programming. Within C#, the ONNX runtime is used to build the neural network required by the decoder in the autoencoder. The specific steps include: S5-1: The host computer receives compressed data packets sent by the MCU via the UDP protocol.

[0067] During data transmission, the communication status can be visually represented by the indicator light color: when communication is in normal condition, the indicator light is bright green; if a communication failure occurs, specifically if there is no data transmission for 10 consecutive seconds, the indicator light will turn red; and when not in a test state or when communication has ended, the indicator light will be dark green.

[0068] S5-2. Perform data parsing and storage on the compressed data packet.

[0069] The decoder in the autoencoder parses the compressed data packets, progressively restoring the latent representation to data of the same dimension as the input. The decoder employs a four-layer neural network structure, such as... Figure 5 As shown, the process is as follows: 10→16 linear layers (ReLU activation), 16→32 linear layers (ReLU activation), 32→64 linear layers (ReLU activation), and finally 64→100 linear layers to output the reconstructed result. Through this structure, the model can effectively learn low-dimensional latent representations while maintaining consistency between input and output, achieving feature decompression and information reconstruction.

[0070] Differential pruning operations are then performed on the data that has undergone feature decompression and information reconstruction. The host computer adopts a relatively conservative pruning ratio of 10%-30% to maintain better signal reconstruction quality.

[0071] The pruned neural network model is dequantized using the following formula: ; Dequantization, the inverse process of quantization, remaps the quantized discrete integers back to their original numerical range (in this case, floating-point numbers within the range [-1, 1]). Through dequantization, approximate original floating-point information can be recovered from stored or transmitted 8-bit integer data, enabling the conversion of compressed data into actual voltage values. The converted voltage values ​​are then stored in a MySQL database to ensure data integrity and traceability.

[0072] This embodiment uses a pruned and compressed approach to process the collected voltage data, which has a significant effect compared to directly transmitting uncompressed data, as shown in Table 1.

[0073] Table 1. Optimization effect of pruning on the compressed transmission model

[0074] This embodiment designs a separate encoding and decoding architecture. The lower-level machine (MCU) uses a lightweight neural network to focus on data acquisition and compression, while the upper-level machine (PC) is responsible for high-precision decoding and storage. It adopts an intelligent model pruning strategy and a reliable transmission protocol to achieve a compression ratio of nearly 40:1, reducing MCU resource consumption, ensuring transmission reliability, meeting real-time requirements, and adapting to different computing power environments through pre-training, pruning, quantization and other processing. The effect after compression and transmission is significant.

[0075] This invention addresses the need for long-distance, high-speed pressure sensor signal acquisition in explosion-proof valve test benches by providing a novel high-speed voltage acquisition device and method that integrates multi-channel high-speed acquisition, efficient data processing and compression, lightweight UDP data transmission, and intelligent analysis by the host computer. Through a separate encoding / decoding architecture and intelligent model pruning strategy, it achieves high-speed and reliable transmission at a 10kHz sampling rate over communication distances of 30 meters or even 100 meters, significantly reducing MCU resource consumption, improving data transmission efficiency and signal restoration accuracy, and providing a high-performance, high-reliability signal acquisition solution for industrial scenarios.

[0076] Although the present invention has been described in detail with reference to the accompanying drawings and preferred embodiments, the invention is not limited thereto. Various equivalent modifications or substitutions can be made to the embodiments of the invention by those skilled in the art without departing from the spirit and essence of the invention. Such modifications or substitutions should all fall within the scope of the invention, or any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the invention should be covered within the protection scope of the invention. Therefore, the protection scope of the invention should be determined by the scope of the claims.

Claims

1. A high speed voltage acquisition device, characterized by, The device comprises a lower machine, an analog-to-digital converter (ADC), an upper machine, a W5500 Ethernet module, and a busbar connector. The ADC is connected to the pressure sensor through the busbar connector for collecting voltage data. The lower machine comprises a microcontroller (MCU) which is electrically connected to the ADC, sends data to the ADC and receives data sent by the ADC in an analog SPI mode, compresses the received voltage data, and then sends the compressed data to the upper machine through the W5500 Ethernet module. The upper machine receives the compressed data sent by the MCU through the W5500 Ethernet module, analyzes the data, and converts the data into actual voltage values.

2. The apparatus of claim 1, wherein, The ADC uses an ADS8698-ISO module, the range of which is configured as 0-5.12V, covering the output range of 1-5V of the pressure sensor; a DC-DC power module K7805-2000R3 is used to convert a 24V DC input power into a 5V DC output power, and the 5V DC power is connected to the ADS8698-ISO module to supply power to the module; the ADS8698-ISO module is configured as 8 channels, 18-bit resolution, and 500ksps sampling rate, and is used to simultaneously collect 8-channel pressure sensor signals.

3. The apparatus of claim 2, wherein, The MCU uses an STM32F407ZGT6 chip, the PD8, PD9, PD10, PD11, PD13, and PD15 pins of the STM32F407ZGT6 chip are connected to the communication pins SDO, DAISY, SCLK, CS, RESET, and SDI of the SPI interface of the ADS8698-ISO module, realizing the electrical connection between the MCU and the ADC. The MCU reads a single-channel time including a chip selection time, a time for writing two bytes of data, a time for reading 18-bit data, and a time for releasing the chip selection, and the reading time of 8 channels is 8 times the reading time of a single channel.

4. A method for collecting voltage applied to the high-speed voltage collecting device according to any one of claims 1 to 3, characterized by, The method comprises: initializing and configuring the power supply of the high-speed voltage collection device; collecting voltage data of the pressure sensor; buffering the collected voltage data using a queue data structure, and then compressing the data; transmitting the compressed data to the upper machine; the upper machine receives the compressed data, analyzes the data, and obtains actual voltage values.

5. The method of claim 4, wherein, The buffering of the collected voltage data using a queue data structure and the compression of the data comprise the following steps:

6. The method of claim 5, wherein, the MCU stores the original 18-bit ADC data collected from the ADC in a uint32_t variable, buffers the collected data using a queue data structure, converts the integer data into floating-point voltage data using a formula when dequeuing, and compresses the floating-point voltage data buffered in 10ms for each channel using a compression technique. The compression of the floating-point voltage data using a compression technique comprises the following steps: a neural network is trained using a series of analog collected voltage data, which are floating-point voltage readings collected in a real circuit environment and have a stable value range of 1 to 5V. The data collection process covers various working conditions and load scenarios, including different temperature environments, power fluctuations, and signal noise interference, to ensure the diversity and representativeness of the training data; These datasets enable the autoencoder to learn the essential features and distribution patterns of the voltage signals, thereby maintaining high fidelity during compression and reconstruction; The encoder and decoder of the autoencoder employ an asymmetric design, with the encoder responsible for gradually compressing the 100-dimensional floating-point data input from the MCU into a low-dimensional latent space. The encoder uses a three-layer neural network structure, specifically: the input is first linearly mapped from 100 to 32 and activated by ReLU, then sequentially passes through linear layers of 32→16 and 16→10, also activated by ReLU, and finally outputs 10-dimensional features in the latent layer using the Tanh function to constrain the representation range.

7. The method of claim 6, wherein, The floating-point voltage data is compressed using compression techniques, which further include the following steps: First, pre-train the model using the complete autoencoder architecture on the collected 1-5V voltage dataset, learn the effective feature representation and reconstruction rules of the input data; This stage uses the Adam optimizer and mean square error loss function to update all weight parameters through batch gradient descent, ensuring that the model has a good initial performance basis; Then perform differential pruning operations, according to the different deployment environments and functional requirements of the encoder and decoder, use asymmetric pruning strategies; The MCU-side encoder uses a pruning ratio of 20%-50%, significantly reducing parameter quantity and computational demand; The pruning process is based on weight size criteria, retaining the largest absolute weight connections in each layer and setting the rest to zero to form a sparse network structure; Finally, fine-tune the training with mask constraints, continue to optimize the remaining parameters on the pruned sparse architecture; Introduce a mask protection mechanism during fine-tuning, reapply the pruning mask after each training step to ensure that the pruned weights remain zero, preventing gradient updates from restoring redundant connections; This stage allows the model to maintain high sparsity while gradually recovering the accuracy loss caused by pruning, ultimately obtaining a lightweight and high-performance neural network model.

8. The method of claim 7, wherein, The floating-point voltage data is compressed using compression techniques, which further include the following steps: quantize the pruned neural network model, on the MCU side, realize the quantization of floating-point numbers to 8-bit integers, map floating-point numbers within [-1, 1] to [0, 255] in proportion, compress data bit width to save storage space and transmission bandwidth, the quantization formula is as follows: ; In the formula, round The function is a rounding function, x represents the normalized value of the input signal, usually between [-1, 1], and Q(x) represents the quantized integer value, ranging between [0, 255].

9. The method of claim 8, wherein, The compressed data is transmitted to the host computer, which includes: In the data transmission process, the compressed data needs to be packaged through a standardized data packet format. The data packet adopts a hierarchical structure design: the frame header is a 4-byte fixed identifier, including 0xAA, 0xBB, 0xCC, 0xDD, which is used to synchronize the receiving end and identify the start of the data packet; the data length field occupies 2 bytes, which explicitly indicates the number of valid bytes in the subsequent data field in the form of an unsigned integer, supporting dynamic length data transmission; the data field carries the actual compressed multi-channel voltage sampling value; the checksum is a 1-byte cumulative sum, which is generated by summing all bytes in the data field bit by bit and taking the low 8 bits, used to verify the integrity of the data at the receiving end, and if the verification fails, a retransmission mechanism is triggered; the data packet structure stores multi-byte data in big-endian order; in addition, a queue management method is also used in the data transmission process.

10. The method of claim 9, wherein, The upper computer receives compressed data and analyzes it to obtain the actual voltage value, including: The upper computer receives the compressed data packet sent by the MCU through the UDP protocol; the compressed data packet is analyzed and stored, specifically including: the analysis of the compressed data packet is realized through the decoder part of the self-encoder, and the latent representation is gradually restored to the data with the same dimension as the input; the decoder adopts a four-layer neural network structure, and the process is: 10→16 linear layer, 16→32 linear layer, 32→64 linear layer, all three linear layers use ReLU activation, and the final 64→100 linear layer outputs the reconstruction result; Perform a differential pruning operation on the reconstruction result, and the upper computer end uses a pruning ratio of 10%-30% for pruning processing; Perform dequantization processing on the neural network model after pruning, and the dequantization formula is as follows: ; In the formula, q represents the quantized integer value, which is an unsigned integer, ranging from 0 to 255; D(q) represents the normalized value after dequantization, ranging from -1 to 1; As the inverse process of quantization, through dequantization, the original floating-point number information is recovered from the transmitted 8-bit integer data, realizing the conversion of compressed data into actual voltage values.

Citation Information

Patent Citations

  • Long-distance transmission pressure sensing array system

    CN113176021A

  • ZYNQ-based multifunctional analog instrument test acquisition card and data processing method

    CN119988252A

  • Model quantification and compression method for low-computing-power environment

    CN120317292A

  • Intelligent valve force monitoring system based on virtual instrument

    CN209432322U

  • Pressure sore body position alarm device

    CN213935162U