Data consistency checking method and system based on Internet of Things platform

By implementing data consistency verification methods and systems on the Internet of Things platform, the problem of difficulty in ensuring integrity and consistency in the data transmission link in the Internet of Things system is solved, automatic detection and alarm are realized, and data trust and system stability are improved.

CN120086902APending Publication Date: 2025-06-03SHENZHEN XINGLIAN SHUHUA TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510157794.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-11
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

The prior art is difficult to fully ensure the integrity and consistency of data in the entire transmission link in the Internet of Things system, especially in the case of diverse equipment types and large number, and lacks a unified processing mechanism to detect the non-transmission or missed transmission on the device side.

Method used

By implementing a data consistency verification method and system on the Internet of Things platform, the system includes server and device side. The server receives the target record file sent by the device and stores it in the preset database. The server generates counting information based on the number of times the target record file is sent and received, determines the data type, and generates visual interface or alarm information based on the data type.

Benefits of technology

It realizes end-to-end data consistency detection from the IoT device end to the remote server end, automatically discovers data incompleteness or transmission link abnormalities, and generates alarm information, solving users' doubts about the data integrity of the device end and improving the stability and data trust of the IoT platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086902A_ABST
    Figure CN120086902A_ABST
Patent Text Reader

Abstract

The invention provides a data consistency checking method and system based on an Internet of Things platform, the method relates to a device end and a server, the method comprises the following steps: the server receives a target record file sent by the device end, and stores the target record file in a preset database; the server generates first counting information according to the receiving and sending times of the target record file; the server determines a data type of the target record file, wherein the data type comprises a service message and a control message; when the data type is the service message, the server generates a visual interface according to the service message, the preset database and the first counting information; and / or, when the data type is the control message, the server determines whether to generate alarm information according to the control message and the first counting information. Automatic verification of data consistency and automatic alarm triggering are realized through data acquisition and data transmission of the server and the equipment end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of the Internet of Things, and particularly to a method and system for data consistency verification based on an Internet of Things platform. Background Art

[0002] With the rapid development of Internet of Things technology, more and more devices are connected to the Internet, forming a huge Internet of Things system. These systems are widely used in multiple fields such as smart home, industrial automation, health care, etc. The MQTT (Message Queuing Telemetry Transport) protocol, as a lightweight message publishing / subscribing protocol, has been widely used in the field of the Internet of Things. It supports efficient communication between devices and servers and is suitable for resource-constrained devices and network environments with low bandwidth, high latency, or unreliability. In an Internet of Things system, the security and reliability of data transmission are crucial. With the continuous expansion of the scale of Internet of Things applications, the problem of data loss that may occur during data transmission has become one of the important factors affecting the stable operation of the Internet of Things system and data trust.

[0003] Currently, there are already some research and implementation solutions regarding data transmission consistency in the field of the Internet of Things. These solutions mainly use encryption technologies, check codes, etc. to ensure the security and consistency of data during transmission. Based on the MQTT protocol, there are already some implementation solutions regarding data consistency, but these solutions focus on specific application scenarios and lack universality and flexibility.

[0004] Existing technical solutions often only focus on the integrity of data during the two-point data transmission process, but fail to comprehensively cover the entire process from when the main control program of the Internet of Things device side collects data and performs the upload action to when the remote server side receives and processes the data, and cannot ensure the integrity and consistency of data in the entire transmission link. Due to the lack of a unified processing mechanism for detecting the situation of non-transmission or missing transmission at the device side, existing technical solutions are difficult to solve users' doubts about the integrity of device-side data. Especially when there are various types of devices in large quantities, it is necessary to enter the software systems of different device types to check the logs, and this method of verifying data integrity is time-consuming and laborious and difficult to execute. Summary of the Invention

[0005] In view of the above problems, this application is proposed to provide a method and system for data consistency verification based on an Internet of Things platform that overcomes the above problems or at least partially solves the above problems, including:

[0006] A method for data consistency verification based on an Internet of Things platform, the method involving the device side and the server, the method including:

[0007] The server receives the target record file sent by the device side and stores it in a preset database;

[0008] The server generates first count information based on the number of times the target record file is received and sent;

[0009] The server determines the data type of the target record file, where the data type includes business messages and control messages;

[0010] When the data type is the business message, the server generates a visualization interface based on the business message, the preset database, and the first count information; and / or,

[0011] When the data type is the control message, the server determines whether to generate an alarm message based on the control message and the first count information.

[0012] Further, the step of generating a visualization interface based on the business message, the preset database, and the first count information includes:

[0013] The server writes the first count information into the preset database, and the preset database includes a message reception and transmission record table for storing the first count information;

[0014] The server obtains the business message in the preset database;

[0015] The server performs parsing processing on the business message and a preset processing rule to generate a parsing result;

[0016] The server generates a visualization interface based on the parsing result.

[0017] Further, the step of determining whether to generate an alarm message based on the control message and the first count information includes:

[0018] The server parses a second target record file corresponding to the control message to obtain target count information, where the target count information includes third count information and second count information;

[0019] The server determines whether the third count information, the second count information, and the first count information are consistent;

[0020] The server obtains a third target quantity with the same theme as the third count information, a second target quantity with the same theme as the second count information, and a first target quantity with the same theme as the first count information in the previous day corresponding to the preset detection time according to the preset detection time;

