Control instruction generation method, storage medium and electronic device

By generating a binary tree corresponding to user manipulation instructions and generating control instructions based on node values, the entity recognition problem caused by the diverse forms of control instructions in smart home devices is solved, and structured instruction generation and user intention mining are simplified.

CN116224815BActive Publication Date: 2025-03-25QINGDAO HAIER TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310186436.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-01
Publication Date
2025-03-25
Estimated Expiration
2043-03-01

AI Technical Summary

Technical Problem

In smart home devices, control instructions are diverse in forms, making it difficult to identify entities, which in turn makes it very difficult to mine user intentions based on historical control instructions.

Method used

By calling a preset relationship corresponding to the user's manipulation instructions, a binary tree corresponding to the user's manipulation instructions is generated, and control instructions are generated based on the node values ​​of multiple nodes in the binary tree.

Benefits of technology

Generating structured control instructions is realized, reducing the difficulty of entity recognition of control instructions, thereby simplifying the process of mining user intentions based on control instructions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116224815B_ABST
    Figure CN116224815B_ABST
Patent Text Reader

Abstract

The present application discloses a control instruction generation method, storage medium and electronic device, which relates to the field of smart home technology. The control instruction generation method includes: in response to receiving a user control instruction, calling a preset relationship corresponding to the user control instruction, wherein the preset mapping relationship is used to characterize the mapping relationship between the slot in the user control instruction and the position information of the node of the preset binary tree; based on the preset relationship, generating a binary tree corresponding to the user control instruction; based on the node values ​​of multiple nodes in the binary tree, generating a control instruction, wherein the control instruction is used to adjust the device parameters of the smart home device. Thus, the technical effect of reducing the difficulty of mining user intentions based on control instructions is achieved, and then the technical problem that the control instruction forms are often different, which makes it very difficult to discover user intentions based on historical control instructions, is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart home, and more specifically, to a control instruction generation method, a storage medium and an electronic device. Background Art

[0002] With the development of Internet of Things technology, smart home devices have gradually entered people's daily lives. Users usually use one home device to be controlled by multiple terminal devices and receive control instructions from different terminal devices. In this case, the forms of control instructions are often different. In the subsequent process, if developers need to mine user intentions based on historical control instructions, first of all, they need to perform entity recognition on historical control instructions. In the case of various forms of control instructions, entity recognition is very difficult, which leads to the technical problem that it is very difficult to discover intentions based on historical control power.

[0003] Currently, no effective solution has been proposed for the above technical problems. Summary of the invention

[0004] At least some embodiments of the present disclosure provide a method for generating a control instruction, so as to at least solve the technical problem that the control instruction forms are often different, making it very difficult to discover the user intention based on historical control instructions.

[0005] According to one embodiment of the present disclosure, a method for generating a control instruction is provided, comprising: in response to receiving a user control instruction, calling a preset relationship corresponding to the user control instruction, wherein the preset mapping relationship is used to characterize the mapping relationship between a slot in the user control instruction and position information of a node of a preset binary tree; based on the preset relationship, generating a binary tree corresponding to the user control instruction; based on node values ​​of multiple nodes in the binary tree, generating a control instruction, wherein the control instruction is used to adjust device parameters of a smart home device.

[0006] Optionally, based on a preset relationship, a binary tree corresponding to the user control instruction is generated, including: confirming target information from the user control instruction according to a preset mapping relationship; based on the preset mapping relationship, filling the target information into nodes corresponding to the preset binary tree to obtain a binary tree.

[0007] Optionally, based on the node values ​​of multiple nodes in the binary tree, a control instruction is generated: the binary tree is subsequently traversed to confirm the node values ​​of multiple nodes included in the binary tree; and the control instruction is generated according to the node values ​​of the multiple nodes.

[0008] Optionally, based on the node values ​​of multiple nodes in the binary tree, generating a control instruction includes: dividing the binary tree to determine a child binary tree corresponding to a parent node among the multiple nodes; generating a first control instruction corresponding to the child binary tree based on the node values ​​of the child nodes contained in the child binary tree; generating a second control instruction corresponding to the parent node based on the node value of the parent node and the first control instruction; and determining the second control instruction corresponding to the root node among the multiple nodes as the control instruction.

[0009] Optionally, based on the node values ​​of the child nodes contained in the child binary tree, generating the first control instruction corresponding to the child binary tree includes: in response to the child node being a leaf node among multiple nodes, generating the first control instruction based on the node value of the child node; in response to the child node being a parent node among multiple nodes, repeating the steps of determining the child binary tree, generating the first control instruction and generating the second control instruction.

[0010] Optionally, generating a first control instruction based on the node value of the child node includes: in response to the node value of the child node satisfying a preset condition, determining that the node value of the child node is the first control instruction; in response to the node value of the child node not satisfying the preset condition, determining that the first control instruction is a preset instruction.

[0011] Optionally, determining that the first control instruction is a preset instruction includes: acquiring multiple preset instructions, wherein different preset instructions correspond to different users; determining a target user corresponding to the user operation instruction; and determining that the first control instruction is a preset instruction corresponding to the target user.

[0012] Optionally, generating a second control instruction corresponding to the parent node based on the node value of the parent node and the first control instruction includes: in response to the first control instructions not being preset instructions, generating a second control instruction based on the node value of the parent node and the first control instruction; in response to the first control instruction corresponding to the first sub-binary tree in the sub-binary tree being the second preset instruction, generating a second control instruction based on the node value of the parent node and the first control instruction corresponding to the second sub-binary tree in the sub-binary tree, wherein the first control instruction corresponding to the second sub-binary tree is not a preset instruction; in response to the first control instructions being preset instructions, generating a second control instruction based on the node value of the parent node.

