Household equipment control method and device, electronic equipment and storage medium

By generating linked directed graphs and grouped key-value pairs, the smart home system realizes the simultaneous triggering of multiple rule expressions, solves the problem of low rule execution efficiency in the existing technology, and improves user experience.

CN118759872APending Publication Date: 2024-10-11QINGDAO HAIER TECH +2
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202410942916.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

When existing smart home systems connect multiple home devices, the large number of regular expressions causes slow operation and cannot provide a comfortable and fast user experience.

Method used

Generate a linkage directed graph by obtaining rule expressions, traverse node groups to obtain linkage key-value groups, and trigger home devices to run according to the linkage key-value groups, achieving simultaneous triggering of multiple rule expressions.

Benefits of technology

It improves the rule execution efficiency of the smart home system and optimizes the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118759872A_ABST
    Figure CN118759872A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for controlling household equipment, electronic equipment and a storage medium, and relates to the technical field of smart home, and the method for controlling the household equipment comprises the steps: obtaining a rule expression; the rule expression is used for representing a control rule of the equipment attribute of the home equipment; generating a linkage directed graph according to the rule expression; the linkage directed graph comprises nodes and directed edges between the nodes; traversing the linkage directed graph to obtain a linkage key value group; the linkage key value group comprises a plurality of key value pairs used for representing a triggering relationship among the household equipment; and triggering the home equipment to operate according to the linkage key value group. Thus, simultaneous triggering of multiple rule expressions can be realized, the rule execution efficiency of the smart home system is improved, and the user experience is optimized.
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 technology, and more specifically, to a method, device, electronic device and storage medium for controlling home appliances. Background Art

[0002] With the rapid development of Internet of Things technology and the improvement of economic level, more and more electronic devices of different types are involved in home scenes, so smart home systems come into being. Driven by the development of artificial intelligence, automatic control, Internet of Things and other technologies, smart home systems connect various home devices into an interconnected whole, and conduct comprehensive management through terminal software to improve the convenience, comfort and safety of family life.

[0003] At present, smart home systems can realize the interaction between devices according to the specified regular expressions. Regarding regular expressions, the most representative one is IFTTT (IfThis ThenThat, an event-driven programming method with users as the main body), that is, if one thing is triggered, another set thing will be executed, so that a chain reaction can be achieved between various applications and services. In IFTTT, the operation to be performed by "This" is called a trigger, which is an operation behavior in a scenario, and "That" represents another service behavior brought about by the chain reaction, which is called an action. When the trigger meets the triggering conditions, the behavior specified in the action will be executed.

[0004] Generally, when a smart home system controls home appliances based on rule expressions, it first needs to obtain multiple rule expressions with each home appliance as the main body, and then obtain the state attributes of the corresponding home appliances based on the rule expressions to determine whether the corresponding home appliances meet the trigger conditions. When the corresponding home appliances meet the trigger conditions, the smart home system controls the corresponding home appliances to perform the behavior specified by the action. Each rule expression needs to be executed separately and in sequence.

[0005] In the process of implementing the embodiments of the present application, it is found that there are at least the following problems in the related technology:

[0006] In the prior art, as more and more home appliances are connected to the smart home system, the number of regular expressions input into the system is also increasing. According to the existing rule execution method, the operation speed of the smart home system is slow, which cannot bring a comfortable and fast experience to users.

[0007] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0008] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0009] The embodiments of the present application provide a method and apparatus, an electronic device, and a storage medium for controlling home appliances to solve the technical problem of how to improve the rule execution efficiency of a smart home system.

[0010] In some embodiments, the method for controlling home appliances includes: obtaining a regular expression; the regular expression is used to represent instructions for controlling device properties of home appliances; generating a linkage directed graph based on the regular expression; the linkage directed graph includes nodes and directed edges between nodes; traversing the linkage directed graph to obtain a linkage key value group; the linkage key value group includes multiple key value pairs; the key value pairs are used to represent the trigger relationship between home appliances; triggering home appliances to operate according to the linkage key value group.

