Smart home equipment control method and device, electronic equipment and storage medium
By generating directed acyclic maps to reasonably control smart home devices, the problem of not being able to identify the causal relationship between devices in the prior art is solved, and energy efficiency and user experience are improved.
Patent Information
- Application Number
- CN202411493034.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-01-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing smart home systems cannot effectively identify and utilize the complex causal relationships between smart home devices, resulting in low energy efficiency and poor user experience, especially in home environments where there are many devices and frequent changes in the environment.
By generating a completely undirected graph, conditional independence checks and causal relationship determinations are performed, and directed acyclic graphs are generated, so as to reasonably control smart home devices and improve energy efficiency and user experience.
It realizes reasonable control of smart home devices based on the causal relationship between nodes in the directed acyclic graph, improves the living comfort and user experience of the smart home environment, and avoids excessive consumption of resources.
Smart Images

Figure CN119247796A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart home technology, and in particular to a smart home device control method and device, electronic equipment, and storage medium. Background Art
[0002] With the rapid development of smart home technology, the number and types of smart devices in the home continue to increase. These devices include but are not limited to smart lighting, HVAC systems, security monitoring equipment and automatic curtains, etc. They can interact through network connections to improve living comfort and energy efficiency.
[0003] Currently, most smart home systems rely on preset rules and simple feedback control logic to manage smart home devices. These systems can usually only handle direct command responses, such as turning devices on and off according to time or specific conditions.
[0004] However, in a home environment with a large number of devices and frequent environmental changes, the smart home system in the related art is usually unable to effectively identify and utilize the complex causal relationship between smart home devices, which limits the intelligence and energy efficiency of the system in actual operation. For example, the smart home system in the related art cannot accurately identify which smart home devices should be linked to meet the actual needs of users under specific environmental parameters, which will not only lead to energy waste, but also seriously affect the actual experience of users. Summary of the invention
[0005] In view of the above problems, a method and device for controlling a smart home device, an electronic device, and a storage medium are proposed to overcome the above problems or at least partially solve the above problems, including:
[0006] A method for controlling a smart home device, the method comprising:
[0007] Determine device nodes and environment parameter nodes according to smart home device information and environment parameter information in the smart home environment;
[0008] Generate a completely undirected graph according to the device nodes and the environmental parameter nodes;
[0009] Performing conditional independence test processing and causal relationship determination processing on the nodes in the completely undirected graph in sequence to generate a directed acyclic graph;
[0010] The smart home device is controlled according to the directed acyclic graph.
[0011] Optionally, the step of sequentially performing conditional independence test processing and causal relationship determination processing on the nodes in the completely undirected graph to generate a directed acyclic graph includes:
[0012] Performing a mutual information test on the nodes in the completely undirected graph to remove edges in the completely undirected graph that do not satisfy conditional independence;
[0013] The causal relationship determination process is performed on the nodes in the completely undirected graph that has completed the mutual information test to generate the directed acyclic graph.
[0014] Optionally, the performing mutual information test on the nodes in the completely undirected graph includes:
[0015] Determine a first node and a second node among the nodes of a completely undirected graph, wherein the first node is any node among the nodes, and the second node is any node among the nodes except the first node;
[0016] Performing the mutual information test on the first node and the second node to determine whether the first node and the second node are independent of each other;
[0017] If the first node and the second node are independent of each other, it is determined that the edge between the first node and the second node does not satisfy the conditional independence, and the edge between the first node and the second node is removed.
[0018] Optionally, the method further includes:
[0019] If the first node and the second node are not independent of each other, a third node is determined among the nodes of the completely undirected graph, and the mutual information test is performed on the first node and the second node under the condition of the third node to determine whether the first node and the second node are independent of each other under the condition of the third node, wherein the third node is any node among the nodes except the first node and the second node;
[0020] If the first node and the second node are independent of each other under the condition of the third node, it is determined that the edge between the first node and the second node does not satisfy the conditional independence, and the edge between the first node and the second node is removed.
[0021] Optionally, performing the causal relationship determination process on the nodes in the completely undirected graph that completes the mutual information test to generate the directed acyclic graph includes:
[0022] According to preset structure recognition rules and direction propagation rules, the directions of the edges in the completely undirected graph that completes the mutual information test are determined to generate the directed acyclic graph.
[0023] Optionally, controlling the smart home device according to the directed acyclic graph includes:
[0024] Determining a control target, and determining a target control node in the directed acyclic graph according to the control target;
[0025] According to the control target and the target control node, the control logic of the target control node is determined, and according to the control logic, the smart home device corresponding to the target control node is controlled.
[0026] Optionally, generating a completely undirected graph according to the device nodes and the environment parameter nodes includes:
[0027] Edges are added between all of the nodes to generate the completely undirected graph.
[0028] Optionally, the environmental parameters include at least temperature parameters, humidity parameters, light parameters and air quality parameters.
[0029] A smart home device control device, the device comprising:
[0030] A node determination module, used to determine device nodes and environmental parameter nodes according to smart home device information and environmental parameter information in the smart home environment;
[0031] A completely undirected graph generation module, used to generate a completely undirected graph according to the device nodes and the environment parameter nodes;
[0032] A directed acyclic graph generation module, used for sequentially performing conditional independence test processing and causal relationship determination processing on the nodes in the completely undirected graph to generate a directed acyclic graph;
[0033] A device control module is used to control the smart home device according to the directed acyclic graph.
[0034] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the smart home device control method as described above when executed by the processor.
[0035] A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the smart home device control method as described above is implemented.
[0036] A computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements the smart home device control method as described above.
[0037] The embodiments of the present invention have the following advantages:
[0038] The present invention provides a method for controlling smart home devices, which determines device nodes and environmental parameter nodes according to smart home device information and environmental parameter information in a smart home environment; generates a completely undirected graph according to the device nodes and environmental parameter nodes; and sequentially performs conditional independence test processing and causal relationship determination processing on the nodes in the completely undirected graph to generate a directed acyclic graph; and then controls smart home devices according to the directed acyclic graph. The method realizes reasonable control of smart home devices according to the causal relationship between nodes in the directed acyclic graph, improves the living comfort and user experience of the smart home environment, improves the intelligence level of smart home device control, and avoids excessive consumption of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0040] Figure 1 is a flowchart of a method for controlling a smart home device provided by some embodiments of the present invention;
[0041] Figure 2 It is a schematic diagram of the overall execution flow of the present invention provided by some embodiments of the present invention;
[0042] Figure 3 It is a schematic structural diagram of a sterilization and fresh-keeping device based on a sterilization and fresh-keeping device provided in some embodiments of the present invention. DETAILED DESCRIPTION
[0043] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with basically the same functions and effects. This is only for the purpose of clearly describing the technical solutions of the embodiments of the present application, and shall not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.
[0045] In the embodiments of the present application, the terms "upper", "lower", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0046] With the rapid development of smart home technology, the number and types of smart devices in the home continue to increase. These devices include but are not limited to smart lighting, HVAC systems, security monitoring equipment and automatic curtains, etc. They can interact through network connections to improve living comfort and energy efficiency.
[0047] Currently, most smart home systems rely on preset rules and simple feedback control logic to manage smart home devices. These systems can usually only handle direct command responses, such as turning devices on and off according to time or specific conditions.
[0048] However, in a home environment with a large number of devices and frequent environmental changes, the smart home system in the related art is usually unable to effectively identify and utilize the complex causal relationship between smart home devices, which limits the intelligence and energy efficiency of the system in actual operation. For example, the smart home system in the related art cannot accurately identify which smart home devices should be linked to meet the actual needs of users under specific environmental parameters, which will not only lead to energy waste, but also seriously affect the actual experience of users.
[0049] In order to solve the above problems, the present invention improves the smart home device control method in the related art based on the core technical concept of reasonably controlling the smart home devices according to the causal relationship between nodes in the directed acyclic graph. The present invention will be described in detail below with reference to the accompanying drawings:
[0050] Reference Figure 1 , shows a flowchart of a method for controlling a smart home device provided by some embodiments of the present invention, which may specifically include the following steps:
[0051] Step 101, determining a device node and an environment parameter node according to smart home device information and environment parameter information in a smart home environment;
[0052] In a specific implementation, device nodes and environmental parameter nodes can be determined based on the smart home device information and environmental parameter information in the smart home environment for subsequent construction of a completely undirected graph. For example, the device nodes may include: HVAC system: including air conditioning, heating system, and ventilation system. These are among the devices with the highest energy consumption, and their operating mode and status have a significant impact on home energy efficiency. Lighting system: including various indoor and outdoor lighting equipment. Curtains and blinds: automatic or smart curtains and automatic or smart blinds; Environmental parameters may include: temperature parameters, humidity parameters, light parameters, air quality parameters, etc.
[0053] In some embodiments of the present invention, the environmental parameters at least include temperature parameters, humidity parameters, light parameters and air quality parameters.
[0054] In actual applications, the environmental parameters that can be set include at least temperature parameters, humidity parameters, lighting parameters and air quality parameters, so as to identify which smart home devices should be operated in conjunction under specific environmental parameter conditions to meet the actual needs of users and improve the user experience.
[0055] Step 102, generating a completely undirected graph according to the device nodes and the environment parameter nodes;
[0056] In a specific implementation, a completely undirected graph can be generated based on device nodes and environmental parameter nodes. Specifically, it can be initially assumed that there may be mutual influence between all variables (nodes). For example, it is assumed that there is a causal relationship between the air conditioner and all other device nodes and environmental parameters, thereby forming a completely undirected graph.
[0057] In some embodiments of the present invention, generating a completely undirected graph according to the device nodes and the environment parameter nodes includes:
[0058] Edges are added between all of the nodes to generate the completely undirected graph.
[0059] In practical applications, a completely undirected graph can be generated based on device nodes and environmental parameter nodes. Specifically, it can be initially assumed that there may be mutual influence between all variables (nodes). For example, it is assumed that there is a causal relationship between the air conditioner and all other device nodes and environmental parameters. Therefore, edges can be added between all nodes to form a completely undirected graph.
[0060] Step 103, performing conditional independence test processing and causal relationship determination processing on the nodes in the completely undirected graph in sequence to generate a directed acyclic graph;
[0061] In practical applications, the nodes in the completely undirected graph can be subjected to conditional independence test processing and causal relationship determination processing in turn to generate a directed acyclic graph; specifically, for the conditional independence test processing, the nodes in the completely undirected graph can be subjected to conditional independence test through mutual information test, and the edges in the completely undirected graph that do not meet conditional independence can be gradually eliminated. Mutual information is a measure of the mutual dependence between two variables. The larger the mutual information value, the more mutual information there is between the variables and the stronger the dependence. A mutual information of zero means that the two variables are completely independent of each other.
[0062] For example, for each pair of nodes X and Y in a completely undirected graph, we can first test whether nodes X and Y are unconditionally independent (i.e., whether they are completely independent of each other). If nodes X and Y are unconditionally independent (i.e., nodes X and Y are completely independent of each other), we can directly remove the edge between X and Y. If nodes X and Y are not unconditionally independent (i.e., nodes X and Y are not completely independent of each other), we can then test whether nodes X and Y are independent of each other under the condition of other variables Z. If we can find a set of variables that make nodes X and Y unconditionally independent, we can also remove the edge between X and Y.
[0063] The following is a detailed description of the above-mentioned conditional independence test process with examples:
[0064] Specifically, for the process of testing whether nodes X and Y are unconditionally independent (i.e., whether they are completely independent of each other), it can be assumed that there are two nodes in the smart home system: air conditioner (node X) and curtain (node Y). Then, the following steps can be followed to test whether the two nodes are unconditionally independent.
[0065] Step 1: Data preparation:
[0066] First, a large amount of data about the operating status of the air conditioner (node X) and the curtain (node Y) can be collected. Assume that a series of data is recorded every hour on whether the air conditioner is turned on (X=1 for on, X=0 for off) and whether the curtain is closed (Y=1 for closed, Y=0 for open).
[0067] Step 2: Mutual information calculation:
[0068] Mutual Information (MI) is a measure of the degree of dependence between two random variables. The specific steps for calculating the mutual information of air conditioners (node X) and curtains (node Y) are as follows:
[0069] 1. Calculate the edge probability of each node:
[0070] P(X=1) and P(X=0);
[0071] P(Y=1) and P(Y=0);
[0072] For example, suppose the following probabilities are obtained from the data:
[0073] P(X=1)=0.6, P(X=0)=0.4;
[0074] P(Y=1)=0.7, P(Y=0)=0.3;
[0075] 2. Calculate the joint probability distribution:
[0076] P(X=1,Y=1), P(X=1,Y=0);
[0077] P(X=0,Y=1), P(X=0,Y=0);
[0078] Assume that the joint probability in the data is as follows:
[0079] P(X=1,Y=1)=0.4;
[0080] P(X=1,Y=0)=0.2;
[0081] P(X=0,Y=1)=0.3;
[0082] P(X=0,Y=0)=0.1;
[0083] 3. Use the following formula to calculate mutual information:
[0084]
[0085] Among them, MI is the mutual information value, P is the edge probability, X is the air conditioner related data, and Y is the curtain related data. Substituting into the numerical calculation, a specific mutual information value can be obtained. The larger this value is, the stronger the dependence between the air conditioner (node X) and the curtain (node Y). If the mutual information is close to 0, it can be considered that the air conditioner (node X) and the curtain (node Y) are unconditionally independent.
[0086] Step 3: Result confirmation
[0087] If,MI(X,Y) is approximately equal to 0, it means that the states of the air conditioner (node X) and the curtain (node Y) are unconditionally independent, that is, the state of the air conditioner will not directly affect the state of the curtain, and vice versa.
[0088] If MI(X,Y) is much greater than 0, it means that there is a dependency relationship between the air conditioner (node X) and the curtain (node Y), and they are not unconditionally independent.
[0089] Furthermore, if nodes X and Y are not unconditionally independent (i.e., nodes X and Y are not completely independent of each other), then we test whether nodes X and Y are independent of each other under the condition of other variables Z. We can perform the test by following the steps below:
[0090] Step 1: Data preparation
[0091] Assume that there are three nodes in the smart home system: air conditioner (node X), curtain (node Y) and indoor temperature (node Z). Now it has been found through mutual information test that air conditioner and curtain are not unconditionally independent. It is necessary to test whether air conditioner (node X) and curtain (node Y) are independent when considering indoor temperature (node Z). First, a large amount of operating status and environmental data about air conditioner (X), curtain (Y) and indoor temperature (Z) can be collected. Assume that the following data is recorded:
[0092] Whether the air conditioner is turned on (X=1 means on, X=0 means off);
[0093] Whether the curtain is closed (Y=1 means closed, Y=0 means open);
[0094] Whether the indoor temperature exceeds a certain threshold (Z=1 indicates high temperature, Z=0 indicates low temperature);
[0095] Step 2: Conditional independence test:
[0096] 1. Calculate conditional probability:
[0097] Calculate the joint probability distribution under different conditions. For example, calculate P(X=x, Y=y|Z=z), that is, the joint probability distribution of air conditioning and curtains when the indoor temperature Z is a certain state.
[0098] Assume that the conditional probabilities in the data are as follows:
[0099] When Z = 1 (high temperature):
[0100] P(X=1,Y=1|Z=1)=0.5;
[0101] P(X=1,Y=0|Z=1)=0.2;
[0102] P(X=0,Y=1|Z=1)=0.1;
[0103] P(X=0,Y=0|Z=1)=0.2;
[0104] When Z = 0 (low temperature):
[0105] P(X=1, Y=1|Z=0)=0.3;
[0106] P(X=1, Y=0|Z=0)=0.3;
[0107] P(X=0,Y=1|Z=0)=0.2;
[0108] P(X=0,Y=0|Z=0)=0.2;
[0109] 2. Calculate conditional mutual information:
[0110] Conditional mutual information MI(X,Y|Z) is used to measure whether X and Y are independent given Z. The calculation formula is as follows:
[0111]
[0112] Among them, MI is the mutual information value, P is the edge probability, X is the air conditioning related data, Y is the curtain related data, and Z is the indoor temperature related data. Substituting the above data, the mutual information under Z = 1 and Z = 0 can be calculated respectively. Finally, the results under the two conditions are weighted averaged to obtain the final conditional mutual information value.
[0113] Step 3: Result confirmation:
[0114] If MI(X,Y|Z) is approximately equal to 0, it means that the air conditioner (X) and the curtain (Y) are unconditionally independent when the indoor temperature (Z) is given. In other words, when the indoor temperature Z is given, there is no direct dependency between the states of the air conditioner and the curtain.
[0115] If MI(X,Y|Z) is much greater than 0, it means that even when the indoor temperature (Z) is given, there is still a dependency between the air conditioner and the curtains, that is, when the indoor temperature (Z) is given, the air conditioner (X) and the curtains (Y) are not unconditionally independent.
[0116] In some embodiments of the present invention, the step of sequentially performing conditional independence test processing and causal relationship determination processing on the nodes in the completely undirected graph to generate a directed acyclic graph includes:
[0117] Performing a mutual information test on the nodes in the completely undirected graph to remove edges in the completely undirected graph that do not satisfy conditional independence;
[0118] The causal relationship determination process is performed on the nodes in the completely undirected graph that has completed the mutual information test to generate the directed acyclic graph.
[0119] In a specific implementation, the nodes in a completely undirected graph can be subjected to conditional independence test processing and causal relationship determination processing in turn to generate a directed acyclic graph; specifically, for conditional independence test processing, the nodes in the completely undirected graph can be subjected to conditional independence test through mutual information test, and the edges in the completely undirected graph that do not meet conditional independence can be gradually eliminated. Mutual information is a measure of the mutual dependence between two variables. The larger the mutual information value, the more mutual information there is between the variables and the stronger the dependence. A mutual information of zero means that the two variables are completely independent of each other.
[0120] For example, for each pair of nodes X and Y in a completely undirected graph, we can first test whether nodes X and Y are unconditionally independent (i.e., whether they are completely independent of each other). If nodes X and Y are unconditionally independent (i.e., nodes X and Y are completely independent of each other), we can directly remove the edge between X and Y. If nodes X and Y are not unconditionally independent (i.e., nodes X and Y are not completely independent of each other), we can then test whether nodes X and Y are independent of each other under the condition of other variables Z. If we can find a set of variables that make nodes X and Y unconditionally independent, we can also remove the edge between X and Y.
[0121] The following is a detailed description of the above-mentioned conditional independence test process with examples:
[0122] Specifically, for the process of testing whether nodes X and Y are unconditionally independent (i.e., whether they are completely independent of each other), it can be assumed that there are two nodes in the smart home system: air conditioner (node X) and curtain (node Y). Then, the following steps can be followed to test whether the two nodes are unconditionally independent.
[0123] Step 1: Data preparation:
[0124] First, a large amount of data about the operating status of the air conditioner (node X) and the curtain (node Y) can be collected. Assume that a series of data is recorded every hour on whether the air conditioner is turned on (X=1 for on, X=0 for off) and whether the curtain is closed (Y=1 for closed, Y=0 for open).
[0125] Step 2: Mutual information calculation:
[0126] Mutual Information (MI) is a measure of the degree of dependence between two random variables. The specific steps for calculating the mutual information of air conditioners (node X) and curtains (node Y) are as follows:
[0127] 1. Calculate the edge probability of each node:
[0128] P(X=1) and P(X=0);
[0129] P(Y=1) and P(Y=0);
[0130] For example, suppose the following probabilities are obtained from the data:
[0131] P(X=1)=0.6, P(X=0)=0.4;
[0132] P(Y=1)=0.7, P(Y=0)=0.3;
[0133] 2. Calculate the joint probability distribution:
[0134] P(X=1,Y=1), P(X=1,Y=0);
[0135] P(X=0,Y=1), P(X=0,Y=0);
[0136] Assume that the joint probability in the data is as follows:
[0137] P(X=1,Y=1)=0.4;
[0138] P(X=1,Y=0)=0.2;
[0139] P(X=0,Y=1)=0.3;
[0140] P(X=0,Y=0)=0.1;
[0141] 3. Use the following formula to calculate mutual information:
[0142]
[0143] Among them, MI is the mutual information value, P is the edge probability, X is the air conditioner related data, and Y is the curtain related data. Substituting into the numerical calculation, a specific mutual information value can be obtained. The larger this value is, the stronger the dependence between the air conditioner (node X) and the curtain (node Y). If the mutual information is close to 0, it can be considered that the air conditioner (node X) and the curtain (node Y) are unconditionally independent.
[0144] Step 3: Result confirmation
[0145] If,MI(X,Y) is approximately equal to 0, it means that the states of the air conditioner (node X) and the curtain (node Y) are unconditionally independent, that is, the state of the air conditioner will not directly affect the state of the curtain, and vice versa.
[0146] If MI(X,Y) is much greater than 0, it means that there is a dependency relationship between the air conditioner (node X) and the curtain (node Y), and they are not unconditionally independent.
[0147] Furthermore, if nodes X and Y are not unconditionally independent (i.e., nodes X and Y are not completely independent of each other), then we test whether nodes X and Y are independent of each other under the condition of other variables Z. We can perform the test by following the steps below:
[0148] Step 1: Data preparation
[0149] Assume that there are three nodes in the smart home system: air conditioner (node X), curtain (node Y) and indoor temperature (node Z). Now it has been found through mutual information test that air conditioner and curtain are not unconditionally independent. It is necessary to test whether air conditioner (node X) and curtain (node Y) are independent when considering indoor temperature (node Z). First, a large amount of operating status and environmental data about air conditioner (X), curtain (Y) and indoor temperature (Z) can be collected. Assume that the following data is recorded:
[0150] Whether the air conditioner is turned on (X=1 means on, X=0 means off);
[0151] Whether the curtain is closed (Y=1 means closed, Y=0 means open);
[0152] Whether the indoor temperature exceeds a certain threshold (Z=1 indicates high temperature, Z=0 indicates low temperature);
[0153] Step 2: Conditional independence test:
[0154] 1. Calculate conditional probability:
[0155] Calculate the joint probability distribution under different conditions. For example, calculate P(X=x, Y=y|Z=z), that is, the joint probability distribution of air conditioning and curtains when the indoor temperature Z is a certain state.
[0156] Assume that the conditional probabilities in the data are as follows:
[0157] When Z = 1 (high temperature):
[0158] P(X=1,Y=1|Z=1)=0.5;
[0159] P(X=1,Y=0|Z=1)=0.2;
[0160] P(X=0,Y=1|Z=1)=0.1;
[0161] P(X=0,Y=0|Z=1)=0.2;
[0162] When Z = 0 (low temperature):
[0163] P(X=1, Y=1|Z=0)=0.3;
[0164] P(X=1, Y=0|Z=0)=0.3;
[0165] P(X=0,Y=1|Z=0)=0.2;
[0166] P(X=0,Y=0|Z=0)=0.2;
[0167] 2. Calculate conditional mutual information:
[0168] Conditional mutual information MI(X,Y|Z) is used to measure whether X and Y are independent given Z. The calculation formula is as follows:
[0169]
[0170] Among them, MI is the mutual information value, P is the edge probability, X is the air conditioning related data, Y is the curtain related data, and Z is the indoor temperature related data. Substituting the above data, the mutual information under Z = 1 and Z = 0 can be calculated respectively. Finally, the results under the two conditions are weighted averaged to obtain the final conditional mutual information value.
[0171] Step 3: Result confirmation:
[0172] If MI(X,Y|Z) is approximately equal to 0, it means that the air conditioner (X) and the curtain (Y) are unconditionally independent when the indoor temperature (Z) is given. In other words, when the indoor temperature Z is given, there is no direct dependency between the states of the air conditioner and the curtain.
[0173] If MI(X,Y|Z) is much greater than 0, it means that even when the indoor temperature (Z) is given, there is still a dependency between the air conditioner and the curtains, that is, when the indoor temperature (Z) is given, the air conditioner (X) and the curtains (Y) are not unconditionally independent.
[0174] In some embodiments of the present invention, the performing mutual information test on the nodes in the completely undirected graph includes:
[0175] Determine a first node and a second node among the nodes of a completely undirected graph, wherein the first node is any node among the nodes, and the second node is any node among the nodes except the first node;
[0176] Performing the mutual information test on the first node and the second node to determine whether the first node and the second node are independent of each other;
[0177] If the first node and the second node are independent of each other, it is determined that the edge between the first node and the second node does not satisfy the conditional independence, and the edge between the first node and the second node is removed.
[0178] In a specific implementation, for each pair of nodes X and Y in a completely undirected graph, we can first test whether nodes X and Y are unconditionally independent (i.e., whether they are completely independent of each other). If nodes X and Y are unconditionally independent (i.e., nodes X and Y are completely independent of each other), we can directly remove the edge between X and Y. If nodes X and Y are not unconditionally independent (i.e., nodes X and Y are not completely independent of each other), we can then test whether nodes X and Y are independent of each other under the condition of other variables Z. If we can find a set of variables that make nodes X and Y unconditionally independent, we can also remove the edge between X and Y.
[0179] The following is a detailed description of the above-mentioned conditional independence test process with examples:
[0180] Specifically, for the process of testing whether nodes X and Y are unconditionally independent (i.e., whether they are completely independent of each other), it can be assumed that there are two nodes in the smart home system: air conditioner (node X) and curtain (node Y). Then, the following steps can be followed to test whether the two nodes are unconditionally independent.
[0181] Step 1: Data preparation:
[0182] First, a large amount of data about the operating status of the air conditioner (node X) and the curtain (node Y) can be collected. Assume that a series of data is recorded every hour on whether the air conditioner is turned on (X=1 for on, X=0 for off) and whether the curtain is closed (Y=1 for closed, Y=0 for open).
[0183] Step 2: Mutual information calculation:
[0184] Mutual Information (MI) is a measure of the degree of dependence between two random variables. The specific steps for calculating the mutual information of air conditioners (node X) and curtains (node Y) are as follows:
[0185] 1. Calculate the edge probability of each node:
[0186] P(X=1) and P(X=0);
[0187] P(Y=1) and P(Y=0);
[0188] For example, suppose the following probabilities are obtained from the data:
[0189] P(X=1)=0.6, P(X=0)=0.4;
[0190] P(Y=1)=0.7, P(Y=0)=0.3;
[0191] 2. Calculate the joint probability distribution:
[0192] P(X=1,Y=1), P(X=1,Y=0);
[0193] P(X=0,Y=1), P(X=0,Y=0);
[0194] Assume that the joint probability in the data is as follows:
[0195] P(X=1,Y=1)=0.4;
[0196] P(X=1,Y=0)=0.2;
[0197] P(X=0,Y=1)=0.3;
[0198] P(X=0,Y=0)=0.1;
[0199] 3. Use the following formula to calculate mutual information:
[0200]
[0201] Among them, MI is the mutual information value, P is the edge probability, X is the air conditioner related data, and Y is the curtain related data. Substituting into the numerical calculation, a specific mutual information value can be obtained. The larger this value is, the stronger the dependence between the air conditioner (node X) and the curtain (node Y). If the mutual information is close to 0, it can be considered that the air conditioner (node X) and the curtain (node Y) are unconditionally independent.
[0202] Step 3: Result confirmation
[0203] If,MI(X,Y) is approximately equal to 0, it means that the states of the air conditioner (node X) and the curtain (node Y) are unconditionally independent, that is, the state of the air conditioner will not directly affect the state of the curtain, and vice versa. The edge between node X and node Y can be removed.
[0204] If MI(X,Y) is much greater than 0, it means that there is a dependency relationship between the air conditioner (node X) and the curtain (node Y), and they are not unconditionally independent. Further testing is needed to determine whether the edge between node X and node Y needs to be removed.
[0205] In some embodiments of the present invention, the method further comprises:
[0206] If the first node and the second node are not independent of each other, a third node is determined among the nodes of the completely undirected graph, and the mutual information test is performed on the first node and the second node under the condition of the third node to determine whether the first node and the second node are independent of each other under the condition of the third node, wherein the third node is any node among the nodes except the first node and the second node;
[0207] If the first node and the second node are independent of each other under the condition of the third node, it is determined that the edge between the first node and the second node does not satisfy the conditional independence, and the edge between the first node and the second node is removed.
[0208] In a specific implementation, for each pair of nodes X and Y in a completely undirected graph, we can first test whether nodes X and Y are unconditionally independent (i.e., whether they are completely independent of each other). If nodes X and Y are unconditionally independent (i.e., nodes X and Y are completely independent of each other), we can directly remove the edge between X and Y. If nodes X and Y are not unconditionally independent (i.e., nodes X and Y are not completely independent of each other), we can then test whether nodes X and Y are independent of each other under the condition of other variables Z. If we can find a set of variables that make nodes X and Y unconditionally independent, we can also remove the edge between X and Y.
[0209] Specifically, if nodes X and Y are not unconditionally independent (i.e., nodes X and Y are not completely independent of each other), then test whether nodes X and Y are independent of each other under the condition of other variables Z. The test can be performed according to the following steps:
[0210] Step 1: Data preparation
[0211] Assume that there are three nodes in the smart home system: air conditioner (node X), curtain (node Y) and indoor temperature (node Z). Now it has been found through mutual information test that air conditioner and curtain are not unconditionally independent. It is necessary to test whether air conditioner (node X) and curtain (node Y) are independent when considering indoor temperature (node Z). First, a large amount of operating status and environmental data about air conditioner (X), curtain (Y) and indoor temperature (Z) can be collected. Assume that the following data is recorded:
[0212] Whether the air conditioner is turned on (X=1 means on, X=0 means off);
[0213] Whether the curtain is closed (Y=1 means closed, Y=0 means open);
[0214] Whether the indoor temperature exceeds a certain threshold (Z=1 indicates high temperature, Z=0 indicates low temperature);
[0215] Step 2: Conditional independence test:
[0216] 1. Calculate conditional probability:
[0217] Calculate the joint probability distribution under different conditions. For example, calculate P(X=x, Y=y|Z=z), that is, the joint probability distribution of air conditioning and curtains when the indoor temperature Z is a certain state.
[0218] Assume that the conditional probabilities in the data are as follows:
[0219] When Z = 1 (high temperature):
[0220] P(X=1,Y=1|Z=1)=0.5;
[0221] P(X=1,Y=0|Z=1)=0.2;
[0222] P(X=0,Y=1|Z=1)=0.1;
[0223] P(X=0,Y=0|Z=1)=0.2;
[0224] When Z = 0 (low temperature):
[0225] P(X=1, Y=1|Z=0)=0.3;
[0226] P(X=1, Y=0|Z=0)=0.3;
[0227] P(X=0,Y=1|Z=0)=0.2;
[0228] P(X=0,Y=0|Z=0)=0.2;
[0229] 2. Calculate conditional mutual information:
[0230] Conditional mutual information MI(X,Y|Z) is used to measure whether X and Y are independent given Z. The calculation formula is as follows:
[0231]
[0232] Among them, MI is the mutual information value, P is the edge probability, X is the air conditioning related data, Y is the curtain related data, and Z is the indoor temperature related data. Substituting the above data, the mutual information under Z = 1 and Z = 0 can be calculated respectively. Finally, the results under the two conditions are weighted averaged to obtain the final conditional mutual information value.
[0233] Step 3: Result confirmation:
[0234] If MI(X,Y|Z) is approximately equal to 0, it means that the air conditioner (X) and the curtain (Y) are unconditionally independent when the indoor temperature (Z) is given. In other words, when the indoor temperature Z is given, there is no direct dependency between the states of the air conditioner and the curtain.
[0235] If MI(X,Y|Z) is much greater than 0, it means that even when the indoor temperature (Z) is given, there is still a dependency between the air conditioner and the curtains, that is, when the indoor temperature (Z) is given, the air conditioner (X) and the curtains (Y) are not unconditionally independent.
[0236] In some embodiments of the present invention, performing the causal relationship determination process on the nodes in the completely undirected graph that completes the mutual information test to generate the directed acyclic graph includes:
[0237] According to preset structure recognition rules and direction propagation rules, the directions of the edges in the completely undirected graph that completes the mutual information test are determined to generate the directed acyclic graph.
[0238] In a specific implementation, the direction of the edge in the completely undirected graph that completes the mutual information test can be determined according to the preset structure recognition rule and direction propagation rule (i.e., the causal relationship determination process is performed) to generate a directed acyclic graph;
[0239] Specifically, regarding the preset structure recognition rules, since two or more nodes may have a common effect on a certain node in a completely undirected graph, that is, these nodes may form a special structure in which two or more nodes point to the same node. For example, three variables (nodes) in the following form: X→Z←Y (arrows represent the direction of edges) can be considered to form a V-structure. That is, Z is a common effect caused by X and Y, but there is no direct connection between X and Y; specifically, for each triple X, Y, Z, if X and Y are conditionally independent without Z, but are related (that is, not conditionally independent) when Z is given, then X, Z, Y can be considered to form a V-structure.
[0240] The specific identification process of the above V-structure will be described in detail below with examples:
[0241] Suppose there are three variables in a smart home system: X: the outdoor light intensity of the room, Y: the operating status of the air conditioner, and Z: the indoor temperature of the room; in this example, the V-structure can be described as the following causal relationship:
[0242] X→Z: The outdoor light intensity affects the indoor temperature of the room. When the light is strong, the indoor temperature may rise.
[0243] Y→Z: The operating status of the air conditioner also affects the indoor temperature. When the air conditioner is turned on, the indoor temperature drops.
[0244] There is no direct connection between X and Y: that is, there is no direct causal relationship between the outdoor light intensity and the operating status of the air conditioner.
[0245] Specifically, the following are some examples of the above causal relationship:
[0246] 1.X→Z (outdoor light intensity affects indoor temperature):
[0247] When the light outside is strong (X=strong), it may be hotter inside (Z=high temperature).
[0248] When the outdoor light is low (X=low), the indoor temperature may drop (Z=low temperature).
[0249] 2.Y→Z (air conditioning operation status affects indoor temperature):
[0250] When the air conditioning is on (Y=on), the indoor temperature may drop (Z=low temperature).
[0251] When the air conditioning is turned off (Y=off), the indoor temperature may rise (Z=high temperature).
[0252] 3. There is no direct connection between X and Y:
[0253] The outdoor light intensity does not directly affect the on / off state of the air conditioner, and vice versa. The two are independent variables, and they both affect the system through Z (indoor temperature).
[0254] Based on the above, the identification of V-structure can be carried out according to the following steps:
[0255] Step 1. Data collection: Collect a large amount of data about outdoor light intensity, air conditioning operating status and indoor temperature.
[0256] Step 2. Conditional independence test:
[0257] Tests whether X and Y are unconditionally independent without considering Z. If the test shows that X and Y are unconditionally independent, then V-structure is likely present.
[0258] Test whether X and Y are unconditionally independent given Z. If X and Y are no longer unconditionally independent given Z, then a V-structure is confirmed.
[0259] Step 3. Confirm the V-structure:
[0260] According to the data test results, it is confirmed whether there is the following causal relationship: X→Z←Y. This shows that Z (indoor temperature) is jointly affected by X (outdoor light intensity) and Y (air conditioning operation status), while there is no direct connection between X and Y.
[0261] In summary, the V-structure can be clearly expressed as outdoor light intensity and air conditioning operation status acting on the system by affecting indoor temperature respectively. There is no direct causal relationship between outdoor light and air conditioning, but they are related to each other through the common effect Z (indoor temperature).
[0262] Furthermore, after completing the above-mentioned V-structure recognition process (i.e., completing the corresponding processing according to the preset structure recognition rules), the direction of the edges in the completely undirected graph that completes the mutual information test can be further determined according to the direction propagation rule to generate a directed acyclic graph.
[0263] Specifically, the directional propagation rules may include:
[0264] Rule 1: Transitivity Rule
[0265] For example, if A→B and B→C, then A→C.
[0266] Rule 2: Avoid the Ring Rule
[0267] Directed cycles cannot be formed in a directed acyclic graph because causality must be acyclic.
[0268] Rule 3: Avoid forming new V-structure rules
[0269] Arrows should not be added arbitrarily to form new V-structures unless it is necessary to form a new V-structure.
[0270] Furthermore, the following will illustrate the judgment process of whether it is necessary to form a new V-structure with an example:
[0271] Suppose there are three variables in a smart home system: X: the curtain status of the room (closed or open), Y: the light intensity of the room, Z: the light intensity of the room (including the total amount of natural light and light);
[0272] Assume that the following relationships have been identified:
[0273] X→Z: The state of the curtains affects the light intensity in the room. When the curtains are closed, the natural light in the room is reduced, resulting in a decrease in light intensity.
[0274] Y→Z: The light intensity also directly affects the light intensity of the room. The higher the light intensity, the higher the light intensity of the room.
[0275] At this point, a V-structure is shown in the completely undirected graph: X→Z←Y, that is, the curtain state and light intensity are affected by the light intensity, but there is no direct connection between them.
[0276] On this basis, suppose a potential connection is found in the data, which may indicate that there is some correlation between the light intensity Y and the curtain state X. It is necessary to determine whether an arrow from Y to X should be added to form a new causal relationship Y→X, which may generate a new V-structure. The judgment process on whether to form a new V-structure may include:
[0277] 1. Analyze data and domain knowledge:
[0278] If data analysis shows that Y (light intensity) does have a significant impact on X (curtain status), for example, there is an intelligent control system that automatically closes the curtains when the light in the room is too strong (whether it is natural light or lighting). Then, combined with the knowledge in the field of smart homes, confirm whether this association is reasonable. For example, if there is an automated system that adjusts the curtains according to the light intensity, then adding this causal edge is reasonable and necessary.
[0279] 2. Determine the necessity of a new V-structure:
[0280] If the direct connection between X and Y has important control significance in practical applications, such as the function of automatically adjusting curtains according to light intensity in intelligent control systems, it is considered necessary to add this causal edge Y→X. At this time, it is reasonable to form a new V-structure Y→Z←X because it reflects the real operating logic and causal relationship of the system.
[0281] Non-essential: If the association in the data is merely accidental or has no practical application significance in the system (for example, changes in light intensity and curtain state are completely independently controlled), then adding this edge may increase the complexity of the causal graph without any practical benefit. At this time, arrows should not be added arbitrarily to form a new V-structure.
[0282] In the above example, the necessity of forming a new V-structure depends on whether there is an actual causal relationship and the importance of this relationship in the smart home system. If the relationship Y→X does exist and is of great significance in practical applications, then it can be determined that it is necessary to form a new V-structure. If this relationship has no practical significance or is just an accidental phenomenon in the data, then the V-structure should be avoided to avoid useless complexity.
[0283] Through this specific judgment process, it can be ensured that new V-structures are formed only when necessary, avoiding unnecessary complexity and maintaining the accuracy and simplicity of cause-effect relationships in the directed acyclic graph.
[0284] Step 104: Control the smart home device according to the directed acyclic graph.
[0285] In a specific implementation, after a directed acyclic graph (DAG) describing the causal relationship between variables is generated, the directed acyclic graph can be used to design and execute control strategies in a smart home system.
[0286] Specifically, you can control smart home devices by following the steps below:
[0287] Step 1: parse the DAG structure:
[0288] First, the DAG structure is analyzed in detail to determine which variables are control variables (smart home devices that can be directly operated), which are output variables (environmental parameters or device states that need to be adjusted), and the causal relationship between them. This helps to understand which devices or behaviors affect specific system states.
[0289] Step 2: Set control objectives:
[0290] Depending on the actual needs of the user, these may include: improving energy efficiency (e.g., reducing energy consumption), enhancing comfort (e.g., maintaining ideal room temperature and light levels), and ensuring safety (e.g., automatically adjusting the sensitivity of security systems).
[0291] Step 3: Identify intervention points:
[0292] Based on the DAG, identify the key intervention points that can be manipulated. These intervention points are key control variables that affect the output variables. For example, if the DAG shows that the indoor light intensity directly affects the indoor temperature, and the curtain state can adjust the light intensity, then the opening and closing of the curtain becomes a key intervention point.
[0293] Step 4: Set the control logic:
[0294] Design specific control logic for each key intervention point, which may include:
[0295] Trigger conditions: Define when intervention is required, such as automatically closing curtains when room light exceeds a certain threshold.
[0296] Control actions: Determine specific operational details, such as the degree to which the curtains are closed, the temperature range of the air conditioner, etc.
[0297] Feedback mechanism: monitor the actual effects of control actions and make adaptive adjustments based on actual feedback.
[0298] In some embodiments of the present invention, controlling the smart home device according to the directed acyclic graph includes:
[0299] Determining a control target, and determining a target control node in the directed acyclic graph according to the control target;
[0300] According to the control target and the target control node, the control logic of the target control node is determined, and according to the control logic, the smart home device corresponding to the target control node is controlled.
[0301] In actual application, you can control smart home devices by following the steps below:
[0302] Step 1: parse the DAG structure:
[0303] First, the DAG structure is analyzed in detail to determine which variables are control variables (control nodes) (smart home devices that can be directly operated), which are output variables (environmental parameters or device states that need to be adjusted), and the causal relationship between them. This helps to understand which devices or behaviors affect specific system states.
[0304] Step 2: Set control objectives:
[0305] Depending on the actual needs of the user, these may include: improving energy efficiency (e.g., reducing energy consumption), enhancing comfort (e.g., maintaining ideal room temperature and light levels), and ensuring safety (e.g., automatically adjusting the sensitivity of security systems).
[0306] Step 3: Identify intervention points:
[0307] Based on the DAG, identify the key intervention points (i.e., target control nodes) that can be operated. These intervention points are the key control variables that affect the output variables. For example, if the DAG shows that the indoor light intensity directly affects the indoor temperature, and the curtain state can adjust the light intensity, then the opening and closing of the curtain becomes a key intervention point.
[0308] Step 4: Set the control logic:
[0309] Design specific control logic for each key intervention point, which may include:
[0310] Trigger conditions: Define when intervention is required, such as automatically closing curtains when room light exceeds a certain threshold.
[0311] Control actions: Determine specific operational details, such as the degree to which the curtains are closed, the temperature range of the air conditioner, etc.
[0312] Feedback mechanism: monitor the actual effects of control actions and make adaptive adjustments based on actual feedback.
[0313] The following will be combined Figure 2 The embodiments of the present invention are further described as follows:
[0314] Reference Figure 2 ,The overall execution process of the smart home device control method provided by the present invention can be summarized into the following two processes of causal relationship discovery and device collaborative control;
[0315] Specifically, the causal relationship discovery process can include the following steps: step one, constructing a completely undirected graph, step two, conditional independence test, step three, determining the direction of the edge and the causal relationship, and step four, making a comprehensive judgment on the causal relationship based on domain knowledge.
[0316] Furthermore, the device collaborative control process may include the following steps: step 1, parsing the DAG structure, step 2, setting the control target, step 3, identifying the intervention point, and step 4, setting the control logic. The exemplary descriptions of the above steps have been described in the above content, so they will not be repeated here.
[0317] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0318] Reference Figure 3 , shows a schematic diagram of the structure of a smart home device control device provided by some embodiments of the present invention; specifically, it may include the following modules:
[0319] The node determination module 301 is used to determine the device node and the environmental parameter node according to the smart home device information and the environmental parameter information in the smart home environment;
[0320] A completely undirected graph generation module 302, used to generate a completely undirected graph according to the device nodes and the environment parameter nodes;
[0321] A directed acyclic graph generation module 303, used to perform conditional independence test processing and causal relationship determination processing on the nodes in the completely undirected graph in sequence to generate a directed acyclic graph;
[0322] The device control module 304 is used to control the smart home device according to the directed acyclic graph.
[0323] In some embodiments of the present invention, the directed acyclic graph generation module 303 includes:
[0324] A mutual information test submodule, used for performing a mutual information test on the nodes in the completely undirected graph to remove edges in the completely undirected graph that do not satisfy conditional independence;
[0325] The directed acyclic graph generation submodule is used to perform the causal relationship determination processing on the nodes in the completely undirected graph that completes the mutual information test to generate the directed acyclic graph.
[0326] In some embodiments of the present invention, the mutual information test submodule includes:
[0327] A first node and a second node determining unit, configured to determine a first node and a second node in the nodes of the completely undirected graph, wherein the first node is any node among the nodes, and the second node is any node among the nodes except the first node;
[0328] a mutual independence determination unit, configured to perform the mutual information test on the first node and the second node to determine whether the first node and the second node are independent of each other;
[0329] The first edge removal unit is used to determine that the edge between the first node and the second node does not meet the conditional independence if the first node and the second node are independent of each other, and remove the edge between the first node and the second node.
[0330] In some embodiments of the present invention, the mutual information test submodule further includes:
[0331] A third node determination unit, if the first node and the second node are not independent of each other, determines a third node in the nodes of the completely undirected graph, and performs the mutual information test on the first node and the second node under the condition of the third node to determine whether the first node and the second node are independent of each other under the condition of the third node, wherein the third node is any node among the nodes except the first node and the second node;
[0332] The second edge removal unit is used to determine that the edge between the first node and the second node does not meet the conditional independence if the first node and the second node are independent of each other under the condition of the third node, and remove the edge between the first node and the second node.
[0333] In some embodiments of the present invention, the directed acyclic graph generation submodule includes:
[0334] A directed acyclic graph generation unit is used to determine the direction of the edge in the completely undirected graph that completes the mutual information test according to a preset structure recognition rule and a direction propagation rule, so as to generate the directed acyclic graph.
[0335] In some embodiments of the present invention, the device control module 304 includes:
[0336] A target control node determination submodule, used to determine a control target, and determine a target control node in the directed acyclic graph according to the control target;
[0337] The device control submodule is used to determine the control logic of the target control node according to the control target and the target control node, and control the smart home device corresponding to the target control node according to the control logic.
[0338] In some embodiments of the present invention, the completely undirected graph generation module 302 includes:
[0339] The completely undirected graph generation submodule is used to add edges between all the nodes to generate the completely undirected graph.
[0340] Some embodiments of the present invention further provide an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when the computer program is executed by the processor, the above-mentioned smart home device control method is implemented.
[0341] Some embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned smart home device control method is implemented.
[0342] Some embodiments of the present invention further provide a computer program product, including a computer program, which implements the above smart home device control method when executed by a processor.
[0343] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0344] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0345] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0346] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0347] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0348] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0349] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0350] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the above elements.
[0351] The above provides a detailed introduction to a smart home device control method and device, an electronic device, and a storage medium. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A smart home device control method, characterized in that: The method comprises: Determine device nodes and environment parameter nodes according to smart home device information and environment parameter information in the smart home environment; Generate a completely undirected graph according to the device nodes and the environmental parameter nodes; Performing conditional independence test processing and causal relationship determination processing on the nodes in the completely undirected graph in sequence to generate a directed acyclic graph; The smart home device is controlled according to the directed acyclic graph.
2. The method according to claim 1, characterized in that The step of sequentially performing conditional independence test processing and causal relationship determination processing on the nodes in the completely undirected graph to generate a directed acyclic graph includes: Performing a mutual information test on the nodes in the completely undirected graph to remove edges in the completely undirected graph that do not satisfy conditional independence; The causal relationship determination process is performed on the nodes in the completely undirected graph that has completed the mutual information test to generate the directed acyclic graph.
3. The method according to claim 2, characterized in that The performing mutual information test on the nodes in the completely undirected graph comprises: Determine a first node and a second node among the nodes of a completely undirected graph, wherein the first node is any node among the nodes, and the second node is any node among the nodes except the first node; Performing the mutual information test on the first node and the second node to determine whether the first node and the second node are independent of each other; If the first node and the second node are independent of each other, it is determined that the edge between the first node and the second node does not satisfy the conditional independence, and the edge between the first node and the second node is removed.
4. The method according to claim 3, characterized in that The method further comprises: If the first node and the second node are not independent of each other, a third node is determined among the nodes of the completely undirected graph, and the mutual information test is performed on the first node and the second node under the condition of the third node to determine whether the first node and the second node are independent of each other under the condition of the third node, wherein the third node is any node among the nodes except the first node and the second node; If the first node and the second node are independent of each other under the condition of the third node, it is determined that the edge between the first node and the second node does not satisfy the conditional independence, and the edge between the first node and the second node is removed.
5. The method according to claim 2, characterized in that: The step of performing the causal relationship determination process on the nodes in the completely undirected graph that has completed the mutual information test to generate the directed acyclic graph includes: According to preset structure recognition rules and direction propagation rules, the directions of the edges in the completely undirected graph that completes the mutual information test are determined to generate the directed acyclic graph.
6. The method according to claim 1, characterized in that The controlling the smart home device according to the directed acyclic graph includes: Determining a control target, and determining a target control node in the directed acyclic graph according to the control target; According to the control target and the target control node, the control logic of the target control node is determined, and according to the control logic, the smart home device corresponding to the target control node is controlled.
7. The method according to claim 1, characterized in that The generating a completely undirected graph according to the device nodes and the environment parameter nodes includes: Edges are added between all of the nodes to generate the completely undirected graph.
8. The method according to claim 1, characterized in that The environmental parameters include at least temperature parameters, humidity parameters, light parameters and air quality parameters.
9. A smart home equipment control device, characterized in that: The device comprises: A node determination module, used to determine device nodes and environmental parameter nodes according to smart home device information and environmental parameter information in the smart home environment; A completely undirected graph generation module, used to generate a completely undirected graph according to the device nodes and the environment parameter nodes; A directed acyclic graph generation module, used for sequentially performing conditional independence test processing and causal relationship determination processing on the nodes in the completely undirected graph to generate a directed acyclic graph; A device control module is used to control the smart home device according to the directed acyclic graph.
10. An electronic device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the smart home device control method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the smart home device control method according to any one of claims 1 to 8 is implemented.
12. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the smart home device control method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Equipment control method and device, storage medium and electronic device
CN116110374A
Smart home equipment control method and device, electronic device and storage medium
CN116165907A
Ground disaster space causal relationship inference method
CN118536597A
Household equipment control method and device, electronic equipment and storage medium
CN118759872A
Cited By
Multi-device cooperative control method and system based on virtual-real fusion of intelligent Internet of Things and element universe
CN120103769A