[0021] When the third count information is different from the third target quantity and the second count information is also different from the second target quantity, the server determines that the current abnormal situation is data missing transmission, and generates an alarm message through the current abnormal situation; or,

[0022] When the second count information is different from the second target quantity and the first count information is also different from the first target quantity, the server determines that the current abnormal situation is a transmission link anomaly, and generates an alarm message through the current abnormal situation.

[0023] An embodiment of the present application also discloses a method for checking data consistency based on an Internet of Things platform. The method involves a device side and a server, and the method includes:

[0024] The device side collects device data according to preset user requirements;

[0025] The device side generates a message string from the device data and a preset format;

[0026] The device side generates a read / write record file according to the message string and the collection situation;

[0027] The device side generates a target record file according to the read / write record file, the uplink queue, and the data type of the device data, where the data type includes service messages and control messages;

[0028] The device side sends the target record file to the server.

[0029] Further, the step of generating a read / write record file according to the message string and the collection situation includes:

[0030] The device side generates a message string from the device data and a preset format;

[0031] The device side writes the message string into the uplink queue;

[0032] When the message string is written into the uplink queue, the device side counts the writing of the message string to generate third count information;

[0033] The device side generates a read / write record file according to the third count information.

[0034] Further, the step of generating a target record file according to the read / write record file, the uplink queue, and the data type of the device data, where the data type includes service messages and control messages, includes:

[0035] When the data type is the service message, the device side generates a first target record file based on the service message, the uplink queue, and the read-write record file; and / or,

[0036] When the data type is the control message, the device side generates a second target record file based on the read-write record file and the first target record file generated when the data type is the service message.

[0037] Further, the step of generating the first target record file based on the service message, the uplink queue, and the read-write record file includes:

[0038] The device side reads the message content in the uplink queue according to the service message;

[0039] The device side generates a first target message in the format agreed upon by the network communication protocol with the message content;

[0040] When the first target message is successfully sent, the device side counts the number of times the first target message is sent to generate second count information;

[0041] The device side generates a first target record file based on the second count information.

[0042] Further, the step of generating the second target record file based on the read-write record file and the first target record file generated when the data type is the service message includes:

[0043] The device side respectively obtains third count information corresponding to the read-write record file and second count information corresponding to the first target record file;

[0044] Generate a second target record file based on the third count information and the second count information.

[0045] An embodiment of the present application also discloses a data consistency verification system based on an Internet of Things platform. The system involves a device side and a server, and the system includes:

[0046] A receiving module for the server to receive the target record file sent by the device side and store it in a preset database;

[0047] A first generation module for the server to generate first count information based on the number of times of sending and receiving the target record file;

[0048] A determination module for the server to determine the data type of the target record file, where the data type includes a service message and a control message;

[0049] A second generation module, configured to, when the data type is the service message, generate a visualization interface by the server according to the service message, the preset database, and the first count information; and / or,

[0050] A third generation module, configured to, when the data type is the control message, determine whether to generate an alarm message by the server according to the control message and the first count information.

[0051] An embodiment of the present application further discloses a data consistency verification system based on an Internet of Things platform. The system relates to a device side and a server, and the system includes:

[0052] A fourth generation module, configured to obtain device data by the device side and preprocess the device data to generate a read / write record file;

[0053] A fifth generation module, configured to generate a target record file by the device side according to the read / write record file, the uplink queue, and the data type of the device data, where the data type includes a service message and a control message;

[0054] A sending module, configured to send the target record file to the server by the device side.

[0055] The present application has the following advantages:

[0056] In the embodiments of the present application, compared with the prior art where "existing technical solutions often only focus on the integrity during the two-point data transmission process, but fail to comprehensively cover the entire process from when the main control program of the Internet of Things device collects data and performs the upload action to when the remote server receives and processes the data, and cannot ensure the integrity and consistency of data in the entire transmission link. Since there is no unified processing mechanism for detecting non-transmission and missing transmission situations at the device end, it is difficult for existing technical solutions to address users' concerns about the integrity of device-end data. Especially when there are diverse types and a large number of devices, it is necessary to enter the software systems of different device types to check the logs, and this method of verifying data integrity is time-consuming and laborious to execute", the present application provides a solution of "a method capable of solving end-to-end data consistency problems and judging the integrity of service data", specifically: "The server receives the target record file sent by the device end and stores it in a preset database; the server generates first count information based on the number of times the target record file is sent and received; the server determines the data type of the target record file, where the data type includes service messages and control messages; when the data type is the service message, the server generates a visual interface based on the service message, the preset database, and the first count information; and / or, when the data type is the control message, the server determines whether to generate an alarm message based on the control message and the first count information". Through the "device end and the server", the problem of "existing technical solutions often only focus on the integrity during the two-point data transmission process, but fail to comprehensively cover the entire process from when the main control program of the Internet of Things device collects data and performs the upload action to when the remote server receives and processes the data, and cannot ensure the integrity and consistency of data in the entire transmission link. Since there is no unified processing mechanism for detecting non-transmission and missing transmission situations at the device end, it is difficult for existing technical solutions to address users' concerns about the integrity of device-end data. Especially when there are diverse types and a large number of devices, it is necessary to enter the software systems of different device types to check the logs, and this method of verifying data integrity is time-consuming and laborious to execute" is solved, achieving the effect of "providing a method and mechanism to automatically detect data consistency, automatically discover data integrity anomalies, and automatically trigger alarms throughout the entire process from collecting data by the main control program of the Internet of Things devices, to establishing connections, initiating transmissions, to the server receiving data, decrypting, dumping, and finally submitting it to the upper-layer application for processing. Automatic detection can actively discover data transmission link failure problems, dispel the concerns of Internet of Things platform users about the integrity of device-uploaded data, and is conducive to promoting the iterative improvement of the entire Internet of Things platform software system". BRIEF DESCRIPTION OF THE DRAWINGS

