Smart home control method and device, electronic equipment and medium

By constructing a smart home knowledge graph and integrating device, environmental, and user interaction data, personalized device control solutions are generated, solving the problem of the single control mode in smart home control methods and improving personalization and accuracy.

CN121763792APending Publication Date: 2026-03-31GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing smart home control methods have limited control modes and are unable to meet users' personalized needs.

Method used

By constructing a smart home knowledge graph, integrating device data, environmental data, and behavioral relationship data, acquiring user interaction data, performing reasoning and feedback updates, and generating personalized device control solutions.

Benefits of technology

It achieves personalized adaptability and accuracy in smart home control methods, and can dynamically adjust and optimize device control schemes according to user preferences, thereby improving the accuracy and reliability of control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121763792A_ABST
    Figure CN121763792A_ABST
Patent Text Reader

Abstract

The invention discloses a smart home control method and device, electronic equipment and a medium, and belongs to the technical field of smart home. The method comprises the following steps: acquiring equipment data, environment data and behavior relationship data of the smart home; according to the equipment data, the environment data and the behavior relation data, constructing a smart home knowledge graph, so that the equipment data and the environment data are used as nodes, the behavior relation data are used as edges, and the edges are used for connecting the two nodes which influence each other; obtaining interaction data of a user to the smart home, and updating nodes and edges in the smart home knowledge graph based on the interaction data; reasoning based on the updated smart home knowledge graph to generate an equipment control scheme; and executing the equipment control scheme, and updating the smart home knowledge graph based on the feedback data after the equipment control scheme is executed. Therefore, the problem that in the prior art, a smart home control method is single in control mode and is difficult to meet individual requirements of users is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of smart home technology, specifically relating to a smart home control method, device, electronic device, and medium. Background Technology

[0002] With the increasing variety of home electronic devices, smart homes are becoming more and more popular. Most smart homes have network connectivity, allowing users to remotely control them to operate in a certain mode.

[0003] While current smart home systems have certain automatic control functions, they mostly remain at the level of controlling a single scene or a single device, resulting in limited control scenarios and difficulty in meeting users' personalized needs. Summary of the Invention

[0004] The purpose of this invention is to provide a smart home control method, device, electronic device, and medium that can solve the problem that existing smart home control methods have a single control mode and are difficult to meet users' personalized needs.

[0005] To solve the above-mentioned technical problems, the present invention is implemented as follows: In a first aspect, embodiments of the present invention provide a smart home control method, the method comprising: Acquire device data, environmental data, and behavioral relationship data of the smart home, wherein the behavioral relationship data is used to characterize the influence relationship between the smart home and the environment; A smart home knowledge graph is constructed based on the device data, the environmental data, and the behavioral relationship data, with the device data and the environmental data serving as nodes and the behavioral relationship data serving as edges, and the edges being used to connect two mutually influencing nodes. Acquire user interaction data with the smart home, and update the nodes and edges in the smart home knowledge graph based on the interaction data; Based on the updated smart home knowledge graph, reasoning is performed to generate device control schemes; The device control scheme is executed, and the smart home knowledge graph is updated based on the feedback data after the device control scheme is executed.

[0006] Optionally, the step of constructing a smart home knowledge graph based on device data, environmental data, and behavioral relationship data includes: The device data is mapped to multiple device nodes; Map the environmental data to environmental nodes; Based on behavioral relationship data, determine the association relationships between each of the device nodes and between the device nodes and the environment nodes; Edges are established between the device nodes that have an association relationship and between the device node and the environment node. The edges also include weight values ​​that characterize the association strength between the device nodes and between the device node and the environment node.

[0007] Optionally, the step of acquiring user interaction data with the smart home and updating the nodes and edges in the smart home knowledge graph based on the interaction data includes: Acquire user interaction data with the smart home system, and determine the target node and target edge corresponding to the interaction data; Update the target node, as well as the nodes and edges adjacent to the target node; Update the target edge, as well as the nodes and edges adjacent to the target edge.

[0008] Optionally, the step of generating a device control scheme based on the updated smart home knowledge graph includes: Based on the updated smart home knowledge graph, a rule-based reasoning process is executed to generate the first control command; Based on the updated smart home knowledge graph, a graph neural network inference process is executed to generate a second control command; The first control command and the second control command are subjected to consistency verification, and the device control scheme is determined based on the consistency verification result.

[0009] Optionally, the step of generating a first control command based on the updated smart home knowledge graph by executing a rule-based reasoning process includes: Obtain the logical rule base of the rule reasoning process, the logical rule base including preset device data, preset environment data and corresponding preset action data; The smart home knowledge graph is matched according to the logical rule base. When the preset device data, the preset environment data and the node and the edge are consistent, the preset action data corresponding to the preset device data and the preset environment data is output. The first control command is output based on the corresponding preset action data.

[0010] Optionally, the step of generating a second control command based on the updated smart home knowledge graph by executing a graph neural network inference process includes: Obtain the graph neural network model; The node attributes in the smart home knowledge graph are converted into node feature vectors, and the edge types and weight values ​​are converted into relation feature vectors. The node feature vector and the relationship feature vector are input into the graph neural network model, the node feature vector and the relationship feature vector are calculated, and the optimal prediction action is output. The second control command is output based on the optimal predicted action.

[0011] Optionally, the step of performing a consistency check on the first control command and the second control command, and determining the device control scheme based on the consistency check result, includes: Obtain the weight values ​​of the edges corresponding to the first control command and the second control command, as well as the target energy strategy. The target energy strategy is used to calculate the energy consumption change data of the smart home. When the first control command and the second control command are inconsistent, the combined score of the first control command and the second control command is determined based on the weight value of the edge and the target energy strategy. Based on the comprehensive score, either the first control command or the second control command is selected as the device control scheme.

[0012] Alternatively, smart home control methods may also include: Obtain the constraints of the device control scheme; the constraints include device safety operation constraints, circuit load constraints, and user-defined blacklist / whitelist constraints; When the device control scheme violates the constraints, the device control scheme shall be adjusted.