[0011] In some embodiments, the device for controlling home appliances includes: an acquisition module configured to acquire a regular expression; the regular expression is used to represent instructions for controlling device properties of home appliances; a generation module configured to generate a linkage directed graph according to the regular expression; the linkage directed graph includes nodes and directed edges between nodes; a processing module configured to traverse the linkage directed graph to obtain a linkage key value group; the linkage key value group includes multiple key value pairs; the key value pairs are used to represent the trigger relationship between home appliances; and an execution module configured to trigger home appliances to operate according to the device linkage key value group.

[0012] In some embodiments, the electronic device includes: a memory and a processor, the memory stores a computer program, and the processor is configured to execute the method for controlling home appliances as described above through the computer program.

[0013] In some embodiments, the computer-readable storage medium includes stored program instructions, and the program instructions are executed by a processor to implement the method for home device control as described above.

[0014] The method and device, electronic device, and storage medium for controlling home appliances provided in the embodiments of the present application can achieve the following technical effects:

[0015] The present invention obtains a linkage directed graph through the acquired rule expression, traverses all nodes in the linkage directed graph, groups the nodes according to the trigger relationship, obtains a linkage key value group, and triggers the home appliance to run according to the linkage key value group, thereby enabling multiple rule expressions to be triggered simultaneously, improving the rule execution efficiency of the smart home system, and optimizing the user experience.

[0016] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] 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.

[0018] 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.

[0019] Figure 1 It is a hardware environment diagram of a method for controlling home appliances provided in an embodiment of the present application;

[0020] Figure 2 is a schematic diagram of a method for controlling home appliances provided in an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of a linkage directed graph provided in an embodiment of the present application;

[0022] Figure 4-1 is a schematic diagram of a head node and related nodes provided in an embodiment of the present application;

[0023] Figure 4-2 is a schematic diagram of another head node and related nodes provided in an embodiment of the present application;

[0024] Figure 5-1 is a schematic diagram of a key-value pair provided in an embodiment of the present application;

[0025] Figure 5-2 is a schematic diagram of another key-value pair provided in an embodiment of the present application;

[0026] Figure 6 is a timing diagram of a method for controlling home appliances provided in an embodiment of the present application;

[0027] Figure 7 is a schematic diagram of a device for controlling household appliances provided in an embodiment of the present application;

[0028] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] 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.

[0030] 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.

[0031] According to one aspect of an embodiment of the present application, a method for controlling home appliances is provided. The method for controlling home appliances is widely used in smart home, smart home, smart home appliance ecosystem, smart house ecosystem and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the method for controlling home appliances can be applied to Figure 1 In the hardware environment composed of the terminal device 101 and the server 102 shown in FIG. Figure 1 As shown, the server 102 is connected to the terminal device 101 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 102. 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 102.

[0032] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above 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 above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 101 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 equipment, a smart dishwasher, a smart projection equipment, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart speaker, a smart fresh air equipment, a smart kitchen and bathroom equipment, a smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification equipment, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0033] Combination Figure 2 As shown, an embodiment of the present application provides a method for controlling home appliances. The method includes:

[0034] Step S201: The electronic device obtains a regular expression. The regular expression is used to represent a control rule for device attributes of a home device.

[0035] Step S202: The electronic device generates a linkage directed graph according to the regular expression. The linkage directed graph includes nodes and directed edges between the nodes.

[0036] Step S203: the electronic device traverses the linkage directed graph to obtain a linkage key value group. The linkage key value group includes a plurality of key value pairs, and the key value pairs are used to represent the trigger relationship between the home appliances.

[0037] Step S204: the electronic device triggers the home device to operate according to the linkage key value group.

