An internet of things sensor monitoring data encryption and storage processing method

By combining multiple obfuscation encryption methods with a database storage scheme, the problem of IoT sensor monitoring data being easily tampered with is solved, achieving efficient data storage and security protection, and improving the reliability of coal mine safety production.

CN119203193BActive Publication Date: 2026-02-27CHINA COAL TECH & ENG GRP CHONGQING RES INST CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411359095.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2026-02-27
Estimated Expiration
2044-09-27

AI Technical Summary

Technical Problem

Existing encryption methods for IoT sensor monitoring data suffer from problems such as easy repetition of ciphertext, strong regularity, high likelihood of ciphertext being cracked, low query efficiency, and inability to effectively prevent data from being arbitrarily tampered with, which affects coal mine safety production.

Method used

A multi-layered obfuscation encryption method combining MD5 message digest algorithm, array rearrangement calculation and CRC cyclic redundancy check algorithm is adopted to generate obfuscated ciphertext of sensor monitoring data, which is then stored in TDengine time series database and MySQL relational database. Through multi-layered encryption of enterprise, equipment and data identification information, data security and query efficiency are ensured.

Benefits of technology

It improves data storage and retrieval efficiency, enhances data anti-tampering capabilities, ensures the security and integrity of coal mine sensor monitoring data, and prevents data from being arbitrarily tampered with.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119203193B_ABST
    Figure CN119203193B_ABST
Patent Text Reader

Abstract

The application relates to a kind of Internet of Things sensor monitoring data encryption and storage processing methods, belong to Internet of Things sensor monitoring data acquisition, storage and application field.It includes: establishing enterprise identification information, equipment identification information and data identification information, and adding identification information to the monitoring data information obtained;Monitoring data information is encrypted by multiple confusion encryption method, and finally the confusion ciphertext is output;Establish a time series database to store real-time monitoring data, and establish a relational database to store abnormal monitoring data and related data;When decryption is needed, the real-time monitoring value is multiple confusion encrypted in an enumerated manner according to the enterprise identification information, equipment identification information and data identification information, and the real-time monitoring value before encryption is determined according to the ciphertext.The application solves the problems of easy repetition and strong regularity of ciphertext, improves data storage and retrieval efficiency, prevents data from being tampered with with the help of ciphertext information, and improves data security protection capability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of Internet of Things sensor monitoring data collection, storage and application, and relates to an Internet of Things sensor monitoring data encryption and storage processing method. BACKGROUND

[0002] With the continuous advancement of the nationwide intelligent mine construction work, various Internet of Things sensors such as toxic and harmful gas monitoring, personnel position and health information monitoring, and mechanical and electrical equipment working condition monitoring are widely used, and coal mine monitoring data is showing explosive growth. Especially in some large coal enterprise groups, the real-time monitoring data generated by sensors per second varies from tens of thousands to hundreds of thousands, and the existing mainstream relational databases are difficult to meet the requirements of data collection, processing, storage and query analysis.

[0003] Coal mining enterprises are the main body of safety production guarantee and the owner of enterprise data assets, and have the highest authority of various information systems, databases and data management platforms, which cannot fundamentally prevent the illegal behavior of tampering with data by enterprises. In order to pursue economic benefits, some enterprises engage in illegal production, maliciously tamper with sensor monitoring data, evade industry supervision, cause various safety accidents, cause heavy casualties and economic losses, and have a very bad influence. Therefore, it is particularly important to improve the processing efficiency of Internet of Things sensor monitoring data and prevent data from being tampered with at will.

[0004] Due to the performance bottleneck of relational databases in processing massive sensor time series data and the requirement of monitoring business efficient processing, a few fields are simply encrypted by using the encryption function, MD5 or RSA encryption algorithm provided by the database, which has the weaknesses of ciphertext repetition, strong regularity, etc. The possibility of ciphertext cracking is large, the record is often tampered with and not easy to find, the encryption effect is not good, and the query efficiency is low. SUMMARY

[0005] Therefore, the purpose of the present application is to provide an Internet of Things sensor monitoring data encryption and storage processing method, which uses a data confusion encryption method combining MD5 information digest algorithm, array rearrangement calculation and CRC cyclic redundancy check algorithm to generate sensor monitoring data ciphertext information. The TDengine time series database super table scheme is used to store massive real-time monitoring data and ciphertext information of sensors, and MySQL and other relational databases are used to store abnormal monitoring data and ciphertext information, device definition data and dictionary code table and other data. The problems of easy repetition and strong regularity of ciphertext in the existing encryption method are solved, the data storage and retrieval efficiency is improved, the data is prevented from being tampered with at will by means of ciphertext information, and the data security protection capability is improved.

[0006] To achieve the above purpose, the present application provides the following technical scheme:

[0007] A method for monitoring data encryption and storage of Internet of Things sensors, comprising the following steps:

[0008] S1, establishing enterprise identification information, device identification information and data identification information, and adding identification information to the obtained monitoring data information;

[0009] S2, encrypting the monitoring data information by a multi-confusion encryption method, and finally outputting the confusion ciphertext;

[0010] S3, establishing a time series database to store real-time monitoring data, and establishing a relational database to store abnormal monitoring data and related data;

[0011] S4, when decryption is needed, the real-time monitoring value is encrypted in an enumerated manner according to the enterprise identification information, device identification information and data identification information, the ciphertexts are compared to determine the real-time monitoring value before encryption.

