Device control method, communication system, gateway device and controlled device
By integrating the gateway function in the first device of the smart home system and using scene identification for device control, the problem of router failure caused by device uncontrollable is solved, and the user experience and control response speed is improved.
Patent Information
- Application Number
- CN202311533076.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-15
- Publication Date
- 2025-05-16
AI Technical Summary
In existing smart home systems, the control of smart devices relies on network devices such as routers, which causes the smart devices to be unable to be controlled once the router fails, affecting the user experience.
By integrating the gateway function in the first device, the first device can communicate directly with the second device and control it through scene identification without transmitting specific control instructions, and can still be controlled normally even in the event of a router failure.
It realizes that the smart device can still be controlled normally when the router fails, improves the user experience, and improves the control response speed by reducing the amount of data transmission.
Smart Images

Figure CN120017433A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a device control method, a communication system, a gateway device and a controlled device. Background Art
[0002] Smart home technology can provide users with a more convenient lifestyle. Based on smart home technology, users can intelligently control smart home appliances at home, such as controlling the start of smart rice cookers at home on their mobile phones, controlling the TV to play corresponding programs through voice, and controlling the switch of smart lights through smart switch panels.
[0003] Taking the control of the switch of the smart light through the smart switch panel as an example, the entire implementation process can be implemented through router A, gateway device B, smart switch panel C and smart light D. Among them, the smart switch panel C and smart light D are connected to router A through gateway device B respectively. The control information or control instructions corresponding to the buttons on the smart switch panel C are saved in router A. In addition, router A receives the key event reported by the smart switch panel C through gateway device B, determines the control information or control instruction corresponding to the key event, and then uses the control instruction through gateway device B to control the smart light D to turn on or off.
[0004] In the above process of controlling the smart light, the control function is mainly dependent on router A. However, once router A fails, the smart light D cannot obtain control instructions and cannot be controlled, which will affect the user experience. Summary of the invention
[0005] The present application provides a device control method, a communication system, a gateway device and a controlled device, which do not rely on other devices other than the gateway device to control the controlled device. In addition, the controlled device can achieve the controlled process by obtaining a scene identifier from the gateway device. Even if a network device such as a router fails, the controlled device can still be controlled, thereby improving the user experience.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, a device control method is provided, which can be applied to a communication system. The communication system includes a first device and a second device, the first device having a gateway function, and the gateway function is used to establish a communication connection between the first device and the second device. In the method, in response to a first key event corresponding to a first key acquired, the first device acquires a first scene identifier corresponding to the first key event, and the first device sends the first scene identifier to the second device based on the gateway function, wherein the second device is a controlled device in the scene indicated by the first scene identifier. The second device determines and executes the first task based on the received first scene identifier.
[0008] In the above method, the first device itself has a gateway function, or the first device itself is a gateway device (i.e., has a gateway function), and after receiving a key event of a first key, the first device sends a scene identifier corresponding to the key event to the corresponding second device. The second device can determine the corresponding first task according to the scene identifier and execute it, thereby completing a control process of the first key on the second device.
[0009] It can be seen that the communication between the first device and the second device does not require the transmission of specific control instructions, and there is no need for network devices such as routers to participate in the control process. Even if network devices such as routers fail, it will not affect the control process of the first button for the second device, thereby improving the user experience.
[0010] In addition, the scene identifier only needs to be transmitted between the first device and the second device. In this way, the amount of transmitted data is reduced, the speed of data transmission can be increased, and the response speed of the second device during the control process can be increased, which can also improve the user experience.
[0011] In an implementation manner of the first aspect, in response to the acquired second key event corresponding to the first key, the first device acquires a second scene identifier corresponding to the second key event, and the first device sends the second scene identifier to the second device based on a gateway function, wherein the second device is also a controlled device in the scene indicated by the second scene identifier. The second device determines and executes a second task based on the received second scene identifier, wherein the second task is different from the first task.
[0012] In this implementation, the first button can also correspond to the second button event, that is, the first button can also trigger the second button event, so that the first device can obtain the second scene identifier and control the second device to perform the second task by sending the second scene identifier to the second device. In this way, the purpose of controlling a controlled device to perform different tasks can be achieved with one button.
[0013] The second task is different from the first task. For example, the first task is to turn on the light, and the second task is to turn off the light. Then, one button can be used to control the second device to turn on and off the light respectively.
[0014] In an implementation of the first aspect, the communication system further includes a third device, and the gateway function of the first device is also used to establish a communication connection between the first device and the third device. Furthermore, in response to the acquired second key event corresponding to the first key, the first device acquires the second scene identifier corresponding to the second key event, and sends the second scene identifier to the third device based on the gateway function, wherein the third device is a controlled device in the scene indicated by the second scene identifier. The third device determines and executes the second task based on the received second scene identifier, wherein the second task is different from the first task.
[0015] In this implementation, the first button can also trigger the second button event, so that the first device can obtain the second scene identifier. In addition, the first device can also control the third device to perform the second task by sending the second scene identifier to the third device. In this way, one button can be used to control multiple controlled devices (such as the second device and the third device) to perform different tasks.
[0016] In an implementation manner of the first aspect, the first device sends a first scene identifier to a third device based on a gateway function, wherein the third device is also a controlled device in the scene indicated by the first scene identifier. The third device determines and executes a fourth task based on the received first scene identifier, wherein the fourth task is the same as the first task, or the fourth task is different from the first task.
[0017] In this implementation, the first device can not only send the first scene identifier to the second device, but also send the first scene identifier to the third device, and the second device and the third device respectively determine and execute different tasks. In this way, the purpose of controlling multiple controlled devices (such as the second device and the third device) to execute different tasks by one button can also be achieved.
[0018] In an implementation manner of the first aspect, in response to the acquired third key event corresponding to the second key, the first device acquires a third scene identifier corresponding to the third key event, and sends the third scene identifier to the second device based on the gateway function, wherein the second device is also a controlled device in the scene indicated by the third scene identifier. The second device determines and executes a third task based on the received third scene identifier, wherein the third task is the same as the first task, or the third task is different from the first task.
[0019] In this implementation, the first device can send the scene identifier corresponding to the key event triggered by multiple keys (such as the first key and the second key) to the second device, so that the second device can perform the task corresponding to the scene identifier. In this way, the purpose of multiple keys controlling a controlled device can be achieved, and the controlled device can be controlled to perform the same or different tasks.
[0020] In an implementation manner of the first aspect, the communication system further includes a fourth device, which establishes communication connections with the first device and the second device respectively. When the first device is unavailable, the fourth device obtains a first key event corresponding to the first key, and in response to the first key event, obtains a first scene identifier corresponding to the first key event, and sends the first scene identifier to the second device.
[0021] In this implementation, when the first device fails or is unavailable, the first button can also control the second device through the fourth device. That is, when the first device is unavailable, the second device can also be controlled, thereby improving the user experience.
[0022] In an implementation method of the first aspect, the above-mentioned first task, second task, third task, fourth task, etc. may respectively include controlling the second device to turn on or off, or adjusting the attribute parameter value of the second device, wherein the attributes of the second device include one or more of brightness, temperature, wind speed, and color.
[0023] In an implementable manner of the first aspect, the first device, the second device, the third device, the fourth device, etc. are respectively devices in the whole house smart scene, for example, the first device may be a smart switch, a smart switch panel, a gateway device, etc., and the second device (or the third device, the fourth device) may be a smart light, a smart air conditioner, a smart curtain, etc. And the whole house smart scene may be, for example, a smart home scene, a smart office scene, a smart room scene, a smart hotel scene, etc.
[0024] In a second aspect, a device control method is provided, which is applied to a first device in a communication system, wherein the communication system further includes a second device, and the first device has a gateway function, and the gateway function is used to establish a communication connection between the first device and the second device. In the method, in response to a first key event corresponding to a first key acquired, the first device acquires a first scene identifier corresponding to the first key event; the first device sends the first scene identifier to the second device based on the gateway function, wherein the second device is a controlled device in the scene indicated by the first scene identifier, and the first scene identifier is used to instruct the second device to determine and execute the first task.
[0025] In an implementation method of the second aspect, in response to an acquired second key event corresponding to a first key, the first device acquires a second scene identifier corresponding to the second key event; the first device sends the second scene identifier to the second device based on a gateway function, wherein the second device is also a controlled device in the scene indicated by the second scene identifier, and the second scene identifier is used to instruct the second device to determine and execute a second task, which is different from the first task.
[0026] In an implementation of the second aspect, the communication system further includes a third device, and the gateway function is further used to establish a communication connection between the first device and the third device. In response to the acquired second key event corresponding to the first key, the first device acquires a second scene identifier corresponding to the second key event. The first device sends the second scene identifier to the third device based on the gateway function, wherein the third device is a controlled device in the scene indicated by the second scene identifier, and the second scene identifier is used to instruct the third device to determine and execute a second task, and the second task is different from the first task.
[0027] In an implementation method of the second aspect, the first device sends a first scene identifier to a third device based on a gateway function, wherein the third device is a controlled device in the scene indicated by the first scene identifier, and the first scene identifier is used to instruct the third device to determine and execute a fourth task, and the fourth task is the same as the first task, or the fourth task is different from the first task.
[0028] In an implementation method of the second aspect, in response to a third key event corresponding to the acquired second key, the first device obtains a third scene identifier corresponding to the third key event; the first device sends the third scene identifier to the second device based on the gateway function, wherein the second device is also a controlled device in the scene indicated by the third scene identifier, and the third scene identifier is used to instruct the second device to determine and execute a third task, the third task is the same as the first task, or the third task is different from the first task.
[0029] In a third aspect, a device control method is provided, which is applied to a second device in a communication system, wherein the communication system further includes a first device, the first device having a gateway function, and the gateway function is used to establish a communication connection between the first device and the second device. In the method, the second device receives a first scene identifier sent by the first device, wherein the first scene identifier is obtained by the first device in response to a first key event corresponding to a first key, the first scene identifier corresponds to the first key event, and the second device is a controlled device in the scene indicated by the first scene identifier; the second device determines and executes the first task according to the first scene identifier.
[0030] In an implementation manner of the third aspect, the second device receives a second scene identifier sent by the first device, wherein the second scene identifier is obtained by the first device in response to a second key event corresponding to the first key, the second scene identifier corresponds to the second key event, and the second device is also a controlled device in the scene indicated by the second scene identifier. The second device determines and executes a second task based on the second scene identifier, wherein the second task is different from the first task.
[0031] In an implementation manner of the third aspect, the second device receives a third scene identifier sent by the first device, wherein the third scene identifier is obtained by the first device in response to a third key event corresponding to the second key, the third scene identifier corresponds to the third key event, and the second device is also a controlled device in the scene indicated by the third scene identifier. The second device determines and executes a third task based on the third scene identifier, wherein the third task is the same as the first task, or the third task is different from the first task.
[0032] In an implementation manner of the third aspect, the communication system further includes a fourth device, and the fourth device establishes communication connections with the first device and the second device respectively. When the first device is unavailable, the second device receives a first scene identifier sent by the fourth device, wherein the first scene identifier is obtained by the fourth device in response to a first key event corresponding to the first key.
[0033] In a fourth aspect, a communication system is provided, including a first device and a second device, wherein the first device has a gateway function, and the gateway function is used to establish a communication connection between the first device and the second device.
[0034] The first device is configured to obtain, in response to the obtained first key event corresponding to the first key, a first scene identifier corresponding to the first key event;
[0035] The first device is further configured to send a first scene identifier to a second device based on a gateway function; the second device is a controlled device in the scene indicated by the first scene identifier;
[0036] The second device is used to determine and execute the first task according to the received first scene identifier.
[0037] In a fifth aspect, a gateway device is provided, the gateway device having a gateway function, the gateway function being used to establish a communication connection between the gateway device and a controlled device; the gateway device also includes a memory and one or more processors; the memory is coupled to the processor; wherein computer program code is stored in the memory, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the gateway device executes the device control method as in the second aspect and any one of its implementations.
[0038] In a sixth aspect, a controlled device is provided, comprising a memory and one or more processors; the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the controlled device executes the device control method as in the third aspect and any one of its implementations.
[0039] In the seventh aspect, a computer-readable storage medium is provided, comprising computer instructions, which, when executed on a gateway device, cause the gateway device to execute a device control method as in the second aspect and any of its implementations; or, when executed on a controlled device, cause the controlled device to execute a device control method as in the third aspect and any of its implementations.
[0040] In an eighth aspect, a computer program product is provided. When the computer program product runs on a gateway device, the gateway device executes the device control method as in the second aspect and any one of its implementations; or, when the computer program product runs on a controlled device, the controlled device executes the device control method as in the third aspect and any one of its implementations.
[0041] It can be understood that the beneficial effects that can be achieved by the device control method described in the second aspect, the device control method described in the third aspect, the communication system described in the fourth aspect, the gateway device described in the fifth aspect, the controlled device described in the sixth aspect, the computer-readable storage medium described in the seventh aspect, and the computer program product described in the eighth aspect can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 This is a schematic diagram of a smart switch panel controlling a smart light according to an embodiment of the present application;
[0043] Figure 2 The structure of the communication system shown in the embodiment of the present application is shown in FIG. Figure 1 ;
[0044] Figure 3 The structure of the communication system shown in the embodiment of the present application is shown in FIG. Figure 2 ;
[0045] Figure 4 The structure of the communication system shown in the embodiment of the present application is shown in FIG. Figure 3 ;
[0046] Figure 5 A schematic diagram of a page displayed on a terminal device according to an embodiment of the present application;
[0047] Figure 6 The process diagram of the device control method shown in the embodiment of the present application is as follows Figure 1 ;
[0048] Figure 7 The process diagram of the device control method shown in the embodiment of the present application is as follows Figure 2 ;
[0049] Figure 8 The process diagram of the device control method shown in the embodiment of the present application is as follows Figure 3 ;
[0050] Fig. 9 The process diagram of the device control method shown in the embodiment of the present application is as follows Figure 4 ;
[0051] Fig.10 A schematic diagram of the structure of a gateway device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the differences. At the same time, in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.
[0053] In addition, the business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art can appreciate that with the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0054] In the field of smart home, users can perform intelligent control over smart home appliances in their homes. For example, users can control the start of a smart rice cooker at home on their mobile phones, control the TV to play corresponding programs through voice, and control the switch of smart lights through a smart switch panel.
[0055] For example, using the smart switch panel to control the switch of the smart light, see Figure 1 As shown, the entire implementation process can be implemented through router A, gateway device B, smart switch panel C and smart light D. Among them, the smart switch panel C and the smart light D are connected to router A through gateway device B respectively. The control information or control instructions corresponding to the buttons on the smart switch panel C are saved in router A. In addition, router A receives the key event reported by the smart switch panel C through gateway device B, and determines the control instruction corresponding to the key event according to the saved control instruction, and sends the control instruction to the smart light through gateway device B, so as to control the smart light D to turn on or off according to the current scene.
[0056] In addition, router A can also connect to device E where the target application is located, and the target application is associated with the smart switch panel C. On the setting page of the target application provided by device E, the user can set the control command for each button on the smart switch panel C, so that device E can send the set control command to router A, and router A saves the control command corresponding to each button.
[0057] Exemplarily, the smart lamp D can also be replaced by smart home appliances such as smart curtains and smart air conditioners.
[0058] In the above process of controlling the smart light, the control function is mainly dependent on router A. However, once router A fails, the smart light D cannot obtain control instructions and cannot be controlled, which will affect the user experience.
[0059] Based on the above content, an embodiment of the present application provides a device control method. In the method, the first device has a gateway function, and the gateway function is used to establish a communication connection between the first device and the second device.
[0060] In response to the first key event corresponding to the acquired first key, the first device acquires the first scene identifier corresponding to the first key event, and the first device sends the first scene identifier to the second device based on the gateway function, wherein the second device is a controlled device in the scene indicated by the first scene identifier. The second device determines and executes the first task according to the received first scene identifier.
[0061] In the above method, the first device itself has a gateway function, or the first device itself is a gateway device (i.e., has a gateway function), and after receiving a key event of the first button, the first device sends the scene identifier corresponding to the key event to the corresponding second device. The second device can determine the corresponding first task according to the scene identifier and execute it, thereby completing a control process of the first button on the second device. It can be seen that the communication between the first device and the second device does not require the transmission of specific control instructions, and there is no need for network devices such as routers to participate in the control process. Even if network devices such as routers fail, it will not affect the control process of the first button on the second device, thereby improving the user experience.
[0062] In addition, the scene identifier only needs to be transmitted between the first device and the second device. In this way, the amount of transmitted data is reduced, the speed of data transmission can be increased, and the response speed of the second device during the control process can be increased, which can also improve the user experience.
[0063] The device control method provided in the embodiment of the present application can be applied to a communication system. Figure 2 As shown in (a) of FIG. 1 , the communication system may include a first device 201 and a controlled device 202 . The first device 201 has a gateway function, and the gateway function may establish a communication connection between the first device 201 and the controlled device 202 .
[0064] In the absence of network devices such as routers, the two networks cannot communicate via the Transmission Control Protocol / Internet Protocol (TCP / IP). Even if the two networks are connected to the same switch (or hub), the TCP / IP protocol will determine that the devices in the two networks are in different networks based on the subnet mask. To achieve communication between the two networks, a gateway must be used. In the embodiment of the present application, the first device 201 has a gateway function and can implement the function of a gateway device, or the first device 201 is a gateway device (i.e., has a gateway function), and the first device 201 can communicate with the controlled device 202 through the gateway function.
[0065] In some possible application scenarios, the controlled device 202 may be controlled by a control device including buttons. In addition, the control device may implement a control process of the controlled device 202 through the first device 201 .
[0066] Taking the control device as a button as an example, one button can control one controlled device.
[0067] A key may trigger at least one key event, each key event corresponds to a scene identifier, and a scene identifier may correspond to a task. The controlled device 202 may be a controlled device in a scene indicated by the scene identifier.
[0068] See also Figure 2 As shown in (b), the first device 201 can obtain a key event generated by a key each time, and obtain the scene identifier corresponding to the key event, and send the scene identifier to the controlled device 202 based on the gateway function. The controlled device 202 then determines the corresponding task according to the scene identifier and executes it.
[0069] It can be understood that the first device 201 can send all the scene identifiers corresponding to at least one key event triggered by a key to the controlled device 202. Since each scene identifier can correspond to a different task, it can not only achieve the purpose of one key controlling one controlled device 202, but also achieve the purpose of one key controlling one controlled device 202 to perform different tasks.
[0070] Taking the control device as a button as an example, one button can also control multiple controlled devices.
[0071] In this case, see Figure 2 As shown in (c), there may be multiple controlled devices 202 in the above communication system, for example, including a second device, a third device, etc., and each controlled device 202 can communicate with the first device 201 through the gateway function.
[0072] Among them, a button can trigger at least one button event, and each button event corresponds to a scene identifier, that is, a button can correspond to at least one scene identifier. The first device 201 sends at least one scene identifier corresponding to a button to multiple controlled devices 202 based on the gateway function, and the controlled device 202 determines and executes the corresponding task according to the scene identifier.
[0073] For example, key 1 triggers key event 1, key event 2, and key event 3, and the scene identifiers corresponding to key event 1, key event 2, and key event 3 are scene identifier 1, scene identifier 2, and scene identifier 3. The second device can obtain scene identifier 1 and determine that the corresponding task 1 is executed, and the second device can also obtain scene identifier 2 and determine that the corresponding task 2 is executed; the third device can obtain scene identifier 3 and determine that the corresponding task 3 is executed.
[0074] It is understandable that the first device 201 can send the scene identifiers corresponding to at least one key event triggered by a key to the multiple controlled devices 202, so the purpose of controlling multiple controlled devices 202 by one key can be achieved.
[0075] The above-mentioned scene identification can distinguish the control scenes corresponding to different key events, such as the light-on scene, the light-off scene, etc., and the tasks corresponding to the key events in different control scenes are also different. For example, the task in the light-on scene is to turn on the light, and the task in the light-off scene is to turn off the light. Therefore, the scene identification can also distinguish different tasks.
[0076] In addition, the scene identifier may also indicate the controlled device that performs the corresponding task in the current scene. For example, in the light-on scene and the light-off scene, the controlled device that performs the corresponding task is a smart light.
[0077] Taking the control device as a button as an example, multiple buttons can control one controlled device.
[0078] Among them, a key can trigger at least one key event, and each key event corresponds to a scene identifier. Figure 2 As shown in (d), the first device 201 sends scene identifiers corresponding to key events respectively triggered by multiple keys to the controlled device 202 based on the gateway function, and the controlled device 202 determines and corresponds to the task according to the scene identifier.
[0079] For example, key 1 triggers key event 1, key 2 triggers key event 4, key event a corresponds to scene identifier 1, and key event d corresponds to scene identifier 4. The controlled device 202 can obtain scene identifier 1 and determine the corresponding task 1 to execute, and the controlled device 202 can also obtain scene identifier 4 and determine the corresponding task 4 to execute.
[0080] It is understandable that the first device 201 can send the scene identifiers corresponding to the key events triggered by multiple keys to one controlled device 202, so the purpose of controlling one controlled device 202 with multiple keys can be achieved.
[0081] The "button" in the above embodiment can be a physical button or a virtual button. The user can trigger a key event by pressing a physical button, or the user can trigger a key event by clicking a virtual button. The specific triggering method is not specifically limited in the embodiments of the present application.
[0082] And, the control device may include at least one button, for example, see Figure 3 As shown in (a) of FIG. 1 , the first device 201 may be connected to the control device, thereby obtaining a key event corresponding to a key from the control device. Alternatively, the control device may also be integrated into the first device 201, or the first device 201 may serve as the control device. For example, see Figure 3 As shown in (b), the first device 201 may include at least one button. For example, the first device 201 may be a smart switch with a gateway function, a smart switch panel, etc.
[0083] In some possible application scenarios, the communication system may further include a fourth device. The fourth device may be the control device in the above embodiment, or the fourth device may be a device other than the first device 201 that can send a scene identifier, and the fourth device may establish communication connections with the first device 201, the controlled device 202, etc. of the communication system, respectively. When the first device 201 is unavailable, the fourth device may obtain a key event and a corresponding scene identifier, communicate with the controlled device 202, and send the scene identifier to the controlled device 202.
[0084] Exemplarily, the fourth device can establish a communication connection with the controlled device 202 such as the second device through the gateway function of the first device 201 when the first device 201 is available. When the first device 201 fails or is unavailable, the fourth device can obtain the first key event triggered by the first key, obtain the first scene identifier corresponding to the first key event, and send the first scene identifier to the controlled device 202, so that the controlled device 202 determines and executes the first task according to the first scene identifier.
[0085] In some possible application scenarios, when the controlled device 202 determines a task according to a scenario identifier, it may determine a corresponding task from a pre-stored scenario task set or at least one task according to the scenario identifier.
[0086] Among them, a scene task set can correspond to a button, and a scene task set includes tasks corresponding to at least one button event triggered by a button; or, a scene task set can also correspond to multiple buttons, and a scene task set includes tasks corresponding to button events triggered by multiple buttons.
[0087] In some other possible application scenarios, the controlled device 202 may obtain a scenario task set or at least one task through a network device.
[0088] In this case, see Figure 4 As shown, the communication system further includes a terminal device 401 and a network device 402 , and the terminal device 401 communicates with the first device 201 and the controlled device 202 through the network device 402 .
[0089] Exemplarily, the network device 402 may be a host, a router, etc. having a network management function and a routing function.
[0090] Take routers as an example. In a local area network at home or office, devices in a region (such as electronic devices, terminal devices, smart devices, etc.) can usually be connected to the network through routers. A router is a network device responsible for path finding. It finds a network path with the least traffic from multiple paths in an interconnected network and provides it to users for communication. Routers are used to connect multiple logically separate networks.
[0091] In the embodiment of the present application, the terminal device 401 can be an electronic device or terminal device such as a mobile phone, a tablet computer, a personal computer, etc., which can install an application (application, APP). The terminal device 401, the first device 201, and the controlled device 202 are in different networks. Furthermore, after the terminal device 401 is connected to the network device 402, it is necessary to further communicate with the first device 201 and the controlled device 202 through the gateway function.
[0092] It is understandable that the gateway function can support data transmission between different protocols, while network devices such as routers transmit data between different networks.
[0093] In the same home area or the same space, one APP may correspond to at least one controlled device 202, and to each button that can control the controlled device. The user can not only set each controlled device on the APP page, but also set at least one button that controls each controlled device.
[0094] Exemplarily, the APP installed on the terminal device 401 may be an associated APP of the first device 201, or an associated APP of a control device such as a button. When the user opens the APP on the terminal device 401, a series of setting pages for button configuration may be entered, and the tasks corresponding to the button events of each button may be set on the setting page.
[0095] For example, the terminal device 401 first displays a button selection page, wherein the button selection page is shown in FIG. Figure 5As shown in (a) in the figure. The button selection page may include at least one button option, such as left button, middle button, right button, etc. On the button selection page, the user can select the button to be set according to their needs. For example, click "left button", click "middle button", click "right button", etc.
[0096] The terminal device 401 displays the first page in response to the user selecting a button option on the button selection page. Figure 5 As shown in (b) in the figure. The first page includes control setting items corresponding to the button options selected by the user, such as device switch setting items, scene setting items, etc. Among them, the device switch setting item can represent a button controlling the corresponding controlled device 202 to be turned on or off, and the scene setting item can represent a button controlling the corresponding controlled device 202 to perform multiple tasks in turn. Correspondingly, an explanation of the setting item is also displayed under each setting item, such as, for the device switch setting item, "Press the button to control the turning on and off of the connected device" is displayed, and for the scene setting item, "Press the button to execute the scene" is displayed, wherein the device connected to the button represents the controlled device 202 (such as the second device) in the embodiment of the present application. On the first page, the user can select the control setting item of the button according to his or her needs, for example, click the device switch setting item, click the scene setting item, etc.
[0097] The terminal device 401 displays the second page in response to the user selecting the target control setting item on the first page. If the controlled device 202 corresponding to the button is a smart light, and the user selects the device switch setting item on the first page, the second page can refer to Figure 5 As shown in (c) in the figure. The second page includes at least one control content option corresponding to the above-mentioned button, such as "turn on the light", "turn off the light", etc. The user can select a control content option according to his or her needs on the second page. In this case, the button can correspond to a button event, which can be triggered by the user pressing the button, and the control content (or task content) corresponding to the button event can be "turn on the light" or "turn off the light".
[0098] Alternatively, if the controlled device 202 corresponding to the button is a smart air conditioner, the user selects a scene setting item on the first page, then the second page can refer to Figure 5As shown in (d) in the figure. The second page includes at least one control content option corresponding to the above-mentioned button, such as "automatic", "low wind", "medium wind", "high wind", etc. The user can select at least one control content option according to his or her needs on the second page. In this case, the button corresponds to four button events, and the four button events can be triggered by the user pressing the button. The control content (or task content) corresponding to each button event can be the above-mentioned "automatic", "low wind", "medium wind", and "high wind", respectively, and each control content corresponds to the four wind speed modes of the smart air conditioner, namely "control the smart air conditioner in automatic mode", "control the smart air conditioner in low wind mode", "control the smart air conditioner in wind mode", and "control the smart air conditioner in high wind mode".
[0099] Afterwards, the terminal device 401 determines the scene task set (or at least one task) corresponding to the key according to at least one control content option (or task content), and sends the scene task set (or at least one task) corresponding to the key for controlling the controlled device 202 to the controlled device 202. That is, the controlled device 202 corresponds to the key for controlling the controlled device 202, and the scene indicated by the scene identifier of at least one key event corresponding to the key includes the controlled device 202.
[0100] It is understandable that when a controlled device 202 can be controlled by multiple buttons, the controlled device 202 can receive scene task sets (or at least one task) corresponding to the multiple buttons respectively.
[0101] Furthermore, the terminal device 401 may send the scene task set (or at least one task) to the controlled device 202 via a network device 402 such as a router, and the network device 402 may send the scene task set (or at least one task) to the controlled device 202 via a gateway function.
[0102] In some possible application scenarios, the terminal device 401 may determine the sorting order of at least one task corresponding to a key according to the order in which the user selects the control content (or task content). Alternatively, the terminal device 401 may also determine the sorting order of at least one task corresponding to a key according to a preset order. This embodiment of the application does not specifically limit this.
[0103] The above-mentioned terminal device 401 can provide users with a page for setting button control functions, so that users can set the control functions of different buttons (or control the tasks performed by the controlled device) according to their needs, so that the button control functions can better meet user needs and ensure the user experience.
[0104] In addition, the controlled device 202 saves a scene task set (or at least one task), and after subsequently acquiring the scene identifier, it can directly obtain and execute the corresponding task from the saved scene task set (or at least one task), thereby improving the response speed of the controlled device 202.
[0105] In some possible application scenarios, the first device 201, the controlled device 202, the fourth device, etc., can be devices in the whole house smart scene, where the whole house smart scene can be, for example, a smart home scene, a smart office scene, a smart guest room scene, a smart hotel scene, etc. In addition, the first device 201 can be a gateway device, a smart switch with a gateway function, a smart switch panel with a gateway function, etc., the controlled device 202 can be a smart lamp, a smart curtain, a smart air conditioner, a smart TV, etc., and the fourth device can be a smart switch, a smart switch panel, etc.
[0106] In addition, in other possible application scenarios, the above tasks may include controlling the controlled device 202 (such as the second device, the third device, etc.) to turn on or off, or adjusting the attribute parameter value of the controlled device 202 (such as the second device, the third device, etc.), wherein the attributes of the controlled device 202 include one or more of brightness, temperature, wind speed, and color.
[0107] In some possible application scenarios, the above tasks may include a scene identifier, so that the controlled device 202 can determine and execute the task corresponding to the scene identifier according to the received scene identifier. Exemplarily, the scene identifier included in task 1 is 1. If the scene identifier received by the controlled device 202 is also 1, then the controlled device 202 can determine that the task corresponding to the scene identifier is task 1.
[0108] In addition, the above task may also include task parameters, so that when the controlled device 202 executes the task, it can execute the task according to the task parameters corresponding to the task. Further, the task parameters included in the task may correspond to the attribute parameter values of the controlled device 202, and the controlled device 202 executes the task according to the task parameters of the task, that is, adjusts the corresponding attribute parameter values according to the task parameters.
[0109] Exemplarily, as a smart light of the controlled device 202, it can execute an opening task or an closing task according to the task parameters, and can also execute a color adjustment task, a brightness adjustment task, etc. according to the task parameters, wherein the task parameters can be a color value, a brightness value, etc., or a color mode, a brightness mode, etc.; as a smart air conditioner of the controlled device 202, it can execute an opening task or an closing task according to the task parameters, and can also execute a temperature adjustment task, a wind speed adjustment task, etc. according to the task parameters, wherein the task parameters can be a temperature value, a wind speed value (fan speed), etc., or a temperature mode, a wind speed mode, etc.; as a smart curtain of the controlled device 202, it can execute an opening task or a closing task according to the task parameters.
[0110] In some other possible application scenarios, the communication between the first device 201 and the controlled device 202 may be performed based on a preset control protocol or communication protocol. The preset control protocol may be a scene protocol, and when communicating based on the scene protocol, each of the above tasks may represent a scene, or a scene may represent a task, and a scene task set is a scene set.
[0111] Furthermore, a scene may also include a scene identifier (IDentity, ID) and corresponding scene parameters, wherein the scene identifier is the scene identifier, and the scene parameter is the task parameter.
[0112] For example, the scene set corresponding to button1 (i.e. button 1) can be expressed as:
[0113] button1:[
[0114] {sceneId:1, switch:"on"}, / / Turn on the light
[0115] {sceneId:2, switch:"off"} / / Turn off the light ]
[0117] The above scene set includes two tasks corresponding to the key events triggered by button1, and the two tasks are turning on and off the light, which are used to adjust the switch mode of the controlled device. The controlled device can save these two tasks, or save the scene set corresponding to button1.
[0118] Among them, sceneId is used to represent the scene identifier of each task, and the specific content of the scene identifier can be represented by "1" or "2". Switch is used to represent the task parameters for the switch mode in each task, and the specific content of the task parameters can be represented by "on" or "off".
[0119] For example, the first device receives a key event corresponding to button1, and determines that the scene identifier corresponding to the key event is "1". After that, the first device sends the scene identifier "1" to the controlled device based on the gateway function. The controlled device determines the corresponding scene parameter (or task parameter) according to the scene identifier "1": switch: "on", and executes the scene (or task), that is, turns on the light.
[0120] Afterwards, the first device receives another key event corresponding to button1, and determines that the scene identifier corresponding to the key event is "2". The first device sends the scene identifier "2" to the controlled device based on the gateway function. The controlled device determines the corresponding scene parameter (or task parameter) according to the scene identifier "2": switch: "off", and executes the scene (or task), that is, turns off the lights.
[0121] For example, the scene set corresponding to button2 (i.e. button 2) can be expressed as:
[0122] button2:[
[0123] {sceneId:3,windmode:0}, / / automatic
[0124] {sceneId:4,windmode:1}, / / low wind
[0125] {sceneId:5,windmode:2}, / / Stroke
[0126] {sceneId:6,windmode:3} / / Gao Feng ]
[0128] The above scene set includes four tasks corresponding to the key events triggered by button2, and the four tasks are respectively controlling the smart air conditioner in automatic mode, controlling the smart air conditioner in low wind mode, controlling the smart air conditioner in medium wind mode and controlling the smart air conditioner in high wind mode, which are used to adjust the wind speed mode of the smart air conditioner. The smart air conditioner can save these four tasks, or save the scene set corresponding to button2.
[0129] Among them, windmode is used to represent the task parameters for the wind speed mode in each task, and the specific content of the task parameters can be represented by "0", "1", "2", and "3".
[0130] For example, the first device receives a key event corresponding to button2, and determines that the scene identifier corresponding to the key event is "3", and the controlled device in the scene indicated by the scene identifier "3" is a smart air conditioner. Afterwards, the first device sends the scene identifier "3" to the smart air conditioner based on the gateway function, and the smart air conditioner determines the corresponding scene parameter (or task parameter) as windmode:0 according to the scene identifier "3", and executes the scene (or task) corresponding to the scene parameter (or task parameter), that is, adjusts the wind speed mode to the automatic mode, so that the smart air conditioner is in the automatic mode.
[0131] Afterwards, the first device receives another key event corresponding to button2, and determines that the scene identifier corresponding to the key event is "4". The first device sends the scene identifier "4" to the smart air conditioner based on the gateway function. The smart air conditioner determines the corresponding scene parameter (or task parameter) according to the scene identifier "4": windmode:1, and executes the scene (or task) corresponding to the scene parameter (or task parameter), that is, adjusts the wind speed mode to low wind mode, thereby putting the smart air conditioner in low wind mode.
[0132] In addition, for other key events corresponding to button2, the first device can refer to the above content for processing, which will not be repeated here.
[0133] For example, the scene set corresponding to button3 (i.e. button 3) can be expressed as:
[0134] button3:[
[0135] {sceneId:7, sunshademode:1}, / / Open the curtains
[0136] {sceneId:8, sunshademode:0}, / / Pause
[0137] {sceneId:9, sunshademode:2}, / / Close the curtains
[0138] {sceneId:10,sunshademode:0} / / Pause ]
[0140] The above scene set includes four tasks corresponding to the key events triggered by button3, and the four tasks are opening curtains, pausing, closing curtains and pausing, which are used to adjust the switch mode or sunshade mode of the smart curtains. The smart curtain can save these four tasks, or save the scene set corresponding to button3.
[0141] Among them, sunshademode is used to represent the task parameters for the sunshade mode in each task, and the content of the task parameter can be represented by "1", "0", "2", "0".
[0142] For example, the first device receives a key event corresponding to button3, and determines that the scene identifier corresponding to the key event is "7". The scene identifier "7" indicates that the controlled device in the scene is the smart curtain. Afterwards, the first device sends the scene identifier "7" to the smart curtain based on the gateway function. The smart curtain determines the corresponding scene parameter (or task parameter) as sunshademode:1 according to the scene identifier "7", and executes the scene (or task) corresponding to the scene parameter (or task parameter), that is, opens the curtain.
[0143] Afterwards, the first device receives another key event corresponding to button3, and determines that the scene identifier corresponding to the key event is "8". The first device sends the scene identifier "8" to the smart curtain based on the gateway function. The smart curtain determines the corresponding scene parameter (or task parameter) according to the scene identifier "8": sunshademode:0, and executes the scene (or task) corresponding to the scene parameter (or task parameter), that is, pauses opening the curtains.
[0144] In addition, for other key events corresponding to button3, the first device can refer to the above content for processing, which will not be repeated here.
[0145] For example, the scene set corresponding to button4 (i.e. button 4) can be expressed as:
[0146] button4:[
[0147] {sceneId:11, switch:on, brightness:50, color:80}, / / guest light
[0148] {sceneId:12, switch:on, brightness:10, color:50}, / / movie viewing light
[0149] {sceneId:13, switch:on,brightness:70,color:20} / / Leisure light ]
[0151] The above scene set includes three tasks corresponding to the key events triggered by button4, and the three tasks are to control the smart light in reception light mode, to control the smart light in movie light mode, and to control the smart light in leisure light mode, which are used to adjust the light mode of the smart light. In different modes, the brightness and color of the smart light can be different. Among them, the smart light can save these three tasks, or save the scene set corresponding to button4.
[0152] Among them, brightness is used to represent the task parameters for adjusting brightness in each task, and the specific content of the task parameters can be represented by "50", "10", and "70", which can correspond to different brightness values; color is used to represent the task parameters for adjusting color in each task, and the specific content of the task parameters can be represented by "80", "50", and "20", which can correspond to different color values.
[0153] For example, the first device receives a key event corresponding to button4, and determines that the scene identifier corresponding to the key event is "11", and the controlled device in the scene indicated by the scene identifier "11" is a smart light. Afterwards, the first device sends the scene identifier "11" to the smart light based on the gateway function, and the smart light determines the corresponding scene parameters (or task parameters) according to the scene identifier "11": switch: on, brightness: 50, color: 80, and executes the scene (or task) corresponding to the scene parameters (or task parameters), that is, adjusts the brightness to the brightness corresponding to 50, and adjusts the color to the color corresponding to 80, so that the smart light is in the reception light mode.
[0154] Afterwards, the first device receives another key event corresponding to button4, and determines that the scene identifier corresponding to the key event is "12". The first device sends the scene identifier "12" to the smart light based on the gateway function. The smart light determines the corresponding scene parameters (or task parameters) according to the scene identifier "12": switch: on, brightness: 10, color: 50, and executes the scene (or task) corresponding to the scene parameters (or task parameters), that is, adjusts the brightness to the brightness corresponding to 10, and adjusts the color to the color corresponding to 50, so that the smart light is in the movie viewing light mode.
[0155] In addition, for other key events corresponding to button4, the first device can refer to the above content for processing, which will not be repeated here.
[0156] The above example can indicate that one button controls one controlled device, such as a smart light, a smart curtain, a smart air conditioner, etc.
[0157] In other examples, one button may also control multiple controlled devices, or multiple buttons may control one controlled device.
[0158] For example, the controlled devices that can be controlled by button5 (i.e., button 5) include smart lights, smart air conditioners, and smart curtains. The smart lights, smart air conditioners, and smart curtains can respectively save the tasks or scene task sets corresponding to button5, wherein the scene set corresponding to button5 can be expressed as:
[0159] button5:[
[0160] {sceneId:14,switch:on,airconditioning:on,sunshademode:1}, / / Go home
[0161] {sceneId:15,switch:off,airconditioning:off,sunshademode:0} / / leave home ]
[0163] The above scene set includes two tasks corresponding to the key events triggered by button5, and the two tasks are to adjust the controlled device to the home mode and to adjust the controlled device to the away mode, which are used to adjust the scene mode of the linkage between smart lights, smart air conditioners and smart curtains.
[0164] Among them, airconditioning is used to represent the task parameters for the intelligent air-conditioning wind speed mode in each control instruction, and the specific content of the task parameters can be represented by "on" or "off".
[0165] For example, after receiving the first key event, the first device determines that the first scene identifier corresponding to the first key event is "14", and the controlled devices in the scene indicated by the first scene identifier are smart lights, smart air conditioners and smart curtains. The first device sends the scene identifier "14" to the smart lights, smart air conditioners and smart curtains respectively based on the gateway function. Thus, when the smart light receives the scene identifier "14", it can determine that the corresponding scene parameter (or task parameter) is: switch: on, and execute the scene (or task) corresponding to the scene parameter (or task parameter), that is, turn on the light. And, when the smart air conditioner receives the scene identifier "14", it can determine that the corresponding scene parameter (or task parameter) is: airconditioning: on, and execute the scene (or task) corresponding to the scene parameter (or task parameter), that is, turn on the smart air conditioner. And, when the smart curtain receives the scene identifier "14", it can determine that the corresponding scene parameter (or task parameter) is: sunshademode: 1, and execute the scene (or task) corresponding to the scene parameter (or task parameter), that is, open the curtains.
[0166] In addition, for other key events corresponding to button5, the first device can refer to the above content for processing, which will not be repeated here.
[0167] This control method can also be seen as button5 adjusting the linkage scene of the controlled devices in the home to the home mode.
[0168] As another example, button6 (i.e., button 6) and button7 (i.e., button 7) can control a controlled device respectively, wherein when the controlled device is a smart curtain, the smart curtain respectively saves the tasks or scene task sets corresponding to button6 and button7.
[0169] Among them, the scene collection corresponding to button6 and button7 can be expressed as:
[0170] button6:[
[0171] {sceneId:16, sunshademode:1}, / / Open the curtains
[0172] {sceneId:17, sunshademode:0}, / / Pause ]
[0174] button7:[
[0175] {sceneId:18, sunshademode:2}, / / Close the curtains
[0176] {sceneId:19,sunshademode:0} / / Pause ]
[0178] The first scene set mentioned above includes two tasks corresponding to the key events triggered by button6, and the two tasks are opening curtain mode and pause mode, which are used to adjust the switch mode of the smart curtain.
[0179] The second scene set includes two tasks corresponding to the key events triggered by button7, and the two tasks are curtain closing mode and pause mode, which are used to adjust the switch mode of the smart curtain.
[0180] For example, the first device receives a key event corresponding to button6, and determines that the scene identifier corresponding to the key event is "16", and the controlled device in the scene indicated by the scene identifier "16" is the smart curtain. Afterwards, the first device sends the scene identifier "16" to the smart curtain based on the gateway function. The smart curtain determines the corresponding scene parameter (or task parameter) as: sunshademode:1 according to the scene identifier "16", and executes the scene (or task) corresponding to the scene parameter (or task parameter), that is, opens the curtain.
[0181] Afterwards, the first device receives a key event corresponding to button7, and determines that the scene identifier corresponding to the key event is "18", and the controlled device in the scene indicated by the scene identifier "18" is the smart curtain. The first device sends the scene identifier "18" to the smart curtain based on the gateway function. The smart curtain determines the corresponding scene parameter (or task parameter) as sunshademode:2 according to the scene identifier "18", and executes the scene (or task) corresponding to the scene parameter (or task parameter), that is, closes the curtain.
[0182] In addition, for other key events corresponding to button6 and button7, the first device can refer to the above content for processing, which will not be repeated here.
[0183] It can be seen from the above content that in the embodiment of the present application, the first device itself has a gateway function, or the first device itself is a gateway device (i.e., has a gateway function), and after receiving a key event of the first key, the first device sends the scene identifier corresponding to the key event to the corresponding controlled device (such as the second device). The controlled device can determine the corresponding first task according to the scene identifier and execute it, thereby completing a control process of the first key on the controlled device.
[0184] It can be seen that the communication between the first device and the controlled device does not require the transmission of specific control instructions, and there is no need for network devices such as routers to participate in the control process. Even if network devices such as routers fail, it will not affect the control process of the controlled device by the first button, thereby improving the user experience.
[0185] In addition, the scene identifier only needs to be transmitted between the first device and the controlled device. In this way, the amount of transmitted data is reduced, the speed of data transmission can be increased, and the response speed of the controlled device during the control process can be increased, which can also improve the user experience.
[0186] The following example takes the first button corresponding to controlling a controlled device as an example. Figure 6 As shown, the above device control method may include the following steps S601-S604, wherein the controlled device is the second device.
[0187] S601: The first device obtains a first key event corresponding to a first key.
[0188] It is understandable that the first button can trigger at least one button event, and the first button event is one of them. Exemplarily, each time the first button is pressed by the user, a button event is triggered, and any of the button events can be regarded as the first button event.
[0189] Furthermore, when the first device is connected to the first button, the first device can obtain the first button event from the first button; and when the first device includes the first button or the first device is the first button, the first device can directly obtain the first button event.
[0190] In addition, after the first button triggers the button event, the button event can be actively reported to the first device; or the first device can also actively detect the state of the first button, thereby timely acquiring the button event triggered by the first button. The embodiment of the present application does not specifically limit the method of acquiring the button event.
[0191] S602: In response to a first key event, the first device obtains a first scene identifier corresponding to the first key event.
[0192] In some embodiments, each time the first device obtains a key event, it triggers a local auto-increment function to be incremented once, so that the first device can determine the scene identifier of the currently obtained key event according to the value of the auto-increment function.
[0193] Exemplarily, the self-increment function can be expressed as current = (++current)%current. As shown in Table 1 below, the self-increment of current can trigger the first device to cyclically select the scene identifier. For example, when current is incremented once, index = 0, and the first device selects scene identifier 1; when current is incremented twice, index = 1, and the first device selects scene identifier 2; when current is incremented three times, index = 1, and the first device selects scene identifier 1.
[0194] Table 1
[0195] Scene ID 1 Scene ID 2 index=0 index=1
[0196] After the first device obtains the first key event, it can determine the first scene identifier corresponding to the first key event according to the triggering condition of the self-increment function.
[0197] S603: The first device sends a first scenario identifier to the second device based on the gateway function.
[0198] In some embodiments, the first button is associated with the second device, that is, after the first button triggers a key event, the first device can determine the corresponding second device; or, in other embodiments, the key event triggered by the first button can indicate the controlled second device, for example, the scene identifier corresponding to the key event can indicate the current scene, and the second device in the scene.
[0199] It is understandable that a key event may correspond to a scene identifier, and a scene identifier may correspond to a task. The scene identifier may distinguish the control scenes corresponding to different key events, the scene identifier may also distinguish different tasks, and the scene identifier may also indicate the second device that performs the corresponding task in the current scene.
[0200] For example, in the light turning on and off scenarios, the second device that performs the corresponding task is a smart light; in the curtain opening and closing scenarios, the second device that performs the corresponding task is a smart curtain; in the light color or brightness adjustment scenario, the second device that performs the corresponding task is a smart light; in the temperature or wind speed adjustment scenario, the second device that performs the corresponding task is a smart air conditioner.
[0201] S604: The second device determines and executes the first task according to the received first scenario identifier.
[0202] In some embodiments, the second device may pre-store tasks corresponding to keys that can control the second device. The second device may determine the first task corresponding to the first scene identifier from the saved tasks according to the received first scene identifier.
[0203] Each task stored in the second device may include a scene identifier, and the first scene identifier corresponds to the first task, and the scene identifier of the first task may be the same as the first scene identifier. Alternatively, the first scene identifier corresponds to the first task, and the first task and the first scene identifier may have an associated relationship.
[0204] In the above process, the first device can send a scene identifier corresponding to the first button to the second device, wherein one scene corresponds to one task, thereby achieving the purpose of controlling the second device to perform a task through one button.
[0205] In some other embodiments, after the above S604, the first device may continue to obtain other key events triggered by the first key, and send the scene identifiers corresponding to the other key events to the second device, so that the second device can determine and execute a new task according to the scene identifier received again. Figure 7 As shown, the above device control method may further include the following steps S701-S704.
[0206] S701: The first device obtains a second key event corresponding to a first key.
[0207] S702: In response to a second key event, the first device obtains a second scene identifier corresponding to the second key event.
[0208] As described in the foregoing embodiments, in some embodiments, after acquiring the second key event, the first device may trigger the self-increment function to increase once, thereby acquiring the next scene identifier of the first scene identifier, that is, the second scene identifier.
[0209] Exemplarily, when the first scene identifier is scene identifier 1, the second scene identifier is scene identifier 2; when the first scene identifier is scene identifier 2, the second scene identifier is scene identifier 1.
[0210] S703: The first device sends a second scenario identifier to the second device based on the gateway function.
[0211] The second device may be a controlled device in the scene indicated by the first scene identifier or a controlled device in the scene indicated by the second scene identifier, that is, both key events of the first button can realize control of the second device.
[0212] S704: The second device determines and executes the second task according to the received second scenario identifier.
[0213] Among them, the second task is different from the first task. For example, the first task is to turn on the lights, and the second task is to turn off the lights; the first task is to control the smart air conditioner in automatic mode, and the second task is to control the smart air conditioner in low wind mode; the first task is to control the curtains to open, and the second task is to control the curtains to pause opening; the first task is to turn on the meeting light mode, and the second task is to turn on the movie watching light mode.
[0214] From the above content, it can be seen that the above-mentioned first button can trigger multiple button events, different button events correspond to different scene identifiers, and different scene identifiers have their own corresponding tasks. That is to say, the first button can control a controlled device to perform different tasks through the first device.
[0215] In addition, the first device can select the scene identifier cyclically or in turn according to the triggering situation of the key event, and the second device can determine and execute the task in turn according to the scene identifier accordingly, thereby achieving the purpose of controlling a controlled device to execute multiple tasks in turn with one key.
[0216] The following example takes the first button corresponding to controlling multiple controlled devices as an example. Figure 8 As shown, the above device control method may further include the following steps S801-S804 after S604, wherein the controlled device may further include a third device.
[0217] S801. The first device obtains a second key event corresponding to a first key.
[0218] S802: In response to a second key event, the first device obtains a second scene identifier corresponding to the second key event.
[0219] S803. The first device sends a second scenario identifier to the third device based on the gateway function.
[0220] The third device is a controlled device in the scene indicated by the second scene identifier, and the second device is a controlled device in the scene indicated by the first scene identifier.
[0221] S804: The third device determines and executes the second task according to the received second scenario identifier.
[0222] The second task may be different from the first task, that is, the first button may control the second device and the third device to perform different tasks respectively. For example, the first button may control the smart light (such as the second device) to turn on the light, and the first button may also control the smart curtain (such as the third device) to close; the first button may control the smart light to adjust the light mode, and the first button may also control the smart air conditioner to adjust the wind speed mode.
[0223] Alternatively, the second task may be the same as the first task, that is, the first button may control the second device and the third device to perform the same task. For example, the first button may control the smart light (such as the second device) to turn on, and the first button may also control the smart curtain (such as the third device) to open.
[0224] From the above content, it can be seen that the above-mentioned first button can trigger multiple button events, different button events correspond to different scene identifiers, and different scene identifiers can be received by different controlled devices respectively. That is to say, one button can control multiple controlled devices to perform tasks through the first device.
[0225] Alternatively, in some embodiments, after the first button triggers the first button event, the first device may also send the first scene identifier corresponding to the first button event to the third device based on the gateway function, and the third device determines and executes the corresponding fourth task according to the first scene identifier. The fourth task may be the same as the first task, or the fourth task may be different from the first task.
[0226] In this way, the third device and the second device can both be controlled devices in the scene indicated by the first scene identifier. That is, the same scene identifier corresponding to the first button can be received by different controlled devices, and different controlled devices can perform the same or different tasks. Similarly, the purpose of controlling multiple controlled devices to perform tasks through the first device by one button can be achieved.
[0227] The following example takes multiple buttons corresponding to controlling one controlled device as an example. Fig. 9 As shown, after S604, the device control method may further include the following steps S901-S904, wherein the button may include a second button in addition to the first button.
[0228] S901. The first device obtains a third key event corresponding to the second key.
[0229] The manner in which the second button triggers the third button event may refer to the manner in which the first button triggers the button event in the aforementioned embodiment, and will not be described in detail here.
[0230] S902: In response to a third key event, the first device obtains a third scene identifier corresponding to the third key event.
[0231] Among them, the way in which the first device obtains the third scene identifier can refer to the way in which the first scene identifier is obtained in the aforementioned embodiment, and will not be repeated here.
[0232] S903: The first device sends a third scenario identifier to the second device based on the gateway function.
[0233] The second device may be a controlled device in the scene indicated by the first scene identifier, or a controlled device in the scene indicated by the third scene identifier.
[0234] S904: The second device determines and executes the third task according to the received third scenario identifier.
[0235] The third task may be different from the first task. That is, the first button and the second button respectively control the second device to perform different tasks. For example, the first button may control the smart light (such as the second device) to turn on, and the second button may control the smart light (such as the second device) to turn off; the first button may control the smart light (such as the second device) to adjust to a reception light mode, and the second button may control the smart light (such as the second device) to adjust to a movie light mode.
[0236] Alternatively, the third task may be the same as the first task. That is, the first button and the second button may control the second device to perform the same task. For example, the first button may control the smart light (such as the second device) to turn on, and the second button may also control the smart light (such as the second device) to turn on.
[0237] It can be seen from the above content that the first button and the second button can trigger button events respectively, and both can be received by the same controlled device, that is, multiple buttons can control a controlled device to perform tasks through the first device.
[0238] In other embodiments, based on the device control method in the embodiment of the present application, the purpose of controlling multiple controlled devices by corresponding to multiple buttons can also be achieved. For example, when a first button controls a second device through a first device, and a second button controls a third device through the first device, and when one button controls one controlled device, the control method can also refer to the content in the aforementioned embodiment.
[0239] It can be known from the above content that in the embodiment of the present application, the first device itself has a gateway function, or the first device itself is a gateway device (i.e., has a gateway function), and the first device can achieve the purpose of controlling one controlled device with one button, controlling multiple controlled devices with one button, controlling one controlled device with multiple buttons, and controlling multiple controlled devices with multiple buttons. In addition, the communication between the first device and the controlled device does not require the transmission of specific control instructions, and there is no need for network devices such as routers to participate in the control process. Even if network devices such as routers fail, it will not affect the control process of the buttons for the controlled devices, thereby improving the user experience.
[0240] In addition, the scene identifier only needs to be transmitted between the first device and the controlled device. In this way, the amount of transmitted data is reduced, the speed of data transmission can be increased, and the response speed of the controlled device during the control process can be increased, which can also improve the user experience.
[0241] In some schemes, multiple embodiments of the present application can be combined, and the combined scheme can be implemented. Optionally, some operations in the process of each method embodiment are optionally combined, and / or the order of some operations is optionally changed. In addition, the execution order between the steps of each process is only exemplary and does not constitute a restriction on the execution order between the steps. There can also be other execution orders between the steps. It is not intended to show that the execution order is the only order in which these operations can be performed. A person of ordinary skill in the art will think of a variety of ways to reorder the operations described in the embodiments of the present application. In addition, it should be noted that the process details involved in a certain embodiment of the present application are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.
[0242] In addition, some steps in the method embodiment may be equivalently replaced by other possible steps. Alternatively, some steps in the method embodiment may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added to the method embodiment.
[0243] Furthermore, the various method embodiments may be implemented separately or in combination.
[0244] It is understandable that in order to implement the above functions, the aforementioned electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0245] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0246] The present application also provides a gateway device. For example, the gateway device may be the first device in the above embodiment. Fig.10 As shown, the gateway device may include one or more processors 1001, a memory 1002, and a communication interface 1003. It may also include a gateway module 1005 that provides gateway functions.
[0247] The gateway module 1005 is used for the gateway device to establish a communication connection with other devices, for example, for establishing a communication connection between the first device and the controlled device, and for establishing a communication connection between the first device and a control device such as a button. Also, it can be understood that the gateway in the embodiment of the present application can be a function provided by the gateway device, or a hardware structure in the gateway device, for example, a module or unit that provides a gateway function.
[0248] The gateway module 1005 , the memory 1002 , the communication interface 1003 are coupled to the processor 1001 . For example, the gateway module 1005 , the memory 1002 , the communication interface 1003 and the processor 1001 may be coupled together via a bus 1004 .
[0249] The communication interface 1003 is used for data transmission with other devices. The memory 1002 stores computer program code. The computer program code includes computer instructions. When the computer instructions are executed by the processor 1001, the gateway device executes the relevant method steps in the device control method in the embodiment of the present application.
[0250] Among them, the processor 1001 can be a processor or a controller, for example, it can be a central processing unit (CPU), a general processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the contents of the embodiments of the present application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0251] The bus 1004 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 1004 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0252] The embodiment of the present application also provides a controlled device, which can be, for example, the second device, the third device, etc. in the aforementioned embodiment. The controlled device may include a memory and one or more processors, wherein the memory is coupled to the processor; the memory stores computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the controlled device executes the relevant method steps in the device control method in the embodiment of the present application.
[0253] The structures of the processor, memory, and communication interface can refer to the above Fig.10 as shown in .
[0254] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program code. When the above-mentioned processor executes the computer program code, the above-mentioned gateway device or the controlled device executes the relevant method steps in the device control method in the embodiment of the present application.
[0255] The embodiment of the present application also provides a computer program product, which, when executed on a gateway device, enables the gateway device or a controlled device to execute relevant method steps in the device control method in the embodiment of the present application.
[0256] Among them, the gateway device, controlled device, computer storage medium or computer program product provided in this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0257] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0258] In the several embodiments provided in the present application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0259] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0260] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0261] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0262] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A device control method, characterized in that: Applied to a communication system, the communication system includes a first device and a second device, the first device has a gateway function, and the gateway function is used to establish a communication connection between the first device and the second device; the method includes: In response to the acquired first key event corresponding to the first key, the first device acquires a first scene identifier corresponding to the first key event; The first device sends the first scene identifier to the second device based on the gateway function; the second device is a controlled device in the scene indicated by the first scene identifier; The second device determines and executes the first task according to the received first scenario identifier.
2. The method according to claim 1, characterized in that The method further comprises: In response to the acquired second key event corresponding to the first key, the first device acquires a second scene identifier corresponding to the second key event; The first device sends the second scene identifier to the second device based on the gateway function; the second device is also a controlled device in the scene indicated by the second scene identifier; The second device determines and executes a second task according to the received second scenario identifier; the second task is different from the first task.
3. The method according to claim 1, characterized in that The communication system further includes a third device, and the gateway function is further used to establish a communication connection between the first device and the third device; and the method further includes: In response to the acquired second key event corresponding to the first key, the first device acquires a second scene identifier corresponding to the second key event; The first device sends the second scene identifier to the third device based on the gateway function; the third device is a controlled device in the scene indicated by the second scene identifier; The third device determines and executes a second task according to the received second scenario identifier, where the second task is different from the first task.
4. The method according to claim 2 or 3, characterized in that: The method further comprises: The first device sends the first scene identifier to a third device based on the gateway function; the third device is a controlled device in the scene indicated by the first scene identifier; The third device determines and executes a fourth task according to the received first scenario identifier; the fourth task is the same as the first task, or the fourth task is different from the first task.
5. The method according to any one of claims 2 to 4, characterized in that: The method further comprises: In response to the acquired third key event corresponding to the second key, the first device acquires a third scene identifier corresponding to the third key event; The first device sends the third scene identifier to the second device based on the gateway function; the second device is also a controlled device in the scene indicated by the third scene identifier; The second device determines and executes a third task according to the received third scenario identifier; the third task is the same as the first task, or the third task is different from the first task.
6. The method according to any one of claims 1 to 5, characterized in that: The communication system further includes a fourth device, and the fourth device establishes communication connections with the first device and the second device respectively; and the method further includes: When the first device is unavailable, the fourth device obtains a first key event corresponding to the first key; In response to the first key event, the fourth device obtains a first scene identifier corresponding to the first key event, and sends the first scene identifier to the second device.
7. The method according to any one of claims 1 to 6, characterized in that: The first task includes controlling the second device to turn on or off, or adjusting the attribute parameter value of the second device; the attributes of the second device include one or more of brightness, temperature, wind speed, and color.
8. The method according to any one of claims 1 to 7, characterized in that: The first device and the second device are devices in the whole-house smart scene respectively.
9. A device control method, characterized in that: A first device applied to a communication system, the communication system further comprising a second device, the first device having a gateway function, the gateway function being used to establish a communication connection between the first device and the second device; the method comprising: In response to the acquired first key event corresponding to the first key, acquiring a first scene identifier corresponding to the first key event; The first scenario identifier is sent to the second device based on the gateway function; the second device is a controlled device in the scenario indicated by the first scenario identifier, and the first scenario identifier is used to instruct the second device to determine and execute a first task.
10. The method according to claim 9, characterized in that The method further comprises: In response to the acquired second key event corresponding to the first key, acquiring a second scene identifier corresponding to the second key event; The second scene identifier is sent to the second device based on the gateway function; the second device is also a controlled device in the scene indicated by the second scene identifier, and the second scene identifier is used to instruct the second device to determine and execute a second task, which is different from the first task.
11. The method according to claim 9, characterized in that The communication system further includes a third device, and the gateway function is further used to establish a communication connection between the first device and the third device; and the method further includes: In response to the acquired second key event corresponding to the first key, acquiring a second scene identifier corresponding to the second key event; The second scene identifier is sent to a third device based on the gateway function; the third device is a controlled device in the scene indicated by the second scene identifier, and the second scene identifier is used to instruct the third device to determine and execute a second task, which is different from the first task.
12. The method according to claim 10 or 11, characterized in that: The method further comprises: The first scene identifier is sent to a third device based on the gateway function; the third device is a controlled device in the scene indicated by the first scene identifier, the first scene identifier is used to instruct the third device to determine and execute a fourth task, and the fourth task is the same as the first task, or the fourth task is different from the first task.
13. The method according to any one of claims 10 to 12, characterized in that: The method further comprises: In response to the acquired third key event corresponding to the second key, acquiring a third scene identifier corresponding to the third key event; The third scenario identifier is sent to the second device based on the gateway function; the second device is also a controlled device in the scenario indicated by the third scenario identifier, and the third scenario identifier is used to instruct the second device to determine and execute a third task, and the third task is the same as the first task, or the third task is different from the first task.
14. The method according to any one of claims 9 to 13, characterized in that: The first task includes controlling the second device to turn on or off, or adjusting the attribute parameter value of the second device; the attributes of the second device include one or more of brightness, temperature, wind speed, and color.
15. The method according to any one of claims 9 to 14, characterized in that: The first device and the second device are devices in the whole-house smart scene respectively.
16. A device control method, characterized in that: A second device applied to a communication system, the communication system further comprising a first device, the first device having a gateway function, the gateway function being used to establish a communication connection between the first device and a second device; the method comprising: receiving a first scene identifier sent by the first device; the first scene identifier is obtained by the first device in response to a first key event corresponding to a first key, the first scene identifier corresponds to the first key event, and the second device is a controlled device in the scene indicated by the first scene identifier; According to the first scenario identifier, a first task is determined and executed.
17. The method according to claim 16, characterized in that The method further comprises: receiving a second scene identifier sent by the first device; the second scene identifier is obtained by the first device in response to a second key event corresponding to the first key, the second scene identifier corresponds to the second key event, and the second device is also a controlled device in the scene indicated by the second scene identifier; According to the second scenario identifier, a second task is determined and executed; the second task is different from the first task.
18. The method according to claim 16 or 17, characterized in that The method further comprises: receiving a third scene identifier sent by the first device; the third scene identifier is obtained by the first device in response to a third key event corresponding to the second key, the third scene identifier corresponds to the third key event, and the second device is also a controlled device in the scene indicated by the third scene identifier; According to the third scene identifier, a third task is determined and executed; the third task is the same as the first task, or the third task is different from the first task.
19. The method according to any one of claims 16 to 18, characterized in that: The communication system further includes a fourth device, and the fourth device establishes communication connections with the first device and the second device respectively; and the method further includes: When the first device is unavailable, a first scene identifier sent by the fourth device is received; the first scene identifier is acquired by the fourth device in response to a first key event corresponding to the first key.
20. The method according to any one of claims 16 to 19, characterized in that: The first task includes controlling the second device to turn on or off, or adjusting the attribute parameter value of the second device; the attributes of the second device include one or more of brightness, temperature, wind speed, and color.
21. The method according to any one of claims 16 to 20, characterized in that: The first device and the second device are devices in the whole-house smart scene respectively.
22. A communication system, characterized in that: comprising a first device and a second device, wherein the first device has a gateway function, and the gateway function is used to establish a communication connection between the first device and the second device; The first device is configured to obtain, in response to an acquired first key event corresponding to the first key, a first scene identifier corresponding to the first key event; The first device is further configured to send the first scenario identifier to the second device based on the gateway function; The second device is a controlled device in the scene indicated by the first scene identifier; The second device is used to determine and execute the first task according to the received first scene identifier.
23. A gateway device, characterized in that: The gateway device has a gateway function, and the gateway function is used for the gateway device to establish a communication connection with the controlled device; it also includes a memory and one or more processors; the memory is coupled to the processor; wherein the memory stores computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the gateway device executes the device control method as described in any one of claims 9 to 15.
24. A controlled device, characterized in that: It includes a memory and one or more processors; the memory is coupled to the processor; wherein the memory stores computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the controlled device executes the device control method as described in any one of claims 16-21.
25. A computer-readable storage medium, characterized in that: It includes computer instructions, which, when executed on a gateway device, enable the gateway device to execute the device control method as described in any one of claims 9 to 15; or, when executed on a controlled device, enable the controlled device to execute the device control method as described in any one of claims 16 to 21.