Data verification method, system, device, and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-08-11
AI Technical Summary
[0005]本发明的主要目的在于提供一种数据验证方法,旨在解决现有技术中,在单向网络环境下验证数据完整性时,验证效率不高的技术问题
[0034]本申请提供一种数据验证方法、系统、设备及存储介质,与现有技术中,在单向网络环境下验证数据完整性时,验证效率不高的技术问题相比,在本申请中,在从物联网采集终端中获取到包含有待传输数据包的传输任务信息时,基于所述传输任务信息,生成验证任务标识;将所述验证任务标识进行序列化处理,得到二进制的文件;将所述二进制的文件单向传输给接收终端以供所述接收终端进行验证数据完整性,其中,所述接收终端验证数据完整性后将完整性验证结果从单向传输通道之外的Netty通道反馈给所述物联网采集终端;针对单向传输所述二进制的文件,所述物联网采集终端中生成有对单向传输的数据完整性进行预测的预测结果;在检测到所述接收终端向所述物联网采集终端反馈所述完整性验证结果时,从所述物联网采集终端中获取自主比对所述预测结果与所述完整性验证结果的一致性的比对结果;若所述比对结果为所述预测结果与所述完整性验证结果是一致的,则验证数据传输在数据完整性方面是通过的,若所述比对结果为所述预测结果与所述完整性验证结果是不一致的,则验证数据传输在数据完整性方面是不通过的。在本申请中,通过二进制流转换文件方式和 Netty通道机制,通过比对映射算法,突破双向反馈限制,发送端无需访问接收端数据即可自主验证,突破端到端完整性验证依赖双向反馈和网络协议的限制。Protobuf 序列化压缩数据体积降低计算和传输开销,提高了在单向网络环境下验证数据完整性时的验证效率。
Smart Images