[0057] To more clearly illustrate the technical solutions of the present application, the accompanying drawings required for the description of the present application will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other accompanying drawings can be obtained based on these drawings without creative efforts.

[0058] Figure 1 is a flowchart of the steps of a method for checking data consistency based on an Internet of Things platform provided by an embodiment of the present application;

[0059] Figure 2 is a flowchart of the steps of a method for checking data consistency based on an Internet of Things platform provided by an embodiment of the present application;

[0060] Figure 3 is a block diagram of the structure of a system for checking data consistency based on an Internet of Things platform provided by an embodiment of the present application;

[0061] Figure 4 is a block diagram of the structure of a system for checking data consistency based on an Internet of Things platform provided by an embodiment of the present application;

[0062] Figure 5 is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention;

[0063] Figure 6 is a flowchart of a specific embodiment provided by an embodiment of the present invention;

[0064] Figure 7 is a schematic diagram of an embodiment provided by an embodiment of the present invention. Detailed Embodiments

[0065] To make the above objects, features, and advantages of the present application more apparent and understandable, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.

[0066] The inventor found through analyzing the prior art that: The technical solutions of the prior art ① The method based on checksum: Before data transmission, calculate the checksum of the data (such as CRC checksum) and carry the checksum in the data packet. After the receiving end receives the data, recalculate the checksum and compare it with the original checksum to verify the integrity of the data. The technical solutions of the prior art ② The method based on digital signature: Use digital signature technology to sign the data to ensure that the data is not tampered with during transmission. The receiving party can confirm the source and integrity of the data by verifying the digital signature. The technical solutions of the prior art ③ The implementation based on the MQTT protocol: Utilize the QoS (Quality of Service) level of the MQTT protocol to ensure reliable message transmission. However, these above-mentioned solutions focus on specific application scenarios and lack universality and flexibility.

[0067] Referring to Figure 1 and Figure 6 shows a flowchart of the steps and a specific implementation flowchart of a method for checking data consistency based on an Internet of Things platform provided by an embodiment of the present application;

[0068] A method for checking data consistency based on an Internet of Things platform, the method involves a device side and a server, and the method includes:

[0069] S110. The server receives the target record file sent by the device side and stores it in a preset database;

[0070] S120. The server generates first count information according to the number of times of receiving and sending of the target record file;

[0071] S130. The server determines the data type of the target record file, wherein the data type includes service messages and control messages;

[0072] S140. When the data type is the service message, the server generates a visualization interface according to the service message, the preset database and the first count information; and / or,

[0073] S150. When the data type is the control message, the server determines whether to generate an alarm message according to the control message and the first count information.

[0074] In the embodiments of the present application, compared with the prior art where "existing technical solutions often only focus on the integrity during the two-point data transmission process, but fail to comprehensively cover the entire process from when the main control program of the Internet of Things device collects data and performs the upload action to when the remote server receives and processes the data, and cannot ensure the integrity and consistency of data in the entire transmission link. Since there is no unified processing mechanism for detecting the non-transmission or missing transmission of data at the device end, it is difficult for the existing technical solutions to address users' concerns about the integrity of device-end data. Especially when there are various types of devices in large quantities, it is necessary to access the software systems of different device types to check the logs, and this method of verifying data integrity is time-consuming and laborious to execute", the present application provides a solution of "a method for solving end-to-end data consistency problems and determining the integrity of service data", specifically: "The server receives the target record file sent by the device end and stores it in a preset database; the server generates first count information based on the number of times the target record file is sent and received; the server determines the data type of the target record file, where the data type includes service messages and control messages; when the data type is the service message, the server generates a visualization interface based on the service message, the preset database, and the first count information; and / or, when the data type is the control message, the server determines whether to generate an alarm message based on the control message and the first count information". Through the "device end and the server", the problem of "existing technical solutions often only focus on the integrity during the two-point data transmission process, but fail to comprehensively cover the entire process from when the main control program of the Internet of Things device collects data and performs the upload action to when the remote server receives and processes the data, and cannot ensure the integrity and consistency of data in the entire transmission link. Since there is no unified processing mechanism for detecting the non-transmission or missing transmission of data at the device end, it is difficult for the existing technical solutions to address users' concerns about the integrity of device-end data. Especially when there are various types of devices in large quantities, it is necessary to access the software systems of different device types to check the logs, and this method of verifying data integrity is time-consuming and laborious to execute" is solved, achieving the effect of "providing a method and mechanism to automatically detect data consistency, automatically discover data integrity anomalies, and automatically trigger alarms during the entire process from when the main control program of the Internet of Things device collects data, to establishing a connection, initiating transmission, to the server receiving data, decrypting, dumping, and finally submitting it to the upper-layer application for processing. Automatic detection can proactively discover data transmission link failure problems, dispel Internet of Things platform users' concerns about the integrity of device-uploaded data, and is conducive to promoting the iterative improvement of the entire Internet of Things platform software system".

