Lightweight encryption-based single-particle mass spectrum real-time secure transmission method

By employing the lightweight encryption algorithm ChaCha20 and the MQTT protocol in single-particle mass spectrum data transmission, combined with dynamic key generation and data preprocessing, the problems of real-time transmission and high resource consumption are solved, achieving efficient and secure data transmission.

CN121151002APending Publication Date: 2025-12-16GUANGDONG MAX SCI INSTR INNOVATION RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511162640.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

Existing technologies for single-particle mass spectrum data transmission suffer from poor real-time performance, high resource consumption, and a lack of customized encryption mechanisms, making it difficult to meet the needs of high-frequency acquisition and resource-constrained equipment.

Method used

It employs the lightweight encryption algorithm ChaCha20 and the streaming protocol MQTT, combined with dynamic key generation and data preprocessing, to achieve real-time secure data transmission.

Benefits of technology

It improves data security and system processing capabilities, reduces resource consumption, meets the real-time requirements of high-frequency data acquisition, and achieves millisecond-level transmission response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121151002A_ABST
    Figure CN121151002A_ABST
Patent Text Reader

Abstract

The invention discloses a single-particle mass spectrum real-time secure transmission method based on lightweight encryption, and relates to the technical field of mass spectrum data secure transmission. Optimization is specially carried out aiming at high-frequency acquisition and high-safety requirements of single-particle mass spectrum data; by adopting a ChaCha20 efficient encryption algorithm, the calculation overhead is remarkably reduced on the premise of ensuring the data security, and real-time synchronization of acquisition and encryption is realized; and meanwhile, a dynamic key management mechanism is introduced, so that the system security is improved, the applicability and flexibility in a resource limited environment are enhanced, and the problems of poor encryption transmission real-time performance, high resource consumption, high deployment cost and the like in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of mass spectrum data secure transmission, and in particular to a real-time secure transmission method for single-particle mass spectrum based on lightweight encryption. BACKGROUND

[0002] With the development of environmental monitoring and health research, single-particle mass spectrometers are widely used for real-time analysis of particle composition, generating a large amount of high-value data. These data are at risk of being stolen or tampered with during transmission. Therefore, a secure, efficient and real-time data encryption transmission scheme is urgently needed. In recent years, lightweight encryption algorithm (ChaCha20) has been widely used in Internet of Things and edge computing due to its low resource consumption and high efficiency. At the same time, streaming transmission protocols (such as MQTT) also provide good support for real-time data transmission.

[0003] The transmission method in the prior art has the following disadvantages: 1) poor real-time performance: existing encryption transmission schemes mostly use traditional encryption algorithms (such as AES, RSA), which have high computational complexity, resulting in large encryption and transmission delays, making it difficult to meet the real-time requirements of single-particle mass spectrum with high-frequency acquisition (millisecond level). 2) High resource consumption: Some schemes rely on hardware encryption modules (such as FPGA, special security chips) or encryption algorithms with high computational overhead, making it difficult to deploy in resource-constrained field monitoring devices or embedded systems, affecting the overall performance of the system. 3) Lack of customized encryption mechanism for mass spectrum data: existing lightweight encryption schemes are mostly designed for simple sensor data and do not consider the large amount of mass spectrum data, resulting in a mismatch between the encryption strategy and the data structure, affecting efficiency and security. Therefore, we propose a real-time secure transmission method for single-particle mass spectrum based on lightweight encryption. SUMMARY

[0004] The purpose of the present application is to solve the problems mentioned in the background art. The present application provides a real-time secure transmission method for single-particle mass spectrum based on lightweight encryption.

[0005] In order to achieve the above purpose, the present application specifically adopts the following technical solutions: A real-time secure transmission method for single-particle mass spectrum based on lightweight encryption, comprising: A data acquisition module acquires raw mass spectrum data from a single-particle mass spectrometer; A preprocessing module performs mass spectrum algorithm compression processing on the acquired data; An encryption module uses lightweight encryption algorithm ChaCha20 to encrypt the preprocessed data and generates a dynamic key; A transmission module sends the encrypted data to the receiving end through the network; A receiving end module receives encrypted data and performs decryption, restoration and integrity verification.

[0006] Further, the preprocessing module integrates a mass spectrum algorithm module in the acquisition thread for signal preprocessing, and uses zlib to compress the data.