[0013] According to one embodiment of the present disclosure, a control instruction generating device is also provided, including: a calling module, used to call a preset relationship corresponding to the user control instruction in response to receiving a user control instruction, wherein the preset mapping relationship is used to characterize the mapping relationship between the slot in the user control instruction and the position information of the node of a preset binary tree; based on the preset relationship, a binary tree corresponding to the user control instruction is generated; a binary tree generating module, used to generate a binary tree corresponding to the user control instruction based on the preset relationship; an instruction generating module, used to generate a control instruction based on the node values ​​of multiple nodes in the binary tree, wherein the control instruction is used to adjust the device parameters of the smart home device.

[0014] Optionally, the binary tree generation module includes: a target information confirmation unit, used to confirm the target information from the user control instruction according to a preset mapping relationship; and a filling unit, used to fill the target information into the node corresponding to the preset binary tree based on the preset mapping relationship to obtain the binary tree.

[0015] Optionally, the instruction generation module includes: a traversal unit, used to subsequently traverse the binary tree to confirm the node values ​​of multiple nodes contained in the binary tree; and a first instruction generation unit, used to generate control instructions according to the node values ​​of the multiple nodes.

[0016] Optionally, the instruction generation module includes: a partitioning unit, used to partition the binary tree and determine a child binary tree corresponding to a parent node among multiple nodes; a second instruction generation unit, used to generate a first control instruction corresponding to the child binary tree based on the node values ​​of the child nodes contained in the child binary tree; a third instruction generation unit, used to generate a second control instruction corresponding to the parent node based on the node value of the parent node and the first control instruction; and an instruction determination unit, used to determine that the second control instruction corresponding to the root node among multiple nodes is a control instruction.

[0017] Optionally, the second instruction generation unit is also used to generate a first control instruction based on the node value of the child node in response to the child node being a leaf node among multiple nodes; and to repeat the steps of determining the child binary tree, generating the first control instruction and generating the second control instruction in response to the child node being a parent node among multiple nodes.

[0018] Optionally, the second instruction generation unit is also used to, in response to the child node being a parent node among multiple nodes, repeatedly execute the steps of determining the child binary tree, generating a first control instruction and generating a second control instruction; in response to the node value of the child node not satisfying a preset condition, determine that the first control instruction is a preset instruction.

[0019] Optionally, the instruction determination unit is further used to obtain multiple preset instructions, wherein different preset instructions correspond to different users; determine the target user corresponding to the user operation instruction; and determine the first control instruction as the preset instruction corresponding to the target user.

[0020] Optionally, the third instruction generation unit is also used to generate a second control instruction based on the node value of the parent node and the first control instruction in response to the first control instructions not being preset instructions; generate a second control instruction based on the node value of the parent node and the first control instruction corresponding to the second sub-binary tree in the sub-binary tree in response to the first control instruction corresponding to the first sub-binary tree being the second preset instruction, wherein the first control instruction corresponding to the second sub-binary tree is not a preset instruction; and generate a second control instruction based on the node value of the parent node in response to the first control instructions being preset instructions.

[0021] According to one embodiment of the present disclosure, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above control instruction generation methods when running.

[0022] According to one embodiment of the present disclosure, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above control instruction generation methods.

[0023] In at least some embodiments of the present disclosure, in response to receiving a user control instruction, a preset relationship corresponding to the user control instruction is called, and then based on the preset relationship, a binary tree corresponding to the user control instruction is uniformly generated, and then a control instruction is generated according to the node values ​​of multiple nodes in the binary tree. Based on this, the present application can generate a control instruction structure according to a binary tree with a unified structure, and generate control instructions according to the node values ​​of multiple nodes contained in the binary tree, thereby ensuring the consistency of the control instruction structure, achieving the purpose of generating structured control instructions, and reducing the difficulty of entity recognition of control instructions, thereby achieving the technical effect of reducing the difficulty of mining user intentions based on control instructions, and then solving the technical problem that the forms of control instructions are often different, which makes it very difficult to discover user intentions based on historical control instructions. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0026] Figure 1is a hardware environment schematic diagram of a method for generating a control instruction according to an embodiment of the present application;

[0027] Figure 2 is a flow chart of a method for generating a control instruction according to an embodiment of the present application;

[0028] Figure 3 It is a binary tree diagram of a method for generating a control instruction in an embodiment of the present application;

[0029] Figure 4 is a schematic diagram of a method for identifying the intention of a control instruction according to an embodiment of the present application;

[0030] Figure 5 It is a structural schematic diagram of a control instruction generating device according to an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] According to one aspect of an embodiment of the present application, a method for generating a control instruction is provided. The method for generating a control instruction is widely used in smart home, smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above control instruction generation method can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0034] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0035] In this embodiment, a method for generating a control instruction is provided, which is applied to the above-mentioned computer terminal. Figure 2 : is a flow chart of a method for generating a control instruction according to an embodiment of the present application, the flow includes the following steps:

[0036] Step S202, in response to receiving a user manipulation instruction, calling a preset relationship corresponding to the user manipulation instruction, wherein the preset mapping relationship is used to represent a mapping relationship between a slot in the user manipulation instruction and position information of a node of a preset binary tree.