[0038] By adopting the method for controlling home appliances provided in the embodiment of the present application, a linkage directed graph is obtained by obtaining a rule expression, all nodes in the linkage directed graph are traversed, each node is grouped according to the trigger relationship, a linkage key value group is obtained, and the home appliances are triggered to run according to the linkage key value group, thereby enabling multiple rule expressions to be triggered simultaneously, improving the rule execution efficiency of the smart home system, and optimizing the user experience.

[0039] Optionally, before the electronic device obtains the regular expression, the method further includes: the electronic device sends a connection request to the home device. When the electronic device is successfully connected to the home device, the electronic device obtains the device information of the home device at the current moment. The electronic device stores the device information in a preset data table to obtain a device data table.

[0040] In the home scene, a variety of home devices are usually involved, including sensor devices, such as temperature sensors, humidity sensors, etc., and actuator devices, such as air conditioners, televisions, lamps, etc. When the home device is paired and connected successfully with the user's smart terminal, the user can obtain the device information of the home device at the current moment through the smart terminal and store it in the device data table. The above-mentioned smart terminal includes a mobile phone, a computer or a server. The user enters a regular expression through the smart terminal. The smart terminal processes the regular expression to obtain a linkage directed graph, and uses a deep traversal algorithm to obtain a linkage key value group. The smart terminal compares the linkage key value group with the device data table to determine all home devices that need to be triggered, and sends the instructions corresponding to the key nodes in the linkage key value group to the home device end. The home device end receives the instructions sent by the smart terminal and executes them according to the instructions.

[0041] Optionally, the device information includes a device name, a device attribute, and an attribute value. Each home appliance has a plurality of device attributes, and the device attribute is used to characterize the control of one aspect of the home appliance, and the corresponding attribute value is a control parameter of the device attribute. For example, the home appliance is a lamp, and the device attributes of the lamp include a switch, a brightness level, and a color temperature. For example, the home appliance is an air conditioner, and the device attributes of the air conditioner include a switch, a cooling mode, and a heating mode. In one embodiment, at the current moment, the lamp is turned on and is in a warm light illumination of the second brightness level, and the air conditioner is turned on and is in a cooling mode. At this time, the user obtains the device information of the home appliance at the current moment through the smart terminal. In the case where the smart terminal obtains the device information of the lamp, the device name is the lamp, the first device attribute is the switch, and the corresponding first attribute value is turned on, the second device attribute is the brightness, and the corresponding second attribute value is the second level, the third device attribute is the color temperature, and the corresponding third attribute value is warm light. In the case where the smart terminal obtains the device information of the air conditioner, the device name is the air conditioner, the first device attribute is the switch, and the corresponding first attribute value is turned on, the second device attribute is the cooling mode, and the corresponding second attribute value is turned on, and the third device attribute is the heating mode, and the corresponding third attribute value is turned off.

[0042] Optionally, the rule expression includes the device information of the home appliance and the control sequence between the home appliances. The rule expression is such as: "If event A, then event B". Event A includes the device information of home appliance A, and event B includes the device information of home appliance B. The control sequence between home appliance A and home appliance B is that when event A occurs, home appliance B is triggered to execute event B. For example, the rule expression is "If the temperature sensor reading is greater than or equal to 25°C, turn on the air conditioner", that is, when the indoor temperature sensor detects that the indoor temperature is greater than or equal to 25°C, the air conditioner switch is triggered to turn on.

[0043] Optionally, generating a linkage directed graph according to the rule expression includes: determining the device information of the household device as a node, determining the directed edges between the nodes according to the control sequence between the household devices, and generating a linkage directed graph. The directed edges between the nodes are the control sequence between the household devices. By converting the rule expression into a directed graph, the linkage relationship between multiple rule expressions is obtained, which is conducive to the subsequent realization that multiple rule expressions are triggered simultaneously when the trigger condition is met.

