Data verification method, system and device and storage medium
By generating a verification task identifier and serializing it into a binary file, and then using the Netty channel for one-way transmission, the problem of low data integrity verification efficiency for IoT devices in a one-way network environment is solved, and efficient data integrity verification is achieved.
Patent Information
- Application Number
- CN202511653615.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-11-12
AI Technical Summary
In a one-way network environment, IoT devices have limited computing power and find it difficult to efficiently verify data integrity, especially in high-concurrency scenarios where verification efficiency is low.
By generating a verification task identifier and serializing it into a binary file, and using the Netty channel for one-way transmission, the receiving terminal verifies the integrity of the data and then feeds back the result. The IoT data acquisition terminal autonomously compares the consistency between the prediction result and the integrity verification result.
It improves the efficiency of data integrity verification in a one-way network environment, breaks through the two-way feedback limitation of end-to-end integrity verification, and reduces computation and transmission overhead.
Smart Images

Figure CN121462276A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet of Things data security, and particularly to a data verification method, system, device and storage medium. BACKGROUND
[0002] In an Internet of Things system, an Internet of Things (IoT) device collects data through a sensor and then reports the data to a data center or cloud through a network. For some scenarios that strictly require high security of data transmission, such as industrial control scenarios, energy management scenarios and military scenarios, in order to prevent data leakage or external attacks, a unidirectional network is generally used to realize unidirectional transmission of data from a low-security domain to a high-security domain through a gatekeeper or a unidirectional gateway. In the process of unidirectional transmission, the integrity of the data reported by the Internet of Things device needs to be verified.
[0003] In the prior art, since the Internet of Things device is usually a device with low power consumption and low computing capability, it is difficult to support a verification algorithm with high computing complexity, and only a simple verification algorithm can be arranged, which is difficult to efficiently process a large amount of heterogeneous data in a high-concurrency scenario, and the verification efficiency is low. Therefore, in the prior art, there is a technical problem that the verification efficiency is not high when verifying the integrity of data in a unidirectional network environment.
[0004] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0005] The main purpose of the present application is to provide a data verification method, which aims to solve the technical problem that the verification efficiency is not high when verifying the integrity of data in a unidirectional network environment in the prior art.
[0006] To achieve the above-mentioned purpose, the present application provides a data verification method, when transmission task information containing a data packet to be transmitted is obtained from an Internet of Things collection terminal, a verification task identifier is generated based on the transmission task information; The verification task identifier is serialized to obtain a binary file; The binary file is unidirectionally transmitted to a receiving terminal for verifying the integrity of data, wherein the receiving terminal feeds back the integrity verification result to the Internet of Things collection terminal from a Netty channel outside the unidirectional transmission channel after verifying the integrity of data, and the Internet of Things collection terminal generates a prediction result for predicting the integrity of the unidirectional transmission data; When it is detected that the receiving terminal feeds back the integrity verification result to the Internet of Things collection terminal, a comparison result of comparing the consistency of the prediction result and the integrity verification result is obtained from the Internet of Things collection terminal. If the comparison result is that the prediction result is consistent with the integrity verification result, it is verified that the data transmission is passed in terms of data integrity, and if the comparison result is that the prediction result is inconsistent with the integrity verification result, it is verified that the data transmission is failed in terms of data integrity.
[0007] In a possible implementation of the present application, the data packet of the transmission task information includes a preset transmission task identifier, a terminal identifier of the Internet of Things collection terminal, a timestamp, a byte length of the data packet, and data content to be transmitted. When the transmission task information containing the data packet to be transmitted is acquired from the Internet of Things collection terminal, a verification task identifier is generated based on the transmission task information, including: When the transmission task information containing the data packet to be transmitted is acquired from the Internet of Things collection terminal, the transmission task identifier, the terminal identifier of the Internet of Things collection terminal, the timestamp, the byte length of the data packet, and the data content to be transmitted are generated into a first data digest. The transmission task identifier, the terminal identifier of the Internet of Things collection terminal, the timestamp, the byte length of the data packet, and the first data digest are generated into a verification task identifier.
[0008] In a possible implementation of the present application, when the receiving terminal receives the binary file, the receiving terminal parses the binary file, and the receiving terminal generates a second data digest from the transmission task identifier, the terminal identifier of the Internet of Things collection terminal, the timestamp, the byte length of the data packet, and the data content to be transmitted parsed. The process of generating the second data digest by the receiving terminal is the same as that of generating the first data digest by the Internet of Things collection terminal. The receiving terminal verifies the second data digest. If the second data digest is consistent with the first data digest, it is determined that the integrity verification result is complete. If the second data digest is inconsistent with the first data digest, it is determined that the integrity verification result is incomplete.
[0009] In a possible implementation of the present application, after the step of parsing the binary file by the receiving terminal, the timestamp parsed by the receiving terminal is verified for timeliness. If the timestamp is within a preset time window, the step of generating the second data digest by the receiving terminal from the transmission task identifier, the terminal identifier of the Internet of Things collection terminal, the timestamp, the byte length of the data packet, and the data content to be transmitted parsed by the receiving terminal is continued. If the timestamp is not within the preset time window, it is confirmed that there is a replay attack at present.
[0010] In a possible implementation of the present application, the prediction result and the integrity verification result are represented by a state code, and the step of obtaining, from the IoT collection terminal, a comparison result of self-comparing the consistency of the prediction result and the integrity verification result comprises: generating a verification state code for the integrity verification result when it is detected that the receiving terminal feeds back the integrity verification result to the IoT collection terminal, wherein the IoT collection terminal generates a prediction state code for the prediction result; generating a JSON format data set for the verification state code, the verification task identifier, and a verification completion timestamp, and sending the JSON format data set to the IoT collection terminal; obtaining, from the IoT collection terminal, a comparison result of self-comparing the consistency of the verification state code and the prediction state code.
[0011] In a possible implementation of the present application, the step of serializing the verification task identifier to obtain a binary file comprises: performing Protobuf format conversion on the verification task identifier to obtain a Protobuf data format file; performing binary stream conversion processing on the Protobuf data format file to obtain a binary file.
[0012] In a possible implementation of the present application, the other channel in addition to the one-way transmission channel comprises a Netty channel, and the receiving terminal transmits the integrity verification result from the Netty channel to a preset gate or gateway after verification, and controls one-way transmission of the integrity verification result to the IoT collection terminal based on the gate or gateway.
[0013] In addition, to achieve the above object, the present application also provides a data verification system, which comprises a data verification terminal, an IoT collection terminal, and a receiving terminal, wherein the data verification terminal is in communication connection with the IoT collection terminal and the receiving terminal, The IoT collection terminal is configured to collect monitoring data, generate a data packet from the collected monitoring data, and perform the following steps: the data packet comprises a preset transmission task identifier, a terminal identifier of the IoT collection terminal, a timestamp, a byte length of the data packet, and data content to be transmitted; and the IoT collection terminal is further configured to generate a first data digest based on a hash algorithm, and the first data digest comprises the transmission task identifier, the terminal identifier of the IoT collection terminal, the timestamp, the byte length of the data packet, and the data content to be transmitted. The data verification terminal is configured to generate a verification task identifier based on the first data digest, the transmission task identifier, the terminal identifier of the Internet of Things collection terminal, the timestamp, and the byte length of the data packet; to serialize the verification task identifier and the data packet to obtain a binary file; and to transmit the binary file to the receiving terminal. The receiving terminal is configured to receive the binary file, verify data integrity based on the binary file, and obtain an integrity verification result; and to feed back the integrity verification result to the Internet of Things collection terminal from a Netty channel outside the one-way transmission channel. The Internet of Things collection terminal is configured to receive the integrity verification result, generate a prediction result for predicting data integrity of one-way transmission, and autonomously compare the integrity verification result and the prediction result; if the prediction result is the same as the integrity verification result, the comparison result is consistent; if the prediction result is different from the integrity verification result, the comparison result is inconsistent. The data verification terminal is configured to obtain the comparison result from the Internet of Things collection terminal; if the comparison result is consistent, the data transmission is verified to pass in terms of data integrity; and if the comparison result is inconsistent, the transmission is verified to fail in terms of data integrity.
[0014] In addition, to achieve the above object, the present application further provides a data verification device, which is an entity node device, and includes a memory, a processor, and a data verification program stored in the memory and executable on the processor, wherein the processor executes the data verification program to implement the steps of the data verification method.
[0015] In addition, to achieve the above object, the present application further provides a storage medium having a data verification program stored thereon, wherein the data verification program is executable on a processor to implement the steps of the data verification method.
[0016] The application provides a data verification method, system, device and storage medium. Compared with the technical problem of low verification efficiency in verifying data integrity in a one-way network environment in the prior art, in the application, when transmission task information containing a data packet to be transmitted is acquired from an Internet of Things collection terminal, a verification task identifier is generated based on the transmission task information; the verification task identifier is subjected to serialization processing to obtain a binary file; the binary file is one-way transmitted to a receiving terminal for verifying data integrity by the receiving terminal, wherein the receiving terminal feeds back an integrity verification result from a Netty channel outside the one-way transmission channel to the Internet of Things collection terminal after verifying data integrity; for one-way transmission of the binary file, a prediction result of data integrity of one-way transmission is generated in the Internet of Things collection terminal; when it is detected that the receiving terminal feeds back the integrity verification result to the Internet of Things collection terminal, a comparison result of consistency of the prediction result and the integrity verification result is acquired from the Internet of Things collection terminal; if the comparison result is that the prediction result is consistent with the integrity verification result, data transmission is passed in terms of data integrity, and if the comparison result is that the prediction result is inconsistent with the integrity verification result, data transmission is not passed in terms of data integrity. In the application, by means of binary stream conversion file and the Netty channel mechanism, and by means of a comparison mapping algorithm, the limitation of bidirectional feedback is broken through, the sending end can autonomously verify without accessing data of the receiving end, and the limitation of end-to-end integrity verification depending on bidirectional feedback and a network protocol is broken through. Protobuf serialization compresses the data volume, reduces the calculation and transmission overhead, and improves the verification efficiency when verifying data integrity in a one-way network environment. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 A flowchart of an embodiment of the data verification method of the application; Figure 2 A data verification system schematic diagram in an embodiment of the data verification device of the application; Figure 3 A device structure schematic diagram of a hardware running environment related to an embodiment of the data verification method of the application. DETAILED DESCRIPTION
[0018] To make the above objectives, characteristics and advantages of the application more apparent, clear and complete, the technical solutions in the embodiments of the application will be described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the application.
[0019] Embodiment one The embodiment of the present application provides a data verification method. In the first embodiment of the data verification method, referring to Figure 1 , the method is applied to a data verification device, and the method comprises the following steps S110-S150: S110, when transmission task information containing a to-be-transmitted data packet is acquired from an Internet of Things collection terminal, generating a verification task identifier based on the transmission task information; In an Internet of Things system, a device collects data through a preset Internet of Things sensor, such as collecting temperature, humidity or device state data, and then transmits the collected data to a data center or cloud through a network. In the scene of industrial control, energy management or military system which requires high security, in order to prevent data leakage or external attack, a one-way network transmission mode is generally used to realize one-way transmission of data from a low security domain to a high security domain.
[0020] In the prior art, an Internet of Things device such as an Internet of Things sensor reports the collected data, and the integrity of the reported data needs to be verified. A complex verification algorithm is generally used to generate a data check value, and the receiving terminal recalculates to verify the integrity in the data transmission process.
[0021] Data transmission is usually based on Message Queuing Telemetry Transport (MQTT) or Constrained Application Protocol (CoAP) to realize efficient transmission through a lightweight message format. The receiving terminal checks, stores and analyzes the data to ensure data integrity and reliability. Although the prior art has made certain progress in data integrity verification, there are still the following problems: resource limitation problem, IoT devices are usually low-power and low-computing-capability devices, which are difficult to support high-computing-complexity verification algorithms, resulting in low verification efficiency. Problem of heterogeneous data difficult to process, the data format generated by a large number of IoT devices is heterogeneous, and the traditional MQTT or CoAP network protocol is difficult to efficiently process in a high-concurrency scene. Network protocol security risk problem, in specific security fields such as military or energy, the traditional network protocol may have potential security risks, and it is difficult to meet the strict isolation and leakage prevention requirements. One-way network limitation problem, one-way network prohibits two-way communication, and the traditional verification mechanism based on two-way interaction (such as challenge-response authentication) cannot be directly applied, which limits the flexibility of the verification method.
[0022] In summary, since the Internet of Things devices are usually low-power, low-computing-capability devices, it is difficult to support high-computing-complexity verification algorithms, and only simple verification algorithms can be arranged, which is difficult to efficiently process massive heterogeneous data in a high-concurrency scenario, and the verification efficiency is low. Therefore, in the prior art, there is a technical problem of low verification efficiency when verifying data integrity in a unidirectional network environment.
[0023] The data packet of the transmission task information includes a preset transmission task identifier, a terminal identifier of the Internet of Things collection terminal, a timestamp, a byte length of the data packet, and data content to be transmitted. The step S110 includes steps S1101-S1102: In step S1101, when the transmission task information containing the data packet to be transmitted is obtained from the Internet of Things collection terminal, the transmission task identifier, the terminal identifier of the Internet of Things collection terminal, the timestamp, the byte length of the data packet, and the data content to be transmitted are generated into a first data digest. Internet of Things (IoT) refers to the interconnection between objects and people through sensors or communication modules and other devices, and is widely used in industrial control, smart home, Internet of Vehicles, etc.
[0024] A unidirectional network refers to a network architecture that allows data to be transmitted only from a sending end to a receiving end, and is usually implemented through a data diode or a unidirectional gateway, and is used in high-security scenarios to prevent data leakage or external attacks.
[0025] Data integrity refers to the characteristic of ensuring that data is not tampered with, lost, or forged during generation, transmission, and storage.
[0026] The data verification system includes a data verification terminal, an Internet of Things collection terminal, and a receiving terminal, and the data verification terminal, the Internet of Things collection terminal, and the receiving terminal are all in communication connection.
[0027] First, the Internet of Things collection terminal collects monitoring data, generates a data packet from the collected monitoring data such as temperature, humidity, or device status, and the data packet includes a preset transmission task identifier, a terminal identifier of the Internet of Things collection terminal (referred to as device ID), a timestamp, a byte length of the data packet, and data content to be transmitted. In addition to generating a data packet, the Internet of Things collection terminal generates a first data digest based on a hash algorithm from the transmission task identifier, device ID, timestamp, byte length of the data packet, and data content to be transmitted in the data packet.
[0028] The data digest is equivalent to a digital fingerprint of a piece of data, and a string of fixed-length random alphanumeric code (hash value) is generated based on a hash algorithm. The generated random alphanumeric code is the data digest. The main use of the data digest is to check the data integrity. If the digests calculated by both parties for the same data packet are consistent, it means that the data packet is complete during transmission. If the digests are inconsistent, it means that the data packet may be tampered with or other problems occur during transmission, and the data is incomplete.
[0029] The data verification terminal obtains the transmission task information from the Internet of Things collection terminal, wherein the transmission task information includes a data packet to be transmitted and a data digest corresponding to the data packet.
[0030] In step S1102, the transmission task identifier, the terminal identifier of the Internet of Things collection terminal, the timestamp, the byte length of the data packet, and the first data digest are used to generate a verification task identifier.
[0031] The transmission task identifier is a set of features or metadata that uniquely identifies a specific data collection task or data processing flow. It contains information such as the source, destination, and attributes of the task.
[0032] As an example, the transmission task identifier can be a task fingerprint.
[0033] Task fingerprints and other transmission task identifiers contain task IDs, task targets, task parameters, task initiators, and security credentials. The task ID is a unique serial number generated by the system. The security credentials are used to verify the signature or token of the task.
[0034] In this embodiment, the transmission task identifier used is only the task ID. The data verification terminal generates a verification task identifier from the first data digest, the task ID, the device ID, the timestamp, and the byte length of the data packet. The verification task identifier here can also be a verification task fingerprint.
[0035] In step S120, the verification task identifier is serialized to obtain a binary file. Serialization refers to the process of converting data structures or object states into a format that can be stored or transmitted.
[0036] When massive Internet of Things collection devices collect data, the device differences of different Internet of Things collection devices are different in data representation, and the obtained data format is not unified. In order to solve this data heterogeneity problem, the collected data is serialized to obtain a neutral representation that is independent of the platform, language, and memory layout.
[0037] The format obtained after the serialization processing can be a JSON format, which is a commonly used serialization format at present. The JSON format is lightweight, easy to read, and supported by almost all modern programming languages.
[0038] The format obtained after the serialization processing can also be a binary format. Such binary format is friendly to machines, small in size, and fast in serialization speed, but cannot be directly read by humans.
[0039] Here, unlike the prior art that transmits data through a transmission protocol such as MQTT or CoAP, binary stream conversion files are converted to binary file form, and data packets are transmitted through file transmission rather than traditional network protocols, which is suitable for high-security scenarios.
[0040] In this embodiment, the verification task fingerprint is serialized with the data packet to obtain a flattened string such as Protobuf, which is serialized into a binary file in the Protobuf format for one-way transmission.
[0041] The difference between binary stream transmission data and prior art protocol-based transmission data is that binary stream transmission is simple and flexible. When binary stream transmission is used, it is a continuous binary stream without additional metadata such as file name, type, size, etc. to describe the file. When protocol-based transmission data is used, there is usually a fixed data format, including a header and a body. The header contains metadata such as content type, length, encoding, etc., and the body contains the actual data. The receiver can obtain this metadata by parsing the header. From the perspective of the application layer, it does not care about the internal structure of the file. An IoT collection terminal collects a JPEG picture or a text file, which is treated as a long continuous byte stream without distinction during transmission. The data structure of the collected data is interpreted by the corresponding application program such as a picture viewer. Therefore, the binary data stream transmission method is very suitable for scenarios where a large number of IoT collection terminals collect data and need to report data.
[0042] After the serialization processing, the binary file is also transmitted to the receiving terminal.
[0043] The steps of step S120 include steps S1201-S1202: Step S1201, converting the verification task identifier into a Protobuf format to obtain a Protobuf data format file; As an example, the Protobuf format is used to compress the data volume. The first data digest contained in the verification task ID, the task ID of the transmission task, the device ID, the timestamp, and the byte length of the data packet are converted into the Protobuf format as follows, where task_id represents the task ID of the transmission task, device_id represents the device ID, timestamp represents the timestamp, data_length represents the byte length, data represents the data content, and hash represents the first data digest.
[0044] The following is an example of the definition of the Protobuf data structure: syntax = "proto3"; message IoTDataPacket { string task_id = 1; string device_id = 2; string timestamp = 3; int32 data_length = 4; repeated float data = 5; string hash = 6; } In step S1202, the file in the Protobuf data format is converted into a binary stream to obtain a binary file.
[0045] The file in the Protobuf data format is converted into a binary stream to transmit the file completely and ensure that the receiving party obtains an identical file copy as the sending party.
[0046] In step S130, the binary file is unidirectionally transmitted to the receiving terminal for the receiving terminal to verify the data integrity. After the receiving terminal verifies the data integrity, the integrity verification result is fed back to the Internet of Things collection terminal from a Netty channel outside the unidirectional transmission channel. For the unidirectional transmission of the binary file, a prediction result of the data integrity of the unidirectional transmission is generated in the Internet of Things collection terminal. The data verification terminal unidirectionally transmits the binary file to the receiving terminal.
[0047] When receiving the binary file, the receiving terminal verifies the data integrity based on the binary file to obtain an integrity verification result.
[0048] As an example, the receiving terminal server receives a binary file, parses the Protobuf format, extracts the task ID, device ID, timestamp, data length, data content, and first data digest.
[0049] The receiving terminal uses the same hash algorithm to recalculate the data digest of the data packet, including the task ID, device ID, timestamp, data length, and data content, to obtain a second data digest. The receiving terminal generates the second data digest in the same process as the first data digest generated by the IoT collection terminal.
[0050] The receiving terminal compares the calculated second data digest with the received first data digest. If they are consistent, the data is complete, otherwise an abnormality is triggered.
[0051] The receiving terminal feeds back the integrity verification result from the Netty channel outside the one-way transmission channel to the IoT collection terminal. Specifically, the one-way transmission starts from the Netty channel to the network gate or gateway, and the integrity verification result is controlled to be transmitted to the IoT collection terminal based on the network gate or gateway.
[0052] Based on the high-performance asynchronous event-driven channel mechanism of the Netty framework, binary file transmission is efficiently processed. All I / O operations supported by the Netty channel are asynchronous, and I / O operations are initiated by calling the channel method. The asynchronous, event-driven, and pipeline-based characteristics of the Netty channel enable Netty to build high-performance, high-concurrency, and maintainable network applications.
[0053] In this embodiment, after the receiving terminal parses the binary file, the time stamp parsed by the receiving terminal is verified for timeliness. If the timestamp is within the preset time window, the transmission task identifier parsed, the terminal identifier of the IoT collection terminal, the timestamp, the byte length of the data packet, and the data content to be transmitted are continued to generate a second data digest. If the timestamp is not within the preset time window, it is confirmed that there is a replay attack.
[0054] Replay attack refers to an attack mode in which an attacker intercepts and repeatedly sends legitimate data packets to impersonate legitimate devices for fraud. The multi-dimensional task fingerprint includes task ID, device ID, timestamp, data length, and data digest. The multi-dimensional task fingerprint of this embodiment can effectively prevent data tampering and replay attacks.
[0055] By adding a timestamp to the data packet, the receiving end verifies the timeliness of the timestamp to prevent replay attacks.
[0056] Step S140, when detecting that the receiving terminal feeds back the integrity verification result to the IoT collection terminal, acquiring the comparison result of self-comparing the consistency of the predicted result and the integrity verification result from the IoT collection terminal; The integrity verification result obtained by the receiving terminal comparing the calculated second data digest with the received first data digest can be "yes", that is, consistent, or "no", that is, inconsistent.
[0057] The receiving terminal generates a state fingerprint or a state code according to the verification result, which contains the following information: Task ID: corresponding to the sending terminal task.
[0058] Verification result: whether the data integrity verification is passed (true / false).
[0059] Timestamp: verification completion time.
[0060] The receiving terminal transmits the state fingerprint or the state code to the IoT collection terminal in the form of a binary file through another one-way channel such as an independent network gate. In the IoT collection terminal, the IoT collection terminal generates a predicted result of predicting the data integrity of the one-way transmission. The IoT collection terminal self-comparing the integrity verification result and the predicted result. If the predicted result and the integrity verification result are the same, the comparison result is consistent, and if the predicted result and the integrity verification result are not the same, the comparison result is inconsistent.
[0061] The IoT collection terminal self-verification, the IoT collection terminal uses the predicted algorithm, generates the expected state fingerprint based on the rules of the task ID and the timestamp, compares with the received state fingerprint, and confirms whether the data is complete and received.
[0062] The predicted result and the integrity verification result are represented by a state code, and the steps of step S140 include steps S1401-S1403: Step S1401, when detecting that the receiving terminal feeds back the integrity verification result to the IoT collection terminal, generating a verification state code from the integrity verification result, wherein the IoT collection terminal generates a predicted state code from the predicted result; Step S1402, generating a JSON format data set from the verification state code, the verification task identification and the verification completion timestamp, and sending the JSON format data set to the IoT collection terminal; As an example, the receiving terminal generates a structured JSON data set from the verification state code, the verification task identification and the verification completion timestamp, and the format is as follows: is_valid indicates the integrity verification result, which can be true or false. status_code indicates the verification status code.
[0063] { "task_id": "TASK_001", "device_id": "IoT_001", "timestamp": "2025-08-28T23:42:56Z", "data_length": 128, "data": [25.5, 1013.2], "hash": "a1b2c3d4e5f6", "is_valid": true, "status_code": "OK" } Step S1403, obtaining the comparison result of self-comparing the verification status code and the predicted status code from the Internet of Things collection terminal.
[0064] The Internet of Things collection terminal self-comparison of the verification status code and the predicted status code. Both are consistent, or both are inconsistent.
[0065] The data verification terminal obtains the comparison result from the Internet of Things collection terminal. If the comparison result is consistent, the data transmission is passed in terms of data integrity. If the comparison result is inconsistent, the transmission is not passed in terms of data integrity.
[0066] Step S150, if the comparison result is that the predicted result and the integrity verification result are consistent, the data transmission is passed in terms of data integrity. If the comparison result is that the predicted result and the integrity verification result are inconsistent, the data transmission is not passed in terms of data integrity.
[0067] The application provides a data verification method, system, device and storage medium. Compared with the technical problem of low verification efficiency in verifying data integrity in a one-way network environment in the prior art, in the application, when transmission task information containing a data packet to be transmitted is acquired from an Internet of Things collection terminal, a verification task identifier is generated based on the transmission task information; the verification task identifier is subjected to serialization processing to obtain a binary file; the binary file is unidirectionally transmitted to a receiving terminal for verifying data integrity by the receiving terminal, wherein the receiving terminal feeds back an integrity verification result to the Internet of Things collection terminal from a Netty channel outside the unidirectional transmission channel after verifying data integrity; for unidirectional transmission of the binary file, a prediction result of data integrity of unidirectional transmission is generated in the Internet of Things collection terminal; when it is detected that the receiving terminal feeds back the integrity verification result to the Internet of Things collection terminal, a comparison result of consistency of the prediction result and the integrity verification result is acquired from the Internet of Things collection terminal; if the comparison result is that the prediction result is consistent with the integrity verification result, data transmission is passed in terms of data integrity, and if the comparison result is that the prediction result is inconsistent with the integrity verification result, data transmission is failed in terms of data integrity. In the application, by means of binary stream conversion file and the Netty channel mechanism, and by means of a comparison mapping algorithm, the limitation of bidirectional feedback is broken, the sending end can autonomously verify without accessing data of the receiving end, and the limitation of end-to-end integrity verification depending on bidirectional feedback and network protocols is broken. Protobuf serialization compresses data volume, reduces calculation and transmission overhead, and improves the verification efficiency when verifying data integrity in a one-way network environment.
[0068] Embodiment two Further, based on all the above embodiments, another embodiment of the application is provided, such as Figure 2 A data verification system is provided, comprising a data verification terminal, an Internet of Things collection terminal and a receiving terminal, the data verification terminal, the Internet of Things collection terminal and the receiving terminal are in communication connection, and the system comprises: The Internet of Things collection terminal is used for collecting monitoring data, generating a data packet from the collected monitoring data, the data packet comprises a preset transmission task identifier, a terminal identifier of the Internet of Things collection terminal, a timestamp, a byte length of the data packet and data content to be transmitted; and is further used for generating a first data digest based on a hash algorithm, the transmission task identifier, the terminal identifier of the Internet of Things collection terminal, the timestamp, the byte length of the data packet and the data content to be transmitted in the data packet; The data verification terminal is configured to generate a verification task identifier based on the first data digest, the transmission task identifier, the terminal identifier of the Internet of Things collection terminal, the timestamp, and the byte length of the data packet; to perform serialization processing on the verification task identifier and the data packet to obtain a binary file; and to transmit the binary file to the receiving terminal. The receiving terminal is configured to receive the binary file, verify data integrity based on the binary file, and obtain an integrity verification result; and to feed back the integrity verification result to the Internet of Things collection terminal from a Netty channel outside the one-way transmission channel. The Internet of Things collection terminal is configured to receive the integrity verification result, generate a prediction result for predicting data integrity of one-way transmission, and autonomously compare the integrity verification result and the prediction result; if the prediction result is the same as the integrity verification result, the comparison result is consistent; if the prediction result is different from the integrity verification result, the comparison result is inconsistent. The data verification terminal is configured to obtain the comparison result from the Internet of Things collection terminal; if the comparison result is consistent, the data transmission passes the data integrity verification; and if the comparison result is inconsistent, the data transmission fails the data integrity verification.
[0069] The data verification system of the present application has the same implementation as the above-mentioned data verification method, and will not be described again.
[0070] Embodiment Three Further, based on all the above embodiments, another embodiment of the present application is provided, in which a data verification device is provided, which is an entity node device, and the data verification device comprises a memory, a processor, and a program stored in the memory for implementing the data verification method. The memory is configured to store the program for implementing the data verification method; and the processor is configured to execute the program for implementing the data verification method to implement the steps of the data verification method in the above-mentioned embodiments.
[0071] Reference Figure 3 , Figure 3 is a device structure schematic diagram of a hardware running environment involved in the embodiment scheme of the present application.
[0072] As Figure 3As shown, the data verification device can include a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection communication between the processor 1001 and the memory 1005. The memory 1005 can be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0073] In a possible implementation of the present application, the data verification device can further include a network interface, an audio circuit, a display, a connection line, a sensor, an input module, and the like. The network interface can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface, a Bluetooth interface), and the input module can optionally include a keyboard (KeyboarC), a system soft keyboard, a voice input, a wireless receiving input, and the like.
[0074] Those skilled in the art can understand that the data verification device structure does not constitute a limitation on the data verification device, and can include more or fewer components than the illustrated, or combine certain components, or different component arrangements.
[0075] As a kind of determination machine storage medium can include operating system, information exchange module and data verification program in the memory. The operating system is the program of management and control data verification device hardware and software resources, supports the operation of data verification program and other software and / or program. The information exchange module is used to realize the communication between the components in the memory, and the communication with other hardware and software in the management system.
[0076] In the data verification device, the processor is used to execute the data verification program stored in the memory, and realizes the steps of the above-mentioned data verification.
[0077] The data verification device specific embodiments of the present application are basically the same as the above-mentioned data verification method embodiments, and will not be repeated here.
[0078] Embodiment Four The embodiment of the present application provides a storage medium, and the storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to realize the steps of the data verification method in the above-mentioned embodiments.
[0079] The storage medium specific embodiments of the present application are basically the same as the above-mentioned data verification method embodiments, and will not be repeated here.
[0080] It should be noted that, in this document, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0081] The above-mentioned sequence numbers of embodiments of the present application are only for description, and do not represent advantages or disadvantages of the embodiments.
[0082] Those skilled in the art can clearly understand the above-mentioned embodiment methods from the description of the above embodiments, which can be realized by software and necessary general hardware platforms, of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM or a RAM, a magnetic disk, an optical disk) as described above, and includes a plurality of instructions for making a terminal device (which can be a mobile phone, a server, an air conditioner, or a network device) execute the methods described in various embodiments of the present application.
[0083] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the content of the specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A data verification method, characterized in that, The method includes: When the transmission task information containing the data packet to be transmitted is obtained from the IoT acquisition terminal, a verification task identifier is generated based on the transmission task information. The verification task identifier is serialized to obtain a binary file; The binary file is transmitted unidirectionally to the receiving terminal for the receiving terminal to verify data integrity. After verifying the data integrity, the receiving terminal feeds back the integrity verification result to the IoT acquisition terminal through a Netty channel outside the unidirectional transmission channel. For the unidirectional transmission of the binary file, the IoT acquisition terminal generates a prediction result to predict the data integrity of the unidirectional transmission. When the integrity verification result is detected to be fed back from the receiving terminal to the IoT acquisition terminal, the consistency comparison result between the prediction result and the integrity verification result is obtained from the IoT acquisition terminal. If the comparison result shows that the prediction result is consistent with the integrity verification result, then the data transmission verification is successful in terms of data integrity. If the comparison result shows that the prediction result is inconsistent with the integrity verification result, then the data transmission verification is unsuccessful in terms of data integrity.
2. The data verification method according to claim 1, characterized in that, The data packet containing the transmission task information includes a preset transmission task identifier, a terminal identifier of the IoT acquisition terminal, a timestamp, the byte length of the data packet, and the data content to be transmitted. The step of generating a verification task identifier based on the transmission task information when the transmission task information containing the data packet to be transmitted is obtained from the IoT acquisition terminal includes: When the transmission task information containing the data packet to be transmitted is obtained from the IoT acquisition terminal, the transmission task identifier, the terminal identifier of the IoT acquisition terminal, the timestamp, the byte length of the data packet, and the data content to be transmitted are used to generate a first data digest. The verification task identifier is generated by combining the transmission task identifier, the terminal identifier of the IoT acquisition terminal, the timestamp, the byte length of the data packet, and the first data digest.
3. The data verification method according to claim 2, characterized in that, When the receiving terminal receives the binary file, the receiving terminal parses the binary file. The receiving terminal generates a second data digest from the parsed transmission task identifier, the terminal identifier of the IoT acquisition terminal, the timestamp, the byte length of the data packet, and the data content to be transmitted. The process of the receiving terminal generating the second data digest is the same as that of the IoT acquisition terminal generating the first data digest. The receiving terminal verifies the second data digest. If the second data digest is consistent with the first data digest, the integrity verification result is determined to be complete. If the second data digest is inconsistent with the first data digest, the integrity verification result is determined to be incomplete.
4. The data verification method according to claim 3, characterized in that, After the receiving terminal parses the binary file, the timeliness of the timestamp obtained by the receiving terminal is verified. If the timestamp is within a preset time window, then the receiving terminal continues the step of generating a second data digest from the parsed transmission task identifier, the terminal identifier of the IoT acquisition terminal, the timestamp, the byte length of the data packet, and the data content to be transmitted; If the timestamp is not within the preset time window, a replay attack is confirmed to be present.
5. The data verification method according to claim 1, characterized in that, The prediction result and the integrity verification result are represented by status codes. The step of obtaining the comparison result of the consistency between the prediction result and the integrity verification result from the IoT acquisition terminal includes: When the integrity verification result is detected by the receiving terminal to the IoT acquisition terminal, the integrity verification result is generated into a verification status code, wherein the IoT acquisition terminal generates a prediction status code from the prediction result; Generate a dataset in JSON format from the verification status code, the verification task identifier, and the verification completion timestamp, and send the dataset in JSON format to the IoT data acquisition terminal. The system obtains the comparison results from the IoT data acquisition terminal, which automatically compare the consistency between the verification status code and the predicted status code.
6. The data verification method according to claim 1, characterized in that, The step of serializing the verification task identifier to obtain a binary file includes: The verification task identifier is converted to Protobuf format to obtain a file in Protobuf data format; The Protobuf data format file is converted into a binary stream to obtain a binary file.
7. The data verification method according to claim 1, characterized in that, After verification, the receiving terminal transmits the integrity verification result from the Netty channel to a preset network gateway or control gateway, and controls the unidirectional transmission of the integrity verification result to the IoT acquisition terminal based on the network gateway or control gateway.
8. A data verification system, characterized in that, The data verification system includes a data verification terminal, an IoT acquisition terminal, and a receiving terminal. The data verification terminal establishes a communication connection with the IoT acquisition terminal and the receiving terminal. An IoT data acquisition terminal is used to collect monitoring data and generate data packets from the collected monitoring data. The data packets include a preset transmission task identifier, an IoT data acquisition terminal identifier, a timestamp, the byte length of the data packet, and the data content to be transmitted. It is also used to generate a first data digest based on a hash algorithm using the transmission task identifier, the IoT data acquisition terminal identifier, the timestamp, the byte length of the data packet, and the data content to be transmitted in the data packets. A data verification terminal is used to generate a verification task identifier from the first data digest, the transmission task identifier, the terminal identifier of the IoT acquisition terminal, the timestamp, and the byte length of the data packet; it is also used to serialize the verification task identifier and the data packet to obtain a binary file. It is also used to transmit the binary file to the receiving terminal; The receiving terminal is used to receive the binary file, verify the data integrity based on the binary file, and obtain the integrity verification result; it is also used to feed back the integrity verification result to the IoT acquisition terminal from the Netty channel outside the unidirectional transmission channel; The IoT data acquisition terminal is used to receive the integrity verification result, generate a prediction result for predicting the integrity of data transmitted in one direction, and autonomously compare the integrity verification result and the prediction result. If the prediction result is the same as the integrity verification result, the comparison result is consistent; if the prediction result is different from the integrity verification result, the comparison result is inconsistent. A data verification terminal is used to obtain comparison results from the IoT acquisition terminal. If the comparison results are consistent, the data transmission is verified to be successful in terms of data integrity. If the comparison results are inconsistent, the transmission is verified to be unsuccessful in terms of data integrity.
9. A data verification device, characterized in that, The method includes a memory, a processor, and a data verification program stored in the memory and executable on the processor, wherein the processor executes the data verification program to implement the steps of the data verification method according to any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores a program that implements the data verification method, which is executed by a processor to implement the steps of the data verification method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
A processing system for intelligently judging and predicting occurrence of events
CN109558966A
Transparent data integrity auditing and transparent encrypted data deduplication protocol based on block chain
CN110278076A
Renewable energy microgrid replay attack-oriented detection, isolation and positioning method
CN114785568A
Data acquisition method and semi-closed network data acquisition system
CN120200792A
Bidirectional authentication security mobile communication method and system based on public key digital fingerprint
CN120475369A