A method, device, electronic device and storage medium for managing Internet of Things devices
By establishing and synchronizing device shadows in IoT devices, the load pressure problem caused by the Internet of Things platform due to the access of a large number of devices is solved, and the stability and processing capabilities of the platform are improved.
Patent Information
- Application Number
- CN202010930318.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-07
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2040-09-07
AI Technical Summary
When a large number of devices are connected to the IoT platform, the device information that the IoT platform needs to process increases, resulting in excessive load pressure and may even cause the platform to be paralyzed.
By obtaining the object model information of registered devices, establishing device shadows and syncing them to the device, the device allows the device to perform operations based on the synchronized shadows when collecting information, reducing the need to send information to the Internet of Things platform, thereby reducing platform load .
It effectively reduces the load pressure of the IoT platform, avoids platform paralysis caused by information processing overload, and improves the stability and processing capabilities of the platform.
Smart Images

Figure CN114244860B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to an Internet of Things device management method, device, electronic device and storage medium. Background Art
[0002] The Internet of Things refers to the use of sensors, radio frequency identification devices, global positioning systems, infrared sensors, laser scanners and other devices to collect any objects or processes that need to be monitored, connected, and interacted in real time, collect various information such as sound, light, heat, electricity, force, and location, and connect objects with objects and objects with people through various possible network accesses, so as to realize intelligent control, identification and management of objects and processes. This will form a network based on the Internet as an information carrier, allowing all independently addressable devices to interconnect.
[0003] Before forming the Internet of Things, the device needs to be registered in the Internet of Things platform. After the device is registered in the Internet of Things platform, in order to decouple the device from the application of the Internet of Things platform, the device shadow is provided in the relevant technology. Among them, the device shadow is usually a JSON document in the Internet of Things platform, which is used to store the status of the device, the device attributes reported by the device last time, and the configuration that the Internet of Things platform expects to send. Each device has one and only one device shadow, and the device can obtain and set the device shadow to synchronize the status.
[0004] In related technologies, devices usually report the collected device information to the IoT platform, which then processes the collected device information and sends the corresponding instructions obtained from the processing to the device instructions, which are then executed by the device. However, when a large number of devices are connected to the IoT platform, the IoT platform needs to process a lot of device information, which will increase the load pressure of the IoT platform and even cause the IoT platform to crash. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide an Internet of Things device management method, device, electronic device and storage medium to reduce the load pressure of the Internet of Things platform. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present invention provides an Internet of Things device management method, which is applied to an Internet of Things platform. The method includes:
[0007] Obtain the physical model information of the device registered to the IoT platform, and create the device shadow corresponding to the device based on the physical model information;
[0008] Synchronize the device shadow to the device so that when the device collects device information, it performs corresponding operations based on the synchronized device shadow.
[0009] Optionally, before obtaining the object model information of the device registered with the Internet of Things platform, the method further includes:
[0010] When the device is registered with the IoT platform, a software development kit containing a preset device shadow is sent to the device, so that the device can save the preset device shadow locally;
[0011] Synchronize the device shadow to the device so that when the device collects device information, it performs corresponding operations based on the synchronized device shadow, including:
[0012] The device shadow is sent to the device so that the device synchronizes the device shadow to the preset device shadow to obtain the synchronized device shadow, and when the device information is collected, the corresponding operation is performed based on the synchronized device shadow.
[0013] Optionally, the object model information includes: boundary conditions of the device and corresponding event operations; in this regard, the device shadow is synchronized to the device so that when the device information is collected, the device performs corresponding operations based on the synchronized device shadow, including:
[0014] The device shadow including the boundary conditions and the corresponding event operations is synchronized to the device, so that when the device information is collected, the device performs the corresponding event operations based on the device information and the boundary conditions.
[0015] Optionally, the object model information further includes: first operation priority information corresponding to the boundary condition; in this regard, a device shadow including the boundary condition and the corresponding event operation is synchronized to the device, so that when the device information is collected, the device performs the corresponding event operation based on the device information and the boundary condition, including:
[0016] The device shadow including the boundary conditions, the corresponding event operations and the first operation priority information is synchronized to the device, so that when the device collects the device information, the device performs the corresponding event operation based on the device information, the boundary conditions and the first operation priority information.
[0017] Optionally, the Internet of Things platform is further connected to a control terminal, and the event operation includes: first event information feedback; in this regard, the method further includes:
[0018] The first event information fed back by the device based on the collected device information and boundary conditions is acquired; and the first event information is forwarded to the control terminal.
[0019] Optionally, the object model information includes: a trend condition of the device and a corresponding event operation; in this regard, the device shadow is synchronized to the device, so that when the device information is collected, the device performs a corresponding operation based on the synchronized device shadow, including:
[0020] The device shadow containing trend conditions and corresponding event operations is synchronized to the device, so that when the device collects device information, it determines the information change of the device based on the collected device information and historical device information, and performs corresponding event operations based on the information change of the device and trend conditions.
[0021] Optionally, the object model information includes: second operation priority information; in this regard, synchronizing a device shadow including a trend condition and a corresponding event operation to the device, so that when the device collects device information, the device determines the information change of the device based on the collected device information and historical device information, and performs the corresponding event operation based on the information change of the device and the trend condition, including:
[0022] The device shadow including the trend condition, the corresponding event operation and the second operation priority information is synchronized to the device, so that when the device collects the device information, it determines the information change of the device based on the collected device information and the historical device information, and performs the corresponding event operation based on the information change of the device, the trend condition and the second operation priority information.
[0023] Optionally, the Internet of Things platform is further connected to a control terminal, and the event operation includes: feedback of second event information; in this regard, the method further includes:
[0024] Acquire the second event information fed back by the device based on the collected device information, historical device information and trend conditions; and forward the second event information to the control terminal.
[0025] Optionally, obtain the object model information of the device registered to the IoT platform, and create a device shadow corresponding to the device based on the object model information, including:
[0026] Obtaining object model information and device status information, and establishing a device shadow corresponding to the device and version information of the device shadow based on the object model information and the status information;
[0027] Synchronize the device shadow to the device so that when the device collects device information, it performs corresponding operations based on the synchronized device shadow, including:
[0028] When a version switching instruction is received, the device shadow of the target version is determined based on the version information of the device shadow, and the device shadow of the target version is synchronized to the device, so that when the device collects the device information, it performs corresponding operations based on the synchronized device shadow of the target version.
[0029] In a second aspect, an embodiment of the present invention further provides an IoT device management device, which is applied to an IoT platform, and the device includes:
[0030] The device shadow creation module is used to obtain the physical model information of the device registered to the IoT platform and create the device shadow corresponding to the device based on the physical model information;
[0031] The device shadow synchronization module is used to synchronize the device shadow to the device so that when the device collects device information, it performs corresponding operations based on the synchronized device shadow.
[0032] Optionally, the device further comprises:
[0033] A software development kit sending module, used for sending a software development kit including a preset device shadow to a device when the device is registered with the Internet of Things platform before acquiring the object model information of the device registered with the Internet of Things platform, so that the device can save the preset device shadow locally;
[0034] The device shadow synchronization module is specifically used for:
[0035] The device shadow is sent to the device so that the device synchronizes the device shadow to the preset device shadow to obtain the synchronized device shadow, and when the device information is collected, the corresponding operation is performed based on the synchronized device shadow.
[0036] Optionally, the physical model information includes: boundary conditions of the device and corresponding event operations; in this regard, the device shadow synchronization module is specifically used to:
[0037] The device shadow including the boundary conditions and the corresponding event operations is synchronized to the device, so that when the device information is collected, the device performs the corresponding event operations based on the device information and the boundary conditions.
[0038] Optionally, the physical model information further includes: first operation priority information corresponding to the boundary condition; in this regard, the device shadow synchronization module is specifically used to:
[0039] The device shadow including the boundary conditions, the corresponding event operations and the first operation priority information is synchronized to the device, so that when the device collects the device information, the device performs the corresponding event operation based on the device information, the boundary conditions and the first operation priority information.
[0040] Optionally, the Internet of Things platform is further connected to a control terminal, and the event operation includes: first event information feedback; in this regard, the device further includes:
[0041] The first event information acquisition module is used to acquire the first event information fed back by the device based on the collected device information and boundary conditions; and forward the first event information to the control terminal.
[0042] Optionally, the object model information includes: trend conditions of the device and corresponding event operations; in this regard, the device shadow synchronization module is specifically used to:
[0043] The device shadow containing trend conditions and corresponding event operations is synchronized to the device, so that when the device collects device information, it determines the information change of the device based on the collected device information and historical device information, and performs corresponding event operations based on the information change of the device and trend conditions.
[0044] Optionally, the object model information includes: second operation priority information; in this regard, the device shadow synchronization module is specifically used to:
[0045] The device shadow including the trend condition, the corresponding event operation and the second operation priority information is synchronized to the device, so that when the device collects the device information, it determines the information change of the device based on the collected device information and the historical device information, and performs the corresponding event operation based on the information change of the device, the trend condition and the second operation priority information.
[0046] Optionally, the Internet of Things platform is further connected to a control terminal, and the event operation includes: feedback of second event information; in this regard, the device further includes:
[0047] The second event information acquisition module is used to acquire the second event information fed back by the device based on the collected device information, historical device information and trend conditions; and forward the second event information to the control terminal.
[0048] Optional, device shadow creation module, specifically used for:
[0049] Obtaining object model information and device status information, and establishing a device shadow corresponding to the device and version information of the device shadow based on the object model information and the status information;
[0050] The device shadow synchronization module is specifically used for:
[0051] When a version switching instruction is received, the device shadow of the target version is determined based on the version information of the device shadow, and the device shadow of the target version is synchronized to the device, so that when the device collects the device information, it performs corresponding operations based on the synchronized device shadow of the target version.
[0052] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to: implement the steps of an Internet of Things device management method provided in the first aspect above.
[0053] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of an Internet of Things device management method provided in the first aspect are implemented.
[0054] In a fifth aspect, an embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the steps of an Internet of Things device management method provided in the first aspect above.
[0055] In a sixth aspect, an embodiment of the present invention further provides a computer program, which, when executed on a computer, enables the computer to execute the steps of an Internet of Things device management method provided in the first aspect above.
[0056] The embodiments of the present invention provide an IoT device management method, apparatus, electronic device, and storage medium. When the physical model information of a device registered to the IoT platform is obtained, a device shadow corresponding to the device is established based on the physical model information; the device shadow is then synchronized to the device. In this way, when the device collects the device information, the device performs the corresponding operation based on the synchronized device shadow without sending the device information to the IoT platform for processing, thereby reducing the load pressure of the IoT platform. Of course, implementing any product or method of the present invention does not necessarily require all of the above advantages to be achieved at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0058] Figure 1 This is a flow chart of a first implementation method of an Internet of Things device management method according to an embodiment of the present invention;
[0059] Figure 2 This is a flow chart of a second implementation of a method for managing an Internet of Things device according to an embodiment of the present invention;
[0060] Figure 3 This is a flow chart of a third implementation method of an Internet of Things device management method according to an embodiment of the present invention;
[0061] Figure 4 This is a flowchart of a fourth implementation method of an Internet of Things device management method according to an embodiment of the present invention;
[0062] Figure 5This is a flowchart of a fifth implementation of a method for managing an Internet of Things device according to an embodiment of the present invention;
[0063] Figure 6 This is a signaling interaction diagram of the Internet of Things management system according to an embodiment of the present invention;
[0064] Figure 7 This is a schematic diagram of the structure of an Internet of Things device management device according to an embodiment of the present invention;
[0065] Figure 8 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0066] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0067] In order to solve the problems existing in the prior art, the embodiments of the present invention provide an Internet of Things device management method, apparatus, electronic device and storage medium to reduce the load pressure of the Internet of Things platform.
[0068] Next, a method for managing an IoT device according to an embodiment of the present invention is first described. Figure 1 FIG. 1 is a flowchart of a first implementation of a method for managing an IoT device according to an embodiment of the present invention. The method may include:
[0069] S110, obtaining object model information of a device registered to the Internet of Things platform, and establishing a device shadow corresponding to the device based on the object model information;
[0070] S120, synchronizing the device shadow to the device, so that when the device collects the device information, the device performs a corresponding operation based on the synchronized device shadow.
[0071] In some examples, the IoT platform of the embodiment of the present invention may be connected to multiple devices, which may be devices of the same type or devices of different types, which is not limited here. Before connecting a device to the IoT platform, the device may be registered to the IoT platform of the embodiment of the present invention.
[0072] Specifically, the user can input the metadata of the device and the identification information of the device into the IoT platform, and then the IoT platform can find the device based on the address information of the device, and after finding the device, store the metadata of the device and the identification information of the device locally on the IoT platform. The metadata of the device may include: device model, device specifications, device manufacturer, etc. The address information of the device may include the physical address of the device, the IP address of the device, etc.
[0073] In some other examples, the IoT platform may search for address information of a device connected to the IoT platform based on a user's search instructions, and after searching for the address information of the device, display it so that the user can enter metadata of the device corresponding to the address information of the device.
[0074] In this way, the device can be registered to the IoT platform. Then the user can input the object model information of the device to the IoT platform.
[0075] In some examples, the IoT platform may be connected to a backend device, which may include: a mobile terminal, a personal computer, a tablet computer, and other terminals.
[0076] The user can input the physical model information of the device in the back-end device, and then send the physical model information of the device to the above-mentioned Internet of Things platform, so that the Internet of Things platform can obtain the physical model information of the device.
[0077] The object model information is to digitize the actual physical device into a data model composed of attributes, services, and events, which is convenient for cloud management and data interaction. Its essence is a JSON (JavaScript Object Notation) description document. One physical device corresponds to one object model.
[0078] In some examples, the above-mentioned device registered with the Internet of Things platform may be installed with an information collection device, for example, a sensor, a camera, etc. Therefore, the device can collect device information.
[0079] When the device collects the device information, in order to avoid the device sending the device information to the IoT platform for processing, so as to reduce the load pressure of the IoT platform. After obtaining the object model information, the above-mentioned IoT platform can establish the device shadow corresponding to the device based on the object model information; and synchronize the device shadow to the device, so that when the device collects the device information, it can perform the corresponding operation based on the synchronized device shadow, without sending the device information to the IoT platform for processing, thereby reducing the load pressure of the IoT platform.
[0080] In some examples, a device shadow is a digital representation of a physical device in the real world.
[0081] An Internet of Things device management method provided by an embodiment of the present invention can establish a device shadow corresponding to the device based on the object model information when the object model information of the device registered to the Internet of Things platform is obtained; and then synchronize the device shadow to the device. In this way, when the device collects the device information, the device performs the corresponding operation based on the synchronized device shadow without sending the device information to the Internet of Things platform for processing, thereby reducing the load pressure of the Internet of Things platform.
[0082] exist Figure 1 Based on the IoT device management method shown in FIG. 1 , the embodiment of the present invention further provides a possible implementation method, such as Figure 2 FIG. 1 is a flow chart of a second implementation of a method for managing an IoT device according to an embodiment of the present invention. The method may include:
[0083] S210, when the device is registered to the IoT platform, a software development kit including a preset device shadow is sent to the device, so that the device locally saves the preset device shadow;
[0084] S220, obtaining object model information of a device registered to the IoT platform, and establishing a device shadow corresponding to the device based on the object model information;
[0085] S230, sending the device shadow to the device so that the device synchronizes the device shadow to the preset device shadow, obtains the synchronized device shadow, and performs corresponding operations based on the synchronized device shadow when the device information is collected.
[0086] In some examples, in order to facilitate synchronization of device shadows in subsequent steps, preset device shadows can be set in advance in the IoT platform.
[0087] Among them, each parameter in the preset device shadow can be empty. In this way, the preset device shadow can be made into a universal device shadow. Therefore, when the device is registered to the Internet of Things platform, the software development kit containing the universal device shadow can be sent to the above-mentioned device for storage.
[0088] In some other examples, corresponding device shadows can be pre-set for different types of devices in the above-mentioned IoT platform, and then when the device is registered to the IoT platform, a software development kit containing the device shadow corresponding to the type of device is sent to the device for storage.
[0089] After sending the software development kit to the device, when the Internet of Things platform obtains the object model information, it can establish a device shadow corresponding to the device based on the object model information, and then send the device shadow to the device. In this way, the device can synchronize the device shadow sent by the Internet of Things platform to the preset device shadow, thereby obtaining the synchronized device shadow.
[0090] In some examples, the IoT platform may send the parameters of the device shadow to the device, so that after acquiring the parameters of the device shadow, the device may use the parameters of the device shadow to replace the preset parameters of the device shadow, thereby obtaining a synchronized device shadow.
[0091] In the embodiment of the present invention, by using a software development kit, it is possible to conveniently deploy a device shadow in a device when the device is registered to an Internet of Things platform, thereby facilitating a subsequent synchronization process and reducing the time overhead of the synchronization process.
[0092] In some examples, some devices usually have boundary conditions, which may be the temperature range, pressure range, etc. of the working environment. Correspondingly, under different boundary conditions, there should be corresponding event operations. Therefore, the user can input the boundary conditions and corresponding event operations as object models into the above-mentioned Internet of Things platform.
[0093] Based on this, Figure 1 Based on the IoT device management method shown in FIG. 1 , the embodiment of the present invention further provides a possible implementation method, such as Figure 3 FIG. 1 is a flowchart of a third implementation of a method for managing an IoT device according to an embodiment of the present invention. The method may include:
[0094] S310, obtaining object model information of a device registered to the Internet of Things platform, and establishing a device shadow corresponding to the device based on the object model information;
[0095] S320, synchronizing the device shadow including the boundary conditions and the corresponding event operations to the device, so that when the device information is collected, the device performs the corresponding event operations based on the device information and the boundary conditions.
[0096] When the user inputs the boundary conditions and corresponding event operations as a physical model into the above-mentioned IoT platform, the IoT platform can obtain the physical model information including the boundary conditions and the corresponding event operations, and then establish a device shadow corresponding to the device based on the physical model information.
[0097] After obtaining the device shadow, the above-mentioned Internet of Things platform can synchronize the device shadow including the boundary conditions and the corresponding event operations to the device. In this way, when the device collects the device information, it can perform the corresponding event operations based on the device information and the boundary conditions.
[0098] Specifically, when the above-mentioned device performs corresponding event operations based on the device information and boundary conditions, it may send an alarm message to the above-mentioned Internet of Things platform when the device information exceeds the boundary conditions, or send the device information to the above-mentioned Internet of Things platform when the device information does not exceed the boundary conditions.
[0099] In some examples, the aforementioned IoT platform is also connected to a control terminal. When the IoT platform obtains alarm information fed back by the device based on the collected device information and boundary conditions, the alarm information can be sent to the aforementioned control terminal.
[0100] Or when the device information fed back by the device is obtained, the device information is sent to the above-mentioned control terminal.
[0101] In some examples, events of different importance should have different priorities. Based on this, the user can set the first operation priority information corresponding to the boundary condition. Therefore, the object model information obtained by the above-mentioned Internet of Things platform can also include: the first operation priority information corresponding to the boundary condition.
[0102] At this time, the above-mentioned Internet of Things platform can synchronize the device shadow containing boundary conditions, corresponding event operations and first operation priority information to the device, so that when the device collects device information, it performs the corresponding event operation based on the device information, boundary conditions and first operation priority information.
[0103] For example, assuming the boundary conditions are that the working temperature is -50℃~250℃ and the working pressure is 1MPa~5MPa. The first operation priority information is: the alarm information of the working pressure higher than 5MPa or lower than 1MPa is the first priority, and the alarm information of the working temperature lower than -50℃ or higher than 250℃ is the second priority. If the device information is the temperature of -51℃ and the pressure of 5.1MPa, the above device will give priority to sending the alarm information of the working pressure higher than 5MPa to the above IoT platform.
[0104] In the embodiment of the present invention, by setting different priorities for different event operations, more important event operations can be executed first.
[0105] In some examples, changes in device information usually have some trends, such as the changing trend of working temperature or the changing trend of working pressure. In order to predict the device information of the device based on the trend in advance so as to remind the user in advance, the user can input the trend conditions of the device and the corresponding event operations as a physical model into the above-mentioned Internet of Things platform.
[0106] Based on this, Figure 1 Based on the IoT device management method shown in FIG. 1 , the embodiment of the present invention further provides a possible implementation method, such as Figure 4 FIG. 1 is a flowchart of a fourth implementation of a method for managing an IoT device according to an embodiment of the present invention. The method may include:
[0107] S410, obtaining object model information of a device registered to the Internet of Things platform, and establishing a device shadow corresponding to the device based on the object model information;
[0108] S420, synchronize the device shadow including the trend conditions and the corresponding event operations to the device, so that when the device collects the device information, it determines the information change of the device based on the collected device information and the historical device information, and performs the corresponding event operation based on the information change of the device and the trend conditions.
[0109] When the user inputs the trend condition and the corresponding event operation as a physical model into the above-mentioned IoT platform, the IoT platform can obtain the physical model information including the trend condition and the corresponding event operation, and then establish the device shadow corresponding to the device based on the physical model information.
[0110] After obtaining the device shadow, the above-mentioned Internet of Things platform can synchronize the device shadow containing trend conditions and corresponding event operations to the device. In this way, when the device collects device information, it determines the information changes of the device based on the collected device information and historical device information, and then performs corresponding event operations based on the information changes and trend conditions of the device.
[0111] Specifically, when the above-mentioned device performs corresponding event operations based on the information changes and trend conditions of the device, it may send an alarm message to the above-mentioned Internet of Things platform when the information change is greater than or equal to the trend condition, or send device information to the above-mentioned Internet of Things platform when the information change is less than the trend condition.
[0112] In some examples, the above-mentioned Internet of Things platform is also connected to a control terminal. When the Internet of Things platform obtains alarm information fed back by the device based on the collected device information, historical device information and trend conditions, the alarm information can be sent to the above-mentioned control terminal.
[0113] Or when the device information fed back by the device is obtained, the device information is sent to the above-mentioned control terminal.
[0114] In some examples, events of different importance should have different priorities. Based on this, the user can set the second operation priority information corresponding to the trend condition. Therefore, the object model information obtained by the above-mentioned Internet of Things platform can also include: the second operation priority information corresponding to the trend condition.
[0115] At this time, the above-mentioned Internet of Things platform can synchronize the device shadow containing trend conditions, corresponding event operations and second operation priority information to the device, so that when the device collects device information, it determines the information changes of the device based on the collected device information and historical device information, and compares the information changes with the trend conditions; and when the information changes do not meet the trend conditions, the event operations corresponding to the trend conditions are executed based on the second operation priority information.
[0116] For example, assuming that the trend condition is that the rate of change of the working temperature is less than or equal to 10°C / h, and the rate of change of the working pressure is less than or equal to 0.1MPa / h. The first operation priority information is: the alarm information of the rate of change of the working pressure is greater than 0.1MPa / h is the first priority, and the alarm information of the working temperature is greater than 10°C / h is the second priority. When the rate of change of the working temperature in the obtained device information is 11°C / h and the rate of change of the working pressure is 0.11MPa / h, the above-mentioned device will give priority to sending the alarm information of the rate of change of the working pressure greater than 0.1MPa / h to the above-mentioned Internet of Things platform.
[0117] exist Figure 1 Based on the IoT device management method shown in FIG. 1 , the embodiment of the present invention further provides a possible implementation method, such as Figure 5 FIG. 1 is a flowchart of a fifth implementation of a method for managing an IoT device according to an embodiment of the present invention. The method may include:
[0118] S510, acquiring object model information and device status information, and establishing a device shadow corresponding to the device and version information of the device shadow based on the object model information and the status information;
[0119] S520, when receiving a version switching instruction, determine the device shadow of the target version based on the version information of the device shadow, and synchronize the device shadow of the target version to the device, so that when the device collects the device information, it performs corresponding operations based on the synchronized device shadow of the target version.
[0120] In some examples, when the user inputs object model information each time, the above-mentioned Internet of Things platform can establish version information of the device shadow when establishing the device shadow based on the object model information obtained each time.
[0121] In some other examples, the above-mentioned user can also input the status information of the device each time when inputting the physical model information. Therefore, the above-mentioned Internet of Things device can establish a device shadow corresponding to the device containing the physical model information and the status information, as well as the version information of the device shadow based on the input physical model information and the status information of the device.
[0122] The state information of the device may include: state metadata, expected value, collected device information, etc. The state metadata may include information such as the time when the collected device information of the device changes.
[0123] In some other examples, when the user inputs the status information of the device, the collected device information in the status information may be empty or set to 0.
[0124] In some other examples, the user can also input the change rules of the device shadow version information, and then the above-mentioned Internet of Things platform can establish new version information according to the change rules of the version information and the historical version information each time the device shadow version information is established.
[0125] After the above-mentioned IoT platform establishes the device shadow corresponding to the device and the version information of the device shadow each time, the device shadow corresponding to the device and the version information of the device shadow can be saved accordingly. In this way, when a version switching instruction is received, the device shadow of the target version can be determined based on the saved version information of multiple device shadows, and the device shadow of the target version can be synchronized to the device, so that when the device collects the device information, the device can perform the corresponding operation based on the synchronized device shadow of the target version.
[0126] exist Figure 1 Based on the IoT device management method shown in FIG. 1 , the embodiment of the present invention further provides a possible implementation method, such as Figure 6 As shown, it is a signaling interaction diagram of the Internet of Things management system of an embodiment of the present invention. The Internet of Things management system may include: a control terminal, an Internet of Things management platform and a device, wherein a Twins module may be provided in the Internet of Things management platform, and the Twins module may communicate with the Web page of the control terminal through the communication module of the Internet of Things management platform, and may also communicate with the device.
[0127] The device can be pre-registered with the IoT platform, and the IoT platform can then send a locally stored SDK to the device.
[0128] Then, when the user inputs the object model information and status information of the device on the Web page, the Web page can send the object model information and status information of the device to the Twins module through the communication module of the control terminal.
[0129] When the Twins module receives the object model information and status information of the device, it can establish the device shadow corresponding to the device and the version information of the device shadow based on the object model information and status information of the device, and then send the device shadow corresponding to the device to the device.
[0130] After receiving the device shadow corresponding to the device, the device can synchronize the device shadow and then determine whether the collected device information exceeds the boundary conditions; when the collected device information exceeds the boundary conditions, an alarm message is sent to the above-mentioned Twins module; when the collected device information does not exceed the boundary conditions, the device information is sent to the above-mentioned Twins module.
[0131] The above-mentioned Twins module can also determine the information changes of the equipment based on the collected equipment information and historical equipment information, and judge whether the information changes meet the trend conditions. When the information changes do not meet the trend conditions, an alarm message is sent to the above-mentioned Twins module; when the information changes meet the trend conditions, the equipment information is sent to the above-mentioned Twins module.
[0132] After receiving the alarm information or device information, the Twins module may send the alarm information or device information to a Web page to remind the user or allow the user to browse the device information.
[0133] In some examples, the user may also input an expected value of the device status information, and the web page may send the expected value of the device status information to the Twins module. The Twins module may then change the device status information based on the expected value of the device status information.
[0134] In some other examples, the above-mentioned device may be online or offline. In this regard, the above-mentioned Twins module can monitor whether the device is online. If it is online, the changed device status information is sent to the device so that the device can change the device status information in the locally stored device shadow.
[0135] In some examples, a user may input a version switching instruction of a device shadow on a web page, and then the web page may send the version switching instruction of the device shadow to the Twins module. Upon receiving the version switching instruction, the Twins module may determine the device shadow of the target version based on the version information of multiple device shadows saved, and synchronize the device shadow of the target version to the device, so that when the device collects device information, the device may determine whether the collected device information exceeds the boundary conditions in the device shadow of the target version, or determine whether the information change corresponding to the collected device information satisfies the trend conditions in the device shadow of the target version, and then perform the corresponding operation.
[0136] Corresponding to the above method embodiment, the embodiment of the present invention also provides an Internet of Things device management device, such as Figure 7 FIG. 1 is a schematic diagram of a structure of an IoT device management device according to an embodiment of the present invention. The device may include:
[0137] The device shadow creation module 710 is used to obtain the physical model information of the device registered to the Internet of Things platform, and to create a device shadow corresponding to the device based on the physical model information;
[0138] The device shadow synchronization module 720 is used to synchronize the device shadow to the device so that when the device information is collected, the device performs corresponding operations based on the synchronized device shadow.
[0139] An Internet of Things device management device provided by an embodiment of the present invention can, when obtaining the physical model information of a device registered to an Internet of Things platform, establish a device shadow corresponding to the device based on the physical model information; then synchronize the device shadow to the device, so that when the device collects the device information, the device performs corresponding operations based on the synchronized device shadow without sending the device information to the Internet of Things platform for processing, thereby reducing the load pressure of the Internet of Things platform.
[0140] In some examples, the apparatus may further include:
[0141] A software development kit sending module, used for sending a software development kit including a preset device shadow to a device when the device is registered with the Internet of Things platform before acquiring the object model information of the device registered with the Internet of Things platform, so that the device can save the preset device shadow locally;
[0142] The device shadow synchronization module 720 is specifically used for:
[0143] The device shadow is sent to the device so that the device synchronizes the device shadow to the preset device shadow to obtain the synchronized device shadow, and when the device information is collected, the corresponding operation is performed based on the synchronized device shadow.
[0144] In some examples, the physical model information includes: boundary conditions of the device and corresponding event operations; in this regard, the device shadow synchronization module 720 is specifically used to:
[0145] The device shadow including the boundary conditions and the corresponding event operations is synchronized to the device, so that when the device information is collected, the device performs the corresponding event operations based on the device information and the boundary conditions.
[0146] In some examples, the object model information further includes: first operation priority information corresponding to the boundary condition; in this regard, the device shadow synchronization module 720 is specifically configured to:
[0147] The device shadow including the boundary conditions, the corresponding event operations and the first operation priority information is synchronized to the device, so that when the device collects the device information, the device performs the corresponding event operation based on the device information, the boundary conditions and the first operation priority information.
[0148] In some examples, the IoT platform is further connected to a control terminal, and the event operation includes: first event information feedback; in this regard, the device may further include:
[0149] The first event information acquisition module is used to acquire the first event information fed back by the device based on the collected device information and boundary conditions; and forward the first event information to the control terminal.
[0150] In some examples, the object model information includes: trend conditions of the device and corresponding event operations; in this regard, the device shadow synchronization module 720 is specifically used to:
[0151] The device shadow containing trend conditions and corresponding event operations is synchronized to the device, so that when the device collects device information, it determines the information change of the device based on the collected device information and historical device information, and performs corresponding event operations based on the information change of the device and trend conditions.
[0152] In some examples, the object model information includes: second operation priority information; in this regard, the device shadow synchronization module 720 is specifically configured to:
[0153] The device shadow including the trend condition, the corresponding event operation and the second operation priority information is synchronized to the device, so that when the device collects the device information, it determines the information change of the device based on the collected device information and the historical device information, and performs the corresponding event operation based on the information change of the device, the trend condition and the second operation priority information.
[0154] In some examples, the IoT platform is further connected to a control terminal, and the event operation includes: feedback of second event information; in this regard, the device may further include:
[0155] The second event information acquisition module is used to acquire the second event information fed back by the device based on the collected device information, historical device information and trend conditions; and forward the second event information to the control terminal.
[0156] In some examples, the device shadow establishment module 710 is specifically configured to:
[0157] Obtaining object model information and device status information, and establishing a device shadow corresponding to the device and version information of the device shadow based on the object model information and the status information;
[0158] The device shadow synchronization module 720 is specifically used for:
[0159] When a version switching instruction is received, the device shadow of the target version is determined based on the version information of the device shadow, and the device shadow of the target version is synchronized to the device, so that when the device collects the device information, it performs corresponding operations based on the synchronized device shadow of the target version.
[0160] The embodiment of the present invention further provides an electronic device, such as Figure 8 As shown, it is a structural schematic diagram of an Internet of Things device management method according to an embodiment of the present invention applied to an electronic device. The electronic device may include a processor 801 and a machine-readable storage medium 802. The machine-readable storage medium 802 stores machine-executable instructions that can be executed by the processor 801. The processor 801 is prompted by the machine-executable instructions to implement the steps of an Internet of Things device management method shown in any of the above embodiments. For example, the following steps may be implemented:
[0161] Obtain the physical model information of the device registered to the IoT platform, and create the device shadow corresponding to the device based on the physical model information;
[0162] Synchronize the device shadow to the device so that when the device collects device information, it performs corresponding operations based on the synchronized device shadow.
[0163] An electronic device provided by an embodiment of the present invention can, when obtaining the physical model information of a device registered to an Internet of Things platform, establish a device shadow corresponding to the device based on the physical model information; and then synchronize the device shadow to the device. In this way, when the device collects the device information, it performs corresponding operations based on the synchronized device shadow without sending the device information to the Internet of Things platform for processing, thereby reducing the load pressure of the Internet of Things platform.
[0164] The machine-readable storage medium 802 may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0165] The above-mentioned processor 801 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0166] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of an IoT device management method shown in any of the above embodiments are implemented. For example, the following steps can be implemented:
[0167] Obtain the physical model information of the device registered to the IoT platform, and create the device shadow corresponding to the device based on the physical model information;
[0168] Synchronize the device shadow to the device so that when the device collects device information, it performs corresponding operations based on the synchronized device shadow.
[0169] A computer-readable storage medium provided by an embodiment of the present invention can establish a device shadow corresponding to the device based on the object model information when the object model information of a device registered to the Internet of Things platform is obtained; and then synchronize the device shadow to the device. In this way, when the device collects the device information, the device performs corresponding operations based on the synchronized device shadow without sending the device information to the Internet of Things platform for processing, thereby reducing the load pressure of the Internet of Things platform.
[0170] An embodiment of the present invention further provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps of an IoT device management method shown in any of the above embodiments. For example, the following steps may be executed:
[0171] Obtain the physical model information of the device registered to the IoT platform, and create the device shadow corresponding to the device based on the physical model information;
[0172] Synchronize the device shadow to the device so that when the device collects device information, it performs corresponding operations based on the synchronized device shadow.
[0173] A computer program product including instructions provided by an embodiment of the present invention can establish a device shadow corresponding to the device based on the physical model information when the physical model information of a device registered to the Internet of Things platform is obtained; and then synchronize the device shadow to the device. In this way, when the device collects the device information, the device performs corresponding operations based on the synchronized device shadow without sending the device information to the Internet of Things platform for processing, thereby reducing the load pressure of the Internet of Things platform.
[0174] The embodiment of the present invention further provides a computer program, which, when executed on a computer, enables the computer to execute the steps of an IoT device management method shown in any of the above embodiments. For example, the following steps may be executed:
[0175] Obtain the physical model information of the device registered to the IoT platform, and create the device shadow corresponding to the device based on the physical model information;
[0176] Synchronize the device shadow to the device so that when the device collects device information, it performs corresponding operations based on the synchronized device shadow.
[0177] A computer program provided by an embodiment of the present invention can, when obtaining the physical model information of a device registered to an Internet of Things platform, establish a device shadow corresponding to the device based on the physical model information; then synchronize the device shadow to the device, so that when the device collects the device information, the device performs corresponding operations based on the synchronized device shadow without sending the device information to the Internet of Things platform for processing, thereby reducing the load pressure of the Internet of Things platform.
[0178] It should be noted that, in this article, relational terms such as first and second, etc. 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 terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0179] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0180] The above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.
Claims
1. A method for managing IoT devices, characterized in that: Applied to the Internet of Things platform, the method includes: Obtaining object model information of a device registered to the Internet of Things platform, and establishing a device shadow corresponding to the device based on the object model information; the object model information includes: a trend condition of the device and a corresponding event operation; Synchronize the device shadow to the device, so that when the device information is collected, the device performs a corresponding operation based on the synchronized device shadow; The step of synchronizing the device shadow to the device so that the device performs a corresponding operation based on the synchronized device shadow when the device information is collected includes: The device shadow including the trend condition and the corresponding event operation is synchronized to the device, so that when the device collects device information, the device determines the information change of the device based on the collected device information and historical device information, and performs the corresponding event operation based on the information change of the device and the trend condition.
2. The method according to claim 1, characterized in that Before acquiring the object model information of the device registered to the Internet of Things platform, the method further includes: When the device is registered to the IoT platform, a software development kit including a preset device shadow is sent to the device, so that the device locally saves the preset device shadow; The step of synchronizing the device shadow to the device so that the device performs a corresponding operation based on the synchronized device shadow when the device information is collected includes: The device shadow is sent to the device so that the device synchronizes the device shadow with the preset device shadow to obtain a synchronized device shadow, and when the device information is collected, a corresponding operation is performed based on the synchronized device shadow.
3. The method according to claim 1, characterized in that The physical model information includes: boundary conditions of the device and corresponding event operations; The step of synchronizing the device shadow to the device so that the device performs a corresponding operation based on the synchronized device shadow when the device information is collected includes: The device shadow including the boundary conditions and the corresponding event operations is synchronized to the device, so that when the device information is collected, the device performs the corresponding event operations based on the device information and the boundary conditions.
4. The method according to claim 3, characterized in that The physical model information also includes: first operation priority information corresponding to the boundary condition; The step of synchronizing the device shadow including the boundary condition and the corresponding event operation to the device, so that the device performs the corresponding event operation based on the device information and the boundary condition when the device information is collected, includes: The device shadow including the boundary condition, the corresponding event operation and the first operation priority information is synchronized to the device, so that when the device information is collected, the device performs the corresponding event operation based on the device information, the boundary condition and the first operation priority information.
5. The method according to claim 3 or 4, characterized in that: The Internet of Things platform is also connected to a control terminal, and the event operation includes: first event information feedback; the method also includes: Acquire first event information fed back by the device based on the collected device information and the boundary condition; and forward the first event information to the control terminal.
6. The method according to claim 1, characterized in that The object model information includes: second operation priority information; The step of synchronizing the device shadow including the trend condition and the corresponding event operation to the device, so that when the device collects the device information, the device determines the information change of the device based on the collected device information and the historical device information, and performs the corresponding event operation based on the information change of the device and the trend condition, includes: The device shadow including the trend condition, the corresponding event operation and the second operation priority information is synchronized to the device, so that when the device collects device information, the device determines the information change of the device based on the collected device information and historical device information, and performs the corresponding event operation based on the information change of the device, the trend condition and the second operation priority information.
7. The method according to claim 1 or 6, characterized in that: The Internet of Things platform is also connected to a control terminal, and the event operation includes: feedback of second event information; the method also includes: Acquire second event information fed back by the device based on the collected device information, historical device information and the trend condition; and forward the second event information to the control terminal.
8. The method according to claim 1, characterized in that The acquiring the object model information of the device registered to the Internet of Things platform, and establishing the device shadow corresponding to the device based on the object model information, includes: Acquire the object model information and the status information of the device, and establish a device shadow corresponding to the device and version information of the device shadow based on the object model information and the status information; The step of synchronizing the device shadow to the device so that the device performs a corresponding operation based on the synchronized device shadow when the device information is collected includes: When a version switching instruction is received, the device shadow of the target version is determined based on the version information of the device shadow, and the device shadow of the target version is synchronized to the device, so that when the device information is collected, the device performs corresponding operations based on the synchronized device shadow of the target version.
9. An IoT device management device, characterized in that: Applied to the Internet of Things platform, the device includes: A device shadow establishment module, used to obtain the physical model information of the device registered to the Internet of Things platform, and establish the device shadow corresponding to the device based on the physical model information; the physical model information includes: the trend condition of the device and the corresponding event operation; A device shadow synchronization module, used to synchronize the device shadow to the device, so that when the device information is collected, the device performs a corresponding operation based on the synchronized device shadow; The device shadow synchronization module is specifically used for: The device shadow including the trend condition and the corresponding event operation is synchronized to the device, so that when the device collects device information, the device determines the information change of the device based on the collected device information and historical device information, and performs the corresponding event operation based on the information change of the device and the trend condition.
10. An electronic device, characterized in that: The method comprises a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