[0037] Specifically, the user control instruction may be a control instruction generated according to the user's voice, for example, the user's voice may be "set the bedroom air conditioning temperature to 27 degrees", or it may be a control instruction generated by the user selecting a corresponding option in the mobile terminal. The user control instruction may essentially be a user query. The preset binary tree may be a binary tree of a fixed structure designed by the R&D personnel according to the requirements, for example, the preset binary tree may be a complete binary tree.

[0038] In an optional embodiment, the above-mentioned preset relationship may be pre-set by a staff member and stored in the device.

[0039] Optionally, the user control instruction includes: the target device name, target device location information and target device parameters of the smart home device. Specifically, the target device can be a smart home device for responding to the user control instruction, such as smart sockets and smart air conditioners. The target device location information can be the location of the smart home device, such as a living room, bedroom, study, etc. The command to be executed can be "shut down", "start up" or adjust the working mode of the target device, or the parameters of the target device, where the parameters of the target device can be the target device attributes, for example, if the target device is an air conditioner, the target device can be the temperature and mode, if the target device is a smart speaker, the target device attribute can be the volume, if the target device is an electric fan, it can be the gear, etc.

[0040] Optionally, the leaf nodes of the binary tree have node values. Specifically, the nodes of the binary tree, except the root node of the binary tree, the leaf nodes of the binary tree have node values, and the non-leaf nodes are used to identify the connection relationship of the child nodes.

[0041] Optionally, the binary tree is a complete binary tree. Specifically, a non-leaf node of the binary tree must have two left and right child nodes.

[0042] As an optional implementation, Figure 3 is a binary tree diagram of a method for generating a control instruction in an embodiment of the present application, such as Figure 3 As shown, taking the device control instruction "Set the living room air conditioner to 25 degrees" as an example, the action node is used to represent the action of "setting", and there is no corresponding node value. The attrValue node is used to represent the attribute value of the target device air conditioner. The node value of the attrValue node is "25 degrees". The attr node is used to represent the attribute of the target device air conditioner. In this embodiment, the attr node is an empty node. The device node is used to represent the smart home device that executes the control instruction. The node value of the device node is "air conditioner". The room node is used to represent the location of the smart home device that executes the control instruction. The node value of the room node is "living room". The node values ​​of the action node and all leaf nodes in the binary tree are the corresponding slot values ​​in the user query. For example, the leaf node attrValue can directly obtain the node value from the slot storing the attribute value of the target device in the user query. The node value of the left subtree is the tree node formalized value, such as dest, dest_attr, which are used to identify the connection relationship between nodes.

[0043] It should be noted that if the control instruction to be executed is "increase the temperature of the living room air conditioner by 3 degrees", the node used to represent the action can be the increase node. If the control instruction to be executed is "decrease the temperature of the living room air conditioner by 5 degrees", the node used to represent the action can be the decrease node.

[0044] Step S204: generating a binary tree corresponding to the user manipulation instruction based on the preset relationship.

[0045] Specifically, the target information of the binary tree node can be confirmed from the user control instruction based on the preset relationship. After confirming the target information, the target information can be further filled into the corresponding node based on the preset relationship as the node value of the node, and finally a binary tree corresponding to the user control instruction is obtained.

[0046] Step S206: Generate a control instruction based on the node values ​​of the multiple nodes in the binary tree, wherein the control instruction is used to adjust the device parameters of the smart home device.

[0047] Specifically, the control instruction may be a character string. The multiple nodes may be all nodes included in the binary tree.

[0048] As an optional implementation, Figure 3 Taking the provided binary tree as an example, the node values ​​of the binary tree are as follows: the node value of the action node is empty, the node value of the attrValue node is "25 degrees", the node value of the attr node is empty, the node value of the device node is "air conditioning", the node value of the device node is "air conditioning", the node value of the room node is "living room", and the control instruction is "set (dest (air conditioning, living room), 25 degrees)".

[0049] In at least some embodiments of the present disclosure, in response to receiving a user control instruction, a binary tree corresponding to the user control instruction is uniformly generated, and the binary tree is traversed in post-order to generate control instructions, so that structured control instructions can be generated according to the structure of the binary tree, thereby achieving the purpose of generating structured control instructions, reducing the difficulty of entity recognition of control instructions, thereby achieving the technical effect of reducing the difficulty of mining user intentions based on control instructions, and further solving the technical problem that the forms of control instructions are often not the same, which makes it very difficult to discover user intentions based on historical control instructions.

[0050] Optionally, based on the user control instruction and based on a preset relationship, a binary tree corresponding to the user control instruction is generated, including: confirming target information from the user control instruction according to the preset mapping relationship; based on the preset mapping relationship, filling the target information into the node corresponding to the preset binary tree to obtain the binary tree.

[0051] Specifically, the slot that has a preset mapping relationship with the node of the binary tree can be determined according to the preset mapping relationship, and the data stored in the slot can be determined to be the target information. The target information is then filled into the node of the binary tree that has an associated relationship with the slot as the node value of the node to obtain a binary tree.

[0052] Optionally, based on the node values ​​of multiple nodes in the binary tree, a control instruction is generated: the binary tree is subsequently traversed to confirm the node values ​​of multiple nodes included in the binary tree; and the control instruction is generated according to the node values ​​of the multiple nodes.

[0053] Specifically, the traversal of the binary tree may be performed using a subsequent traversal. In the subsequent traversal of the binary tree, the order of left, right, and root may be adopted, that is, the left subtree is first traversed, then the right subtree is traversed, and finally the root node is visited.