[0075] Next, a method for verifying data consistency based on the Internet of Things platform in this exemplary embodiment will be further described.

[0076] It should be noted that the wireless communication module driver establishes a connection with the Internet of Things application platform server, namely the server, encrypts and transmits data.

[0077] It should be noted that the message upload is received by the message receiving program of the Internet of Things application platform. After receiving, it can be dumped into the database, and after the dumping is completed, the server message sending and receiving counting program is triggered.

[0078] As described in step S140, when the data type is the service message, the server generates a visualization interface based on the service message, the preset database, and the first counting information.

[0079] In an embodiment of the present invention, the specific process of "when the data type is the service message, the server generates a visualization interface based on the service message, the preset database, and the first counting information" described in step S140 can be further described in combination with the following description.

[0080] As described in the following steps,

[0081] S210: The server writes the first counting information into the preset database, and the preset database includes a message sending and receiving record table for storing the first counting information;

[0082] S220: The server obtains the service message in the preset database;

[0083] S230: The server parses and processes the service message and the preset processing rule to generate a parsing result;

[0084] S240: The server generates a visualization interface based on the parsing result.

[0085] In a specific implementation, when the message type is a service message, the server message sending and receiving counting program writes the first counting information into the server message sending and receiving record table, namely the message sending and receiving record table. Each message type starts from 0 at 00:00 every day and increments by 1 step by step. The message processing program obtains the service message uploaded and dumped into the database, parses the service message according to the actual business and executes the specific processing logic, namely the preset processing rule, and outputs the parsing result to the database. The Internet of Things application module is responsible for accessing the database and presenting the data visually and performing UI interaction, namely the visualization interface, through the parsing result.

[0086] As described in step S150, when the data type is the control message, the server determines whether to generate an alarm message based on the control message and the first counting information.

[0087] In an embodiment of the present invention, the specific process of "when the data type is the control message, the server determines whether to generate an alarm message based on the control message and the first count information" described in step S150 can be further described in combination with the following description.

[0088] As described in the following steps,

[0089] S310. The server parses the second target record file corresponding to the control message to obtain target count information, where the target count information includes third count information and second count information;

[0090] S320. The server determines whether the third count information, the second count information, and the first count information are consistent;

[0091] S330. The server obtains a third target quantity with the same theme as the third count information, a second target quantity with the same theme as the second count information, and a first target quantity with the same theme as the first count information in the day before the preset detection time corresponding to the preset detection time;

[0092] S340. When the third count information is different from the third target quantity, and the second count information is also different from the second target quantity, the server determines that the current abnormal situation is data missing transmission, and generates an alarm message through the current abnormal situation; or,

[0093] S350. When the second count information is different from the second target quantity, and the first count information is also different from the first target quantity, the server determines that the current abnormal situation is a transmission link exception, and generates an alarm message through the current abnormal situation.

[0094] In a specific implementation, when the message type is a control message, for the transmission of the consistency detection message, that is, the second target record file, after detecting such a message in this link, the message content is parsed to extract two count information on the device side; the first part: the message count submitted by the main control program on the device side, that is, the third count information, and this part of the record is stored in the first database table (the main control program reads and writes the message count table); the second part: the message count sent by the IOT communication module on the device side to the server, that is, the second count information, and this part of the record is stored in the second database table (the IOT communication module sends and receives the message count table).

[0095] Execute the message consistency detection program regularly, and obtain the three count quantities of the three nodes of the previous day (namely, the device-side main control program, the device-side IOT communication module, and the server-side message receiving program), that is, the third target quantity (device-side main control program) corresponding to the same theme as the third count information, the second target quantity (device-side IOT communication module) corresponding to the same theme as the second count information, and the first target quantity (server-side message receiving program) corresponding to the same theme as the first count information; compare the count quantities of the same theme. If the above-mentioned target quantities are all consistent with their corresponding count information, it proves that the data submitted by the device-side is completely transmitted to the server; if the quantities recorded by the first two are different (that is, the third count information is different from the third target quantity, and the second count information is also different from the second target quantity), it proves that part of the data submitted by the device has not been transmitted to the server, and there may be defects in the IOT communication module; if the quantities recorded by the last two are different (that is, the second count information is different from the second target quantity, and the first count information is also different from the first target quantity), it proves that there is a problem with the transmission link of the device-side IOT communication module to the server. When data inconsistency is detected, submit the abnormal information to the notification and alarm program and generate an alarm message, and inform the administrator of the Internet of Things application platform of the alarm message.

[0096] Refer to Figure 2 and Figure 6 , this application also shows the step flow chart and the specific embodiment flow chart of a data consistency verification method provided by an embodiment of this application;

[0097] A data consistency verification method based on an Internet of Things platform, the method involves the device-side and the server, and the method includes:

[0098] S410. The device-side obtains device data and preprocesses the device data to generate a read-write record file;

[0099] S420. The device-side generates a target record file according to the read-write record file, the uplink queue, and the data type of the device data, where the data type includes service messages and control messages;

[0100] S430. The device-side sends the target record file to the server.

[0101] It should be noted that the device - side main control program collects device data, encapsulates the data into a message string in a certain format according to the message protocol agreed upon by the IOT platform (i.e., Internet of Things, also known as the Internet of Things platform, which is an Internet - based solution designed to connect and manage IOT devices and data). The specific content of the message protocol is not limited here, but each message is limited to have a specified message type and message payload (the content is not limited).

