Internet of Things equipment proxy method and device, equipment and storage medium

By creating a device shadow in the gateway device to act as an agent for the physical IoT device, the problem of the existing IoT system being unable to control home appliances when the network connection is lost is solved, realizing device management and control without network, and enhancing the flexibility of the system. performance and reliability.

CN118784672APending Publication Date: 2024-10-15TP-LINK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410819688.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing IoT systems cannot control home appliances when the external network connection is lost, which has application limitations.

Method used

By creating a device shadow of the physical IoT device in the gateway device and configuring it in the gateway device, the device shadow acts as a proxy for the physical IoT device, thereby achieving management and control of the physical IoT device and getting rid of dependence on the IoT cloud platform.

Benefits of technology

Even if the external network is lost, home appliances can be controlled, which solves the application limitations of the Internet of Things system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784672A_ABST
    Figure CN118784672A_ABST
Patent Text Reader

Abstract

The invention discloses an Internet of Things equipment proxy method, device and equipment and a storage medium, and relates to the technical field of Internet of Things, in the application, gateway equipment creates an equipment shadow of entity Internet of Things equipment based on equipment information of the entity Internet of Things equipment, the equipment shadow is configured in the gateway equipment, and the equipment shadow is configured in the entity Internet of Things equipment based on the equipment information of the entity Internet of Things equipment. And the entity Internet of Things equipment is agented through the equipment shadow. In other words, the gateway device constructs the device shadow for the entity Internet of Things device and configures the device shadow in the gateway device, the device shadow can reflect the device state condition of the entity Internet of Things device, and the gateway device can proxy the entity Internet of Things device through the device shadow (that is, the entity Internet of Things device is managed and controlled). And the equipment shadow is configured in the gateway equipment, so that the dependence on an Internet of Things cloud platform can be eliminated, and the entity Internet of Things equipment can still be managed and controlled even if an external network is lost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of Internet of Things, and in particular to an Internet of Things device proxy method, apparatus, device and storage medium. Background Art

[0002] At present, in the smart home industry, people usually want to control all the home appliances in the house through one channel. The current conventional solution for this demand is to build an Internet of Things system, which includes an Internet of Things cloud platform, gateway devices and specific home appliances. The gateway devices are connected to the Internet of Things cloud platform and specific home appliances respectively, and the Internet of Things cloud platform is the channel for controlling each home appliance in the Internet of Things system. However, the above conventional Internet of Things system is highly dependent on the Internet of Things cloud platform, and the premise of using the Internet of Things cloud platform for control is that the gateway device maintains a network connection with the Internet of Things cloud platform. When the gateway device is disconnected from the Internet of Things cloud platform, that is, when the gateway device loses the network for communication with the outside world, it is impossible to control the home appliances. Therefore, the current conventional Internet of Things system has limitations.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of this application is to provide an Internet of Things device proxy method, device, equipment and storage medium, aiming to solve the technical problem that the current conventional Internet of Things system cannot control home appliances when the network communicating with the outside world is lost, thus having application limitations.

[0005] To achieve the above-mentioned purpose, the present application proposes an IoT device proxy method, which is applied to a gateway device, wherein the network where the gateway device is located includes at least one physical IoT device, and the IoT device proxy method includes:

[0006] Based on the device information of the physical IoT device, create a device shadow of the physical IoT device, wherein the device shadow is configured on the gateway device;

[0007] The physical IoT device is represented by the device shadow agent.

[0008] Optionally, the device information includes a service list supported by the physical IoT device, and the step of creating a device shadow of the physical IoT device based on the device information of the physical IoT device includes:

[0009] Acquire a service capability set of the physical IoT device based on the service list;

[0010] A data model of the physical IoT device is constructed based on the service capability set, and state parameters of the physical IoT device are configured to the data model to obtain the device shadow.

[0011] Optionally, the Internet of Things device proxy method further includes:

[0012] Creating link broadcast information and device broadcast information of the physical IoT device, wherein the link broadcast information includes the IP address of the gateway device, the device identifier of the physical IoT device, the link type and the link aging time, and the device broadcast information includes the device identifier, the name of the physical IoT device, the device type of the physical IoT device, and the online status of the physical IoT device;

[0013] After the device shadow of the physical IoT device is created, the link broadcast information and the device broadcast information are broadcast in the network.

[0014] Optionally, the proxying the physical IoT device through the device shadow agent includes:

[0015] After receiving a data request for data from the physical IoT device, obtaining device data from the device shadow based on the data request;

[0016] The device data is fed back to the sender of the data request.