[0012] Further, in step S1, the established enterprise identification information includes enterprise name, unified social credit code, coal mine code and globally unique identifier, wherein the globally unique identifier is a digital identifier generated by an algorithm, and the globally unique identifier is used as the first key in the subsequent encryption process;

[0013] The established device identification information includes the system number of the sensor device, the device code and the installation address of the sensor device;

[0014] The established data identification information includes at least real-time monitoring data identification information and abnormal monitoring data identification information.

[0015] Further, the real-time monitoring data identification information includes the timestamp of the sensor device data generation, the real-time monitoring value and the real-time state value, wherein the timestamp is in the format of "yyyy-MM-dd HH:mm:ss.fff", wherein "yyyy" represents the year, "MM" represents the month, "dd" represents the day, "HH" represents the hour part, "mm" represents the minute part, "ss" represents the second part, and "fff" represents the millisecond part;

[0016] The abnormal monitoring data identification information is calculated from the real-time data generated by the sensor device, which includes the abnormal start time, the abnormal end time, the abnormal state value, the maximum value during the abnormal period, the maximum value time mark, the minimum value during the abnormal period, the minimum value time mark, the average value, and the timestamp of the corresponding record generation.

[0017] Further, in step S2, the enterprise identification information, device identification information and data identification information are spliced and combined into the original plaintext, and the encryption process includes at least six times of encryption, wherein:

[0018] The first re-encryption process is: using MD5 information digest algorithm, the original plaintext is generated as a digest ciphertext; the first re-encryption takes the original plaintext as input, takes the globally unique identifier as the first key, and outputs a 32-bit hexadecimal number string after digest encryption;

[0019] The second re-encryption process is: according to the randomly generated 32-bit confusion integer array, the characters in the 32-bit MD5 ciphertext string are rearranged according to the integer in the array corresponding to each index; the second re-encryption takes the 32-bit hexadecimal number string after the first re-encryption as input, takes the randomly generated 32-bit confusion integer array composed of non-repeating integers from 0 to 31 as the second key, and outputs a 32-bit ciphertext string after rearrangement;

[0020] The third re-encryption process is: according to the random integer corresponding to the 4-bit complement confusion integer array, select the characters at the corresponding 4 random integer positions from the 128-bit binary string and supplement them at the end of the 128-bit binary string to form a 132-bit string; the third re-encryption takes the 32-bit ciphertext string after rearrangement as input, takes the randomly generated 4-bit complement confusion integer array composed of non-repeating integers from 0 to 127 as the third key, and outputs a 132-bit binary number string;

[0021] The fourth re-encryption process is: the 132-bit binary number string is rearranged according to the index order of the confusion array; the fourth re-encryption takes the 132-bit binary number string as input, takes the randomly generated 132-bit confusion integer array composed of non-repeating integers from 0 to 131 as the fourth key, and outputs a 132-bit binary number string after confusion sorting;

[0022] The fifth re-encryption process is: using CRC cyclic redundancy check algorithm and selecting 12-bit CRC check code, 12-bit binary remainder is obtained by XOR operation, which is supplemented at the end of the confusion sorted 132-bit binary number string to form a 144-bit binary number string; the fifth re-encryption takes the confusion sorted 132-bit binary number string as input, takes the 12-bit CRC check code as the fifth key, and outputs a 144-bit binary number string with CRC check result;

[0023] The sixth re-encryption process is: using the array rearrangement calculation method, the Base64 encoding table characters are reordered and sorted to form a private encoding dictionary, and then using the Base64 encoding method, the 144-bit binary number string with CRC check result is converted into a 24-bit visible string; the sixth re-encryption takes the 144-bit binary number string with CRC check result as input, takes a randomly generated 64-bit confusion integer array composed of non-repeating integers from 0 to 63 as the sixth key, and outputs the final confusion ciphertext.

[0024] Further, the array rearrangement method in the multiple encryption process is as follows: for an array a = [a0, a1, …, an-1], a random algorithm is used to generate an n-bit non-repeating disorder index array b = [b0, b1, …, bn-1] composed of integers 0 ~ (n-1), and the rearranged new array is represented as c = [c0, c1, …, cn-1], wherein the element c n-1 in the array has: n-1 n-1 i

[0025]

[0026] In the formula, i ∈ [0, n-1], i is an integer.

[0027] Further, in step S3, a real-time monitoring data super table is designed, wherein the real-time monitoring data super table includes a label column and a data column, the label column includes sensor device encoding and installation address, and the data column includes collection time, monitoring value, value meaning, value state, and a cipher field.

[0028] Further, the data column of the real-time monitoring data super table includes a cipher field CipherText, and the encrypted input data identification information includes data generation time DataGenTime, real-time monitoring value RealtimeValue, monitoring value meaning MeaningValue, monitoring value state StateId, and their corresponding data types; the label column includes device installation location InstallAddr, system number SystemId, and their corresponding data types.

[0029] Further, in step S3, a relational database is established, wherein the relational database at least stores abnormal monitoring data, sensor device definition data, code table dictionary data, measurement point definition data, and abnormal treatment measures; the sensor device definition data includes its corresponding manufacturer, specification model, monitored physical quantity and unit, and device type; the code table dictionary data includes device system coding dictionary table, device type coding dictionary table, measurement point abnormal state coding dictionary table, and measurement point relationship table; the measurement point definition data includes measurement point state change record data table and measurement point abnormal monitoring data table generated by secondary analysis statistics according to device state; and the abnormal treatment measures are the treatment schemes corresponding to the abnormal monitoring data.