[0044] Optionally, traversing the linkage directed graph to obtain the linkage key value group includes: obtaining the head node of the linkage directed graph; traversing the linkage directed graph to obtain the target node; and obtaining the linkage key value group according to the head node and the target node. The head node is a node with an in-degree of 0 in the linkage directed graph, and the in-degree is used to characterize the sum of the number of times a node in the directed graph serves as the end point of a directed edge in the directed graph. The in-degree of a node is 0, indicating that the node in the directed graph is not the end point of any directed edge, that is, the directed edges connected to the node all take this point as the starting point. By obtaining the head node of the linkage directed graph and traversing the linkage directed graph, the associated node corresponding to the head node is obtained, so that multiple rule expressions can be grouped according to the trigger relationship to obtain the linkage key value group, so that multiple rule expressions can be triggered simultaneously when the trigger conditions are met.

[0045] Optionally, traversing the linkage directed graph to obtain the target node includes: starting from the head node, traversing the linkage directed graph using a depth-first algorithm to obtain an associated node corresponding to the head node; and determining the associated node as the target node. Traversing the linkage directed graph using a depth-first algorithm can go deep into each possible directed edge branch path of the node until it cannot go deeper, and each node can only be visited once, so no node is missed.

[0046] Optionally, obtaining a linkage key value group according to the head node and the target node includes: obtaining a key value pair according to the head node and the target node; and storing the key value pair in a preset array to obtain a linkage key value group. Each element of the linkage key value group is a key value pair, the key is the head node, and the value is all related nodes traversed from the head node. By grouping the nodes according to the trigger relationship to obtain the linkage key value group, multiple rule expressions can be triggered simultaneously, thereby improving the rule execution efficiency of the smart home system.

[0047] Optionally, a key-value pair is obtained according to the head node and the target node, including: determining the head node as the key; determining the target node as the value; constructing a mapping relationship between the key and the value to obtain a key-value pair. For example, the head node is "temperature sensor ≥ 25", and the target nodes obtained by traversal are "air conditioner on", "window closed" and "door closed". "Temperature sensor ≥ 25" is determined as the key, and "air conditioner on", "window closed" and "door closed" are determined as the value. Construct a trigger relationship between the key and the value to obtain a key-value pair. That is, when the temperature sensor reading is greater than or equal to 25°C, the air conditioner is triggered to turn on, and the windows and doors are closed at the same time.

[0048] In some embodiments, the user inputs a rule expression through a client APP set in a smart terminal, and each rule expression includes two parts: a conditional expression and an action expression. For example, rule expression 1 is "If the temperature sensor reading is greater than or equal to 25°C, turn on the air conditioner", the conditional expression is that the temperature sensor reading is greater than or equal to 25°C, and the action expression turns on the air conditioner. At the same time, the conditional expression and action expression entered by the user need to include the device attributes and attribute values ​​of the home appliance. For example, if the user wants to implement "turn on the air conditioner when the indoor temperature is greater than or equal to 25°C", the user needs to enter the rule expression "If the temperature sensor reading is greater than or equal to 25°C, turn on the air conditioner switch" in the client APP.

[0049] The client APP obtains all regular expressions, obtains a set of regular expressions, and generates a linkage directed graph based on the set of regular expressions. For example, the set of regular expressions includes regular expressions 1, 2, 3, 4, 5, 6, 7, 8, and 9. Regular expression 1 is "If the temperature sensor indicates that the reading is greater than or equal to 25°C, turn on the air conditioner." Regular expression 2 is "If the air conditioner switch is turned on, close the door." Regular expression 3 is "If the air conditioner switch is turned on, close the window." Regular expression 4 is "If the brightness sensor shows dark, close the window." Regular expression 5 is "If the brightness sensor shows dark, turn on the porch light." Regular expression 6 is "If the porch light switch is turned on, turn on the living room light." Regular expression 7 is "If the living room light switch is turned on, turn on the TV." Regular expression 8 is "If the TV switch is turned on, close the curtains." Regular expression 9 is "If the TV switch is turned on, turn on the treadmill."