[0017] Optionally, the proxying the physical IoT device through the device shadow further includes:

[0018] After receiving a control instruction for controlling the physical IoT device, forwarding the control instruction to the physical IoT device, wherein the physical IoT device generates device status update information after executing an action corresponding to the control instruction;

[0019] After receiving the device status update information sent by the physical Internet of Things device, the status parameters in the device shadow are updated based on the device status update information.

[0020] Optionally, forwarding the control instruction to the physical IoT device includes:

[0021] When the physical IoT device is in an awake state, forwarding the control instruction to the physical IoT device;

[0022] When the physical IoT device is in a dormant state, the control instruction is saved in a preset cache entry of the device shadow, and after the physical IoT device changes from a dormant state to an awake state, the control instruction in the preset cache entry is sent to the physical IoT device.

[0023] Optionally, after the physical IoT device changes from a dormant state to an awake state, sending the control instruction in the preset cache entry to the physical IoT device includes:

[0024] After receiving the heartbeat message sent by the physical Internet of Things device, determining that the physical Internet of Things device changes from a dormant state to an awakened state;

[0025] Sending a first notification message to the physical IoT device, and sending a control instruction in the preset cache entry to the physical IoT device, wherein the first notification message is used to notify the physical IoT device to stay awake;

[0026] When there is no control instruction in the preset cache entry, second notification information is sent to the physical Internet of Things device, wherein the second notification information indicates that the physical Internet of Things device can enter a sleep state.

[0027] In addition, to achieve the above purpose, the present application also proposes an Internet of Things device proxy device, which is applied to a gateway device, wherein the network where the gateway device is located includes at least one physical Internet of Things device, and the Internet of Things device proxy device includes:

[0028] A creation module, configured to create a device shadow of the physical IoT device based on the device information of the physical IoT device, wherein the device shadow is configured on the gateway device;

[0029] The proxy module is used to proxy the physical Internet of Things device through the device shadow.

[0030] In addition, to achieve the above-mentioned purpose, the present application also proposes an IoT device proxy device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the IoT device proxy method as described above.

[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the IoT device proxy method described above are implemented.

[0032] One or more technical solutions proposed in this application have at least the following technical effects:

[0033] In an embodiment of the present application, the gateway device will create a device shadow of the physical IoT device based on the device information of the physical IoT device, wherein the device shadow is configured in the gateway device, and the physical IoT device is proxied through the device shadow. That is, the gateway device of the present application will build a device shadow for the physical IoT device, and configure the device shadow in the gateway device, and the device shadow can reflect the device status of the physical IoT device, and the gateway device can realize the proxy of the physical IoT device (that is, the control of the physical IoT device) through the device shadow. And because the device shadow is configured in the gateway device, it can get rid of the dependence on the IoT cloud platform, so that even if the external network is lost, the physical IoT device can still be controlled. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0035] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0036] Figure 1 This is a flow chart of the first embodiment of the IoT device proxy method of the present application;

[0037] Figure 2 A timing diagram for creating a device shadow in the IoT device proxy method of this application;

[0038] Figure 3 This is a timing diagram for the first proxy business scenario in the IoT device proxy method of this application;

[0039] Figure 4 This is a timing diagram for the second proxy business scenario in the IoT device proxy method of this application;

[0040] Figure 5 This is a timing diagram for the third agent business scenario in the IoT device agent method of this application;

[0041] Figure 6 This is a schematic diagram of the module structure of the Internet of Things device proxy device according to an embodiment of the present application;

[0042] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the Internet of Things device proxy method in the embodiment of the present application.

[0043] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0046] At present, conventional IoT systems are highly dependent on IoT cloud platforms, that is, the device shadows of home appliances are basically set up in the IoT cloud platform, and the IoT cloud platform can manage related home appliances through the device shadows (i.e., agents). However, in actual applications, the premise of using the IoT cloud platform for control is that the gateway device maintains a network connection with the IoT cloud platform. When the gateway device is disconnected from the IoT cloud platform, that is, when the gateway device loses the network for communication with the outside world, it is impossible to control the home appliances. Therefore, the current conventional IoT system has limitations.

[0047] The main solution of the embodiment of the present application is: based on the device information of the physical Internet of Things device, create a device shadow of the physical Internet of Things device, wherein the device shadow is configured on the gateway device; and proxy the physical Internet of Things device through the device shadow.