[0030] ​​​Further, the abnormal monitoring data table includes a cipher text field CipherText, which encrypts the input data identification information, including data generation time DataGenTime, abnormal start time StartTime, abnormal end time EndTime, abnormal state value StatusId, maximum value during abnormal period MaxValue, maximum value time MaxTime, minimum value during abnormal period MinValue, minimum value time MinTime, average value AvgValue, device measurement point code DeviceCode, self-increment field RowId, and their corresponding data types and column categories.

[0031] Further, in step S4, under the condition that all keys are known, according to the enterprise identification information, the device identification information and the data identification information, the enumeration real-time monitoring value is calculated and the confusion encryption is calculated, the confusion cipher texts are compared in a loop, if the confusion cipher texts are the same, the current enumeration monitoring value is the sensor monitoring data value before encryption, if the confusion cipher texts are not the same, the confusion encryption comparison is repeated until the confusion cipher texts are the same.

[0032] The present application has the following beneficial effects:

[0033] The present application groups and perfects the coal mine enterprise identification information, the sensor device identification information and the data identification information, uses 6 groups of keys, fuses the MD5 information digest algorithm, the array rearrangement calculation method, the Base64 encoding method and the CRC cyclic redundancy check algorithm, generates the coal mine sensor monitoring data confusion cipher text, and prevents the data from being tampered at will.

[0034] The present application stores the sensor time series data based on the time series database super table according to the data size and the use scene, uses the relational database to store the sensor abnormal data, the definition information, the dictionary code table and other non-real-time monitoring data. Based on the confusion encryption method, the cipher text field is added in the real-time monitoring data table and the abnormal data table respectively, the monitoring data and the confusion cipher text are stored, the data tamper-proofing and inspection means are increased, and the system operation efficiency and the system security are improved.

[0035] Other advantages, objects, and features of the present application will be apparent to those skilled in the art from the following specification, which is to be taken in conjunction with the accompanying drawings, wherein: BRIEF DESCRIPTION OF DRAWINGS

[0036] In order to make the objects, technical solutions and advantages of the present application clearer, the preferred detailed description of the present application will be made below in conjunction with the drawings, wherein:

[0037] Figure 1A schematic diagram of the overall process for obfuscated encryption;

[0038] Figure 2 A schematic diagram of the specific process for multiple encryption in the obfuscated encryption process;

[0039] Figure 3 A schematic diagram of the data reorganization process in the multiple encryption process;

[0040] Figure 4 A schematic diagram of the encrypted data storage architecture;

[0041] Figure 5 A schematic diagram of the data decryption process. DETAILED DESCRIPTION

[0042] The advantages and effects of the present application can be easily understood by those skilled in the art from the disclosure of the present specification. The present application can also be implemented or applied in other different specific embodiments, and various modifications or changes can be made to the details in the specification based on different views and applications without departing from the spirit of the present application. It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0043] The accompanying drawings are only used for exemplary illustration, and the representations are only schematic diagrams, not physical diagrams, and cannot be understood as limitations of the present application; in order to better illustrate the embodiments of the present application, some components in the drawings can be omitted, enlarged or reduced, and do not represent the actual size of the product; it can be understood by those skilled in the art that some well-known structures and their descriptions in the drawings can be omitted.

[0044] The same or similar reference numerals in the drawings of the embodiments of the present application correspond to the same or similar components; in the description of the present application, it should be understood that the orientations or positional relationships indicated by terms such as "upper", "lower", "left", "right", "front", "back" and the like are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore the terms describing the positional relationship in the drawings are only used for exemplary illustration, and cannot be understood as limitations of the present application, and for those skilled in the art, the specific meanings of the above terms can be understood according to the specific circumstances.

[0045] Please refer to Figures 1 to 5 , a method for monitoring and storing data of an Internet of Things sensor.

[0046] Embodiment 1

[0047] The embodiment provides a method for encrypting and storing monitoring data of an Internet of Things sensor for a smart mine, which comprises the following steps:

[0048] S1, establishing enterprise identification information, device identification information and data identification information, and adding identification information to acquired monitoring data information;

[0049] S2, encrypting the monitoring data information through a multiple confusion encryption method, and finally outputting confusion ciphertext;

[0050] S3, establishing a time series database to store real-time monitoring data, and establishing a relational database to store abnormal monitoring data and related data;

[0051] S4, when decryption is needed, the real-time monitoring value is decrypted in an enumerated manner according to the enterprise identification information, the device identification information and the data identification information, and whether the ciphertext after encryption is consistent is determined to determine the real-time monitoring value before encryption.

[0052] In step S1, the coal mine sensor monitoring data has typical time series data characteristics, and the data is continuously generated according to the characteristics of real-time, rapid, ordered, stable, massive and the like, and is uploaded to the ground monitoring and control system through the underground ring network. The sensors used in the mine mainly include methane, carbon monoxide, carbon dioxide, hydrogen sulfide, oxygen, temperature, smoke, support working resistance, anchor rod (cable) stress, dust, water level, water inflow and other gas, fire, roof, dust, hydrological and various disaster monitoring sensors, and device start-stop, voltage, current, vibration, fault and other mechanical and electrical equipment working condition monitoring sensors.

