Device control method, device, storage medium and electronic device
By deploying multiple gateway devices in smart home devices and directly obtaining appropriate gateway devices from candidate gateway devices to execute control requests, the problem of low control efficiency of smart home devices is solved and more efficient device control and user experience are achieved.
Patent Information
- Application Number
- CN202210857676.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-20
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-07-20
AI Technical Summary
The control efficiency of existing smart home devices is low, especially when the network is unstable or disconnected, resulting in the failure of control instructions to be transmitted, affecting the user experience.
By deploying multiple gateway devices in the target area, after receiving the device control request, the appropriate gateway device is obtained from the candidate gateway devices to execute the control request, avoiding the need to find a suitable gateway device through cloud service computing, and directly performing control on the local gateway device. operate.
It improves the efficiency of device control, reduces the time to obtain suitable gateway devices, avoids control failures caused by network instability, and improves user experience.
Smart Images

Figure CN115309062B
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a device control method, device, storage medium and electronic device. Background Art
[0002] As household devices in daily life become more and more intelligent, people expect a smoother and smarter device control experience, for example, they can easily control multiple devices to operate in the state expected by the user without having to perform complex manual operations. In the prior art, smart home linkage often requires the support of cloud services. When users expect to control devices to execute control instructions, they often need to select the appropriate gateway device for the control device through cloud service calculations, and then control the device through the gateway device. If the network in the user's home is disconnected or unstable, the control instruction may not be sent to the corresponding gateway, which will lead to device control failure and reduce the user experience.
[0003] With regard to the problems of low control efficiency of equipment in related technologies, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a method, device, storage medium and electronic device for controlling a device, so as to at least solve the problem of low control efficiency of the device in the related art.
[0005] According to an embodiment of the present application, a method for controlling a device is provided, including:
[0006] receiving a device control request, wherein the device control request is used to request control of a target device deployed in a target area, wherein a plurality of gateway devices are also deployed in the target area, and the plurality of gateway devices include the first gateway device;
[0007] In response to the device control request, obtaining a second gateway device from candidate gateway devices, wherein the candidate gateway devices include the first gateway device and a third gateway device among the multiple gateway devices that is allowed to control the target device;
[0008] Control the second gateway device to execute the device control request.
[0009] Optionally, acquiring the second gateway device from the candidate gateway devices includes:
[0010] Acquire a gateway that is allowed to control the target device from the plurality of gateway devices as the third gateway device;
[0011] In a case where the third gateway device includes the first gateway device, determining the first gateway device as the second gateway device;
[0012] In a case where the third gateway device does not include the first gateway device, the second gateway device is acquired from the third gateway device.
[0013] Optionally, the acquiring the second gateway device from the third gateway device includes one of the following:
[0014] Acquire a gateway device whose calling frequency meets the target calling condition from the third gateway device as the second gateway device;
[0015] Detect the calling status of each of the third gateway devices; obtain the calling status to indicate the fourth gateway device currently allowed to be called by the first gateway device; and obtain a gateway device whose calling frequency meets the target calling condition from the fourth gateway device as the second gateway device.
[0016] Optionally, the controlling the second gateway device to execute the device control request includes:
[0017] In a case where the second gateway device comes from the third gateway device, sending the device control request to the second gateway device;
[0018] In a case where the second gateway device is the first gateway device, the target device is controlled to execute the target operation requested by the device control request.
[0019] Optionally, after sending the device control request to the second gateway device, or controlling the target device to perform the target operation requested by the device control request, the method further includes:
[0020] Receiving a confirmation message returned by the second gateway device or the target device;
[0021] In a case where the confirmation message is used to indicate that the device control request is executed successfully, indication information is sent to the device that initiated the device control request, wherein the indication information is used to indicate that the device control request is executed successfully.
[0022] Optionally, after acquiring the second gateway device from the candidate gateway devices, the method further includes:
[0023] If the second gateway device is not obtained, obtaining a fifth gateway device corresponding to the target device from smart devices and gateway devices having a corresponding relationship through a cloud service;
[0024] Acquire, through the cloud service, from the fifth gateway device a gateway device whose calling frequency meets a target calling condition as a sixth gateway device;
[0025] The sixth gateway device is controlled by the cloud service to execute the device control request.
[0026] Optionally, after controlling the second gateway device to execute the device control request, in a case where controlling the second gateway device to execute the device control request fails, the method further includes one of the following:
[0027] Acquire a seventh gateway device from other gateway devices in the third gateway device except the second gateway device; control the seventh gateway device to execute the device control request;
[0028] The eighth gateway device is obtained from the plurality of gateway devices through the cloud service and is controlled to execute the device control request.
[0029] According to another embodiment of the present application, a control device for a device is also provided, including:
[0030] A first receiving module, configured to receive a device control request, wherein the device control request is used to request control of a target device deployed in a target area, wherein a plurality of gateway devices are also deployed in the target area, and the plurality of gateway devices include the first gateway device;
[0031] A first acquisition module, configured to respond to the device control request and acquire a second gateway device from candidate gateway devices, wherein the candidate gateway devices include the first gateway device and a third gateway device among the multiple gateway devices that is allowed to control the target device;
[0032] The first processing module is used to control the second gateway device to execute the device control request.
[0033] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the control method of the above-mentioned device when running.
[0034] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the control method of the device through the computer program.
[0035] In an embodiment of the present application, a device control request is received, wherein the device control request is used to request control of a target device deployed in a target area, and multiple gateway devices are also deployed in the target area, and the multiple gateway devices include a first gateway device; in response to the device control request, a second gateway device is obtained from a candidate gateway device, wherein the candidate gateway device includes the first gateway device and a third gateway device that is allowed to control the target device among the multiple gateway devices; the second gateway device is controlled to execute the device control request, that is, when the device control request is obtained, it can be indicated that the target device deployed in the target area is desired to be controlled. In this case, the first gateway device that receives the device control request can obtain a suitable second gateway device from the candidate gateway devices including the first gateway device and the third gateway device that is allowed to control the target device among the multiple gateway devices, and control the second gateway device to execute the device control request, which greatly saves the time required to obtain the second gateway device. The above technical solution solves the problems of low control efficiency of the device in the related technology, and achieves the technical effect of improving the control efficiency of the device. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 is a schematic diagram of a hardware environment of a control method of a device according to an embodiment of the present application;
[0039] Figure 2 is a flow chart of a method for controlling a device according to an embodiment of the present application;
[0040] Figure 3 is a schematic diagram of an operation performed by a terminal device editing control device according to an embodiment of the present application;
[0041] Figure 4 is a schematic diagram of controlling a device through a cloud service according to an embodiment of the present application;
[0042] Figure 5 is a schematic diagram of a control method of a device according to an embodiment of the present application;
[0043] Figure 6 It is a schematic diagram of an application scenario execution according to an embodiment of the present application;
[0044] Figure 7 is a timing diagram of controlling a smart device across a gateway device according to an embodiment of the present application;
[0045] Figure 8 It is a structural block diagram of a control device of a device according to an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0048] According to one aspect of an embodiment of the present application, a method for controlling a device is provided. The method for controlling the device is widely used in smart home, smart home, smart home device ecosystem, smart home ecosystem and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the method for controlling the device can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0049] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0050] In this embodiment, a device control method is provided, which is applied to a first gateway device. Figure 2 is a flow chart of a control method of a device according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0051] Step S202, receiving a device control request, wherein the device control request is used to request control of a target device deployed in a target area, wherein a plurality of gateway devices are also deployed in the target area, and the plurality of gateway devices include the first gateway device;
[0052] Step S204, in response to the device control request, obtaining a second gateway device from the candidate gateway devices, wherein the candidate gateway devices include the first gateway device and a third gateway device among the multiple gateway devices that is allowed to control the target device;
[0053] Step S206: Control the second gateway device to execute the device control request.
[0054] Through the above steps, when a device control request is obtained, it can be indicated that the target device deployed in the target area is desired to be controlled. In this case, the first gateway device that receives the device control request can obtain a suitable second gateway device from the candidate gateway devices including the first gateway device and the third gateway device that is allowed to control the target device among multiple gateway devices, and control the second gateway device to execute the device control request, which greatly saves the time required to obtain the second gateway device. The above technical solution solves the problem of low control efficiency of the device in the related technology and achieves the technical effect of improving the control efficiency of the device.
[0055] In the technical solution provided in the above step S202, each gateway device among the multiple gateway devices deployed in the target area can receive a device control request. It can be, but not limited to, when the first gateway device receives the device control request, it can indicate that it wants to control the target device deployed in the target area. The target device can be, but not limited to, one or more devices deployed in the target area. It can be, but not limited to, when the device control request is used to request control of multiple devices deployed in the target area, batch control of multiple devices deployed in the target area can be achieved, thereby realizing linkage between devices and improving user experience.
[0056] Optionally, in this embodiment, the target area may include but is not limited to an area in a house where the target device and multiple gateway devices are deployed, and the target area may include but is not limited to a rest area (including but not limited to a bedroom, a balcony, and a living room, etc.), an office area (including but not limited to a study and an office, etc.), a cooking area (including but not limited to a kitchen and a dining room, etc.), and the like.
[0057] Optionally, in this embodiment, one or more smart devices may be deployed in the target area but are not limited to, and the one or more smart devices may include but are not limited to the target device. The smart devices may be but are not limited to devices that can connect to the local area network and can be controlled by a gateway device deployed in the target area, and may include but are not limited to: smart air conditioners, smart range hoods, smart refrigerators, smart ovens, smart stoves, smart washing machines, smart water heaters, smart washing equipment, smart dishwashers, smart projection equipment, smart TVs, smart clothes racks, smart curtains, smart audio and video, smart sockets, smart speakers, smart speakers, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart sweeping robots, smart window cleaning robots, smart mopping robots, smart air purification equipment, smart steamers, smart microwave ovens, smart kitchen treasures, smart purifiers, smart water dispensers and smart door locks, etc.
[0058] Optionally, in this embodiment, the target device and the gateway device deployed in the target area can be connected via, but not limited to, WIFI, Bluetooth gateway, Zigbee (Zigbee protocol) protocol, etc., thereby achieving control of the target device through the gateway device.
[0059] In the technical solution provided in the above step S204, when the first gateway device receives the device control request, it can indicate that it hopes to control the target device deployed in the target area. In this case, the first gateway device can allocate a suitable gateway device to the target device from all selectable gateway devices deployed in the target area, thereby avoiding the search for a suitable gateway device through cloud server calculation, saving the time required for transmitting the device control request to the cloud server, waiting for the cloud server to complete the calculation, and sending the device control request to the gateway device calculated by the cloud server. At the same time, it also avoids the failure of transmitting the device control request to the corresponding gateway device due to poor network or network disconnection, thereby greatly improving the control efficiency of the device.
[0060] Optionally, in this embodiment, the candidate gateway devices may include but are not limited to a first gateway device that receives a device control request and a third gateway device that is allowed to control the target device, etc. Each gateway device has a corresponding device that is allowed to be controlled by the gateway device. The devices controlled by each gateway device may include but are not limited to different, identical, or partially identical devices, etc., thereby achieving control of smart devices deployed in the target area through multiple gateway devices deployed in the target area.
[0061] In an exemplary embodiment, the second gateway device may be obtained from the candidate gateway devices in the following manner, but is not limited to: obtaining a gateway that is allowed to control the target device from the multiple gateway devices as the third gateway device; in a case where the third gateway device includes the first gateway device, determining the first gateway device as the second gateway device; in a case where the third gateway device does not include the first gateway device, obtaining the second gateway device from the third gateway device.
[0062] Optionally, in this embodiment, when the third gateway device includes the first gateway device, the first gateway device can be determined as the second gateway device, but is not limited to. That is, when the gateway device allowed to control the target device includes the first gateway device that receives the device control request, the first gateway device may directly determine the first gateway device as a suitable gateway device for controlling the target device without assigning a gateway device to the target device, thereby greatly reducing the time required to obtain a suitable gateway device for controlling the target device and improving the efficiency of controlling the target device.
[0063] Optionally, in this embodiment, when the third gateway device does not include the first gateway device, the first gateway device may, but is not limited to, obtain a suitable gateway device from gateway devices that are allowed to control the target device to control the target device, thereby avoiding transmitting the device control request to the cloud, calculating the suitable gateway device through the cloud, and then sending the device control request to the corresponding gateway device. Instead, the first gateway device that receives the device control request allocates a suitable gateway device to the target device, converting the remote operation of the cloud into a local operation on the gateway device, greatly improving the efficiency of obtaining a suitable gateway device.
[0064] In an exemplary embodiment, obtaining the second gateway device from the third gateway device may include, but is not limited to, one of the following situations:
[0065] Scenario 1: A gateway device whose calling frequency meets a target calling condition is obtained from the third gateway device as the second gateway device.
[0066] Optionally, in this embodiment, a gateway device whose calling frequency meets the target calling condition can be directly obtained from the third gateway device that is allowed to control the target device as the second gateway device, but is not limited to the calling frequency. The calling frequency can be obtained from the historical calling data of each gateway device in the third gateway device, but is not limited to the historical calling data. This enables the acquisition of a suitable gateway device directly based on the calling frequency in the historical calling data of each gateway device in the third gateway device without other data, thereby reducing the complexity of acquiring the second gateway device.
[0067] Scenario 2: Detect the calling status of each of the third gateway devices; obtain the calling status to indicate the fourth gateway device currently allowed to be called by the first gateway device; obtain the gateway device whose calling frequency meets the target calling condition from the fourth gateway device as the second gateway device.
[0068] Optionally, in this embodiment, it is possible but not limited to obtaining a fourth gateway device whose calling status is to allow it to be called by the first gateway device from the third gateway device, and then obtaining a gateway device whose calling frequency meets the target calling condition from the fourth gateway device as the second gateway device. This method can ensure that the obtained second gateway device can currently be called by the first gateway device, avoiding the acquisition of a gateway device that cannot currently be called by the first gateway device, which results in wasting more time to obtain other gateway devices from the third gateway device, thereby improving the success rate of device control.
[0069] In an exemplary embodiment, the sixth gateway device can be obtained in the following manner but is not limited to: if the second gateway device is not obtained, the fifth gateway device corresponding to the target device is obtained from the smart devices and gateway devices with a corresponding relationship through the cloud service; a gateway device whose calling frequency meets the target calling condition is obtained from the fifth gateway device as the sixth gateway device through the cloud service; and the sixth gateway device is controlled through the cloud service to execute the device control request.
[0070] Optionally, in this embodiment, the first gateway device may, but is not limited to, obtain the second gateway device from the candidate gateway devices, or may not obtain the second gateway device from the candidate gateway devices; it may, but is not limited to, when the first gateway device does not obtain the second gateway device from the candidate gateway devices, the first gateway device may, but is not limited to, obtain a gateway device whose calling frequency meets the target calling condition from the fifth gateway device corresponding to the target device through the cloud service as the sixth gateway device; the first gateway device may, but is not limited to, control the sixth gateway device through the cloud service to execute the device control request. This achieves that when the first gateway device cannot control the target device and does not obtain the second gateway device from the gateway device that is allowed to control the target device, the cloud service can be used to select a suitable sixth gateway device for the target device, thereby improving the success rate of device control.
[0071] Optionally, in this embodiment, when the user is not at home but wants to control the smart home devices at home, the user can edit the operations performed by the desired controlled devices by triggering application software, applets, web pages, etc. installed on mobile phones, computers, tablets, etc., but is not limited to the above methods. Figure 3 is a schematic diagram of an operation performed by a terminal device editing control device according to an embodiment of the present application, such as Figure 3 As shown, the user can, but is not limited to, edit the operation (i.e., the above-mentioned target operation) performed by the air conditioner (i.e., the above-mentioned target device) deployed in the bedroom (i.e., the above-mentioned target area) that is desired to be controlled on the application interface of the application software installed on the mobile phone. Function plug-ins including power on, power off, operation model adjustment, operation temperature adjustment, operation wind speed adjustment, and operation wind direction adjustment can be displayed on the application interface of the air conditioner, but are not limited to. The air conditioner can be turned on by, but is not limited to, clicking the power on function plug-in first, and then clicking the operation model adjustment function plug-in to adjust the operation mode of the air conditioner to the cooling mode. This enables users to conveniently control smart devices without the need for users to approach the device to be controlled, greatly improving the user's operating experience.
[0072] Optionally, in this embodiment, it is possible but not limited to initiate a device control request to the cloud service to control the device according to the operation performed by the user editing the target device on a terminal device such as a mobile phone, computer or tablet. When the cloud service receives the device control request, it can allocate a gateway device whose calling frequency meets the target calling condition to the device. Figure 4 is a schematic diagram of controlling a device through a cloud service according to an embodiment of the present application, such as Figure 4 As shown, it is possible but not limited to obtain the gateway device that executes the device control request (i.e., the sixth gateway device mentioned above) from the gateway device that allows the execution of the device control request (i.e., the fifth gateway device mentioned above) through the domain model deployed in the LOT (Lot Of Things, Internet of Things) cloud (i.e., the cloud service mentioned above) and send the device control request to the corresponding gateway device through the cloud edge channel, thereby controlling the device to execute the target operation carried in the device control request. In this way, remote control of smart devices is achieved, which improves the user's control experience.
[0073] In the technical solution provided in the above step S206, it can be but not limited to that when the first gateway device obtains the device control request, it can indicate that it wants to control the target device deployed in the target area. In this case, the first gateway device can obtain the second gateway device from the candidate gateway devices. The second gateway device can be but not limited to the first gateway device, or from a third gateway device. The first gateway device can be but not limited to controlling the second gateway device to execute the device control request.
[0074] In an exemplary embodiment, controlling the second gateway device to execute the device control request may include but is not limited to the following situations:
[0075] Scenario 1: When the second gateway device comes from the third gateway device, the device control request is sent to the second gateway device.
[0076] Optionally, in this embodiment, it is possible but not limited to the case where the second gateway device comes from a third gateway device, that is, the gateway devices allowed to control the target device do not include the first gateway device. In this case, the first gateway device can send a device control request to the second gateway device, thereby achieving coordination and cooperation between gateway devices across gateway devices, thereby completing the control of the target device.
[0077] Scenario 2: When the second gateway device is the first gateway device, the target device is controlled to execute the target operation requested by the device control request.
[0078] Optionally, in this embodiment, it is possible but not limited to the case where the second gateway device is the first gateway device, that is, the gateway device allowed to control the target device includes the first gateway device that receives the device control request. In this case, the first gateway device can be directly controlled to perform the target operation requested by the device control request without sending the device control request to other gateway devices, which greatly saves the time required to send the device control request to the corresponding gateway device and improves the efficiency of device control.
[0079] In an exemplary embodiment, an indication message may be sent to a device that initiates a device control request in the following manner, but is not limited to: receiving a confirmation message returned by the second gateway device or the target device; and when the confirmation message is used to indicate that the device control request is successfully executed, sending indication information to the device that initiates the device control request, wherein the indication information is used to indicate that the device control request is successfully executed.
[0080] Optionally, in this embodiment, the device that initiates the device control request may include but is not limited to a terminal device (including but not limited to a mobile phone, a computer or a tablet, etc.), a gateway device and a smart device deployed with a gateway function (including but not limited to: a smart speaker, a smart speaker, etc.). It may be determined that the device control request has been received when, but not limited to, the user expresses the language in which he or she wishes to control the device, or clicks on a control plug-in displayed on the screen of the gateway device, or by triggering software, a web page or a mini-program deployed on the terminal device.
[0081] Optionally, in this embodiment, the first gateway device may receive a confirmation message returned by the second gateway device when sending a device control request to the second gateway device, but is not limited to; or, when controlling the target device to perform the target operation requested by the device control request, the first gateway device receives a confirmation message returned by the target device. When the confirmation message is used to indicate that the device control request is successfully executed, the successful execution indication information may be, but is not limited to, broadcasted by voice, or displayed on a mobile phone, tablet or other terminal device, or displayed on the first gateway device. This enables timely notification of the user's device control request execution status, making it easier for the user to understand the control result of the desired device in real time.
[0082] In an exemplary embodiment, after controlling the second gateway device to execute the device control request, and in the case where controlling the second gateway device to execute the device control request fails, controlling other suitable gateway devices to execute the device control request may include, but is not limited to, one of the following situations:
[0083] Scenario 1: Obtain a seventh gateway device from other gateway devices in the third gateway device except the second gateway device; and control the seventh gateway device to execute the device control request.
[0084] Optionally, in this embodiment, in the event that the control of the second gateway device to execute the device control request fails, the second gateway device may be controlled again to execute the device control request within a specific time (may be but not limited to 30 seconds, or 40 seconds or 1 minute, etc.) or a specific number of times (may be but not limited to 3 times, 4 times or 5 times, etc.); if the control of the second gateway device still fails within the specific time or the specific number of times, the seventh gateway device may be obtained from other gateway devices in the third gateway device except the second gateway device, and the seventh gateway device may be controlled to execute the device control request, but is not limited to.
[0085] Optionally, in this embodiment, in the event that the control of the second gateway device to execute the device control request fails, the seventh gateway device can be obtained, but is not limited to, directly from other gateway devices in the third gateway device except the second gateway device, without having to retry controlling the second gateway device of the network, thereby avoiding repeated attempts to recontrol the second gateway device to execute the device control request but ultimately failing to control the second gateway device, thereby improving the user experience.
[0086] Scenario 2: Obtain and control the eighth gateway device from the multiple gateway devices through cloud service to execute the device control request.
[0087] Optionally, in this embodiment, in the case where the control of the second gateway device to execute the device control request fails, an eighth gateway device may be obtained from multiple gateway devices deployed in the target area through a cloud service, but is not limited to the second gateway device, or other gateway devices among the multiple gateway devices. The eighth gateway device is controlled to execute the device control request. In this way, in the case where the first gateway device fails to control the second gateway device to execute the device control request, a suitable eighth gateway device may be selected through the cloud service and the eighth gateway device may be controlled to execute the device control request.
[0088] In order to better understand the control process of the above-mentioned device, the control process of the above-mentioned device is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0089] In this embodiment, a method for controlling a device is provided. Figure 5 is a schematic diagram of a control method of a device according to an embodiment of the present application, such as Figure 5As shown, the target area may be but not limited to having gateway device 1, gateway device 2, and gateway device 3 (i.e., the above-mentioned multiple gateway devices) deployed, gateway device 1 may be but not limited to allowing control of smart device 1, smart device 2, and smart device 3, gateway device 2 may be but not limited to allowing control of smart device 2 and smart device 3, and gateway device 3 may be but not limited to allowing control of smart device 4, smart device 5, ..., smart device n. uSDK (Software Development Kit) and Smart Device may be but not limited to being deployed on gateway devices 1 to 3, and Smart Device may be compatible with gateway devices 1 to 3 and may interact with terminal devices of different operating systems, and uSDK may be but not limited to being used for gateway devices to interact with various models of smart devices.
[0090] The user can initiate a device control request that carries the control of smart device 1 (i.e., the target device mentioned above) by, but not limited to, clicking on the application software installed on the mobile phone, or by voice interaction with the smart speaker. In this case, if the small loop of the gateway device 1 currently used to control the smart device 1 is online (i.e., the gateway device 1 can be directly called locally), then the device control request can be directly transmitted to the gateway device 1, but not limited to. If the small loop of the current gateway device 1 is not online, then the device control request can be sent to the LOT (Lot Of Things, Internet of Things) cloud (i.e., the cloud service mentioned above), and the domain model in the cloud service can be used to calculate the gateway device that executes the device control request based on the smart devices allowed to be controlled by each gateway device, but not limited to, and the device control request can be sent to the corresponding gateway device through the cloud edge channel, but not limited to.
[0091] In addition, users can also set application scenarios for batch control of multiple smart devices on mobile phones, computers, tablets and other terminal devices, such as: home scene (including but not limited to controlling smart lamps to turn on, smart TVs to adjust to sports news channels, smart air conditioners to adjust to 26°C cooling mode, etc.), sleep scene (including but not limited to controlling smart lamps to turn off, smart curtains to turn off, smart speakers to turn off, etc.), and going out scene (including but not limited to controlling smart lamps to turn off, smart gas stoves to turn off, smart door locks to turn off, etc.) and other scenes. It is possible but not limited to adding, deleting, adjusting the operations performed by the control devices on mobile phones, computers, tablets and other terminal devices, and it is possible but not limited to synchronizing multiple application scenarios to the scene center on the LOT (Lot Of Things, Internet of Things) cloud through an API (Application Interface) gateway. When a user triggers an application scenario on a mobile phone, computer, tablet or other terminal device, if the small loop of the gateway device that controls the smart devices in the application scenario is online, it is possible but not limited to directly batch control multiple gateway devices through the small loop channel, thereby realizing batch control of multiple smart devices included in the application scenario. If the small loop of the gateway device that controls the smart device in the application scenario is not online, the device control request can be, but is not limited to, sent to the LOT cloud. The domain model deployed in the LOT cloud can be, but is not limited to, obtaining the gateway device used to control multiple smart devices in the application scenario based on the list of smart devices corresponding to each gateway device, and then sending the device control request to the corresponding gateway device through the cloud edge channel.
[0092] Each gateway device deployed in the target area can trigger all application scenarios, and each gateway device corresponds to a list of application scenarios that are allowed to be executed. Figure 6 is a schematic diagram of an application scenario execution according to an embodiment of the present application, such as Figure 6 As shown, the device APP (Application) can but is not limited to triggering a request to execute application scenario 1 (i.e., the above-mentioned device control request) on gateway device A (i.e., the first gateway device mentioned above). In this case, the edge scene SDK in gateway device A will first determine the location of application scenario 1, that is, determine whether gateway device A allows the execution of application scenario 1. If the current gateway device 1 allows the execution of application scenario 1, it can but is not limited to directly executing application scenario 1 in gateway device A, and after execution, report logs to the cloud scene management in the LOT cloud (i.e., the above-mentioned cloud service).
[0093] If gateway device A does not allow the execution of application scenario 1, in this case, gateway device A can obtain other gateway devices B (i.e., the second gateway device mentioned above, gateway device B can be but not limited to being connected to the same local area network as gateway device A) that are currently allowed to execute application scenario 1 based on the list of application scenarios allowed to be executed corresponding to each gateway device, and can but is not limited to sending a request to execute application scenario 1 to the Smart Device deployed in gateway device B through USDK, and the Smart Device sends the request to the edge scenario management in the edge scenario SDK deployed in gateway device B. After the edge scenario is executed, the log is reported to the cloud scene management in the LOT cloud (i.e., the cloud service mentioned above).
[0094] If gateway device A is not allowed to execute application scenario 1, in this case, gateway device A can obtain other gateway devices B that are currently allowed to execute application scenario 1 based on the application scenarios that each gateway device is allowed to execute. However, if the current gateway device B fails or is disconnected, etc., resulting in the failure of gateway device A to control gateway device B, gateway device A can select a suitable gateway device (i.e., the seventh gateway device mentioned above) from the gateway devices other than gateway device B that are allowed to execute the application scenario 1, or can obtain other gateway devices (i.e., the eighth gateway device mentioned above) from the gateway devices that are allowed to execute the application scenario through a large loop (i.e., the cloud service mentioned above).
[0095] If gateway device A does not allow the execution of application scenario 1, and gateway device 1 has not obtained a gateway device that allows the execution of application scenario 1, in this case, it is possible but not limited to directly obtaining a gateway device that allows the execution of the application scenario (i.e., the fifth gateway device mentioned above) through the LOT cloud (i.e., the above-mentioned cloud service), and it is possible but not limited to obtaining a gateway device for executing the request (i.e., the sixth gateway device mentioned above) from the fifth gateway device, and sending the request to the corresponding gateway device through the cloud edge channel of the LOT cloud.
[0096] In order to better understand the control process of the above-mentioned device, the control process of the above-mentioned device is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0097] In this embodiment, a method for controlling a device is provided. Figure 7 is a timing diagram of a cross-gateway device controlling a smart device according to an embodiment of the present application, such as Figure 7As shown, when the user triggers the APP installed on the mobile phone or the user interacts with the smart speaker deployed with the gateway device function by voice, the gateway device 1 (i.e., the first gateway device mentioned above) may, but is not limited to, obtain a device control request for requesting to control the smart device 1 (i.e., the target device mentioned above). In this case, the gateway device 1 may, but is not limited to, obtain the gateway device (i.e., the third gateway device mentioned above) that is allowed to control the smart device 1 according to the smart devices allowed to be controlled by each gateway device. When the third gateway device does not include the gateway device 1, it may, but is not limited to, obtain the gateway device 2 (i.e., the second gateway device mentioned above) from the third gateway device, detect whether the small loop of the gateway device 2 is currently online, that is, detect whether the current gateway device 2 is allowed to be called by the gateway device 1. If the current small loop of the gateway device 2 is not online, that is, the current gateway device 2 is not allowed to be called by the gateway device 1, it may, but is not limited to, send the device control request to the gateway device 2 through the large loop (i.e., the cloud service mentioned above), thereby completing the control of the smart device 1 and feeding back the device control result to the mobile phone APP.
[0098] If the current small loop of gateway device 2 is online, that is, the current gateway device 2 allows being called by gateway device 1, in this case, the device control request can be sent directly to gateway device 2 but is not limited to it. After gateway device 2 successfully controls smart device 2 to perform the operation carried in the device control request (i.e. the above-mentioned one), it can return the device control result (i.e. the above-mentioned indication information) to the mobile phone APP for user viewing.
[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0100] Figure 8 is a structural block diagram of a control device of a device according to an embodiment of the present application, which is applied to a first gateway device, such as Figure 8 As shown, including:
[0101] A first receiving module 802 is used to receive a device control request, wherein the device control request is used to request control of a target device deployed in a target area, wherein a plurality of gateway devices are also deployed in the target area, and the plurality of gateway devices include the first gateway device;
[0102] A first acquisition module 804 is configured to respond to the device control request and acquire a second gateway device from candidate gateway devices, wherein the candidate gateway devices include the first gateway device and a third gateway device among the multiple gateway devices that is allowed to control the target device;
[0103] The first processing module 806 is configured to control the second gateway device to execute the device control request.
[0104] Through the above embodiment, when a device control request is obtained, it can be indicated that the target device deployed in the target area is desired to be controlled. In this case, the first gateway device that receives the device control request can obtain a suitable second gateway device from the candidate gateway devices including the first gateway device and the third gateway device that is allowed to control the target device among multiple gateway devices, and control the second gateway device to execute the device control request, which greatly saves the time required to obtain the second gateway device. The above technical solution solves the problem of low control efficiency of the device in the related technology and achieves the technical effect of improving the control efficiency of the device.
[0105] Optionally, the first acquisition module includes:
[0106] A first acquiring unit, configured to acquire a gateway that is allowed to control the target device from the plurality of gateway devices as the third gateway device;
[0107] a determining unit, configured to determine the first gateway device as the second gateway device when the third gateway device includes the first gateway device;
[0108] A second acquiring unit is configured to acquire the second gateway device from the third gateway device when the third gateway device does not include the first gateway device.
[0109] Optionally, the second acquiring unit includes one of the following:
[0110] Acquire a gateway device whose calling frequency meets a target calling condition from the third gateway device as the second gateway device;
[0111] Detect the calling status of each of the third gateway devices; obtain the calling status to indicate the fourth gateway device currently allowed to be called by the first gateway device; and obtain a gateway device whose calling frequency meets the target calling condition from the fourth gateway device as the second gateway device.
[0112] Optionally, the first processing module includes:
[0113] a sending unit, configured to send the device control request to the second gateway device in the case that the second gateway device comes from the third gateway device;
[0114] A processing unit is used to control the target device to perform the target operation requested by the device control request when the second gateway device is the first gateway device.
[0115] Optionally, the device further comprises:
[0116] A second receiving module, configured to receive a confirmation message returned by the second gateway device or the target device after sending the device control request to the second gateway device or controlling the target device to perform the target operation requested by the device control request;
[0117] The sending module is used to send indication information to the device that initiated the device control request when the confirmation message is used to indicate that the device control request is successfully executed, wherein the indication information is used to indicate that the device control request is successfully executed.
[0118] Optionally, the device further comprises:
[0119] A second acquisition module, configured to, after acquiring the second gateway device from the candidate gateway devices, acquire a fifth gateway device corresponding to the target device from the smart devices and gateway devices having a corresponding relationship through a cloud service if the second gateway device is not acquired;
[0120] A third acquisition module, configured to acquire, through the cloud service, from the fifth gateway device a gateway device whose calling frequency meets a target calling condition as a sixth gateway device;
[0121] An execution module is used to control the sixth gateway device to execute the device control request through the cloud service.
[0122] Optionally, the device further comprises one of the following:
[0123] a fourth acquisition module, configured to, after controlling the second gateway device to execute the device control request, acquire a seventh gateway device from other gateway devices in the third gateway device except the second gateway device if controlling the second gateway device to execute the device control request fails; and control the seventh gateway device to execute the device control request;
[0124] The second processing module is used to obtain and control the eighth gateway device to execute the device control request from the multiple gateway devices through the cloud service.
[0125] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0126] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0127] S1, receiving a device control request, wherein the device control request is used to request control of a target device deployed in a target area, wherein a plurality of gateway devices are also deployed in the target area, and the plurality of gateway devices include the first gateway device;
[0128] S2, in response to the device control request, obtaining a second gateway device from the candidate gateway devices, wherein the candidate gateway devices include the first gateway device and a third gateway device among the multiple gateway devices that is allowed to control the target device;
[0129] S3: Control the second gateway device to execute the device control request.
[0130] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0131] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0132] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0133] S1, receiving a device control request, wherein the device control request is used to request control of a target device deployed in a target area, wherein a plurality of gateway devices are also deployed in the target area, and the plurality of gateway devices include the first gateway device;
[0134] S2, in response to the device control request, obtaining a second gateway device from the candidate gateway devices, wherein the candidate gateway devices include the first gateway device and a third gateway device among the multiple gateway devices that is allowed to control the target device;
[0135] S3: Control the second gateway device to execute the device control request.
[0136] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0137] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0138] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0139] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for controlling a device, It is characterized in that Applied to the first gateway device, comprising: Receiving a device control request through the first gateway device, wherein the device control request is used to request control of a target device deployed in a target area, wherein a plurality of gateway devices are also deployed in the target area, and the plurality of gateway devices include the first gateway device; In response to the device control request, obtaining a second gateway device from candidate gateway devices, wherein the candidate gateway devices include the first gateway device and a third gateway device among the multiple gateway devices that is allowed to control the target device; Controlling the second gateway device to execute the device control request; Wherein, obtaining the second gateway device from the candidate gateway devices includes: obtaining a gateway device allowed to control the target device from the multiple gateway devices as the third gateway device; in a case where the third gateway device includes the first gateway device, determining the first gateway device as the second gateway device; in a case where the third gateway device does not include the first gateway device, obtaining the second gateway device from the third gateway device.
2. The method according to claim 1, It is characterized in that The acquiring the second gateway device from the third gateway device comprises one of the following: Acquire a gateway device whose calling frequency meets the target calling condition from the third gateway device as the second gateway device; Detecting the calling status of each of the third gateway devices; The calling state is obtained to indicate a fourth gateway device that is currently allowed to be called by the first gateway device; and a gateway device whose calling frequency meets a target calling condition is obtained from the fourth gateway device as the second gateway device.
3. The method according to claim 1, It is characterized in that The controlling the second gateway device to execute the device control request includes: In a case where the second gateway device comes from the third gateway device, sending the device control request to the second gateway device; In a case where the second gateway device is the first gateway device, the target device is controlled to execute the target operation requested by the device control request.
4. The method according to claim 3, It is characterized in that After sending the device control request to the second gateway device, or controlling the target device to perform the target operation requested by the device control request, the method further includes: Receiving a confirmation message returned by the second gateway device or the target device; In a case where the confirmation message is used to indicate that the device control request is executed successfully, indication information is sent to the device that initiated the device control request, wherein the indication information is used to indicate that the device control request is executed successfully.
5. The method according to claim 1, It is characterized in that After acquiring the second gateway device from the candidate gateway devices, the method further includes: If the second gateway device is not obtained, obtaining a fifth gateway device corresponding to the target device from smart devices and gateway devices having a corresponding relationship through a cloud service; Acquire, through the cloud service, from the fifth gateway device a gateway device whose calling frequency meets a target calling condition as a sixth gateway device; The sixth gateway device is controlled by the cloud service to execute the device control request.
6. The method according to claim 1, It is characterized in that After controlling the second gateway device to execute the device control request, in the case where controlling the second gateway device to execute the device control request fails, the method further includes one of the following: Acquire a seventh gateway device from other gateway devices in the third gateway device except the second gateway device; control the seventh gateway device to execute the device control request; The eighth gateway device is obtained from the plurality of gateway devices through the cloud service and is controlled to execute the device control request.
7. A control device for an equipment, It is characterized in that Applied to the first gateway device, comprising: A first receiving module, configured to receive a device control request through the first gateway device, wherein the device control request is used to request control of a target device deployed in a target area, wherein a plurality of gateway devices are further deployed in the target area, and the plurality of gateway devices include the first gateway device; A first acquisition module, configured to respond to the device control request and acquire a second gateway device from candidate gateway devices, wherein the candidate gateway devices include the first gateway device and a third gateway device among the multiple gateway devices that is allowed to control the target device; A first processing module, configured to control the second gateway device to execute the device control request; Among them, the first acquisition module includes: a first acquisition unit, used to acquire a gateway allowed to control the target device from the multiple gateway devices as the third gateway device; a determination unit, used to determine the first gateway device as the second gateway device when the third gateway device includes the first gateway device; and a second acquisition unit, used to acquire the second gateway device from the third gateway device when the third gateway device does not include the first gateway device.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 6 when executed.
9. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