[0048] The present application provides a solution, which is applied to a gateway device. The network where the gateway device is located includes at least one physical IoT device. The gateway device builds a device shadow for the physical IoT device and configures the device shadow in the gateway device. The device shadow can reflect the device status of the physical IoT device. Through the device shadow, the gateway device can implement the proxy of the physical IoT device (i.e., control the physical IoT device). And because the device shadow is configured in the gateway device, it can get rid of the dependence on the IoT cloud platform, so that even if the external network is lost, the physical IoT device can still be controlled.

[0049] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a central control device, a router, a switch, etc., or an electronic device that can realize the above functions.

[0050] Based on this, the present application embodiment provides an Internet of Things device proxy method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the IoT device proxy method of the present application.

[0051] In this embodiment, the Internet of Things device proxy method is applied to a gateway device, and the network where the gateway device is located includes at least one physical Internet of Things device. The Internet of Things device proxy method includes S10 to S20:

[0052] Step S10, creating a device shadow of the physical IoT device based on the device information of the physical IoT device, wherein the device shadow is configured on the gateway device;

[0053] It should be noted that, in this embodiment, the above-mentioned Internet of Things device proxy method can be applied to a gateway device, and the gateway device can be an independent hardware device or a software solution integrated in a hardware device. The network where the gateway device is located can include a local area network based on an IP (Internet Protocol) network protocol component, and can also include a network formed by other protocols (including Bluetooth protocol and Zigbee protocol). Correspondingly, the physical Internet of Things device can be an IP device, which refers to a device that can be connected to the Internet and communicate using the IP protocol; it can also be a non-IP device, which refers to a device that cannot be directly connected to the Internet, such as a Bluetooth device, a Zigbee device, etc. Non-IP devices can use related protocols for networking, such as Bluetooth devices and Bluetooth gateways communicate and network through Bluetooth-related protocols. In actual applications, the gateway device will first network with the physical Internet of Things device through different protocols, and the physical Internet of Things device that completes the networking with the gateway device is the physical Internet of Things device under the network where the gateway device is located. The proxy process of the gateway device for each physical Internet of Things device under its network is basically the same, so in this embodiment, the process of proxying a physical Internet of Things device will be described.

[0054] Exemplarily, for any physical IoT device in the network where the gateway device is located, the device information of the physical IoT device is obtained. The device information may include functional information related to the physical IoT device, and based on the functional information, the gateway device may create a device shadow of the physical IoT device. The device shadow is a virtual mapping of the physical IoT device, which can reflect the real-time status data of the physical IoT device, and the created device shadow is configured in the gateway device. It can be understood that when other physical IoT devices in the local area network where the gateway device is located access the data of the physical IoT device, they actually access the device shadow of the IoT device on the gateway device. The other IoT devices are generally IP devices and are in the same local area network as the gateway device, so there is no need to rely on the external network.

[0055] Step S20: proxy the physical IoT device through the device shadow agent.

[0056] Exemplarily, the gateway device will complete the proxy of the physical IoT device through the device shadow, that is, complete the relevant management and control operations of the physical IoT device through the device shadow. For example, when there is a need to obtain the device data of the physical IoT device, the gateway device can directly obtain the relevant device data from the device shadow, and send the relevant device data to the above-mentioned party that needs to obtain the device data. It can be understood that in actual applications, the proxy content of the gateway device for the physical IoT device, that is, the control of the physical IoT device based on the device shadow can be set by the technician according to actual needs, and will not be repeated here.

[0057] In this embodiment, the gateway device will create a device shadow of the physical IoT device based on the device information of the physical IoT device, wherein the device shadow is configured in the gateway device, and the physical IoT device is proxied through the device shadow. That is, the gateway device of this application will build a device shadow for the physical IoT device, and configure the device shadow in the gateway device, and the device shadow can reflect the device status of the physical IoT device. The gateway device can proxy the physical IoT device (i.e., manage and control the physical IoT device) through the device shadow. And because the device shadow is configured in the gateway device, it can get rid of the dependence on the IoT cloud platform, so that even if the external network is lost, the physical IoT device can still be managed and controlled.

[0058] In a feasible implementation manner, the device information includes a list of services supported by the physical IoT device, and the step of creating a device shadow of the physical IoT device based on the device information of the physical IoT device includes steps S11 to S12:

[0059] Step S11, acquiring a service capability set of the physical IoT device based on the service list;

[0060] Step S12: construct a data model of the physical IoT device based on the service capability set, and configure the state parameters of the physical IoT device to the data model to obtain the device shadow.