[0007] Further, the encryption process of the encryption module is as follows: the data acquisition thread calls the encryption module immediately after acquiring a batch of data; the batch of data is encrypted using a dynamically generated key; and the encrypted data block is sent through the transmission module.

[0008] Further, the key generation logic in the encryption module generates a new key according to the current timestamp, device ID and session ID each time a connection is established.

[0009] Further, the transmission module includes a transmission protocol and a breakpoint resume mechanism, wherein the transmission protocol uses MQTT, and the breakpoint resume mechanism uses QoS2 of MQTT to ensure data reception.

[0010] Further, the receiving end module is composed of a receiving module, a decryption module and a data restoration module, wherein the receiving module is used to listen to the encrypted data stream, the decryption module uses the same key for decryption, and the data restoration module is used to restore the original mass spectrum data.

[0011] Further, the method comprises the following steps: Step 1, starting acquisition: after the system is started, the data acquisition module starts to acquire original data from the mass spectrometer; Step 2, preprocessing: the data enters the preprocessing module, and the spectrum correction, baseline reduction, normalization algorithm processing and compression are performed; Step 3, encryption processing: the encryption module uses a dynamic key to encrypt the data through the chacha20 algorithm; Step 4, transmission and sending: the transmission module sends the encrypted data to the receiving end through a specified protocol; Step 5, receiving and decryption: after the receiving end receives the encrypted data, the decryption module is called to perform decryption; Step 6, data restoration: restore to original mass spectrum data.

[0012] Further, the starting acquisition in step 1 and the preprocessing in step 2 comprise the following steps: Step A1, acquiring single particle mass spectrum data; Step A2, spectrum correction, baseline reduction and normalization to obtain clean particle spectrum; Step A3, data compression; Step A4, generating a key according to the device number, device registration code and session ID; Step A5, using ChaCha20 encryption algorithm with the obtained key to encrypt the data, forming an encrypted data packet; Step A6, splicing the equipment number with the encrypted data packet to obtain a sending packet; Step A7, sending the sending packet to the transmission module to complete data sending.

[0013] Further, the data compression in step A3 uses the LZ4 compression algorithm to compress the preprocessed data.

[0014] Further, the receiving and decryption in step 5 and the data restoration in step 6 include the following steps: Step B1, receiving the acquisition end data; Step B2, cutting the encrypted segment data and the equipment number; Step B3, obtaining the registration code according to the equipment number, and obtaining the decryption key according to the session ID; Step B4, decrypting the data according to the key using the ChaCha20 algorithm; Step B5, decompressing the data packet; Step B6, spectrum storage.

[0015] The beneficial effects of the present application are as follows: 1. The present application reduces the risk of data being stolen during transmission by using encryption and key management mechanisms, improves data security, and significantly reduces CPU and memory usage with lightweight encryption algorithms, enabling the system to run efficiently on devices with limited resources. Lightweight encryption algorithms can complete encryption operations faster, improving the overall system processing capacity and reducing resource consumption.

[0016] The present application uses an optimized transmission protocol and supports streaming encryption to achieve fast data transmission, meeting the real-time requirements of high-frequency data acquisition. The design of collecting and encrypting simultaneously reduces the time window of data exposure, improves the overall system response speed, and improves the real-time performance of transmission. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. The drawings described in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0018] Figure 1 is a workflow diagram of the present application; Figure 2 is a system architecture diagram of the present application; Figure 3is a workflow diagram of starting collection and pre-processing in the present application; Figure 4 is a workflow diagram of receiving and decryption and data restoration in the present application. DETAILED DESCRIPTION

[0019] The application will be further described in details with reference to the drawings. Obviously, the described embodiments are only part of the embodiments of the present application, but not all the embodiments. Based on the embodiments of the present application, all the other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0020] It should be noted that the terms "first", "second" and the like are used only for the purpose of description, and should not be understood as indicating or implying relative importance or implying the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise specifically limited.