[0054] As an optional implementation, Figure 3 Taking the provided binary tree as an example, the node values ​​of the binary tree are as follows: the node value of the action node is empty, the node value of the attrValue node is "25 degrees", the node value of the attr node is empty, the node value of the device node is "air conditioning", the node value of the device node is "air conditioning", the node value of the room node is "living room", and the control instruction is "set (dest (air conditioning, living room), 25 degrees)".

[0055] Optionally, generating a control instruction based on the node values ​​of multiple nodes includes: dividing the binary tree to determine a child binary tree corresponding to a parent node among the multiple nodes; generating a first control instruction corresponding to the child binary tree based on the node values ​​of the child nodes contained in the child binary tree; generating a second control instruction corresponding to the parent node based on the node value of the parent node and the first control instruction; and determining the second control instruction corresponding to the root node among the multiple nodes as the control instruction.

[0056] Specifically, the above-mentioned sub-binary trees can be the left subtree and the right subtree of the binary tree. The above-mentioned first control instruction can be a character expression corresponding to the left subtree, or it can be a character expression corresponding to the right subtree. The above-mentioned child node can be any node in the binary tree that has a corresponding parent node, that is, any node in the binary tree except the root node. The above-mentioned parent node can be any parent node in the binary tree, such as the root node of the binary tree, the root node of the left subtree, and the root node of the right subtree. The root node among the multiple nodes can be the root node of the binary tree, and the second control instruction can be the character expression corresponding to the binary tree.

[0057] As an optional implementation, Figure 3Taking the binary tree provided in as an example, the sub-binary tree can be a sub-binary tree with the dest_attr node as the root node, or it can be a sub-binary tree composed of attrValue nodes. When the sub-binary tree is a sub-binary tree with the dest_attr node, the first control instruction node_left_pdt can be "(dest(air conditioner, living room)", and the first control instruction corresponding to the sub-binary tree composed of attrValue nodes can be "25 degrees". The node expression of the root node action is "Set (dest(air conditioner, living room), 25 degrees)".

[0058] Optionally, based on the node values ​​of the child nodes contained in the child binary tree, generating the first control instruction corresponding to the child binary tree includes: in response to the child node being a leaf node among multiple nodes, generating the first control instruction based on the node value of the child node; in response to the child node being a parent node among multiple nodes, repeating the steps of determining the child binary tree, generating the first control instruction and generating the second control instruction.

[0059] As an optional implementation, Figure 3 Taking the provided binary tree as an example, attrValue is a leaf node, and the first control instruction corresponding to the attrValue node is "25 degrees". The attr node is a leaf node, and the first control instruction corresponding to the attr node is "~". The dest node is the parent node, and the first control instruction of the dest node is determined to be "dest(air conditioner, living room)". Since the dest node is not the root node, the parent node of the dest node is further determined, that is, the first control instruction of the dest_attr node. The first control instruction of the dest_attr node is "dest_atttr(dest(air conditioner, living room), ~)" = "dest(air conditioner, living room)". The dest_attr node is not the root node of the binary tree either. The control instruction of the action node is further confirmed. The control instruction corresponding to the action node is "Set (dest(air conditioner, living room), 25 degrees)". The action node is determined to be the root node, and "Set (dest(air conditioner, living room), 25 degrees)" is determined to be the second control instruction.

[0060] Optionally, generating a first control instruction based on the node value of the child node includes: in response to the node value of the child node satisfying a preset condition, determining that the node value of the child node is the first control instruction; in response to the node value of the child node not satisfying the preset condition, determining that the first control instruction is a preset instruction.

[0061] Specifically, the preset condition may be that the node value is not empty, and the preset instruction may be a preset symbol for identifying an empty node value, such as "~". When the node value of the child node is not empty, the first control instruction is generated according to the specific node value of the child node. When the node value of the child node is empty, the control instruction of the child node is "~". Figure 3 Taking the provided binary tree as an example, the node value of the attrValue node is "25" degrees, and the first control instruction corresponding to the attrValue node is "25 degrees". The node value of the attr node is empty, and the control instruction corresponding to the attr node is the preset instruction "~".

[0062] Optionally, determining that the first control instruction is a preset instruction includes: acquiring multiple preset instructions, wherein different preset instructions correspond to different users; determining a target user corresponding to the user operation instruction; and determining that the first control instruction is a preset instruction corresponding to the target user.

[0063] Specifically, different user control instructions may correspond to different preset instructions. For example, if the execution action of the user control instruction is "set", the preset instruction is "~", and if the execution action of the user control instruction is "increase", the preset instruction is "!". After receiving the user operation instruction, the smart home device determines the preset instruction corresponding to the user operation instruction. When the child node is a leaf node and the node value of the child node is empty, the first control instruction corresponding to the child node is determined to be the preset instruction corresponding to the target user.

[0064] Optionally, generating a second control instruction corresponding to the parent node based on the node value of the parent node and the first control instruction includes: in response to the first control instructions not being preset instructions, generating a second control instruction based on the node value of the parent node and the first control instruction; in response to the first control instruction corresponding to the first sub-binary tree in the sub-binary tree being the second preset instruction, generating a second control instruction based on the node value of the parent node and the first control instruction corresponding to the second sub-binary tree in the sub-binary tree, wherein the first control instruction corresponding to the second sub-binary tree is not a preset instruction; in response to the first control instructions being preset instructions, generating a second control instruction based on the node value of the parent node.