[0013] Optionally, executing the device control scheme includes: The device control scheme is parsed into an ordered sequence of actions, which includes multiple action execution information. Each action execution information includes a target device identifier, action type, target parameter value, and expected execution time. According to the order and timing of the action sequence, the action execution information is sent to the corresponding smart home device.

[0014] Secondly, embodiments of the present invention provide a smart home control device, comprising: The data acquisition module is used to acquire device data, environmental data, and behavioral relationship data of the smart home, wherein the behavioral relationship data is used to characterize the influence relationship between the smart home and the environment. The knowledge graph module is used to construct a smart home knowledge graph based on the device data, the environmental data, and the behavioral relationship data, so that the device data and the environmental data are used as nodes, the behavioral relationship data are used as edges, and the edges are used to connect two mutually influential nodes. An interaction data update module is used to acquire user interaction data with the smart home and update the nodes and edges in the smart home knowledge graph based on the interaction data. The reasoning module is used to perform reasoning based on the updated smart home knowledge graph to generate device control schemes. An execution module is used to execute the device control scheme and update the smart home knowledge graph based on feedback data after executing the device control scheme.

[0015] Optionally, the knowledge graph module includes: The device mapping submodule is used to map the device data into multiple device nodes; The environment mapping submodule maps the environment data into environment nodes; The association relationship determination submodule is used to determine the association relationships between each of the device nodes and between the device nodes and the environment nodes based on the behavioral relationship data; An edge establishment submodule is used to establish edges between the device nodes that have an association relationship and between the device node and the environment node. The edges also include weight values ​​that characterize the association strength between the device nodes and between the device node and the environment node.

[0016] Optionally, the interactive data update module includes: The interaction data acquisition submodule is used to acquire user interaction data with the smart home and determine the target node and target edge corresponding to the interaction data. The first update submodule is used to update the target node, as well as the nodes and edges adjacent to the target node; The second update submodule is used to update the target edge and the nodes and edges adjacent to the target edge.

[0017] Optionally, the inference module includes: The rule reasoning submodule is used to execute a rule reasoning process based on the updated smart home knowledge graph to generate a first control command. The graph neural network inference submodule is used to execute a graph neural network inference process based on the updated smart home knowledge graph to generate a second control command. The verification submodule is used to perform consistency verification on the first control command and the second control command, and determine the device control scheme based on the consistency verification result.

[0018] Optionally, the rule reasoning submodule includes: The logic rule base unit is used to obtain the logic rule base of the rule reasoning process. The logic rule base includes preset device data, preset environment data and corresponding preset action data. The matching unit is used to match the smart home knowledge graph according to the logical rule base. When the preset device data, the preset environment data and the node and the edge are consistent, the preset action data corresponding to the preset device data and the preset environment data is output. The first instruction output unit is used to output a first control instruction based on the corresponding preset action data.

[0019] Optionally, the graph neural network inference submodule includes: The model acquisition unit is used to acquire the graph neural network model. The conversion unit is used to convert the node attributes in the smart home knowledge graph into node feature vectors, and to convert the edge type and weight value into relation feature vectors. The computing unit is used to input the node feature vector and the relationship feature vector into the graph neural network model, calculate the node feature vector and the relationship feature vector, and output the optimal prediction action; The second instruction output unit is used to output a second control instruction based on the optimal predicted action.

[0020] Optionally, the verification submodule includes: The weight and strategy acquisition unit is used to acquire the weight values ​​of the edges corresponding to the first control command and the second control command, as well as the target energy strategy, wherein the target energy strategy is used to calculate the energy consumption change data of the smart home. The comprehensive score calculation unit is used to determine the comprehensive score of the first control command and the second control command based on the weight value of the edge and the target energy strategy when the first control command and the second control command are inconsistent. The judgment unit is used to select either the first control instruction or the second control instruction as the device control scheme based on the comprehensive score.

[0021] Optionally, the smart home control device also includes: The constraint acquisition module is used to acquire the constraints of the device control scheme; the constraints include device safe operation constraints, circuit load constraints, and user-defined blacklist / whitelist constraints. An adjustment module is used to adjust the equipment control scheme when the equipment control scheme violates the constraints.

[0022] Optionally, the execution module includes: The parsing submodule is used to parse the device control scheme into an ordered sequence of actions. The sequence of actions includes multiple action execution information, each of which contains a target device identifier, action type, target parameter value, and expected execution time. The instruction sending submodule is used to send the action execution information to the corresponding smart home device according to the order and timing of the action sequence.

[0023] Thirdly, embodiments of the present invention provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0024] Fourthly, embodiments of the present invention provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0025] In this embodiment of the invention, the smart home control method integrates multi-source information by acquiring device data, environmental data, and behavioral relationship data of the smart home, providing a data foundation for the subsequent construction of a smart home knowledge graph. Behavioral relationship data characterizes the influence relationship between device data and environmental data of the smart home, thereby representing the effects of interactions between smart home devices and laying the foundation for subsequent collaborative control. Based on the above data, a smart home knowledge graph is constructed, with device data and environmental data as nodes and behavioral relationship data as edges, connecting two mutually influencing nodes to represent the complex relationships between the smart home and the environment. By acquiring user interaction data with the smart home, the smart home control method can adapt to users' personalized preferences and dynamically update the smart home graph to meet users' personalized needs. Through the structured information of the smart home knowledge graph, device status, environmental conditions, and users' personalized operations can be comprehensively considered to generate more reasonable device control schemes. The smart home knowledge graph is updated based on feedback data after executing the device control scheme, ensuring that the smart home control method can continuously learn and adjust from the execution results, thereby optimizing future device control schemes and improving the accuracy and reliability of the smart home control method in this invention.

[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0027] Figure 1 This is a flowchart of a smart home control method according to an embodiment of the present invention; Figure 2This is a flowchart of a smart home control method according to another embodiment of the present invention; Figure 3 This is a structural block diagram of a smart home control device according to an embodiment of the present invention. Detailed Implementation

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0030] With the increasing variety of home electronic devices, smart homes are becoming more and more popular. Most smart homes have network connectivity, allowing users to remotely control them to operate in a certain mode.

[0031] While current smart home systems have certain automatic control functions, they mostly remain at the level of controlling a single scene or a single device, resulting in limited control scenarios and difficulty in meeting users' personalized needs.