[0061] Exemplarily, in the process of creating the device shadow of the physical IoT device, the gateway device may obtain the device information from the physical IoT device after the physical IoT device completes networking, or may obtain the device information from the physical IoT device after receiving the device shadow creation request sent by the physical IoT device. The device information may include the service list of the physical IoT device, which may represent the services or functions that the physical IoT device can provide. The gateway device obtains the service capability set from the physical IoT device through the service list, wherein the service capability set is a json file, which may include dev_i nfo.json related to basic information, which describes the name, type, uu id, mac, hardware ID, hardware version, software ID, software version, device_id, etc. of the device, and the function-related capability set. For example, the physical IoT device is a door and window sensor, which describes the switch state of the door and window sensor and the type of data. A data model corresponding to the physical IoT device can be created through the service capability set, and then the state parameters obtained from the physical IoT device are configured to the data model to obtain the above-mentioned device shadow.

[0062] In actual applications, the service capability set file is used to describe the services or configuration properties of the device. The gateway device builds a data management model by parsing the information in the service capability set file. The service capability set file may include basic fields, such as version: capability set description file version; name: module name, such as the door and window sensor service, named door_sensor, providing data related to the opening and closing of doors and windows and the opening and closing time; capability: provides a basis for the creation of data models for external (outside the device or other modules in the device) to access data, which can be regarded as an interface for external (outside the device or other modules in the device) to access device data. The service capability set can also include data attributes, such as @type, @auth, etc. Among them, @type is a required attribute and describes the numeric type. This field contains information such as the type and size of the data and is placed in the first place of the data attribute. The type description field supported in the capability set file may include signed integer, unsigned integer, floating point type, Boolean type, etc. Among them, @auth is an optional attribute, which is used to specify data access permissions, such as limiting whether the current data node is writable, whether it is configurable data, etc. It mainly includes accessible only within the device (can be defaulted), accessible outside the device (default is inaccessible across devices), if this node is public, all its descendant nodes are public, data is readable and writable (can be defaulted), etc., which will not be repeated here.

[0063] The process of creating a device shadow may include: after the intelligent gateway obtains all capability sets, it splices them into a large capability set file such as shaodw0.json, creates a DMTree (data management tree) based on shadow0.json, that is, converts the Kv key-value pairs of json into the PrvaData structure of DMTree, and then adds the newly created DMTreeNode to the local DM tree root node to complete the device shadow creation.

[0064] In a feasible implementation manner, the Internet of Things device proxy method further includes steps S01 to S02:

[0065] Step S01, creating link broadcast information and device broadcast information of the physical IoT device, wherein the link broadcast information includes the IP address of the gateway device, the device identifier of the physical IoT device, the link type and the link aging time, and the device broadcast information includes the device identifier, the name of the physical IoT device, the device type of the physical IoT device, and the online status of the physical IoT device;

[0066] Step S02, after the device shadow of the physical IoT device is created, the link broadcast information and the device broadcast information are broadcast in the network.

[0067] It should be noted that, in this embodiment, the gateway device can proxy both IP devices and non-IP devices. And after proxying the device, the relevant information of the proxy device can be broadcast to other devices in the network. First, create the link broadcast information and device broadcast information of the physical IoT device, wherein the link broadcast information may include the gateway device IP address, the device identifier of the physical IoT device, the link type and the link aging time, and may also include the MAC Media Access Control (MAC) address of the physical IoT device. Exemplarily, the device identifier may be the uu id (Uniformly Unique Identifier) ​​of the physical IoT device; the link type may be Wi-Fi or Bluetooth, etc. For example, device A is a Bluetooth device, device B is a Bluetooth gateway, and the link type of device A maintained by gateway B is Bluetooth, but when gateway B proxies device A to broadcast the link externally, the link type of device A is modified to Wi-Fi; the link aging time (timeout) can be obtained from the physical IoT device when creating a device shadow to obtain device information. Generally, the link aging time refers to the effective time of the broadcast link information. The device broadcast information includes the device identification, the name of the physical IoT device, the device type of the physical IoT device, the online status of the physical IoT device, etc. For example, the online status can be online or offline. After the device shadow of the physical IoT device is created, the established link broadcast information and device broadcast information are broadcast in the IP network where the gateway device is located. Other devices in the network can find the device link of the above-mentioned physical IoT device through their own device discovery module and link discovery module, and other devices can interact with the physical IoT device through the device link, such as obtaining the device status of the physical IoT device or controlling the physical IoT device.