Figure CN121462276B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things (IoT) data security technology, and in particular to a data verification method, system, device, and storage medium. Background Technology
[0002] In Internet of Things (IoT) systems, IoT devices collect data through sensors and then report it to a data center or cloud via a network. For scenarios with stringent data transmission security requirements, such as industrial control, energy management, and military applications, a one-way network is typically used to prevent data leakage or external attacks, enabling unidirectional data transmission from a low-security domain to a high-security domain via a network gateway or isolation gate. During this unidirectional transmission, the integrity of the data reported by the IoT devices needs to be verified.
[0003] In existing technologies, IoT devices are typically low-power, low-computing-power devices, making it difficult to support computationally complex verification algorithms. They can only deploy simple verification algorithms, which struggle to efficiently process massive amounts of heterogeneous data in high-concurrency scenarios, resulting in low verification efficiency. Therefore, existing technologies suffer from low verification efficiency when verifying data integrity in unidirectional network environments.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this invention is to provide a data verification method that aims to solve the technical problem of low verification efficiency in the prior art when verifying data integrity in a one-way network environment.
[0006] To achieve the above objectives, this application provides a data verification method, which generates a verification task identifier based on the transmission task information when it obtains transmission task information containing data packets to be transmitted from an IoT data acquisition terminal.
[0007] The verification task identifier is serialized to obtain a binary file;
[0008] 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.
[0009] 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.
[0010] 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.
[0011] In one possible implementation of this application, 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:
[0012] 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.
[0013] 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.
[0014] In one possible implementation of this application, 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.
[0015] In one possible implementation of this application, after the receiving terminal parses the binary file, the timeliness of the timestamp obtained by the receiving terminal is verified.
[0016] 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;
[0017] If the timestamp is not within the preset time window, a replay attack is confirmed to be present.
[0018] In one possible implementation of this application, the prediction result and the integrity verification result are represented by status codes, and 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:
[0019] 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;
[0020] 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.
[0021] 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.
[0022] In one possible implementation of this application, the step of serializing the verification task identifier to obtain a binary file includes:
[0023] The verification task identifier is converted to Protobuf format to obtain a file in Protobuf data format;
[0024] The Protobuf data format file is converted into a binary stream to obtain a binary file.
[0025] In one possible implementation of this application, other channels besides the unidirectional transmission channel include the Netty channel. 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.
[0026] Furthermore, to achieve the above objectives, this application also provides a data verification system, which 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.
[0027] 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.
[0028] A data verification terminal is configured 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 configured to serialize the verification task identifier and the data packet to obtain a binary file; and it is further configured to transmit the binary file to the receiving terminal.
[0029] 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;
[0030] 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.
[0031] 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.
[0032] In addition, to achieve the above objectives, this application also provides a data verification device, which is a physical node device. The data verification device includes: a memory, a processor, and a data verification program stored in the memory and executable on the processor. The processor executes the data verification program to implement the steps of the data verification method.
[0033] In addition, to achieve the above objectives, this application also provides a storage medium storing a program that implements a data verification method, wherein the data verification program, when executed by a processor, implements the steps of the data verification method described above.
[0034] This application provides a data verification method, system, device, and storage medium. Compared with the existing technology, which suffers from low verification efficiency when verifying data integrity in a one-way network environment, this application, upon obtaining transmission task information containing data packets to be transmitted from an IoT acquisition terminal, generates a verification task identifier based on the transmission task information; serializes the verification task identifier to obtain a binary file; and transmits the binary file unidirectionally to a receiving terminal for the receiving terminal to verify data integrity. After verifying data integrity, the receiving terminal feeds back the integrity verification result to the IoT device via a Netty channel outside the unidirectional transmission channel. The IoT data acquisition terminal generates a prediction result for the integrity of the data transmitted unidirectionally, specifically for the binary file. When the integrity verification result is detected by the receiving terminal, a comparison result is obtained from the IoT data acquisition terminal to independently compare the prediction result with the integrity verification result. If the comparison result shows that the prediction result and the integrity verification result are consistent, the data transmission is verified as having passed in terms of data integrity; otherwise, the data transmission fails in terms of data integrity. In this application, by using a binary stream conversion file method and the Netty channel mechanism, and through a comparison mapping algorithm, the limitation of bidirectional feedback is overcome. The sending end can independently verify the data without accessing the receiving end's data, thus overcoming the limitation of end-to-end integrity verification relying on bidirectional feedback and network protocols. Protobuf serialization compresses the data volume, reducing computational and transmission overhead and improving the verification efficiency when verifying data integrity in a unidirectional network environment. Attached Figure Description
[0035] Figure 1 This is a flowchart illustrating an embodiment of the data verification method of this application;
[0036] Figure 2 This is a schematic diagram of the data verification system in an embodiment of the data verification device of this application;
[0037] Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the data verification method embodiments of this application. Detailed Implementation
[0038] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] Example 1
[0040] This application provides a data verification method. In the first embodiment of the data verification method of this application, referring to... Figure 1 The method is applied to a data verification device, and the method includes steps S110-S150:
[0041] Step S110: 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.
[0042] In IoT systems, devices collect data via pre-set IoT sensors, such as temperature, humidity, or device status data, and then transmit the collected data to a data center or cloud via a network. In high-security scenarios such as industrial control, energy management, or military systems, unidirectional network transmission is generally used to prevent data leakage or external attacks, enabling one-way data transfer from a low-security domain to a high-security domain.
[0043] In existing technologies, IoT devices such as IoT sensors report the collected data, requiring verification of the data's integrity. This typically involves using complex verification algorithms to generate checksums, which are then recalculated at the receiving terminal to verify the integrity of the data transmission process.
[0044] Data transmission typically relies on Message Queuing Telemetry Transport (MQTT) or Constrained Application Protocol (CoAP) to achieve efficient transmission through lightweight message formats. The receiving terminal verifies, stores, and analyzes the data to ensure its integrity and reliability. While existing technologies have made some progress in data integrity verification, the following problems remain: Resource constraints: IoT devices are typically low-power, low-computing-power devices, making it difficult to support computationally complex verification algorithms, resulting in low verification efficiency. Heterogeneous data processing challenges: The data formats generated by massive numbers of IoT devices are heterogeneous, making it difficult for traditional MQTT or CoAP network protocols to handle efficiently in high-concurrency scenarios. Network protocol security vulnerabilities: In specific security fields such as military or energy sectors, traditional network protocols may pose potential security risks and struggle to meet stringent isolation and leakage prevention requirements. One-way network limitations: One-way networks prohibit bidirectional communication, making it impossible to directly apply traditional bidirectional interactive verification mechanisms (such as challenge-response authentication), limiting the flexibility of verification methods.
[0045] In summary, because IoT devices are typically low-power and low-computing-power devices, they struggle to support computationally complex verification algorithms and can only deploy simple ones. This makes them inefficient in handling massive amounts of heterogeneous data in high-concurrency scenarios, resulting in low verification efficiency. Therefore, existing technologies suffer from low verification efficiency when verifying data integrity in unidirectional network environments.
[0046] The data packet containing the transmission task information includes a preset transmission task identifier, the terminal identifier of the IoT acquisition terminal, a timestamp, the byte length of the data packet, and the data content to be transmitted. Step S110 includes steps S1101-S1102:
[0047] Step S1101: 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.
[0048] The Internet of Things (IoT) refers to the interconnection between objects and between objects and people through devices such as sensors or communication modules. It is widely used in fields such as industrial control, smart homes, and vehicle networking.
[0049] A one-way network is a network architecture that only allows data to be transmitted in one direction from the sender to the receiver. It is usually implemented through a data digitizer or one-way gateway and is used in high-security scenarios to prevent data leakage or external attacks.
[0050] Data integrity refers to the characteristics that ensure data is not tampered with, lost, or falsified during its generation, transmission, and storage.
[0051] The data verification system includes a data verification terminal, an IoT acquisition terminal, and a receiving terminal. The data verification terminal establishes communication connections with the IoT acquisition terminal and the receiving terminal.
[0052] First, the IoT data acquisition terminal collects monitoring data, such as temperature, humidity, or device status, and generates data packets. These data packets include a preset transmission task identifier, the IoT data acquisition terminal's terminal identifier (device ID), a timestamp, the data packet's byte length, and the data content to be transmitted. In addition to generating the data packets, the IoT data acquisition terminal also uses a hash algorithm to generate a first data digest from the transmission task identifier, device ID, timestamp, data packet's byte length, and the data content to be transmitted within the data packets.
[0053] In this context, a data digest is like a digital fingerprint of a data packet. It's generated using a hash algorithm, creating a fixed-length string of random alphanumeric codes (hash values) from the data packet's contents. The primary purpose of a data digest is to verify data integrity. By comparing the digests calculated by both parties for the same data packet, if they match, the data was transmitted intact. If they don't match, the data packet may have been tampered with or encountered other problems during transmission, and the data is incomplete.
[0054] The data verification terminal obtains transmission task information from the IoT acquisition terminal, which includes the data packet to be transmitted and the corresponding data digest.
[0055] Step S1102: Generate a verification task identifier using 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.
[0056] A transmission task identifier is a set of characteristics or metadata that uniquely identifies a specific data acquisition task or data processing flow. It includes information such as the task's source, purpose, and attributes.
[0057] As an example, the transmission task identifier can be a task fingerprint.
[0058] Task fingerprints, as a type of data transfer task identifier, include a task ID, task target, task parameters, task initiator, and security credentials. The task ID is a unique serial number generated by the system. The security credentials are a signature or token used to verify the legitimacy of the task.
[0059] In this embodiment, the transmission task identifier used is simply the task ID. The data verification terminal generates a verification task identifier from the first data digest, task ID, device ID, timestamp, and the byte length of the data packet. This verification task identifier can also be a verification task fingerprint.
[0060] Step S120: Serialize the verification task identifier to obtain a binary file;
[0061] Serialization is the process of converting the state of a data structure or object into a format that can be stored or transmitted.
[0062] When massive IoT data collection devices collect data, the differences between these devices lead to different data representations, resulting in a lack of standardized data formats. To address this data heterogeneity issue, the collected data is serialized to obtain a neutral representation that is independent of platform, language, and memory layout.
[0063] The serialization process yields a JSON format, which is currently the most commonly used serialization format. JSON is lightweight, easy to read, and supported by almost all modern programming languages.
[0064] The format obtained after serialization can also be binary. This type of binary format is machine-friendly, small in size, and has a fast serialization speed, but it cannot be read directly by humans.
[0065] Here, unlike existing technologies that use transport protocols such as MQTT and CoAP for data transmission, we perform binary stream conversion to convert data packets into binary files and transmit data via file transfer instead of traditional network protocols. This approach is suitable for high-security scenarios.
[0066] In this embodiment, the verification task fingerprint and the data packet are serialized to obtain a flattened string such as Protobuf, which is then serialized into a binary file using the Protobuf format for one-way transmission.
[0067] The difference between binary stream-based data transmission and existing protocol-based data transmission technologies lies in their simplicity and flexibility. Binary stream transmission produces a continuous binary stream without additional metadata such as filename, type, or size to describe the file. In contrast, protocol-based data transmission typically has a fixed data format, including a header and a body. The header contains metadata such as content type, length, and encoding, while the body contains the actual data. The receiver can obtain this metadata by parsing the header. From the application layer's perspective, the internal structure of the file is irrelevant. When an IoT data acquisition terminal collects a JPEG image or a text file, it is treated as a long, continuous, undifferentiated stream of bytes during transmission. The data structure of the collected data is interpreted by the corresponding application, such as an image viewer. Therefore, binary stream-based transmission is highly suitable for scenarios where massive numbers of IoT data acquisition terminals need to report the collected data.
[0068] After serialization, the binary file is transmitted to the receiving terminal.
[0069] Step S120 includes steps S1201-S1202:
[0070] Step S1201: Convert the verification task identifier to Protobuf format to obtain a file in Protobuf data format;
[0071] As an example, Protobuf format is used to compress the data volume. The data content, including 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, is converted to 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.
[0072] The following is an example of the definition of a Protobuf data structure:
[0073] syntax = "proto3";
[0074] message IoTDataPacket {
[0075] string task_id = 1;
[0076] string device_id = 2;
[0077] string timestamp = 3;
[0078] int32 data_length = 4;
[0079] repeated float data = 5;
[0080] string hash = 6;
[0081] }
[0082] Step S1202: Convert the Protobuf data format file into a binary stream to obtain a binary file.
[0083] The Protobuf data format file is converted into a binary stream and transmitted intact, ensuring that the receiver receives a file copy that is exactly the same as the sender's.
[0084] Step S130: The binary file is unidirectionally transmitted 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.
[0085] The data verification terminal transmits the binary file unidirectionally to the receiving terminal.
[0086] When receiving a binary file, the receiving terminal verifies the data integrity based on the binary file and obtains the integrity verification result.
[0087] As an example, the receiving terminal server receives a binary file, parses the Protobuf format, and extracts the task ID, device ID, timestamp, data length, data content, and first data digest.
[0088] 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 process by which the receiving terminal generates the second data digest is the same as the process by which the IoT data acquisition terminal generates the first data digest.
[0089] The receiving terminal compares the calculated second data digest with the received first data digest. If they match, the data is complete; otherwise, exception handling is triggered.
[0090] The receiving terminal feeds back the integrity verification result to the IoT acquisition terminal from the Netty channel, which is separate from the unidirectional transmission channel. Specifically, the data is transmitted unidirectionally from the Netty channel to the network gateway or isolation gateway, and the integrity verification result is then transmitted unidirectionally to the IoT acquisition terminal based on the network gateway or isolation gateway control.
[0091] Netty channels utilize a high-performance asynchronous event-driven channel mechanism based on the Netty framework to efficiently handle binary file transfers. All I / O operations in Netty are asynchronous, initiated by calling channel methods. The asynchronous, event-driven, and pipe-based nature of Netty channels enables the construction of high-performance, high-concurrency, and highly maintainable network applications.
[0092] In this embodiment, 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, the process continues with 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 exist.
[0093] A replay attack refers to an attack method in which an attacker intercepts and repeatedly sends legitimate data packets, impersonating a legitimate device to deceive the attacker. A multi-dimensional task fingerprint includes task ID, device ID, timestamp, data length, and data digest. The multi-dimensional task fingerprint in this embodiment can effectively prevent data tampering and replay attacks.
[0094] By adding a timestamp to the data packet, the receiving end verifies the timeliness of the timestamp to prevent replay attacks.
[0095] Step S140: 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.
[0096] The receiving terminal compares the calculated second data digest with the received first data digest to obtain an integrity verification result that can be "yes" (meaning they are consistent) or "no" (meaning they are inconsistent).
[0097] The receiving terminal generates a status fingerprint or status code based on the verification result, which includes the following information:
[0098] Task ID: Corresponds to the sending task.
[0099] Verification result: Whether the data integrity verification passed (true / false).
[0100] Timestamp: Verification completion time.
[0101] The receiving terminal transmits the status fingerprint or status code to the IoT acquisition terminal in binary file form via another unidirectional channel, such as an independent gateway. In the IoT acquisition terminal, a prediction result is generated to assess the integrity of the data transmitted unidirectionally. The IoT acquisition terminal autonomously compares the integrity verification result with 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.
[0102] The IoT data acquisition terminal performs autonomous verification. It uses a prediction algorithm to generate an expected state fingerprint based on the rule mapping of task ID and timestamp, and compares it with the received state fingerprint to confirm whether the data has been received completely.
[0103] The prediction result and the integrity verification result are represented by status codes. Step S140 includes steps S1401-S1403:
[0104] Step S1401: When the integrity verification result is detected by the receiving terminal to the IoT acquisition terminal, a verification status code is generated from the integrity verification result, wherein the IoT acquisition terminal generates a prediction status code from the prediction result.
[0105] Step S1402: 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.
[0106] As an example, the receiving terminal will generate a structured JSON dataset from the verification status code, the verification task identifier, and the verification completion timestamp, in the following format:
[0107] Here, is_valid represents the integrity verification result, which can be either true or false. status_code represents the verification status code.
[0108] {
[0109] "task_id": "TASK_001",
[0110] "device_id": "IoT_001",
[0111] "timestamp": "2025-08-28T23:42:56Z",
[0112] "data_length": 128,
[0113] "data": [25.5, 1013.2],
[0114] "hash": "a1b2c3d4e5f6",
[0115] "is_valid": true,
[0116] "status_code": "OK"
[0117] }
[0118] Step S1403: Obtain the comparison result of the consistency between the verification status code and the predicted status code from the IoT acquisition terminal.
[0119] The IoT data acquisition terminal autonomously compares and verifies the status code with the predicted status code. The two may either match or they may not match.
[0120] The data verification terminal obtains the comparison results from the IoT acquisition terminal. If the comparison results are consistent, the data transmission is verified to be in good condition in terms of data integrity. If the comparison results are inconsistent, the transmission is verified to be in bad condition in terms of data integrity.
[0121] Step S150: If the comparison result is consistent with the prediction result and the integrity verification result, then the data transmission verification is successful in terms of data integrity; if the comparison result is inconsistent with the prediction result and the integrity verification result, then the data transmission verification is unsuccessful in terms of data integrity.
[0122] This application provides a data verification method, system, device, and storage medium. Compared with the existing technology, which suffers from low verification efficiency when verifying data integrity in a one-way network environment, this application, upon obtaining transmission task information containing data packets to be transmitted from an IoT acquisition terminal, generates a verification task identifier based on the transmission task information; serializes the verification task identifier to obtain a binary file; and transmits the binary file unidirectionally to a receiving terminal for the receiving terminal to verify data integrity. After verifying data integrity, the receiving terminal feeds back the integrity verification result to the IoT device via a Netty channel outside the unidirectional transmission channel. The IoT data acquisition terminal generates a prediction result for the integrity of the data transmitted unidirectionally, specifically for the binary file. When the integrity verification result is detected by the receiving terminal, a comparison result is obtained from the IoT data acquisition terminal to independently compare the prediction result with the integrity verification result. If the comparison result shows that the prediction result and the integrity verification result are consistent, the data transmission is verified as having passed in terms of data integrity; otherwise, the data transmission fails in terms of data integrity. In this application, by using a binary stream conversion file method and the Netty channel mechanism, and through a comparison mapping algorithm, the limitation of bidirectional feedback is overcome. The sending end can independently verify the data without accessing the receiving end's data, thus overcoming the limitation of end-to-end integrity verification relying on bidirectional feedback and network protocols. Protobuf serialization compresses the data volume, reducing computational and transmission overhead and improving the verification efficiency when verifying data integrity in a unidirectional network environment.
[0123] Example 2
[0124] Furthermore, based on all the above embodiments, another embodiment of this application is provided, such as... Figure 2 A data verification system is provided, comprising 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. The system includes:
[0125] 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.
[0126] A data verification terminal is configured 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 configured to serialize the verification task identifier and the data packet to obtain a binary file; and it is further configured to transmit the binary file to the receiving terminal.
[0127] 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;
[0128] 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.
[0129] 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.
[0130] The specific implementation of the data verification system in this application is basically the same as the embodiments of the data verification method described above, and will not be repeated here.
[0131] Example 3
[0132] Furthermore, based on all the above embodiments, another embodiment of this application is provided. In this embodiment, a data verification device is provided. The data verification device is a physical node device. The data verification device includes: a memory, a processor, and a program stored in the memory for implementing the data verification method. The memory is used to store the program for implementing the data verification method; the processor is used to execute the program for implementing the data verification method to implement the steps of the data verification method in the above embodiments.
[0133] Reference Figure 3 , Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.
[0134] like Figure 3As shown, the data verification device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to establish communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM or a stable, non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0135] In one possible implementation of this application, the data verification device may further include a network interface, audio circuitry, display, connecting cable, sensor, input module, etc. The network interface may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface or a Bluetooth interface). The input module may optionally include a keyboard, a system soft keyboard, voice input, wireless receiver input, etc.
[0136] Those skilled in the art will understand that the structure of the data verification device does not constitute a limitation on the data verification device, and may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0137] A memory, as a deterministic storage medium, may include an operating system, an information exchange module, and a data verification program. The operating system is a program that manages and controls the hardware and software resources of the data verification device, supporting the operation of the data verification program and other software and / or programs. The information exchange module is used to enable communication between various components within the memory, as well as communication with other hardware and software in the management system.
[0138] In the data verification device, the processor is used to execute the data verification program stored in the memory to implement the data verification steps described above.
[0139] The specific implementation of the data verification device in this application is basically the same as the embodiments of the data verification method described above, and will not be repeated here.
[0140] Example 4
[0141] This application provides a storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the data verification method described above.
[0142] The specific implementation of the storage medium in this application is basically the same as the embodiments of the data verification method described above, and will not be repeated here.
[0143] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0144] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0145] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM or RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0146] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this 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, it parses the binary file and 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 generating the second data digest by the receiving terminal is the same as that of generating the first data digest by the IoT acquisition terminal. 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
Data integrity verification system
WO2023231782A1