Exclusive encrypted file format of universal water, gas, sound and residue pollutant data acquisition instrument
By designing a universal water acoustic slag pollutant data collector exclusive encrypted file format, the problems of lack of universality, data security risks, low storage efficiency and inconvenience in management in the prior art are solved, and the data security, efficiency and reliability are achieved, and the data is well scalable.
Patent Information
- Application Number
- CN202411667871.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing environmental monitoring data acquisition equipment and file formats have problems such as lack of universality, data security risks, low storage efficiency and inconvenient management.
A universal water acoustic slag pollutant data collector exclusive encrypted file format is designed, including file header setting segment, data storage format definition segment, self-check segment and encryption algorithm segment, using technical means such as XML structured storage, AES encryption and CRC32 verification.
It realizes data security and integrity, improves data storage and retrieval efficiency, ensures data reliability, and has good scalability.
Smart Images

Figure CN119603012A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of environmental monitoring, and in particular to an exclusive encrypted file format of a universal water, gas, sound and slag pollutant data collector. Background Art
[0002] Environmental protection monitoring comes first. Automation and informatization are the premise and guarantee for good environmental monitoring. Over the years, while the local economy has been developing rapidly, various regions have continued to experience varying degrees of environmental pollution incidents such as water, air, and noise, which have seriously affected people’s quality of life and hindered the sustainable development of the local economy. Environmental testing is a way to understand the state of environmental pollution. Environmental testing generally includes water source testing, soil testing, and air testing.
[0003] During the monitoring process, the environmental information collected needs to be stored in the form of data and named in a specific format and stored in the data acquisition instrument for quick retrieval. There are many problems with the data acquisition equipment and file formats currently used in environmental monitoring, as follows:
[0004] 1. Lack of versatility: Monitoring different pollutants requires different collection equipment, which increases costs and operational complexity.
[0005] 2. Data security risks: The encryption measures of existing file formats are weak, and data is vulnerable to attacks, affecting the authenticity and reliability of the data.
[0006] 3. Low storage efficiency: The data storage format is unreasonable, occupies a large space and has a slow transmission speed.
[0007] 4. Inconvenient management: Lack of unified and efficient data management methods is not conducive to data analysis and application.
[0008] Therefore, a dedicated encrypted file format for a universal water, air, sound and slag pollutant data collector is proposed. Summary of the invention
[0009] The purpose of the present invention is to provide a dedicated encrypted file format for a universal water, gas, sound and slag pollutant data collector to solve the problems raised in the above-mentioned background technology.
[0010] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: a dedicated encrypted file format for a universal water, gas, sound and slag pollutant data collector, including a file header setting segment, a data storage format definition segment, a self-checking segment, and an encryption algorithm segment. These file structures are sequentially stored in the file to form a dedicated encrypted file format for a universal water, gas, sound and slag pollutant data collector;
[0011] The file header setting section includes a magic number, a version number, a collection timestamp, a device identifier, and file attributes, where:
[0012] Magic number: As an identifier of the file format, it uses a unique byte sequence: "0x5A 0x4C0x4C 0x5A0x70" to quickly identify the .llzip file format and prevent misidentification of other file types;
[0013] Version number: records the version information of the file format so as to facilitate compatibility processing in subsequent upgrades;
[0014] Collection timestamp: Accurately record the start and end time of data collection in Unix timestamp format, accurate to the second, to facilitate time series analysis and management of data;
[0015] Device identifier: a unique identifier bound to the data collector hardware, used to trace the data source and device status;
[0016] File attributes: including data type, data compression flag, encryption flag and other information, expressed in the form of bytes, occupying one byte to generate data;
[0017] The data storage format definition section adopts an XML-based structured storage method to describe each pollutant data in detail;
[0018] The self-check segment is a CRC32 check value added at the end of the file, through which the integrity check of the data can be calculated for each data block;
[0019] The encryption algorithm section uses the AES symmetric encryption algorithm for data encryption processing.
[0020] Preferably, in the above data storage format definition segment, environmental characteristic data such as water quality data, gas data, sound data and waste residue data are stored according to corresponding structures to ensure data clarity and readability, while facilitating subsequent data analysis and processing.
[0021] Preferably, in the above data storage format definition segment, for numerical data, binary storage is adopted, and the precision and unit information of the data are recorded in the file.
[0022] Preferably, in the above data storage format definition segment, time series data is stored in chronological order and indexed to facilitate fast retrieval and query of data in a specific time period.
[0023] Preferably, during the file generation process, the above-mentioned self-check segment performs CRC32 calculation on the entire file to obtain a 32-bit check value, and stores it at the end of the file. When reading the file, the CRC32 check value of the file is recalculated and compared with the check value stored at the end of the file. If the two are consistent, it means that the file has not been damaged or tampered with during the transmission or storage process. If they are inconsistent, it indicates that there may be problems with the file and further inspection or data re-acquisition is required.
[0024] Preferably, in addition to the CRC32 check in the above self-check segment, a data integrity check code is also embedded in the file. During the data collection and storage process, a check code is calculated for each data block according to the algorithm and stored together with the data. When reading the data, the check code of the data block is recalculated and compared with the stored check code to ensure the integrity of the data.
[0025] Preferably, the above encryption algorithm segment uses a randomly generated key to encrypt data during the encryption process. The key is generated using a high-strength random number generator to ensure the randomness and security of the key. The key length is 256 bits to provide sufficient encryption strength.
[0026] Preferably, in order to ensure the secure transmission and storage of the key in the above encryption algorithm segment, the RSA asymmetric encryption algorithm is used to encrypt the AES key. After generating the AES key, the collector uses the recipient's public key to encrypt the AES key, and stores the encrypted key together with the encrypted data in the .llzip file. When reading the file, the recipient uses his own private key to decrypt the encrypted AES key, and then uses the decrypted AES key to decrypt the data.
[0027] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:
[0028] 1. Data security: The exclusive encrypted file format uses a variety of encryption and verification measures to ensure the security and integrity of data during transmission and storage, and prevent data from being tampered with and stolen.
[0029] 2. Efficient storage and retrieval: Reasonable data storage format and index design improve data storage efficiency and retrieval speed, and facilitate data management and analysis.
[0030] 3. Self-checking function: Through CRC32 checksum and data integrity check code, file damage or data tampering can be detected in time to ensure data reliability.
[0031] 4. Scalability: XML-based structured storage and open file format design facilitates the subsequent addition of new pollutant parameters or functional expansion, and has good scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 This is a schematic diagram of the composition of the exclusive encrypted file format of this universal water, air, sound and slag pollutant data collector. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the conditions under which this application can be implemented. Therefore, they have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size should still fall within the scope of the technical content disclosed in this application without affecting the effects and purposes that can be achieved by this application.
[0036] Example
[0037] See also Figure 1 The present invention provides a technical solution: a dedicated encrypted file format for a universal water, gas, sound and slag pollutant data collector, including a file header setting segment, a data storage format definition segment, a self-checking segment, and an encryption algorithm segment. These file structures are sequentially stored in the file to form a dedicated encrypted file format for a universal water, gas, sound and slag pollutant data collector;
[0038] Specifically, the file header setting segment includes a magic number, a version number, a collection timestamp, a device identifier, and file attributes, where:
[0039] Magic Number: As an identifier of the file format, it uses a unique byte sequence: "0x5A0x4C 0x4C 0x5A 0x70" to quickly identify the .llzip file format and prevent misidentification of other file types;
[0040] Version number: records the version information of the file format to facilitate compatibility processing in subsequent upgrades, such as "V1.0".
[0041] Collection timestamp: Accurately record the start and end time of data collection in Unix timestamp format, accurate to seconds, to facilitate time series analysis and management of data.
[0042] Device ID: A unique identifier bound to the data collector hardware, used to trace the source of data and device status, such as a string of numbers and letters.
[0043] File Attributes: including data type (classification marks such as water, gas, sound, and slag), data compression flag, encryption flag, etc., expressed in the form of bytes and occupying one byte. For example, in the binary "00001010", the first bit from right to left indicates whether it is encrypted (1 is encrypted, 0 is not encrypted), the second bit indicates whether it is compressed (1 is compressed, 0 is not compressed), and the third and fourth bits indicate the data type (00 is water, 01 is gas, 10 is sound, and 11 is slag).
[0044] The data storage format definition section uses a structured storage method based on XML (Extensible Markup Language) to describe each pollutant data in detail. For example, for water quality data, the storage format is as follows:
[0045]
[0046] Gas data, sound data and waste residue data are also stored according to corresponding structures to ensure the clarity and readability of the data, while facilitating subsequent data analysis and processing.
[0047] In order to improve storage efficiency, binary storage is used for numerical data, and the precision and unit information of the data are recorded in the file. For example, temperature data is stored in the binary format of the "float32" type, and the unit is indicated as "℃" in the file.
[0048] For time series data, it is stored in chronological order and indexed to quickly retrieve and query data in a specific time period. The index information is stored in the file header, including the offset and data length of the data at each time point.
[0049] The self-check segment adds a CRC32 (cyclic redundancy check) check value at the end of the file. During the file generation process, CRC32 calculation is performed on the entire file (except the magic number and the CRC32 check value itself) to obtain a 32-bit check value, which is stored at the end of the file. When reading the file, the CRC32 check value of the file is recalculated and compared with the check value stored at the end of the file. If the two are consistent, it means that the file has not been damaged or tampered with during the transmission or storage process. If they are inconsistent, it indicates that there may be problems with the file and further inspection or data re-acquisition is required.
[0050] In addition to the CRC32 checksum, a data integrity checksum is also embedded in the file. During data collection and storage, a checksum is calculated for each data block according to a certain algorithm (such as a hash algorithm) and stored together with the data. When reading data, the checksum of the data block is recalculated and compared with the stored checksum to ensure data integrity.
[0051] The encryption algorithm section uses the AES (Advanced Encryption Standard) symmetric encryption algorithm to encrypt the data in the file. The AES algorithm has the characteristics of fast encryption speed and high security, and is suitable for encrypting large amounts of data.
[0052] Specifically, during the encryption process, a randomly generated key is used to encrypt the data. The key is generated using a high-intensity random number generator to ensure the randomness and security of the key. The key length is 256 bits to provide sufficient encryption strength. In order to ensure the safe transmission and storage of the key, the RSA (Rivest-Shamir-Adleman) asymmetric encryption algorithm is used to encrypt the AES key. After the collector generates the AES key, it uses the recipient's public key (obtained in advance through a secure channel) to encrypt the AES key, and stores the encrypted key together with the encrypted data in a .llzip file. When the recipient reads the file, it uses its own private key to decrypt the encrypted AES key, and then uses the decrypted AES key to decrypt the data.
[0053] Working principle: First, perform software programming and configuration. Perform software programming and configuration on the data acquisition instrument. Specifically, write the firmware program of the acquisition instrument, use programming languages (such as C++, Python, etc.) to develop file generation programs, and be responsible for encapsulating and encrypting the collected data in .llzip file format. Input the written program into the data acquisition instrument to realize the automatic identification and data acquisition functions of the sensor. The program should include the communication protocols and drivers of various sensors to communicate with different types of sensors. Then input the intelligent data preprocessing algorithm into the data acquisition instrument to process the collected raw data in real time to improve the data quality. Finally, perform data configuration. Configure the device identifier and default acquisition parameters in the acquisition instrument, such as acquisition frequency, data accuracy, etc. These parameters can be modified and set through the host computer software. After completing the writing work, the system needs to be integrated and tested, as follows:
[0054] System Integration:
[0055] Connect the data acquisition instrument to the sensor and conduct actual data acquisition tests to ensure that the data acquisition instrument can correctly identify and collect data from various sensors and transmit the data to the host computer;
[0056] Install the file generation and reading program on the host computer, store and read the collected data in .llzip file format, and verify whether the file generation, encryption, transmission and decryption process is correct and whether the data is complete. The specific test plan is as follows:
[0057] Functional testing: testing the sensor connection function, data acquisition function, data preprocessing function and various functions of the file format of the data collector, such as reading the file header, parsing the data storage format, encryption and decryption functions, etc., to ensure that the system can work normally according to the design requirements;
[0058] Performance testing: testing performance indicators such as the speed and accuracy of data collection, the efficiency of file storage and transmission, and the time consumption of encryption and decryption, evaluating the performance of the system in actual applications, identifying possible performance bottlenecks and optimizing them;
[0059] Security testing: Simulate various security attack scenarios, such as data tampering and key theft, to verify the security and anti-attack capabilities of the system, check the strength of the encryption algorithm and the effectiveness of the verification mechanism, and ensure that data security protection measures are reliable;
[0060] Compatibility testing: Test the compatibility of the system on different operating systems (such as Windows, Linux, Mac OS, etc.) and hardware platforms to ensure that the system can run stably in various common environments and meet the needs of different users. Finally, analyze and improve the system based on the test results.
[0061] During sampling, environmental data is collected through a data acquisition instrument, and the collected raw data is filtered, denoised, calibrated and processed in real time to improve data quality and prepare for subsequent data storage and analysis. Then, the file header is generated in the program, including the magic number, version number, collection timestamp, device identifier and file attribute settings. According to the collected data type, the relevant information in the file attributes is correctly filled in. After completion, the data is converted into XML format and stored in binary according to the defined data storage format. For numerical data, it is converted and stored according to the specified precision and unit. During the storage process, the data integrity check code is calculated for each data block and stored together with the data. Then, an AES encryption key is generated and the data is encrypted using the key. Then, the AES key is RSA encrypted using the recipient's public key, and the encrypted key and encrypted data are written to the file together, and a CRC32 checksum value is added to the end of the file to complete the file generation.
[0062] When accessing data, the file is read and decrypted, the data information is read, and the data is decrypted, checked, and analyzed by algorithms to obtain usable data. The specific steps are as follows:
[0063] Read file header: The program first reads the file header, verifies the magic number and version number, ensures the correctness of the file format, and then obtains information such as device identifier, acquisition timestamp, and file attributes to prepare for subsequent data processing;
[0064] Data decryption and verification: Use the recipient's private key to decrypt the encrypted AES key to obtain the AES key, and then use the AES key to decrypt the encrypted data to obtain the original data. During the decryption process, perform data integrity verification on each data block to ensure data integrity;
[0065] Data parsing: According to the data storage format, parse the data in XML format and convert it into a usable data structure for data analysis and application.
[0066] In summary, the use of exclusive encrypted file formats adopts multiple encryption and verification measures to ensure the security and integrity of data during transmission and storage, prevent data tampering and theft, and reasonable data storage format and index design improve data storage efficiency and retrieval speed, facilitate data management and analysis, and use CRC32 checksum and data integrity check code to detect file damage or data tampering in a timely manner to ensure data reliability. The XML-based structured storage method and open file format design facilitate the subsequent addition of new pollutant parameters or function extensions, and have good scalability.
[0067] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present invention may be combined and / or combined in various ways, even if such combinations and / or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments and / or claims of the present invention may be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All of these combinations and / or combinations fall within the scope of the present invention.
Claims
1. A dedicated encrypted file format for a universal water, air, sound and slag pollutant data collector, characterized in that: The file structures including the file header setting section, the data storage format definition section, the self-checking section, and the encryption algorithm section are stored in the file in sequence to form a dedicated encrypted file format for the universal water, gas, sound, and slag pollutant data acquisition instrument; The file header setting section includes a magic number, a version number, a collection timestamp, a device identifier, and file attributes, where: Magic number: As an identifier of the file format, it uses a unique byte sequence: "0x5A 0x4C0x4C 0x5A0x70" to quickly identify the .llzip file format and prevent misidentification of other file types; Version number: records the version information of the file format so as to facilitate compatibility processing in subsequent upgrades; Collection timestamp: Accurately record the start and end time of data collection in Unix timestamp format, accurate to the second, to facilitate time series analysis and management of data; Device identifier: a unique identifier bound to the data collector hardware, used to trace the data source and device status; File attributes: including data type, data compression flag, encryption flag and other information, expressed in the form of bytes, occupying one byte to generate data; The data storage format definition section adopts an XML-based structured storage method to describe each pollutant data in detail; The self-check segment is a CRC32 check value added at the end of the file, through which the integrity check of the data can be calculated for each data block; The encryption algorithm section uses the AES symmetric encryption algorithm for data encryption processing.
2. According to claim 1, the exclusive encrypted file format of the universal water, air, sound and slag pollutant data collector is characterized by: In the data storage format definition section, environmental characteristic data such as water quality data, gas data, sound data and waste residue data are stored according to corresponding structures to ensure the clarity and readability of the data and facilitate subsequent data analysis and processing.
3. The exclusive encrypted file format of the universal water, air, sound and slag pollutant data collector according to claim 2 is characterized by: In the data storage format definition section, for numerical data, binary storage is adopted, and the precision and unit information of the data are recorded in the file.
4. The exclusive encrypted file format of the universal water, air, sound and slag pollutant data collector according to claim 3 is characterized by: In the data storage format definition section, time series data is stored in chronological order and indexed to facilitate rapid retrieval and query of data in a specific time period.
5. The exclusive encrypted file format of the universal water, air, sound and slag pollutant data collector according to claim 1 is characterized by: During the file generation process, the self-check segment performs CRC32 calculation on the entire file to obtain a 32-bit check value, and stores it at the end of the file. When reading the file, the CRC32 check value of the file is recalculated and compared with the check value stored at the end of the file. If the two are consistent, it means that the file has not been damaged or tampered with during the transmission or storage process. If they are inconsistent, it indicates that there may be problems with the file and further inspection or data re-acquisition is required.
6. The exclusive encrypted file format of the universal water, air, sound and slag pollutant data collector according to claim 5 is characterized by: In addition to the CRC32 check, the self-check segment also embeds a data integrity check code in the file. During data collection and storage, a check code is calculated for each data block according to the algorithm and stored together with the data. When reading data, the check code of the data block is recalculated and compared with the stored check code to ensure data integrity.
7. The exclusive encrypted file format of the universal water, air, sound and slag pollutant data collector according to claim 1 is characterized by: During the encryption process, the encryption algorithm segment uses a randomly generated key to encrypt data. The key is generated using a high-strength random number generator to ensure the randomness and security of the key. The key length is 256 bits to provide sufficient encryption strength.
8. The exclusive encrypted file format of the universal water, air, sound and slag pollutant data collector according to claim 7 is characterized by: In order to ensure the secure transmission and storage of the key in the encryption algorithm section, the RSA asymmetric encryption algorithm is used to encrypt the AES key. After the collector generates the AES key, it uses the recipient's public key to encrypt the AES key and stores the encrypted key together with the encrypted data in the .llzip file. When reading the file, the recipient uses his own private key to decrypt the encrypted AES key, and then uses the decrypted AES key to decrypt the data.
Citation Information
Cited By
Encryption method and device suitable for large file, computer equipment and storage medium
CN120358101A
Encryption method, device, computer equipment and storage medium suitable for large files
CN120358101B