[0068] Reference Figure 2, is a timing diagram for creating a device shadow in this application, as shown in the figure, the figure includes a physical device (physical IoT device) and a gateway device. First, the gateway device will complete the networking with the physical device. After the networking is completed, the physical device will request the gateway device to create a device shadow. The gateway device will feedback to the physical device to start creating the device shadow and obtain device information from the physical device. The physical device will then feedback to the gateway device including type (device type), uu id (device identification), service (service list) and other device information to the gateway device. The gateway device can establish a device link information table (i.e., device link information) based on type, uu id, and its own IP address, and the gateway device will then obtain the service capability set of the physical device according to the service list, and create a device data model based on the service capability set. The gateway device will fill the initial service data obtained from the physical device into the device data model to obtain the device shadow. The completion of the device shadow creation also indicates that the physical device can be proxied. Finally, the gateway device broadcasts externally (i.e., to other devices in the network) the device link information table established in the above steps and the proxy relationship with the physical device.

[0069] In a feasible implementation manner, the step of using the device shadow proxy to proxy the physical IoT device includes steps S211 to S212:

[0070] Step S211, after receiving a data request for requesting data from the physical IoT device, obtaining device data from the device shadow based on the data request;

[0071] Step S212: Feedback the device data to the sender of the data request.

[0072] It should be noted that the above data request can be sent to the gateway device by other devices in the network through the device link information of the above physical IoT device.

[0073] For example, the gateway device receives a data request for data from the physical IoT device. Since the device shadow can reflect the real-time device status of the physical IoT device, the gateway device can directly obtain the relevant device data from the device shadow of the physical IoT device according to the request content in the data request. The gateway device then feeds back the obtained relevant device data to the sender of the data request (i.e., other devices sending data requests in the network).

[0074] It can be understood that in this embodiment, since the gateway device uses the device shadow proxy physical IoT device, the physical IoT device of non-IP device type can be connected to the network where the gateway device is located and participate in unified management and control.

[0075] Reference Figure 3, is a timing diagram for the first proxy service scenario in this application, as shown in the figure, including low-power devices (usually referring to physical IoT devices that are not IP devices) / normally powered devices, gateway devices and other devices. Normally, the proxied physical IoT device (i.e., low-power device / normally powered device) will send heartbeat messages to the gateway device at a certain frequency, and after receiving the heartbeat message, the gateway device will, on the one hand, refresh the link aging time and return a successful keep-alive message, and on the other hand, it will proxy the physical IoT device to send link broadcast information and device broadcast information in the network to maintain the link information and device information of the physical IoT device. When other devices have the need to request data from the physical IoT device, they can send the data request to the gateway device. When the gateway device determines that it is the device that it proxies based on the data request, it directly obtains the data from the device shadow of the physical IoT device pointed to by the data request, and returns the data to other devices that send the data request.

[0076] In a feasible implementation manner, the method of using the device shadow proxy to proxy the physical IoT device further includes steps S221 to S222:

[0077] Step S221, after receiving a control instruction for controlling the physical IoT device, forwarding the control instruction to the physical IoT device, wherein the physical IoT device generates device status update information after executing an action corresponding to the control instruction;

[0078] Step S222: after receiving the device status update information sent by the physical IoT device, the status parameters in the device shadow are updated based on the device status update information.

[0079] It should be noted that the above control instructions may be sent to the gateway device by other devices in the network through the device link information of the above physical IoT device.

[0080] Exemplarily, after receiving the control instruction of the physical IoT device, the gateway device may forward the control instruction to the physical IoT device. The gateway device and the physical IoT device are in a networking state, so the control instruction may be forwarded to the physical IoT device, and when forwarding, the gateway device may parse the control instruction based on the protocol for networking with the physical IoT device, convert the protocol, and then send it to the physical IoT device. For example, assuming that the control instruction received by the gateway device is generated based on the IP protocol, and the gateway device and the physical IoT device are networked based on the Bluetooth protocol, the gateway device receives the control instruction, parses the control instruction, converts it into a control instruction under the Bluetooth protocol, and then sends it to the physical IoT device. Among them, the control instruction can control the physical IoT device, such as controlling the physical IoT device to perform a state change action, and the control instruction can also be to write specific data to the physical IoT device, that is, a write action. After the physical IoT device executes the action corresponding to the control instruction, its own device state may change. Accordingly, the physical IoT device can generate corresponding device state update information and send it to the gateway device. After receiving the device state update information, the gateway device can update the state parameters in the device shadow of the physical IoT device through the device state update information.

[0081] In a feasible implementation manner, forwarding the control instruction to the physical IoT device includes steps A10 to A20:

[0082] Step A10, when the physical IoT device is in an awake state, forwarding the control instruction to the physical IoT device;

[0083] Step A20, when the physical IoT device is in a sleep state, save the control instruction to a preset cache entry of the device shadow, and after the physical IoT device changes from a sleep state to a wake-up state, send the control instruction in the preset cache entry to the physical IoT device.