[0050] Combination Figure 3As shown, the device information of household appliances in the rule expression set is determined as a node. The temperature sensor reading is greater than or equal to 25°C, the air conditioner is on, the door is closed, the window is closed, the brightness sensor is dim, the porch light is on, the living room light is on, the TV is on, the curtains are closed, and the treadmill is on. The directed edges between the nodes are determined according to the control sequence between the above household appliances, that is, "temperature sensor ≥ 25" triggers "air conditioner on", "air conditioner on" triggers "door closed" and "window closed", "brightness sensor dark" triggers "window closed" and "porch light on", "porch light on" triggers "living room light on", "living room light on" triggers "TV on", and "TV on" triggers "curtains closed" and "treadmill on". Based on the obtained nodes and the directed edges between the nodes, the following is obtained. Figure 3 The client APP obtains the head node of the linkage directed graph, which includes "temperature sensor ≥ 25" and "brightness sensor dark".

[0051] Combination Figure 4-1 As shown, starting from the head node "Temperature sensor ≥ 25", the depth-first algorithm is used to traverse the linkage directed graph to obtain the associated nodes corresponding to the head node. In the process of traversing the linkage directed graph using the depth-first algorithm, when a node has two or more directed edge branch paths, the left node sequence is traversed first, and after completing the left node traversal, the right node sequence is traversed. For example, the head node is "Temperature sensor ≥ 25", and all directed edge branch paths of the head node are traversed in the order of "Air conditioner on", "Window closed", and "Door closed" to obtain the related nodes corresponding to the head node, and the related nodes are determined as the target nodes. Among them, the head node is "Temperature sensor ≥ 25", and the corresponding related nodes are "Air conditioner on", "Window closed", and "Door closed". Combined with Figure 4-2 As shown in the figure, starting from the head node "brightness sensor dark", the linkage directed graph is traversed in the order of "porch light on", "living room light on", "TV on", "curtains closed", "treadmill on", and "windows closed" using the depth-first algorithm to obtain the relevant nodes corresponding to the head node, and the relevant nodes are determined as the target nodes. Among them, the head node is "brightness sensor dark", and the target nodes are "porch light on", "living room light on", "TV on", "curtains closed", "treadmill on", and "windows closed".

[0052] Based on the above head node and target node, we get the key-value pair, and determine the head node "temperature sensor ≥ 25" and "brightness sensor dark" as the key, and the target node as the value. The values ​​include "air conditioner on", "window closed", "door closed", "porch light on", "living room light on", "TV on", "curtains closed" and "treadmill on". Based on the association between the head node and the target node, we build a mapping relationship between the key and the value to get the key-value pair. Figure 5-1As shown, "temperature sensor ≥ 25" is associated with "air conditioner on", "window closed" and "door closed", and "temperature sensor ≥ 25" and "air conditioner on", "window closed" and "door closed" are determined as the first key-value pair. Figure 5-2 As shown, "brightness sensor dark" is associated with "porch light on", "living room light on", "TV on", "curtains closed", "treadmill on" and "windows closed", and "brightness sensor dark" and "porch light on", "living room light on", "TV on", "curtains closed", "treadmill on" and "windows closed" are determined as the second key-value pair. The first key-value pair and the second key-value pair are stored in a preset array to obtain a linkage key-value group.

[0053] Optionally, triggering the home appliance to run according to the linkage key value group includes: using the device attribute of the key to perform a table lookup operation from a preset device data table to find out the target attribute value corresponding to the device attribute of the key; the device data table stores the correspondence between the device attributes of all home appliances and the target attribute values; wherein the target attribute value is the attribute value currently running for the home appliance; judging whether the attribute value of the key is the same as the target attribute value; and in the case where the attribute value of the key is the same as the target attribute value, triggering the home appliance to run according to the value. By obtaining the target attribute value from the device database and judging whether the target attribute value is the same as the attribute value of the key, it is determined whether the home appliance runs according to the value corresponding to the key, thereby realizing that the smart home system can more efficiently control the execution of rules by the home appliance.

