Internet of Things terminal status data tracing method and system
By using the first-in, first-out storage queue mechanism in the IoT terminal, abnormal data packets are formed and queryed, the resource consumption problem caused by massive data in the monitoring and traceability of abnormal data at the Internet of Things terminal is solved, and the accurate data acquisition and Efficient transmission.
Patent Information
- Application Number
- CN202110926442.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-12
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2041-08-12
AI Technical Summary
In the prior art, the monitoring and traceability of abnormal status or accident data of the Internet of Things terminals has massive data uploaded to the data center, resulting in high consumption of network and storage resources and inconvenience to users.
The storage queue mechanism of the first-in-first-out principle is adopted to obtain abnormal data of IoT terminals in real time, and form abnormal data packets before and after the state data, store and query, reduce the storage and transmission of non-critical data, and improve data traceability efficiency.
When an abnormality occurs at the Internet of Things terminal, accurately obtain the abnormal data and its state data before and after, reduce the consumption of massive data on the network and storage resources, and improve the efficiency of data transmission, storage and traceability.
Smart Images

Figure CN113660119B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet of Things, and in particular to a method and system for tracing status data of an Internet of Things terminal. Background Art
[0002] With the rise of the Internet of Everything, more and more urban infrastructure, factory machinery and equipment, transportation facilities and household items are organically connected through the Internet of Things system, and remote monitoring and management are achieved according to professional classification. When an abnormal state or accident occurs in the controlled object, users are very concerned about the abnormal state data or the monitoring data before and after the accident, and will use it as the basis for analyzing the abnormal state or accident.
[0003] In the prior art, for the analysis of abnormal status or accidents, all data of the IoT terminal is often uploaded to the data center in real time. When the controlled object has an abnormal status or an accident, the user queries the data before and after the abnormal status or accident time point for analysis, thereby realizing the traceability function of IoT monitoring data. However, this method has the following defects: since a large amount of IoT monitoring data is uploaded to the data center, it causes huge loss of network resources and storage resources. When a large amount of non-critical or non-sensitive IoT monitoring data is uploaded to the data center, it also brings a great burden to storage, sorting and analysis. At the same time, it also causes great inconvenience for users to trace the abnormal status or accident data of the controlled object.
[0004] Therefore, in order to solve the above technical problems, it is urgent to propose a new technical means. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a method and system for tracing status data of an Internet of Things terminal, which can accurately obtain the abnormal data of the Internet of Things terminal and the status data before and after the abnormal data when an abnormality occurs in the Internet of Things terminal, provide accurate data support for the analysis of key data or sensitive data of the Internet of Things system, and can effectively reduce the consumption of network resources and storage resources caused by massive data, and effectively improve the efficiency of data transmission, storage and subsequent data tracing.
[0006] The present invention provides a method for tracing status data of an Internet of Things terminal, comprising the following steps:
[0007] Obtain real-time status data of IoT terminals;
[0008] Determine whether there is an abnormality in the real-time status data of the IoT terminal. If so, extract the real-time status data of the N IoT terminals before and after the abnormal data to form an abnormal data packet and store the abnormal data packet;
[0009] Extract the flag information when the abnormal data packet is stored, and store the flag information and the abnormal data in correspondence to form a query data packet;
[0010] When calling an abnormal data packet, the abnormal data packet is queried and called according to the information contained in the query data packet.
[0011] Further, an abnormal data packet is formed according to the following method:
[0012] The acquired real-time data of the Internet of Things terminal is stored in a first storage queue, wherein the first storage queue accesses data according to the first-in-first-out principle and the first storage queue has N real-time data storage spaces;
[0013] When there is an abnormality in the real-time status data of the Internet of Things terminal, the current abnormal data is stored in the first storage queue, and then the real-time status data of the Internet of Things terminal squeezed out by the abnormal data in the first storage queue is written into the second storage queue;
[0014] Continue to write the real-time status data of the Internet of Things terminal after the current abnormal data into the first storage queue and write the real-time status data squeezed out of the first storage queue into the second storage queue;
[0015] Determine whether the current abnormal data is squeezed out of the first storage queue. If so, write the abnormal data into the second storage queue, and all data in the first storage queue when the current abnormal data is squeezed out are sequentially written into the second storage queue and are located after the current abnormal data;
[0016] When the real-time status data of the Internet of Things terminals stored in the first storage queue when the current abnormal data is squeezed out is stored in the second storage queue, the current abnormal data in the second storage queue and the real-time status data of N Internet of Things terminals before and after the current abnormal data are formed into an abnormal data packet.
[0017] Furthermore, the flag information when the abnormal data packet is stored is the first address and the last address of the abnormal data packet.
[0018] Furthermore, the query data packet and the abnormal data packet are located in different storage queues when being stored.
[0019] Further, after the abnormal data packet is formed, the first address and the last address of the abnormal data packet are extracted, and the current abnormal data, the first address and the last address of the abnormal data packet are correspondingly stored in the third storage queue.
[0020] Accordingly, the present invention also provides an Internet of Things terminal status data tracing system, comprising a processor, a first memory and a second memory;
[0021] The processor is used to obtain the real-time status data of the Internet of Things terminal, determine whether the real-time status data of the Internet of Things terminal is abnormal, and output alarm information when the real-time status data of the Internet of Things terminal is abnormal;
[0022] The processor stores the real-time status data of the IoT terminal in the first memory and the second memory;
[0023] The first memory is used to store the real-time status data of the Internet of Things terminal acquired by the processor, and the first processor follows the first-in-first-out principle when accessing data;
[0024] The second memory has a status data storage queue and an alarm data storage queue. When an abnormality occurs in the real-time status data of the Internet of Things terminal, a total of 2N real-time status data before and after the current abnormal data and the current abnormal data itself are stored in the status data storage queue as an abnormal data packet, and the first address and the last address of the abnormal data packet and the current abnormal data itself are stored in the alarm data storage queue as a query data packet.
[0025] Further, an abnormal data packet is formed according to the following method:
[0026] The processor stores the acquired real-time data of the Internet of Things terminal in a first storage queue, wherein the first storage queue accesses data based on a first-in-first-out principle and the first storage queue has N real-time data storage spaces;
[0027] When the processor determines that the real-time status data of the Internet of Things terminal is abnormal, the processor stores the current abnormal data in the first storage queue, and then writes the real-time status data of the Internet of Things terminal squeezed out by the abnormal data in the first storage queue into the second storage queue;
[0028] The processor continues to write the real-time status data of the Internet of Things terminal after the current abnormal data into the first storage queue and writes the real-time status data squeezed out of the first storage queue into the second storage queue;
[0029] The processor determines whether the current abnormal data is squeezed out of the first storage queue. If so, the abnormal data is written into the second storage queue, and all data in the first storage queue when the current abnormal data is squeezed out are sequentially written into the second storage queue and are located after the current abnormal data;
[0030] When the real-time status data of the Internet of Things terminals stored in the first storage queue when the current abnormal data is squeezed out is stored in the second storage queue, the current abnormal data in the second storage queue and the real-time status data of N Internet of Things terminals before and after the current abnormal data are formed into an abnormal data packet.
[0031] Further, the processor calls the abnormal data packet according to the following method:
[0032] The processor receives the call instruction sent by the host computer;
[0033] The processor searches for a query data packet corresponding to the current call instruction in the alarm data storage queue of the second memory according to the call instruction, and parses the found query data packet to obtain the abnormal data information contained in the call instruction and the first address and the last address of the abnormal data packet corresponding to the abnormal information;
[0034] The processor calls the abnormal data packet from the state data storage queue of the second memory according to the abnormal data information and the first address and the last address of the abnormal data packet.
[0035] Further, it also includes an input module and an output module;
[0036] The input module is in communication with the processor and is used to input the real-time status data of the IoT terminal into the processor;
[0037] The output module is connected to the processor and is used to transmit the data of the processor to the host computer.
[0038] The beneficial effects of the present invention are as follows: through the present invention, when an abnormality occurs in an IoT terminal, the abnormal data of the IoT terminal and the status data before and after the abnormal data can be accurately obtained, providing accurate data support for the analysis of key data or sensitive data of the IoT system, and can effectively reduce the consumption of network resources and storage resources caused by massive data, and effectively improve the efficiency of data transmission, storage and subsequent data tracing. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0040] Figure 1 It is a schematic diagram of the process of the present invention.
[0041] Figure 2 It is a specific schematic diagram of the present invention.
[0042] Figure 3 It is a schematic diagram of the system structure of the present invention.
[0043] Figure 4 It is a schematic diagram of data storage of the present invention. DETAILED DESCRIPTION
[0044] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0045] The present invention provides a method for tracing status data of an Internet of Things terminal, comprising the following steps:
[0046] Obtain real-time status data of IoT terminals;
[0047] Determine whether there is an abnormality in the real-time status data of the IoT terminal. If so, extract the real-time status data of the N IoT terminals before and after the abnormal data to form an abnormal data packet and store the abnormal data packet;
[0048] Extract the flag information when the abnormal data packet is stored, and store the flag information and the abnormal data in correspondence to form a query data packet;
[0049] When calling an abnormal data packet, the abnormal data packet is queried and called according to the information contained in the query data packet; through the above method, the abnormal data of the IoT terminal and the status data before and after the abnormal data can be accurately obtained when an abnormality occurs in the IoT terminal, providing accurate data support for the analysis of key data or sensitive data of the IoT system, and can effectively reduce the consumption of network resources and storage resources due to massive data, and effectively improve the efficiency of data transmission, storage and subsequent data tracing.
[0050] Specifically: an abnormal data packet is formed according to the following method:
[0051] The acquired real-time data of the Internet of Things terminal is stored in a first storage queue, wherein the first storage queue accesses data according to the first-in-first-out principle and the first storage queue has N real-time data storage spaces;
[0052] When there is an abnormality in the real-time status data of the Internet of Things terminal, the current abnormal data is stored in the first storage queue, and then the real-time status data of the Internet of Things terminal squeezed out by the abnormal data in the first storage queue is written into the second storage queue;
[0053] Continue to write the real-time status data of the Internet of Things terminal after the current abnormal data into the first storage queue and write the real-time status data squeezed out of the first storage queue into the second storage queue;
[0054] Determine whether the current abnormal data is squeezed out of the first storage queue. If so, write the abnormal data into the second storage queue, and all data in the first storage queue when the current abnormal data is squeezed out are sequentially written into the second storage queue and are located after the current abnormal data;
[0055] When the real-time status data of the Internet of Things terminals stored in the first storage queue when the current abnormal data is squeezed out is stored in the second storage queue, the current abnormal data in the second storage queue and the real-time status data of N Internet of Things terminals before and after the current abnormal data are formed into an abnormal data packet.
[0056] Among them: the flag information when the abnormal data packet is stored is the first address and the last address of the abnormal data packet. Of course, other flag information can also be set to distinguish different abnormal data packets for easy search.
[0057] The query data packets and the abnormal data packets are stored in different storage queues, that is,
[0058] After the abnormal data packet is formed, the first address and the last address of the abnormal data packet are extracted, and the current abnormal data, the first address and the last address of the abnormal data packet are correspondingly stored in the third storage queue.
[0059] The following is combined with Figure 4 For further explanation:
[0060] Attached Figure 4 In the figure, the left sequence is the first storage queue, the middle sequence is the third storage queue, and the right sequence is the second storage queue;
[0061] After the real-time status data of the IoT terminal is acquired, it is stored in the first storage queue. The access principle of the first storage queue is the first-in-first-out principle, that is, the first-arrived data is first stored in the first storage queue, and the later-arrived data is stored in the order of first arrival. The first storage queue can store N data. As the data is stored, when the storage limit of the first storage queue is reached, the first-entered data is squeezed out;
[0062] When it is determined that there is abnormal data at present (the abnormal data is data that characterizes the state of the Internet of Things terminal, such as the indicator represented by the data is too large, too small, etc.), the abnormal data is still stored in the first storage queue at this time, because the abnormal data also characterizes the real-time state of the Internet of Things terminal; the first storage queue has reached saturation before the current abnormal data arrives, and after the current abnormal data enters the first storage queue, the data that first enters the first storage queue is squeezed out. At this time, the first squeezed-out data is stored in the second storage queue. When the first data squeezed out by the abnormal data is stored in the second storage queue, the first address when the first data is stored in the second storage queue is used as the first address of the current abnormal data packet; the real-time state data after the abnormal data is still stored in the first storage queue. As the data is written, data is squeezed out of the first storage queue one after another, and these squeezed-out data are stored in the second storage queue in turn. When the abnormal state data is squeezed out of the first storage queue, at this time, the first storage queue is The first storage queue stores N data after the abnormal data occurs, and the N data will be stored in the second storage queue (of course, it is also based on the subsequent data being written into the first storage queue in sequence and squeezed out one after another), and is located after the current abnormal data. After the N real-time status data after the current abnormal data are all written into the second storage queue, the last address of the last N data that is finally stored in the second storage queue is used as the last address of the current abnormal data packet. At this time, the current abnormal data is stored in the second storage queue, and the N data before and after the current abnormal data form an abnormal data packet, and then form a complete traceability data packet. When it is necessary to call, the query data packet required by the call instruction is obtained from the third storage queue according to the call instruction, and the query data packet is parsed to obtain the corresponding abnormal data information, the first address and the last address of the abnormal data packet, and the corresponding abnormal data packet, i.e., the traceability data packet, is found from the second storage queue according to the parsing result of the query data packet. In this process, other non-abnormal data (or sensitive data) do not need to be stored, saving network resources, storage resources and transmission efficiency, and the calling efficiency is also significantly improved. The alarm data stored in the third storage queue, that is, the abnormal data, when the abnormal data occurs, the Internet of Things system will generate corresponding alarm information, so the abnormal data is also called alarm data.
[0063] In the above example, it is explained that one abnormal data occurs or the interval between two abnormal data is long (long means that the normal real-time status data between two adjacent abnormal data is greater than N); then the following situations often occur in actual applications:
[0064] 1. When the Internet of Things starts running, abnormal data is generated, that is, the first data to be reached in the first storage queue is the abnormal data. Then, there is no data before the abnormal data occurs. At this time, the above steps are still followed. The difference is that there are only N+1 data in the current abnormal data packet, and it can be marked as 0 before the abnormal data. The first address of the abnormal data packet in the second storage queue is the first address of the current abnormal data stored in the second storage queue.
[0065] 2. Abnormal data appears continuously, for example: three consecutive abnormal data A, B, and C. When A is judged as abnormal data, only A is regarded as abnormal data, and B and C are treated as normal data. After A is judged, if B is also judged as abnormal data, only B is regarded as abnormal data, and the rest are treated as normal data. The subsequent processing process is exactly the same as the above process.
[0066] Accordingly, the present invention also provides an Internet of Things terminal status data tracing system, comprising a processor, a first memory and a second memory;
[0067] The processor is used to obtain the real-time status data of the Internet of Things terminal, determine whether the real-time status data of the Internet of Things terminal is abnormal, and output alarm information when the real-time status data of the Internet of Things terminal is abnormal;
[0068] The processor stores the real-time status data of the IoT terminal in the first memory and the second memory;
[0069] The first memory is used to store the real-time status data of the Internet of Things terminal acquired by the processor, and the first processor follows the first-in-first-out principle when accessing data;
[0070] The second memory has a status data storage queue and an alarm data storage queue. When an abnormality occurs in the real-time status data of the IoT terminal, the 2N real-time status data before and after the current abnormal data and the current abnormal data itself are stored in the status data storage queue as an abnormal data packet, and the first address and the last address of the abnormal data packet and the current abnormal data itself are stored in the alarm data storage queue as a query data packet. Through the above system, the abnormal data of the IoT terminal and the status data before and after the abnormal data can be accurately obtained when an abnormality occurs in the IoT terminal, providing accurate data support for the analysis of key data or sensitive data of the IoT system, and can effectively reduce the consumption of network resources and storage resources caused by massive data, and effectively improve the efficiency of data transmission, storage and subsequent data tracing.
[0071] Specifically: an abnormal data packet is formed according to the following method:
[0072] The processor stores the acquired real-time data of the Internet of Things terminal in a first storage queue, wherein the first storage queue accesses data based on a first-in-first-out principle and the first storage queue has N real-time data storage spaces;
[0073] When the processor determines that the real-time status data of the Internet of Things terminal is abnormal, the processor stores the current abnormal data in the first storage queue, and then writes the real-time status data of the Internet of Things terminal squeezed out by the abnormal data in the first storage queue into the second storage queue;
[0074] The processor continues to write the real-time status data of the Internet of Things terminal after the current abnormal data into the first storage queue and writes the real-time status data squeezed out of the first storage queue into the second storage queue;
[0075] The processor determines whether the current abnormal data is squeezed out of the first storage queue. If so, the abnormal data is written into the second storage queue, and all data in the first storage queue when the current abnormal data is squeezed out are sequentially written into the second storage queue and are located after the current abnormal data;
[0076] When the real-time status data of the Internet of Things terminals stored in the first storage queue when the current abnormal data is squeezed out is stored in the second storage queue, the current abnormal data in the second storage queue and the real-time status data of N Internet of Things terminals before and after the current abnormal data are formed into an abnormal data packet.
[0077] For the call of abnormal data, the following steps are followed: The processor calls the abnormal data packet according to the following method:
[0078] The processor receives the call instruction sent by the host computer;
[0079] The processor searches for a query data packet corresponding to the current call instruction in the alarm data storage queue of the second memory according to the call instruction, and parses the found query data packet to obtain the abnormal data information contained in the call instruction and the first address and the last address of the abnormal data packet corresponding to the abnormal information;
[0080] The processor calls the abnormal data packet from the state data storage queue of the second memory according to the abnormal data information and the first address and the last address of the abnormal data packet.
[0081] Of course, the second memory can also be replaced by two memories, respectively realizing the storage of status data and the storage of alarm data; or one memory can be used to replace the first memory and the second memory. If one memory is used, then the first storage queue, the second storage queue and the third storage queue as mentioned above can be opened up in the memory. These are all equivalent replacement methods.
[0082] In this embodiment, an input module and an output module are also included. The input module is communicatively connected to the processor and is used to input the real-time status data of the Internet of Things terminal into the processor.
[0083] Specifically: the input module is a transmission interface.
[0084] The access module is a wireless transmission module.
[0085] The output module is connected to the processor and is used to transmit the data of the processor to the host computer.
[0086] The output module is a transmission interface.
[0087] The output module is a wireless transmission module. The transmission interface mentioned above adopts an existing interface, such as an Ethernet interface, an optical fiber interface, etc., and the wireless transmission module adopts an existing module, such as a Bluetooth module, a mobile communication module (such as a 4G module, a 5G module), a UWB module, a ZigBee module, etc.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A method for tracing status data of an Internet of Things terminal, characterized by: The following steps are involved: Obtain real-time status data of IoT terminals; Determine whether there is an abnormality in the real-time status data of the IoT terminal. If so, extract the real-time status data of the N IoT terminals before and after the abnormal data to form an abnormal data packet and store the abnormal data packet; Extract the flag information when the abnormal data packet is stored, and store the flag information and the abnormal data in correspondence to form a query data packet; wherein: the flag information when the abnormal data packet is stored is the first address and the last address of the abnormal data packet; When calling an abnormal data packet, query and call the abnormal data packet according to the information contained in the query data packet; The abnormal data packet is formed according to the following method: The acquired real-time data of the Internet of Things terminal is stored in a first storage queue, wherein the first storage queue accesses data according to the first-in-first-out principle and the first storage queue has N real-time data storage spaces; When there is an abnormality in the real-time status data of the Internet of Things terminal, the current abnormal data is stored in the first storage queue, and then the real-time status data of the Internet of Things terminal squeezed out by the abnormal data in the first storage queue is written into the second storage queue; Continue to write the real-time status data of the Internet of Things terminal after the current abnormal data into the first storage queue and write the real-time status data squeezed out of the first storage queue into the second storage queue; Determine whether the current abnormal data is squeezed out of the first storage queue. If so, write the abnormal data into the second storage queue, and all data in the first storage queue when the current abnormal data is squeezed out are sequentially written into the second storage queue and are located after the current abnormal data; When the real-time status data of the Internet of Things terminal stored in the first storage queue when the current abnormal data is squeezed out is stored in the second storage queue, the current abnormal data in the second storage queue and the real-time status data of the N Internet of Things terminals before and after the current abnormal data are formed into an abnormal data packet; After the abnormal data packet is formed, the first address and the last address of the abnormal data packet are extracted, and the current abnormal data, the first address and the last address of the abnormal data packet are correspondingly stored in the third storage queue; the query data packet and the abnormal data packet are located in different storage queues when stored.