[0021] In the present application, unless otherwise specifically defined and limited, the terms "mounting", "connecting", "fixing" and the like should be understood broadly, for example, it can be fixed connection, or detachable connection, or integral; it can be mechanical connection, or electrical connection or communication with each other; it can be directly connected, or indirectly connected through intermediate medium, it can be the internal communication of two elements or the interaction relationship between two elements, unless otherwise specifically limited. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0022] In the present application, unless otherwise specifically defined and limited, the first feature is "on" or "under" the second feature, which can be direct contact between the first and second features, or indirect contact between the first and second features through intermediate medium. Moreover, the first feature "above", "over" and "on" the second feature can be directly above or obliquely above the first feature, or only indicate that the horizontal height of the first feature is higher than that of the second feature. The first feature "below", "under" and "under" the second feature can be directly below or obliquely below the first feature, or only indicate that the horizontal height of the first feature is less than that of the second feature.

[0023] In the above description, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples, without contradiction.

[0024] Please refer to Figure 1 - Figure 4 The present application provides a real-time secure transmission method of single-particle mass spectrum based on lightweight encryption, comprising: A data acquisition module is used to acquire original mass spectrum data from a single-particle mass spectrometer, including mass-to-charge ratio, ion intensity, and timestamp information. The module is connected to the mass spectrometer in real time through a high-speed serial interface to obtain a data stream at a rate of gigabits per second, ensuring low latency and integrity. The acquired data is temporarily stored in a buffer in binary format to facilitate subsequent encryption preprocessing.

[0025] A preprocessing module is used to perform common mass spectrum algorithms and compression processing on the acquired data to improve data quality and reduce transmission volume.

[0026] An encryption module uses the lightweight encryption algorithm ChaCha20 to encrypt the preprocessed data to ensure data security. The encryption module generates a dynamic key based on a session ID, a device serial number, and a device registration code. Through encryption and key management mechanisms, the risk of data being stolen during transmission is reduced, data security is improved, the lightweight encryption algorithm significantly reduces CPU and memory usage, enabling the system to run efficiently on devices with limited resources. The lightweight encryption algorithm can complete encryption operations faster, improving the processing capacity of the entire system and reducing resource consumption.

[0027] A transmission module is used to send the encrypted data to the receiving end through the network. The use of an optimized transmission protocol and support for streaming encryption enables fast data transmission, meeting the real-time requirements of high-frequency data acquisition. The design of collecting and encrypting simultaneously reduces the time window of data exposure, improves the response speed of the overall system, and improves the real-time performance of transmission.

[0028] A receiving end module is used to receive encrypted data and perform decryption, restoration, and integrity verification.

[0029] In this embodiment, preferably, the preprocessing module integrates a mass spectrometry algorithm module in the acquisition thread for signal preprocessing, and uses zlib to compress the data; the mass spectrometry algorithm module performs noise reduction and feature extraction on the original mass spectrometry signal through real-time filtering and peak detection, ensuring the accuracy and processability of the data, while the zlib compression uses a default compression level to efficiently reduce the data volume, significantly reducing the storage and transmission overhead. This design directly completes preprocessing and compression within the acquisition thread, avoiding thread switching delays, achieving immediate acquisition and processing of data, and further improving the real-time performance and resource efficiency of the overall system; the compressed data is immediately sent to the encryption module, seamlessly connecting the subsequent secure transmission process.

[0030] In this embodiment, preferably, the encryption process of the encryption module is as follows: the data acquisition thread immediately calls the encryption module after acquiring a batch of data; the batch of data is encrypted using a dynamically generated key; and the encrypted data block is sent through the transmission module. The dynamic key is generated by the encryption security random number generator immediately before each encryption, and the key is immediately cleared from the memory after encryption is completed, preventing the risk of key leakage; the encryption process optimizes the block size (such as 1KB) for the compressed data block, matches the packet structure of the transmission module, and ensures seamless connection with the transmission process.

[0031] In this embodiment, preferably, the key generation logic in the encryption module generates a new key based on the current timestamp, device ID, and session ID each time a connection is established. The timestamp is obtained using a high-precision UTC clock to ensure timeliness, the device ID is a unique identifier fixed at the factory for binding the device identity, and the session ID is dynamically allocated by the system when the connection is established, ensuring the independence of each session.

[0032] In this embodiment, preferably, the transmission module includes a transmission protocol and a breakpoint resume mechanism, wherein the transmission protocol uses MQTT, and the breakpoint resume mechanism uses MQTT QoS2 to ensure data reception. The lightweight nature of the MQTT protocol reduces system overhead, supports real-time publish / subscribe mode, and ensures stable operation in a high-concurrency environment; the breakpoint resume mechanism realizes message ID tracking and double confirmation through MQTT QoS2 level, automatically retransmits unconfirmed data packets when the network is interrupted, avoids data loss or duplication, and cooperates with the immediate key clearing mechanism of the encryption module to ensure end-to-end data security and integrity.