[0084] It should be noted that in actual applications, physical IoT devices can exist in two states, namely, sleep state and wake-up state.

[0085] Exemplarily, when the physical IoT device is in an awake state, the gateway device can directly forward the control instruction to the physical IoT device. For example, some physical IoT devices are in an awake state under normal circumstances (usually normally powered devices), and at this time the gateway device can directly forward the control instruction to the physical IoT device. However, when the physical IoT device is in a dormant state (usually a low-power device, which is in a dormant state under normal circumstances to reduce power consumption), the gateway device cannot directly forward the control instruction to the physical IoT device. The corresponding gateway device can temporarily save the control instruction in the preset cache entry of the device shadow, and wait until the physical IoT device changes from the dormant state to the awake state, and then send the control instruction in the preset cache entry to the physical IoT device.

[0086] Reference Figure 4 , is a timing diagram for the second proxy service scenario in this application. As shown in the figure, the figure includes a permanent power supply device (i.e., a type of physical IoT device), a gateway device, and other devices. Similarly, the permanent power supply device will send a heartbeat message to the gateway device at a certain frequency. After the gateway device receives the heartbeat message, the gateway device will refresh the link aging time, return a successful keep-alive message to the permanent power supply device, and will proxy the physical IoT device to send link broadcast information and device broadcast information in the network. In addition, when the permanent power supply device is in an awake state for a long time, the gateway device receives a control instruction sent by other devices (i.e., setting or writing permanent power supply device data). The gateway device can directly send the control instruction to the permanent power supply device. After the permanent power supply device completes data writing, it returns the successful writing information to the gateway device. The gateway device can write the relevant data to the device shadow.

[0087] In a feasible implementation manner, after the physical IoT device changes from a dormant state to an awake state, sending the control instruction in the preset cache entry to the physical IoT device includes steps A21 to SA23:

[0088] Step A21, after receiving the heartbeat message sent by the physical IoT device, determining that the physical IoT device changes from a dormant state to an awakened state;

[0089] Step A22, sending a first notification message to the physical IoT device, and sending a control instruction in the preset cache entry to the physical IoT device, wherein the first notification message is used to notify the physical IoT device to stay awake;

[0090] Step A23: When there is no control instruction in the preset cache entry, send a second notification message to the physical IoT device, wherein the second notification message indicates that the physical IoT device can enter a sleep state.

[0091] Exemplarily, for a low-power physical IoT device, it is in a dormant state under normal conditions, and wakes itself up according to a certain period, and sends a heartbeat message to the gateway device. For the gateway device, after receiving the heartbeat message sent by the physical IoT device, it can be determined that the physical IoT device has changed from a dormant state to an awake state. The gateway device then sends a first notification message to the physical IoT device, and the first notification message is used to notify the gateway device not to enter a dormant state, that is, to remain awake. After sending the first notification message, or while sending the first notification message, a control instruction in a preset cache entry is sent to the physical IoT device. And when the control instruction in the preset cache entry is sent, that is, there is no control instruction in the preset cache entry, a second notification message is sent to the physical IoT device, and the second notification message is used to indicate that the physical IoT device can enter a dormant state. After receiving the second notification message, the physical IoT device determines whether it enters a dormant state based on actual conditions.

[0092] It can be understood that, for physical IoT devices that may enter a sleep state, this embodiment sets a preset cache entry to temporarily store control instructions sent to the physical IoT devices, and sends the control instructions to the physical IoT devices after the physical IoT devices are in a wake-up state, thereby achieving effective control over the physical IoT devices that may enter a sleep state.

[0093] Reference Figure 5 , is a timing diagram for the third proxy service scenario in this application. As shown in the figure, the figure includes a low-power device (i.e., a type of physical IoT device), a gateway device, and other devices. The low-power device sends a heartbeat message to the gateway device. After the gateway device receives the heartbeat message, if it is determined that there is no control instruction, i.e., entry data, in the preset cache entry corresponding to the low-power device, a message of successful device keep-alive is sent to the low-power device, and the low-power device can continue to sleep after receiving the message of successful keep-alive. If it is determined that there is a control instruction, i.e., entry data, in the preset cache entry corresponding to the low-power device, a message of successful device keep-alive is sent to the low-power device and a message of needing to pull the cache (i.e., the first notification information, used to inform the low-power device not to enter the sleep state) is sent. The gateway device then assembles the cache message based on the entry data in the preset cache entry, and sends the cache message to the low-power device. In the absence of a cache message, the cache message is pulled to the low-power device (i.e., the second notification information), and the low-power device can enter the sleep state.