[0032] Therefore, one of the core concepts of this invention is to construct a smart home knowledge graph to aggregate smart home device data, environmental data, behavioral relationship data, and interaction data, integrating discrete data into an identifiable and computable network, thereby achieving an intelligent device control solution while meeting users' personalized needs.

[0033] This invention provides a smart home control method, device, electronic device, and medium, which can solve the problem that existing smart home control methods have a single control mode and are difficult to meet users' personalized needs.

[0034] The smart home control method provided by the present invention will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0035] Figure 1 This is a flowchart of a smart home control method according to an embodiment of the present invention, such as... Figure 1As shown, this smart home control method is applicable to electronic devices. Figure 1 The illustrated embodiment includes at least the following steps 101-104.

[0036] In step 101, device data, environmental data, and behavioral relationship data of the smart home are acquired. The behavioral relationship data is used to characterize the influence relationship between the smart home and the environment.

[0037] Specifically, the device data includes relevant data from multiple smart home devices, such as air conditioners, lighting fixtures, and water heaters. This application is not limited to these. Specific data content includes rated power, dynamic energy consumption curves, operating modes, adjustment ranges, and energy efficiency factors. Taking an air conditioner as an example, its relevant data includes technical parameters such as cooling power curves, target temperature ranges, fan speed settings, and operating energy consumption models. Taking lighting fixtures as an example, its relevant data includes technical parameters such as luminous efficacy functions, dimming ranges, and switching response delays.

[0038] In this embodiment of the invention, environmental data includes environmental factors related to energy consumption and economy and their changing trends, including: room temperature, humidity, light intensity, outdoor wind speed, dynamic electricity price, etc. This application is not limited here. Taking room temperature as an example, the relevant data on the changing trend of room temperature include: real-time temperature value, temperature rise or fall rate, controlled space volume, etc.

[0039] Behavioral relationship data is used to encompass the logic of dependencies, constraints, and extended effects between devices. In some embodiments, the sources of behavioral relationship data include device operation logs, physical coupling models, and user behavior pattern information. Specifically, device operation logs can be used to mine co-occurrence relationships between smart home devices, thereby determining their interdependencies; physical coupling models can reflect physical interference or mutual exclusion phenomena among smart home devices, such as water heaters and dryers operating simultaneously, resulting in high energy consumption loads; air conditioning cooling and underfloor heating heating, leading to temperature control conflicts; and fresh air systems and air conditioners operating simultaneously, affecting the operation of the air conditioner; user behavior patterns are used to statistically analyze long-term user operation processes, such as a user entering the living room and turning on the lights and then the air conditioner, and a user leaving and turning off the air conditioner and lights. User behavior pattern information is used to statistically analyze the frequency of users performing one action before performing another.

[0040] In this embodiment of the invention, by simultaneously acquiring device data, environmental data, and behavioral relationship data that characterizes the influence relationship between devices and the environment, a comprehensive and interconnected data foundation is established for subsequent steps. This enables the smart home control method to acquire information on the status of smart home devices beyond a single scenario, and to understand the mutual influence between smart home devices and between the operation of smart home devices and the surrounding environment.

[0041] In step 102, a smart home knowledge graph is constructed based on the device data, the environmental data, and the behavior relationship data, such that the device data and the environmental data serve as nodes, the behavior relationship data serves as edges, and the edges are used to connect two nodes that influence each other.

[0042] A smart home knowledge graph is constructed based on device data, environmental data, and behavior relationship data. The device data and environmental data are abstracted as nodes, and their influence relationship, i.e., the behavior relationship data, is abstracted as connection edges, achieving a highly structured and semantic modeling of the complex smart home environment. The construction of the smart home knowledge graph integrates discrete device data, environmental data, and behavior relationship data into a data network, making the potential linkage relationships between smart homes and the dependence relationships of smart homes on environmental conditions visible and computable, thus laying an input foundation for subsequent reasoning.

[0043] In step 103, interaction data of the user with the smart home is obtained, and based on the interaction data, the nodes and edges in the smart home knowledge graph are updated.

[0044] By obtaining user interaction data and updating the nodes and edges in the smart home knowledge graph with it, the direct control or preference settings of the user for the smart home are realized as adjustments to the content and structure of the smart home graph. This enables the smart home knowledge graph to continuously evolve according to the user's interaction data to reflect and learn the user's personalized usage habits and scenarios.

[0045] In step 104, reasoning is performed based on the updated smart home knowledge graph to generate a device control scheme.

[0046] Reasoning is performed based on the updated smart home knowledge graph to generate a device control scheme. By utilizing the rich semantic relationships and real-time status contained in the smart home knowledge graph for logical reasoning or calculation, the reasoning process can comprehensively consider the association constraints between smart homes, the real-time status of the environment, and the user's historical preferences, thereby generating a device control scheme that coordinates multiple smart homes, adapts to the current environment, and conforms to the user's habits. Thus, it realizes scenario-based and personalized linkage control based on user selection.

[0047] In step 105, the device control scheme is executed, and based on the feedback data after executing the device control scheme, the smart home knowledge graph is updated.

[0048] By executing the control scheme and updating the knowledge graph using feedback data, a complete closed-loop control operation is formed. The feedback data reflects the actual effect of the device control scheme. Using it to update the smart home knowledge graph can verify the accuracy of reasoning through the smart home knowledge graph. Based on the actual results, the smart home knowledge graph can be strengthened or corrected (such as adjusting the weight of relation edges). This enables the smart home control method of the present invention to have the ability to continuously self-optimize, improving the control accuracy and user satisfaction in long-term operation.

[0049] In this embodiment of the invention, the smart home control method integrates multi-source information by acquiring device data, environmental data, and behavioral relationship data of the smart home, providing a data foundation for the subsequent construction of a smart home knowledge graph. Behavioral relationship data characterizes the influence relationship between device data and environmental data of the smart home, thereby representing the effects of interactions between smart home devices and laying the foundation for subsequent collaborative control. Based on the above data, a smart home knowledge graph is constructed, with device data and environmental data as nodes and behavioral relationship data as edges, connecting two mutually influencing nodes to represent the complex relationships between the smart home and the environment. By acquiring user interaction data with the smart home, the smart home control method can adapt to users' personalized preferences and dynamically update the smart home graph to meet users' personalized needs. Through the structured information of the smart home knowledge graph, device status, environmental conditions, and users' personalized operations can be comprehensively considered to generate more reasonable device control schemes. The smart home knowledge graph is updated based on feedback data after executing the device control scheme, ensuring that the smart home control method can continuously learn and adjust from the execution results, thereby optimizing future device control schemes and improving the accuracy and reliability of the smart home control method in this invention.