[0065] As an optional implementation, the current parent node of the traversed binary tree is the root node node, the first control instruction of the left child node of the root node of the binary tree is node_left_pdt, and the first control instruction of the right child node is node_right_pdt. Taking the case where the node value of the current node is node_value as an example, when the first control instruction of the left child node is a preset instruction, the expression of the current node is cur_node_pdt=node_value(~,node_right_pdt), and when the first control instruction of the right child node is the first control instruction, cur_node_pdt=node_value(node_left_pdt,~). When the first control instructions of the left child node and the right child node are both preset instructions, cur_node_pdt=node_value(~,~)=node_value.

[0066] As an optional implementation, the present application also provides a method for identifying the intent of a control instruction. The control instruction of the control instruction generation method provided in the present application can use the above control instruction intention identification method to mine user intent. The intention identification method specifically includes the following steps:

[0067] Step 1: Entity extraction:

[0068] For example, the BERT model can be used to extract entities from the text data corresponding to the user's control instructions. The following relationship between entity data and entity data categories can be defined:

[0069] device: target device name, such as refrigerator and air conditioner.

[0070] attr: Set target device attributes, such as temperature, mode, and volume.

[0071] attrValue: Sets the target device attribute value, such as setting the volume to "26".

[0072] location: Target device location information, such as living room, bathroom, and first floor.

[0073] action: target device action, such as set, open, close, increase, etc.

[0074] Among them, the structural diagram of the BERT model can be shown as follows Figure 4 As shown, Figure 4It is a schematic diagram of the intention recognition method of the control instruction according to the embodiment of the present application. Combined with the logical structure of BERT (Chinese word segmentation) + CRF (part-of-speech tagging), the learning rate of the CRF layer can be set greater than the BERT layer during training, for example, the learning rate of the CRF layer is set to 100 times that of the BERT layer.

[0075] In this embodiment, taking "adjust the air conditioner temperature to 25 degrees" as an example, the following entity relationship can be obtained using the entity extraction model:

[0076] device: air conditioner;

[0077] attr: temperature;

[0078] attrValue:25;

[0079] action: adjust.

[0080] Step 2: Generate control instructions:

[0081] In this step, the entity data extracted in step one can be formally expressed in the following way to obtain the generated intent expression: determine the entity category in the entity data and obtain the entity data corresponding to the preset attributes of the node on the preset binary tree, and then fill the corresponding entity data into the corresponding node as the node value of the node, and obtain a binary tree, and then traverse the binary tree to generate control instructions.

[0082] Alternatively, taking "increase the air conditioning temperature in the living room by 2 degrees" as an example, the following intent expression can be obtained:

[0083] Increase(dest_attr(location(air conditioner, living room), temperature), 2 degrees).

[0084] Step 3: Inference of control instruction intention:

[0085] Specifically, step three includes the following steps:

[0086] Step 1: Get a predefined set of intents.

[0087] For example, taking AirConditionerIncrTemp and AirConditionerDecrTemp as the codes for increasing and decreasing the temperature of the air conditioner, an intent set including the following mapping relationships is defined. It should be noted that when defining the mapping relationship, all possible expressions should be enumerated as much as possible.

[0088] Taking AirConditionerIncrTemp as the preset intent set as an example, the intent expressions included in AirConditionerIncrTemp are as follows:

[0089] AirConditionerIncrTemp:[

[0090] "increase(dest_attr(location(air conditioner, room), temperature), \\d+degrees)",

[0091] "increase(dest_attr(air conditioner, temperature), \\d+degrees)",

[0092] "increase(dest_attr(~, temperature), \\d+degrees)",

[0093] "increase(air conditioning, \\d+degrees)",

[0094] "increase(~,\\d+degree)"

[0095] ].

[0096] Taking AirConditionerDecrTemp as the preset intent set as an example, the intent expressions included in AirConditionerIncrTemp are as follows:

[0097] AirConditionerDecrTemp:[

[0098] "decrease(dest_attr(location(air conditioner, room), temperature), \\d+degrees)",

[0099] "decrease(dest_attr(air conditioner, temperature), \\d+degrees)",

[0100] "decrease(dest_attr(~, temperature), \\d+degrees)",

[0101] "decrease(air conditioning, \\d+degrees)",

[0102] "decrease(~,\\d+degree)"

[0103] ].

[0104] Step 2: Get the target intent expression that matches the intent expression generated in step 2 in the preset intent set:

[0105] In step 2, include:

[0106] Step 2.1: Standardize the intent expression generated in step 2 according to the preset dictionary. The dictionary content example is as follows:

[0107] increase: to raise or increase

[0108] decrease: lower;

[0109] room: living room|kitchen.

[0110] Then, the intent expression "increase(dest_attr(location(air conditioner, living room),temperature), 2 degrees)" can be standardized as: "increase(dest_attr(location(air conditioner, room),temperature), 2 degrees)".

[0111] Step 2.2: Traverse each intent expression in the intent set and match each element of each intent expression. The pseudo code for implementing the matching is as follows:

[0112] 1var intents / / intent semantics set

[0113] 2var queryFormula / / User input formal expression

[0114] 3var intentResults / / hit intent

[0115] 4def intentInfer(var queryFormula):

[0116] 5for intent in intents:

[0117] 6for formula in intents.formulas:

[0118] 7if match(formula,queryFormula):

[0119] 8intentResults.add(intent).

[0120] Through the above-mentioned embodiments, the user's intention can be accurately identified. Compared with the existing classification model identification method, the maintenance cost is low and the identification efficiency is higher.