[0053] According to the needs of coal mine enterprise safety production and national mine safety supervision and regulation, and relevant regulations, the coal mine enterprise must save the monitoring and control data in real time and complete according to the standard specification requirements, and timely upload to the superior company and the supervision and regulation department. Complete record sensor measuring point number, installation address, measuring point type, real-time data, data generation time stamp and measuring point data state and other information, as well as measuring point abnormal statistical information, including abnormal start time, abnormal end time, maximum value during abnormal period, maximum value generation time, minimum value during abnormal period, minimum value generation time, average value during abnormal period, abnormal type and other information.

[0054] Based on this, in step S1, the enterprise identification information, the device identification information and the data identification information are first established, specifically:

[0055] The enterprise identification information is composed of enterprise name, unified social credit code, coal mine code and globally unique identifier (GUID). The enterprise name and unified social information code are registered and published by the industrial and commercial management department, and the unified social information code is composed of 18 Arabic numerals or capital English letters, and the code of different enterprises is unique. The coal mine code is consistent with the coal mine code in the coal mine basic data management module of the national mine safety supervision bureau mine safety production comprehensive information system, which is composed of 12 Arabic numerals, and each coal mine code is unique. The coal mine enterprise name, unified social information code and coal mine code have been published to the society, which can be obtained through public channels or coal mine enterprise inquiry. The globally unique identifier is a 32-bit hexadecimal number generated by an algorithm, such as "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", where each X is a hexadecimal number in the range of 0-9 or A-F (when used, it does not contain the "-" string, and all are converted to uppercase letters). In this scheme, a different globally unique identifier is randomly generated for each coal mine in the country by a computer program, which is used as the first key of the scheme, i.e. key 1.

[0056] The device identification information is composed of the system number of the sensor device, the device code and the installation address of the sensor device. The system number is composed of 4 Arabic numerals, ranging from 0001 to 9999; the device code is defined by the coal mine, with a length of not less than 8 digits, and is unique in the whole mine, otherwise it is filled with the English letter D on the left side; the installation address of the sensor device is defined by the mine, with a length of not less than 4 digits, otherwise it is filled with the English letter A on the right side.

[0057] The data identification information includes at least real-time monitoring data identification information and abnormal monitoring data identification information. According to the different types of data, the composition of the data identification information can also be different.

[0058] The real-time monitoring data identification information is composed of the timestamp of the sensor device data generation, the real-time monitoring value and the real-time state value. The timestamp is represented in the format of yyyy-MM-dd HH:mm:ss.fff, where "yyyy" represents the year, "MM" represents the month, "dd" represents the day, "HH" represents the hour part, "mm" represents the minute part, "ss" represents the second part, and "fff" represents the millisecond part, such as 2024-08-15 07:22:34.033, which represents the time of 2024-08-15 07:22:34.033. According to actual needs, you can choose whether to use the ".fff" three-bit millisecond part data. Combined with the actual business needs of coal mines and industry identification specifications, the real-time monitoring data can have a maximum of 4 significant digits after the decimal point.

[0059] The abnormal monitoring data identification information is formed by calculating a series of real-time data generated by the sensor device, and contains abnormal start time, abnormal end time, abnormal state value, abnormal period maximum value, maximum value time mark, abnormal period minimum value, minimum value time mark, average value, and the time stamp of the record generation. The time field in the abnormal data is represented in the same way as the real-time monitoring data time field. The number of significant digits after the decimal point in the maximum value field in the abnormal data is the same as the real-time monitoring value field in the real-time monitoring data.

[0060] In order to ensure the uniqueness of each monitoring data of different sensors in different coal mine enterprises, the input monitoring data information is composed of enterprise identification information, device identification information and data identification information, and the information is connected by a semicolon.

[0061] In step S2, a combination of MD5 information digest algorithm, random array confusion algorithm, CRC checksum and Base64 encoding conversion method is used to realize multiple encryption of sensor monitoring data, and then generate the confusion ciphertext of the data. The encryption process consists of three parts: parameter input, verification calculation and ciphertext output, as shown in the flowchart Figure 1 The scheme selects a combination of multiple confusion encryption methods to realize confusion encryption of sensor monitoring data. The entire encryption process uses MD5 information digest algorithm, array rearrangement method, Base64 encoding and CRC checksum algorithm.

[0062] For different coal mines, an independent key set is established, and based on the spliced original plaintext data, the final confusion ciphertext is obtained through multiple confusion encryption methods. The multiple confusion encryption process in step S2 is shown in the flowchart Figure 2 The original plaintext is composed of enterprise identification information, device identification information and data identification information. The internal identification information and multiple identification information are connected by a connector to form a complete string of character plaintext information. The real-time monitoring data, abnormal monitoring maximum value, minimum value and average value in the data identification information are standardized before encryption, i.e. the last 4 digits after the decimal point are filled with 0, and the first 14 digits before the decimal point are filled with 0. The data range meets the needs of coal mine safety production. For example, the real-time monitoring value of the temperature sensor is 23.04℃, which is filled with 2 zeros at the end and 12 zeros at the front, and after standardization, it becomes 000000000000 23.04 00 , where the underscore “ 0 ” represents the newly added characters. In the calculation process, multiple confusion arrays and a 12-bit CRC checksum are used as keys to realize confusion encryption and verification of the ciphertext information. Specifically, it includes at least six encryption processes:

[0063] First encryption calculation:

[0064] Input: raw real-time data or abnormal data information with globally unique identification identifier (GUID). Contains enterprise identification information, device identification information and data identification information. Use string concatenation method to form a complete string between multiple information.

[0065] Key 1: globally unique identification identifier (GUID).

[0066] Calculation process: use MD5 information digest algorithm to generate digest ciphertext from input string.

[0067] Output: 32-bit hexadecimal number string (uppercase).

[0068] Second encryption calculation:

[0069] Input: the result of the first encryption calculation.

[0070] Key 2: 32-bit confusion integer array. Since the 32-bit hexadecimal ciphertext string generated after MD5 information digest algorithm encryption has the possibility of brute force cracking such as exhaustion and dictionary lookup, in order to increase the cracking difficulty, a 32-bit random array composed of 0-31 non-repeating integers is randomly generated.

[0071] Calculation process: according to the randomly generated 32-bit confusion integer array, rearrange the characters in the 32-bit MD5 ciphertext string according to the integer corresponding to each index in the array.

[0072] Output: 32-bit ciphertext string after rearrangement.

[0073] Third encryption calculation:

[0074] Input: the result after the second encryption calculation, the rearranged 32-bit ciphertext string.

[0075] Key 3: 4-bit complement confusion integer array. In order to facilitate the use of Base64 encoding method for conversion, the 32-bit hexadecimal ciphertext string is converted into a 128-bit binary string composed of 0 and 1, and a 4-bit binary string is added to form a 132-bit binary string. A 4-bit random array composed of 0-127 non-repeating integers is randomly generated.

[0076] Calculation process: according to the random integer corresponding to the 4-bit complement confusion integer array, select the characters at the corresponding 4 random integer positions from the 128-bit binary string, and supplement them at the end of the 128-bit binary string to form a 132-bit string.

[0077] Output: 132-bit binary string.

[0078] Fourth encryption calculation:

[0079] Input: the result of the third encryption calculation, a 132-bit binary number string

[0080] Key 4: a 132-bit shuffled integer array. Randomly generate a 132-bit shuffled array composed of non-repeating integers from 0 to 131.

[0081] Calculation process: rearrange the 132-bit binary number string according to the index order of the shuffled array.

[0082] Output: a 132-bit binary number string after shuffled sorting.

[0083] Fifth encryption calculation:

[0084] Input: the result of the fourth encryption calculation, a 132-bit binary number string after shuffled sorting.

[0085] Key 5: 12-bit CRC check code, i.e., the highest power of the check code generation polynomial G(x) is 12.

[0086] Calculation process: To enhance the tamper-proofing ability of the shuffled ciphertext, while meeting the requirements of Base64 encoding and decoding, and to verify whether the ciphertext has been tampered with in time, the scheme adopts the CRC cyclic redundancy check algorithm, and selects a 12-bit CRC check code. Through XOR operation, a 12-bit binary remainder is obtained and supplemented at the end of the string to form a 144-bit binary number string.

[0087] Output: a 144-bit binary number string with CRC check results.

[0088] Sixth encryption calculation:

[0089] Input: the result of the fifth encryption calculation, a 144-bit binary number string with CRC check results.

[0090] Key: a 64-bit shuffled integer array, i.e., randomly generate a 64-bit shuffled array composed of non-repeating integers from 0 to 63, and use the array rearrangement calculation method to reorder the Base64 encoding table characters to form a private encoding dictionary.

[0091] Calculation process: Rearrange the characters corresponding to the encoding table according to the index order of the shuffled array to generate a new encoding dictionary table. On this basis, use the Base64 encoding method to convert the 144-bit binary number string with CRC check results into a 24-bit visible string to form the final shuffled ciphertext.

[0092] Output: a 24-bit ciphertext string.

[0093] The Base64 encoding table is shown in Table 1 below:

[0094] Table 1

[0095] Code value Character Code value Character Code value Character Code value Character 0 A 16 Q 32 g 48 w 1 B 17 R 33 h 49 x 2 C 18 S 34 i 50 y 3 D 19 T 35 j 51 z 4 E 20 U 36 k 52 0 5 F 21 V 37 l 53 1 6 G 22 W 38 m 54 2 7 H 23 X 39 n 55 3 8 I 24 Y 40 o 56 4 9 J 25 Z 41 p 57 5 10 K 26 a 42 q 58 6 11 L 27 b 43 r 59 7 12 M 28 c 44 s 60 8 13 N 29 d 45 t 61 9 14 O 30 e 46 u 62 + 15 P 31 f 47 v 63 /

[0096] The entire multi-confusion encryption calculation process is completed, and the composition and bit number of each key and the number of keys are shown in Table 2:

[0097] Table 2

[0098]

[0099] In the above multi-encryption process, in order to increase the difficulty of ciphertext cracking, the array rearrangement method is used to realize the encryption of the string.

[0100] For the array a = [a0, a1, …, a n-1 ], a non-repeating n-bit random index array b = [b0, b1, …, b n-1 ] composed of integers 0 ~ (n-1) is generated by using a random algorithm, and the rearranged new array is represented as c = [c0, c1, …, c n-1 ], wherein, for the elements c i in the array, there is:

[0101]

[0102] In the formula, i ∈ [0, n-1], i is an integer.

[0103] This embodiment takes an array [a, b, c, d] with a length of 4 as an example, and the confusion process is as follows:

[0104] If a random algorithm is used to generate a 4-bit random index array [3, 0, 2, 1] composed of non-repeating integers 0 ~ 3, the array is rearranged according to the order:

[0105] The value corresponding to the index 0 of the confusion array is 3, so the character “d” with the index 3 in the original array is placed at the index 0 of the newly generated confusion array;

[0106] The value corresponding to the index 1 of the confusion array is 0, so the character “a” with the index 0 in the original array is placed at the index 1 of the newly generated confusion array;

[0107] The value corresponding to the index 2 of the confusion array is 2, so the character “c” with the index 2 in the original array is placed at the index 2 of the newly generated confusion array;

[0108] The value corresponding to the index 3 in the confusion array is 1, so the character "b" at the index 1 in the original array is placed at the index 3 in the newly generated confusion array. The above confusion process is as shown in Figure 3 The larger the array length, the more difficult it is to crack after confusion.

[0109] According to the above manner, there are about 3000 existing coal mines in China at present. From the above analysis, the number of the least number of keys 5 is 4096, which meets the demand of one coal mine corresponding to one different key. The number of the other 5 keys is much larger than the number of existing coal mines in China, and different keys can be used by coal mine enterprises to complete the data encryption calculation process, realizing the uniqueness and universal applicability of all keys. Even if it is for all the industrial and mining enterprises in China, due to the huge number of the other 5 keys, it still has very good global uniqueness and universal usability.

[0110] In the allocation and storage of the six different keys, it can be managed by the superior supervisory department, the coal mine enterprise itself and the information system construction factory and other parties, to ensure the security of the key.

[0111] In step S3, in order to meet the requirements of mass sensor equipment time series data storage and utilization, the scheme adopts a storage architecture combining time series database and relational database, combined with monitoring data confusion ciphertext, to design a coal mine sensor monitoring data storage scheme with tamper-proof capability. The overall architecture is as shown in Figure 4 The combination of time series database and relational database is used to realize the integrated fusion storage of mass Internet of Things sensor real-time monitoring data, abnormal monitoring data and other data. The sensor real-time monitoring data with obvious time series characteristics are stored in the time series database, the abnormal monitoring data based on real-time monitoring data statistical analysis, and the corresponding processing measures, sensor equipment measurement point basic definition information, system number, measurement point type, measurement point abnormal state, measurement point monitoring physical quantity unit, measurement point relationship and other code table dictionary are stored in the relational database.

[0112] Real-time monitoring data, i.e. time series data continuously generated by coal mine Internet of Things sensors, are stored based on TDengine time series database table. A real-time monitoring data super table is designed, which consists of a label column and a data column. The label (TAG) column includes sensor equipment code and installation address, and the data column (COLUMN) consists of collection time, monitoring value, value meaning, value state and ciphertext field. The specific structure is shown in Table 3:

[0113] Table 3

[0114]

[0115] In the TDengine database, a super table represents a set of sensor device data collection points with the same attributes, which contains the common attributes of all device measurement points (such as measurement point number, address, system number, etc.) and the collected quantities (such as real-time monitoring values, value status, etc.). TDengine stores the tag (TAG) attribute column only once and the collected quantity data (COLUMN) column according to different timestamps during data storage. This design not only simplifies table management and facilitates cross-sensor device measurement point aggregation operations, but also reduces the repeated storage of static attributes and improves data processing efficiency. The super table creation statement is as follows:

[0116]

[0117] The CipherText in the table is a ciphertext field, and the encrypted input data identification information includes data generation time, real-time monitoring value, monitoring value meaning, and monitoring value status.

[0118] Taking the gas sensor monitoring point with the number MN001A01 under the safety monitoring system (system code 1001) as an example, a sub-table corresponding to this monitoring point is constructed based on the super table, and the creation statement is as follows:

[0119]

[0120]

[0121] Among them, "MN001A01" is the device code of the gas sensor monitoring point, which is also the table name of the sub-table. The TAG column is the installation address and the system number of the measurement point, respectively. When querying and statistics, you can query multiple points according to the device measurement point data generation time, state, and system to which it belongs. You can also specify a specific sensor device code to query one or more data at a certain time point (or time period) and state.

[0122] Based on the real-time monitoring data generated by the sensor device, according to business needs, in addition to the sensor time series data, there are also definition information of the sensor device, including its corresponding manufacturer, specifications and models, monitoring physical quantity and its unit, device type, and related device system code dictionary table, device type code dictionary table, measurement point abnormal state code dictionary table, measurement point relationship table, etc. Basic tables. In addition, there are measurement point state change record data tables and measurement point abnormal monitoring data tables generated by secondary analysis and statistics according to device state. Since the data stored in these data tables is relatively small, it is designed to be stored in MySQL, SQL Server, or Oracle relational databases, which facilitates data association query and analysis. Taking the abnormal monitoring data table as an example, its data table structure is shown in Table 4:

[0123] Table 4

[0124]

[0125] The abnormality monitoring table creation statement is as follows:

[0126]

[0127] MaxTime DATETIME,

[0128] MinValue FLOAT,

[0129] MinTime DATETIME,

[0130] AvgValue FLOAT,

[0131] DataGenTime DATETIME not null,

[0132] CipherText CHAR(24)not null