[0054] In some embodiments, the user detects through the smart terminal that the air conditioner is in the on state at the current moment, and the doors and windows are also in the open state. The smart terminal stores "air conditioner on", "door open" and "window open" in the device data table. Among them, the first device name is air conditioner, the first device attribute is switch, and the first attribute value is on; the second device name is door, the second device attribute is switch, and the second attribute value is on; the third device name is window, the third device attribute is switch, and the third attribute value is on. At this time, the key is "air conditioner on", that is, the air conditioner switch is on, the device name of the key is air conditioner, the device attribute of the key is switch, and the attribute value of the key is on. The corresponding values ​​are "door closed" and "window closed". The device attribute of the key is used to perform a table lookup operation in the device data table to obtain the target attribute value of "on". The target attribute value is the attribute value of the home appliance at the current moment stored in the device data table by the user through the smart terminal. The attribute value "on" of the key is compared with the target attribute value "on", and the two are in the same state. When the attribute value of the key is the same as the target attribute value, the home appliance is triggered to run according to the value, that is, the door and window switches are triggered to close, so that the doors and windows are both in the closed state. If the target attribute value is off at this time, the key attribute value "on" and the target attribute value "off" are in different states, and the home appliance is not triggered to run according to the value, so that the home appliance maintains the current attribute value.

[0055] Combination Figure 6 As shown, the embodiment of the present application provides another method for controlling home appliances, including:

[0056] Step S601: The client sends a pairing connection request to the device.

[0057] Step S602: When pairing is successful, the device sends device information to the client.

[0058] Step S603: the client stores the device information into the device data table.

[0059] Step S604: The client obtains a regular expression.

[0060] Step S605: The client generates a linkage directed graph according to the regular expression.

[0061] Step S606: The client traverses the linkage directed graph to obtain a linkage key value group.

[0062] Step S607: The client obtains information of all devices that need to be triggered according to the linkage key value group.

[0063] Step S608: the client sends all device information that needs to be triggered to the device end.

[0064] Step S609: the device end triggers the corresponding home appliance to operate according to the device information.

[0065] Step S610: the device sends the execution result of the home device to the client.

[0066] In one embodiment, the user first opens the client APP loaded on the smart terminal, and the user can send a pairing connection request to the device side through the client. After receiving the pairing connection request sent by the client, the device side performs a pairing connection, such as Bluetooth pairing or LAN connection. After the device side and the client are successfully paired and connected, the device information of the device side at the current moment is sent to the client. The client stores the received device information in the device data table. At this time, the client starts to obtain the rule expression input by the user, and generates a linkage directed graph according to the above rule expression. The client traverses the linkage directed graph through the depth-first algorithm to obtain a linkage key value group. According to the linkage key value group, the client uses the device attribute of the key to perform a table lookup operation from the device data table to find the target attribute value corresponding to the device attribute of the key. When the attribute value of the key is the same as the target attribute value, the device information of the corresponding value is obtained to obtain all the device information that needs to be triggered. The client sends all the device information that needs to be triggered to the corresponding device side, triggering the corresponding home appliance to run according to the above device information. Finally, the device side sends the corresponding execution result feedback to the client, so that the user can timely understand the completion of the execution of the rule expression by the home appliance through the smart terminal.

[0067] Combination Figure 7 As shown, an embodiment of the present application provides a device 700 for controlling home appliances, including: an acquisition module 701, a generation module 702, a processing module 703 and an execution module 704. The acquisition module 701 is configured to acquire a regular expression; the regular expression is used to characterize the control rules for the device attributes of the home appliance. The generation module 702 is configured to generate a linkage directed graph according to the regular expression. The above-mentioned linkage directed graph includes nodes and directed edges between nodes. The processing module 703 is configured to traverse the linkage directed graph to obtain a linkage key value group. The linkage key value group includes multiple key-value pairs; the key-value pairs are used to characterize the trigger relationship between home appliances. The execution module 704 is configured to trigger the home appliance to run according to the device linkage key value group.

