Disclosure of Invention
In order to solve the existing technical problems, the application provides an intelligent household equipment scene configuration method and device, an intelligent household equipment control method and device, an intelligent device and a computer readable storage medium, wherein the intelligent household equipment scene configuration method and device can be flexibly configured and the configuration difficulty is reduced.
In order to achieve the above object, the technical solution of the embodiment of the present application is as follows:
in a first aspect, an embodiment of the present application provides a method for configuring a scene of an intelligent home device, which is applied to a terminal device, and includes:
Acquiring a configuration request of a target scene;
Acquiring a configuration instruction of a nested scene corresponding to the configuration request and/or an action setting instruction of the target intelligent home equipment to form configuration data;
And sending the configuration data to a server, forming scene execution data corresponding to the target scene by the server according to the configuration data, and sending the scene execution data to a gateway corresponding to the target scene.
In the above embodiment, the terminal device obtains the configuration request of the target scene of the user, forms the configuration data according to the configuration instruction of the nested scene corresponding to the configuration request and/or the action setting instruction of the target smart home device, and sends the configuration data to the server, and the server forms the scene execution data corresponding to the target scene according to the configuration data, so that the user can complete the configuration by selecting the known scene to nest, or can directly set the action of the target smart home device to complete the configuration, and the configuration step of the target scene can be simplified by supporting the nested known scene to configure the target scene, and the configuration data of the target scene including the nested scene only needs to store the identification of the nested scene without repeatedly storing the action data included in the nested scene.
In a second aspect, an embodiment of the present application provides a method for configuring a scene of an intelligent home device, which is applied to a server, and includes:
receiving configuration data corresponding to a configuration request of a target scene sent by a terminal device, wherein the configuration data comprises a configuration instruction of a nested scene corresponding to the configuration request and/or an action setting instruction of the target intelligent home device;
Generating a corresponding target scene identifier according to the configuration data, forming scene execution data corresponding to the target scene, and sending the scene execution data to a gateway corresponding to the target scene, wherein the scene execution data comprises the target scene identifier, the nested scene identifier and/or execution action data of the target intelligent home equipment.
In the above embodiment, the server receives the configuration data corresponding to the configuration request of the target scene sent by the terminal device, generates the corresponding target scene identifier according to the configuration data, forms the scene execution data corresponding to the target scene, and sends the scene execution data to the gateway corresponding to the target scene, so that the user can complete the configuration by selecting the known scene to nest, and can also complete the configuration by directly setting the action of the target smart home device, and the configuration step of the target scene can be simplified by supporting the nesting known scene to configure the target scene.
In a third aspect, an embodiment of the present application provides a method for controlling an intelligent home device, which is applied to a gateway, including:
acquiring a target scene execution instruction, and determining scene execution data corresponding to a target scene according to the target scene execution instruction;
determining scene execution data corresponding to a nested scene according to the nested scene identifier under the condition that the scene execution data comprises the nested scene identifier;
And under the condition that the scene execution data is execution action data of the intelligent household equipment, issuing the execution action data to the corresponding intelligent household equipment for corresponding execution.
In the above embodiment, when the user performs the target scene configuration by using the terminal device, the server side forms the scene execution data according to the configuration request and the configuration data of the terminal device, and stores the scene execution data in the gateway, and when the target scene control is performed, the gateway obtains the scene execution instruction sent by the terminal device, determines the scene execution data corresponding to the target scene, and determines the scene execution data corresponding to the nested scene according to the nested scene identifier when the scene execution data includes the nested scene identifier, and issues the execution action data to the corresponding intelligent home device to perform corresponding execution when the scene execution data is the execution action data of the intelligent home device, so that the scene execution data of the target scene including the nested scene does not need to repeatedly store the action data included in the nested scene through the mutual nesting of the scenes, thereby saving the storage consumption of the gateway and having more intuitive scene execution.
In a fourth aspect, an embodiment of the present application provides a method for controlling an intelligent home device, including:
the terminal equipment receives an execution request of a target scene and sends the execution request to the server;
after the server receives the execution request, sending a target scene execution instruction to a gateway corresponding to the target scene;
the gateway determines scene execution data corresponding to the target scene according to the target scene execution instruction, determines the scene execution data corresponding to the nested scene according to the nested scene identification when the scene execution data comprises the nested scene identification, and issues the execution action data to the corresponding intelligent household equipment for corresponding execution when the scene execution data is the execution action data of the intelligent household equipment.
In the embodiment, the terminal device receives the execution request of the target scene and sends the execution request to the server, the server receives the execution request and then sends the target scene execution instruction to the gateway corresponding to the target scene, the gateway determines scene execution data corresponding to the target scene according to the target scene execution instruction, the scene execution data corresponding to the nested scene is determined according to the nested scene identifier when the scene execution data comprises the nested scene identifier, and the execution action data is sent to the corresponding intelligent home device to be correspondingly executed when the scene execution data is the execution action data of the intelligent home device.
In a fifth aspect, an embodiment of the present application provides an intelligent home device scene configuration apparatus, including:
The configuration request module is used for acquiring a configuration request of the target scene;
The configuration data module is used for acquiring a configuration instruction of a nested scene corresponding to the configuration request and/or an action setting instruction of the target intelligent home equipment to form configuration data;
and the sending module is used for sending the configuration data to a server, forming scene execution data corresponding to the target scene by the server according to the configuration data, and sending the scene execution data to a gateway corresponding to the target scene.
In a sixth aspect, an embodiment of the present application provides an intelligent home device scene configuration apparatus, including:
The system comprises a receiving module, a target intelligent home device and a target intelligent home device, wherein the receiving module is used for receiving configuration data corresponding to a configuration request of the target scene, which is sent by a terminal device, wherein the configuration data comprises a configuration instruction of a nested scene corresponding to the configuration request and/or an action setting instruction of the target intelligent home device;
The scene configuration module is used for generating a corresponding target scene identifier according to the configuration data, forming scene execution data corresponding to the target scene, and sending the scene execution data to a gateway corresponding to the target scene, wherein the scene execution data comprises the target scene identifier, the nested scene identifier and/or execution action data of the target intelligent home equipment.
In a seventh aspect, an embodiment of the present application provides an intelligent home device control apparatus, including:
the acquisition module is used for acquiring a target scene execution instruction and determining scene execution data corresponding to a target scene according to the target scene execution instruction;
The nesting module is used for determining scene execution data corresponding to a nesting scene according to the nesting scene identification under the condition that the scene execution data comprises the nesting scene identification;
And the execution module is used for issuing the execution action data to the corresponding intelligent household equipment for corresponding execution under the condition that the scene execution data is the execution action data of the intelligent household equipment.
In an eighth aspect, an embodiment of the present application provides an intelligent device, including a processor, a memory, and a computer program stored in the memory and executable by the processor, where the computer program when executed by the processor implements the intelligent home device scene configuration method according to any one embodiment of the present application or the intelligent home device control method according to any one embodiment of the present application.
In a ninth aspect, an embodiment of the present application further provides a computer readable storage medium, where a computer program is stored on the computer readable storage medium, where the computer program when executed by the processor implements a method for configuring a scene of an intelligent home device according to any one embodiment of the present application or a method for controlling an intelligent home device according to any one embodiment of the present application.
In the above embodiments, the intelligent home device scene configuration apparatus, the intelligent home device control apparatus, the intelligent device, and the computer readable storage medium respectively belong to the same concept as the corresponding intelligent home device scene configuration method and intelligent home device control method embodiments, so that the same technical effects as the corresponding intelligent home device scene configuration method and intelligent home device control method embodiments respectively are provided, and are not described herein again.
Detailed Description
The technical scheme of the application is further elaborated below by referring to the drawings in the specification and the specific embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the implementations of the application. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
In the description of the present application, it should be understood that the terms "center," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like indicate orientations or positional relationships based on the orientation or positional relationships shown in the drawings, merely to facilitate describing the present application and simplify the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present application. In the description of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
In the description of the present application, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected, directly connected, or indirectly connected through an intermediary, or may be in communication with the interior of two elements. The specific meaning of the above terms in the present application will be understood in specific cases by those of ordinary skill in the art.
Referring to fig. 1, an architecture diagram of an internet of things system for an optional application scenario of an intelligent home device scenario configuration method and an intelligent home device control method according to an embodiment of the present application is shown, where the internet of things system includes a terminal device 11, a server 12, a gateway 13, and an intelligent home device 14. The terminal device 11 is a device with communication and storage functions, such as a smart phone, a desktop computer, a notebook computer, a tablet computer, or other intelligent communication devices with network connection functions. The server 12 may include one or more physical servers, such as a network access server, a database server, a cloud server, and the like. Optionally, the gateway 13 may be a gateway device built based on ZigBee, the smart home device 14 accesses the gateway 13 and is controlled by the terminal device 11, and the terminal device 11 installs a client capable of managing the smart home, where the client may be an application client (such as a mobile APP) or a web client, which is not limited herein. The user can control the intelligent home equipment 14 through operating the client, the terminal equipment 11 receives a control instruction input by the user to the intelligent home equipment 14 through the client, communicates with the server 12, and the server 12 forwards the control instruction input by the user to the corresponding intelligent home equipment 14 through the gateway 13, so that remote intelligent control to the intelligent home equipment 14 is realized. The smart home device 14 may be a device that is added to the gateway 13 in advance, for example, the smart home device 14 may be a device in a set to which the gateway 13 belongs, which is preset when the gateway leaves the factory, or may be a device that is connected to the gateway 13 through a user operation later.
Optionally, the smart home device 14 may establish a network connection with the gateway 13 based on the ZigBee protocol, thereby joining the ZigBee network.
The intelligent home equipment 14 and the terminal equipment 11 can be connected into the Ethernet through the gateway 13, and the gateway 13 can be connected into the server 12 through a wired or wireless communication connection mode. For example, the gateway 13 and the terminal device 11 may store the acquired information in the server 12. Optionally, the terminal device 11 may also establish a network connection with the server 12 through 2G/3G/4G/5G, wiFi or the like, so as to obtain data issued by the server 12.
Optionally, the terminal device 11, the gateway 13 and the smart home device 14 may be in the same local area network, or may be in the same wide area network as the server 12. When the terminal device 11 and the gateway 13 are in the same local area network, the terminal device 11 may interact with the gateway 13 and the smart home device 14 connected to the gateway 13 through a local area network path, or may interact with the gateway 13 and the smart home device 14 connected to the gateway 13 through a wide area network path. When the terminal device 11 and the gateway 13 are not in the same local area network, the terminal device 11 may interact with the gateway and the smart home device 14 connected to the gateway 13 through a wide area network path. The internet of things system can further realize the control of opening or closing the intelligent home equipment 14 in the range of the local area network or correspondingly connected with the intelligent home equipment 14 through the intelligent home equipment 14. The smart home devices 14 may include, but are not limited to, smart home products such as smart lights, automatic curtains, air conditioners, etc.
Referring to fig. 2, a method for configuring a scene of an intelligent home device according to an embodiment of the present application may be applied to the terminal device shown in fig. 1. The intelligent home equipment scene configuration method includes but is not limited to S101, S103 and S105, and specifically introduced as follows:
s101, acquiring a configuration request of a target scene.
The target scene refers to a scene that the user currently wants to create. The configuration request of the terminal device for obtaining the target scene may be that the terminal device is used for controlling the client of the smart home device to include a scene setting page, the terminal device obtains an operation instruction for creating the target scene, which is input by a user in the scene setting page, and forms the configuration request of the target scene according to the operation instruction. Optionally, a control key for creating a scene is provided in the scene setting page, the terminal device detects a touch operation of a user on the control key for creating the scene, and a configuration request of the target scene is formed according to the touch operation. The configuration request for the terminal device to acquire the target scene based on the scene setting page may also be based on a preset voice command, gesture command, etc., which is not limited herein.
S103, acquiring configuration instructions of nested scenes corresponding to the configuration requests and/or action setting instructions of the target intelligent home equipment to form configuration data.
Nested scenes refer to any other scene that has been created prior to the creation of the current target scene. The user creates one or more scenes for controlling the intelligent home equipment through the terminal equipment, and each scene can correspondingly contain one or more set data for executing actions of the intelligent home equipment. Smart home devices may include, but are not limited to, any smart home product that a user of a light fixture, window covering, television, monitoring system, etc. wants to remotely control through a terminal device. The scenes are related to personal preferences, living habits and the like of the user, and under different scenes, the user wants to open or close the intelligent home equipment, and the user can directly select the scene which needs to be entered currently by creating the scenes in advance and presetting the actions of one or more target intelligent home equipment contained in the corresponding scenes, so that the control operation is simplified. The action setting instruction of the target intelligent household equipment refers to the selected instruction of the user for opening and closing the intelligent household equipment and different working modes. Taking the intelligent home equipment as the lamp 1 as an example, the action setting instruction for the lamp 1 can comprise that the lamp 1 is turned on, the lamp 1 is turned off, the working mode of the lamp 1 is an intelligent detection brightness mode, and the like.
The terminal device obtains configuration instructions of the nested scenes corresponding to the configuration requests and/or action setting instructions of the target intelligent home devices, and configuration data is formed, wherein the configuration instructions for the creation of the target scenes can only comprise the configuration instructions of the nested scenes or the action setting instructions of the target intelligent home devices or both the configuration instructions of the nested scenes and the action setting instructions of the target intelligent home devices.
Taking a case that a user wants to create a new scene D, the created scenes include a scene a, a scene B and a scene C, wherein the scene a includes that a lamp 1 is turned on, a lamp 2 is turned off, a curtain 1 is turned off, the scene B includes that a television 1 is turned on, an air conditioner 1 is turned on, and the scene C includes that the lamp 1 is turned off and the curtain 1 is turned on. Then when the user inputs a request for creation of scene D through the terminal device, scene a, scene B, and scene C may all be alternative nested scenes. If the scene D that the user wants to create is that the lamp 1 is on, the lamp 2 is off, the curtain 1 is off, the television 1 is on, and the air conditioner 1 is on, after the user inputs the creation operation of the scene D through the terminal device, the user can further select the scene a and the scene B as nested scenes of the scene D, so that the terminal device obtains the configuration instruction of the nested scenes corresponding to the configuration request of the scene D.
If the scene D which the user wants to create is that the lamp 1 is on, the lamp 2 is off, the curtain 1 is off, and the air conditioner 1 is on, after the user inputs the creation operation of the scene D through the terminal device, the user can further select the scene A as a nested scene of the scene D and acquire an action setting instruction for controlling the air conditioner 1 to be started, so that the terminal device acquires a configuration instruction of the nested scene corresponding to the configuration request of the scene D and an action setting instruction of the target intelligent household device.
S105, the configuration data is sent to a server, scene execution data corresponding to the target scene is formed by the server according to the configuration data, and the scene execution data is sent to a gateway corresponding to the target scene.
The scene execution data refers to the corresponding intelligent household equipment to be controlled in the target scene and the setting data of the actions of the intelligent household equipment. The terminal equipment sends configuration data formed by a configuration instruction of a corresponding nested scene and/or an action setting instruction of the target intelligent home equipment, which are received according to a configuration request of the target scene, to the server, the server forms scene execution data corresponding to the target scene according to the configuration data, and sends the scene execution data to a gateway corresponding to the target scene, so that the configuration of the target scene is completed. The server side sends the scene execution data of the target scene to the gateway for storage, so that the gateway can control corresponding intelligent household equipment according to the scene execution data when the target scene is controlled next time.
In the above embodiment, the terminal device obtains a configuration request of a target Scene of a user, forms configuration data according to a configuration instruction of a nesting Scene corresponding to the configuration request and/or an action setting instruction of the target smart home device, and sends the configuration data to the server, and the server forms Scene execution data corresponding to the target Scene according to the configuration data, so that the user can complete the configuration by selecting a known Scene to nest, and can also complete the configuration by directly setting actions of the target smart home device, for example, a user family has a Scene1 with a living room lamp fully closed and a Scene2 with a bedroom lamp fully closed, if an off Scene needs to be created, the Scene1 and the Scene2 need to be fully closed in the off Scene, the Scene need not to be added as nesting scenes of the off Scene, and only the Scene1 and the Scene2 need not to be added one by one, and the gateway need not to send respective Scene identifiers of the Scene1 and the Scene2 to the gateway during the configuration, for the configuration can be completed, for the gateway need not to successfully send the Scene1 and the Scene2, and the target Scene can be stored in a flexible manner, and the configuration can be stored, thereby achieving the effects of saving the configuration difficulty and the steps.
In some embodiments, referring to fig. 3, s103, obtaining a configuration instruction of a nesting scene corresponding to the configuration request and/or an action setting instruction of a target smart home device to form configuration data includes:
S1031, displaying a configuration page of the target scene according to the configuration request;
S1033, receiving a configuration instruction of a nested scene and/or an action setting instruction of the target intelligent home equipment based on the configuration page, and forming configuration data according to the configuration instruction of the nested scene and/or the action setting instruction of the target intelligent home equipment.
The terminal device displaying the configuration page of the target scene according to the configuration request may be that the terminal device is configured to control the client of the smart home device to include the configuration page, and when the terminal device obtains an operation instruction for creating the target scene, which is input by a user in the scene setting page, the terminal device forms the configuration request of the target scene according to the operation instruction, and displays the configuration page of the target scene based on the configuration request. The configuration page can display configuration options for user selection, such as a selection list of nested scenes and a selection list of intelligent home equipment, and a user can directly select nested scenes which need to be nested in a current target scene in the configuration page, and/or select intelligent home equipment which needs to be contained in the current target scene and select execution actions corresponding to the intelligent home equipment, and the configuration instructions of the nested scenes and/or action setting instructions of the target intelligent home equipment are obtained according to the operation of the user on the configuration page, so that configuration data corresponding to the target scene are formed.
Optionally, the configuration options in the configuration page may be other forms, such as a configuration page provided with a nested scene input box and an intelligent home device input box, in which the user directly inputs the identifier of the nested scene to be nested and the intelligent home device to be contained in the current target scene and selects the corresponding execution action of the intelligent home device, or may be a document in which the user uploads the identifier of the nested scene to be nested and the intelligent home device to be contained in the current target scene and selects the corresponding execution action of the intelligent home device, in a specified format.
In some embodiments, the smart home device configuration method further includes:
And acquiring a shortcut setting instruction of the target scene, and adding a shortcut starting key of the target scene to a designated page according to the shortcut setting instruction.
The shortcut setting instruction refers to an instruction input by a user indicating whether to add a shortcut start of the target scene. Optionally, a sliding selection key for adding the shortcut start mode of the target scene to the home page may be provided in the configuration page of the scene, and the user may operate the sliding selection key to add the shortcut start key of the target scene to the desktop of the terminal device, or add the shortcut start key of the target scene to the home page of the client.
In the embodiment of the application, the user can add the commonly used scene to the desktop or the home page of the client by setting the shortcut starting mode of the target scene, thereby facilitating the operation.
In some embodiments, the smart home device configuration method further includes:
And acquiring a test instruction of a target scene, sending the test instruction to a gateway, and controlling the associated intelligent home equipment to complete the test by the gateway according to the test instruction.
The associated intelligent home equipment refers to intelligent home equipment related to a target scene to be tested currently. And the completion of the test means that after the associated intelligent home equipment receives the test instruction, the intelligent home equipment automatically returns to the state before the test after executing corresponding actions for a preset time according to the configuration data of the target scene. If the target scene includes a nested scene a and an execution action of the lamp 1, wherein the nested scene a includes execution actions of the lamp 2 and the television 3, after receiving a test instruction for the target scene, the gateway controls the lamp 1, the lamp 2 and the television 2 to execute corresponding actions for a preset time and then return to a state before testing. The obtaining the test instruction for the target scene may be after the target scene is configured, or in the process of configuring the target scene, so that a user can conveniently confirm whether the current configuration operation is the effect desired by the user or not by sending the test instruction, and judge how to accurately adjust when confirming that adjustment is required.
Referring to fig. 4 and fig. 5, which are schematic views of an optional interface of a client for controlling an intelligent home device in a terminal device, the intelligent home device scene configuration method includes the following steps:
S1, the terminal equipment can acquire a scene view instruction, a scene page is displayed according to the scene view instruction, a configured known scene list is displayed in the scene page, and the known scene list displayed in the scene page comprises a film mode, a sleep mode, a game mode, a leaving home mode, a returning home mode and the like as shown in fig. 4-1.
S2, the terminal equipment acquires a scene newly-built instruction based on the scene page, and displays a configuration page of a scene according to the scene newly-built instruction, wherein a "+" type key is arranged on the upper right corner of the scene page, when the clicking operation of a user on the + type key is detected, the scene newly-built instruction is acquired, and configuration options can be displayed in the configuration page, and the configuration options comprise adding action keys as shown in fig. 4-2.
And S3, the terminal equipment acquires an adding action instruction based on the configuration page, displays an adding action page according to the adding action instruction, and acquires the adding action instruction when detecting the touch operation of a user on an adding action key, wherein selectable configuration options such as a scene, a gateway lamp and the like for a scene to be configured currently are displayed in the adding action page as shown in the figure 4-3.
S4, the terminal equipment acquires a configuration instruction of a nested scene based on the adding action page, and displays an optional nested scene list based on the configuration instruction of the nested scene, wherein as shown in fig. 4-4, the configured known scenes are displayed in the nested scene list, a user can directly select one or more known scenes as nested scenes of the current target scene, and/or,
The terminal equipment acquires an action setting instruction of the target intelligent household equipment based on the adding action page, and displays an action setting page of the corresponding intelligent household equipment based on the action setting instruction, wherein as shown in fig. 4-5 and 4-6, when the touch operation of a user on the gateway lamp in the adding action page is detected, the action setting page of the gateway lamp is displayed, and the action setting page comprises execution action options of turning on the night lamp, turning off the night lamp, turning on/off the night lamp, setting the color of the night lamp, playing appointed alarm sound, flashing the night lamp and the like, and as shown in fig. 4-7, when the touch operation of the user on the color of the night lamp is detected, the color setting page of the gateway lamp is displayed, and the user can adjust the selected light color in the color setting page.
And S5, the terminal equipment sends the corresponding configuration data formed by the configuration instruction of the nested scene obtained according to the configuration request of the target scene and/or the action setting instruction of the target intelligent home equipment to the server, after finishing the selection of the configuration parameters of the target scene to be configured currently, the user can click a completion button, and the terminal equipment sends the configuration data corresponding to the configuration request of the target scene to the server according to the completion instruction. As shown in fig. 4-8, the terminal device forms configuration data corresponding to the target scene according to the foregoing operation of the user, and sends the configuration data to the server.
In another aspect of the embodiment of the present application, referring to fig. 6, there is further provided a method for configuring a scene of an intelligent home device, which is applicable to a server as shown in fig. 1, and includes:
S201, receiving configuration data corresponding to a configuration request of a target scene sent by a terminal device, wherein the configuration data comprises a configuration instruction of a nested scene corresponding to the configuration request and/or an action setting instruction of the target intelligent home device;
S203, generating a corresponding target scene identifier according to the configuration data, forming scene execution data corresponding to the target scene, and sending the scene execution data to a gateway corresponding to the target scene, wherein the scene execution data comprises the target scene identifier, the nested scene identifier and/or execution action data of the target intelligent home equipment.
The target scene refers to a scene that the user currently wants to create. The target scene identification refers to an identification, such as a name, a code, and the like, capable of uniquely characterizing the identity of the target scene. The method comprises the steps that communication interaction is carried out between a server side and terminal equipment, the server side receives configuration data corresponding to a configuration request of a target scene sent by the terminal equipment, a corresponding target scene identifier is generated according to configuration request related information of the target scene carried in the configuration data, scene execution data corresponding to the target scene is formed according to configuration instructions of nested scenes and/or action setting instructions of target intelligent home equipment, which are acquired by the configuration data based on the target scene configuration request, and the scene execution data are sent to a gateway corresponding to the target scene, wherein the scene execution data comprise the target scene identifier, the nested scene identifier and/or execution action data of the target intelligent home equipment. Alternatively, the target scene identification may be represented by a scene ID, such as sceneId _ A, sceneId _b, or the like.
In the embodiment of the application, the user can complete the configuration by selecting the known scene and nesting, or can complete the configuration by directly setting the action of the target intelligent home equipment, and the configuration of the target scene is realized by supporting the nested known scene, so that the configuration steps of the target scene can be simplified, the configuration data of the target scene containing the nested scene only need to store the identification of the nested scene, and the repeated storage of the action data contained in the nested scene is not needed, so that the configuration mode is flexible, the configuration difficulty is reduced, and the gateway storage saving effect can be achieved.
Referring to fig. 7, a flowchart of a method for configuring a scenario of an intelligent home device according to an alternative embodiment of the present application includes the following steps:
s11, a client of terminal equipment selects to create a scene A;
And S12, the terminal equipment sends configuration data of the scene A to the server, wherein an optional example of the configuration data can be { [ di 1, resourceId1, di 2, resourceId, ] }, wherein di represents a unique identifier of the intelligent household equipment, resourceId represents a point value of corresponding execution action of the intelligent household equipment, such as closing of a lamp 1 and closing of a socket 1.
S13, the server generates a scene ID (sceneId _A) and sends the scene ID and corresponding configuration data to the gateway;
s14, the gateway carries out association storage on the scene ID and the data to be executed, which are obtained according to the configuration data;
S15, a client of the terminal equipment selects to create a scene B, and the scene B is nested with the scene A and other execution actions;
S16, the server receives configuration data of the scene B, generates a scene ID (sceneId _B), and sends sceneId _B, sceneId _A associated with the scene B and execution action data to the gateway, wherein an optional example of the configuration data can be { sceneId _A, [ did3, resource ID2. ] }.
And S17, the gateway stores sceneId _ B, sceneId _A and execution action data in an associated mode.
In the embodiment, the scene creation support of the intelligent home equipment supports the nesting of the scenes, so that the configuration efficiency and flexibility can be effectively improved.
In another aspect of the embodiment of the present application, referring to fig. 8, a method for controlling an intelligent home device is provided, which can be applied to a gateway shown in fig. 1, and includes:
S301, acquiring a target scene execution instruction, and determining scene execution data corresponding to a target scene according to the target scene execution instruction.
And the user can send out a target scene execution instruction through a client side on the terminal equipment, wherein the client side is used for controlling the intelligent household equipment. The gateway receives a target scene execution instruction sent by the terminal equipment, and controls the associated intelligent home equipment to execute corresponding actions according to corresponding scene execution data stored when the target scene is previously created.
S303, determining scene execution data corresponding to a nested scene according to the nested scene identifier under the condition that the scene execution data comprises the nested scene identifier.
Nested scenes refer to any other scene that has been created prior to the creation of the current target scene. When the current target scene to be executed comprises a nested scene, corresponding scene execution data stored during the creation of the target scene correspondingly also comprises a nested scene identifier, and the scene execution data corresponding to the nested scene is called according to the identifier of the nested scene. It should be noted that, the scenario execution data corresponding to the nested scenario may include execution action data of one or more intelligent home devices, optionally, the scenario execution data corresponding to the nested scenario may also include a sub-nested scenario, and in the case that the nested scenario further includes the sub-nested scenario, the execution action data of one or more intelligent home devices included in the sub-nested scenario is further determined, and the process is repeated until the execution action data of all associated intelligent home devices included in the scenario execution data of the target scenario to be executed currently is obtained.
S305, when the scene execution data is execution action data of the intelligent home equipment, the execution action data is issued to the corresponding intelligent home equipment for corresponding execution.
And under the condition that the scene execution data is the execution action data of the intelligent home equipment, the execution action data of all the associated intelligent home equipment contained in the scene execution data of the target scene to be executed at present can be directly obtained. After the gateway obtains the scene execution data corresponding to the target scene, corresponding actions are respectively executed according to the associated intelligent home equipment according to the scene execution data, so that the switching to the target scene is realized.
In the above embodiment, when the user performs the target scene configuration by using the terminal device, the server side forms the scene execution data according to the configuration request and the configuration data of the terminal device, and stores the scene execution data in the gateway, and when the target scene control is performed, the gateway obtains the scene execution instruction sent by the terminal device, determines the scene execution data corresponding to the target scene, and determines the scene execution data corresponding to the nested scene according to the nested scene identifier when the scene execution data includes the nested scene identifier, and issues the execution action data to the corresponding intelligent home device to perform corresponding execution when the scene execution data is the execution action data of the intelligent home device, so that the scene execution data of the target scene including the nested scene does not need to repeatedly store the action data included in the nested scene through the mutual nesting of the scenes, thereby saving the storage consumption of the gateway and having more intuitive scene execution.
In some embodiments, before the acquiring the target scene execution instruction, the method further includes:
And acquiring scene execution data of the target scene, forming a mapping relation between the target scene identification and corresponding nested scene identification and/or execution action data of the target intelligent home equipment, and storing the mapping relation.
Scene identification refers to identification, such as name, code, etc., capable of uniquely characterizing the identity of a scene. Because the scene identifier is unique, when the scene is created, the terminal equipment sends configuration data corresponding to the configuration request of the target scene to the server according to the configuration operation of the user, the server generates the target scene identifier according to the configuration request, generates scene execution data corresponding to the target scene identifier according to the configuration data, and sends the target scene identifier and the corresponding scene execution data to the gateway. When the gateway receives a configuration request of a target scene, a mapping relation is formed and stored in a dictionary (map) mode, wherein the target scene identifier is specifically used as a key, and scene execution data is used as a value to support quick and insertion. When the target scene contains the nested scene, the scene execution data contains the corresponding nested scene identifier as a value.
When the gateway receives the scene execution instruction, the gateway only needs to find the corresponding value in the dictionary according to the scene identification of the target scene, if the gateway comprises the execution action, the action is sent to the intelligent home equipment for execution, if the action is the nested scene identification, the gateway continues to find the corresponding value in the dictionary data, and the process is circulated until no nested scene identification exists.
By forming and storing the mapping relation between the target scene identification and the corresponding nested scene identification and/or the execution action data of the target intelligent home equipment, the gateway can conveniently and rapidly search when executing the scene command, and the execution efficiency is improved.
In another aspect of the embodiment of the present application, referring to fig. 9, a method for controlling an intelligent home device is provided, which can be applied to the internet of things system shown in fig. 1, and includes:
step S401, a terminal device receives an execution request of a target scene and sends the execution request to a server;
step S403, after receiving the execution request, the server sends a target scene execution instruction to a gateway corresponding to the target scene;
Step S405, the gateway determines, according to the target scene execution instruction, scene execution data corresponding to the target scene, where the scene execution data includes a nested scene identifier, determines, according to the nested scene identifier, the scene execution data corresponding to the nested scene, and issues the execution action data to a corresponding smart home device for corresponding execution if the scene execution data is execution action data of the smart home device.
And the user can send out a target scene execution instruction through a client side on the terminal equipment, wherein the client side is used for controlling the intelligent household equipment. For example, the scene control page of the client may include a scene control key corresponding to the created scene, and the user may click the scene control key of the corresponding scene to be executed to send the corresponding execution request. The server forwards the scene execution instruction to the corresponding gateway, wherein the corresponding gateway can control the corresponding intelligent home equipment to execute the action.
When a target scene execution request is acquired, corresponding scene execution data stored when the target scene is created correspondingly also comprise nested scene identifiers, scene execution data corresponding to the nested scenes are called according to the identifiers of the nested scenes, and when the scene execution data is the execution action data of the intelligent household equipment, the execution action data of all associated intelligent household equipment contained in the scene execution data of the target scene to be executed can be directly acquired.
In some embodiments, the smart home device control method further includes:
S4011, the terminal equipment receives a configuration request of a target scene and configuration data corresponding to the configuration request, and sends the configuration data to a server, wherein the configuration data comprises a configuration instruction of a nested scene corresponding to the configuration request and/or an action setting instruction of the target intelligent home equipment;
S4012, the server forms scene execution data corresponding to the target scene according to the configuration data and sends the scene execution data to a gateway corresponding to the target scene;
s4013, the gateway obtains and stores the scene execution data corresponding to the target scene.
The user can create and configure the target scene through the client on the terminal equipment, and the terminal equipment sends a configuration request of the target scene and configuration data corresponding to the configuration request to the server according to the operation of the user. The server receives the configuration data, generates a target scene identification and scene execution data, sends the target scene identification and scene execution data to the gateway, and carries out association storage by the gateway to complete the creation of the target scene.
In some embodiments, S4013, the gateway obtains and stores the scene execution data corresponding to the target scene, including:
And the gateway acquires scene execution data corresponding to the target scene, forms a mapping relation between the target scene identifier and corresponding nested scene identifier and/or execution action data of the target intelligent home equipment, and stores the mapping relation.
Because the scene identifier is unique, when the scene is created, the terminal equipment sends configuration data corresponding to the configuration request of the target scene to the server according to the configuration operation of the user, the server generates the target scene identifier according to the configuration request, generates scene execution data corresponding to the target scene identifier according to the configuration data, and sends the target scene identifier and the corresponding scene execution data to the gateway. When the gateway receives a configuration request of a target scene, a mapping relation is formed and stored in a dictionary (map) mode, wherein the target scene identifier is specifically used as a key, and scene execution data is used as a value to support quick and insertion. When the target scene contains the nested scene, the scene execution data contains the corresponding nested scene identifier as a value.
When the gateway receives the scene execution instruction, the gateway only needs to find the corresponding value in the dictionary according to the scene identification of the target scene, if the gateway comprises the execution action, the action is sent to the intelligent home equipment for execution, if the action is the nested scene identification, the gateway continues to find the corresponding value in the dictionary data, and the process is circulated until no nested scene identification exists.
By forming and storing the mapping relation between the target scene identification and the corresponding nested scene identification and/or the execution action data of the target intelligent home equipment, the gateway can conveniently and rapidly search when executing the scene command, and the execution efficiency is improved.
Referring to fig. 10, a flowchart of a method for controlling smart home devices according to an alternative embodiment of the present application includes the following steps:
S21, clicking an execution scene B button at the terminal equipment, and sending sceneId _B to the server by the terminal equipment;
s22, after receiving the execution request of the scene B, the server side sends a scene execution command of sceneId _B to the gateway;
s23, after receiving a sceneId _B scene execution command, the gateway searches scene execution data corresponding to sceneId _B in a stored database, wherein the scene B comprises a nested scene A, and optional examples of the scene execution data are { sceneId _A, [ did3, resource id2. ];
The gateway further determines scene execution data corresponding to sceneId _a according to a scene identifier sceneId _a of a nested scene a, wherein the scene a does not comprise the nested scene, and optional examples of the scene execution data corresponding to the scene a are { [ did1, resourceId1, did2, resourceId, ] };
And S25, after the gateway determines the execution action data of all intelligent household devices contained in sceneId _B according to the scene execution data corresponding to sceneId _B, controlling the corresponding intelligent household devices to execute the corresponding actions. Taking the foregoing example as an example, an optional example of the execution action data of all the smart home devices contained in sceneId _b is [ di 1, resourceId1, di 2, resourceId2, di 3, resource id2.
In the embodiment, the scenes of the intelligent home equipment support nesting of the scenes, and the gateway stores the execution data of the scenes, so that repeated storage of action data in different scenes can be avoided, and storage resources are effectively saved.
Referring to fig. 11, in another aspect of the present application, an apparatus for configuring a smart home device scene is provided, where in an exemplary embodiment, the apparatus for configuring a smart home device scene may be implemented by using a terminal device. The intelligent household equipment scene configuration device comprises a configuration request module 11, a configuration data module 13 and a sending module 15, wherein the configuration request module 11 is used for obtaining a configuration request of a target scene, the configuration data module 13 is used for obtaining a configuration instruction of a nested scene corresponding to the configuration request and/or an action setting instruction of the target intelligent household equipment to form configuration data, the sending module 15 is used for sending the configuration data to a server, the server forms scene execution data corresponding to the target scene according to the configuration data, and the scene execution data is sent to a gateway corresponding to the target scene.
Optionally, the configuration data module 13 is specifically configured to display a configuration page of the target scene according to the configuration request, receive a configuration instruction of a nested scene and/or an action setting instruction of the target smart home device based on the configuration page, and form configuration data according to the configuration instruction of the nested scene and/or the action setting instruction of the target smart home device.
It should be noted that, in the configuration process of the intelligent home equipment scene provided by the embodiment, only the division of each program module is used for illustration, in practical application, the processing allocation can be completed by different program modules according to the need, and the internal structure of the device can be divided into different program modules to complete all or part of the method steps described above. In addition, the intelligent home equipment scene configuration device provided in the above embodiment and the intelligent home equipment scene configuration method embodiment applied to the terminal equipment side belong to the same concept, and detailed implementation processes of the intelligent home equipment scene configuration device are shown in the method embodiment, and are not repeated here.
Referring to fig. 12, in another aspect of the present application, an apparatus for configuring a smart home device scene is provided, where in an exemplary embodiment, the apparatus for configuring a smart home device scene may be implemented by using a server. The intelligent household equipment scene configuration device comprises a receiving module 21 and a scene configuration module 23, wherein the receiving module 21 is used for receiving configuration data corresponding to a configuration request of a target scene sent by a terminal device, the configuration data comprises configuration instructions of nested scenes corresponding to the configuration request and/or action setting instructions of the target intelligent household equipment, the scene configuration module 23 is used for generating corresponding target scene identifications according to the configuration data, forming scene execution data corresponding to the target scenes, and sending the scene execution data to a gateway corresponding to the target scenes, and the scene execution data comprises the target scene identifications, the nested scene identifications and/or execution action data of the target intelligent household equipment.
It should be noted that, in the configuration process of the intelligent home equipment scene provided by the embodiment, only the division of each program module is used for illustration, in practical application, the processing allocation can be completed by different program modules according to the need, and the internal structure of the device can be divided into different program modules to complete all or part of the method steps described above. In addition, the intelligent home equipment scene configuration device provided in the above embodiment and the intelligent home equipment scene configuration method embodiment applied to the server side belong to the same concept, and detailed implementation processes of the intelligent home equipment scene configuration device are shown in the method embodiment, and are not repeated here.
Referring to fig. 13, in another aspect of the present application, an intelligent home device control apparatus is provided, and in an exemplary embodiment, the intelligent home device control apparatus may be implemented by using a gateway. The intelligent household equipment control device comprises an acquisition module 31 for acquiring a target scene execution instruction, a nesting module 33 for determining scene execution data corresponding to a target scene according to the target scene execution instruction, and an execution module 35 for issuing the execution action data to corresponding intelligent household equipment for corresponding execution if the scene execution data is execution action data of the intelligent household equipment if the scene execution data comprises a nesting scene identifier and the nesting scene identifier.
Optionally, the obtaining module 31 is further configured to obtain scene execution data of the target scene, form a mapping relationship between the target scene identifier and the corresponding nested scene identifier and/or execution action data of the target smart home device, and store the mapping relationship.
It should be noted that, in the process of implementing the control of the smart home device, the smart home device control apparatus provided in the foregoing embodiment is only exemplified by the division of the foregoing program modules, and in practical application, the foregoing processing allocation may be completed by different program modules according to needs, that is, the internal structure of the apparatus may be divided into different program modules, so as to complete all or part of the method steps described above. In addition, the intelligent home equipment control device provided in the above embodiment and the intelligent home equipment control method embodiment applied to the gateway side belong to the same concept, and detailed implementation processes of the intelligent home equipment control device are shown in the method embodiment, and are not repeated here.
In another aspect, referring to fig. 14, an optional hardware structure schematic diagram of an intelligent device provided by the embodiment of the present application is provided, where the intelligent device includes a processor 111 and a memory 112, and various types of data are stored in the memory 112 to support operations of a smart home device scene configuration device or a smart home device control device, and a computer program for implementing the smart home device scene configuration method or the smart home device control method provided by any embodiment of the present application is stored, and when the computer program is executed by the processor, the steps of the smart home device scene configuration method or the smart home device control method provided by any embodiment of the present application are implemented, and the same technical effects can be achieved, so that repetition is avoided. The intelligent devices may be the terminal device, the server and the gateway shown in fig. 1, respectively.
Referring to fig. 15, an optional hardware block diagram of an intelligent device according to an embodiment of the present application is shown. As shown in fig. 15, the smart device may vary considerably in configuration or performance and may include one or more processors (ProcessingUnits, CPU) 1110 (the processor 1110 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA), a memory 1130 for storing data, one or more storage mediums 1120 (e.g., one or more mass storage devices) storing applications 1123 or data 1122. Wherein the memory 1130 and the storage medium 1120 may be transitory or persistent storage. The program stored on the storage medium 1120 may include one or more modules, each of which may include a series of instruction operations in the scene control panel. Still further, the processor 1110 may be configured to communicate with a storage medium 1120 to execute a series of instruction operations in the storage medium 1120 on a smart device. The smart device may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input/output interfaces 1140, and/or one or more operating systems 1121, e.g., windowsServerTM, macOSXTM, unixTM, linuxTM, freeBSDTM, etc.
The input-output interface 1140 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the smart device. In one example, the input/output interface 1140 includes a network adapter (NetworkInterfaceController, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the input-output interface 1140 may be a radio frequency (RadioFrequency, RF) module for communicating wirelessly with the internet.
It will be appreciated by those skilled in the art that the configuration shown in fig. 15 is merely illustrative, and is not intended to limit the configuration of the scene control panel described above. For example, the smart device may also include more or fewer components than shown in fig. 15, or have a different configuration than shown in fig. 15.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the above working mode configuration method and each process of the switch control method embodiment, and can achieve the same technical effects, so that repetition is avoided, and no further description is given here. Wherein, the computer readable storage medium is Read-only memory (ROM), random Access Memory (RAM), magnetic disk or optical disk, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.