Data processing method, data collection gateway, internet of things platform and electronic device
By converting sensor addresses between the data acquisition gateway and the IoT platform and setting up security measures, the security issue of data transmission from DCS to the IoT platform is solved, improving the security and efficiency of data transmission, preventing data leakage and tampering, and reducing the risk of industrial production accidents.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUPER ROBOT RESEARCH INSTITUTE (HUANGPU)
- Filing Date
- 2026-02-13
- Publication Date
- 2026-05-15
AI Technical Summary
During the process of sensor data acquisition, transmission, and uploading from a distributed control system (DCS) to an Internet of Things (IoT) platform, there are security issues such as data leakage, data tampering, and network transmission anomalies, which can lead to platform decision-making errors and industrial production accidents.
The data acquisition gateway converts local sensor addresses into globally unique addresses carrying verification codes. Before uploading data, it sets communication keys, random numbers, timestamps, and data signatures to generate data packets. The IoT platform then signs and verifies these packets to ensure the security of data transmission.
Without affecting the operation of the DCS, it prevents data replay attacks, rainbow table attacks, and data tampering, thereby improving the security and efficiency of data transmission and reducing risks in industrial production.
Smart Images

Figure CN121728123B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, specifically to a data processing method, a data acquisition gateway, an Internet of Things platform, and an electronic device. Background Technology
[0002] In related technologies, during the entire process of sensor data acquisition, transmission, and uploading from a Distributed Control System (DCS) to an Internet of Things (IoT) platform, data leakage, data tampering, and network transmission anomalies become core security risks due to the industrial design attributes of the DCS itself, the openness of IoT access networks, and the compatibility issues of protocols and architectures in their integration. These risks can lead to platform decision-making errors, abnormal DCS linkage control, and even industrial production accidents. Summary of the Invention
[0003] This application provides a data processing method, a data acquisition gateway, an Internet of Things (IoT) platform, and an electronic device to improve the security problems such as data leakage, data tampering, and network transmission anomalies that exist in the process of uploading DCS data from DCS to the IoT platform in related technologies.
[0004] In a first aspect, this application provides a data processing method applied to a data acquisition gateway, the data acquisition gateway being located between a distributed control system and an Internet of Things (IoT) platform, the method comprising:
[0005] Receive sensor data collected by multiple data sensors uploaded by the distributed control system;
[0006] The local sensor addresses in the sensor data collected by each data sensor are converted into globally unique addresses, and the globally unique addresses carry a check code.
[0007] Based on the globally unique address and data value corresponding to each sensor data, generate the data content corresponding to each sensor data.
[0008] The timestamp, data content, corresponding enterprise identifier, pre-generated random number and pre-generated data signature of each sensor data are packaged to obtain the data package corresponding to each sensor data.
[0009] The data packets corresponding to the data from each sensor are uploaded to the IoT platform.
[0010] Secondly, this application provides a data processing method applied to an Internet of Things (IoT) platform, the method comprising:
[0011] Receive a data upload request from the data acquisition gateway, the data upload request including a target data packet to be uploaded, the target data packet being a data packet generated by the data acquisition gateway according to the data processing method of the application data acquisition gateway described above;
[0012] Parse the target data packet to obtain the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and data signature from the target data packet;
[0013] The target data packet is verified by data signature based on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key;
[0014] Upon successful data signature verification, obtain the globally unique address from the data content;
[0015] The checksum in the globally unique address is verified based on the preset communication key and the local sensor address in the globally unique address.
[0016] In response to the successful verification of the check code, the target data packet is stored in a preset time-series database.
[0017] Thirdly, this application provides a data acquisition gateway, which is located between a distributed control system and an Internet of Things (IoT) platform, and the data acquisition gateway includes:
[0018] The data query module is used to receive sensor data collected by multiple data sensors uploaded by the distributed control system;
[0019] The address conversion module is used to convert the local sensor address in the sensor data collected by each data sensor into a globally unique address, and the globally unique address carries a check code.
[0020] The data processing module is used to generate data content corresponding to each sensor data based on the globally unique address and data value corresponding to each sensor data.
[0021] The data packaging module is used to package the timestamp, data content, corresponding enterprise identifier, pre-generated random number and pre-generated data signature of each sensor data to obtain the data package corresponding to each sensor data.
[0022] The data upload module is used to upload the data packets corresponding to the data from each sensor to the IoT platform.
[0023] Fourthly, this application provides an Internet of Things (IoT) platform, including:
[0024] The data receiving module is used to receive data upload requests from the data acquisition gateway. The data upload request includes a target data packet to be uploaded. The target data packet is a data packet generated by the data acquisition gateway according to the data processing method applied to the data acquisition gateway described above.
[0025] The data parsing module parses the target data packet to obtain the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and data signature from the target data packet.
[0026] The signature verification module is used to perform data signature verification on the target data packet based on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key;
[0027] The address verification module is used to obtain the globally unique address in the data content in response to the successful data signature verification; and to verify the check code in the globally unique address according to the preset communication key and the local sensor address in the globally unique address.
[0028] The data entry module is used to store the target data packet into a preset time-series database in response to the successful verification of the check code.
[0029] Fifthly, this application provides a data processing system, including a distributed control system, a data acquisition gateway, and an Internet of Things (IoT) platform;
[0030] The data acquisition gateway includes the data acquisition gateway provided by any of the above parties, and / or the Internet of Things platform includes the Internet of Things platform provided by any of the above parties.
[0031] In a sixth aspect, this application provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the data processing method described in the first aspect or any corresponding embodiment.
[0032] According to the data processing method of this application, without affecting the operation of the enterprise's original distributed control system, when uploading sensor data collected by the enterprise's data sensors through a data acquisition gateway, the local sensor addresses of the sensor data uploaded from different enterprises' distributed control systems are converted into globally unique addresses. These globally unique addresses contain checksums, allowing the IoT platform to quickly verify the address validity and prevent the local sensor addresses of the sensor data from being forged. Simultaneously, before uploading sensor data to the IoT platform, by setting communication keys, random numbers, timestamps, and data signatures, security risks such as data replay attacks, rainbow table attacks, data tampering, and network transmission anomalies can be prevented, thus improving data transmission security while ensuring data transmission efficiency. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0034] Figure 1 This application provides a schematic diagram of the system architecture of a data processing system.
[0035] Figure 2 A flowchart illustrating a data processing method provided in an embodiment of this application;
[0036] Figure 3 A flowchart illustrating an address mapping relationship establishment method provided in an embodiment of this application;
[0037] Figure 4 A flowchart illustrating another data processing method provided in an embodiment of this application;
[0038] Figure 5 This is a schematic diagram of the structure of a data acquisition gateway provided in an embodiment of this application;
[0039] Figure 6 This is a schematic diagram of the structure of an Internet of Things (IoT) platform provided in an embodiment of this application;
[0040] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0042] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0043] In related technologies, during the entire process of sensor data acquisition, transmission, and uploading from a Distributed Control System (DCS) to an Internet of Things (IoT) platform, data leakage, data tampering, and network transmission anomalies become core security risks due to the industrial design attributes of the DCS itself, the openness of IoT access networks, and the compatibility issues of the protocols and architectures that integrate the two. These risks can lead to platform decision-making errors, abnormal DCS linkage control, and even industrial production accidents.
[0044] Figure 1 This is a schematic diagram of the system architecture of a data processing system provided in an embodiment of this application. As an optional application scenario of this application embodiment, such as... Figure 1 As shown, the data processing system includes a distributed control system 101, a data acquisition gateway 102, and an Internet of Things platform 103.
[0045] The distributed control system 101 is a system that achieves centralized control and management by connecting multiple distributed sensors, actuators, and workstations through a network. The control station is the central hub of the entire system, capable of receiving data from sensors and issuing commands to control the actuators. Hazardous chemical production enterprises typically use the distributed control system 101 to achieve automated production control. It collects necessary sensor data from sensors distributed throughout the enterprise, and based on the sensor data collected, it can conduct risk assessments and predictions of the enterprise's production environment, especially for enterprises with major hazard sources in hazardous chemicals. For example, data sensors may include temperature sensors, humidity sensors, liquid level sensors, pressure sensors, combustible gas concentration sensors, etc. Sensor data may include, but is not limited to, data on temperature, humidity, liquid level, pressure, and combustible gas concentration in major hazard source devices within the enterprise's production environment. For instance, if a sensor on the production line detects an excessively high temperature, a command is issued to turn on the corresponding fan for ventilation and cooling.
[0046] As a heterogeneous communication middleware between the distributed control system 101 and the IoT platform 103, the data acquisition gateway 102 solves the problems of closedness, heterogeneity of communication protocols, and incompatibility of data formats of the distributed control system 101 in the industrial field. It realizes standardized acquisition, protocol conversion, data preprocessing and secure transmission of production process data and equipment status data on the distributed control system 101 side. At the same time, it supports the reverse command pass-through on the IoT platform 103 side, completes bidirectional data interaction between the industrial field layer and the cloud / platform layer, and adapts to the real-time, reliability and security requirements of industrial production.
[0047] The IoT platform 103 is an industrial-grade IoT platform. Its core is the data acquisition gateway 102 between the DCS101 and the IoT platform 103. It focuses on receiving, storing, parsing, analyzing, displaying, and issuing commands for production process data and equipment status data from the DCS101 in the industrial field. It achieves deep integration of data at the industrial field layer and the platform application layer. At the same time, it supports remote operation and maintenance, configuration management, and status monitoring of the gateway, meeting the core needs of real-time monitoring, data traceability, intelligent analysis, and remote control in industrial production. It is suitable for the industrialization, standardization, and safety requirements of industrial scenarios such as chemical, power, metallurgy, and pharmaceutical industries. The IoT platform 103 can receive DCS data uploaded from various data acquisition gateways 102, achieving unified data aggregation across multiple sites, DCS systems, and acquisition points, breaking down industrial data silos. It provides full lifecycle management of industrial data, combining industrial algorithms to achieve real-time data analysis, trend analysis, and anomaly warnings, providing data support for production decisions. It enables remote configuration, status monitoring, firmware upgrades, and fault diagnosis for all distributed data acquisition gateways 102, reducing on-site maintenance costs. It issues compliant production control and configuration commands to the data acquisition gateways 102, transmitting them through the gateways to the DCS system, enabling remote control of industrial production and forming a closed loop of "acquisition-analysis-control." Furthermore, it provides standardized API / SDK interfaces to support the integration of third-party industrial applications, enabling secondary development and value mining of data.
[0048] To effectively address the security issues such as data leakage, data tampering, and abnormal network transmission in the aforementioned related technologies, this application provides a data processing method based on the aforementioned data processing system.
[0049] According to an embodiment of this application, a data processing method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0050] This application provides a data processing method that can be used in a data acquisition gateway, which is located between a distributed control system and an Internet of Things (IoT) platform. Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application, as shown below. Figure 2 As shown, the data processing method includes the following steps:
[0051] Step S201: Receive sensor data collected by multiple data sensors uploaded by the distributed control system.
[0052] In this embodiment, the data acquisition gateway uses the Object Linking and Embedded Process Control (OLE for Process Control, OPC) communication protocol to periodically send data query commands to the Distributed Control System (DCS).
[0053] OPC communication protocol is a communication protocol standard in the field of industrial automation. The OPC standard is a series of specifications jointly developed by industry suppliers, end users, and software developers. These specifications define the interfaces between clients and servers, as well as between servers. For example, accessing real-time data, detecting alarms and events, accessing historical data, and other applications all require the coordination of the OPC standard.
[0054] Specifically, the data acquisition gateway can periodically send data query commands to the distributed control system (DCS) to read data from one or more data sensors. The command parameters may include, but are not limited to, the following fields:
[0055] NodeIds list: An array containing the local sensor addresses of multiple data sensors to be read.
[0056] Attributes list: An array containing multiple attribute identifiers (IDs) to be read, the length of which should be the same as the length of the NodeIds list.
[0057] Index Range List (IndexRanges): An array containing multiple index ranges (IndexRange) to specify the range parameters for reading sensor data or structure portions. Its length should be the same as the length of the NodeIds list. If a sensor node does not require an index range, it can be set to null or an empty value.
[0058] NodeAdditionalInfos: This parameter allows for finer control over the reading behavior, especially for sensor data. It is an array of structures, with each element corresponding to a sensor node. You can specify the start index (StartIndex) and end index (EndIndex) to read specific portions of the sensor data.
[0059] The Distributed Control System (DCS) queries the sensor data collected by various data sensors distributed in the enterprise's production environment according to the data query command. These data include, for example, temperature, humidity, liquid level, pressure, and combustible gas concentration.
[0060] The distributed control system uploads the sensor data collected from each data sensor to the data acquisition gateway via the OPC communication protocol. The data acquisition gateway receives the sensor data collected from multiple data sensors uploaded by the distributed control system.
[0061] Step S202: Convert the local sensor address in the sensor data collected by each data sensor into a globally unique address, and the globally unique address carries a check code.
[0062] Each sensor data collected by each data sensor carries the corresponding local sensor address. The local sensor address in the sensor data is the address identifier set locally by the data sensor, which is used to uniquely identify the data sensor and its location. The address identifier can be the tag number of the sensor location or other identifiers (ID) of the sensor.
[0063] After receiving sensor data collected by each data sensor, the data acquisition gateway converts the local sensor address in the sensor data collected by each data sensor into a globally unique address according to a preset address mapping table. The globally unique address carries a check code, and the preset address mapping table is pre-configured with the mapping relationship between the local sensor address and the globally unique address of each data sensor.
[0064] Step S203: Generate the data content corresponding to each sensor data according to the globally unique address and data value corresponding to each sensor data.
[0065] For each sensor data, the data acquisition gateway generates the corresponding data content (DATA) based on the globally unique address and data value (e.g., temperature) of the sensor data. The data content of the sensor data includes the globally unique address and data value of the sensor data.
[0066] Step S204: Package the timestamp, data content, corresponding enterprise identifier, pre-generated random number and pre-generated data signature corresponding to each sensor data to obtain the data packet corresponding to each sensor data.
[0067] The enterprise identifier is, for example, the enterprise number, which is the enterprise number of the enterprise to which the sensor data belongs; the random number is a randomly generated number; the data signature is a data signature generated in advance based on the timestamp corresponding to the sensor data, the data content, the corresponding enterprise identifier, the pre-generated random number, and the preset communication key. The communication key is a pre-generated communication key between the IoT platform and the enterprise's distributed control system. The communication keys between each enterprise's distributed control system and the IoT platform are pre-configured in the data acquisition gateway and the IoT platform.
[0068] The timestamp, data content, corresponding enterprise identifier, pre-generated random number, and pre-generated data signature of each sensor data are packaged to obtain the data packet corresponding to each sensor data. The data packet can be in JSON format.
[0069] The following is an example of a JSON format data package generated by packaging:
[0070] {
[0071] "CompanyCode": "440101000001",
[0072] "DATA": [
[0073] { "id": "440101000001-10001-8",
[0074] "value": "25.5"},
[0075] { "id": "440101000001-10002-3",
[0076] "value": "1.5"}],
[0077] "Timestamp": 1770321758,
[0078] "Nonce": 78098758,
[0079] "Signature": "AA65820909876532ABE567FD09125678"
[0080] }
[0081] The fields have the following meanings: CompanyCode: Enterprise identifier; DATA.id: Globally unique address corresponding to the sensor data; DATA.value: Data value corresponding to the sensor data; Timestamp: Current timestamp, which can prevent replay attacks; Nonce: Randomly generated 8-bit random number; Signature: Calculated data signature.
[0082] The DATA field contains an array of globally unique addresses and a list of data values for all sensor data that needs to be uploaded.
[0083] Step S205: Upload the data packets corresponding to each sensor data to the IoT platform.
[0084] After signing and packaging the data packets corresponding to each sensor, the data acquisition gateway uploads the signed and packaged data packets to the IoT platform via the Transmission Control Protocol (TCP).
[0085] According to the data processing method of this application embodiment, without affecting the operation of the enterprise's original distributed control system, when uploading sensor data collected by the enterprise's data sensors through a data acquisition gateway, the local sensor addresses of the sensor data uploaded from the distributed control systems of different enterprises are converted into globally unique addresses. These globally unique addresses contain checksums, allowing the IoT platform to quickly verify the address validity through the checksums and preventing the local sensor addresses of the sensor data from being forged. Simultaneously, before uploading sensor data to the IoT platform, by setting communication keys, random numbers, timestamps, data signatures, and other technical means, security risks such as data replay attacks, rainbow table attacks, data tampering, and network transmission anomalies can be prevented, ensuring both data transmission efficiency and improved data transmission security.
[0086] Figure 3 This is a flowchart illustrating an address mapping relationship establishment method provided in an embodiment of this application. In some embodiments, such as... Figure 3 As shown, before receiving sensor data collected by multiple data sensors uploaded by the distributed control system, the data processing method further includes:
[0087] Step S301: Receive sensor information of each data sensor imported by the user. The sensor information of the data sensor includes the corporate identifier of the company to which the data sensor belongs and the local sensor address of the data sensor in the company.
[0088] Users compile the local sensor addresses of the data sensors in the distributed control system that need to be collected into a data table and import it in batches into the data acquisition gateway. The imported data table includes sensor information for each data sensor, including but not limited to: the company identifier (such as company number) of the company to which the data sensor belongs, the local sensor address, the sensor location name, the data type of the collected sensor data, and the length of the collected sensor data.
[0089] Step S302: For each data sensor, generate a globally unique address corresponding to the data sensor based on the enterprise identifier corresponding to the data sensor, the local sensor address corresponding to the data sensor, and the pre-generated check code.
[0090] The local sensor address is a unique address for the data sensor within the enterprise's distributed control system. However, local sensor addresses may be duplicated in distributed control systems of different enterprises. To avoid the local sensor addresses of data sensors from different enterprises being identical, which could affect the accuracy of data uploads, the local sensor addresses of the collected sensor data need to be re-encoded.
[0091] The encoding method for globally unique addresses is as follows: 1. Add an enterprise identifier prefix before the local sensor address;
[0092] 2. To prevent data errors caused by address anomalies during communication, address authenticity verification is necessary. Due to the large number of enterprises connected to the IoT platform, each with thousands of data sensors, and the high frequency of receiving data (once every 5 seconds) from thousands of sensor addresses, the IoT platform experiences significant performance overhead when performing database lookups to verify address accuracy. To optimize this, a checksum field is added to the globally unique address for self-verification by the IoT platform, improving security while maintaining concurrent processing performance.
[0093] In some embodiments, a globally unique address is generated by connecting a specific character with the enterprise identifier, the local sensor address, and a 1-digit checksum. For example, if the specific character is the character "-", then the globally unique address can be represented as: enterprise identifier - local sensor address - 1-digit checksum.
[0094] In some embodiments, before generating the globally unique address corresponding to the data sensor based on the enterprise identifier corresponding to the data sensor, the local sensor address corresponding to the data sensor, and the pre-generated check code, i.e. before step S302 above, the data processing method further includes: calculating the first ASCII code of each character in the local sensor address corresponding to the data sensor; calculating the second ASCII code of each character in the preset communication key; multiplying each first ASCII code and each second ASCII code one by one, and summing the product results; and performing a modulo operation on the summation result and a preset value to obtain the check code corresponding to the data sensor.
[0095] Specifically, the formula for calculating the check code can be expressed as: S=[Sum(C[i]×Key[i])] mod 10.
[0096] Where C[i] is the first ASCII code of the i-th character in the local sensor address, Key[i] is the second ASCII code of the i-th character in the communication key, Sum is the summation operation, and mod is the modulo operation.
[0097] For example, the globally unique address is: 440101000001-10001-8, where 440101000001 is the enterprise identifier, 10001 is the local sensor address, and 8 is the checksum calculated according to the above formula.
[0098] Step S303: Establish the address mapping relationship between the local sensor address and the globally unique address of each data sensor.
[0099] Step S304: Upload the address mapping relationship to the global address encoding database.
[0100] After generating a globally unique address, the data acquisition gateway locally caches a table of address mapping relationships between the local sensor addresses and the globally unique addresses of all data sensors. This facilitates quick address conversion before uploading data. At the same time, the data acquisition gateway uploads this address mapping table to the global address encoding database of the IoT platform via the HTTP protocol.
[0101] In some embodiments, in step S202 above, converting the local sensor address in the sensor data collected by each data sensor into a globally unique address may further include: converting the local sensor address in the sensor data collected by each data sensor into its corresponding globally unique address according to a preset address mapping relationship.
[0102] In some embodiments, before packaging the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and pre-generated data signature corresponding to each sensor data, i.e. before step S204 above, the data processing method further includes: for each sensor data, performing hash calculation on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and pre-generated communication key corresponding to the sensor data according to a preset hash algorithm to obtain the data signature corresponding to the sensor data.
[0103] In some embodiments, the preset hash algorithm is represented as:
[0104] Signature=SM3(CompanyCode+DATA+Nonce+SecretKey+Timestamp)
[0105] Here, CompanyCode represents the enterprise identifier, DATA represents the data content containing the globally unique address and data value of the data sensor, SecretKey represents the communication key pre-assigned to the enterprise, Timestamp represents the current timestamp, and Nonce represents a randomly generated random number. The SM3 algorithm is a standard cryptographic hash function, mainly used to generate message digests to ensure data integrity.
[0106] This application provides a data processing method that can be used in an Internet of Things (IoT) platform. The data acquisition gateway is located between the distributed control system and the IoT platform. Figure 4 A flowchart illustrating another data processing method provided in this application embodiment is shown below. Figure 4 As shown, the data processing method includes the following steps:
[0107] Step S401: Receive a data upload request from the data acquisition gateway. The data upload request includes the target data packet to be uploaded.
[0108] The target data packet is a data packet generated by the data acquisition gateway according to the data processing method based on the data acquisition gateway described above. After generating the target data packet, the data acquisition gateway sends a data upload request to the IoT platform via the TCP protocol. The data upload request carries the target data packet that has been signed and packaged. The IoT platform receives the data upload request from the data acquisition gateway and obtains the target data packet.
[0109] Step S402: Parse the target data packet to obtain the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and data signature in the target data packet.
[0110] The IoT platform receives a data upload request from the data acquisition gateway, acquires the target data packet, and parses it to obtain the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and data signature from the target data packet.
[0111] Step S403: Perform data signature verification on the target data packet based on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key.
[0112] To prevent data tampering or network transmission anomalies, the IoT platform performs data signature verification on the target data packet after receiving it, based on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key.
[0113] In some embodiments, data signature verification of a target data packet is performed based on a timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key. This includes: performing a hash calculation on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key using a preset hash algorithm to obtain a data signature to be verified; comparing the data signature to be verified with the data signature of the received target data packet; if the comparison result is consistent, the data signature verification of the target data packet is determined to be successful; if the comparison result is inconsistent, the data signature verification of the target data packet is determined to be unsuccessful.
[0114] Specifically, for the company identifier (CompanyCode), data content (DATA), timestamp (Timestamp), random number (Nonce), and agreed communication key (SecretKey) in the received data, the data signature is recalculated according to the above data signature calculation formula, and the calculated data signature is verified to be consistent with the received data signature (Signature). If the signatures do not match, the target data packet is discarded and the processing flow of the target data packet ends. If the signatures match, the subsequent steps are performed.
[0115] Step S404: In response to the successful data signature verification, obtain the globally unique address in the data content.
[0116] Step S405: Verify the checksum in the globally unique address based on the preset communication key and the local sensor address in the globally unique address.
[0117] In response to the successful data signature verification, the IoT platform will process all sensor data in the DATA field of the target data packet one by one. To prevent the local sensor address from being forged, the platform will perform a self-verification of the globally unique address in the sensor data using a checksum.
[0118] In some embodiments, the verification of the checksum in the globally unique address is performed based on a preset communication key and the local sensor address in the globally unique address. This includes: calculating the first ASCII code of each character in the local sensor address; calculating the second ASCII code of each character in the communication key; multiplying each first ASCII code and each second ASCII code one-to-one, and summing the product results; performing a modulo operation on the summation result with a preset value to obtain the target checksum; comparing the target checksum with the checksum in the globally unique address; if the comparison result is consistent, the checksum in the globally unique address is determined to have passed verification; if the comparison result is inconsistent, the checksum in the globally unique address is determined to have failed verification.
[0119] Specifically, the globally unique address of the sensor data is split into three parts: enterprise identifier, local sensor address, and check code, based on the identification of specific characters (such as "-"). Then, the check code is recalculated according to the above formula based on the enterprise identifier, local sensor address, and communication key.
[0120] The calculated checksum is compared with the checksum portion in the received globally unique address. If they do not match, the checksum verification of the target data packet is determined to have failed, the target data packet is discarded, and the processing flow of the target data packet ends. If they match, the verification passes, and the process proceeds to the next step.
[0121] This self-verification process eliminates the need to query a massive sensor address database for verification every time a data packet is received, thus improving the efficiency of verifying the legality of the data.
[0122] Because IoT platforms connect to a large number of sensors, sometimes reaching millions, checking the address in a database every time data is received would consume significant server resources. Therefore, this embodiment uses a self-verifying checksum within the globally unique address to prevent address spoofing. Upon receiving data, verifying the accuracy of the checksum in the globally unique address completes the address verification.
[0123] Step S406: In response to the successful verification of the check code, the target data packet is stored in a preset time-series database.
[0124] The IoT platform will discard data that fails the self-verification of the sensor's globally unique address, and will store all data that passes the self-verification of the sensor's globally unique address into the IoT platform's time-series database.
[0125] In practical applications, the sensor data, once stored in the database, can be used by the detection systems of enterprises with major hazardous chemical sources to monitor and analyze sensor data in real time. When sensor data values exceed the high alarm threshold or fall below the low alarm threshold, an alarm message is automatically generated and the relevant personnel in the enterprise are automatically notified. Simultaneously, it facilitates regulatory authorities in querying historical data from various sensors after an accident occurs at a major hazardous chemical source enterprise, allowing for analysis of the time, cause, and process of the accident.
[0126] In some embodiments, before obtaining the globally unique address in the data content, the data processing method further includes: performing a timeliness check on the target data packet; obtaining the time difference between the receiving timestamp of the target data packet and the timestamp in the target data packet; and determining that the timeliness check of the target data packet passes if the absolute value of the time difference is less than a set threshold.
[0127] Specifically, to prevent data replay attacks, after the data signature verification is passed, the IoT platform performs a timeliness check on the target data packet: the time difference between the timestamp in the received target data packet and the reception time of the target data packet received by the IoT platform is calculated. If the absolute value of the time difference is less than a set threshold, the target data packet is considered valid. If the time difference exceeds the set threshold, the target data packet is considered invalid and discarded. Considering the time error between the data upload end and the server end, the set threshold can be set to 60 seconds.
[0128] In some embodiments, before obtaining the globally unique address in the data content, the data processing method further includes: performing a uniqueness check on the target data packet; concatenating the enterprise identifier, timestamp, and random number in the target data packet to obtain the target request record identifier corresponding to the target data packet; checking, according to a preset request record identifier cache list, whether there is a data upload request for a data packet whose request record identifier matches the target request record identifier within the most recent preset time; and, in response to the absence of a data upload request for a data packet whose request record identifier matches the target request record identifier within the most recent preset time, storing the target request record identifier in the request record identifier cache list.
[0129] Specifically, to prevent data retransmission caused by network disruptions, after the timeliness verification is passed, the IoT platform performs a uniqueness check on the entire target data packet: it concatenates the CompanyCode, Timestamp, and Nonce in the received target data packet into a unique target request record identifier RequestId, and checks whether a data upload request with the same request record identifier has been received within the most recent preset time (e.g., within 60 seconds). If a duplicate request record identifier is found, the target data packet is considered to have been processed, the data packet is discarded, and the data processing flow of the data packet ends.
[0130] If no request record identifier (RequestId) is found that is identical to the target request record identifier (RequestId), then the request record identifier and the time when the data upload request for the target data packet was received are added to the request record identifier cache list before proceeding to the next step.
[0131] It should be noted that when updating the request record identifier cache list, request record identifiers that are more than a preset time away from the current time will be automatically removed from the request record identifier cache list to prevent the cache queue from being too large and affecting query performance.
[0132] Because the entire data acquisition and uploading process includes anti-tampering verification, timeliness verification, uniqueness verification, and self-verification of the sensor's globally unique address, the system's security and reliability are improved without affecting the original concurrent data acquisition performance.
[0133] This application also provides a data acquisition gateway for implementing the data processing method based on the data acquisition gateway in the above embodiments and preferred embodiments. Details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the data acquisition gateway described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0134] This application also provides a data acquisition gateway. Figure 5 This is a schematic diagram of the structure of a data acquisition gateway provided in an embodiment of this application, as shown below. Figure 5 As shown, the data acquisition gateway is located between the distributed control system and the IoT platform. The data acquisition gateway includes:
[0135] The data query module 501 is used to receive sensor data collected by multiple data sensors uploaded by the distributed control system.
[0136] Address conversion module 502 is used to convert the local sensor address in the sensor data collected by each data sensor into a globally unique address, and the globally unique address carries a check code.
[0137] The data processing module 503 is used to generate data content corresponding to each sensor data according to the globally unique address and data value corresponding to each sensor data.
[0138] The data packaging module 504 is used to package the timestamp, data content, corresponding enterprise identifier, pre-generated random number and pre-generated data signature corresponding to each sensor data to obtain the data packet corresponding to each sensor data.
[0139] The data upload module 505 is used to upload the data packets corresponding to the data from each sensor to the Internet of Things platform.
[0140] The data acquisition gateway provided in this application embodiment can execute the data processing method applied to the data acquisition gateway provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0141] This application also provides an Internet of Things (IoT) platform for implementing the data processing methods applied to the IoT platform in the above embodiments and preferred embodiments. Details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the IoT platform described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0142] This application also provides an Internet of Things (IoT) platform. Figure 6 This application provides a schematic diagram of the structure of an Internet of Things (IoT) platform, as shown in the embodiments. Figure 6 As shown, the IoT platform includes:
[0143] The data receiving module 601 is used to receive data upload requests from the data acquisition gateway. The data upload request includes the target data packet to be uploaded.
[0144] The data parsing module 602 parses the target data packet and obtains the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and data signature from the target data packet.
[0145] The signature verification module 603 is used to perform data signature verification on the target data packet based on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key.
[0146] The address verification module 604 is used to obtain the globally unique address in the data content in response to the successful data signature verification; and to verify the check code in the globally unique address according to the preset communication key and the local sensor address in the globally unique address.
[0147] The data entry module 605 is used to store the target data packet into a preset time-series database in response to the successful verification of the check code.
[0148] The IoT platform provided in this application can execute the data processing method for IoT platforms provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.
[0149] This application also provides a data processing system, such as... Figure 1 As shown, an Internet of Things (IoT) platform includes a distributed control system 101, a data acquisition gateway 102, and an IoT platform 103; the data acquisition gateway 102 includes the data acquisition gateway provided in the above embodiments, and / or, the IoT platform 103 includes the IoT platform provided in the above embodiments.
[0150] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0151] The following is a detailed reference. Figure 7 This diagram illustrates a suitable structural schematic for implementing the electronic device described in the embodiments of this application. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 701, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 702 or a program loaded from memory 708 into random access memory (RAM) 703. RAM 703 also stores various programs and data required for the operation of the electronic device. The processor 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0152] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic devices to exchange data via wireless or wired communication with other devices. Although Figure 7 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0153] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 709, or installed from a memory 708, or installed from a ROM 702. When the computer program is executed by the processor 701, it performs the functions defined in the data processing method of the embodiments of this application.
[0154] Figure 7 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0155] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the data processing methods shown in the above embodiments are implemented.
[0156] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0157] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A data processing method, characterized in that, Applied to a data acquisition gateway, which is located between a distributed control system and an Internet of Things (IoT) platform, the method includes: Receive sensor data collected by multiple data sensors uploaded by the distributed control system; The local sensor addresses in the sensor data collected by each data sensor are converted into globally unique addresses. The globally unique address carries a check code. The globally unique address is composed of the enterprise identifier, the local sensor address, and the check code connected by specific characters. The local sensor address is the address identifier set locally by the data sensor and is used to uniquely identify the data sensor and its location. Based on the globally unique address and data value corresponding to each sensor data, generate the data content corresponding to each sensor data. For each sensor data, a hash calculation is performed on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key corresponding to the sensor data according to a preset hash algorithm to obtain the data signature corresponding to the sensor data; The timestamp, data content, corresponding enterprise identifier, pre-generated random number and pre-generated data signature of each sensor data are packaged to obtain the data package corresponding to each sensor data. The data packets corresponding to the data from each sensor are uploaded to the IoT platform.
2. The data processing method according to claim 1, characterized in that, Before receiving sensor data collected by multiple data sensors uploaded by the distributed control system, the method further includes: Receive sensor information of each data sensor imported by the user. The sensor information of the data sensor includes the enterprise identifier of the enterprise to which the data sensor belongs and the local sensor address of the data sensor in the enterprise to which the data sensor belongs. For each data sensor, a globally unique address is generated based on the enterprise identifier corresponding to the data sensor, the local sensor address corresponding to the data sensor, and the pre-generated verification code. Establish an address mapping relationship between the local sensor address and the globally unique address of each of the aforementioned data sensors; The address mapping relationship is uploaded to the global address encoding database.
3. The data processing method according to claim 2, characterized in that, The step of converting the local sensor addresses in the sensor data collected by each data sensor into globally unique addresses includes: The local sensor addresses in the sensor data collected by each data sensor are converted into their respective globally unique addresses according to the preset address mapping relationship.
4. The data processing method according to claim 2, characterized in that, Before generating the globally unique address corresponding to the data sensor based on the enterprise identifier corresponding to the data sensor, the local sensor address corresponding to the data sensor, and the pre-generated checksum, the method further includes: Calculate the first ASCII code of each character in the local sensor address corresponding to the data sensor; Calculate the second ASCII code of each character in the preset communication key; Each first ASCII code is multiplied one by one with each second ASCII code, and the product results are summed. The summation result is moduloed with a preset value to obtain the check code corresponding to the data sensor.
5. A data processing method, characterized in that, Applied to an Internet of Things (IoT) platform, the method includes: Receive a data upload request from a data acquisition gateway, wherein the data upload request includes a target data packet to be uploaded, and the target data packet is a data packet generated by the data acquisition gateway according to the data processing method as described in any one of claims 1-4; Parse the target data packet to obtain the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and data signature from the target data packet; The target data packet is verified by data signature based on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key; Upon successful data signature verification, obtain the globally unique address from the data content; The checksum in the globally unique address is verified based on the preset communication key and the local sensor address in the globally unique address. In response to the successful verification of the check code, the target data packet is stored in a preset time-series database.
6. The data processing method according to claim 5, characterized in that, The step of performing data signature verification on the target data packet based on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key includes: The timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key are hashed according to a preset hash algorithm to obtain the data signature to be verified. The signature of the data to be verified is compared with the signature of the data packet received from the target data packet; If the comparison result is consistent, then the data signature verification of the target data packet is determined to be successful.
7. The data processing method according to claim 5, characterized in that, Before obtaining the globally unique address in the data content, the method further includes: Perform timeliness verification on the target data packet; Obtain the time difference between the received timestamp of the target data packet and the timestamp in the target data packet; If the absolute value of the time difference is less than a set threshold, then the timeliness verification of the target data packet is determined to be successful.
8. The data processing method according to claim 5, characterized in that, Before obtaining the globally unique address in the data content, the method further includes: Perform a uniqueness check on the target data packet; The enterprise identifier, the timestamp, and the random number in the target data packet are concatenated to obtain the target request record identifier corresponding to the target data packet; Based on a preset request record identifier cache list, check whether there is a data upload request for a data packet whose request record identifier matches the target request record identifier within the most recent preset time period; In response to a data upload request for which no data packet with the same request record identifier as the target request record identifier exists within a recent preset time period, the target request record identifier is stored in the request record identifier cache list.
9. The data processing method according to claim 5, characterized in that, The step of verifying the checksum in the globally unique address based on the preset communication key and the local sensor address in the globally unique address includes: Calculate the first ASCII code of each character in the local sensor address; Calculate the second ASCII code of each character in the communication key; Each first ASCII code is multiplied one by one with each second ASCII code, and the product results are summed. The summation result is moduloed by a preset value to obtain the target verification code; Compare the target checksum with the checksum in the globally unique address; If the comparison result is consistent, it is determined that the checksum in the globally unique address has passed the verification.
10. A data acquisition gateway, characterized in that, The data acquisition gateway is located between the distributed control system and the Internet of Things platform, and the data acquisition gateway includes: The data query module is used to receive sensor data collected by multiple data sensors uploaded by the distributed control system; The address conversion module is used to convert the local sensor address in the sensor data collected by each data sensor into a globally unique address. The globally unique address carries a check code. The globally unique address is composed of the enterprise identifier, the local sensor address, and the check code connected by specific characters. The local sensor address is the address identifier set locally by the data sensor and is used to uniquely identify the data sensor and its location. The data processing module is used to generate data content corresponding to each sensor data based on the globally unique address and data value corresponding to each sensor data. This module is used to perform hash calculations on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key of each sensor data according to a preset hash algorithm, so as to obtain the data signature corresponding to the sensor data. The data packaging module is used to package the timestamp, data content, corresponding enterprise identifier, pre-generated random number and pre-generated data signature of each sensor data to obtain the data package corresponding to each sensor data. The data upload module is used to upload the data packets corresponding to the data from each sensor to the IoT platform.
11. An Internet of Things (IoT) platform, characterized in that, The IoT platform includes: The data receiving module is used to receive a data upload request from the data acquisition gateway. The data upload request includes a target data packet to be uploaded. The target data packet is a data packet generated by the data acquisition gateway according to the data processing method as described in any one of claims 1-4. The data parsing module parses the target data packet to obtain the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and data signature from the target data packet. The signature verification module is used to perform data signature verification on the target data packet based on the timestamp, data content, corresponding enterprise identifier, pre-generated random number, and preset communication key; The address verification module is used to obtain the globally unique address in the data content in response to the successful data signature verification; and to verify the check code in the globally unique address according to the preset communication key and the local sensor address in the globally unique address. The data entry module is used to store the target data packet into a preset time-series database in response to the successful verification of the check code.
12. A data processing system, characterized in that, This includes distributed control systems, data acquisition gateways, and IoT platforms; The data acquisition gateway includes the data acquisition gateway as described in claim 10, and / or the Internet of Things platform includes the Internet of Things platform as described in claim 11.
13. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the data processing method of any one of claims 1 to 9.