[0068] By using the device for controlling home appliances provided in the embodiment of the present application, a linkage directed graph is obtained by obtaining a rule expression, all nodes in the linkage directed graph are traversed, each node is grouped according to the trigger relationship, a linkage key value group is obtained, and the home appliances are triggered to run according to the linkage key value group, thereby enabling multiple rule expressions to be triggered simultaneously, improving the rule execution efficiency of the smart home system, and optimizing the user experience.

[0069] Optionally, the rule expression includes device information of the household device and a control sequence between the household devices. The generation module is configured to generate a linkage directed graph according to the rule expression in the following manner: determining the device information of the household device as a node, determining directed edges between the nodes according to the control sequence between the household devices, and generating a linkage directed graph.

[0070] Optionally, the processing module is configured to traverse the linkage directed graph to obtain the linkage key value group in the following manner: obtain a head node of the linkage directed graph, traverse the linkage directed graph to obtain a target node, and obtain the linkage key value group according to the head node and the target node.

[0071] Optionally, the processing module is configured to traverse the linkage directed graph to obtain the target node by: starting from the head node, traversing the linkage directed graph using a depth-first algorithm to obtain an associated node corresponding to the head node, and determining the associated node as the target node.

[0072] Optionally, the processing module is configured to obtain the linkage key value group according to the head node and the target node in the following manner: obtain a key value pair according to the head node and the target node, and store the key value pair in a preset array to obtain the linkage key value group.

[0073] Optionally, the processing module is configured to obtain a key-value pair according to the head node and the target node in the following manner: determining the head node as the key, determining the target node as the value, and constructing a mapping relationship between the key and the value to obtain the key-value pair.

[0074] Optionally, the device information includes device attributes and attribute values. The execution module is configured to trigger the home appliance to run according to the linkage key value group in the following manner: using the device attribute of the key to perform a table lookup operation in a preset device data table to find out the target attribute value corresponding to the device attribute of the key. The device data table stores the correspondence between the device attributes of all home appliances and the target attribute values. Among them, the target attribute value is the attribute value currently running for the home appliance. Determine whether the attribute value of the key is the same as the target attribute value. If the attribute value of the key is the same as the target attribute value, trigger the home appliance to run according to the value.

[0075] Combination Figure 8 As shown, an embodiment of the present application provides an electronic device 800, including a processor (processor) 801 and a memory (memory) 802. Optionally, the device may also include a communication interface (Communication Interface) 803 and a bus 804. Among them, the processor 801, the communication interface 803, and the memory 802 can communicate with each other through the bus 804. The communication interface 803 can be used for information transmission. The processor 801 can call the logic instructions in the memory 802 to execute the method for home appliance control of the above embodiment.

[0076] By using the electronic device provided in the embodiment of the present application, a linkage directed graph is obtained by obtaining a rule expression, all nodes in the linkage directed graph are traversed, each node is grouped according to the trigger relationship, a linkage key value group is obtained, and the home appliances are triggered to run according to the linkage key value group, thereby enabling multiple rule expressions to be triggered at the same time, improving the rule execution efficiency of the smart home system, and optimizing the user experience.

[0077] In addition, the logic instructions in the memory 802 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.

[0078] The memory 802, as a computer-readable storage medium, can be used to store software programs, computer executable programs, such as program instructions / modules corresponding to the methods in the embodiments of the present application.

[0079] The processor 801 executes the functional application and data processing by running the program instructions / modules stored in the memory 802, that is, implements the method for controlling home appliances in the above embodiment.

[0080] The memory 802 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 802 may include a high-speed random access memory and may also include a non-volatile memory.

[0081] An embodiment of the present application provides a computer-readable storage medium, which includes stored program instructions, and the program instructions are executed by a processor to implement the method for controlling home appliances as described above.