[0121] Figure 5 is a structural schematic diagram of a device for generating a control instruction according to an embodiment of the present application, the device comprising:

[0122] The calling template 52 is used to call a preset relationship corresponding to the user manipulation instruction in response to receiving the user manipulation instruction, wherein the preset mapping relationship is used to represent the mapping relationship between the slot in the user manipulation instruction and the position information of the node of the preset binary tree.

[0123] The binary tree generation module 54 is used to generate a binary tree corresponding to the user control instruction based on a preset relationship.

[0124] The instruction generation module 56 is used to generate control instructions based on the node values ​​of multiple nodes in the binary tree, wherein the control instructions are used to adjust device parameters of the smart home device.

[0125] In the above-mentioned embodiment of the present application, in response to receiving a user control instruction, a preset relationship corresponding to the user control instruction is called, and then based on the preset relationship, a binary tree corresponding to the user control instruction is uniformly generated, and then a control instruction is generated according to the node values ​​of multiple nodes in the binary tree. Based on this, the present application can generate a control instruction structure according to a binary tree with a unified structure, and generate control instructions according to the node values ​​of multiple nodes contained in the binary tree, thereby ensuring the consistency of the control instruction structure, achieving the purpose of generating structured control instructions, and reducing the difficulty of entity recognition of control instructions, thereby achieving the technical effect of reducing the difficulty of mining user intentions based on control instructions, and then solving the technical problem that the forms of control instructions are often different, which makes it very difficult to discover user intentions based on historical control instructions.

[0126] Optionally, the binary tree generation module includes: a target information confirmation unit, used to confirm the target information from the user control instruction according to a preset mapping relationship; and a filling unit, used to fill the target information into the node corresponding to the preset binary tree based on the preset mapping relationship to obtain the binary tree.

[0127] Optionally, the instruction generation module includes: a traversal unit, used to subsequently traverse the binary tree to confirm the node values ​​of multiple nodes contained in the binary tree; and a first instruction generation unit, used to generate control instructions according to the node values ​​of the multiple nodes.

[0128] Optionally, the instruction generation module includes: a partitioning unit, used to partition the binary tree and determine a child binary tree corresponding to a parent node among multiple nodes; a second instruction generation unit, used to generate a first control instruction corresponding to the child binary tree based on the node values ​​of the child nodes contained in the child binary tree; a third instruction generation unit, used to generate a second control instruction corresponding to the parent node based on the node value of the parent node and the first control instruction; and an instruction determination unit, used to determine that the second control instruction corresponding to the root node among multiple nodes is a control instruction.

[0129] Optionally, the second instruction generation unit is also used to generate a first control instruction based on the node value of the child node in response to the child node being a leaf node among multiple nodes; and to repeat the steps of determining the child binary tree, generating the first control instruction and generating the second control instruction in response to the child node being a parent node among multiple nodes.

[0130] Optionally, the second instruction generation unit is also used to, in response to the child node being a parent node among multiple nodes, repeatedly execute the steps of determining the child binary tree, generating a first control instruction and generating a second control instruction; in response to the node value of the child node not satisfying a preset condition, determine that the first control instruction is a preset instruction.

[0131] Optionally, the instruction determination unit is further used to obtain multiple preset instructions, wherein different preset instructions correspond to different users; determine the target user corresponding to the user operation instruction; and determine the first control instruction as the preset instruction corresponding to the target user.

[0132] Optionally, the third instruction generation unit is also used to generate a second control instruction based on the node value of the parent node and the first control instruction in response to the first control instructions not being preset instructions; generate a second control instruction based on the node value of the parent node and the first control instruction corresponding to the second sub-binary tree in the sub-binary tree in response to the first control instruction corresponding to the first sub-binary tree being the second preset instruction, wherein the first control instruction corresponding to the second sub-binary tree is not a preset instruction; and generate a second control instruction based on the node value of the parent node in response to the first control instructions being preset instructions.

[0133] According to one embodiment of the present disclosure, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above control instruction generation methods when running.

[0134] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0135] S1, in response to receiving a user manipulation instruction, calling a preset relationship corresponding to the user manipulation instruction, wherein the preset mapping relationship is used to represent a mapping relationship between a slot in the user manipulation instruction and position information of a node of a preset binary tree;

[0136] S2, generating a binary tree corresponding to the user control instruction based on the preset relationship;

[0137] S3, generating a control instruction based on the node values ​​of the multiple nodes in the binary tree, wherein the control instruction is used to adjust the device parameters of the smart home device.

[0138] Through the above embodiment, in response to receiving a user control instruction, the preset relationship corresponding to the user control instruction is called, and then based on the preset relationship, a binary tree corresponding to the user control instruction is uniformly generated, and then a control instruction is generated according to the node values ​​of multiple nodes in the binary tree. Based on this, the present application can generate a control instruction structure according to a binary tree with a unified structure, and generate control instructions according to the node values ​​of multiple nodes contained in the binary tree, thereby ensuring the consistency of the control instruction structure, achieving the purpose of generating structured control instructions, and reducing the difficulty of entity recognition of control instructions, thereby achieving the technical effect of reducing the difficulty of mining user intentions based on control instructions, and then solving the technical problem that the forms of control instructions are often different, which makes it very difficult to discover user intentions based on historical control instructions.

[0139] Optionally, in this embodiment, the above-mentioned storage medium can be configured to store program code for executing the following steps: confirming target information from user control instructions according to a preset mapping relationship; based on the preset mapping relationship, filling the target information into the nodes corresponding to the preset binary tree to obtain a binary tree.