[0094] The present application also provides an IoT device proxy device, which is applied to a gateway device, wherein the network where the gateway device is located includes at least one physical IoT device, please refer to Figure 6 , the Internet of Things device proxy device includes:

[0095] A creation module 10, configured to create a device shadow of the physical IoT device based on the device information of the physical IoT device, wherein the device shadow is configured on the gateway device;

[0096] The proxy module 20 is used to proxy the physical IoT device through the device shadow.

[0097] Optionally, the device information includes a list of services supported by the physical IoT device, and the creation module 10 is further used to:

[0098] Acquire a service capability set of the physical IoT device based on the service list;

[0099] A data model of the physical IoT device is constructed based on the service capability set, and state parameters of the physical IoT device are configured to the data model to obtain the device shadow.

[0100] Optionally, the Internet of Things device proxy device further includes a broadcast module 30, and the broadcast module 30 is used to:

[0101] Creating link broadcast information and device broadcast information of the physical IoT device, wherein the link broadcast information includes the IP address of the gateway device, the device identifier of the physical IoT device, the link type and the link aging time, and the device broadcast information includes the device identifier, the name of the physical IoT device, the device type of the physical IoT device, and the online status of the physical IoT device;

[0102] After the device shadow of the physical IoT device is created, the link broadcast information and the device broadcast information are broadcast in the network.

[0103] Optionally, the proxy module 20 is further configured to:

[0104] After receiving a data request for data from the physical IoT device, obtaining device data from the device shadow based on the data request;

[0105] The device data is fed back to the sender of the data request.

[0106] Optionally, the proxy module 20 is further configured to:

[0107] After receiving a control instruction for controlling the physical IoT device, forwarding the control instruction to the physical IoT device, wherein the physical IoT device generates device status update information after executing an action corresponding to the control instruction;

[0108] After receiving the device status update information sent by the physical Internet of Things device, the status parameters in the device shadow are updated based on the device status update information.

[0109] Optionally, the proxy module 20 is further configured to:

[0110] When the physical IoT device is in an awake state, forwarding the control instruction to the physical IoT device;

[0111] When the physical IoT device is in a dormant state, the control instruction is saved in a preset cache entry of the device shadow, and after the physical IoT device changes from a dormant state to an awake state, the control instruction in the preset cache entry is sent to the physical IoT device.

[0112] Optionally, the proxy module 20 is further configured to:

[0113] After receiving the heartbeat message sent by the physical Internet of Things device, determining that the physical Internet of Things device changes from a dormant state to an awakened state;

[0114] Sending a first notification message to the physical IoT device, and sending a control instruction in the preset cache entry to the physical IoT device, wherein the first notification message is used to notify the physical IoT device to stay awake;

[0115] When there is no control instruction in the preset cache entry, second notification information is sent to the physical Internet of Things device, wherein the second notification information indicates that the physical Internet of Things device can enter a sleep state.

[0116] The Internet of Things device proxy device provided by the present application adopts the Internet of Things device proxy method in the above embodiment, which can solve the technical problem that the current conventional Internet of Things system cannot control home appliances when the network for communication with the outside world is lost, thus having application limitations. Compared with the prior art, the beneficial effects of the Internet of Things device proxy device provided by the present application are the same as the beneficial effects of the Internet of Things device proxy method provided by the above embodiment, and the other technical features in the Internet of Things device proxy device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0117] The present application provides an Internet of Things device proxy device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the Internet of Things device proxy method in the above-mentioned embodiment 1.

[0118] Reference below Figure 7, which shows a schematic diagram of the structure of an Internet of Things device proxy device suitable for implementing the embodiment of the present application. The Internet of Things device proxy device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The IoT device proxy device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0119] like Figure 7 As shown, the IoT device proxy device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read On ly Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the IoT device proxy device are also stored in RAM1004. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the IoT device proxy device to communicate wirelessly or wired with other devices to exchange data. Although the IoT device proxy device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0120] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0121] The Internet of Things device proxy device provided by the present application adopts the Internet of Things device proxy method in the above embodiment, which can solve the technical problem that the current conventional Internet of Things system cannot control home appliances when the network for communication with the outside world is lost, thus having application limitations. Compared with the prior art, the beneficial effects of the Internet of Things device proxy device provided by the present application are the same as the beneficial effects of the Internet of Things device proxy method provided by the above embodiment, and the other technical features in the Internet of Things device proxy device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0122] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0124] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the Internet of Things device proxy method in the above-mentioned embodiment.