[0102] As described in step S410, the device - side obtains device data and pre - processes the device data to generate a read - write record file.

[0103] In an embodiment of the present invention, the specific process of "the device - side obtains device data and pre - processes the device data to generate a read - write record file" described in step S410 can be further described in combination with the following description.

[0104] As described in the following steps,

[0105] S510: The device - side generates a message string based on the device data and a preset format;

[0106] S520: The device - side writes the message string into the uplink queue;

[0107] S530: When the message string is written into the uplink queue, the device - side counts the writing of the message string to generate third counting information;

[0108] S540: The device - side generates a read - write record file based on the third counting information.

[0109] In a specific implementation, when the device - side main control program, that is, the device - side, collects device data, the sub - module responsible for IOT processing will trigger the call to the message submission interface of the IOT SDK. The message will be written into the uplink queue. After the writing is successful, the counting program will be triggered, and the counting program will write the third counting information into the main control program read - write message record file, that is, the read - write record file. Each message type starts counting from 0 at 00:00 every day with a step size of 1 and grows incrementally.

[0110] As described in step S420, the device - side generates a target record file based on the read - write record file, the uplink queue, and the data type of the device data, where the data type includes business messages and control messages.

[0111] In an embodiment of the present invention, the specific process of "the device end generates a target record file according to the read / write record file, the uplink queue, and the data type of the device data, where the data type includes service messages and control messages" described in step S420 can be further described in combination with the following description.

[0112] As described in the following steps,

[0113] S610. When the data type is the service message, the device end generates a first target record file according to the service message, the uplink queue, and the read / write record file; and / or,

[0114] S620. When the data type is the control message, the device end generates a second target record file according to the read / write record file and the first target record file generated when the data type is the service message.

[0115] It should be noted that according to the different data types, there are also differences in the processing process.

[0116] As described in step S610, when the data type is the service message, the device end generates a first target record file according to the service message, the uplink queue, and the read / write record file.

[0117] In an embodiment of the present invention, the specific process of "when the data type is the service message, the device end generates a first target record file according to the service message, the uplink queue, and the read / write record file" described in step S610 can be further described in combination with the following description.

[0118] As described in the following steps,

[0119] S710. The device end reads the message content in the uplink queue according to the service message;

[0120] S720. The device end generates a first target message in the format agreed upon by the network communication protocol according to the message content;

[0121] S730. When the first target message is successfully sent, the device end counts the number of times the first target message is sent to generate second count information;

[0122] S740. The device end generates a first target record file according to the second count information.

[0123] In a specific implementation, for business class messages, i.e., business messages, the IOT communication software module starts the message transmission program, reads the message content in the uplink queue in a loop, encapsulates the message content into the message format agreed upon by the network communication protocol to obtain the first target message, calls the wireless communication module driver program to initiate a network connection and transmit data, and automatically triggers the upload message counting program after the first target message is successfully sent. The counting program writes the second counting information into the IOT communication module message record file, i.e., the first target record file. Each type of message type starts counting from 0 at 00:00 every day with a step size of 1 and increments automatically.

[0124] As described in step S620, when the data type is the control message, the device side generates a second target record file based on the read / write record file and the first target record file generated from the business message with the data type.

[0125] In an embodiment of the present invention, the specific process of "when the data type is the control message, the device side generates a second target record file based on the read / write record file and the first target record file generated from the business message with the data type" described in step S620 can be further described in combination with the following description.

[0126] As described in the following steps,

[0127] S810: The device side respectively obtains the third counting information corresponding to the read / write record file and the second counting information corresponding to the first target record file;

[0128] S820: Generate a second target record file based on the third counting information and the second counting information.

[0129] In a specific implementation, for control messages, the IOT communication software module regularly starts the message transmission program every day, combines the main control program read / write message record, i.e., the read / write record file, and the IOT communication module message record, i.e., the first target record file, encapsulates the current counting information in the above two files into a consistency detection control message, i.e., the second target record file, and calls the wireless communication module driver program to initiate a network connection and transmit data to the Internet of Things application platform server, i.e., the server.

[0130] Embodiment 1

[0131] As Figure 7 shown, the device side main control program (A1) collects device data, encapsulates the data into a message string in a certain format according to the message protocol agreed upon by the IOT platform. The specific content of the message protocol is not limited here, but it is limited that each message has a specified message type (hereinafter referred to as Topic) and message payload (content is not limited).

[0132] When the device - side main control program collects device data, the sub - module (A1 - 1) responsible for IOT processing will trigger the call to the message submission interface (A1 - 2 - 1) of the IOT SDK. The message will be written into the uplink queue (A2 - 1, a file in the device - side operating system). After successful writing, the counting program (A1 - 2 - 2) will be triggered. The counting program will write (update if it exists) to the main control program read - write message record (A2 - 3) file in the format of "1 - S - {Topic}-{year - month - day}:{quantity}". Each type of message Topic starts counting from 0 at 00:00 every day with a step size of 1 for self - incrementing counting.