[0050] Figure 2 This is a flowchart of a smart home control method according to another embodiment of the present invention, such as... Figure 2 As shown, this smart home control method is applicable to electronic devices. Figure 2 The illustrated embodiment includes at least the following steps 201-209.

[0051] In step 201, device data, environmental data, and behavioral relationship data of the smart home are acquired. The behavioral relationship data is used to characterize the influence relationship between the smart home and the environment.

[0052] In this embodiment of the invention, by simultaneously acquiring device data, environmental data, and behavioral relationship data that characterizes the influence relationship between devices and the environment, a comprehensive and interconnected data foundation is established for subsequent steps. This enables the smart home control method to acquire information on the status of smart home devices beyond a single scenario, and to understand the mutual influence between smart home devices and between the operation of smart home devices and the surrounding environment.

[0053] In step 202, a smart home knowledge graph is constructed based on the device data, the environmental data, and the behavioral relationship data, with the device data and the environmental data serving as nodes and the behavioral relationship data serving as edges, and the edges being used to connect two mutually influential nodes.

[0054] A smart home knowledge graph is constructed based on device data, environmental data, and behavioral relationship data. Device and environmental data are abstracted into nodes, and their influence relationships, i.e., behavioral relationship data, are abstracted into connecting edges. This achieves a highly structured and semantic modeling of the complex smart home environment. The construction of the smart home knowledge graph integrates discrete device, environmental, and behavioral relationship data into a data network, making the potential linkages between smart home devices and their dependencies on environmental conditions visible and computable, thus laying the input foundation for subsequent reasoning.

[0055] Step 202 above includes the following sub-steps: Sub-step S11: Map the device data to multiple device nodes.

[0056] The device data includes relevant data from multiple smart home devices. This data is mapped to multiple device nodes. Each device node focuses on the internal state and controllable parameters of the smart home devices; that is, each smart home device corresponds to a single entity device node. Device nodes contain node attributes, which are stored in a structured format. This means that the attributes of each device node are not stored as loose key-value pairs or text comments, but rather as enumerable fields, fixed types, and reasonable attribute groups. This allows for direct calculation by field, rather than identification through text parsing. Furthermore, taking an air conditioner as an entity node, its node attributes include: cooling power curve, target temperature range, fan speed setting, and operating energy consumption model, etc. This application is not limited to these attributes; different node attributes can be selected based on actual needs.

[0057] Sub-step S12: Map the environmental data to environmental nodes.

[0058] Environmental data includes data directly related to energy consumption and the economy within a given space. This data characterizes external conditions and influencing factors, and is mapped to environmental nodes. These nodes include: room temperature nodes, humidity nodes, light intensity nodes, outdoor wind speed nodes, and dynamic electricity price nodes. Furthermore, environmental nodes also include node attributes, such as real-time values ​​and their trends. For example, a temperature node's attributes include real-time temperature values, temperature rise / fall rates, and controlled space volume. This application is not restrictive in this regard; different node attributes can be selected based on actual circumstances.

[0059] Sub-step S13: Based on the behavioral relationship data, determine the association relationships between each of the device nodes and between the device nodes and the environment nodes.

[0060] In step S13 above, the relationships between device nodes and between device nodes and environmental nodes are determined based on behavioral relationship data. The abstract influence relationships are transformed into connection edges of the smart home knowledge graph. This transforms the logical relationships (such as linkage, constraint, and causal relationships) mined from behavioral relationship data or defined by rules into a traversable and queryable edge structure in the smart home knowledge graph. This integrates scattered nodes into an interconnected network, and initially has the ability to express multi-device collaborative scenarios.

[0061] Sub-step S14: Establish edges between the device nodes that have an association relationship and between the device node and the environment node. The edges also include weight values ​​that characterize the association strength between the device nodes and between the device node and the environment node.

[0062] By introducing weight values ​​to quantify the strength of relationships between nodes, the smart home knowledge graph is upgraded from a binary model expressing the presence or absence of relationships to a model capable of representing the strength of influence relationships. Furthermore, the weight values ​​serve as a quantitative basis for judging the degree of influence and prioritizing in subsequent reasoning processes, and provide operable parameters for dynamically adjusting relationship confidence when updating the smart home knowledge graph. This enhances the representational capability of the smart home knowledge graph, making it more closely resemble the real-world reality where relationships have varying strengths.

[0063] In step 203, user interaction data with the smart home is obtained, and the nodes and edges in the smart home knowledge graph are updated based on the interaction data.

[0064] By acquiring user interaction data and updating the nodes and edges in the smart home knowledge graph accordingly, users' direct control or preference settings for smart homes can be transformed into adjustments to the content and structure of the smart home knowledge graph. This allows the smart home knowledge graph to continuously evolve based on user interaction data, reflecting and learning users' personalized usage habits and scenarios.

[0065] Step 203 above also includes the following sub-steps: Sub-step S21: Obtain user interaction data with the smart home, and determine the target node and target edge corresponding to the interaction data.

[0066] In step S21 above, the interaction data includes user-input control commands, which can be user operations or user voice messages, etc. This application is not limited to these; any user behavior related to smart home devices is included. After acquiring the interaction data, it is parsed into standardized behavior descriptions, including operation type, target device, parameter changes, time stamps, etc. The standardized behavior descriptions obtained from the parsed interaction data are then mapped to corresponding device nodes, environment nodes, or edges. The mapping rules are managed by a fixed user behavior and attribute mapping table to determine the associated target nodes and target edges.

[0067] By acquiring user interaction data and identifying the target nodes and edges that directly affect it, precise guidance for updating the smart home knowledge graph is achieved. This ensures that every user interaction (such as adjusting the temperature or turning devices on and off) can be accurately located to the device nodes and edges in the smart home knowledge graph that are directly affected by it, avoiding global data traversal and enabling more efficient update operations and faster responses.