[0134] The CipherText in Table 4 is a cipher text field, which encrypts the input data identification information including data generation time, abnormality start time, abnormality end time, abnormality state value, maximum value during abnormality, maximum value time, minimum value during abnormality, minimum value time and average value.

[0135] In step S4, when it is necessary to decrypt the obfuscated cipher text, as shown in Figure 5 under the condition that all keys are known, the enumeration real-time monitoring value is calculated and obfuscated encryption is performed according to the enterprise identification information, device identification information and data identification information, and the obfuscated cipher text is compared with the cipher text stored in the database to determine whether they are the same, that is, the sensor monitoring data value before encryption can be known.

[0136] ​Take the disaster environment monitoring data commonly used in coal mines as an example, methane, oxygen, carbon dioxide and other units are in %, the value is between 0~100; carbon monoxide, hydrogen sulfide and other units are in ppm, the effective monitoring value range of the sensor is between 0~1000; the value range of other switch values and multi-state values may be single digit. According to the confusion encryption calculation process, take the most common methane concentration as an example, the highest alarm power-off value is set to 1.5%, the real-time monitoring value range is between 0~1.5, and after formatting, it is between 000.0000~001.5000; the maximum possible value range is between 0~100, and after formatting, it is between 000.0000~100.0000; the maximum encryption matching times are 15000 times and 1000000 times respectively, and the average time consumed in the decryption process is 0.060 seconds and 4.330 seconds respectively. The decryption speed is fast, which meets the actual supervision and inspection requirements.

[0137] The test results of 10,000 sensor devices show that the average time of 10,000 real-time monitoring data batch storage is less than 0.830 seconds, and the data encryption time accounts for less than 10%. When querying and counting a large amount of data, a sensor device monitoring point generates a real-time monitoring data every 5 seconds, and 10,000 sensor device monitoring points generate about 5 billion data in a super table in a month (30 days), 1 sensor device monitoring point generates about 500,000 data in a sub table, and a monitoring point generates about 17,000 data in a day. The trend curve data query result returns about 1.7 ten thousand data, under the same server resource conditions, compared with MySQL relational database, the query efficiency of TDengine time series database is improved by nearly 40 times, the storage space is reduced by nearly 90%, and the effect is obvious.

[0138] Embodiment 2

[0139] This embodiment proposes a kind of Internet of Things sensor monitoring data safe and efficient processing system for implementing the above method, as shown in Figure 5 It includes Internet of Things sensor device / system, data acquisition module, data encryption module, data writing module, time series database, relational database and data service module, wherein Internet of Things sensor device / system is distributed in each coal mine, data acquisition module is used to collect enterprise identification information, equipment identification information and data identification information, data encryption module is multiple confusion encryption to the collected enterprise identification information, equipment identification information and data identification information to obtain confusion ciphertext, data writing module writes the ciphertext information after encryption into time series database and relational database, data service module is used to query the data in database.

[0140] Finally, it is to be explained that the above embodiments are only used to illustrate the technical solutions of the present application but not to limit the present application. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or equivalently replaced without departing from the purpose and scope of the present application, and all should be covered in the scope of the claims of the present application.

Claims

1. A method for encrypting and storing IoT sensor monitoring data, characterized in that: It includes the following steps: S1. Establish enterprise identification information, equipment identification information, and data identification information, and add identification information to the acquired monitoring data; S2. The monitoring data is encrypted using multiple obfuscation and encryption methods, and the obfuscated ciphertext is finally output. In step S2, the enterprise identification information, equipment identification information, and data identification information are concatenated and combined to form the original plaintext. The encryption process includes at least six layers of encryption, among which: The first encryption process is as follows: using the MD5 message digest algorithm, the original plaintext is converted into a digest ciphertext; the first encryption takes the original plaintext as input, uses the globally unique identifier as the first key, and outputs a 32-bit hexadecimal string after digest encryption. The second encryption process is as follows: Based on a randomly generated 32-bit obfuscated integer array, the characters in the 32-bit MD5 ciphertext string are rearranged according to the integer corresponding to each index in this array; the second encryption takes the 32-bit hexadecimal number string after the first encryption as input, and a randomly generated 32-bit obfuscated integer array consisting of non-repeating integers from 0 to 31 as the second key, and outputs the rearranged 32-bit ciphertext string. The third encryption process is as follows: Based on the random integers corresponding to the 4-bit two's complement obfuscated integer array, characters corresponding to the 4 random integer positions are selected from the 128-bit binary string and appended to the end of the 128-bit binary string to form a 132-bit string; The third encryption takes the rearranged 32-bit ciphertext string as input, takes the randomly generated 4-bit two's complement obfuscated integer array consisting of non-repeating integers from 0 to 127 as the third key, and outputs a 132-bit binary number string; The fourth encryption process is as follows: the string of 132 binary numbers is rearranged according to the index order of the obfuscated array; the fourth encryption takes the 132 binary number string as input, takes a randomly generated 132-bit obfuscated integer array consisting of non-repeating integers from 0 to 131 as the fourth key, and outputs the obfuscated and sorted 132-bit binary number string. The fifth encryption process is as follows: The CRC cyclic redundancy check algorithm is used, and a 12-bit CRC check code is selected. The 12-bit binary remainder is obtained through XOR operation and padded to the end of the 132-bit binary number string after confusion and sorting, forming a 144-bit binary number string. The fifth encryption takes the 132-bit binary number string after confusion and sorting as input, the 12-bit CRC check code as the fifth key, and outputs a 144-bit binary number string with the CRC check result. The sixth encryption process is as follows: using the array rearrangement calculation method, the characters in the Base64 encoding lookup table are rearranged to form a private encoding dictionary. Then, using the Base64 encoding method, the 144-bit binary number string with CRC check result is converted into a 24-bit visible string. The sixth encryption takes the 144-bit binary number string with CRC check result as input, and a 64-bit confusion integer array consisting of randomly generated non-repeating integers from 0 to 63 is used as the sixth key. The final encrypted confused ciphertext is output. S3. Establish a time-series database to store real-time monitoring data, and establish a relational database to store anomaly monitoring data and related data; S4. When decryption is required, the real-time monitoring value is enumerated and encrypted multiple times based on the enterprise identification information, equipment identification information and data identification information. The ciphertext is compared to determine the real-time monitoring value before encryption.