[0133] It is agreed that the message type of the consistency detection control class is {ControlTopic}, and the other business - class message types are {Topic}. For business - class messages, the IOT communication software module (A3) starts the message transmission program (A3 - 1), continuously reads the message content in the uplink queue (A2 - 1), encapsulates the message content into the message format agreed by the network communication protocol, and calls the wireless communication module driver program (A4) to initiate a network connection and transmit data. After successful sending, the upload message counting program (A3 - 2) will be automatically triggered. The counting program will write (update if it exists) to the IOT communication module message record (A2 - 4) file in the format of "2 - P - {Topic}-{year - month - day}:{quantity}". Each type of message Topic starts counting from 0 at 00:00 every day with a step size of 1 for self - incrementing counting. For control - class messages, the IOT communication software module (A3) regularly starts the message transmission program (A3 - 1) every day, integrates and encapsulates the current counting information in the two files of the main control program read - write message record (A2 - 3) and the IOT communication module message record (A2 - 4) into a consistency detection control - class {ControlTopic} message, and calls the wireless communication module driver program (A4) to initiate a network connection and transmit data to the Internet of Things application platform server.

[0134] The wireless communication module driver program (A4) establishes a connection with the Internet of Things application platform server (B), encrypts and transmits data.

[0135] Message upload is the responsibility of the message receiving program (B1) of the Internet of Things application platform. After receiving, it can be dumped into the database, and after the dump is completed, the server message sending and receiving counting program (B2) is triggered.

[0136] If the message type is business - class (distinguished by Topic), the server message sending and receiving counting program (B2) will write (update if it exists) to the server message sending and receiving record (B7 - 3) table in the format of "3 - R - {Topic}-{year - month - day}:{quantity}". Each type of message Topic starts counting from 0 at 00:00 every day with a step size of 1 for self - incrementing counting.

[0137] The message handler (B3) obtains the message received and dumped by B1, parses the message according to the actual business, executes specific processing logic, and outputs the result data to the database (B7).

[0138] The Internet of Things application module (B6) is responsible for accessing the database (B7) and outputting data visual presentation and UI interaction.

[0139] Control the transmission of control messages (consistency detection message C3). After detecting a C3 message in this link, parse the message content and extract two count information on the device side. The first part: "1-S-{Topic}-{Year-Month-Day}: {Quantity}", the prefix 1 is recognized as the device-side main control program A1, S is recognized as the submitted message, {Topic} is the business message topic, and this part of the record is stored in the database table (B7-1 main control program read and write message count table). The second part: "2-P-{Topic}-{Year-Month-Day}: {Quantity}", the prefix 2 is recognized as the device-side IOT communication module A3, P is recognized as the message sent to the server, and this part of the record is stored in the database table (B7-2 IOT communication module send and receive message count table).

[0140] Regularly execute the message consistency detection program (such as 9:00 every morning), obtain the three count information of the previous day's 3 nodes (device-side main control program A1, device-side IOT communication module A3, server-side message receiving program B1): B7-1, B7-2, B7-3, and compare the quantities of the same Topic in the content "1-S-{Topic}-{Year-Month-Day}: {Quantity}", "2-P-{Topic}-{Year-Month-Day}: {Quantity}", "3-R-{Topic}-{Year-Month-Day}: {Quantity}". If the 3 data are consistent, it proves that the data submitted by the device side is completely transmitted to the server side. If the quantities recorded in B7-1 and B7-2 are different, it proves that some of the data submitted by the device has not been transmitted to the server, and there may be a defect in the IOT communication module A3; if the quantities recorded in B7-2 and B7-3 are different, it proves that there is a problem with the link from the device-side IOT communication module A3 to the server B1.

[0141] When data inconsistency is detected, submit the exception information to the notification and alarm program to inform the administrator of the Internet of Things application platform.

[0142] For the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, refer to the partial description of the method embodiment.

[0143] Refer to Figure 3, showing a structural block diagram of a data consistency verification system provided by an embodiment of the present application;

[0144] A data consistency verification system based on an Internet of Things platform, the system relates to a device side and a server, and the system includes:

[0145] A receiving module 110, configured to receive, by the server, a target record file sent by the device side and store it in a preset database;

[0146] A first generating module 120, configured to generate first counting information by the server according to the number of times of receiving and sending the target record file;

[0147] A determining module 130, configured to determine, by the server, the data type of the target record file, where the data type includes a service message and a control message;

[0148] A second generating module 140, configured to, when the data type is the service message, generate a visualization interface by the server according to the service message, the preset database, and the first counting information; and / or,

[0149] A third generating module 150, configured to, when the data type is the control message, determine whether to generate an alarm message by the server according to the control message and the first counting information.

[0150] In an embodiment of the present invention, the second generating module 240 includes:

[0151] A first processing sub-module, configured to write, by the server, the first counting information into the preset database, and the preset database includes a message receiving and sending record table for storing the first counting information;

[0152] A first obtaining sub-module, configured to obtain, by the server, the service message in the preset database;

[0153] A second processing sub-module, configured to perform parsing processing on the service message and a preset processing rule by the server to generate a parsing result;

[0154] A first generating sub-module, configured to generate a visualization interface by the server according to the parsing result.

[0155] In an embodiment of the present invention, the third generating module 250 includes:

[0156] A second processing sub-module, configured to parse, by the server, a second target record file corresponding to the control message to obtain target counting information, where the target counting information includes third counting information and second counting information;

[0157] The first determination sub-module is used for the server to determine whether they are consistent based on the third count information, the second count information, and the first count information;

[0158] The second acquisition sub-module is used for the server to acquire the third target quantity with the same theme as the third count information, the second target quantity with the same theme as the second count information, and the first target quantity with the same theme as the first count information in the day before the preset detection time corresponding to the preset detection time;