[0068] Sub-step S22: Update the target node, as well as the nodes and edges adjacent to the target node.

[0069] Sub-step S23: Update the target edge and the nodes and edges adjacent to the target edge.

[0070] In steps S22 and S23 above, the target node and its adjacent nodes and edges are updated, as are the target edges and their adjacent nodes and edges. It is understood that the direct effects of user interaction data are not limited to a single manipulated device or relationship; their influence often propagates between related entities. For example, when a user raises the air conditioner temperature, it not only changes the setpoint of the air conditioner node itself (target node), but may also affect the expected readings of temperature and humidity sensor nodes in the same room (adjacent nodes), as well as the correlation strength between the air conditioner and the temperature control strategy (adjacent edges). By actively updating these adjacent nodes or edges, the local consistency and coordination of the smart home knowledge graph can be maintained, ensuring that the smart home knowledge graph surrounding this interaction data remains logically self-consistent after the update.

[0071] In other embodiments, in addition to updating device nodes, environment nodes, edges, and edge weights, user interaction data can also add new nodes when necessary, such as adding preference tag nodes, etc. This application does not limit this.

[0072] In step 204, based on the updated smart home knowledge graph, a rule-based reasoning process is executed to generate a first control command; The updated knowledge graph is used to execute rule-based reasoning to generate the first control command. The reasoning process of the rule-based reasoning is clear. The smart home control method can generate deterministic control actions that conform to prior knowledge in scenarios that have been fully understood or under the constraints of clear safety and energy-saving criteria. Based on this control action, the first control command is determined, which ensures the logical reliability and controllability of the first control command and meets the basic requirements of smart home control methods for security and basic functional stability.

[0073] Specifically, step 204 includes the following sub-steps: Sub-step S31: Obtain the logical rule base of the rule reasoning process. The logical rule base includes preset device data, preset environment data, and corresponding preset action data.

[0074] By acquiring a logical rule base containing preset device data, preset environment data, and corresponding preset action data, it can be understood that the logical rule base is used to comprehensively construct based on expert knowledge, user settings, and historical operation results. It is used for conditional judgment and triggering. Therefore, these preset device data, preset environment data, and corresponding preset action data essentially encapsulate domain expert knowledge, safety specifications, energy-saving strategies, and common scenario templates. Furthermore, this knowledge is predefined and stored in the form of condition and action pairs, making it easy to call directly. This avoids the need for complex logical generation or calculation during each reasoning, providing a prerequisite for efficient and reliable decision-making.

[0075] Sub-step S32: Match the smart home knowledge graph according to the logical rule base. When the preset device data, the preset environment data and the node and the edge are consistent, output the preset action data corresponding to the preset device data and the preset environment data.

[0076] The system matches the real-time updated smart home knowledge graph against a logical rule base, triggering corresponding actions when preset data matches nodes and edges in the graph. In this embodiment, the matching process essentially compares dynamically changing specific scenario states (represented by the smart home knowledge graph) with abstract general rule conditions. When the attributes of a node in the smart home knowledge graph, i.e., the factual data of a certain smart home, meet preset conditions, it indicates that the current scenario falls within the scope of a known rule. This matching-based triggering mechanism makes the reasoning process highly interpretable and predictable.

[0077] Sub-step S33: Output the first control command according to the corresponding preset action data.

[0078] Based on the successfully matched rules, the associated preset action data is directly output as the first control command. Once a match is successful, the first control command is determined without additional decision-making delays or complex parameter calculations. It is suitable for scenarios with high real-time requirements or those that need to strictly adhere to hard constraints such as safety and energy efficiency, providing deterministic and rapid response.

[0079] In other embodiments, the execution rule reasoning process further includes constructing a local subgraph based on the smart home knowledge graph, obtaining nodes and edges related to the target smart home, sorting the edges according to their weights, generating candidate action chains, and prioritizing edges with higher weights for matching. The matching conditions in the logical rule base include environmental conditions (such as temperature and humidity, electricity price, etc.), smart home device conditions (such as working mode, parameter range), and edge weight conditions (the relationship between edge weight and threshold). Conflicts and constraints are checked through the matching conditions. If a conflict occurs, arbitration is performed based on the weights, and subsequent action sequence suggestions are generated, including target actions (on / off / adjusting speed / temperature adjustment), parameter selection (airflow / set temperature), and priority.

[0080] In some embodiments, the first control command is also executed and its feasibility is verified to determine whether the action conforms to the capabilities of the smart home itself. The executed behavior is recorded and fed back to the nodes and edges of the smart home knowledge graph to form a self-learning mechanism. If the execution is successful, the weight of the corresponding edge increases; if the execution fails, the weight of the corresponding edge decreases.

[0081] In step 205, based on the updated smart home knowledge graph, a graph neural network inference process is executed to generate a second control command.

[0082] When executing rule-based reasoning based on the smart home knowledge graph, a graph neural network reasoning process is also executed based on the same smart home knowledge graph to generate a second control command. The graph neural network can encode the nodes and edges (including their weights) in the graph as a whole into features and capture complex, potential association patterns between nodes and edges. This enables it to handle complex or dynamic scenarios not explicitly covered by rules and generate optimization suggestions that better fit the personalized states and relationships encoded in the current smart home knowledge graph, thereby enhancing the adaptability and intelligence level of the smart home control method.

[0083] Step 205 includes the following sub-steps: Sub-step S41: Obtain the graph neural network model.

[0084] By acquiring a pre-trained graph neural network model, a foundation is laid for subsequent reasoning. Due to its inherent message passing mechanism, the graph neural network model can effectively process data where nodes and edges are interconnected, enabling it to perform in-depth analysis and computation on relational structures such as smart home knowledge graphs.

[0085] Sub-step S42 converts the node attributes in the smart home knowledge graph into node feature vectors, and converts the edge types and weight values ​​into relation feature vectors.