[0140] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps: subsequently traversing the binary tree to confirm node values ​​of multiple nodes contained in the binary tree; and generating control instructions according to the node values ​​of the multiple nodes.

[0141] Optionally, in this embodiment, the above-mentioned storage medium can be configured to store program codes for executing the following steps: partitioning the binary tree to determine a child binary tree corresponding to a parent node among multiple nodes; generating a first control instruction corresponding to the child binary tree based on the node values ​​of the child nodes contained in the child binary tree; generating a second control instruction corresponding to the parent node based on the node value of the parent node and the first control instruction; and determining that the second control instruction corresponding to the root node among multiple nodes is a control instruction.

[0142] Optionally, in this embodiment, the above-mentioned storage medium can be configured to store program codes for executing the following steps: in response to the child node being a leaf node among multiple nodes, generating a first control instruction based on the node value of the child node; in response to the child node being a parent node among multiple nodes, repeatedly executing the steps of determining a child binary tree, generating a first control instruction, and generating a second control instruction.

[0143] Optionally, in this embodiment, the above-mentioned storage medium can be configured to store program code for executing the following steps: in response to the node value of the child node satisfying a preset condition, determining that the node value of the child node is a first control instruction; in response to the node value of the child node not satisfying the preset condition, determining that the first control instruction is a preset instruction.

[0144] Optionally, in this embodiment, the above-mentioned storage medium can be configured to store program codes for executing the following steps: obtaining multiple preset instructions, wherein different preset instructions correspond to different users; determining the target user corresponding to the user operation instruction; and determining that the first control instruction is a preset instruction corresponding to the target user.

[0145] Optionally, in this embodiment, the above-mentioned storage medium can be configured to store program codes for executing the following steps: in response to the first control instructions not being preset instructions, generating a second control instruction based on the node value of the parent node and the first control instruction; in response to the first control instruction corresponding to the first sub-binary tree in the sub-binary tree being the second preset instruction, generating a second control instruction based on the node value of the parent node and the first control instruction corresponding to the second sub-binary tree in the sub-binary tree, wherein the first control instruction corresponding to the second sub-binary tree is not a preset instruction; in response to the first control instructions being preset instructions, generating a second control instruction based on the node value of the parent node.

[0146] According to one embodiment of the present disclosure, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above control instruction generation methods.

[0147] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0148] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0149] S1, in response to receiving a user manipulation instruction, calling a preset relationship corresponding to the user manipulation instruction, wherein the preset mapping relationship is used to represent a mapping relationship between a slot in the user manipulation instruction and position information of a node of a preset binary tree;

[0150] S2, generating a binary tree corresponding to the user control instruction based on the preset relationship;

[0151] S3, generating a control instruction based on the node values ​​of the multiple nodes in the binary tree, wherein the control instruction is used to adjust the device parameters of the smart home device.

[0152] Through the above embodiment, in response to receiving a user control instruction, the preset relationship corresponding to the user control instruction is called, and then based on the preset relationship, a binary tree corresponding to the user control instruction is uniformly generated, and then a control instruction is generated according to the node values ​​of multiple nodes in the binary tree. Based on this, the present application can generate a control instruction structure according to a binary tree with a unified structure, and generate control instructions according to the node values ​​of multiple nodes contained in the binary tree, thereby ensuring the consistency of the control instruction structure, achieving the purpose of generating structured control instructions, and reducing the difficulty of entity recognition of control instructions, thereby achieving the technical effect of reducing the difficulty of mining user intentions based on control instructions, and then solving the technical problem that the forms of control instructions are often different, which makes it very difficult to discover user intentions based on historical control instructions.

[0153] Optionally, in this embodiment, the above-mentioned processor can be configured to perform the following steps through a computer program: confirming the target information from the user control instruction according to a preset mapping relationship; based on the preset mapping relationship, filling the target information into the node corresponding to the preset binary tree to obtain a binary tree.

[0154] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: subsequently traversing the binary tree to confirm node values ​​of multiple nodes contained in the binary tree; and generating control instructions according to the node values ​​of the multiple nodes.

[0155] Optionally, in this embodiment, the above-mentioned processor can be configured to perform the following steps through a computer program: divide the binary tree to determine the child binary tree corresponding to the parent node among multiple nodes; generate a first control instruction corresponding to the child binary tree based on the node values ​​of the child nodes contained in the child binary tree; generate a second control instruction corresponding to the parent node based on the node value of the parent node and the first control instruction; determine that the second control instruction corresponding to the root node among multiple nodes is the control instruction.

[0156] Optionally, in this embodiment, the above-mentioned processor can be configured to perform the following steps through a computer program: in response to the child node being a leaf node among multiple nodes, generating a first control instruction based on the node value of the child node; in response to the child node being a parent node among multiple nodes, repeatedly executing the steps of determining a child binary tree, generating a first control instruction and generating a second control instruction.

[0157] Optionally, in this embodiment, the above-mentioned processor can be configured to perform the following steps through a computer program: in response to the node value of the subnode satisfying a preset condition, determining that the node value of the subnode is a first control instruction; in response to the node value of the subnode not satisfying the preset condition, determining that the first control instruction is a preset instruction.

[0158] Optionally, in this embodiment, the above-mentioned processor can be configured to perform the following steps through a computer program: obtain multiple preset instructions, where different preset instructions correspond to different users; determine the target user corresponding to the user operation instruction; and determine that the first control instruction is the preset instruction corresponding to the target user.