[0033] In this embodiment, preferably, the receiving end module is composed of a receiving module, a decryption module, and a data restoration module, wherein the receiving module is used to listen to the encrypted data stream, the decryption module uses the same key for decryption, and the data restoration module is used to restore the original mass spectrometry data.

[0034] In this embodiment, preferably, the method comprises the following steps: Step 1, start collecting: after the system starts, the data acquisition module starts to obtain raw data from the mass spectrometer; Step 2, pretreatment: the data enters the pretreatment module, and the spectrum correction, baseline reduction, normalization algorithm processing, and compression are performed; Step 3, encryption processing: the encryption module uses a dynamic key to encrypt the data through the chacha20 algorithm; Step 4, transmission and sending: the transmission module sends the encrypted data to the receiving end through a specified protocol; Step 5, receiving and decryption: after receiving the encrypted data, the receiving end calls the decryption module to decrypt; Step 6, data restoration: restore to the original mass spectrum data.

[0035] In this embodiment, preferably, the start collecting in step 1 and the pretreatment in step 2 include the following steps: Step A1, collecting single particle mass spectrum data; Step A2, spectrum correction, baseline reduction, and normalization to obtain clean particle spectrum; Step A3, data compression; Step A4, generating a key according to the device number, device registration code, and session ID; Step A5, using the ChaCha20 encryption algorithm to encrypt the data with the obtained key to form an encrypted data packet; Step A6, splicing the device number with the encrypted data packet to obtain a sending packet; Step A7, sending the sending packet to the transmission module to complete data sending.

[0036] In this embodiment, preferably, the data compression in step A3 uses the LZ4 compression algorithm to compress the pretreated data.

[0037] In this embodiment, preferably, the receiving and decryption in step 5 and the data restoration in step 6 include the following steps: Step B1, receiving the data of the collecting end; Step B2, cutting the encrypted segment data and the device number; Step B3, obtaining the registration code according to the device number, and obtaining the decryption key according to the session ID; Step B4, decrypting the data according to the key using the ChaCha20 algorithm; Step B5, decompressing the data packet; Step B6, spectrum storage.

[0038] The working principle and use process of the present application are as follows: After system startup, the data acquisition module first acquires the raw data stream generated by the single-particle mass spectrometer in real time via a high-speed serial interface. This data stream includes mass-to-charge ratio, ion intensity, and high-precision timestamp information, and temporarily stores the raw binary data in a buffer at a rate of gigabits per second. The acquisition thread then triggers the preprocessing process: calling the built-in mass spectrometry algorithm module to perform real-time filtering and noise reduction, baseline correction, and peak extraction on the raw data to improve data quality; the processed data is immediately optimized for volume using the zlib compression algorithm (or LZ4 algorithm), significantly reducing the workload of subsequent processing.

[0039] Once the preprocessed data block (typically 1KB in size) is completed, it is immediately sent to the encryption module. At this point, the key generation unit dynamically generates an encryption key based on a high-precision UTC clock, the device's unique identifier, and the current session ID, and performs streaming encryption using the ChaCha20 algorithm. After encryption, the key is immediately cleared from memory, and the encrypted data block is concatenated with the device number to form a transmission packet. The entire process is completed synchronously within the acquisition thread, eliminating thread switching latency.

[0040] The transmission module publishes encrypted data packets at QoS2 level via the MQTT protocol. Its lightweight nature and publish / subscribe model ensure real-time transmission under high concurrency. In case of network fluctuations, the breakpoint resumption mechanism automatically retransmits unacknowledged data packets based on message ID tracking to ensure transmission reliability. After the receiving end's listening module acquires the data packet, it first separates the device number from the encrypted data segment, and then retrieves the corresponding registration code and session ID through the device number to reconstruct the decryption key. Subsequently, it uses the ChaCha20 algorithm to decrypt the data stream, decompresses it using LZ4 / zlib to restore it to clean mass spectrometry data, and finally performs integrity verification and stores it in the analysis system. This process realizes a pipeline operation of "acquisition-processing-encryption-transmission". Through dynamic key management, a zero-residue memory mechanism, and protocol layer protection, it achieves both millisecond-level real-time performance and military-grade security standards in resource-constrained environments.