[0086] The node attributes in the smart home knowledge graph are converted into node feature vectors, and the edge types and weight values ​​are converted into relation feature vectors. While preserving the basic semantics of entities and relations in the smart home knowledge graph (through relative position and direction in vector space), the rich attribute information of nodes (such as device status and environmental readings) and the strength information of relations (weight values) are encoded into features that can be directly mathematically operated on by the graph neural network model. This enables subsequent neural network calculations to fully and meticulously utilize all the information contained in the smart home knowledge graph.

[0087] Sub-step S43: Input the node feature vector and the relationship feature vector into the graph neural network model, calculate the node feature vector and the relationship feature vector, and output the optimal prediction action.

[0088] The transformed node feature vectors and relation feature vectors are input into the graph neural network model for calculation, and the optimal predicted action is output. Through multi-layer message passing and aggregation, the graph neural network model can simulate the process of information propagation and fusion in the smart home knowledge graph network, thereby capturing the potential and complex interaction patterns and dependencies between smart home devices and between devices and the environment. Based on the learned patterns, it can start from the global state, comprehensively weigh multiple factors, and output an action suggestion with better prediction effect under the goal orientation (such as optimal overall energy efficiency and best comfort).

[0089] Sub-step S44: Output a second control command based on the optimal predicted action.

[0090] The second control command is generated based on the optimal predicted action output by the model, thus completing the transition from data-driven analysis to the implementation of specific control commands. This second control command is directly derived from the deep calculation of the current overall situation and represents an optimized solution based on the current state of the smart home knowledge graph.

[0091] In step 206, the first control command and the second control command are subjected to a consistency check, and the device control scheme is determined based on the consistency check result.

[0092] The first and second control commands generated are subjected to consistency verification, and the final device control scheme is determined accordingly. It can be understood that when the two are consistent, it means that the rule-based reasoning process and the graph neural network reasoning process have reached a consensus, which greatly enhances the confidence of the decision result. When the two are inconsistent, consistency verification is triggered, so that the smart home control method needs to comprehensively consider the conclusions from different perspectives. It can arbitrate based on preset strategies or again based on information in the smart home knowledge graph, thereby avoiding over-reliance on a single reasoning method. It can seek a balance between the determinism of rules and the flexibility of neural networks, thereby generating a more robust and globally better control scheme.

[0093] Step 206 includes the following sub-steps: Sub-step S51: Obtain the weight values ​​of the edges corresponding to the first control command and the second control command, as well as the target energy strategy. The target energy strategy is used to calculate the energy consumption change data of the smart home.

[0094] By obtaining the edge weights corresponding to the first and second control commands and the target energy strategy, a clear decision-making basis is provided for subsequent judgments. The edge weights are derived from the smart home knowledge graph and are a quantification of the strength of the association between nodes. The edge weights are used to characterize the confidence of the relationship jointly shaped by historical co-occurrence, physical coupling, and user behavior. At the same time, the target energy strategy, including energy-saving priority strategy, economy priority strategy, or comfort priority strategy, represents the externally defined goal that the system or user expects to optimize in the current period. By combining the edge weights and the target energy strategy, the calculation results can simultaneously consider the strength of the structured association within the system and the pre-set optimization direction.

[0095] Sub-step S52: When the first control command and the second control command are inconsistent, determine the comprehensive score of the first control command and the second control command based on the weight value of the edge and the target energy strategy.

[0096] When instructions are inconsistent, the comprehensive score of each instruction is determined based on the edge weights and the target energy strategy. The process of calculating the comprehensive score is essentially a comprehensive weighted evaluation of the strength of the relationship involved in each instruction (reflecting its influence on the known network of connections in the system) and the effect predicted after execution that conforms to the target strategy (such as energy savings, cost changes, or comfort improvements). This ensures that the decision is not a simple binary choice or a random selection, but rather that the final selection tends to favor those instructions that can make full use of strong connections and better achieve the predetermined optimization goals.

[0097] Sub-step S53: Based on the comprehensive score, select the first control command or the second control command as the device control scheme.

[0098] The selected instruction is the final equipment control scheme based on the calculated comprehensive score. The comprehensive score provides a clear decision-making standard, avoids subjective or vague conflict resolution methods, and enhances the transparency, consistency and predictability of the system decision-making process.

[0099] In step 207, the device control scheme is executed, and the smart home knowledge graph is updated based on the feedback data after the execution of the device control scheme.

[0100] By executing the control scheme and updating the knowledge graph using feedback data, a closed-loop control operation is formed. The feedback data reflects the actual effect of the device control scheme. Using it to update the smart home knowledge graph can verify the accuracy of reasoning through the smart home knowledge graph. Based on the actual results, the smart home knowledge graph can be strengthened or corrected (such as adjusting the weight of relation edges). This enables the smart home control method of the present invention to have the ability to continuously self-optimize, improving the control accuracy and user satisfaction in long-term operation.

[0101] Step 207 includes the following sub-steps: parsing the device control scheme into an ordered sequence of actions, the sequence of actions including multiple action execution information, each of the action execution information including a target device identifier, action type, target parameter value and expected execution time; and sending the action execution information to the corresponding smart home device according to the order and timing of the action sequence.

[0102] By parsing the device control scheme into an ordered sequence of actions containing multiple action execution information, and ensuring that each action execution information clearly specifies the target device identifier, action type, target parameter value, and expected execution time, the parsing process guarantees that each action execution information to be executed is complete and clear. This parsing process breaks down complex linkage schemes into a series of operations, providing a clear execution blueprint for the operation of smart homes and enabling precise control.

[0103] Secondly, the sequential and time-based action sequence, along with the expected execution time included in the execution information for each action, ensures that in scenarios involving the interconnection of multiple smart home devices, the actions of each device can be triggered sequentially or synchronously according to logical dependencies or an optimized time plan. For example, in movie-watching mode, it might be necessary to first turn off the main light (Action A), then turn on the ambient light (Action B) and lower the projection screen (Action C), and Action B and Action C might need to be executed synchronously. This sequential action prevents scene chaos or smart home device state conflicts caused by disordered command sending order, ensuring a smooth and complete experience in complex scenarios.

