An analysis and early warning method and system for data collection of Internet of Things devices
The IoT device data collection, analysis and early warning method and system designed through the microservice architecture solves the problems of computing consistency, long development cycle and high storage pressure in the IoT device data processing architecture, and achieves efficient and flexible data processing. and real-time multi-device automatic alarm capabilities to adapt to changes in multiple business scenarios.
Patent Information
- Application Number
- CN202111661049.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-12-30
AI Technical Summary
Existing IoT device data processing architectures such as Lambda architecture have problems such as inconsistency between real-time and batch calculation results, redevelopment of data source changes, inability to complete batch calculations within the calculation window, and high server storage requirements, and cannot meet the needs of modern data analysis.
The Internet of Things device data collection, analysis and early warning method and system designed using microservice architecture supports the acquisition and flow of multiple types of data sources. Through the unified definition, classification, preprocessing, correlation mining and early warning of real-time reported information, real-time multi-device automatic alarms can be realized .
It achieves real-time access to billions of devices, efficient concurrent processing of tens of millions of data, second-level communication capabilities, and millisecond-level response time, adapts to changes in multiple business scenarios, eliminates single points of failure, and supports one-screen overview of equipment status in the entire region, improving Improve data processing efficiency and system availability.
Smart Images

Figure CN114338746B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of Internet of Things, and in particular relates to an analysis and early warning method and system for collecting data from Internet of Things devices. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] After more than 20 years of development, the Internet of Things industry has gradually matured and with the integration and application of new technologies such as cloud computing, AI, and 5G, the Internet of Things has gradually transitioned to AIoT: the combination of IoT and AI generates and collects massive amounts of data through the Internet of Things, stores it in device terminals, edge devices or the cloud, and then uses machine learning to perform intelligent analysis of the data to achieve the intelligent connection of all things.
[0004] At present, the data architecture of most companies is Lambda architecture, which solves the needs of a company for batch offline processing of big data and real-time data processing. Data starts from the underlying data source and enters the big data platform through various formats. In the big data platform, data is collected through data components such as Kafka and Flume, and then divided into two lines for calculation. One line enters the streaming computing platform (such as Storm, Flink or Spark Streaming) to calculate some real-time indicators; the other line enters the batch data processing offline computing platform (such as Mapreduce, Hive, Spark SQL) to calculate T+1 related business indicators, which need to be seen every other day. Although the Lambda architecture has been stable after years of development, it also has some fatal shortcomings and is increasingly unable to meet the needs of data analysis business in the era of big data 3.0.
[0005] The disadvantages are as follows:
[0006] 1. Data caliber issues caused by inconsistency between real-time and batch calculation results;
[0007] 2. Batch calculation cannot be completed within the calculation window;
[0008] 3. Any changes in data sources require redevelopment, which takes a long time to develop and does not allow for fast business response.
[0009] 4. High requirements for server storage, increasing server storage pressure. Summary of the invention
[0010] In order to solve the above problems, the present invention proposes an analysis and early warning method and system for IoT device data collection. The present invention supports multiple types of data sources to obtain data and flow directions, and has extremely high security, reliability and data recovery capabilities.
[0011] According to some embodiments, a first solution of the present invention provides an analysis and early warning method for IoT device data collection, which adopts the following technical solution:
[0012] An analysis and early warning method for collecting data from IoT devices, comprising:
[0013] Obtain real-time reporting information from IoT devices and make unified definitions;
[0014] Classify based on real-time reporting information from IoT devices;
[0015] Perform data preprocessing on the classified data;
[0016] For the pre-processed data, correlation mining is performed in different corresponding scenarios to determine the correlation information of IoT device data;
[0017] Real-time warning is provided based on the correlation information between IoT device data and the set trigger conditions for device reporting information.
[0018] According to some embodiments, a second solution of the present invention provides an analysis and early warning system for IoT device data collection, which adopts the following technical solutions:
[0019] An analysis and early warning system for IoT device data collection, comprising:
[0020] The data collection module is configured to obtain real-time reporting information from IoT devices and perform unified definition;
[0021] A data classification module is configured to classify data based on real-time reporting information from IoT devices;
[0022] A data preprocessing module is configured to perform data preprocessing on the classified data;
[0023] The data association module is configured to perform association mining on the pre-processed data in corresponding different scenarios to determine the association information of the IoT device data;
[0024] The device early warning module is configured to provide real-time early warning based on the correlation information between IoT device data and the set trigger conditions for device reporting information.
[0025] According to some embodiments, a third aspect of the present invention provides a computer-readable storage medium.
[0026] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of an analysis and early warning method for data collection of Internet of Things devices as described in the first aspect above.
[0027] According to some embodiments, a fourth aspect of the present invention provides a computer device.
[0028] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in an analysis and early warning method for data collection of IoT devices as described in the first aspect above are implemented.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] 1. The present invention adopts a microservice architecture with open capabilities and flexible design. It can integrate multiple business scenarios such as smart gas, smart water, smart kitchen, smart community, etc. It can adapt to the ever-changing business scenarios of various enterprises and embrace the industry ecology.
[0031] 2. The platform of the present invention supports rapid hybrid adaptation of multiple devices, multiple protocols, and multiple networks. Through load balancing and distributed cluster deployment technologies such as Docker, it eliminates single points of failure, ensures high availability of services, supports real-time access of hundreds of millions of devices, efficient concurrent processing of tens of millions of data, second-level communication capabilities, and millisecond-level response time.
[0032] 3. The present invention processes data in layers according to the timeliness of the data to maximize the overall processing efficiency.
[0033] 4. The prior art of the present invention cannot realize a one-screen overview of the equipment status in the entire area, which is equivalent to being unable to simultaneously obtain the operating data status of multiple devices in the entire area. In order to solve this deficiency, the present application realizes real-time automatic alarm of multiple devices through data collection and analysis and correlation mining. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0035] Figure 1 It is a flow chart of an analysis and early warning method for IoT device data collection according to the first embodiment of the present invention;
[0036] Figure 2 This is a device access flow chart of an analysis and early warning system for IoT device data collection as described in Embodiment 1 of the present invention. DETAILED DESCRIPTION
[0037] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0038] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0039] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0040] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0041] Embodiment 1
[0042] like Figure 1-Figure 2 As shown, this embodiment provides an analysis and early warning method for IoT device data collection. In this embodiment, the method includes the following steps:
[0043] Obtain real-time reporting information from IoT devices and make unified definitions;
[0044] Classify based on real-time reporting information from IoT devices;
[0045] Perform data preprocessing on the classified data;
[0046] For the pre-processed data, correlation mining is performed in different corresponding scenarios to determine the correlation information of IoT device data;
[0047] Real-time warning is provided based on the correlation information between IoT device data and the set trigger conditions for device reporting information.
[0048] Specifically, the real-time reporting information of the IoT devices is obtained and uniformly defined, specifically as follows:
[0049] Parse the messages of real-time information reported by different IoT devices to obtain unified messages with unified definitions;
[0050] Unified messages mainly consist of deviceId, messageId, headers, and timestamp;
[0051] deviceId is the unique identifier of the device, messageId is the unique identifier of the message, headers is the message header, and timestamp is the timestamp of the message; the headers is the message header, which is used for custom message processing behaviors, such as whether it is an asynchronous message, whether it is a fragmented message, etc.
[0052] Among them, best practices for device access;
[0053] The core of device access is the protocol package. Whether it is a direct-connected device or a cloud-to-cloud connection, in theory, it can be processed in a custom protocol package.
[0054] Physical Model Definition
[0055] The delivery of IoT projects in the industry requires a standard object model. For equipment manufacturers, if there is a standard object model, they no longer need to choose only one manufacturer's data model. For ISV application manufacturers, it is impossible to enumerate all applications / devices for pre-integration during the development phase. For SI manufacturers, there are too many subsystems and docking and integration take time. For customers, the delivery cycle is too long. The standard object model can be used to improve efficiency between object models, between objects and applications, and between applications. We will be compatible with major manufacturers to jointly define standard object models, multiple devices, multiple manufacturers, and unified management.
[0056] When accessing a device, first design the attributes, functions, and events of the device object model based on the device and the device access document (message description).
[0057] Generally speaking: For the inherent and unchanging information of the device, it is recommended to use device tags for management; attributes are used to define some indicator data, such as voltage, temperature, etc.
[0058] Attributes should all be simple data types, such as int, float, string, etc. Avoid using complex types such as structures.
[0059] Functions are used to define some executable actions of the device, such as mute, turn off lights, PTZ control. Design input and output parameters according to the situation.
[0060] Events are used to define the actions that occur when a device is under certain conditions, such as fire alarms and face detection. Events are usually of structure type and are used to store more complex data.
[0061] Specifically, the protocol package development:
[0062] It is recommended to use the strategy mode to define the function code and the parsing rules corresponding to different function codes. For example, use enumeration to define the function code, avoid array copy, and use offset to directly process the message.
[0063] Specifically, the storage policy selection
[0064] The platform supports configuring data storage strategies. Different strategies use different data storage methods to save device data.
[0065] 1. Default - row storage
[0066] The default storage solution used by the system uses elasticsearch to store device data. Each attribute value is saved as an index record. Typical application scenarios: When the device only reports a part of the attributes at a time and supports reading part of the attribute data.
[0067] 2. Default - Columnar Storage
[0068] Use elasticsearch to store device data, one attribute as a column, and one attribute message as an index record. This is suitable for scenarios where the device reports all attribute values every time.
[0069] Use MQTT service gateway to access devices
[0070] The following uses MQTTX as an example to introduce how to use third-party software to access the IoT platform using the MQTT protocol. MQTTX is an MQTT client tool based on Eclipse Paho and written in Java. It supports subscribing and publishing messages through topics.
[0071] 1. Create a message protocol according to the message protocol definition;
[0072] 2. Create and publish products based on device configuration information;
[0073] 3. Define physical models for product equipment;
[0074] 4. Import the device. After importing, you can set alarms and perform other operations on the device;
[0075] 5. Create gateway configuration, create MQTT service network components and MQTT service component configuration;
[0076] 6. The device connects to the platform and performs some basic event sending and receiving and attribute reading operations.
[0077] In a specific embodiment, classification is performed based on the real-time reporting information of the IoT devices, specifically:
[0078] Set classification labels according to different equipment manufacturers;
[0079] The set classification identifier is stored in the database in the form of a message queue;
[0080] The data is processed by splitting and dividing the database according to the size of each category.
[0081] Data preprocessing for classified data includes missing value filling, data normalization, data dimensionality reduction and principal component analysis.
[0082] For the preprocessed data, association mining is performed in different corresponding scenarios to determine the association information of IoT device data, specifically:
[0083] Based on the preprocessed data set, the FP-tree frequency set algorithm is used to train and determine the IoT device association information in the corresponding scenario, specifically:
[0084] The IoT device association information is set as transactions and the attribute characteristics are set as elements;
[0085] Based on the associated information of each IoT device, the data set is traversed to count the frequency of occurrence of each element item;
[0086] Traverse the data set again and construct an FP tree based on the elements and the number of times the elements appear;
[0087] For each element item in the FP tree, obtain its corresponding conditional pattern base;
[0088] Based on the FP tree, in order from bottom to top, according to the FP-tree frequency set algorithm, the frequent pattern is finally obtained;
[0089] Determine each IoT device association information based on the frequent items.
[0090] Unified device connection management, multi-protocol adaptation (TCP, MQTT, UDP, CoAP, HTTP, etc.), the platform will encapsulate the multi-protocol network communication interface, but the specific data is parsed by the message protocol.
[0091] The protocol (ProtocolSupport) is mainly composed of an authenticator (Authenticator), a message codec (DeviceMessageCodec), a message sending interceptor (DeviceMessageSenderInterceptor) and configuration metadata (ConfigMetadata), which shields the complexity of network programming and flexibly connects devices with different protocols from different manufacturers.
[0092] Reduce the delay of equipment warning. Regarding warning, the platform supports setting trigger conditions, timed triggering, and real-time triggering.
[0093] 1. Real-time triggering: When the data reported by the device fluctuates around the alarm threshold, multiple alarms may be triggered. In this case, you can configure anti-shake rules to handle it.
[0094] For example, if multiple alarms are reported within 1 minute, only one alarm is processed. When configuring alarms in device products, each device's reported message will be de-shaked and the trigger conditions will be set.
[0095] 2. Timing trigger:
[0096] The cron expression can be used to trigger the event at a fixed time. You can select trigger conditions based on object models, such as events, attributes, etc.
[0097] Embodiment 2
[0098] This embodiment provides an analysis and early warning system for IoT device data collection, including:
[0099] The data collection module is configured to obtain real-time reporting information from IoT devices and perform unified definition;
[0100] A data classification module is configured to classify data based on real-time reporting information from IoT devices;
[0101] A data preprocessing module is configured to perform data preprocessing on the classified data;
[0102] The data association module is configured to perform association mining on the pre-processed data in corresponding different scenarios to determine the association information of the IoT device data;
[0103] The device early warning module is configured to provide real-time early warning based on the correlation information between IoT device data and the set trigger conditions for device reporting information.
[0104] The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment 1. It should be noted that the above modules as part of the system can be executed in a computer system such as a set of computer executable instructions.
[0105] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0106] A microservice set for an analysis and early warning system for IoT device data collection consists of four microservice layers and two enhanced basic system services, providing a series of services from physical domain data collection to information domain data processing. The specific technical solution of the multi-module, four-layer architecture is as follows:
[0107] Driver layer: SDK used to provide standard or private protocols to connect physical devices, responsible for data collection and command control of southbound devices, and rapid driver development based on SDK
[0108] Data layer: responsible for the collection and storage of equipment data, and provides data management interface services;
[0109] Management layer: It is used to provide microservice registration center, device command interface, device registration and association pairing, and data management center. It is the core part of all microservice interactions, responsible for the management of various configuration data, and provides interface services to the outside world.
[0110] Application layer: used to provide rule engine, data openness, task scheduling, alarm and message notification, log management, etc., and has the ability to connect to third-party platforms.
[0111] Platform unified device message definition:
[0112] The platform uses a custom protocol package to parse the messages reported by the device into unified messages of the platform for unified management.
[0113] The platform unified message is basically the same as the definition in the object model, and is mainly composed of properties, functions, and events.
[0114] Message composition:
[0115] The message mainly consists of deviceId, messageId, headers, and timestamp. DeviceId is the unique identifier of the device, messageId is the unique identifier of the message, and headers is the message header, which is usually used to customize the behavior of message processing, such as whether it is an asynchronous message, whether it is a fragmented message, etc.
[0116] Property related messages
[0117] 1. Get the device property (ReadPropertyMessage) and the corresponding device reply message ReadPropertyMessageReply.
[0118] 2. Modify the device properties (WritePropertyMessage) corresponding to the device reply message WritePropertyMessageReply.
[0119] 3. The device reports properties (ReportPropertyMessage) by the device.
[0120] Event Message
[0121] EventMessage is sent from the device to the platform;
[0122] Device messages correspond to event bus topics;
[0123] After the protocol package parses the message reported by the device into a unified device message of the platform, it will convert the message to the corresponding topic and send it to the event bus. These messages can be processed by subscribing to messages from the event bus. The topic prefixes of all device messages need to follow the specified rules.
[0124] For example: / device / {productId} / {deviceId}. In this way, you can subscribe to the specified messages of all devices through wildcards, such as: / device / * / * / online, or subscribe to all messages: / device / **
[0125] The proposed system can be implemented in other ways. For example, the system embodiment described above is only illustrative, and the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0126] Embodiment 3
[0127] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the analysis and early warning method for IoT device data collection as described in the first embodiment above are implemented.
[0128] Embodiment 4
[0129] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of an analysis and early warning method for IoT device data collection as described in the first embodiment above are implemented.
[0130] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0131] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0132] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0133] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0134] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0135] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. An analysis and early warning method for IoT device data collection, characterized in that: include: Obtain real-time reporting information from IoT devices and define it uniformly; The platform uses a custom protocol package to parse the messages reported by the device into platform unified messages for unified management; the definition of unified messages consists of attributes, functions, and events; Classification based on real-time reporting information from IoT devices; specifically: Set classification labels according to different equipment manufacturers; store the set classification labels in the database in the form of message queues; use split-database processing according to the size of each category of data; Perform data preprocessing on the classified data; Including missing value filling, data normalization, data dimension reduction and data principal component analysis; For the preprocessed data, association mining is performed in the corresponding different scenarios to determine the association information of the IoT device data; specifically, the FP-tree frequency set algorithm is used to train the preprocessed data set to determine the association information of the IoT devices in the corresponding scenarios; specifically, the IoT device association information is set as a transaction, and the attribute features are set as elements; Based on the associated information of each IoT device, the data set is traversed to count the frequency of occurrence of each element item; Traverse the data set again and construct an FP tree based on the elements and the number of times the elements appear; For each element item in the FP tree, obtain its corresponding conditional pattern base; Based on the FP tree, in order from bottom to top, according to the FP-tree frequency set algorithm, finally a frequent pattern is obtained; based on the frequent items, the associated information of each IoT device is determined; Unified device connection management, multi-protocol adaptation, platform encapsulation of multi-protocol network communication interface, specific data is parsed by message protocol; The protocol is mainly composed of authenticators, message codecs, message sending interceptors, and configuration metadata, which shields the complexity of network programming and allows flexible access to devices with different protocols from different manufacturers. Provide real-time warnings based on the correlation information between IoT device data and the set trigger conditions for device reporting information; The microservice set of the analysis and early warning system consists of four microservice layers and two enhanced basic system services, providing services from physical domain data collection to information domain data processing; it adopts a multi-module, four-layer architecture, as follows: Driver layer: SDK used to provide standard or private protocols to connect physical devices, responsible for data collection and command control of southbound devices; Data layer: responsible for the collection and storage of equipment data, and provides data management interface services; Management layer: It is used to provide microservice registration center, device command interface, device registration and association pairing, and data management center. It is the core part of all microservice interactions, responsible for the management of various configuration data, and provides interface services to the outside world. Application layer: used to provide rule engine, data openness, task scheduling, alarm and message notification, log management, etc., and has the ability to connect to third-party platforms.
2. The analysis and early warning method for IoT device data collection according to claim 1, characterized in that: The real-time reporting information of the IoT devices is obtained and uniformly defined, specifically: Parse the real-time information reports from different IoT devices to obtain unified messages with unified definitions; Unified messages mainly consist of deviceId, messageId, headers, and timestamp; deviceId is the unique identifier of the device, messageId is the unique identifier of the message, headers is the message header, and timestamp is the timestamp of the message; The headers are message headers, which are used to customize the message processing behavior, such as whether it is an asynchronous message or a fragmented message.
3. The analysis and early warning method for IoT device data collection as claimed in claim 2, characterized in that: When connecting a device, first design the attributes, functions, and events of the device object model according to the device and the device connection document; Among them, the inherent and unchanging information of the device is managed using device tags; attributes are used to define some indicator data; Functions are used to define some executable actions of the device, and the input and output parameters are designed according to the situation; Events are used to define the actions that occur when a device meets certain conditions.
4. An analysis and early warning system for IoT device data collection, using the analysis and early warning method for IoT device data collection as claimed in claim 1, characterized in that: include: The data collection module is configured to obtain real-time reporting information from IoT devices and make a unified definition; A data classification module is configured to classify data based on real-time reporting information from IoT devices; A data preprocessing module is configured to perform data preprocessing on the classified data; The data association module is configured to perform association mining on the pre-processed data in corresponding different scenarios to determine the association information of the IoT device data; The device early warning module is configured to provide real-time early warning based on the correlation information between IoT device data and the set trigger conditions for device reporting information.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of an analysis and early warning method for collecting data from Internet of Things devices as described in any one of claims 1 to 3 are implemented.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the analysis and early warning method for IoT device data collection as described in any one of claims 1 to 3 are implemented.