[0041] The above descriptions are merely some embodiments of the present invention. Those skilled in the art can make various modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the scope of protection of the present invention.

Claims

1. A method for real-time secure transmission of single-particle mass spectra based on lightweight encryption, characterized in that, include: The data acquisition module acquires raw mass spectrum data from the single-particle mass spectrometer; The preprocessing module performs mass spectrometry algorithm compression on the collected data; The encryption module uses the lightweight encryption algorithm ChaCha20 to encrypt the preprocessed data and generate a dynamic key; The transmission module sends the encrypted data to the receiving end via the network; The receiving module receives encrypted data and performs decryption, restoration, and integrity verification.

2. The method for real-time secure transmission of single-particle mass spectra based on lightweight encryption according to claim 1, characterized in that, The preprocessing module integrates a mass spectrometry algorithm module in the acquisition thread to preprocess the signal and uses zlib to compress the data.

3. The method for real-time secure transmission of single-particle mass spectra based on lightweight encryption according to claim 1, characterized in that, The encryption process of the encryption module is as follows: the data acquisition thread calls the encryption module immediately after acquiring each batch of data; the batch of data is encrypted using a dynamically generated key; and the encrypted data block is sent through the transmission module.

4. The method for real-time secure transmission of single-particle mass spectra based on lightweight encryption according to claim 1, characterized in that, The encryption module generates a new key based on the current timestamp, device ID, and session ID for each connection.

5. The method for real-time secure transmission of single-particle mass spectra based on lightweight encryption according to claim 1, characterized in that, The transmission module includes a transmission protocol and a breakpoint resume mechanism. The transmission protocol uses MQTT, and the breakpoint resume mechanism utilizes MQTT's QoS2 to ensure data reception.

6. The method for real-time secure transmission of single-particle mass spectra based on lightweight encryption according to claim 1, characterized in that, The receiving module consists of a receiving module, a decryption module, and a data restoration module. The receiving module is used to monitor the encrypted data stream, the decryption module uses the same key to decrypt the data, and the data restoration module is used to restore the data to the original mass spectrum.

7. The method for real-time secure transmission of single-particle mass spectra based on lightweight encryption according to claim 1, characterized in that, Includes the following steps: Step 1: Start Acquisition: After the system starts, the data acquisition module begins to acquire raw data from the mass spectrometer; Step 2, Preprocessing: The data enters the preprocessing module, where spectral correction, baseline reduction, normalization algorithm processing, and compression are performed. Step 3, Encryption Processing: The encryption module uses a dynamic key to encrypt the data using the chacha20 algorithm; Step 4: Transmission and Sending: The transmission module sends the encrypted data to the receiving end according to the specified protocol; Step 5, Receiving and Decrypting: After receiving the encrypted data, the receiving end calls the decryption module to decrypt it; Step 6: Data restoration: Restore the data to the original mass spectrum.

8. The method for real-time secure transmission of single-particle mass spectra based on lightweight encryption according to claim 7, characterized in that, The start of data acquisition in step 1 and the preprocessing in step 2 include the following steps: Step A1: Acquire single-particle mass spectrometry data; Step A2: Spectrum correction, baseline reduction, and normalization to obtain a clean particle spectrum; Step A3: Data compression; Step A4: Generate a key based on the device number, device registration code, and session ID; Step A5: Use the obtained key to encrypt the data using the ChaCha20 encryption algorithm to form an encrypted data packet; Step A6: Concatenate the device number and the encrypted data packet to obtain the sending packet; Step A7: Send the packet to the transmission module to complete the data transmission.

9. A method for real-time secure transmission of single-particle mass spectra based on lightweight encryption according to claim 8, characterized in that, In step A3, the LZ4 compression algorithm is used to compress the preprocessed data.

10. A method for real-time secure transmission of single-particle mass spectra based on lightweight encryption according to claim 7, characterized in that, The receiving and decryption in step 5 and the data restoration in step 6 include the following steps: Step B1: Receive data from the acquisition terminal; Step B2: Segment the encrypted data and device number; Step B3: Obtain the registration code based on the device number and the decryption key based on the session ID; Step B4: Decrypt the data using the ChaCha20 algorithm based on the key; Step B5: Decompress the data packet; Step B6: Spectrum storage.