[0104] Finally, action execution information is sent to the corresponding smart home devices according to the parsed order and timing. The strict sequential sending mechanism, combined with the precise device identifier and parameters in each action execution information, ensures the consistency between instruction sending and execution. This enables the distributed smart home devices to collaboratively complete the predetermined tasks, improves the collaborative control capability of the smart home device group, and enables applications in complex scenarios where multiple smart home devices operate simultaneously or at intervals.

[0105] In step 208, the constraints of the device control scheme are obtained; the constraints include device safety operation constraints, circuit load constraints, and user-defined blacklist / whitelist constraints.

[0106] By acquiring constraints encompassing equipment safety operation constraints, circuit load constraints, and user-defined blacklists and whitelists, a series of insurmountable "guardrails" are established for system decision-making. Equipment safety operation constraints (such as minimum switching intervals and temperature limits) ensure the physical safety and lifespan of individual devices; circuit load constraints (such as total power limits) ensure the overall safety of the home circuit system and prevent overload risks; user blacklists and whitelists grant users absolute permission to allow or prohibit specific device or scenario interactions, which is crucial for meeting highly personalized needs. These constraints together constitute a multi-dimensional line of defense for safety and reliability.

[0107] In step 209, when the device control scheme violates the constraints, the device control scheme is adjusted.

[0108] When a generated device control scheme is detected to violate any constraint, an adjustment mechanism is triggered, enabling proactive risk avoidance and scheme correction. Adjustments can be made based on constraint type and preset strategies; for example, delaying the startup of high-power devices to comply with load constraints, or replacing disabled actions in blacklists and whitelists with permitted actions. This avoids directly issuing schemes that may pose security risks, physical conflicts, or violate explicit user preferences, intercepting potential risks at the decision-making stage.

[0109] Secondly, Figure 3 This is a structural block diagram of a smart home control device according to an embodiment of the present invention. Please refer to it. Figure 3 This invention provides a smart home control device, comprising: Data acquisition module 301 is used to acquire device data, environmental data and behavioral relationship data of the smart home, wherein the behavioral relationship data is used to characterize the influence relationship between the smart home and the environment; The knowledge graph module 302 is used to construct a smart home knowledge graph based on the device data, the environmental data, and the behavioral relationship data, so that the device data and the environmental data are used as nodes, the behavioral relationship data are used as edges, and the edges are used to connect two mutually influential nodes. The interaction data update module 303 is used to acquire user interaction data with the smart home and update the nodes and edges in the smart home knowledge graph based on the interaction data. Inference module 304 is used to perform inference based on the updated smart home knowledge graph to generate device control schemes; The execution module 305 is used to execute the device control scheme and update the smart home knowledge graph based on the feedback data after executing the device control scheme.

[0110] In this embodiment of the invention, the smart home control method integrates multi-source information by acquiring device data, environmental data, and behavioral relationship data of the smart home, providing a data foundation for the subsequent construction of a smart home knowledge graph. Behavioral relationship data characterizes the influence relationship between device data and environmental data of the smart home, thereby representing the effects of interactions between smart home devices and laying the foundation for subsequent collaborative control. Based on the above data, a smart home knowledge graph is constructed, with device data and environmental data as nodes and behavioral relationship data as edges, connecting two mutually influencing nodes to represent the complex relationships between the smart home and the environment. By acquiring user interaction data with the smart home, the smart home control method can adapt to users' personalized preferences and dynamically update the smart home graph to meet users' personalized needs. Through the structured information of the smart home knowledge graph, device status, environmental conditions, and users' personalized operations can be comprehensively considered to generate more reasonable device control schemes. The smart home knowledge graph is updated based on feedback data after executing the device control scheme, ensuring that the smart home control method can continuously learn and adjust from the execution results, thereby optimizing future device control schemes and improving the accuracy and reliability of the smart home control method in this invention.

[0111] In some embodiments, the knowledge graph module 302 includes: The device mapping submodule is used to map the device data into multiple device nodes; The environment mapping submodule maps the environment data into environment nodes; The association relationship determination submodule is used to determine the association relationships between each of the device nodes and between the device nodes and the environment nodes based on the behavioral relationship data; An edge establishment submodule is used to establish edges between the device nodes that have an association relationship and between the device node and the environment node. The edges also include weight values ​​that characterize the association strength between the device nodes and between the device node and the environment node.

[0112] In some embodiments, the interactive data update module 303 includes: The interaction data acquisition submodule is used to acquire user interaction data with the smart home and determine the target node and target edge corresponding to the interaction data. The first update submodule is used to update the target node, as well as the nodes and edges adjacent to the target node; The second update submodule is used to update the target edge and the nodes and edges adjacent to the target edge.

[0113] In some embodiments, the inference module 304 includes: The rule reasoning submodule is used to execute a rule reasoning process based on the updated smart home knowledge graph to generate a first control command. The graph neural network inference submodule is used to execute a graph neural network inference process based on the updated smart home knowledge graph to generate a second control command. The verification submodule is used to perform consistency verification on the first control command and the second control command, and determine the device control scheme based on the consistency verification result.

[0114] In some embodiments, the rule reasoning submodule includes: The logic rule base unit is used to obtain the logic rule base of the rule reasoning process. The logic rule base includes preset device data, preset environment data and corresponding preset action data. The matching unit is used to match the smart home knowledge graph according to the logical rule base. When the preset device data, the preset environment data and the node and the edge are consistent, the preset action data corresponding to the preset device data and the preset environment data is output. The first instruction output unit is used to output a first control instruction based on the corresponding preset action data.

[0115] In some embodiments, the graph neural network inference submodule includes: The model acquisition unit is used to acquire the graph neural network model. The conversion unit is used to convert the node attributes in the smart home knowledge graph into node feature vectors, and to convert the edge type and weight value into relation feature vectors. The computing unit is used to input the node feature vector and the relationship feature vector into the graph neural network model, calculate the node feature vector and the relationship feature vector, and output the optimal prediction action; The second instruction output unit is used to output a second control instruction based on the optimal predicted action.

[0116] In some embodiments, the verification submodule includes: The weight and strategy acquisition unit is used to acquire the weight values ​​of the edges corresponding to the first control command and the second control command, as well as the target energy strategy, wherein the target energy strategy is used to calculate the energy consumption change data of the smart home. The comprehensive score calculation unit is used to determine the comprehensive score of the first control command and the second control command based on the weight value of the edge and the target energy strategy when the first control command and the second control command are inconsistent. The judgment unit is used to select either the first control instruction or the second control instruction as the device control scheme based on the comprehensive score.