[0125] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read On ly Memory), an erasable programmable read-only memory (EPROM: Erasable Programmab le Read On ly Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read On ly Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0126] The computer-readable storage medium may be included in the IoT device proxy device; or may exist independently without being assembled into the IoT device proxy device.

[0127] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the IoT device proxy device, the IoT device proxy device becomes: IoT device proxy.

[0128] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0129] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0130] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0131] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned Internet of Things device proxy method, and can solve the technical problem that the current conventional Internet of Things system cannot control home appliances when the network for communication with the outside world is lost, thus having application limitations. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the Internet of Things device proxy method provided by the above-mentioned embodiment, and will not be repeated here.

[0132] The present application also provides a computer program product, including a computer program, which implements the Internet of Things device proxy method as described above when executed by a processor.

[0133] The computer program product provided by this application can solve the technical problem of IoT device proxy. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the IoT device proxy method provided by the above embodiment, which will not be repeated here.

[0134] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A proxy method for IoT devices, It is characterized in that Applied to a gateway device, the network where the gateway device is located includes at least one physical Internet of Things device, and the Internet of Things device proxy method includes: Based on the device information of the physical IoT device, create a device shadow of the physical IoT device, wherein the device shadow is configured on the gateway device; The physical IoT device is represented by the device shadow agent.

2. The Internet of Things device proxy method according to claim 1, It is characterized in that The device information includes a list of services supported by the physical IoT device, and the step of creating a device shadow of the physical IoT device based on the device information of the physical IoT device includes: Acquire a service capability set of the physical IoT device based on the service list; A data model of the physical IoT device is constructed based on the service capability set, and state parameters of the physical IoT device are configured to the data model to obtain the device shadow.

3. The Internet of Things device proxy method according to claim 1, It is characterized in that The Internet of Things device proxy method also includes: Creating link broadcast information and device broadcast information of the physical IoT device, wherein the link broadcast information includes the IP address of the gateway device, the device identifier of the physical IoT device, the link type and the link aging time, and the device broadcast information includes the device identifier, the name of the physical IoT device, the device type of the physical IoT device, and the online status of the physical IoT device; After the device shadow of the physical IoT device is created, the link broadcast information and the device broadcast information are broadcast in the network.

4. The Internet of Things device proxy method as claimed in claim 1, It is characterized in that The physical IoT device through the device shadow proxy includes: After receiving a data request for data from the physical IoT device, obtaining device data from the device shadow based on the data request; The device data is fed back to the sender of the data request.

5. The Internet of Things device proxy method according to claim 1, It is characterized in that The physical IoT device through the device shadow proxy also includes: After receiving a control instruction for controlling the physical IoT device, forwarding the control instruction to the physical IoT device, wherein the physical IoT device generates device status update information after executing an action corresponding to the control instruction; After receiving the device status update information sent by the physical Internet of Things device, the status parameters in the device shadow are updated based on the device status update information.

6. The Internet of Things device proxy method as claimed in claim 5, It is characterized in that The forwarding of the control instruction to the physical IoT device includes: When the physical IoT device is in an awake state, forwarding the control instruction to the physical IoT device; When the physical IoT device is in a dormant state, the control instruction is saved in a preset cache entry of the device shadow, and after the physical IoT device changes from a dormant state to an awake state, the control instruction in the preset cache entry is sent to the physical IoT device.

7. The Internet of Things device proxy method according to claim 6, It is characterized in that After the physical IoT device changes from a dormant state to an awake state, sending the control instruction in the preset cache entry to the physical IoT device includes: After receiving the heartbeat message sent by the physical Internet of Things device, determining that the physical Internet of Things device changes from a dormant state to an awakened state; Sending a first notification message to the physical IoT device, and sending a control instruction in the preset cache entry to the physical IoT device, wherein the first notification message is used to notify the physical IoT device to stay awake; When there is no control instruction in the preset cache entry, second notification information is sent to the physical Internet of Things device, wherein the second notification information indicates that the physical Internet of Things device can enter a sleep state.

8. An IoT device proxy device, It is characterized in that Applied to a gateway device, the network where the gateway device is located includes at least one physical Internet of Things device, and the Internet of Things device proxy device includes: A creation module, configured to create a device shadow of the physical IoT device based on the device information of the physical IoT device, wherein the device shadow is configured on the gateway device; The proxy module is used to proxy the physical Internet of Things device through the device shadow.

9. An IoT device proxy device, It is characterized in that The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the Internet of Things device proxy method according to any one of claims 1 to 7.

10. A storage medium, It is characterized in that The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the Internet of Things device proxy method according to any one of claims 1 to 7 are implemented.