[0159] Optionally, in this embodiment, the above-mentioned processor can be configured to perform the following steps through a computer program: in response to the first control instructions not being preset instructions, generating a second control instruction based on the node value of the parent node and the first control instruction; in response to the first control instruction corresponding to the first sub-binary tree in the sub-binary tree being the second preset instruction, generating a second control instruction based on the node value of the parent node and the first control instruction corresponding to the second sub-binary tree in the sub-binary tree, wherein the first control instruction corresponding to the second sub-binary tree is not a preset instruction; in response to the first control instructions being preset instructions, generating a second control instruction based on the node value of the parent node.

[0160] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0161] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0162] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0163] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for generating a control instruction, characterized in that: include: In response to receiving a user manipulation instruction, calling a preset relationship corresponding to the user manipulation instruction, wherein the preset mapping relationship is used to represent a mapping relationship between a slot in the user manipulation instruction and position information of a node of a preset binary tree; Based on the preset relationship, generating a binary tree corresponding to the user control instruction; Based on the node values ​​of the plurality of nodes in the binary tree, a control instruction is generated, wherein the control instruction is used to adjust the device parameters of the smart home device, wherein: Based on the preset relationship, a binary tree corresponding to the user control instruction is generated, including: Confirming target information from the user control instruction according to a preset mapping relationship, wherein a slot having a preset mapping relationship with a node of the binary tree is determined according to the preset mapping relationship, and determining that the data stored in the slot is the target information; Based on the preset mapping relationship, filling the target information into the node corresponding to the preset binary tree to obtain the binary tree, wherein the structure of the preset binary tree is fixed; The root node and leaf nodes of the binary tree have node values, and the non-leaf nodes of the binary tree are used to identify the connection relationship of the child nodes.

2. The method according to claim 1, characterized in that Based on the node values ​​of multiple nodes in the binary tree, a control instruction is generated: Subsequently traversing the binary tree to confirm node values ​​of a plurality of nodes included in the binary tree; A control instruction is generated according to the node values ​​of the plurality of nodes.

3. The method according to claim 1, characterized in that Based on the node values ​​of the plurality of nodes in the binary tree, generating a control instruction comprises: Divide the binary tree to determine child binary trees corresponding to parent nodes among the multiple nodes; Generate a first control instruction corresponding to the sub-binary tree based on the node value of the sub-node included in the sub-binary tree; Generate a second control instruction corresponding to the parent node based on the node value of the parent node and the first control instruction; A second control instruction corresponding to a root node among the multiple nodes is determined to be the control instruction.

4. The method according to claim 3, characterized in that Based on the node values ​​of the child nodes included in the child binary tree, generating a first control instruction corresponding to the child binary tree includes: In response to the child node being a leaf node among the plurality of nodes, generating the first control instruction based on the node value of the child node; In response to the child node being a parent node among the multiple nodes, the steps of determining the child binary tree, generating the first control instruction, and generating the second control instruction are repeatedly performed.

5. The method according to claim 4, characterized in that Generating the first control instruction based on the node value of the child node includes: In response to the node value of the child node satisfying a preset condition, determining the node value of the child node to be the first control instruction; In response to the node value of the child node not satisfying the preset condition, determining that the first control instruction is a preset instruction.

6. The method according to claim 5, characterized in that Determining that the first control instruction is a preset instruction includes: Acquire multiple preset instructions, where different preset instructions correspond to different users; Determine a target user corresponding to the user operation instruction; Determine that the first control instruction is a preset instruction corresponding to the target user.

7. The method according to claim 3, characterized in that Generating a second control instruction corresponding to the parent node based on the node value of the parent node and the first control instruction includes: In response to the first control instructions not being preset instructions, generating the second control instruction based on the node value of the parent node and the first control instruction; In response to the first control instruction corresponding to the first sub-binary tree in the sub-binary trees being a second preset instruction, generating the second control instruction based on the node value of the parent node and the first control instruction corresponding to the second sub-binary tree in the sub-binary tree, wherein the first control instruction corresponding to the second sub-binary tree is the preset instruction; In response to the first control instructions being the preset instructions, the second control instruction is generated based on the node value of the parent node.

8. A control instruction generating device, characterized in that: include: A calling module, configured to call a preset relationship corresponding to the user manipulation instruction in response to receiving the user manipulation instruction, wherein the preset mapping relationship is used to represent a mapping relationship between a slot in the user manipulation instruction and position information of a node of a preset binary tree; A binary tree generation module, used to generate a binary tree corresponding to the user control instruction based on the preset relationship; An instruction generation module is used to generate a control instruction based on the node values ​​of multiple nodes in the binary tree, wherein the control instruction is used to adjust the device parameters of the smart home device, wherein: The binary tree generation module includes: a target information confirmation unit, which is used to confirm the target information from the user control instruction according to the preset mapping relationship, wherein the slot having the preset mapping relationship with the node of the binary tree is determined according to the preset mapping relationship, and the data stored in the slot is determined to be the target information; A filling unit, configured to fill the target information into a node corresponding to the preset binary tree based on the preset mapping relationship to obtain the binary tree, wherein the structure of the preset binary tree is fixed; The root node and leaf nodes of the binary tree have node values, and the non-leaf nodes of the binary tree are used to identify the connection relationship of the child nodes.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Home equipment control method and device, storage medium and smart home system

    CN110262273A

  • Information query method and device, computer equipment and storage medium

    CN111651579A