[0117] In some embodiments, the smart home control device further includes: The constraint acquisition module is used to acquire the constraints of the device control scheme; the constraints include device safe operation constraints, circuit load constraints, and user-defined blacklist / whitelist constraints. An adjustment module is used to adjust the equipment control scheme when the equipment control scheme violates the constraints.

[0118] In some embodiments, the execution module 305 includes: The parsing submodule is used to parse the device control scheme into an ordered sequence of actions. The sequence of actions includes multiple action execution information, each of which contains a target device identifier, action type, target parameter value, and expected execution time. The instruction sending submodule is used to send the action execution information to the corresponding smart home device according to the order and timing of the action sequence. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple; relevant details can be found in the description of the method embodiment.

[0119] This invention also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described smart home control method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here.

[0120] This invention also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described smart home control method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.

[0121] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0122] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of the present invention is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, electronic device, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0124] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.

Claims

1. A smart home control method, characterized in that, include: Acquire device data, environmental data, and behavioral relationship data of the smart home, wherein the behavioral relationship data is used to characterize the influence relationship between the smart home and the environment; A smart home knowledge graph is constructed based on the device data, the environmental data, and the behavioral relationship data, with the device data and the environmental data serving as nodes and the behavioral relationship data serving as edges, and the edges being used to connect two mutually influencing nodes. Acquire user interaction data with the smart home, and update the nodes and edges in the smart home knowledge graph based on the interaction data; Based on the updated smart home knowledge graph, reasoning is performed to generate device control schemes; The device control scheme is executed, and the smart home knowledge graph is updated based on the feedback data after the device control scheme is executed.

2. The smart home control method according to claim 1, characterized in that, The construction of a smart home knowledge graph based on device data, environmental data, and behavioral relationship data includes: The device data is mapped to multiple device nodes; Map the environmental data to environmental nodes; Based on behavioral relationship data, determine the association relationships between each of the device nodes and between the device nodes and the environment nodes; Edges are established between the device nodes that have an association relationship and between the device node and the environment node. The edges also include weight values ​​that characterize the association strength between the device nodes and between the device node and the environment node.

3. The smart home control method according to claim 1, characterized in that, The step of acquiring user interaction data with the smart home and updating the nodes and edges in the smart home knowledge graph based on the interaction data includes: Acquire user interaction data with the smart home system, and determine the target node and target edge corresponding to the interaction data; Update the target node, as well as the nodes and edges adjacent to the target node; Update the target edge, as well as the nodes and edges adjacent to the target edge.

4. The smart home control method according to claim 1, characterized in that, The process of generating device control schemes based on the updated smart home knowledge graph includes: Based on the updated smart home knowledge graph, a rule-based reasoning process is executed to generate the first control command; Based on the updated smart home knowledge graph, a graph neural network inference process is executed to generate a second control command; The first control command and the second control command are subjected to consistency verification, and the device control scheme is determined based on the consistency verification result.

5. The smart home control method according to claim 4, characterized in that, The step of generating a first control command by executing a rule-based reasoning process based on the updated smart home knowledge graph includes: Obtain the logical rule base of the rule reasoning process, the logical rule base including preset device data, preset environment data and corresponding preset action data; The smart home knowledge graph is matched according to the logical rule base. When the preset device data, the preset environment data and the node and the edge are consistent, the preset action data corresponding to the preset device data and the preset environment data is output. The first control command is output based on the corresponding preset action data.

6. The smart home control method according to claim 4, characterized in that, The step of generating a second control command by executing a graph neural network inference process based on the updated smart home knowledge graph includes: Obtain the graph neural network model; The node attributes in the smart home knowledge graph are converted into node feature vectors, and the edge types and weight values ​​are converted into relation feature vectors. The node feature vector and the relationship feature vector are input into the graph neural network model, the node feature vector and the relationship feature vector are calculated, and the optimal prediction action is output. The second control command is output based on the optimal predicted action.

7. The smart home control method according to claim 4, characterized in that, The step of performing a consistency check on the first control command and the second control command, and determining the device control scheme based on the consistency check result, includes: Obtain the weight values ​​of the edges corresponding to the first control command and the second control command, as well as the target energy strategy. The target energy strategy is used to calculate the energy consumption change data of the smart home. When the first control command and the second control command are inconsistent, the combined score of the first control command and the second control command is determined based on the weight value of the edge and the target energy strategy. Based on the comprehensive score, either the first control command or the second control command is selected as the device control scheme.

8. The smart home control method according to claim 1, characterized in that, Also includes: Obtain the constraints of the device control scheme; the constraints include device safety operation constraints, circuit load constraints, and user-defined blacklist / whitelist constraints; When the device control scheme violates the constraints, the device control scheme shall be adjusted.

9. The smart home control method according to claim 1, characterized in that, The execution of the device control scheme includes: The device control scheme is parsed into an ordered sequence of actions, which includes multiple action execution information. Each action execution information includes a target device identifier, action type, target parameter value, and expected execution time. According to the order and timing of the action sequence, the action execution information is sent to the corresponding smart home device.

10. A smart home control device, characterized in that, include: The data acquisition module is used to acquire device data, environmental data, and behavioral relationship data of the smart home, wherein the behavioral relationship data is used to characterize the influence relationship between the smart home and the environment. The knowledge graph module is used to construct a smart home knowledge graph based on the device data, the environmental data, and the behavioral relationship data, so that the device data and the environmental data are used as nodes, the behavioral relationship data are used as edges, and the edges are used to connect two mutually influential nodes. An interaction data update module is used to acquire user interaction data with the smart home and update the nodes and edges in the smart home knowledge graph based on the interaction data. The reasoning module is used to perform reasoning based on the updated smart home knowledge graph to generate device control schemes. An execution module is used to execute the device control scheme and update the smart home knowledge graph based on feedback data after executing the device control scheme.

11. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the smart home control method as described in claims 1-9.

12. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the smart home control method as described in claims 1-9.