Device Control Method and Apparatus, Terminal Device, Gateway and Medium
Through the device control method of distributed subscription, the message interconnection between gateways is achieved using bridge gateways, solving the problem of automated control of smart home devices in the case of network delay and poor quality, ensuring the maximum execution of automation scenarios and the improvement of user experience.
Patent Information
- Application Number
- CN202110553579.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-20
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-05-20
AI Technical Summary
The automated scenario control of existing smart home devices relies on cloud servers, resulting in network delay and inability to execute in poor network quality.
Through the device control method based on distributed subscription, the associated devices are determined based on device control events, and the message interconnection between gateways is realized through the bridge gateway, reducing dependence on the quality of the wide area network.
When the network quality is poor or the main gateway is offline, it can still realize automated scene control of smart home devices, reduce network latency and improve user experience.
Smart Images

Figure CN115390462B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of smart home, and in particular to a device control method and device, a terminal device, a gateway and a computer storage medium based on distributed subscription. Background Art
[0002] With the continuous development of the smart home industry, the concept of whole-house intelligence has taken root in people's hearts, and the types and quantities of smart home devices in users' homes have been increasing continuously.
[0003] It is known that the automated scenario control of smart home devices is implemented based on a cloud server. However, in actual applications, implementing automated scenario control based on a cloud server has the phenomenon of network latency, and in the case of poor external network service quality, it will cause the automated scenario control to be unable to execute. Summary of the Invention
[0004] To solve the existing technical problems, this application provides a device control method and device, a terminal device, a gateway and a computer storage medium based on distributed subscription, which enables the automated scenario control of smart home devices to be maximally executed.
[0005] To achieve the above object, the technical solution of the embodiment of this application is realized as follows:
[0006] In a first aspect, the embodiment of this application provides a device control method based on distributed subscription, which is applied to a terminal device and includes: determining a second sub-device associated with the first sub-device according to a device control event of the first sub-device to be mounted on a gateway to be set; determining the gateway to which the second sub-device is mounted as the bridging gateway of the gateway to be set; obtaining subscription configuration information of the gateway to be set, where the subscription configuration information includes subscribing to status information of the second sub-device from the bridging gateway.
[0007] In a second aspect, the embodiment of this application provides a device control device based on distributed subscription, which is applied to a terminal device and includes a determination module, configured to determine a second sub-device associated with the first sub-device according to a device control event of the first sub-device to be mounted on a gateway to be set; a bridging module, configured to determine the gateway to which the second sub-device is mounted as the bridging gateway of the gateway to be set; and a subscription module, configured to obtain subscription configuration information of the gateway to be set, where the subscription configuration information includes subscribing to status information of the second sub-device from the bridging gateway.
[0008] In a third aspect, an embodiment of the present application provides a terminal device, including a processor and a memory. A computer program executable by the processor is stored in the memory. When the computer program is executed by the processor, it implements the device control method based on distributed subscription as described in any embodiment of the present application applied to the terminal device side.
[0009] For the device control method, device, and terminal device based on distributed subscription provided in the above embodiments, by determining, according to the device control event of the first sub-device to be mounted on the gateway to be set, the second sub-device associated with the first sub-device, determining the gateway on which the second sub-device is mounted as the bridging gateway of the gateway to be set, and configuring the gateway to be set to subscribe to the status information of the second sub-device, by bridging the gateways corresponding to the associated devices according to the relationship between the devices in the device control event, and realizing device control through message interconnection between the gateways. In this way, it is not necessary to rely on the network quality of the wide area network to which the device is currently connected. When the network quality is poor or the main gateway is offline, the automated scenario control of the smart home device can still be realized through message interconnection between the bridging gateways, so that the automated scenario control of the smart home device can be maximally executed, reducing network latency and improving the user experience.
[0010] In a fourth aspect, an embodiment of the present application provides a device control method based on distributed subscription, which is applied to a gateway and includes: obtaining the status information of a second sub-device sent by a bridging gateway; wherein, the second sub-device is determined according to the device control event of the first sub-device currently mounted; and controlling the first sub-device to perform corresponding actions according to the status information and the device control event.
[0011] In a fifth aspect, an embodiment of the present application provides a device control device based on distributed subscription, which is applied to a gateway and includes an obtaining module for obtaining the status information of a second sub-device sent by a bridging gateway; wherein, the second sub-device is determined according to the device control event of the first sub-device currently mounted; and an execution module for controlling the first sub-device to perform corresponding actions according to the status information and the device control event.
[0012] In a sixth aspect, an embodiment of the present application provides a gateway, including a processor and a memory. A computer program executable by the processor is stored in the memory. When the computer program is executed by the processor, it implements the device control method based on distributed subscription as described in any embodiment of the present application applied to the gateway side.
[0013] The device control method, device, and gateway based on distributed subscription provided in the above embodiments bridge the gateways corresponding to associated devices according to the relationship between devices in a device control event. By enabling message interconnection and interoperability between the bridged gateways, device control can be achieved. In this way, it is not necessary to rely on the network quality of the wide area network to which the device is currently connected. When the network quality is poor or the main gateway is offline, automated scenario control of smart home devices can still be achieved through message interconnection between the bridged gateways, enabling the maximum execution of automated scenario control of smart home devices, reducing network latency, and enhancing the user experience.
[0014] In a seventh aspect, an embodiment of the present application provides a device control method based on distributed subscription, which is applied to a device control system and includes: the terminal device determines a second sub-device associated with the first sub-device according to a device control event of the first sub-device to be mounted on the gateway to be set, determines the gateway mounted by the second sub-device as the bridging gateway of the gateway to be set, and configures the gateway to be set to subscribe to the status information of the second sub-device from the bridging gateway; the gateway to be set obtains the status information of the second sub-device sent by the bridging gateway and controls the first sub-device to perform corresponding actions according to the status information and the device control event.
[0015] For the device control method based on distributed subscription provided in the above embodiments, the terminal device configures and bridges the gateways in the device control event according to the relationship between devices, enabling device control through message interconnection and interoperability between the bridged gateways. In this way, it is not necessary to rely on the network quality of the wide area network to which the device is currently connected. When the network quality is poor or the main gateway is offline, automated scenario control of smart home devices can still be achieved through message interconnection between the bridged gateways, enabling the maximum execution of automated scenario control of smart home devices, reducing network latency, and enhancing the user experience.
[0016] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a controller, it implements the device control method based on distributed subscription according to any embodiment of the present application.
[0017] The security monitoring method implemented by the computer storage medium provided in the above embodiments belongs to the same concept as the security monitoring method embodiments applied to the terminal device side and the gateway side respectively in the foregoing embodiments, and accordingly has the same beneficial technical effects, which will not be elaborated here. Description of the Drawings
[0018] Figure 1 It is a schematic diagram of an optional application scenario of the device control method based on distributed subscription in an embodiment;
[0019] Figure 2 Flow chart of a device control method based on distributed subscription in an embodiment;
[0020] Figure 3 Schematic diagram of a device control device based on distributed subscription in an embodiment;
[0021] Figure 4 Flow chart of a device control method based on distributed subscription in another embodiment;
[0022] Figure 5 Schematic diagram of a device control device based on distributed subscription in another embodiment;
[0023] Figure 6 Flow chart of a device control method based on distributed subscription in yet another embodiment;
[0024] Figure 7 Schematic diagram of a known cloud - centralized automation control system in an embodiment;
[0025] Figure 8 For Figure 7 Schematic diagram of the distribution of fault points in the cloud - centralized automation control system shown;
[0026] Figure 9 Schematic diagram of a localization - centralized automation control system in an embodiment;
[0027] Figure 10 For Figure 9 Schematic diagram of the distribution of fault points in the localization - centralized automation control system shown;
[0028] Figure 11 Schematic diagram of an automation control system based on distributed subscription in an embodiment;
[0029] Figure 12 For Figure 11 Schematic diagram of the distribution of fault points in the automation control system based on distributed subscription shown;
[0030] Figure 13 Schematic diagram of a terminal device in an embodiment;
[0031] Figure 14 Schematic diagram of the structure of a terminal device in another embodiment;
[0032] Figure 15 Schematic diagram of a gateway in an embodiment. Detailed implementation manners
[0033] The technical solution of the present application will be further elaborated in detail below in conjunction with the specification drawings and specific embodiments.
[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit the implementation of this application. The term "and / or" as used herein includes any and all combinations of one or more of the related listed items.
[0035] In the description of this application, it should be understood that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to this application. In the description of this application, unless otherwise specified, the meaning of "plurality" is two or more.
[0036] In the description of this application, it should be noted that unless otherwise clearly defined and limited, the terms "install", "connect", and "couple" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected, or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific situations.
[0037] Please refer to Figure 1 , which is a framework diagram of an Internet of Things system for an optional application scenario of the device control method based on distributed subscription provided by an embodiment of this application. The Internet of Things system consists of a cloud 52, a router 54, smart home devices 55, a gateway 53, a terminal device 51, etc. The terminal device 51 can be any intelligent device with communication and storage functions, such as a smart phone, a desktop computer, a laptop computer, a tablet computer, or other intelligent communication devices with network connection functions. The cloud 52 can be a network access server, a database server, a cloud server, etc. Optionally, the gateway 53 can be built based on the WiFi protocol or the ZigBee protocol, and the smart home devices 55 can be pre-joined to the gateway 53. For example, the smart home devices 55 can be devices in the kit to which the gateway device belongs when the gateway 53 leaves the factory; or they can be devices connected to the gateway 53 through subsequent user operations.
[0038] Optionally, a client for managing the smart home devices 55 is installed in the terminal device 51. The client can be an application client (such as a mobile APP) or a web client, which is not limited herein.
[0039] Optionally, the smart home device 55 can establish a network connection with the gateway 53 based on the WiFi protocol or the ZigBee protocol, and thus join the network.
[0040] Both the terminal device 51 and the smart home device 55 can access the Ethernet through the gateway 53 and the router 54, and the gateway 53 can access the cloud 52 through a wired or wireless communication connection. For example, the gateway 53 and the terminal device 51 can store the acquired information in the cloud 52. Optionally, the terminal device 51 can also establish a network connection with the cloud 52 through 2G / 3G / 4G / 5G, WiFi, etc., so as to obtain the data sent by the cloud 52.
[0041] Optionally, the terminal device 51, the gateway 53, and the smart home device 55 can be in the same local area network or in the same wide area network as the cloud 52. Among them, when the terminal device 51 and the gateway 53 are in the same local area network, the terminal device 51 can interact with the gateway 53 and the smart home devices 55 connected to the gateway 53 through the local area network path; it can also interact with the gateway 53 and the smart home devices 55 connected to the gateway 53 through the wide area network path. When the terminal device 51 and the gateway 53 are not in the same local area network, the terminal device 51 can interact with the gateway 53 and the smart home devices 55 connected to the gateway 53 through the wide area network path. The Internet of Things system can further control the smart home devices 55 within the scope of the affiliated local area network or those correspondingly connected to it to be turned on or off through the smart home device 55. Among them, the smart home device 55 can include but is not limited to: smart switches, smart sockets, sensors, automatic curtains, air conditioners, warning devices, faucets and other smart home products.
[0042] Please refer to Figure 2 For a device control method based on distributed subscription provided by an embodiment of the present application, which can be applied to Figure 1 the terminal device shown. The device control method includes but is not limited to S101, S103, and S105, which are specifically introduced as follows:
[0043] S101, determine a second sub-device associated with the first sub-device according to the device control event of the first sub-device to be mounted on the gateway to be set.
[0044] A device control event refers to an event that controls a target device to perform a set action. In an optional embodiment, the target device may refer to a smart home device in an Internet of Things (IoT) home system, and the device control event may refer to an event that controls the smart home device to turn on, turn off, or perform a set action according to specified conditions. Among them, the specified conditions may be detecting that a certain preset condition is met, such as detecting that another device associated with the target device is in a certain preset state. Taking the specified condition as detecting that the water immersion sensor on the kitchen wooden floor is flooded, and the living room alarm emits an alarm as an example, the corresponding device control event is "the water immersion sensor on the kitchen wooden floor is flooded, control the living room alarm to emit an alarm".
[0045] The gateway to be set refers to any gateway selected from the IoT system when the user configures the automatic control of smart home devices in the IoT system through a terminal device and completes the configuration of mutual subscription between gateways. The user selects each gateway in the IoT system and configures the status of the smart home devices subscribed to by other gateways respectively, so that the gateways with mutual subscription can communicate with each other through messages to achieve device control. The first sub-device mounted on the gateway to be set refers to a smart home device connected to the network through the gateway to be set in the IoT system. The second sub-device associated with the first sub-device refers to other sub-devices involved in the specified conditions on which the first sub-device depends when performing corresponding actions in the same device control event.
[0046] For example, assume that the gateway to be set is the kitchen gateway, and the device control event A is "the water immersion sensor on the living room wooden floor is flooded, control the kitchen smart faucet to close the water valve". Among them, the first sub-device performing the corresponding action refers to the kitchen smart faucet closing the water valve, the specified condition refers to the water immersion sensor on the living room wooden floor being flooded, and the other sub-devices involved in the specified condition refer to the water immersion sensor on the living room wooden floor. According to the device control event A of the first sub-device, the kitchen smart faucet, determine that the second sub-device associated with the kitchen smart faucet is the water immersion sensor on the living room wooden floor.
[0047] Another example, assume that the gateway to be set is the living room gateway, and the device control event B is "the water immersion sensor on the kitchen wooden floor is flooded, control the living room alarm to emit an alarm". Among them, the first sub-device performing the corresponding action refers to the living room alarm emitting an alarm, the specified condition refers to the water immersion sensor on the kitchen wooden floor being flooded, and the other sub-devices involved in the specified condition refer to the water immersion sensor on the kitchen wooden floor. According to the device control event B of the first sub-device, the living room alarm, determine that the second sub-device associated with the living room alarm is the water immersion sensor on the kitchen wooden floor.
[0048] S103, determine the gateway to which the second sub-device is mounted as the bridging gateway of the gateway to be set.
[0049] The gateway attached to the second sub-device refers to the gateway that the second sub-device is connected to when accessing the network. After the terminal device determines the second sub-device associated with the first sub-device to which the gateway to be set is attached, it determines the gateway attached to the second sub-device as the bridging gateway of the gateway to be set. The bridging gateway refers to the gateway that establishes a communication connection bridge with the gateway to be set. The gateway to be set is associated with the bridging gateway based on the subscription configuration information. The gateway to be set and the bridging gateway are interconnected within the allowable length range, and message interconnection between the two can be achieved based on the established association.
[0050] S105. Obtain the subscription configuration information of the gateway to be set, where the subscription configuration information includes subscribing to the status information of the second sub-device from the bridging gateway.
[0051] The subscription configuration information includes subscribing to the status information of the second sub-device from the bridging gateway. The user operates the terminal device to configure the subscription status of the gateway to be set to obtain the status information of one or more second sub-devices in real time from one or more bridging gateways. The terminal device obtains the subscription configuration information of the gateway to be set according to the user's configuration operation, so that the configured gateway to be set can obtain the status information of the corresponding second sub-device from the corresponding bridging gateway according to the subscription configuration information. Taking the gateway to be set as gateway A, the first sub-devices attached to gateway A include device A1 and device A2, the bridging gateway includes gateway B, and the second sub-devices attached to gateway B include device B1 and device B2 as an example, the user can configure the subscription status of gateway A on the terminal device, select gateway B as the bridging gateway of gateway A, and select device B1 as the second sub-device associated with device A1, so as to form the subscription configuration information for gateway A to subscribe to the status information of device B1 from gateway B.
[0052] The gateway to be set subscribes to the status information of the second sub-device from the bridging gateway based on the subscription configuration information obtained by the terminal device. In this way, the gateway to be set can obtain the status of the second sub-device from the bridging gateway in real time. Among them, the way for the gateway to be set to obtain the status of the second sub-device from the bridging gateway can include the following: the bridging gateway can send the current status of the second sub-device to the gateway to be set according to a preset frequency, or when the status of the second sub-device changes, the bridging gateway sends the latest status after the change of the second sub-device to the gateway to be set.
[0053] It should be noted that for the same gateway, in some actual application scenarios, it can be a gateway to be set, while in some other actual application scenarios, it can also be a bridging gateway; or, for the same gateway, it can be a gateway to be set in one device control event and may also be a bridging gateway in another device control event. That is to say, the gateway to be set and the bridging gateway are relative to each other.
[0054] In the above embodiments, the terminal device determines a second sub-device associated with the first sub-device according to the device control event of the first sub-device mounted on the gateway to be set, determines the gateway mounted by the second sub-device as the bridging gateway of the gateway to be set, and configures the gateway to be set to subscribe to the status information of the second sub-device. By bridging the gateways corresponding to the associated devices according to the relationship between multiple devices in the device control event, and through the message interconnection between the gateways, device control can be achieved. In this way, it does not depend on the network quality of the wide area network to which the device is currently connected. When the network quality is poor or the main gateway is offline, the automated scenario control of smart home devices can still be realized through the message interconnection between the bridging gateways, enabling the maximum execution of the automated scenario control of smart home devices, reducing network latency, and improving the user experience.
[0055] In some embodiments, before determining the second sub-device associated with the first sub-device according to the device control event of the first sub-device mounted on the gateway to be set, it includes:
[0056] Obtain scenario automation information, where the scenario automation information includes device control conditions and device control actions corresponding to the device control conditions;
[0057] Obtain the device control event associated with the first sub-device of the gateway to be set according to the device control conditions and the corresponding device control actions in the scenario automation information.
[0058] The scenario automation information may refer to the information for controlling the expected states of one or more smart home devices included in each preset scenario. The scenario automation information includes device control conditions and device control actions corresponding to the device control conditions. The device control conditions refer to the logical conditions for automation, that is, the specified conditions that need to be met before the smart home device is automatically controlled to execute the set actions; the device control actions refer to the logical actions for automation, that is, the set actions executed by the corresponding smart home device when the device control conditions are met.
[0059] For example, the scenario automation information may include the following control scenarios: a preset monitoring scenario 1, when the water immersion sensor on the wooden floor of the living room detects water immersion, the intelligent faucet in the kitchen is controlled to close the water valve; then in the preset monitoring scenario 1, the device control condition is that the water immersion sensor on the wooden floor of the living room detects water immersion, and the device control action is to control the intelligent faucet in the kitchen to close the water valve. A preset monitoring scenario 2, when the water immersion sensor on the wooden floor of the kitchen detects water immersion, the alarm in the living room is controlled to sound an alarm; then in the preset monitoring scenario 2, the device control condition is that the water immersion sensor on the wooden floor of the kitchen detects water immersion, and the device control action is to control the alarm in the living room to sound an alarm. In the preset sleep scenario, when the sleep scenario button on the intelligent control panel is turned on, the corresponding bedroom light 1 is turned off, the living room light 2 is turned off, and the bedroom sleep light 3 is turned on; then in the preset sleep scenario, the device control condition is that the sleep scenario button on the intelligent control panel is turned on, and the device control action is that the bedroom light 1 is turned off, the living room light 2 is turned off, and the bedroom sleep light 3 is turned on. In the preset leaving-home scenario, when the entrance door magnetic lock is locked, the corresponding whole-house smart home devices are turned off; then in the preset leaving-home scenario, the device control condition is that the entrance door magnetic lock is locked, and the device control action is to control the whole-house smart home devices to be turned off. In the preset movie-watching scenario, when the projection device is turned on, the corresponding living room light 2 is turned off and the living room atmosphere light 4 is turned on; then in the preset movie-watching scenario, the device control condition is that the projection device is turned on, and the device control action is that the living room light 2 is turned off and the living room atmosphere light 4 is turned on.
[0060] A device control event refers to an event that controls a target device to perform a set action. The user can preset multiple scenarios and the working states of one or more smart home devices under each scenario through a terminal device. The terminal device obtains scenario automation information according to the scenarios set by the user, and obtains one or more device control events according to the corresponding relationship between the device control conditions and the device control actions in the scenario automation information. It can be understood that multiple device control actions can be determined based on the same device control condition in the same scenario, so that the same scenario can be correspondingly disassembled into device control events corresponding to multiple devices respectively.
[0061] In the above embodiments, the user can configure the scenarios through the terminal device, and disassemble the scenarios into device control events corresponding to single devices respectively according to the device control conditions and the corresponding device control actions in the scenario automation information. Among them, one device control event can correspond to controlling one device to perform the corresponding action. In this way, it is not necessary to rely on the network quality of the currently connected wide area network. When the network quality is poor or the main gateway is offline, the device control events based on single devices can still control the corresponding devices to perform the corresponding actions through the message interconnection between gateways, implementing the automated scenario control of smart home devices, so that the automated scenario control of smart home devices can be maximally executed, reducing network latency and improving the user experience.
[0062] In some embodiments, the device control method further includes:
[0063] Sending a device control event associated with the first sub-device to be mounted to the gateway to be set to the gateway to be set.
[0064] After the terminal device obtains the scene automation information, it disassembles according to the device control conditions and the corresponding device control actions in the scene automation information, disassembles the control of the device in the scene into device control events corresponding to multiple devices respectively, obtains the device control event associated with the first sub-device of the gateway to be set from the device control events of the multiple devices obtained after disassembly, and sends the device control event as a distributed automation control logic unit to the corresponding gateway.
[0065] Taking the preset sleep scene as an example, in the preset sleep scene, when the sleep scene button on the intelligent control panel is turned on, the corresponding bedroom light 1 is turned off, the living room light 2 is turned off, and the bedroom sleep light 3 is turned on; then in the preset sleep scene, the device control condition is that the sleep scene button on the intelligent control panel is turned on, and the device control actions are that the bedroom light 1 is turned off, the living room light 2 is turned off, and the bedroom sleep light 3 is turned on. In this preset sleep scene, the same device control condition corresponds to the device control actions of three devices, and the disassembly into device control events corresponding to the three devices respectively is: device control event 1 "the sleep scene button on the intelligent control panel is turned on, and the bedroom light 1 is turned off", device control event 2 "the sleep scene button on the intelligent control panel is turned on, and the living room light 2 is turned off", "the sleep scene button on the intelligent control panel is turned on, and the bedroom sleep light 3 is turned on", the gateway to be set in device control event 1 is the bedroom gateway, the gateway to be set in device control event 2 is the living room gateway, the gateway to be set in device control event 3 is the bedroom gateway, and the associated gateways are all the gateways mounted corresponding to the intelligent control panel.
[0066] In the above embodiments, by obtaining the device control event associated with the first sub-device of the gateway to be set and sending it to the corresponding gateway to be set, the scene automation information is disassembled into device control events corresponding to single devices respectively and sent to the corresponding gateways, so that the control logic unit can be minimized, the anti-interference ability and stability of the system can be improved, at the same time, the problem of abnormal control of a large area of device regions caused by single-point failures can be solved, the overall response speed of the system can be improved, and unnecessary data communication bandwidth can be reduced.
[0067] In some embodiments, the device control method further includes:
[0068] Create local automation information corresponding to the gateway to be set according to the scenario automation information; the local automation information includes device control conditions related to the first sub-device mounted on the gateway to be set and their corresponding device control actions, device control actions related to the first sub-device mounted on the gateway to be set and their corresponding device control conditions;
[0069] Send the local automation information to the gateway to be set.
[0070] After the terminal device obtains the scenario automation information, it disassembles according to the device control conditions and the corresponding device control actions in the scenario automation information, and disassembles the control of the device in the scenario into device control events corresponding to multiple devices respectively. Among them, the device control events related to the first sub-device can be those in which the device control conditions are related to the first sub-device or those in which the device control actions are related to the first sub-device. The local automation information includes device control events in which the device control conditions are related to the first sub-device and device control events in which the device control actions are related to the first sub-device. Each gateway has its own exclusive functional attributes and mounted sub-devices. By forming local automation information corresponding to the gateway to be set, the gateway can process the messages of the sub-devices it mounts according to the local automation information, and can also execute control by subscribing to the status information of the sub-devices under different gateways. The local automation information records all the device control events of the first sub-device currently mounted on the gateway to be set, which is convenient for unified modification, upgrade or maintenance of the scenario control table.
[0071] In the above embodiment, the gateway itself has a certain storage capacity and computing capacity. By storing the local automation information including the device control events of the sub-devices it mounts, it can process the messages of the sub-devices it mounts. When the network quality is poor or the main gateway is offline, the device control events disassembled based on a single device can still control the corresponding device to execute the corresponding actions through the message interconnection between gateways, so that the automated scenario control of smart home devices can be maximally executed.
[0072] Please refer to Figure 3 , on the other hand, this application also provides a device control device based on distributed subscription, including a determination module 11, configured to determine a second sub-device associated with the first sub-device according to the device control events of the first sub-device mounted on the gateway to be set; a bridging module 12, configured to determine the gateway on which the second sub-device is mounted as the bridging gateway of the gateway to be set; a subscription module 13, configured to obtain the subscription configuration information of the gateway to be set, where the subscription configuration information includes subscribing to the status information of the second sub-device from the bridging gateway.
[0073] The device control device further includes an acquisition module for acquiring scene automation information, where the scene automation information includes device control conditions and device control actions corresponding to the device control conditions; and acquiring device control events associated with the first sub-device of the gateway to be set according to the device control conditions and the corresponding device control actions in the scene automation information.
[0074] The determination module 11 is further configured to send the device control events associated with the first sub-device mounted on the gateway to be set to the gateway to be set.
[0075] The determination module 11 is further configured to create local automation information corresponding to the gateway to be set according to the scene automation information; the local automation information includes device control conditions related to the first sub-device mounted on the gateway to be set and the corresponding device control actions, and device control actions related to the first sub-device mounted on the gateway to be set and the corresponding device control conditions; and send the local automation information to the gateway to be set.
[0076] It should be noted that: in the process of device automation control of the device control device based on distributed subscription provided in the above embodiments, only the division of the above program modules is used for illustration. In practical applications, the above processing can be allocated to different program modules according to needs, that is, the internal structure of the device can be divided into different program modules to complete all or part of the method steps described above. In addition, the device control device based on distributed subscription provided in the above embodiments and the embodiment of the device control method based on distributed subscription applied to the terminal device side belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be elaborated here.
[0077] Please refer to Figure 4 , on the other hand, this application further provides a device control method based on distributed subscription, which can be applied to Figure 1 the gateway shown in the figure, and the device control method includes but is not limited to S201 and S203, and the specific introduction is as follows:
[0078] S201, acquiring the status information of the second sub-device sent by the bridging gateway; wherein, the second sub-device is determined according to the device control events of the first sub-device currently mounted.
[0079] The first sub-device currently mounted on the gateway refers to a smart home device that accesses the network through the gateway in the Internet of Things system. The second sub-device refers to other sub-devices involved in the specified conditions on which the first sub-device depends when performing corresponding actions in the same device control event. The bridging gateway refers to the gateway to which the second sub-device is mounted, that is, the gateway corresponding to the connection when the second sub-device accesses the network. The steps for determining the bridging gateway include: according to the device control event of the first sub-device mounted on the current gateway, determining the second sub-device associated with the first sub-device, and then determining the gateway to which the second sub-device is mounted as the bridging gateway of the current gateway.
[0080] The gateway obtains the status information of the second sub-device sent by the bridging gateway, which means that the gateway subscribes from the corresponding bridging gateway to the status information of the second sub-device associated with the first sub-device it mounts. The bridging gateway sends the current status of the second sub-device to the gateway according to a preset frequency, or when the status of the second sub-device changes, the bridging gateway sends the latest status after the change of the second sub-device to the gateway.
[0081] S203. Control the first sub-device to perform corresponding actions according to the status information and the device control event.
[0082] After the gateway obtains the status information of the second sub-device sent by the bridging gateway, it judges whether the current status of the second sub-device determined by the device control event meets the device control conditions for controlling the first sub-device to perform corresponding actions. If it meets, it controls the first sub-device to perform corresponding actions. Optionally, after the bridging gateway detects the status of the second sub-device, it judges whether it meets the device control conditions for controlling the first sub-device to perform corresponding actions. If it meets, it sends the status information of the second sub-device to the gateway. After the gateway obtains the status information of the second sub-device sent by the bridging gateway, it controls the first sub-device to perform corresponding actions according to the status information and the device control event.
[0083] Taking the gateway as the kitchen gateway, the first sub-device currently mounted as the kitchen smart faucet, and the device control event A of the first sub-device as "the water immersion sensor on the living room wooden floor is immersed in water, control the kitchen smart faucet to close the water valve" as an example, according to the device control event A, it can be determined that the second sub-device associated with the first sub-device "kitchen smart faucet" is the water immersion sensor on the living room wooden floor. The gateway corresponding to the second sub-device is the living room gateway. The kitchen gateway subscribes from the living room gateway to the status information of the second sub-device "water immersion sensor on the living room wooden floor". The living room gateway sends the status information of the water immersion sensor on the living room wooden floor to the kitchen gateway. When the kitchen gateway determines that the water immersion sensor on the living room wooden floor is immersed in water according to the status information of the water immersion sensor on the living room wooden floor, it controls the kitchen smart faucet to close the water valve.
[0084] In the above embodiments, the gateway bridges the gateways corresponding to the associated devices according to the relationships between the devices in the device control event, and realizes device control through message interconnection and interoperability with the bridged gateways. In this way, it is not necessary to rely on the network quality of the wide area network to which the device is currently connected. When the network quality is poor or the main gateway is offline, the automated scenario control of the smart home devices can still be realized through message interconnection between the bridged gateways, so that the automated scenario control of the smart home devices can be maximally executed, network latency can be reduced, and the user experience can be improved.
[0085] In some embodiments, before obtaining the status information of the second sub-device sent by the bridged gateway, it includes:
[0086] Obtain the device control events of the currently mounted first sub-device and store them locally.
[0087] A device control event refers to an event that controls a target device to perform a set action. The user can preset multiple scenarios and the working states of one or more smart home devices corresponding to each scenario through a terminal device. The terminal device obtains scenario automation information according to the scenarios set by the user, and obtains one or more device control events according to the corresponding relationship between the device control conditions and the device control actions in the scenario automation information, and sends the device control events of the first sub-device currently mounted by the gateway to the gateway for local storage. It can be understood that multiple device control actions can be determined based on the same device control condition in the same scenario, so the same scenario can be correspondingly disassembled into device control events corresponding to multiple devices respectively.
[0088] In the above embodiments, the gateway obtains the device control events associated with the currently mounted first sub-device, subscribes to the status information of the second sub-device from the bridged gateway according to the device control events, and thus completes the distribution of the device control events as distributed automated control logic units to the corresponding gateways, which can minimize the control logic units, improve the anti-interference ability and stability of the system, and at the same time can solve the problem of abnormal control of a large area of devices caused by a single point of failure, improve the overall response speed of the system and reduce unnecessary data communication bandwidth.
[0089] In some embodiments, before obtaining the status information of the second sub-device sent by the bridged gateway, it includes:
[0090] Obtain local automation information; wherein, the local automation information includes the device control conditions related to the first sub-device mounted by the gateway to be set and their corresponding device control actions, and the device control actions related to the first sub-device mounted by the gateway to be set and their corresponding device control conditions;
[0091] Subscribe to the status of the second sub-device from the bridging gateway based on the local automation information.
[0092] The device control event related to the first sub-device can be that the device control condition in the device control event is related to the first sub-device, or that the device control action in the device control event is related to the first sub-device. The local automation information includes device control events where the device control condition is related to the first sub-device and device control events where the device control condition is related to the second sub-device. Each gateway has its own exclusive functional attributes and mounted sub-devices. By forming local automation information corresponding to the gateway, the gateway can process the messages of the sub-devices it mounts based on the local automation information, and can also execute control by subscribing to the status information of the sub-devices under different gateways.
[0093] In the above embodiment, the gateway itself has a certain storage capacity and computing capacity. By storing the local automation information including the device control events of the sub-devices it mounts, it can process the messages of the sub-devices it mounts. When the network quality is poor or the main gateway is offline, the device control events disassembled based on a single device can still control the corresponding device to perform the corresponding actions through the message interconnection between gateways, so that the automated scenario control of smart home devices can be maximally executed.
[0094] In some embodiments, before obtaining the status information of the second sub-device sent by the bridging gateway, it includes:
[0095] Obtain scenario automation information, where the scenario automation information includes device control conditions and device control actions corresponding to the device control conditions;
[0096] Obtain device control events associated with the currently mounted first sub-device according to the device control conditions and the corresponding device control actions in the scenario automation information.
[0097] The gateway itself has a certain storage capacity and computing capacity. In an alternative implementation, the gateway can obtain scene automation information, disassemble it according to the device control conditions and corresponding device control actions in the scene automation information, disassemble the control of devices in the scene into device control events corresponding to multiple devices respectively, obtain the device control events associated with the first sub-device currently mounted by the gateway itself from the device control events of the multiple devices obtained after disassembly, and subscribe the status information of the first sub-device to the gateway corresponding to the associated second sub-device when the first sub-device is involved in the device control condition in the device control event; when the first sub-device is involved in the device control action in the device control event, subscribe the status information of the second sub-device to the gateway corresponding to the second sub-device associated with the first sub-device, so as to bridge each gateway with the device control event as a distributed automation control logic unit, enabling the messages between gateways to communicate with each other.
[0098] In the above embodiment, after the gateway obtains the scene automation information, it disassembles the scene to obtain device control events corresponding to the first sub-devices currently mounted by itself. Based on the device control events of each first sub-device, it can complete the automation control without relying on the network quality of the currently accessed wide area network, and enable the automation scene control of smart home devices to be maximally executed, improving the user experience.
[0099] In some embodiments, the device control method further includes:
[0100] Create local automation information according to the device control events, where the local automation information includes the device control conditions related to the currently mounted first sub-device and their corresponding device control actions, and the device control actions related to the currently mounted first sub-device and their corresponding device control conditions.
[0101] Among them, the local automation information includes the device control events with device control conditions related to the first sub-device currently mounted by the gateway itself and the device control events with device control actions related to the first sub-device. Each gateway has its own exclusive functional attributes and mounted sub-devices. By forming local automation information corresponding to the gateway, the gateway can process the messages of the first sub-device currently mounted by itself according to the local automation information, and can also execute the control of the first sub-device by subscribing to the status information of the second sub-devices under different gateways.
[0102] In the above embodiments, the gateway stores local automation information, which includes all device control events related to the sub-devices currently mounted by the gateway itself. The gateway processes the messages of the sub-devices it mounts according to the scenario control table. When the network quality is poor or the main gateway is offline, the device control events disassembled based on a single device can still control the corresponding devices to perform corresponding actions through the message interconnection between gateways, enabling the maximum execution of the automated scenario control for smart home devices.
[0103] On the other hand, in an embodiment of the present application, please refer to Figure 5 , and a device control device based on distributed subscription is further provided, which is applied to the gateway. The device control device includes: an acquisition module 21, configured to acquire the status information of a second sub-device sent by a bridging gateway; wherein, the second sub-device is determined according to the device control event of a first sub-device currently mounted; an execution module 22, configured to control the first sub-device to perform a corresponding action according to the status information and the device control event.
[0104] Optionally, the acquisition module 21 is further configured to acquire the device control events of the first sub-device currently mounted for local storage.
[0105] Optionally, the acquisition module 21 is further configured to acquire local automation information; wherein, the local automation information includes device control conditions related to the first sub-device mounted by the gateway to be set and their corresponding device control actions, device control actions related to the first sub-device mounted by the gateway to be set and their corresponding device control conditions; and subscribe to the status of the second sub-device from the bridging gateway based on the local automation information.
[0106] Optionally, the acquisition module 21 is further configured to acquire scenario automation information, where the scenario automation information includes device control conditions and device control actions corresponding to the device control conditions; and acquire device control events associated with the first sub-device currently mounted according to the device control conditions and the corresponding device control actions in the scenario automation information.
[0107] Optionally, the acquisition module 21 is further configured to create local automation information according to the device control events, where the local automation information includes device control conditions related to the first sub-device currently mounted and their corresponding device control actions, device control actions related to the first sub-device currently mounted and their corresponding device control conditions.
[0108] It should be noted that: in the process of device automation control by the device control device based on distributed subscription provided in the above embodiments, only the division of the above program modules is used for illustration. In actual applications, the above processing can be allocated to different program modules according to needs, that is, the internal structure of the device can be divided into different program modules to complete all or part of the method steps described above. In addition, the device control device based on distributed subscription provided in the above embodiments and the method embodiments of the device control method based on distributed subscription applied to the gateway side belong to the same concept. For the specific implementation process, please refer to the corresponding method embodiments and will not be elaborated here.
[0109] On the other hand of this application, please refer to Figure 6 , and a device control method based on distributed subscription is also provided, which is applied to a device control system and includes:
[0110] S301. According to the device control event of the first sub-device to be mounted on the gateway to be set, the terminal device determines the second sub-device associated with the first sub-device, determines the gateway on which the second sub-device is mounted as the bridging gateway of the gateway to be set, and configures the gateway to be set to subscribe to the status information of the second sub-device from the bridging gateway.
[0111] The user can configure the automation control scenario of the smart home through the terminal device. The device control event refers to an event that controls the target device to perform a set action. The gateway to be set refers to any gateway selected from the Internet of Things system when the user configures the automation control scenario of the smart home device in the Internet of Things system according to the association between the devices mounted under different gateways in the device control event and completes the configuration of mutual subscription between gateways. The user selects each gateway in the Internet of Things system one by one and configures it to subscribe to the status of the smart home devices in other gateways respectively, so that the gateways with mutual subscription can communicate with each other through messages to achieve device control.
[0112] S303. The gateway to be set obtains the status information of the second sub-device sent by the bridging gateway, and controls the first sub-device to perform corresponding actions according to the status information and the device control event.
[0113] After the gateway to be set subscribes to the status information of the second sub-device associated with the first sub-device it mounts from the corresponding bridging gateway, the bridging gateway sends the current status of the second sub-device to the gateway to be set according to a preset frequency, or when the status of the second sub-device changes, the bridging gateway sends the latest status after the change of the second sub-device to the gateway to be set. Among them, for the same gateway, it can be the gateway to be set in one device control event and the bridging gateway in another device control event. The identity of the same gateway as the gateway to be set or the bridging gateway can be switched according to different device control events as device control conditions or device control actions.
[0114] In the above embodiments, the terminal device determines the second sub-device associated with the first sub-device according to the device control event of the first sub-device mounted by the gateway to be set, determines the gateway where the second sub-device is mounted as the bridging gateway of the gateway to be set, and configures the gateway to be set to subscribe to the status information of the second sub-device. According to the correlation between the devices mounted under different gateways in the device control event, the gateways corresponding to the associated devices are bridged. Through the message interconnection between the gateways, device control can be realized. In this way, it is not necessary to rely on the network quality of the wide area network to which the device is currently connected. When the network quality is poor or the main gateway is offline, the automated scenario control of smart home devices can still be realized through the message interconnection between the bridging gateways, so that the automated scenario control of smart home devices can be maximally executed, reducing network latency and improving user experience.
[0115] In some embodiments, the device control method further includes:
[0116] The terminal device obtains scenario automation information; wherein, the scenario automation information includes device control conditions and device control actions corresponding to the device control conditions;
[0117] The terminal device obtains the device control event associated with the first sub-device of the gateway to be set according to the device control conditions and the corresponding device control actions in the scenario automation information and sends it to the gateway to be set;
[0118] Or, the terminal device creates local automation information corresponding to the gateway to be set according to the scenario automation information and sends it to the gateway to be set; wherein, the local automation information includes device control conditions related to the first sub-device mounted by the gateway to be set and the corresponding device control actions, and device control actions related to the first sub-device mounted by the gateway to be set and the corresponding device control conditions.
[0119] Scene automation information may refer to information for controlling the expected states of one or more smart home devices corresponding to each preset scene. The device control condition refers to the logical condition for automation, that is, the specified condition that needs to be met before the smart home device automatically executes the set action; the device control action refers to the logical action for automation, that is, the set action executed by the corresponding smart home device when the device control condition is met. The user configures the scene automation information through the terminal device, disassembles the control of the devices in the scene into device control events corresponding to multiple devices respectively, obtains the device control events associated with the first sub-device of the gateway to be set from the device control events of the multiple devices obtained after disassembly, and distributes the device control events as distributed automation control logic units to the corresponding gateways.
[0120] In an optional example, the device control system is composed of multiple gateways with certain computing power and storage capacity connected to each other through a router. Each gateway has some exclusive functional attributes and mounted sub-devices. For the gateways, they can communicate with each other through the router. Each gateway has a certain storage capacity and computing power, can store the automation binding table, can process the messages of the sub-devices it mounts, and can also consume data by subscribing to some sub-devices under different gateways. For the sub-devices, taking the living room alarm, the living room wooden floor water immersion sensor, the kitchen smart faucet, and the kitchen wooden floor water immersion sensor as examples, the sub-devices respectively have unique input and output functions. For example, the water immersion sensor can detect whether there is water immersion, the living room alarm can accept commands to trigger an alarm, and the kitchen smart faucet can accept control commands to close. For the router, it bridges each gateway so that the messages of the gateways can be interconnected. When the user configures an automated scene automation information, the logical condition for automation is that the kitchen wooden floor water immersion sensor or the living room wooden floor water immersion sensor detects water immersion, and the logical action for automation is to close the kitchen smart faucet and trigger the living room alarm. When the automation is distributed, the device control system disassembles the scene automation information into a distributed automation control logic unit and distributes it to the corresponding gateways respectively. For example, for the living room gateway, the first step is to subscribe to the status of the kitchen wooden floor water immersion sensor under the kitchen gateway, and the second step is to create an automation binding table. The content of this binding table is that when it is detected that the living room wooden floor water immersion sensor or the kitchen wooden floor water immersion sensor detects water immersion, the alarm is triggered. For the kitchen gateway, the first step is to subscribe to the status of the living room wooden floor water immersion sensor under the living room gateway, and the second step is to create an automation binding table. The content of this binding table is that when it is detected that the living room wooden floor water immersion sensor or the kitchen wooden floor water immersion sensor detects water immersion, the switch of the kitchen smart faucet is closed.
[0121] In the above embodiments, the control of smart home devices in the Internet of Things system is disassembled into independent device control events corresponding to multiple devices respectively, so that the automation control logic unit can be minimized. It is split according to the functional attributes of the automation control logic and the gateway and the relationship between the sub-devices mounted on the gateway, and split into the smallest units for distributed storage to form a bridging gateway. The gateway locally stores the device control events related to the sub-devices mounted on itself. For the communication mechanism, a local area network-based subscription is adopted, so that the conditions under different gateways can be corresponding to each distributed gateway. Distributed automation is adopted to improve the response speed of the device control system and reduce unnecessary data communication bandwidth. At the same time, it also solves the problem of abnormal control of a large area of devices caused by a single point of failure, and improves the anti-interference and stability of the system.
[0122] In some embodiments, the device control method further includes:
[0123] The terminal device obtains the device control events associated with the first sub-device mounted on the bridging gateway according to the device control conditions and the corresponding device control actions in the scenario automation information, and sends them to the bridging gateway;
[0124] Or, the terminal device creates local automation information corresponding to the bridging gateway according to the scenario automation information and sends it to the bridging gateway; wherein, the local automation information includes the device control conditions related to the first sub-device mounted on the bridging gateway and their corresponding device control actions, and the device control actions related to the first sub-device mounted on the bridging gateway and their corresponding device control conditions.
[0125] Among them, the local automation information may include one or more device control events. After the terminal device disassembles the control of devices in the scenario into device control events corresponding to multiple devices respectively, it can send the device control events related to the first sub-device to the gateway respectively or form local automation information in a specified format and send it to the gateway.
[0126] In an optional example, when performing automated scenario control, if the water immersion sensor on the living room wooden floor detects water immersion, since the kitchen gateway subscribes to its status, the living room gateway will inform the kitchen gateway of the status of the water immersion sensor on the living room wooden floor through the router. Then, the living room gateway will instruct the notification alarm to sound. When the kitchen gateway discovers that the water immersion sensor on the living room wooden floor is waterlogged, it will control the kitchen smart faucet to close the water valve. Similarly, if the water immersion sensor on the kitchen wooden floor detects water immersion, since the living room gateway subscribes to its status, the kitchen gateway will inform the living room gateway of the status of the water immersion sensor on the kitchen wooden floor through the router. Then, the kitchen gateway will control the kitchen smart faucet to close the water valve. When the living room gateway discovers that the water immersion sensor on the kitchen wooden floor is waterlogged, it will notify the living room alarm to sound. Among them, the process of mutual subscription of sub-device status information between the two gateways and the establishment of their respective binding relationships can be completed after the user configures the scenario automation information through the client on the terminal device, and the terminal device disassembles the control of the device in the scenario into device control events corresponding to multiple devices respectively and then distributes them to the gateway. The client can be an APP application or a web application.
[0127] In the above embodiment, after the gateway subscribes to the status information of the associated second sub-device from the bridging gateway according to the obtained device control event or the local scenario list, the automated control of the mounted first sub-device can be realized based on the interconnection and intercommunication of messages between the gateways. In this way, through the automated control of distributed subscription, the device control system will execute the corresponding actions as much as possible when the conditions are met. For example, when a device control event requires sub-devices under different gateways to be the device control condition and the device control action for each other, when the network quality of the wide area network currently accessed by the device is poor or offline, the automated scenario control of the sub-device can still be realized through the message interconnection between the gateways; when different sub-devices under the same gateway in a device control event are the device control condition and the device control action for each other, even when there is a fault point in the message interconnection and intercommunication between the gateways, the automated scenario control of the sub-devices mounted on it can be realized based on the device control events stored in the same gateway.
[0128] Please refer to Figure 7 , which is a schematic diagram of a known cloud centralized automated control system. Among them, the automated scenario configuration information of the smart home devices is stored in the cloud. Taking the example that the user configures an automated scenario A: the automated condition is that the living room or the kitchen is waterlogged, and the automated action is to close the faucet and sound the alarm. When the kitchen sensor detects waterlogging, the waterlogging signal will be uploaded to the router through the kitchen gateway, and the router will then report it to the cloud through the Internet. When the cloud detects that the kitchen is waterlogged, it will send a signal to the living room gateway to sound the living room alarm, and at the same time, it will also send a control command to the kitchen gateway to close the kitchen faucet. However, please refer to Figure 8,The cloud centralized control system is particularly dependent on the external network ,situation. If a fault point occurs, once the router is not connected to the ,Internet, the flooding status cannot be reported to the cloud, and the control commands from the ,cloud cannot be sent to the gateway, resulting in the inability to execute automation.
[0129] See also Figure 9 , is a schematic diagram of another localized centralized automation control system, in which the automation scene configuration information of smart home devices is sunk to a main gateway in the local area network (such as the main gateway is the living room gateway). Compared with the cloud-based centralized automation control system, the localized centralized automation control system does not rely on the external network when executing automation, as long as the local area network communicates normally. For example, a user configures an automation scene A: the automation condition is water flooding in the living room or kitchen, and the automation action is to turn off the faucet and alarm. When the kitchen sensor detects water flooding, the water flooding signal will be uploaded to the router through the kitchen gateway, and the router will forward it to the living room gateway. The living room gateway sends a signal to let the living room alarm sound, and also sends a control command to the kitchen gateway to turn off the kitchen faucet. However, please refer to Figure 10 ,For example, when fault point 2 occurs, even if the kitchen wooden floor water sensor is soaked and meets the conditions for closing the faucet, automation cannot be executed because the automation scene configuration information is uniformly stored in the living room gateway.
[0130] See also Figure 11, which is a schematic diagram of the automated control system based on distributed subscription in this application. In this system, the automated scenario configuration information for smart home devices is disassembled into device control events corresponding to each device. The device control events are sent to the corresponding gateways, or local automated information corresponding to the gateways is formed based on the device control events and sent to the gateways. Compared with the cloud centralized automated control system and the local centralized automated control system, it integrates centralized automation and subscription-based automation, minimizes the control logic unit, solves the problem of abnormal control of a large area of device regions caused by single-point failures, minimizes the control logic unit, improves the anti-interference ability and stability of the system, and at the same time improves the response speed of the system and reduces unnecessary data communication bandwidth. Take the example where a user configures an automated scenario A: the automated condition is water immersion in the living room or kitchen, and the automated action is to close the faucet and alarm. Automated scenario A can be respectively device control event a, water immersion in the living room, close the kitchen faucet; device control event b, water immersion in the kitchen, close the kitchen faucet; device control event c, water immersion in the living room, alarm in the living room; device control event d, water immersion in the kitchen, alarm in the living room. The kitchen gateway subscribes to the status of the living room water immersion sensor according to device control event a; the living room gateway subscribes to the status of the kitchen water immersion sensor according to device control event d. When the living room water immersion sensor detects water immersion, the living room gateway notifies the kitchen gateway of the status of the living room water immersion sensor, and the kitchen gateway controls the kitchen faucet to close, and the living room gateway controls the alarm to sound; when the kitchen water immersion sensor detects water immersion, the kitchen gateway notifies the living room gateway of the status of the kitchen water immersion sensor, and the living room gateway controls the alarm to sound, and the kitchen gateway controls the kitchen faucet to close. Please refer to Figure 12 , even if fault point three and fault point four occur, the automated control system based on distributed subscription can still try to execute the corresponding actions when the conditions are met. For example, when the living room water immersion sensor detects a water immersion event, the living room gateway will control the alarm to sound; when the kitchen water immersion sensor detects a water immersion event, the kitchen gateway will also control the kitchen faucet to close the valve.
[0131] On the other hand, in this application, please refer to Figure 13 , and a terminal device is also provided, including a processor 111 and a memory 112. The memory 112 stores a computer program executable by the processor. When the computer program is executed by the processor 111, it implements the device control method based on distributed subscription provided by any embodiment of this application and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0132] Please refer to Figure 14 , which is an optional hardware structure block diagram of the terminal device provided by the embodiment of this application. As Figure 14As shown, terminal devices can vary significantly due to differences in configuration or performance. They can include one or more processors (Processing Units, CPUs) 1110 (the processor 1110 can include, but is not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA), a memory 1130 for storing data, and one or more storage media 1120 for storing application programs 1123 or data 1122 (such as one or more mass storage devices). Among them, the memory 1130 and the storage media 1120 can be transient storage or persistent storage. The program stored in the storage media 1120 can include one or more modules, and each module can include a series of instruction operations on the scenario control panel. Further, the processor 1110 can be set to communicate with the storage media 1120 and execute a series of instruction operations in the storage media 1120 on the intelligent device. The intelligent device can also include one or more power supplies 1160, one or more wired or wireless network light band interfaces 1150, one or more input / output light band interfaces 1140, and / or one or more operating systems 1121, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSD TM, and so on.
[0133] The input / output light band interface 1140 can be used to receive or send data via a network. Specific examples of the above network can include the wireless network provided by the communication provider of the intelligent device. In one example, the input / output light band interface 1140 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one example, the input / output light band interface 1140 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0134] Those of ordinary skill in the art can understand that Figure 14 the structure shown is only schematic and does not limit the structure of the above terminal device. For example, the terminal device can also include more or fewer components than Figure 14 shown, or have a different configuration from Figure 14 shown.
[0135] On the other hand, for this application, please refer to Figure 15, a gateway is further provided, including a processor 211 and a memory 212. A computer program executable by the processor is stored in the memory 212. When the computer program is executed by the processor 211, it implements the device control method based on distributed subscription provided by any embodiment of the present application and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0136] An embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, it implements each process of the embodiment of the multi-mode configuration method of the above intelligent control panel and can achieve the same technical effect. To avoid repetition, it will not be elaborated here. Among them, the computer-readable storage medium, such as a read-only memory (ROM for short), a random access memory (RAM for short), a magnetic disk, or an optical disc, etc.
[0137] The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A device control method based on distributed subscription, applied to a terminal device, characterized in that Including: Obtain scene automation information; The scene automation information includes device control conditions and corresponding device control actions; According to the device control conditions and the corresponding device control actions, determine the device control events corresponding to the first sub-device and the second sub-device respectively; the first sub-device and the second sub-device are mounted on different gateways; According to the device control event of the first sub-device mounted on the gateway to be set, determine the second sub-device associated with the first sub-device; Determine the gateway to which the second sub-device is mounted as the bridging gateway of the gateway to be set; According to the device control events corresponding to the first sub-device and the second sub-device respectively in the scene automation information, disassemble the scene automation information into local automation information corresponding to the gateway to be set and local automation information corresponding to the bridging gateway, and bind the local automation information corresponding to the gateway to be set to the gateway to be set; The local automation information corresponding to the bridging gateway is used to be bound to the bridging gateway; Configure subscription configuration information for the gateway to be set for the bridging gateway; The subscription configuration information is used for the gateway to be set to subscribe to the real-time status information of the second sub-device from the bridging gateway, so that the device control can be realized between the gateway to be set and the corresponding bridging gateway through the local automation information and real-time status information stored respectively.
2. The device control method according to claim 1, characterized in that The local automation information corresponding to the gateway to be set includes: the device control conditions related to the first sub-device mounted on the gateway to be set and their corresponding device control actions, and the device control actions related to the first sub-device mounted on the gateway to be set and their corresponding device control conditions.
3. A device control method based on distributed subscription, applied to a gateway, characterized in that, Including: Obtain the local automation information corresponding to the current gateway disassembled from the device control event corresponding to the first sub-device in the scene automation information, and locally store the local automation information; The scene automation information includes device control conditions and corresponding device control actions; according to the device control conditions and the corresponding device control actions, determine the device control events corresponding to the first sub-device and the second sub-device respectively; The second sub-device is determined according to the device control event of the first sub-device currently mounted; the first sub-device and the second sub-device are mounted on different gateways, the first sub-device is mounted in the current gateway, and the second sub-device is mounted in the bridging gateway; Obtain the subscription configuration information configured for the current gateway for the bridging gateway; The subscription configuration information is used for the current gateway to subscribe to the real-time status information of the second sub-device from the bridging gateway; Obtain the real-time status information of the second sub-device sent by the subscribed bridging gateway; If it is determined that the device control conditions in the local automation information are met according to the real-time status information, control the first sub-device to execute the corresponding device control action.
4. The device control method according to claim 3, characterized in that, The local automation information includes device control conditions related to the currently mounted first sub-device and their corresponding device control actions, and device control actions related to the currently mounted first sub-device and their corresponding device control conditions.
5. A device control method based on distributed subscription, applied to a device control system, characterized in that, Comprising: A terminal device for obtaining scenario automation information; The scenario automation information includes device control conditions and corresponding device control actions; According to the device control conditions and the corresponding device control actions, determine device control events corresponding to the first sub-device and the second sub-device respectively; the first sub-device and the second sub-device are mounted on different gateways; According to the device control event of the first sub-device to be mounted on the gateway to be set, determine the second sub-device associated with the first sub-device, and determine the gateway on which the second sub-device is mounted as the bridging gateway of the gateway to be set; According to the device control events corresponding to the first sub-device and the second sub-device in the scenario automation information, disassemble the scenario automation information into local automation information corresponding to the gateway to be set and local automation information corresponding to the bridging gateway, and bind the local automation information corresponding to the gateway to be set to the gateway to be set; The local automation information corresponding to the bridging gateway is used to be bound to the bridging gateway; Configure subscription configuration information for the gateway to be set for the bridging gateway; The subscription configuration information is used for the gateway to be set to subscribe to the real-time status information of the second sub-device from the bridging gateway, so that the gateway to be set and the corresponding bridging gateway that subscribe to each other can implement device control through the local automation information and real-time status information stored respectively; The gateway to be set is used to obtain the local automation information corresponding to the current gateway disassembled based on the device control event corresponding to the first sub-device in the scenario automation information, and locally store the local automation information; obtain the subscription configuration information for the bridging gateway configured for the current gateway; Obtain the real-time status information of the second sub-device sent by the subscribed bridging gateway, and if it is determined that the device control conditions in the local automation information are met according to the real-time status information, control the first sub-device to execute the corresponding device control action.
6. The device control method according to claim 5, characterized in that, The local automation information corresponding to the gateway to be set includes: device control conditions related to the first sub-device mounted on the gateway to be set and their corresponding device control actions, and device control actions related to the first sub-device mounted on the gateway to be set and their corresponding device control conditions.
7. The device control method according to claim 5, wherein, The local automation information corresponding to the bridging gateway includes: device control conditions related to the first sub-device mounted on the bridging gateway and their corresponding device control actions, and device control actions related to the first sub-device mounted on the bridging gateway and their corresponding device control conditions.
8. A device control device based on distributed subscription, which is applied to a terminal device, and is characterized in that, Comprising: A determination module for obtaining scenario automation information; The scenario automation information includes device control conditions and corresponding device control actions; Determine device control events corresponding to the first sub-device and the second sub-device respectively according to the device control conditions and the corresponding device control actions; the first sub-device and the second sub-device are mounted on different gateways; Determine the second sub-device associated with the first sub-device according to the device control event of the first sub-device to be mounted on the gateway to be set; A bridging module, configured to determine the gateway to which the second sub-device is mounted as the bridging gateway of the gateway to be set; A subscription module, configured to disassemble the scenario automation information into local automation information corresponding to the gateway to be set and local automation information corresponding to the bridging gateway according to the device control events corresponding to the first sub-device and the second sub-device respectively in the scenario automation information, and bind the local automation information corresponding to the gateway to be set to the gateway to be set; The local automation information corresponding to the bridging gateway is used to be bound to the bridging gateway; Configure subscription configuration information for the gateway to be set for the bridging gateway, where the subscription configuration information is used for the gateway to be set to subscribe to the real-time status information of the second sub-device from the bridging gateway, so that the gateway to be set and the corresponding bridging gateway that subscribe to each other can implement device control through the local automation information and real-time status information stored respectively.
9. A terminal device, characterized in that, It includes a processor and a memory, and a computer program executable by the processor is stored in the memory. When the computer program is executed by the processor, it implements the device control method based on distributed subscription as described in any one of claims 1 to 2.
10. A device control device based on distributed subscription, applied to a gateway, characterized in that It includes: An acquisition module, configured to acquire local automation information corresponding to the current gateway disassembled from the device control event corresponding to the first sub-device in the scenario automation information, and locally store the local automation information; The scenario automation information includes device control conditions and corresponding device control actions; determine device control events corresponding to the first sub-device and the second sub-device respectively according to the device control conditions and the corresponding device control actions; The second sub-device is determined according to the device control event of the first sub-device currently mounted; the first sub-device and the second sub-device are mounted on different gateways, the first sub-device is mounted in the current gateway, and the second sub-device is mounted in the bridging gateway; acquire the subscription configuration information configured for the current gateway for the bridging gateway; the subscription configuration information is used for the current gateway to subscribe to the real-time status information of the second sub-device from the bridging gateway; acquire the real-time status information of the second sub-device sent by the subscribed bridging gateway; acquire the subscription configuration information configured for the current gateway for the bridging gateway; the subscription configuration information is used for the current gateway to subscribe to the real-time status information of the second sub-device from the bridging gateway; acquire the real-time status information of the second sub-device sent by the subscribed bridging gateway; An execution module, configured to control the first sub-device to execute the corresponding device control action if it is determined according to the real-time status information that the device control conditions in the local automation information are satisfied.
11. A gateway, characterized in that, It includes a processor and a memory. A computer program executable by the processor is stored in the memory. When the computer program is executed by the processor, it implements the device control method based on distributed subscription as described in any one of claims 3 to 4.
12. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is executed by the controller, it implements the device control method based on distributed subscription as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Equipment control method, device and system, electronic equipment and storage medium
CN110113232A
Multi-intelligent-device linkage control method, device and system
CN111614524A
Acquisition method and device, configuration method and device, and edge computing cluster
CN112532671A