[0159] The second determination sub-module is used for when the third count information is different from the third target quantity, and the second count information is also different from the second target quantity, the server determines that the current abnormal situation is data missing transmission, and generates an alarm message through the current abnormal situation; or,

[0160] The third determination sub-module is used for when the second count information is different from the second target quantity, and the first count information is also different from the first target quantity, the server determines that the current abnormal situation is a transmission link anomaly, and generates an alarm message through the current abnormal situation.

[0161] Refer to Figure 4 , this application also shows a structural block diagram of a data consistency verification system provided by an embodiment of this application;

[0162] A data consistency verification system based on an Internet of Things platform, the system relates to a device side and a server, and the system includes:

[0163] The fourth generation module 210 is used for the device side to acquire device data and preprocess the device data to generate a read-write record file;

[0164] The fifth generation module 220 is used for the device side to generate a target record file according to the read-write record file, the uplink queue, and the data type of the device data, where the data type includes service messages and control messages;

[0165] The sending module 230 is used for the device side to send the target record file to the server.

[0166] In an embodiment of the present invention, the fourth generation module 210 includes:

[0167] The second generation sub-module is used for the device side to generate a message string according to the device data and a preset format;

[0168] The third processing sub-module is used for the device side to write the message string into the uplink queue;

[0169] A third generation sub-module, configured to, when the message string is written into the uplink queue, the device side counts the writing of the message string to generate third count information;

[0170] A fourth generation sub-module, configured to the device side generate a read-write record file according to the third count information.

[0171] In an embodiment of the present invention, the fifth generation module 220 includes:

[0172] A fifth generation sub-module, configured to, when the data type is the service message, the device side generate a first target record file according to the service message, the uplink queue, and the read-write record file; and / or,

[0173] A sixth generation sub-module, configured to, when the data type is the control message, the device side generate a second target record file according to the read-write record file and the first target record file generated by the data type being the service message.

[0174] In an embodiment of the present invention, the fifth generation sub-module includes:

[0175] A first processing unit, configured to the device side read message content in the uplink queue according to the service message;

[0176] A first generation unit, configured to the device side generate a first target message according to the format agreed by the network communication protocol for the message content;

[0177] A second generation unit, configured to, when the first target message is successfully sent, the device side counts the number of times the first target message is sent to generate second count information;

[0178] A third generation unit, configured to the device side generate a first target record file according to the second count information.

[0179] In an embodiment of the present invention, the sixth generation sub-module includes:

[0180] A second processing unit, configured to the device side respectively obtain third count information corresponding to the read-write record file and second count information corresponding to the first target record file;

[0181] A fourth generation unit, configured to generate a second target record file according to the third count information and the second count information.

[0182] Referring to Figure 5 , a computer device for a data consistency verification method based on an Internet of Things platform according to the present invention is shown, and specifically may include the following:

[0183] The above computer device 12 is presented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects different system components (including the system memory 28 and the processing unit 16).

[0184] The bus 18 represents one or more of several types of bus 18 architectures, including a memory bus 18 or a memory controller, a peripheral bus 18, a graphics acceleration port, a processor, or a local bus 18 using any bus 18 architecture in a variety of bus 18 architectures. By way of example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus 18, Micro Channel Architecture (MAC) bus 18, Enhanced ISA bus 18, Video Electronics Standards Association (VESA) local bus 18, and Peripheral Component Interconnect (PCI) bus 18.

[0185] The computer device 12 typically includes a variety of computer system-readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0186] The system memory 28 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 34 may be used for reading and writing on non-removable, non-volatile magnetic media (commonly referred to as a "hard disk drive"). Although Figure 5 not shown in the figure, a disk drive for reading and writing on a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing on a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 through one or more data media interfaces. The memory may include at least one program product having a set (e.g., at least one) of program modules 42, and these program modules 42 are configured to perform the functions of the embodiments of the present invention.

[0187] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory. Such program modules 42 include - but are not limited to - an operating system, one or more application programs, other program modules 42, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods in the embodiments described in the present invention.

[0188] The computer device 12 can also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, a camera, etc.), and can also communicate with one or more devices that enable a user to interact with the computer device 12, and / or communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 22. Moreover, the computer device 12 can also communicate with one or more networks (such as a local area network (LAN)), a wide area network (WAN), and / or a public network (such as the Internet) through the network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the computer device 12 through the bus 18. It should be understood that although Figure 5 not shown in the figure, other hardware and / or software modules can be used in combination with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units 16, external disk drive arrays, RAID systems, tape drives, and data backup storage systems 34, etc.

[0189] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a method for data consistency verification based on an Internet of Things platform provided by an embodiment of the present invention.

[0190] That is, when the above-mentioned processing unit 16 executes the above program, it realizes: the server receives the target record file sent by the device side and stores it in a preset database; the server generates first count information according to the number of times of receiving and sending the target record file; the server determines the data type of the target record file, where the data type includes service messages and control messages; when the data type is the service message, the server generates a visual interface according to the service message, the preset database, and the first count information; and / or, when the data type is the control message, the server determines whether to generate an alarm message according to the control message and the first count information.

[0191] In an embodiment of the present invention, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it realizes a method for data consistency verification based on an Internet of Things platform provided by all embodiments of the present application:

[0192] That is, when the program is executed by the processor, the following operations are implemented: the server receives the target record file sent by the device side and stores it in a preset database; the server generates first count information based on the number of times the target record file is received and sent; the server determines the data type of the target record file, where the data type includes service messages and control messages; when the data type is the service message, the server generates a visualization interface based on the service message, the preset database, and the first count information; and / or, when the data type is the control message, the server determines whether to generate an alarm message based on the control message and the first count information.

[0193] Any combination of one or more computer-readable media may be employed. The computer-readable media may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program which can be used by or combined with an instruction execution system, apparatus, or device.

[0194] A computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal may take many forms, including - but not limited to - an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.

[0195] Computer program code for performing the operations of the present invention may be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider). Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference may be made to each other.

[0196] Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they know the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.

[0197] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the element.

[0198] The above provides a detailed introduction to a method and system for data consistency verification based on an Internet of Things platform. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A data consistency verification method based on an Internet of Things platform, characterized in that: The method involves a device end and a server, and the method includes: The server receives the target record file sent by the device and stores it in a preset database; The server generates first counting information according to the number of times the target record file is sent and received; The server determines the data type of the target record file, wherein the data type includes a service message and a control message; When the data type is the service message, the server generates a visualization interface according to the service message, the preset database and the first counting information; and / or, When the data type is the control message, the server determines whether to generate warning information according to the control message and the first counting information.

2. The method according to claim 1, characterized in that The step of generating a visualization interface according to the service message, the preset database and the first counting information includes: The server writes the first counting information into the preset database, wherein the preset database includes a message sending and receiving record table for storing the first counting information; The server obtains the service message from a preset database; The server parses the service message and the preset processing rule to generate a parsing result; The server generates a visual interface according to the analysis result.

3. The method according to claim 1, characterized in that The step of determining whether to generate warning information according to the control message and the first counting information comprises: The server parses the second target record file corresponding to the control message to obtain target counting information, wherein the target counting information includes third counting information and second counting information; The server determines whether the third counting information, the second counting information and the first counting information are consistent; The server obtains, according to a preset detection time, the number of third targets with the same subject as the third counting information, the number of second targets with the same subject as the second counting information, and the number of first targets with the same subject as the first counting information in the day before the preset detection time; When the third counting information is different from the third target number, and the second counting information is also different from the second target number, the server determines that the current abnormal situation is that data has been leaked, and generates an alarm message based on the current abnormal situation; or, When the second counting information is different from the second target number, and the first counting information is also different from the first target number, the server determines that the current abnormal situation is a transmission link abnormality, and generates alarm information based on the current abnormal situation.

4. A data consistency verification method based on an Internet of Things platform, characterized in that: The method involves a device end and a server, and the method includes: The device end obtains device data, and pre-processes the device data to generate a read-write record file; The device end generates a target record file according to the data type of the read / write record file, the uplink queue and the device data, wherein the data type includes a service message and a control message; The device sends the target record file to the server.

5. The method according to claim 4, characterized in that The step of preprocessing the device data to generate a read-write record file includes: The device terminal generates a message character string according to the device data and a preset format; The device end writes the message character string into the uplink queue; When the message character string is written into the uplink queue, the device end counts the writing of the message character string to generate third counting information; The device generates a read-write record file according to the third counting information.

6. The method according to claim 4, characterized in that The step of generating a target record file according to the data types of the read / write record file, the uplink queue, and the device data, wherein the data types include service messages and control messages, comprises: When the data type is the service message, the device generates a first target record file according to the service message, the uplink queue and the read-write record file; and / or, When the data type is the control message, the device generates a second target record file according to the read-write record file and the first target record file generated by the data type being the service message.

7. The method according to claim 6, characterized in that The step of generating a first target record file according to the service message, the uplink queue and the read-write record file comprises: The device end reads the message content in the uplink queue according to the service message; The device generates a first target message based on the message content in a format agreed upon by the network communication protocol; When the first target message is sent successfully, the device side counts the number of times the first target message is sent to generate second counting information; The device generates a first target record file according to the second counting information.

8. The method according to claim 6, characterized in that The step of generating a second target record file according to the read-write record file and the first target record file generated by the data type for the service message comprises: The device end respectively obtains third counting information corresponding to the read-write record file and second counting information corresponding to the first target record file; A second target record file is generated according to the third counting information and the second counting information.

9. A data consistency verification system based on the Internet of Things platform, characterized in that: The system involves a device end and a server, and the system includes: A receiving module, used for the server to receive the target record file sent by the device end and store it in a preset database; A first generating module, configured for the server to generate first counting information according to the number of times the target record file is sent and received; A determination module, configured for the server to determine a data type of the target record file, wherein the data type includes a service message and a control message; a second generating module, configured to, when the data type is the service message, cause the server to generate a visual interface according to the service message, the preset database and the first counting information; and / or, The third generating module is used for, when the data type is the control message, for the server to determine whether to generate alarm information according to the control message and the first counting information.

10. A data consistency verification system based on the Internet of Things platform, characterized in that: The system involves a device end and a server, and the system includes: A fourth generating module, used for the device end to obtain device data, and pre-process the device data to generate a read-write record file; A fifth generating module, configured for the device to generate a target record file according to the data type of the read / write record file, the uplink queue and the device data, wherein the data type includes a service message and a control message; The sending module is used for the device to send the target record file to the server.