[0082] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0083] The technical solution of the embodiment of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above method in the embodiment of the present application. The aforementioned storage medium can be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes, or a transient storage medium.

[0084] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between each embodiment may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0085] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods to implement the described functions for each specific application, but such implementations should not be considered to exceed the scope of the embodiments of the present application. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0086] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present application may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0087] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two continuous boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two continuous operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

[0088] 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 controlling home appliances, characterized in that: The method comprises: Obtaining a rule expression; the rule expression is used to represent a control rule for a device attribute of a home device; Generate a linkage directed graph according to the regular expression; the linkage directed graph includes nodes and directed edges between the nodes; Traversing the linkage directed graph to obtain a linkage key value group; the linkage key value group includes a plurality of key value pairs for representing the trigger relationship between home appliances; The home device is triggered to operate according to the linkage key value group.

2. The method for controlling home appliances according to claim 1, characterized in that: The regular expression includes device information of the home device and a control sequence between the home devices; According to the regular expression, a linkage directed graph is generated, including: The device information of the home appliances is determined as nodes, and the directed edges between the nodes are determined according to the control sequence between the home appliances to generate a linkage directed graph.

3. The method for controlling home appliances according to claim 1, characterized in that: Traverse the linkage directed graph to obtain a linkage key value group, including: Obtaining the head node of the linkage directed graph; Traversing the linkage directed graph to obtain a target node; A linkage key value group is obtained according to the head node and the target node.

4. The method for controlling home appliances according to claim 3, characterized in that: Traversing the linkage directed graph to obtain the target node includes: Taking the head node as the starting point, traverse the linkage directed graph using a depth-first algorithm to obtain associated nodes corresponding to the head node; The associated node is determined as a target node.

5. The method for controlling home appliances according to claim 4, characterized in that: According to the head node and the target node, a linkage key value group is obtained, including: Obtain a key-value pair according to the head node and the target node; The key-value pairs are stored in a preset array to obtain a linkage key-value group.

6. The method for controlling home appliances according to claim 5, characterized in that: Obtaining a key-value pair according to the head node and the target node includes: Determining the head node as a key; determining the target node as a value; Build a mapping relationship between keys and values ​​to obtain key-value pairs.

7. The method for controlling home appliances according to claim 6, characterized in that: Device information includes device attributes and attribute values; Triggering the home device to run according to the linkage key value group includes: Using the device attribute of the key, a table lookup operation is performed in a preset device data table to find out the target attribute value corresponding to the device attribute of the key; the device data table stores the corresponding relationship between the device attributes of all home devices and the target attribute value; wherein the target attribute value is the attribute value currently running on the home device; Determine whether the attribute value of the key is the same as the target attribute value; When the attribute value of the key is the same as the target attribute value, the home appliance is triggered to operate according to the value.

8. A device for controlling household appliances, characterized in that: include: An acquisition module is configured to acquire a rule expression; the rule expression is used to represent a control rule for a device attribute of a home device; A generating module is configured to generate a linkage directed graph according to the regular expression; the linkage directed graph includes nodes and directed edges between the nodes; A processing module is configured to traverse the linkage directed graph to obtain a linkage key value group; the linkage key value group includes a plurality of key value pairs; the key value pairs are used to represent the trigger relationship between the home appliances; The execution module is configured to trigger the home device to run according to the device linkage key value group.

9. 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 for controlling a household device according to any one of claims 1 to 7 through the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes stored program instructions, and the program instructions are executed by a processor to implement the method for controlling home devices according to any one of claims 1 to 7.

Citation Information

Cited By

  • Vehicle linkage control method and device and storage medium

    CN118991420A

  • Smart home equipment control method and device, electronic equipment and storage medium

    CN119247796A

  • Linkage pairing method, device and equipment

    CN119415265A

  • A linkage pairing method, device and equipment

    CN119415265B

  • Multi-device scene linkage control method, system and device for smart classroom

    CN122732335A