Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, an electronic device and a medium for configuring a smart home, so as to shorten an implementation period of the smart home and reduce a configuration difficulty. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a smart home configuration method, where the method includes:
acquiring a room template identifier corresponding to a specified room;
sending an association request to an internet of things server, wherein the association request carries the room template identifier, and the association request is used for requesting to establish an association relationship between the specified room and a room template corresponding to the room template identifier;
receiving an association response sent by the server of the Internet of things, wherein the association response carries a room template corresponding to the room template identification, and the room template comprises product group information, a plurality of pieces of preset scene information and voice training information;
and performing network access binding on equipment corresponding to the equipment information in the product group information and the Internet of things server so as to enable the room template to take effect.
In a possible implementation manner, the obtaining a room template identifier corresponding to a room includes:
the method comprises the steps of determining the identification of a room template selected by a user based on a first selection operation of the user on the room template preset in a displayed interface.
In one possible implementation manner, after the receiving the association response sent by the internet of things server, the method further includes:
displaying the information of the equipment to be bound in the specified room on an equipment configuration page, wherein the information of the equipment to be bound is the equipment information included in the product group information;
the network access binding of the equipment corresponding to the equipment information in the product group information and the internet of things server comprises the following steps:
identifying a second selection operation of a user on the information of the equipment to be bound, and responding to the second selection operation, sending wireless network information to the equipment to be bound selected by the user so that the equipment to be bound selected by the user is accessed to a wireless network through the wireless network information;
sending the device identification of the device to be bound selected by the user to the Internet of things server so that the Internet of things server binds the device to be bound selected by the user;
and receiving a binding success message sent by the Internet of things server.
In one possible implementation, the product group information includes device information of a plurality of devices; the preset scene information comprises a trigger condition, action information and effective time, wherein the trigger condition is a condition for triggering equipment in a preset scene to execute an action, the action information is an action which is required to be executed by the equipment in response to the trigger condition, and the effective time is the effective time of the preset scene; the voice training information is information used for performing voice training on equipment with a voice recognition function in the equipment corresponding to the equipment information included in the product group.
In a possible implementation manner, before the obtaining of the room template identifier corresponding to the room, the method further includes:
acquiring a room template input by a user;
sending the room template to the Internet of things server;
receiving a room template creation success message sent by the Internet of things server, wherein the room template creation success message comprises an identifier generated by the Internet of things server for the room template;
storing an identification of the room template.
In a second aspect, an embodiment of the present application provides a smart home configuration device, where the smart home configuration device includes:
the acquisition module is used for acquiring a room template identifier corresponding to the specified room;
the sending module is used for sending an association request to an Internet of things server, wherein the association request carries the room template identifier, and the association request is used for requesting to establish an association relationship between the specified room and a room template corresponding to the room template identifier;
the receiving module is used for receiving an association response sent by the internet of things server, the association response carries a room template corresponding to the room template identifier, and the room template comprises product group information, a plurality of pieces of preset scene information and voice training information;
and the network access binding module is used for performing network access binding on the equipment corresponding to the equipment information in the product group information and the Internet of things server so as to enable the room template to take effect.
In a possible implementation manner, the obtaining module is specifically configured to:
the method comprises the steps of determining the identification of a room template selected by a user based on a first selection operation of the user on the room template preset in a displayed interface.
In one possible implementation, the apparatus further includes:
the display module is used for displaying the information of the equipment to be bound in the specified room on an equipment configuration page, wherein the information of the equipment to be bound is the equipment information included in the product group information;
the network access binding module is specifically configured to:
identifying a second selection operation of a user on the information of the equipment to be bound, and responding to the second selection operation, sending wireless network information to the equipment to be bound selected by the user so that the equipment to be bound selected by the user is accessed to a wireless network through the wireless network information;
sending the device identification of the device to be bound selected by the user to the Internet of things server so that the Internet of things server binds the device to be bound selected by the user;
and receiving a binding success message sent by the Internet of things server.
In one possible implementation, the product group information includes device information of a plurality of devices; the preset scene information comprises a trigger condition, action information and effective time, wherein the trigger condition is a condition for triggering equipment in a preset scene to execute an action, the action information is an action which is required to be executed by the equipment in response to the trigger condition, and the effective time is the effective time of the preset scene; the voice training information is information used for performing voice training on equipment with a voice recognition function in the equipment corresponding to the equipment information included in the product group.
In one possible implementation, the apparatus further includes: a storage module;
the acquisition module is also used for acquiring a room template input by a user;
the sending module is further configured to send the room template to the internet of things server;
the receiving module is further configured to receive a room template creation success message sent by the internet of things server, where the room template creation success message includes an identifier generated by the internet of things server for the room template;
the storage module is used for storing the identifier of the room template.
In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor configured to implement the method steps of the first aspect when executing the program stored in the memory.
In a fourth aspect, this application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps described in the first aspect.
In a fifth aspect, embodiments of the present invention also provide a computer program product including instructions, which when executed on a computer, cause the computer to perform the method steps of the first aspect.
By adopting the technical scheme, the electronic equipment can acquire the room template identification corresponding to the appointed room and then send the association request to the Internet of things server, so that the Internet of things server establishes the association relationship between the appointed room and the room template. And then, an association response sent by the server of the internet of things can be received, the association response carries the room template corresponding to the room template identifier, and the room template can automatically take effect after the devices in the product group information are bound with the server of the internet of things in the network due to the fact that the room template has the preset scene information and the preset voice training information. It can be seen that in the embodiment of the application, configuration personnel are not needed to configure scene information for the room on site, the implementation period is shortened, and the configuration difficulty is low.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An embodiment of the present application provides a smart home configuration method, which is applied to an electronic device, where an application program for configuring a smart home is installed in the electronic device, and as shown in fig. 1, the method includes:
s101, acquiring a room template identifier corresponding to the specified room.
S102, sending an association request to the Internet of things server, wherein the association request carries a room template identifier and is used for requesting to establish an association relationship between a room and a room template corresponding to the room template identifier.
S103, receiving an association response sent by the Internet of things server, wherein the association response carries a room template corresponding to the room template identification, and the room template comprises product group information, a plurality of preset scene information and voice training information.
And S104, performing network access binding on equipment corresponding to each piece of equipment information in the product group information and the Internet of things server to enable the room template to take effect.
By adopting the configuration method of the smart home, the electronic equipment can acquire the room template identification corresponding to the specified room and then send the association request to the internet of things server, so that the internet of things server establishes the association relationship between the specified room and the room template. And then, an association response sent by the server of the internet of things can be received, the association response carries the room template corresponding to the room template identifier, and the room template can automatically take effect after the devices in the product group information are bound with the server of the internet of things in the network due to the fact that the room template has the preset scene information and the preset voice training information. It can be seen that in the embodiment of the application, configuration personnel are not needed to configure scene information for the room on site, the implementation period is shortened, and the configuration difficulty is low.
For the above S101, obtaining the room template identifier corresponding to the specified room, the method may specifically be implemented as follows: the electronic device displays a plurality of preset room templates, then receives a first selection operation of a user on the room templates, and determines the identification of the room template selected by the user based on the first selection operation.
The electronic device may display basic information of each preset room template, for example, a name of the room template, scene information included in the room template, and device information related to the room template.
The configurator may select one room template from the displayed list of preset room templates as the room template for the specified room, and in order to match the room template with the specified room, the devices included in the product group information of the room template selected by the configurator are identical to the devices included in the specified room.
Optionally, the designated room may be one room or multiple rooms, that is, the embodiment of the present application may implement batch operation on multiple rooms, and configure the same room template for the multiple rooms.
For step S103, the product group information includes device information of multiple devices, specifically includes device information of devices in each preset scene, and the device information may specifically be a device name. It is understood that the device information included in the product group information is device information specifying devices present in the room.
The preset scene information comprises a trigger condition, action information and effective time.
The trigger condition is a condition for triggering the device in a preset scene to execute an action, and the trigger condition includes a device trigger condition, a timing trigger condition, a manual trigger condition and the like. For example, in a scenario with body sensors, lights and air conditioning, the trigger conditions may include: the motion of a person is monitored by the body sensor or the motion of no person is monitored by the body sensor.
The action information is an action to be performed by the device in response to a trigger condition. Under the condition that the trigger condition is met, the equipment in the preset scene can execute corresponding actions, such as turning on a lamp, starting an air conditioner, switching a certain automatic scene, executing a certain manual scene and the like. The effective time is the effective time of the preset scene.
The voice training information is information used for performing voice training on equipment having a voice recognition function among the equipment corresponding to the equipment information included in the product group. Optionally, the speech training information includes a relationship between the speech to be recognized and the motion information, and/or a relationship between the speech to be recognized and the speech to be played.
Specifically, the equipment with the voice recognition function is trained through the voice training information, so that when the equipment recognizes a certain voice, the action corresponding to the voice is executed; and/or when the equipment identifies a certain voice, playing the voice to be played corresponding to the voice. For example, if the speaker device recognizes the voice "i come back", the speaker device plays the voice "welcome home".
With reference to the method flow shown in fig. 1, as shown in fig. 2, after receiving the association response sent by the internet of things server in the above step S103, the method further includes:
s201, displaying the information of the equipment to be bound in the specified room on an equipment configuration interface.
The device information to be bound is device information included in the product group information. It is understood that the device to be bound is a device present in a given room.
Optionally, in an embodiment, there may be two applications installed in the electronic device for smart home configuration, where one of the applications is used to perform the above S101-S103, that is, to mainly complete the import operation of the room template and to implement the function of creating the room template; another application is used to perform S201 and S104, i.e., mainly for management of devices in a specified room.
As shown in fig. 3, the names of the devices to be bound, such as small-screen speakers, bedside lamps, gateways, purifiers, etc., may be displayed on the device configuration interface. Optionally, information such as a picture and a model of the device to be bound may also be displayed, which is not limited in the embodiment of the present application.
Optionally, the status information of each device may also be displayed on the device configuration interface, for example, the status information of each device in fig. 3 is the waiting distribution network information.
On this basis, in S104, the network access binding is performed between the device corresponding to each device information included in the product group information and the internet of things server, which may specifically be implemented as the following steps:
s1041, identifying a second selection operation of the user on the information of the device to be bound, responding to the second selection operation, and sending wireless network information to the device to be bound selected by the user, so that the device to be bound selected by the user is accessed to a wireless network through the wireless network information.
In order to improve configuration efficiency, the electronic device supports full-selection or multi-selection operation of the device to be bound in the device configuration interface by the configuration personnel, and then the electronic device sends wireless network information to the device to be bound selected by the configuration personnel, so that each device to be bound is accessed into a wireless network, and a subsequent server of the internet of things can realize intelligent control over each device which is accessed into the network through the wireless network.
And S1042, sending the device identifier of the device to be bound selected by the user to the Internet of things server, so that the Internet of things server binds the device to be bound selected by the user.
Specifically, when the electronic device sends the device identifier of the device to be bound to the internet of things server, the electronic device also carries an account of an application program used for smart home configuration in the electronic device, and the internet of things server can bind the account with the device identifier of the device to be bound, so that the internet of things server can bind the device to be bound.
It can be understood that after the internet of things server completes the binding of the device to be bound, the bound device can be associated with the preset scene information and the voice training information in the room template, and then the intelligent control of the bound device can be realized.
And S1043, receiving a binding success message sent by the Internet of things server.
By adopting the method, compared with the prior art that a configuration worker needs to perform physical operations such as 'pressing a certain key for a long time' and the like on each device to enable the device to be in a to-be-configured state, then network information is sent to the device through the APP, the device information of the device is sent to the Internet of things server after the device is networked, and then the process of network access binding is completed, batch control on each device can be achieved, the configuration worker does not need to perform physical operations on each device respectively, the electronic device can be triggered to perform batch binding operation on each device to be bound through simple selection operation performed on a device configuration interface, and the configuration process is simplified. After the network access binding is completed, the preset scene in the room template automatically takes effect, and the voice training information automatically takes effect after the preset scene takes effect, so that configuration personnel do not need to perform scene configuration and voice training operation, and the field configuration difficulty is reduced.
It should be noted that, in the embodiment of the present application, each room may be associated with a room template, and if another room template is imported for the room again on the basis that one room template is already imported for the room, the first room template imported for the room will be disabled in the room.
Optionally, in another embodiment of the present application, the electronic device may further create a room template, as shown in fig. 4, where the method includes:
s401, a room template input by a user is obtained.
The electronic device may provide a room template management function, and the user may select a device required in the room template from a preset product pool using the room template management function, so as to generate product group information of the room template.
After the product group information is generated, intelligent scenes can be configured according to the equipment information in the product group information, and a plurality of pieces of preset scene information are obtained. And then, configuring voice training for the voice equipment in the product group to generate voice training information. The voice training is to set a relationship between a voice recognized by the device and an action executed by the device, or to set a relationship between a voice recognized by the device and a voice played by the sound box. For example, when the user speaks a certain word to the speaker, the speaker plays a voice set in advance.
And then generating a room template by using the product group information, the preset scene information and the voice training information.
Alternatively, the user may create multiple room templates on demand.
S402, sending the room template to the Internet of things server.
And S403, receiving a room template creation success message sent by the Internet of things server.
And the successful message of the room template creation comprises the identifier generated by the Internet of things server for the room template.
It can be understood that after the room template is successfully created, the room template can be selected when the smart home configuration is performed on the room.
And S404, storing the identification of the room template.
In addition, in the embodiment of the present application, for a room that has completed offline configuration, the electronic device may acquire scene information and voice training information configured by a configuration person for the room, so as to generate a new room template, and then perform the above S402-S404, so that the new room template can be used by other rooms.
Based on the same technical concept, an embodiment of the present application further provides a smart home configuration device, as shown in fig. 5, the device includes:
an obtaining module 501, configured to obtain a room template identifier corresponding to a specified room;
a sending module 502, configured to send an association request to an internet of things server, where the association request carries the room template identifier, and the association request is used to request establishment of an association relationship between the specified room and a room template corresponding to the room template identifier;
a receiving module 503, configured to receive an association response sent by the internet of things server, where the association response carries a room template corresponding to the room template identifier, and the room template includes product group information, a plurality of pieces of preset scene information, and voice training information;
and a network access binding module 504, configured to perform network access binding on the device corresponding to each device information included in the product group information and the internet of things server, so that the room template becomes effective.
Optionally, the obtaining module 501 is specifically configured to:
the method comprises the steps of determining the identification of a room template selected by a user based on a first selection operation of the user on the room template preset in a displayed interface.
Optionally, as shown in fig. 6, the apparatus further includes: a display module 601.
A display module 601, configured to display, on an equipment configuration page, to-be-bound equipment information in the specified room, where the to-be-bound equipment information is equipment information included in the product group information;
the network entry binding module 504 is specifically configured to:
identifying a second selection operation of a user on the information of the equipment to be bound, and responding to the second selection operation, sending wireless network information to the equipment to be bound selected by the user so that the equipment to be bound selected by the user is accessed to a wireless network through the wireless network information;
sending the device identification of the device to be bound selected by the user to the Internet of things server so that the Internet of things server binds the device to be bound selected by the user;
and receiving a binding success message sent by the Internet of things server.
Optionally, the product group information includes device information of a plurality of devices; the preset scene information comprises trigger conditions, action information and effective time, wherein the trigger conditions are conditions for triggering equipment in the preset scene to execute actions, the action information is actions which are required to be executed by the equipment in response to the trigger conditions, and the effective time is the effective time of the preset scene; the voice training information is information used for performing voice training on equipment having a voice recognition function among the equipment corresponding to the equipment information included in the product group.
Optionally, the apparatus further comprises: a storage module 602;
the obtaining module 501 is further configured to obtain a room template input by a user;
a sending module 502, configured to send the room template to the internet of things server;
the receiving module 503 is further configured to receive a room template creation success message sent by the internet of things server, where the room template creation success message includes an identifier generated by the internet of things server for the room template;
a storage module 602, configured to store an identification of the room template.
By adopting the configuration device of the smart home, the room template identification corresponding to the specified room can be obtained, and then the association request is sent to the Internet of things server, so that the Internet of things server establishes the association relationship between the specified room and the room template. And then, an association response sent by the server of the internet of things can be received, the association response carries the room template corresponding to the room template identifier, and the room template can automatically take effect after the devices in the product group information are bound with the server of the internet of things in the network due to the fact that the room template has the preset scene information and the preset voice training information. It can be seen that in the embodiment of the application, configuration personnel are not needed to configure scene information for the room on site, the implementation period is shortened, and the configuration difficulty is low.
An embodiment of the present invention further provides an electronic device, as shown in fig. 7, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the method steps in the above-described method embodiments when executing the program stored in the memory 703.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the above-mentioned smart home configuration methods.
In another embodiment of the present invention, there is provided a computer program product including instructions, which when run on a computer, causes the computer to execute any one of the above-mentioned methods for configuring a smart home.
The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g., from one website site, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DS L)) or wireless (e.g., infrared, wireless, microwave, etc.) manner to another website site, computer, server, or data center.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.