Method, device, storage medium and electronic device for determining scene operation gateway
By receiving the gateway selection instructions of the target application and determining the gateway type, the problem of users being unable to run the gateway in a customized scenario is solved, the effect of running the gateway in a customized scenario is realized, and the user experience is improved.
Patent Information
- Application Number
- CN202111155897.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-09-29
AI Technical Summary
In the existing technology, users cannot customize the running gateway of the scenario, resulting in poor user experience.
By receiving the gateway selection instruction sent by the target application, the type of the target gateway is determined, and when the gateway type is a local gateway, a script pull instruction is sent to it, instructing it to pull and execute the target scenario script.
Implemented a running gateway that allows users to customize scenarios, improving user experience and participation.
Smart Images

Figure CN115883287B
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of communications, and in particular, to a method, device, storage medium, and electronic device for determining a scene operation gateway. Background Art
[0002] In the related technologies, the running location of both edge scenarios and cloud scenarios is determined by cloud computing logic, without considering the user's wishes. Users cannot decide the running location of the scene and can only passively accept it, resulting in a lack of user participation and poor user experience.
[0003] It can be seen from this that there is a problem in the related technology that the running gateway of the scene cannot be customized.
[0004] With respect to the above-mentioned problems existing in the related technologies, no effective solution has been proposed yet. Summary of the invention
[0005] Embodiments of the present invention provide a method, device, storage medium and electronic device for determining a scene operation gateway, so as to at least solve the problem in the related art that the scene operation gateway cannot be customized.
[0006] According to one embodiment of the present invention, a method for determining a scenario running gateway is provided, comprising: receiving a gateway selection instruction sent by a target application, wherein the gateway selection instruction is used to indicate a target gateway that executes a target scenario; determining a gateway type of the target gateway; when the gateway type indicates that the target gateway is a local gateway, sending a script pull instruction to the target gateway to instruct the target gateway to pull a scenario script of the target scenario; and controlling the target gateway to execute the target scenario based on the scenario script.
[0007] According to another embodiment of the present invention, a device for determining a scenario running gateway is provided, comprising: a receiving module, used to receive a gateway selection instruction sent by a target application, wherein the gateway selection instruction is used to indicate a target gateway that executes a target scenario; a determining module, used to determine the gateway type of the target gateway; a sending module, used to send a script pull instruction to the target gateway when the gateway type indicates that the target gateway is a local gateway, so as to instruct the target gateway to pull the scenario script of the target scenario; and an executing module, used to control the target gateway to execute the target scenario based on the scenario script.
[0008] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of any of the above methods when executed by a processor.
[0009] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0010] Through the present invention, a selection instruction for a target gateway for instructing to execute a target scenario sent by a target application is received, the gateway type of the target gateway is determined, and when the gateway type indicates that the target gateway is a local gateway, a script pull instruction is sent to the target gateway to instruct the target gateway to pull the scenario script of the target scenario, and the target gateway is controlled to execute the target scenario according to the scenario script. Since the user can select the target gateway through the target application, and send a selection instruction for selecting the target gateway to indicate the selection of the target gateway as the execution gateway of the target scenario. Therefore, the problem of the inability to customize the running gateway of the scenario existing in the related art can be solved, the effect of the running gateway of the customized scenario is achieved, and the user experience is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for determining a scenario running gateway according to an embodiment of the present invention;
[0012] Figure 2 is a flowchart of a method for determining a scenario operation gateway according to an embodiment of the present invention;
[0013] Figure 3 The method flow of determining the scenario operation gateway according to a specific embodiment of the present invention is Figure 1 ;
[0014] Figure 4 The method flow of determining the scenario operation gateway according to a specific embodiment of the present invention is Figure 2 ;
[0015] Figure 5 The method flow of determining the scenario operation gateway according to a specific embodiment of the present invention is Figure 3 ;
[0016] Figure 6 4 is a structural block diagram of a device for determining a scenario operation gateway according to an embodiment of the present invention. DETAILED DESCRIPTION
[0017] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0018] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0019] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal for determining a method for running a gateway in a scenario according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0020] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the scene operation gateway in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0021] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0022] In this embodiment, a method for determining a scenario operation gateway is provided. Figure 2 is a flow chart of a method for determining a scenario operation gateway according to an embodiment of the present invention. Figure 2As shown, the process includes the following steps:
[0023] Step S202, receiving a gateway selection instruction sent by a target application, wherein the gateway selection instruction is used to indicate a target gateway for executing a target scenario;
[0024] Step S204, determining the gateway type of the target gateway;
[0025] Step S206, when the gateway type indicates that the target gateway is a local gateway, sending a script pull instruction to the target gateway to instruct the target gateway to pull the scene script of the target scene;
[0026] Step S208: Control the target gateway to execute the target scenario based on the scenario script.
[0027] In the above embodiment, the target scene may be a smart home scene, in which the operations to be performed by each smart device, the order of operations, and the triggering conditions for executing the operations may be predetermined. For example, a homecoming scene may be defined. In the homecoming scene, the triggering condition may be opening the door, and the devices that are executed sequentially include lights, curtains, air conditioners, and water heaters. The execution operations of each device may include turning on the lights, closing the curtains, turning on the air conditioner and adjusting the temperature to 26°C, and adjusting the water heater to the heating state. When the user returns home and opens the door, the homecoming scene is triggered, and the homecoming scene begins to be executed in sequence.
[0028] In the above embodiment, the target scene can be an automatically executed scene, that is, a scene triggered by a trigger condition, or a manually triggered scene. That is, when the scene is being edited, the automatic trigger condition can be set. Instead, the user clicks the execution instruction through the APP to start the execution of the scene. When the user clicks the execution instruction, he can also select the gateway to run the scene.
[0029] In the above embodiment, the target scene can be executed by different gateways, and the target gateway for executing the target scene can be selected by the target application, that is, by selecting the target gateway in the target application to trigger the gateway selection instruction, the scene center determines the gateway type of the target gateway after receiving the gateway selection instruction, and sends a script pull instruction to the target gateway when the gateway type indicates that the target gateway is a local gateway, so as to instruct the target gateway to pull the scene script of the target scene. And control the target gateway to execute the target scene according to the scene script. Among them, the scene script is the execution instruction of the scene, including the triggering conditions and execution order of the scene.
[0030] In the above embodiment, the gateway type may include a local type and a cloud type. When the gateway is a cloud type, the target scenario can only be executed when the gateway is connected to the network. If the home network is disconnected, the target scenario cannot be executed. The local type is a local gateway, and the local gateway can also execute the target scenario when it is disconnected from the network.
[0031] Optionally, the executor of the above steps may be a scene center, a background processor, or other devices with similar processing capabilities, or a machine that at least integrates a data processing device, wherein the data processing device may include terminals such as computers and mobile phones, but is not limited thereto.
[0032] Through the present invention, a selection instruction for a target gateway for instructing to execute a target scenario sent by a target application is received, the gateway type of the target gateway is determined, and when the gateway type indicates that the target gateway is a local gateway, a script pull instruction is sent to the target gateway to instruct the target gateway to pull the scenario script of the target scenario, and the target gateway is controlled to execute the target scenario according to the scenario script. Since the user can select the target gateway through the target application, and send a selection instruction for selecting the target gateway to indicate the selection of the target gateway as the execution gateway of the target scenario. Therefore, the problem of the inability to customize the running gateway of the scenario existing in the related art can be solved, the effect of the running gateway of the customized scenario is achieved, and the user experience is improved.
[0033] In an exemplary embodiment, sending a script pull instruction to the target gateway includes: determining the status information of the target gateway; and sending the script pull instruction to the target gateway when the status information indicates that the target gateway satisfies a predetermined condition. In this embodiment, when sending a script pull instruction to the target gateway, it is necessary to determine the status information of the target gateway, and when the status information indicates that the target gateway satisfies a predetermined condition, send the script pull instruction to the target gateway. That is, when sending a script pull instruction to the target gateway, it is necessary to send the script pull instruction when it is determined that the target gateway is capable of executing the target scenario. The status information may include network status information, identification information, controllable relationship information, and the remaining number of configurable scenarios.
[0034] In the above embodiment, when the target gateway is a local gateway, the target gateway can execute the target scenario without connecting to the network generated by other devices such as routers. The target gateway is connected to the scenario center, and the scenario center can determine the network status information of the target gateway, that is, the scenario center can determine whether the target gateway is online. The identification information of the target gateway is used to identify whether the target gateway has the ability to execute the target scenario. The controllable relationship information is used to indicate whether the target gateway can control the devices in the scenario.
[0035] In the above embodiment, the maximum number of configurable scenarios allowed by the target gateway can be determined. Therefore, when determining the state information, the number of configurable scenarios remaining in the target gateway also needs to be determined. That is, it is determined whether the target gateway is still configured to execute scenarios. When determining the remaining number, the maximum number of configurable scenarios pre-configured for the target gateway and the current number of scenarios currently executed by the target gateway can be first determined, and the difference between the maximum number of configurable scenarios and the current number is determined as the remaining number.
[0036] In the above embodiment, the maximum number of configurable scenarios can be a predetermined number or a number that the target gateway can bear. For example, if the target gateway can execute 5 scenarios simultaneously, the maximum number of configurable scenarios can be 5. However, due to the performance of the target gateway, the running speed may be slow when executing 5 scenarios simultaneously. Therefore, the maximum number of configurable scenarios of the target gateway can be set to 3.
[0037] In an exemplary embodiment, determining the status information of the target gateway includes: determining the target device corresponding to the target scene; determining the controllable relationship between the target gateway and the target device; determining the identification information of the target gateway, the remaining number of configurable scenes of the target gateway, and the network status of the target gateway; determining the status information based on the controllable relationship, the identification information, the remaining number, and the network status. In this embodiment, when determining the status information of the target gateway, the target device corresponding to the target scene can be determined. That is, the target device required when executing the target scene. For example, in the above-mentioned home scene, the target devices may include lights, curtains, air conditioners, water heaters, and after determining the target devices, the controllable relationship between the target devices and the target gateway can be determined, that is, determining whether the target gateway can control the target device.
[0038] In the above embodiment, when determining the status information, it is also necessary to determine the identification information of the target gateway. The identification information is used to identify whether the target gateway has the ability to execute the target scenario. For example, the version type of the target gateway is identified. When the version type of the target gateway is a predetermined version type, it is determined that the target gateway has the ability to execute the target scenario. When the target gateway is a version other than the predetermined version type, it is determined that the target gateway does not have the ability to execute the target scenario. The predetermined version type can be a predetermined version type. When the target gateway does not have the ability to execute the target scenario, an upgrade request can be sent to the manufacturer of the target gateway or other equipment that can upgrade the target gateway version. And when the upgrade is allowed, the version of the target gateway is upgraded.
[0039] In the above embodiment, when determining the state information, it is also necessary to determine the remaining number of configurable scenarios of the target gateway and the network state. The state information of the target gateway is determined according to the controllable relationship, identification information, remaining number and network state.
[0040] In the above embodiment, when determining the status information of the target gateway, the scene center may send a query request to the device center, and determine the status information according to the result returned by the device center. The device center may be a background processor for managing all devices in the application scene (i.e., the scene applied by this application), such as the devices and gateways in the target scene.
[0041] In an exemplary embodiment, determining the state information based on the controllable relationship, the identification information, the remaining number, and the network state includes: determining that the state information satisfies the predetermined condition when the controllable relationship indicates that the target gateway is allowed to control all devices included in the target device, the identification information indicates that the target gateway supports the execution of the target scenario, the remaining number is greater than a predetermined threshold, and the network state is an online state; determining that the state information does not satisfy the predetermined condition when at least one of the following states exists: the controllable relationship indicates that the target gateway is not allowed to control any device included in the target device, the identification information indicates that the target gateway does not support the execution of the target scenario, the remaining number is less than or equal to a predetermined threshold, and the network state is an offline state. In this embodiment, when the determined controllable relationship, identification information, remaining number, and network state all meet the requirements, it is determined that the state information meets the predetermined condition. Among them, when the controllable relationship indicates that the target gateway is allowed to control all devices in the target device, it is determined that the controllable relationship meets the requirements. When the identification information indicates that the target gateway supports the local scenario type, that is, the target gateway supports the execution of the target scenario, it is determined that the identification information meets the requirements. When the remaining number is greater than a predetermined threshold, it is determined that the remaining number meets the requirements. The predetermined threshold can be 0, 1, etc. It should be noted that the predetermined threshold is a customizable value, and the present invention does not limit this. When the network status is online, that is, when the target gateway is connected to the scene center line, it is determined that the network status meets the requirements.
[0042] In the above embodiment, the controllable relationship indicates that the target gateway is not allowed to control at least one of the target devices. For example, in the home scene, the target devices include lights, curtains, air conditioners and water heaters. When the target gateway cannot control the curtains, it is considered that the controllable relationship does not meet the predetermined conditions. When the identification information indicates that the target gateway does not support the execution of the target scene, that is, when the type of the target gateway does not support the local scene type, it can be determined that the status information does not meet the predetermined conditions. When the remaining number is less than or equal to a predetermined threshold, it can also be determined that the status information does not meet the predetermined conditions. When the network status is offline, it can also be determined that the status information does not meet the predetermined conditions.
[0043] In the above embodiment, when the status information does not meet the predetermined conditions, it means that the target gateway does not support the execution of the target scenario. Therefore, a selection failure prompt can be fed back to the target application, and an alternative gateway can be determined according to the target scenario and the type of the target gateway, and the identification information of the alternative gateway can be sent to the target application, and the identification information of the alternative gateway can be displayed in the target application. This prompts the user to select an alternative gateway to execute the target scenario. Among them, the gateway type of the alternative gateway is the same as the gateway type of the target gateway. The alternative gateway is a gateway that can execute the target scenario. That is, when it is determined that the target gateway selected by the user cannot execute the target scenario, the gateway type of the target gateway can be determined. When the gateway type is a local gateway, an alternative gateway that can execute the target scenario can be found in the local gateway.
[0044] In an exemplary embodiment, after sending a script pull instruction to the target gateway, the method further includes: determining the current gateway that executes the target scenario; and when the current gateway is a local gateway other than the target gateway, controlling the other local gateway to delete the scenario script. In this embodiment, after sending a script pull instruction to the target gateway, the current gateway that currently executes the target scenario can be determined, and when the current gateway is a local gateway other than the target gateway, the other local gateway can be controlled to delete the scenario script. That is, when the current gateway and the target gateway are both local gateways, when selecting the target gateway, the function of switching from the local gateway to the local gateway is implemented. In the process of switching the local gateway, after controlling the target gateway to pull the scenario script, the current gateway can be controlled to delete its stored scenario script.
[0045] In the above embodiment, when the current gateway is in the cloud, the target gateway only needs to pull the scene script from the running. The scene script can be stored in the cloud, and the gateway can pull the scene script from the cloud, store it locally, and execute it according to the scene script when executing the target scene.
[0046] In the above embodiment, when the current gateway is a local gateway, when the scene is switched to the target gateway for execution, the current gateway does not need to execute the scene script, and the locally stored scene script can be deleted to save storage space.
[0047] In an exemplary embodiment, after determining the gateway type of the target gateway, the method further includes: when the gateway type indicates that the target gateway is a cloud-based gateway, instructing the cloud-based gateway to execute the target scenario. In this embodiment, when the target gateway is a cloud-based gateway, the cloud-based gateway can directly execute the target scenario. If the current gateway is a local gateway, the current gateway can be controlled to delete the locally stored scenario script.
[0048] In an exemplary embodiment, before receiving a gateway selection instruction, the method further includes: receiving a gateway query instruction; querying the network status of the gateway based on the gateway query instruction; sending the gateway and the network status corresponding to the gateway to the target application to instruct the target application to display the gateway and the network status corresponding to the gateway. In this embodiment, before receiving a gateway selection instruction, a gateway query instruction may also be received. That is, before selecting a gateway, a query instruction may be sent to the scene center. After receiving the query instruction, the scene center may query the network status of all gateways, and send the gateway and its corresponding network status to the target application to display the gateway and its network status in the target application. The user may select the target gateway based on the network status. That is, the user may select the target gateway from the online gateways.
[0049] The following describes a method for determining a scenario operation gateway in conjunction with a specific implementation method:
[0050] Figure 3 The method flow of determining the scenario operation gateway according to a specific embodiment of the present invention is Figure 1 ,like Figure 3As shown, this process is the case where the gateway running the scene is transferred from the cloud to the local. The user can instruct the scene center to query which gateways are available in the home through the APP (corresponding to the above-mentioned target application), the scene center queries the registered gateways in the home, and queries the device center whether the gateway in the home is online. The device center returns the result. After receiving the result, the scene center forwards the result to the APP, and the user can manually change the cloud scene to the local scene. The scene center can filter out all the devices configured in the scene, and query the device center for the controllable relationship between the device and the gateway, and the device center returns the result. The scene center can also determine whether the gateway specified by the user (corresponding to the above-mentioned target gateway) can control all the devices in the scene (corresponding to the above-mentioned target device), and determine whether the typeID of the gateway (corresponding to the above-mentioned identification information) is a type that can support local scenes. The scene center can also query whether there are any remaining configurable scenes for the gateway. The scene center can also query the device center for the status of the gateway. After the device center returns the result, the scene center can determine whether the gateway is online. If the status of the scene center meets the predetermined conditions, the scene center can modify the scene running location to the gateway and update the scene to the local scene. And notify the device center to instruct the gateway to pull the edge scene script (corresponding to the above-mentioned scene script). The device center sends a command to the terminal module (corresponding to the target gateway) to pull the scene script. The device center can return the result of the command operation. After the gateway pulls the scene script, it can execute the target scene. The device center can return the result to the scene center, and the scene center sends the returned result to the APP.
[0051] Figure 4 The method flow of determining the scenario operation gateway according to a specific embodiment of the present invention is Figure 2 ,like Figure 4As shown, this process is the case of transferring the gateway running the scene from local to local. The user can instruct the scene center to query which gateways are available in the home through the APP (corresponding to the above target application), the scene center to query the registered gateways in the home, and to query the device center whether the gateway in the home is online. The device center returns the result. After receiving the result, the scene center forwards the result to the APP, and the user can manually change the cloud scene to the local scene. The scene center can filter out all the devices configured in the scene, and query the device center for the controllable relationship between the device and the gateway, and the device center returns the result. The scene center can also determine whether the gateway specified by the user (corresponding to the above target gateway) can control all the devices in the scene (corresponding to the above target device), and determine whether the typeID of the gateway (corresponding to the above identification information) is a type that can support local scenes. The scene center can also query whether there are any remaining configurable scenes for the gateway. The scene center can also query the device center for the status of the gateway. After the device center returns the result, the scene center can determine whether the gateway is online. If the status of the scene center meets the predetermined conditions, the scene center can modify the scene running location to the gateway and update the scene to the local scene. And notify the device center to instruct the gateway to pull the edge scene script (corresponding to the above scene script). The device center sends a command to the gateway to pull the scene script. The device center can return the result of the command operation. After the gateway pulls the scene script, it can execute the target scene. The scene center can also notify the device center to instruct the original running gateway (corresponding to the above current gateway) to delete the edge script. The device center sends a command to the terminal module (corresponding to the above target gateway) and returns the result to the scene center, which sends the returned result to the APP.
[0052] Figure 5 The method flow of determining the scenario operation gateway according to a specific embodiment of the present invention is Figure 3 ,like Figure 5 As shown in the figure, the process is to transfer the gateway running the scene from the local to the cloud. The user can manually change the local scene to the cloud scene through the APP. The scene center updates the scene to the cloud scene and notifies the device center to instruct the gateway to delete the edge scene script. The device center sends a command to the terminal module (corresponding to the above-mentioned target gateway) to instruct the gateway to delete the edge scene script. The device center can send the command operation result to the scene center, and the scene center will return the result to the APP.
[0053] In the above embodiments, the created scene running location can be managed by the user from the user's perspective. The user can run the scene in the cloud or on a gateway designated by the user according to his / her wishes, thereby improving the user experience and increasing user participation.
[0054] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0055] In this embodiment, a device for determining a scene operation gateway is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0056] Figure 6 is a structural block diagram of a device for determining a scenario operation gateway according to an embodiment of the present invention, such as Figure 6 As shown, the device comprises:
[0057] A receiving module 62, configured to receive a gateway selection instruction sent by a target application, wherein the gateway selection instruction is used to indicate a target gateway for executing a target scenario;
[0058] A determination module 64, configured to determine the gateway type of the target gateway;
[0059] A sending module 66, configured to send a script pull instruction to the target gateway when the gateway type indicates that the target gateway is a local gateway, so as to instruct the target gateway to pull the scene script of the target scene;
[0060] The execution module 68 is used to control the target gateway to execute the target scenario based on the scenario script.
[0061] Through the present invention, a selection instruction for a target gateway for instructing to execute a target scenario sent by a target application is received, the gateway type of the target gateway is determined, and when the gateway type indicates that the target gateway is a local gateway, a script pull instruction is sent to the target gateway to instruct the target gateway to pull the scenario script of the target scenario, and the target gateway is controlled to execute the target scenario according to the scenario script. Since the user can select the target gateway through the target application, and send a selection instruction for selecting the target gateway to indicate the selection of the target gateway as the execution gateway of the target scenario. Therefore, the problem of the inability to customize the running gateway of the scenario existing in the related art can be solved, the effect of the running gateway of the customized scenario is achieved, and the user experience is improved.
[0062] In an exemplary embodiment, the sending module 66 may send the script pull instruction to the target gateway in the following manner: determine the status information of the target gateway; and send the script pull instruction to the target gateway when the status information indicates that the target gateway meets a predetermined condition.
[0063] In an exemplary embodiment, the sending module 66 can determine the status information of the target gateway in the following manner: determine the target device corresponding to the target scenario; determine the controllable relationship between the target gateway and the target device; determine the identification information of the target gateway, the remaining number of configurable scenarios of the target gateway, and the network status of the target gateway; determine the status information based on the controllable relationship, the identification information, the remaining number, and the network status.
[0064] In an exemplary embodiment, the sending module 66 can determine the status information based on the controllable relationship, the identification information, the remaining number and the network status in the following manner: when the controllable relationship indicates that the target gateway is allowed to control all devices included in the target device, the identification information indicates that the target gateway supports the execution of the target scenario, the remaining number is greater than a predetermined threshold, and the network status is an online state, determine that the status information satisfies the predetermined condition; when at least one of the following states exists, determine that the status information does not satisfy the predetermined condition: the controllable relationship indicates that the target gateway is not allowed to control any device included in the target device, the identification information indicates that the target gateway does not support the execution of the target scenario, the remaining number is less than or equal to the predetermined threshold, and the network status is an offline state.
[0065] In an exemplary embodiment, the device can be used to determine the current gateway executing the target scenario after sending a script pull instruction to the target gateway; when the current gateway is a local gateway other than the target gateway, control the other local gateway to delete the scenario script.
[0066] In an exemplary embodiment, the apparatus may be configured to, after determining a gateway type of the target gateway, instruct the cloud to execute the target scenario if the gateway type indicates that the target gateway is a cloud.
[0067] In an exemplary embodiment, the device can also be used to receive a gateway query instruction before receiving a gateway selection instruction; query the network status of the gateway based on the gateway query instruction; send the gateway and the network status corresponding to the gateway to the target application to instruct the target application to display the gateway and the network status corresponding to the gateway.
[0068] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0069] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0070] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0071] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0072] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0073] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0074] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0075] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for determining a scene operation gateway, characterized in that: include: Receiving a gateway selection instruction sent by a target application, wherein the gateway selection instruction is used to indicate a target gateway for executing a target scenario; Determining the gateway type of the target gateway; In a case where the gateway type indicates that the target gateway is a local gateway, sending a script pull instruction to the target gateway to instruct the target gateway to pull the scene script of the target scene; Controlling the target gateway to execute the target scenario based on the scenario script; Sending the script pull instruction to the target gateway includes: determining the status information of the target gateway; sending the script pull instruction to the target gateway when the status information indicates that the target gateway meets a predetermined condition; Determining the status information of the target gateway includes: determining the target device corresponding to the target scenario; determining the controllable relationship between the target gateway and the target device; determining the identification information of the target gateway, the remaining number of configurable scenarios of the target gateway, and the network status of the target gateway; and determining that the status information satisfies the predetermined condition when the controllable relationship indicates that the target gateway is allowed to control all devices included in the target device, the identification information indicates that the target gateway supports execution of the target scenario, the remaining number is greater than a predetermined threshold, and the network status is an online state.
2. The method according to claim 1, characterized in that Determining the state information based on the controllable relationship, the identification information, the remaining number, and the network state includes: In the presence of at least one of the following states, it is determined that the state information does not satisfy the predetermined condition: the controllable relationship indicates that the target gateway is not allowed to control any device included in the target device, the identification information indicates that the target gateway does not support the execution of the target scenario, the remaining number is less than or equal to a predetermined threshold, and the network state is offline.
3. The method according to claim 1, characterized in that After sending the script pull instruction to the target gateway, the method further includes: Determining a current gateway for executing the target scenario; In the case that the current gateway is other local gateway except the target gateway, the other local gateway is controlled to delete the scenario script.
4. The method according to claim 1, characterized in that: After determining the gateway type of the target gateway, the method further includes: When the gateway type indicates that the target gateway is a cloud-end gateway, the cloud-end gateway is instructed to execute the target scenario.
5. The method according to claim 1, characterized in that Before receiving the gateway selection instruction, the method further includes: Receive gateway query instructions; Querying the network status of the gateway based on the gateway query instruction; The gateway and the network status corresponding to the gateway are sent to the target application to instruct the target application to display the gateway and the network status corresponding to the gateway.
6. A device for determining a scene operation gateway, characterized in that: include: A receiving module, used to receive a gateway selection instruction sent by a target application, wherein the gateway selection instruction is used to indicate a target gateway for executing a target scenario; A determination module, used to determine the gateway type of the target gateway; A sending module, configured to send a script pulling instruction to the target gateway when the gateway type indicates that the target gateway is a local gateway, so as to instruct the target gateway to pull the scene script of the target scene; An execution module, used for controlling the target gateway to execute the target scenario based on the scenario script; The sending module sends the script pull instruction to the target gateway in the following manner: determining the status information of the target gateway; and sending the script pull instruction to the target gateway when the status information indicates that the target gateway meets a predetermined condition; The sending module determines the status information of the target gateway in the following manner: determines the target device corresponding to the target scenario; determines the controllable relationship between the target gateway and the target device; determines the identification information of the target gateway, the remaining number of configurable scenarios of the target gateway, and the network status of the target gateway; and determines that the status information satisfies the predetermined condition when the controllable relationship indicates that the target gateway is allowed to control all devices included in the target device, the identification information indicates that the target gateway supports the execution of the target scenario, the remaining number is greater than a predetermined threshold, and the network status is an online state.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 5 when executed by a processor.
8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 5.