2. The method for encrypting and storing IoT sensor monitoring data according to claim 1, characterized in that: In step S1, the established enterprise identification information includes the enterprise name, unified social credit code, coal mine code, and globally unique identifier. The globally unique identifier is a digital identifier generated by the algorithm and serves as the first key in the subsequent encryption process. The established device identification information includes the system number to which the sensor device belongs, the device code, and the sensor device installation address; The established data identification information should include at least real-time monitoring data identification information and abnormal monitoring data identification information.

3. The method for encrypting and storing IoT sensor monitoring data according to claim 2, characterized in that: The real-time monitoring data identification information includes the timestamp of the sensor device data generation, the real-time monitoring value, and the real-time status value. The timestamp is represented in the format "yyyy-MM-dd HH:mm:ss.fff", where "yyyy" represents the year, "MM" represents the month, "dd" represents the day, "HH" represents the hour, "mm" represents the minute, "ss" represents the second, and "fff" represents the millisecond. The anomaly monitoring data identification information is calculated from the real-time data generated by the sensor device. It includes the anomaly start time, anomaly end time, anomaly status value, maximum value during the anomaly period, maximum value time, minimum value during the anomaly period, minimum value time, average value, and the timestamp of the corresponding record.

4. The method for encrypting and storing IoT sensor monitoring data according to claim 1, characterized in that: The array rearrangement method in the multiple encryption process is as follows: For arrays a= [ a 0, a 1 ,…,a n-1 A random algorithm is used to generate an integer from 0 to ( ). n -1) forms a non-repeating n-bit disordered index array b= [ b 0 ,b 1 ,…,b n-1 If ], then the rearranged new array is represented as c= [ c 0 ,c 1 ,…,c n-1 ], where, for elements in the array c i ,have: In the formula, i ∈[0, n -1], i Integer 。 5. The method for encrypting and storing IoT sensor monitoring data according to claim 1, characterized in that: In step S3, a real-time monitoring data super table is designed, which includes a label column and a data column. The label column includes the sensor device code and installation address, and the data column includes the acquisition time, monitoring value, value meaning, value status, and encrypted field.

6. The method for encrypting and storing IoT sensor monitoring data according to claim 5, characterized in that: The data columns of the real-time monitoring data super table include CipherText, which is an encrypted field. Its encrypted input data identification information includes the data generation time (DataGenTime), real-time monitoring value (RealtimeValue), monitoring value meaning (MeaningValue), monitoring value status (StateId), and its corresponding data type. The label column includes the device installation location (InstallAddr), the system number (SystemId), and its corresponding data type.

7. The method for encrypting and storing IoT sensor monitoring data according to claim 1, characterized in that: In step S3, a relational database is established, which stores at least the following: anomaly monitoring data, sensor device definition data, code table dictionary data, measurement point definition data, statistical analysis data, and anomaly handling measures. The sensor device definition data includes the corresponding manufacturer, specifications, monitored physical quantity and its unit, and device type. The code table dictionary data includes a device system coding dictionary, a device type coding dictionary, a measurement point anomaly status coding dictionary, and a measurement point relationship table. The statistical analysis data includes a measurement point status change record data table and a measurement point anomaly monitoring data table generated by secondary analysis and statistics based on the device status. The anomaly handling measures refer to the handling schemes adopted for the anomaly monitoring data.

8. The method for encrypting and storing IoT sensor monitoring data according to claim 7, characterized in that: The anomaly monitoring data table includes a CipherText field, whose encrypted input data identification information includes the data generation time (DataGenTime), anomaly start time (StartTime), anomaly end time (EndTime), anomaly status value (StatusId), maximum value during the anomaly period (MaxValue), maximum value time (MaxTime), minimum value during the anomaly period (MinValue), minimum value time (MinTime), average value (AvgValue), and device measurement point code (DeviceCode).

9. The method for encrypting and storing IoT sensor monitoring data according to claim 1, characterized in that: In step S4, given all keys, based on the enterprise identification information, device identification information, and data identification information, the real-time monitoring values ​​are enumerated and obfuscated for encryption calculation. The obfuscated ciphertexts are compared cyclically to see if they are the same. If the obfuscated ciphertexts are the same, the currently enumerated monitoring value is the sensor monitoring data value before encryption. If the obfuscated ciphertexts are different, the obfuscated encryption comparison is repeated until the obfuscated ciphertexts are the same.

Citation Information

Patent Citations

  • Multi-dimensional high-efficiency Internet of Things equipment batch management method and system

    CN118381720A