Smart home control method and apparatus based on causal inference, device and medium

By acquiring user behavior and environmental data and using causal inference models to determine the root causes of behavioral deviations in smart home systems, the problem of inaccurate control in existing technologies is solved, enabling smarter and more user-friendly automated control, improving user experience and bringing energy-saving benefits.

CN122362910APending Publication Date: 2026-07-10GREE 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
GREE ELECTRIC APPLIANCE INC OF ZHUHAI
Filing Date
2026-04-09
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing smart home systems struggle to accurately determine the root cause of user behavior deviations, resulting in an inability to provide precise automation control strategies, which may lead to energy waste or negatively impact user experience.

Method used

By acquiring user behavior data, environmental data, and user profiles, causal inference models are used to perform causal reasoning to determine the root causes of user behavior deviations, and smart home control commands are formulated based on these root causes.

Benefits of technology

It enables precise control of smart home devices, improves user experience and brings energy-saving benefits, and overcomes the problem of difficulty in judging the root cause of behavior deviation in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122362910A_ABST
    Figure CN122362910A_ABST
Patent Text Reader

Abstract

This invention discloses a smart home control method, device, equipment, and medium based on causal inference. The method includes: acquiring user behavior data, environmental data, and user profiles; determining user behavior deviation characteristics based on the behavior data, environmental data, and preset historical behavior data; determining user behavior deviation vectors based on the user behavior deviation characteristics, user profiles, and environmental data; inputting the user behavior deviation vectors into a preset causal inference model, performing causal reasoning on the user behavior deviation vectors through the preset causal inference model to determine the root cause of the user behavior deviation; determining smart home control commands based on the root cause of the user behavior deviation, and controlling the corresponding smart home devices according to the smart home control commands. This achieves smarter, more user-centric, and automated control of smart home devices, improving user experience and bringing energy-saving benefits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of smart home, specifically relating to a smart home control method, device, equipment, and medium based on causal inference. Background Technology

[0002] With the development of smart home technology, more and more families are equipped with various smart devices, such as smart air conditioners, smart lights, and smart curtains. These devices can typically record user behavior and attempt to provide automated services based on user habits. However, in current technology, when smart home systems detect deviations between user behavior and historical habits, they often only identify the anomaly but struggle to accurately determine the root cause of the deviation. For example, when a user does not turn on the air conditioner at their usual time, the system cannot effectively distinguish whether it is due to a temporary change in habits, environmental changes, device malfunction, or the user being engaged in other activities. This lack of ability to determine the root cause of behavioral deviations makes it difficult for smart home systems to provide truly tailored and precise automated control strategies that meet the user's actual needs, potentially leading to unnecessary energy consumption or negatively impacting the user experience. Summary of the Invention

[0003] In view of the above problems, embodiments of the present invention are proposed to provide a smart home control method, apparatus, device and medium based on causal inference that overcomes the problem that the above-mentioned smart home systems are unable to provide a truly accurate automation control strategy that meets the actual needs of users, or at least partially solves the above problems.

[0004] In a first aspect, embodiments of the present invention provide a smart home control method based on causal inference, the method comprising: Acquire user behavior data, environmental data, and user profiles; Based on the behavioral data, the environmental data, and the preset historical behavioral data, user behavior deviation characteristics are determined; Based on the user behavior deviation characteristics, the user profile, and the environmental data, determine the user behavior deviation vector; The user behavior deviation vector is input into a preset causal inference model, and the user behavior deviation vector is subjected to causal inference through the preset causal inference model to determine the root cause of the user behavior deviation. Based on the root cause of the user behavior deviation, determine the smart home control command, and control the corresponding smart home according to the smart home control command.

[0005] Optionally, the preset causal inference model is trained in the following manner: Acquire historical user behavior data, historical environment data, historical user profiles, and corresponding root cause annotation data for user behavior deviations; Based on the historical user behavior data, historical environment data, and preset historical behavior data, the deviation characteristics of historical user behavior are determined; Based on the historical user behavior deviation characteristics, the historical user profile, and the historical environmental data, determine the historical user behavior deviation vector; Using the historical user behavior deviation vector as input and the corresponding user behavior deviation root cause labeling data as output label, an initial causal inference model is trained to obtain the preset causal inference model.

[0006] Optionally, the acquisition of historical user behavior data, historical environment data, historical user profiles, and corresponding user behavior deviation root cause annotation data includes: Determine standardized variables, which include: entity variables representing physical objects in the household, concept variables representing environmental states, user behaviors, or abstract concepts, as well as the attributes possessed by the entity variables and concept variables; Obtain the historical user behavior data, label the user behavior deviation root causes corresponding to the samples in the historical user behavior data that deviate from the preset historical behavior data, and determine the user behavior deviation root cause labeling data.

[0007] Optionally, determining the historical user behavior deviation characteristics based on the historical user behavior data, historical environment data, and preset historical behavior data includes: Based on the historical user behavior data, the historical environment data, and the historical user profile, a preliminary causal graph is generated using a preset causal discovery algorithm; Based on the preliminary causal graph, determine the causal relationships in natural language; Based on the natural language causal relationships and the preset domain prompt word template, the target prompt word is determined; Input the target prompt words and the preliminary causal graph into a preset large language model to determine the supplementary causal graph; By using a preset virtual intervention algorithm in a preset family digital model, at least one variable in the supplementary causal graph is assigned a specific value and the responses of other variables are determined, so as to determine the effect of the simulated intervention. The edge weights of the supplementary causal graph are adjusted based on the preset historical behavioral data and the simulated intervention effect to determine the family causal graph; Based on the family causal diagram and preset historical behavior data, the deviation characteristics of the historical user behavior are determined.

[0008] 5. The smart home control method based on causal inference according to claim 2, characterized in that, determining the historical user behavior deviation vector based on the historical user behavior deviation characteristics, the historical user profile, and the historical environmental data includes: The historical user behavior deviation features, the historical user profiles, and the historical environment data are vectorized to obtain historical deviation vectors, historical profile vectors, and historical environment vectors, respectively. The historical user behavior deviation vector is determined based on the historical deviation vector, the historical profile vector, and the historical environment vector.

[0009] Optionally, determining smart home control commands based on the root cause of the user behavior deviation, and controlling the corresponding smart home devices according to the smart home control commands, includes: Based on the root cause of the user behavior deviation, at least one target control strategy is matched from a preset root cause-control strategy mapping library. The target control strategy is used to eliminate or mitigate the root cause of the user behavior deviation. Based on the target control strategy and current environmental data, a smart home control command is determined, which includes the target device identifier and the corresponding control parameters. The smart home control command is sent to the smart home device corresponding to the target device identifier to control the smart home device to perform the corresponding operation.

[0010] Optionally, the behavioral data includes at least one of the following: user operation records of smart home devices, operation time, operation frequency, and operation sequence; the environmental data includes at least one of the following: indoor temperature and humidity, light intensity, outdoor weather information, and indoor activity areas collected by sensors; the user profile includes at least one of the following: user's age, gender, daily routine, device usage preferences, and sensitivity to environmental parameters.

[0011] Secondly, embodiments of the present invention provide a smart home control device based on causal inference, the device comprising: The data acquisition module is used to acquire user behavior data, environmental data, and user profiles; The user behavior deviation feature determination module is used to determine user behavior deviation features based on the behavior data, the environmental data, and preset historical behavior data. The user behavior deviation vector determination module is used to determine the user behavior deviation vector based on the user behavior deviation features, the user profile, and the environmental data. The user behavior deviation root cause determination module is used to input the user behavior deviation vector into a preset causal inference model, and perform causal inference on the user behavior deviation vector through the preset causal inference model to determine the root cause of the user behavior deviation. The smart home control module is used to determine smart home control commands based on the root causes of user behavior deviations, and to control the corresponding smart home devices according to the smart home control commands.

[0012] Optionally, the preset causal inference model is trained through the following modules: The historical data acquisition submodule is used to acquire historical user behavior data, historical environment data, historical user profiles, and corresponding root cause annotation data of user behavior deviations. The historical user behavior deviation feature determination submodule is used to determine the historical user behavior deviation features based on the historical user behavior data, historical environment data, and preset historical behavior data. The historical user behavior deviation vector determination submodule is used to determine the historical user behavior deviation vector based on the historical user behavior deviation characteristics, the historical user profile, and the historical environmental data. The preset causal inference model determination submodule is used to train an initial causal inference model by taking the historical user behavior deviation vector as input and the corresponding user behavior deviation root cause labeling data as output labels, so as to obtain the preset causal inference model.

[0013] Optionally, the historical data acquisition submodule includes: A standardized variable determination unit is used to determine standardized variables, which include: entity variables representing physical objects in the household, concept variables representing environmental states, user behaviors, or abstract concepts, as well as the attributes possessed by the entity variables and concept variables; The user behavior deviation root cause labeling data determination unit is used to acquire the historical user behavior data, label the user behavior deviation root causes corresponding to the samples in the historical user behavior data that deviate from the preset historical behavior data, and determine the user behavior deviation root cause labeling data.

[0014] Optionally, the historical user behavior deviation feature determination submodule includes: The preliminary causal graph determination unit is used to generate a preliminary causal graph based on the historical user behavior data, the historical environment data, and the historical user profile, using a preset causal discovery algorithm. The causal relationship determination unit is used to determine natural language causal relationships based on the preliminary causal graph. The target prompt word determination unit is used to determine target prompt words based on the natural language causal relationship and the preset domain prompt word template; The supplementary causal graph determination unit is used to input the target prompt word and the preliminary causal graph into a preset large language model to determine the supplementary causal graph; The simulated intervention effect determination unit is used to assign a specific value to at least one variable in the supplementary causal graph and determine the response of other variables in a preset family digital model through a preset virtual intervention algorithm, so as to determine the simulated intervention effect. The family causal graph determination unit is used to adjust the edge weights of the supplementary causal graph based on the preset historical behavioral data and the simulated intervention effect, and to determine the family causal graph. The user behavior deviation feature determination unit is used to determine the historical user behavior deviation features based on the family causal graph and preset historical behavior data.

[0015] Optionally, the historical user behavior deviation vector determination submodule includes: The vectorization processing unit is used to vectorize the historical user behavior deviation features, the historical user profile, and the historical environment data respectively to obtain historical deviation vector, historical profile vector, and historical environment vector. The historical user behavior deviation vector comprehensive determination unit is used to determine the historical user behavior deviation vector based on the historical deviation vector, the historical profile vector, and the historical environment vector.

[0016] Optionally, the smart home control module includes: The target control strategy determination submodule is used to match at least one target control strategy from a preset root cause-control strategy mapping library based on the root cause of the user behavior deviation. The target control strategy is used to eliminate or mitigate the root cause of the user behavior deviation. The smart home control command determination submodule is used to determine smart home control commands based on the target control strategy and current environmental data. The control commands include the target device identifier and the corresponding control parameters. The smart home control submodule is used to send the smart home control command to the smart home device corresponding to the target device identifier, so as to control the smart home device to perform corresponding operations.

[0017] Thirdly, embodiments of the present invention provide an electronic device, the 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.

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

[0019] In this embodiment of the invention, by acquiring user behavior data, environmental data, and user profiles, multi-dimensional information influencing user behavior can be comprehensively collected, providing a data foundation for subsequent analysis. Based on the behavior data, environmental data, and preset historical behavior data, user behavior deviation characteristics are determined, accurately identifying the differences between the user's current behavior and the normal pattern. By determining the user behavior deviation vector based on the user behavior deviation characteristics, user profile, and environmental data, multi-source heterogeneous deviation information can be transformed into a structured numerical vector, facilitating model processing. The user behavior deviation vector is input into a preset causal inference model, which performs causal reasoning on the user behavior deviation vector to determine the root cause of the user behavior deviation. This allows for accurate determination of the root cause of user behavior deviation, overcoming the difficulty in identifying the root cause of behavior deviation in existing technologies. Finally, based on the root cause of the user behavior deviation, smart home control commands are determined, and the corresponding smart home devices are controlled according to these commands. Based on accurate root cause analysis, precise control commands can be formulated and executed, achieving smarter and more user-centric automated control of smart home devices, improving user experience and bringing energy-saving benefits. Attached Figure Description

[0020] Figure 1 This is a flowchart illustrating the steps of an embodiment of the smart home control method based on causal inference according to the present invention. Figure 2 This is a flowchart illustrating the steps of another embodiment of the smart home control method based on causal inference of the present invention. Figure 3 This is a structural block diagram of an embodiment of a smart home control device based on causal inference according to the present invention. Detailed Implementation

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

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

[0023] The following description, in conjunction with the accompanying drawings, details the smart home control method, apparatus, device, and medium based on causal inference provided by the embodiments of the present invention through specific examples and application scenarios.

[0024] Reference Figure 1 The diagram illustrates a flowchart of an embodiment of a smart home control method based on causal inference according to the present invention, which may specifically include the following steps: Step 101: Obtain user behavior data, environmental data, and user profiles; In step 101, user behavior data, environmental data, and user profiles are first acquired. User behavior data refers to information reflecting various operations or activities performed by the user in the smart home environment, such as records of smart device operation and movement trajectories within the indoor space. Environmental data refers to information characterizing the physical state of the smart home environment, such as indoor temperature and humidity, light intensity, and outdoor weather conditions. User profiles are comprehensive descriptions of the user's individual characteristics, lifestyle habits, and preferences. These data can be acquired through methods such as logging by the smart devices themselves, data collection from various environmental sensors, information proactively provided by the user, and analysis and mining of historical data. This data is collected via wired or wireless networks, providing a foundation for subsequent analysis.

[0025] The smart home control method based on causal inference provided in this invention can be executed by a smart decision-making device in a smart home system, such as a smart central control device, an edge computing node with data processing capabilities, a cloud server, or a combination thereof. It is mainly applied to smart home environments and aims to achieve intelligent control of smart home devices through comprehensive analysis of user behavior and environment.

[0026] Step 102: Determine user behavior deviation characteristics based on the behavioral data, the environmental data, and the preset historical behavioral data; In step 102, user behavior deviation characteristics are first determined based on the acquired behavioral data, environmental data, and preset historical behavioral data. Preset historical behavioral data refers to a pre-defined or historically accumulated set of data reflecting user behavior patterns under normal circumstances, which can serve as a benchmark for judging whether current behavior is normal. User behavior deviation characteristics refer to the differences or abnormal features exhibited by the current user behavior compared to the preset historical behavioral data.

[0027] In practice, the current behavioral data, environmental data, and preset historical behavioral data are first preprocessed, such as by aligning time and standardizing formats. Then, a normal behavioral pattern model of the user under different environmental conditions is constructed based on the preset historical behavioral data. For example, statistical analysis is used to determine the user's typical operating habits in specific time periods and environmental states. Next, the current behavioral data is compared with the constructed normal behavioral pattern model. Combined with the current environmental data, the degree of deviation between the current behavior and the historical normal pattern in terms of operation frequency, operation sequence, and operation parameters is analyzed. Finally, this deviation information is extracted into quantitative or descriptive features, forming user behavior deviation features. These features will serve as an important basis for subsequent causal inferences. For example, if historical data shows that the user usually turns off the bedroom lights before going to bed, but the user does not perform this action under the same environmental conditions, then the deviation feature "bedroom lights not turned off before going to bed" can be extracted.

[0028] Step 103: Determine the user behavior deviation vector based on the user behavior deviation features, the user profile, and the environmental data; In step 103, based on the identified user behavior deviation features, and combined with user profiles and current environmental data, a user behavior deviation vector is constructed. This user behavior deviation vector is a form that integrates and numerically represents various types of information, including deviation features reflecting behavioral abnormalities, user profile information characterizing individual differences, and environmental data describing the current environmental conditions. Its purpose is to transform this multi-dimensional, potentially unstructured information into a structured data form suitable for processing by the input model.

[0029] Specifically, user behavior deviation features, user profiles, and environmental data can be vectorized separately. For example, deviation features can be quantified into different values ​​or codes; categorical data in user profiles, such as age groups and interests, can be one-hot encoded or embedded, while numerical data can be standardized or normalized; various physical parameters in environmental data, such as temperature and humidity, can also be numerically quantified and standardized accordingly. Then, the resulting sub-vectors are combined into a comprehensive vector, i.e., the user behavior deviation vector, according to preset rules such as concatenation and weighted fusion.

[0030] Step 104: Input the user behavior deviation vector into a preset causal inference model, and use the preset causal inference model to perform causal inference on the user behavior deviation vector to determine the root cause of the user behavior deviation. In step 104, the constructed user behavior deviation vector is input into a pre-set causal inference model. This pre-trained causal inference model is a model capable of analyzing causal relationships between variables from input data. The core of processing the user behavior deviation vector through this model and performing causal inference lies in identifying the root cause of the user's current behavior deviating from its normal pattern—that is, the root cause of the user behavior deviation. The causal inference process may involve analyzing the interactions between elements in the deviation vector and mining the causal relationships between these elements and pre-set potential influencing factors, thereby locating the initial or most critical factor leading to the abnormal behavior.

[0031] Step 105: Determine the smart home control command based on the root cause of the user behavior deviation, and control the corresponding smart home according to the smart home control command.

[0032] In step 105, based on the determined root causes of user behavior deviation, corresponding smart home control instructions are formulated, and the corresponding smart home devices are controlled according to the control instructions.

[0033] In practice, based on the type and nature of the root cause, a control strategy capable of eliminating or mitigating the root cause can be matched from a pre-defined strategy library. For example, if the root cause is excessively high indoor temperature leading to frequent adjustments of the air conditioner, the control strategy might be to set the air conditioner to a more comfortable temperature. Subsequently, based on this control strategy and combined with current environmental data such as current indoor and outdoor temperature and humidity, specific smart home control commands are generated. These commands typically include the identification information of the target control device and the specific operational parameters that the device needs to perform, such as turning it on / off, adjusting it to a certain temperature / brightness, etc. Finally, the generated control commands are sent to the corresponding smart home devices to drive them to perform the corresponding operations, thereby improving the user experience or solving practical problems.

[0034] By acquiring user behavior data, environmental data, and user profiles, comprehensive multi-dimensional information influencing user behavior can be collected, providing a data foundation for subsequent analysis. Based on the behavior data, environmental data, and preset historical behavior data, user behavior deviation characteristics are determined, accurately identifying the differences between the user's current behavior and the usual pattern. By determining the user behavior deviation vector based on the user behavior deviation characteristics, user profile, and environmental data, multi-source heterogeneous deviation information can be transformed into a structured numerical vector, facilitating model processing. The user behavior deviation vector is input into a preset causal inference model, which performs causal reasoning on the deviation vector to determine the root cause of the user behavior deviation. This allows for accurate identification of the root cause of user behavior deviation, overcoming the difficulty in determining the root cause of behavior deviation in existing technologies. Finally, based on the root cause of the user behavior deviation, smart home control commands are determined, and the corresponding smart home devices are controlled according to these commands. Based on accurate root cause analysis, precise control commands can be formulated and executed, achieving smarter and more user-centric automated control of smart home devices, improving user experience and bringing energy-saving benefits.

[0035] Reference Figure 2 The diagram illustrates a flowchart of another embodiment of the smart home control method based on causal inference of the present invention, which may specifically include the following steps: Step 201: Obtain user behavior data, environmental data, and user profiles; The behavioral data may include at least one of the following: user operation records of smart home devices (such as turning lights on and off, adjusting air conditioning temperature), operation time, operation frequency, and operation sequence; the environmental data may include at least one of the following: indoor temperature and humidity, light intensity, outdoor weather information, and indoor activity areas collected by sensors; the user profile may include at least one of the following: user's age, gender, daily routine, device usage preferences, and sensitivity to environmental parameters. This data is collected through various means, including various sensors within the smart home system, device logs, and user configuration information.

[0036] In one embodiment, the behavioral data includes at least one of the following: user operation records of smart home devices, operation time, operation frequency, and operation sequence; the environmental data includes at least one of the following: indoor temperature and humidity, light intensity, outdoor weather information, and indoor activity areas collected by sensors; the user profile includes at least one of the following: user's age, gender, daily routine, device usage preferences, and sensitivity to environmental parameters.

[0037] The behavioral data encompasses a variety of key information about user interactions with the smart home system, including user operation records of smart home devices, such as whether the lights were turned on or off, or the air conditioner temperature was adjusted; the specific time the operation occurred, such as whether it was at 7 a.m. or 10 p.m.; the frequency of specific operations performed by the user, such as the number of times the air purifier was turned on within a week; and the sequence of operations formed by the order in which the user operated the devices, such as opening the curtains first, then turning on the lights, and then starting the coffee machine.

[0038] The environmental data includes various parameters related to the home environment collected by various sensors, including indoor temperature and humidity, which directly affect the user's physical comfort; indoor light intensity, which relates to the use of lighting equipment; outdoor weather information, such as sunny, cloudy, rainy, or snowy days, and the corresponding temperature, which affects the user's operation of devices such as windows, curtains, and air conditioners; in addition, it also includes the activity areas of the people in the room, i.e., whether the user is currently mainly active in the living room, bedroom, or kitchen, which helps to understand the context of the user's behavior.

[0039] The user profile is a comprehensive description of a user's personal characteristics and preferences, including the user's age and gender, which often influence their lifestyle and device usage; the user's daily routine, such as fixed wake-up and bedtimes and commuting patterns, which is crucial for predicting user behavior patterns at specific times; the user's device usage preferences, such as whether they prefer voice control or mobile app control, or a preference for certain brands or models of devices; and the user's sensitivity to environmental parameters, such as whether they are highly sensitive to temperature changes or have special requirements for light intensity, all of which directly affect the user's operating behavior with environmental control devices.

[0040] Step 202: Determine user behavior deviation characteristics based on the behavioral data, the environmental data, and the preset historical behavioral data; Based on the behavioral data, environmental data, and preset historical behavioral data obtained in step 201, user behavior deviation characteristics are determined. Preset historical behavioral data refers to data on the user's typical behavioral patterns under similar environmental conditions within a certain period. Specifically, firstly, based on the historical user behavior data, historical environmental data, and historical user profiles, a preset causal discovery algorithm is used, such as the PC algorithm or FCI algorithm, to generate a preliminary causal graph. This preliminary causal graph reflects the potential causal relationships between variables. Next, based on the preliminary causal graph, the nodes and edges are converted into natural language causal relationship descriptions. Then, based on the natural language causal relationship and a preset domain prompt template, such as "If [cause variable] [changes], how will [outcome variable] change?", target prompts are determined. The target prompts and the preliminary causal graph are input into a preset large language model, such as the GPT series model or LLaMA, which supplements and improves the preliminary causal graph to obtain a supplementary causal graph. To verify the effectiveness of the supplementary causal graph, a pre-defined virtual intervention algorithm, such as DO-calculus, is used in a pre-defined family digital model to assign a specific value to at least one variable in the supplementary causal graph. For example, the "indoor temperature" is set to 30 degrees Celsius, and the responses of other variables, such as "air conditioner on / off status" and "user's perceived comfort," are observed to determine the simulated intervention effect. Then, the edge weights of the supplementary causal graph are adjusted based on the pre-defined historical behavioral data and the simulated intervention effect. For example, if the simulated intervention "increased indoor temperature" leads to a significant increase in the "probability of air conditioner on," the causal edge weights between these two nodes are strengthened, ultimately determining the family causal graph. Based on the family causal graph and the pre-defined historical behavioral data, by analyzing the differences between current behavioral data and historical behavioral patterns on the critical path of the causal graph, the historical user behavior deviation characteristics can be determined, such as "keeping the main light on even when the light intensity is sufficient" or "using the coffee machine outside of the usual routine."

[0041] Step 203: Determine the user behavior deviation vector based on the user behavior deviation features, the user profile, and the environmental data; Based on the user behavior deviation features determined in step 202, the user profile obtained in step 201, and the environmental data, a user behavior deviation vector is determined. Specifically, the historical user behavior deviation features, historical user profiles, and historical environmental data are first vectorized. For example, user behavior deviation features can be converted into binary vectors such as "yes / no" type deviations or numerical vectors such as deviation degree scores. Categorical data in the user profile, such as gender and age group, uses one-hot encoding or embedding techniques; numerical data, such as age and sensitivity scores, is standardized or normalized. Continuous variables in the environmental data, such as temperature and humidity, are also standardized; discrete variables, such as weather conditions, are encoded. This yields historical deviation vectors, historical profile vectors, and historical environmental vectors. Then, the historical deviation vectors, historical profile vectors, and historical environmental vectors are concatenated according to a preset dimensional order, or feature fusion is performed using a fusion model such as a neural network, thereby determining the final historical user behavior deviation vector. This vector integrates multiple information aspects and can be used as input for subsequent causal inference models. When constructing structured input vectors, in addition to vectorizing deviation features, user profiles and environmental data, it is also necessary to add context labels to the vectors, such as time labels (e.g., weekdays / weekends, specific time periods) and location labels (e.g., the user's current room) to provide richer background information.

[0042] Step 204: Input the user behavior deviation vector into a preset causal inference model, and use the preset causal inference model to perform causal inference on the user behavior deviation vector to determine the root cause of the user behavior deviation. The user behavior deviation vector determined in step 203 is input into a preset causal inference model. This preset causal inference model is obtained through pre-training, and its training process includes: acquiring historical user behavior data, historical environment data, historical user profiles, and corresponding user behavior deviation root cause annotation data; determining historical user behavior deviation features based on the historical user behavior data, historical environment data, and preset historical behavior data; determining historical user behavior deviation vectors based on the historical user behavior deviation features, historical user profiles, and historical environment data; and then training an initial causal inference model using the historical user behavior deviation vector as input and the corresponding user behavior deviation root cause annotation data as output labels, thereby obtaining the preset causal inference model. Through this preset causal inference model, causal reasoning is performed on the input user behavior deviation vector. The model analyzes the causal relationships between the features of each dimension in the vector, identifies the root cause that leads to the user's current behavior deviating from its normal pattern, i.e., determines the root cause of the user behavior deviation, such as "insufficient indoor lighting intensity causing the user to turn on the lights prematurely" or "the user frequently adjusting the air conditioner due to excessively high perceived temperature." In one embodiment, the preset causal inference model is trained in the following manner: Acquire historical user behavior data, historical environment data, historical user profiles, and corresponding root cause annotation data for user behavior deviations; determine historical user behavior deviation features based on the historical user behavior data, historical environment data, and preset historical behavior data; determine historical user behavior deviation vectors based on the historical user behavior deviation features, historical user profiles, and historical environment data; train an initial causal inference model using the historical user behavior deviation vectors as input and the corresponding root cause annotation data for user behavior deviations as output labels to obtain the preset causal inference model.

[0043] In this embodiment, the training process of the preset causal inference model is a rigorous supervised learning process. Its core objective is to enable the model to accurately and reliably infer the root cause of the deviation in user behavior from the input user behavior deviation vector.

[0044] The first step in this training process is to systematically acquire various training data for model learning, which together form the foundation for model understanding and learning. Specifically, the training data to be collected includes historical user behavior data. This type of data records in detail various user interactions with the smart home environment over a period of time. For example, it includes records of user switching on and off smart lights, brightness adjustments, temperature settings, mode switching, and fan speed adjustments for air conditioners, control of the opening and closing of smart curtains, and even the usage time and frequency of smart door locks. This data can usually be completely extracted from the device operation logs of the smart home system. At the same time, it is also necessary to acquire historical environmental data, that is, environmental status information within the time period corresponding to the above-mentioned historical user behavior data. This includes indoor environmental parameters such as indoor temperature, humidity, light intensity, and PM2.5 concentration collected by various sensors deployed in the home environment, as well as outdoor weather conditions, such as sunny, rainy, snowy, and temperature, and may even include information on the areas where people are active indoors. Furthermore, historical user profiles are an indispensable component. They encompass individual user characteristics associated with the aforementioned historical user behavior data. This includes relatively static demographic characteristics such as age, gender, and occupation, as well as dynamic or preference characteristics such as users' daily routines (e.g., typical wake-up and sleep times), preferred ranges for indoor temperature and humidity, sensitivity to light intensity, and frequently used device operating habits. Some of this data may be proactively provided by users during initial system setup, while the rest can be obtained through long-term tracking and in-depth analysis of historical behavior data. Most importantly, it is also necessary to obtain corresponding root cause annotation data for user behavior deviations; this is the "standard answer" for model training. For each segment or sample of historical user behavior data, when the system detects a significant deviation from the preset historical normal behavior pattern (i.e., the user's behavioral baseline under normal circumstances), thus forming historical user behavior deviation characteristics, domain experts, using their professional knowledge or through meticulous manual analysis, need to accurately determine and annotate the specific root cause of this particular behavioral deviation. For example, if historical data shows that a user turned off the living room lights two hours later than their usual bedtime on a weekday evening, a comprehensive analysis might identify the root cause as "the user was working overtime in the living room that night because they hadn't finished their work tasks," or "the user forgot to turn off the lights," or "the TV program the user was watching hadn't ended," etc. This precise labeled data directly guides the model in learning the complex mapping relationship between input features and output root causes.

[0045] After obtaining the comprehensive historical data mentioned above, the next key step is to determine the deviation characteristics of historical user behavior based on this data. This step is implemented in a similar way to step 202 described earlier, and the core is to conduct a multi-dimensional and in-depth comparative analysis of the collected historical user behavior data with preset historical behavior data (which may be historical data from earlier periods, or a recognized baseline of normal behavior established through statistical analysis).

[0046] Specifically, the process will follow the methods described in step 202, such as constructing a family causal graph and analyzing critical path differences. For example, firstly, based on historical user behavior data, historical environmental data, and historical user profiles, a preliminary causal graph is generated using a pre-defined causal discovery algorithm (such as the PC algorithm or the FCI algorithm). This graph reflects the potential causal relationships between these variables. Next, the nodes and edges in the preliminary causal graph are converted into causal relationship descriptions in natural language form. Combined with a pre-defined domain cue word template, target cue words are determined and input into a pre-defined large language model. The large language model then supplements and improves the preliminary causal graph with knowledge, resulting in a supplementary causal graph.

[0047] Subsequently, a pre-defined virtual intervention algorithm (such as do-calculus) is used to intervene in the variables of the supplementary causal graph within a pre-defined family digital model. The responses of other variables are observed to determine the simulated intervention effect. The edge weights of the supplementary causal graph are adjusted based on pre-defined historical behavioral data and the simulated intervention effect, ultimately determining the family causal graph. Based on this family causal graph and pre-defined historical behavioral data, the differences between current historical behavioral data and historical normal behavioral patterns on the critical path of the causal graph are analyzed to identify historical instances of user behavior deviation. Corresponding historical user behavior deviation features that characterize these deviation instances are extracted, such as specific abnormal behavioral patterns like "turning on high-brightness lights during daytime when the light intensity is sufficient" or "still using entertainment devices after the set bedtime."

[0048] After obtaining the historical user behavior deviation features, the next step is to determine the historical user behavior deviation vector. This step is similar to the processing in step 203, and its purpose is to convert unstructured or multimodal information into structured numerical vectors that the model can process. In practice, the historical user behavior deviation features, historical user profile data, and historical environmental data obtained in the previous step are vectorized separately. For example, historical user behavior deviation features can be converted into binary vectors to represent "yes / no" type deviations, or into numerical vectors to represent the degree of deviation scores; for categorical data in historical user profiles, such as age groups (youth, middle-aged, elderly) and genders (male, female), one-hot encoding or embedding techniques can be used to convert them into low-dimensional dense vectors; for numerical data, such as specific ages and temperature sensitivity scores, standardization or normalization processing is performed to bring them into a uniform numerical range. Similarly, continuous variables in historical environmental data, such as temperature, humidity, and light intensity, are standardized; discrete variables, such as weather conditions (sunny, cloudy, rainy), are appropriately encoded. Through these processes, historical deviation vectors, historical profile vectors, and historical environment vectors are obtained. These sub-vectors are then concatenated according to a predefined dimensional order, or subjected to deep feature fusion using a specially designed fusion model (such as a small neural network), ultimately determining a comprehensive historical user behavior deviation vector that fully reflects various aspects of historical behavioral deviations.

[0049] Finally, the model training phase begins, specifically training the initial causal inference model. The historical user behavior deviation vectors obtained in the previous steps are used as the model's input features, and the corresponding user behavior deviation root cause annotation data are used as the model's expected output target labels. Using these carefully labeled training sample sets, an initially constructed causal inference model is trained. This initial model can be built based on traditional machine learning algorithms, such as decision trees, random forests, and support vector machines, or more complex deep learning models, such as deep neural networks, recurrent neural networks, and long short-term memory networks. Its specific network structure design should fully consider the need to capture complex causal relationships between variables. During training, the model's parameters (such as the weights and biases of the neural network) are continuously adjusted, and an appropriate loss function (such as the cross-entropy loss function for classification tasks) is used to measure the error between the behavioral deviation root causes predicted by the model based on the input historical user behavior deviation vectors and the manually labeled true root cause data. An optimization algorithm (such as gradient descent) is then used to minimize this error. After multiple rounds of iterative training, the training process is complete when the model's prediction performance on the validation set (evaluation metrics such as accuracy, precision, recall, and F1 score) reaches a preset threshold and stabilizes. The model obtained at this point is the "preset causal inference model," which has learned the mapping pattern between user behavior deviation vectors and root causes of behavior deviations. This enables it to perform causal inference on newly input, unseen user behavior deviation vectors and accurately output the root causes of user behavior deviations.

[0050] In one embodiment, the step of acquiring historical user behavior data, historical environment data, historical user profiles, and corresponding user behavior deviation root cause annotation data includes the following: Determine standardized variables, including: entity variables representing physical objects in the home, concept variables representing environmental states, user behavior, or abstract concepts, and the attributes possessed by the entity variables and concept variables; acquire the historical user behavior data, label the samples in the historical user behavior data that deviate from the preset historical behavior data with the corresponding root causes of user behavior deviation, and determine the user behavior deviation root cause labeling data.

[0051] First, standardized variables need to be identified. These standardized variables are unified abstractions and definitions of various elements in the smart home environment. Specifically, they include: entity variables representing physical objects in the home, such as specific smart home devices like the "living room main light," "master bedroom air conditioner," and "smart curtains"; conceptual variables representing environmental states, user behavior, or abstract concepts, such as "indoor temperature," "light intensity," "user's sleeping status," and "working mode"; and the attributes possessed by these entity and conceptual variables. For example, the attributes of the entity variable "living room main light" may include "on / off status," "brightness value," and "color temperature," while the attributes of the conceptual variable "indoor temperature" may include "temperature value" and "temperature change trend." After identifying these standardized variables, historical user behavior data can be systematically acquired. This data typically comes from the operation logs and sensor records of smart home devices. The acquired historical user behavior data needs to be filtered and analyzed to identify samples that deviate from the preset historical behavior data (i.e., data on users' normal behavior patterns under normal circumstances). Then, for these deviation samples, domain experts or manual analysis are used to label them with the corresponding root causes of user behavior deviation, such as "user working overtime temporarily," "sudden change in ambient light," or "accidental triggering of equipment malfunction." Through this process, the labeled data of the root causes of user behavior deviation are finally determined, providing learning samples with standard answers for the subsequent training of the model.

[0052] In one embodiment, the step of determining the historical user behavior deviation characteristics based on the historical user behavior data, historical environment data, and preset historical behavior data specifically includes the following: Based on the historical user behavior data, the historical environment data, and the historical user profile, a preliminary causal graph is generated using a preset causal discovery algorithm. Natural language causal relationships are determined based on the preliminary causal graph. Target prompts are determined based on the natural language causal relationships and a preset domain prompt word template. The target prompts and the preliminary causal graph are input into a preset large language model to determine a supplementary causal graph. A preset virtual intervention algorithm is used in a preset family digital model to assign specific values ​​to at least one variable in the supplementary causal graph and determine the responses of other variables to determine the simulated intervention effect. The edge weights of the supplementary causal graph are adjusted based on the preset historical behavior data and the simulated intervention effect to determine the family causal graph. Based on the family causal graph and the preset historical behavior data, the historical user behavior deviation characteristics are determined.

[0053] First, based on collected historical user behavior data, historical environmental data, and historical user profiles, a pre-defined causal discovery algorithm is used to analyze the statistical correlations and potential causal relationships between variables in this data, thereby automatically generating a preliminary causal graph. This preliminary causal graph graphically illustrates the possible causal relationships between different variables. Next, based on the structure of nodes and directed edges in this preliminary causal graph, it is transformed into causal relationships described in natural language, such as low indoor light intensity causing users to turn on lights or elevated user body temperature causing users to lower air conditioning temperatures. Then, these causal relationships in natural language form are filled into a pre-defined domain cue word template to form target cue words. This template contains instructions to guide the large language model in knowledge supplementation, relationship verification, or logical reasoning. Subsequently, the generated target cue words and preliminary causal graph are combined... Figure 1 The input is fed into a pre-defined large language model. Leveraging the model's powerful knowledge base and reasoning capabilities, the initial causal graph is reviewed, supplemented, and refined. This includes adding missing causal relationships, correcting unreasonable causal directions, or refining causal paths, resulting in a more comprehensive and accurate supplementary causal graph. Next, a pre-defined virtual intervention algorithm is used in a pre-defined family digital model to assign a specific intervention value to at least one key variable in the supplementary causal graph. For example, outdoor light intensity is forcibly set to extremely low. The resulting response changes in other relevant variables in the family digital model are observed and recorded to determine the simulated intervention effect. Following this, a comparative analysis is performed based on pre-defined historical behavioral data and the simulated intervention effect to evaluate the contribution and accuracy of each causal path in the supplementary causal graph in explaining normal behavioral patterns. Based on this, the weights of corresponding edges in the supplementary causal graph are adjusted, strengthening causal relationships that highly match actual behavioral patterns and weakening or removing those that do not. Finally, a family causal graph that accurately reflects the strength of causal interactions between variables in the family environment is determined. Finally, based on this optimized and verified family causal graph, and the normal behavioral benchmark represented by the preset historical behavioral data, we analyze which behavioral patterns in the historical user behavior data deviate significantly from the normal benchmark, and what abnormal causal paths or variable states these deviations correspond to in the family causal graph, thereby accurately determining the deviation characteristics of the historical user behavior.

[0054] In one embodiment, the step of determining the historical user behavior deviation vector based on the historical user behavior deviation features, the historical user profile, and the historical environmental data specifically includes the following: The historical user behavior deviation features, the historical user profile, and the historical environment data are vectorized to obtain the historical deviation vector, the historical profile vector, and the historical environment vector; the historical user behavior deviation vector is determined based on the historical deviation vector, the historical profile vector, and the historical environment vector.

[0055] First, the three types of data—historical user behavior deviation features, historical user profiles, and historical environmental data—from different sources and with different properties, need to be vectorized. The purpose of this step is to convert various unstructured or structured but inconsistently formatted information into numerical vector forms that computers can understand and process.

[0056] For historical user behavior deviation features, these features might describe abnormal user behavior, such as "turning on bright lights during a well-lit day" or "using entertainment devices after bedtime." Various encoding methods can be used to transform these features into historical deviation vectors. For example, each possible deviation feature can be treated as an independent dimension; if a sample exhibits the deviation, that dimension has a value of 1, otherwise 0, forming a binary vector. Alternatively, for features whose degree of deviation can be quantified, a numerical score representing the severity of the deviation can be assigned, forming a numerical vector.

[0057] Historical user profiles contain various user attributes such as age, gender, occupation, daily routine, and temperature preferences. When processing this type of data, it's crucial to select an appropriate vectorization method based on the attribute type. For categorical data, such as age groups (youth, middle-aged, elderly) or gender (male, female), one-hot encoding can be used to convert it into a vector with only one dimension equal to 1 and all other dimensions equal to 0. Alternatively, embedding techniques can be used to map it to a low-dimensional, dense vector space to better capture the semantic relationships between categories. For numerical data, such as specific ages or numerical temperature preferences, standardization or normalization is typically performed to adjust the numerical range to a uniform interval (e.g., between 0 and 1, or a standard normal distribution with a mean of 0 and a standard deviation of 1) to eliminate the influence of different units on model training, ultimately forming the historical profile vector.

[0058] Historical environmental data, including indoor and outdoor temperature, humidity, light intensity, PM2.5 concentration, and weather conditions, also needs to be vectorized. For continuous environmental variables, such as temperature and humidity, standardization or normalization similar to that used for numerical data in user profiles is employed. For discrete environmental variables, such as weather conditions (sunny, cloudy, rainy, snowy), encoding methods similar to those used for categorical user profile data, such as one-hot encoding or embedding, can be used to obtain historical environmental vectors.

[0059] After obtaining the historical deviation vector, historical profile vector, and historical environment vector, the next step is to determine the final historical user behavior deviation vector based on these three sub-vectors. There are several ways to achieve this: a common method is to simply concatenate the three sub-vectors in a predetermined order to form a longer vector. This method is simple and direct, but may not consider the interaction relationships between different sub-vectors. Another more complex but potentially more effective method is to perform deep feature fusion of these three sub-vectors using a specially designed fusion model (such as a small neural network, like a multilayer perceptron). This fusion model can learn the complex nonlinear relationships between different types of features, integrating them into a more representative comprehensive vector. Through this process, a final historical user behavior deviation vector that comprehensively and effectively represents the historical user behavior deviation and its related influencing factors is determined.

[0060] Step 205: Based on the root cause of the user behavior deviation, at least one target control strategy is matched from a preset root cause-control strategy mapping library. The target control strategy is used to eliminate or mitigate the root cause of the user behavior deviation. Based on the root causes of user behavior deviations identified in step 204, a search and matching process is performed from a pre-defined root cause-control strategy mapping library to obtain at least one target control strategy. This root cause-control strategy mapping library pre-stores mapping relationships between various common user behavior deviation root causes and their corresponding control strategies. The core purpose of the target control strategy is to eliminate or mitigate the identified user behavior deviation root causes. For example, if the root cause is "insufficient indoor lighting intensity," control strategies such as "automatically open curtains" or "brighten indoor lights" may be matched; if the root cause is "feeling temperature too high," control strategies such as "lower air conditioner set temperature" or "start fan" may be matched.

[0061] For example, after matching the target control strategy, the strategy generation module calls a preset large language model and combines it with user profiles (such as the user's sensitivity to disturbances, common tone of voice, etc.) to transform the target control strategy into natural language suggestions that match the user's preferences. For example, for users who prefer a concise style, the system might generate: 'We detected that you are still in the living room. Should we turn on the bedroom air conditioner for you later?' For optimization strategies with high confidence and no user confirmation required (such as energy-saving scenarios), the system will execute them directly and generate informative natural language; for strategies that require user confirmation, the system will present the natural language suggestion to the user. The system will record the user's feedback on the suggestions (such as agreement, rejection, or ignoring) and use this feedback data to optimize future strategy generation and the root cause-control strategy mapping library through reinforcement learning and other methods, achieving continuous iteration and personalization of strategies.

[0062] Step 206: Based on the target control strategy and the current environmental data, determine the smart home control command, which includes the target device identifier and the corresponding control parameters; Based on the target control strategy obtained in step 205 and the current environmental data, specific smart home control commands are determined. The current environmental data provides a real-time basis for setting control parameters, such as current indoor temperature, humidity, and light intensity. The control commands need to explicitly include two key pieces of information: first, the target device identifier, i.e., the unique identifier of the smart home device to be controlled, such as "living room main light" or "master bedroom air conditioner"; second, the corresponding control parameters, i.e., the specific operation commands that the target device needs to execute, such as "turn on, brightness 80%", "cooling mode, temperature 24 degrees Celsius", or "fan speed level 3". By refining the target control strategy in conjunction with the current environmental data, the accuracy and applicability of the control commands are ensured.

[0063] For example, before determining the target control strategy and preparing to generate control commands, the system performs multimodal context fusion judgment and combines dynamic thresholds to decide whether to execute the strategy. First, the threshold for intervention is not fixed. For example, on weekends or holidays, user behavior is more variable, and the system dynamically increases the deviation detection threshold to reduce unnecessary inquiries or controls. Simultaneously, the system does not act rashly based on a single root cause but integrates various contextual information for analysis. For instance, the system detects that the user did not turn on the air conditioner at their usual time (behavioral deviation root cause), but simultaneously detects that the bedroom is empty (spatial context), the user's phone is in the living room (device context), and the TV is playing in the living room (environmental context). In this case, the system comprehensively judges that 'the user may still be active in the living room,' thus suppressing the generation and sending of the control command to avoid disturbing the user. Conversely, if someone is in the bedroom and the environment is stuffy, it is considered a valid service opportunity, and the system continues to generate and send control commands. Step 207: Send the smart home control command to the smart home device corresponding to the target device identifier to control the smart home device to perform the corresponding operation.

[0064] The smart home control command generated in step 206 is sent to the smart home device corresponding to the target device identifier via the smart home system's communication network (such as Wi-Fi, Bluetooth, Zigbee, etc.). Upon receiving the control command, the smart home device parses the command content and executes the corresponding operation, thereby achieving automatic control of the smart home device to eliminate or mitigate the root causes of user behavior deviations and improve the user experience.

[0065] The following detailed description of the causal inference-based smart home control method of the present invention is illustrated with a specific scenario example: In one scenario, a user typically turns on the bedroom air conditioner at 10:15 PM (±15 minutes) on weekdays and sets the temperature to 26°C. On a Wednesday evening, at 10:50 PM, the system detects activity in the bedroom using millimeter-wave radar, but the air conditioner is still off, and the current indoor temperature is 29°C.

[0066] The system has initially constructed a preliminary causal graph based on historical user behavior data, historical environmental data, and historical user profiles, using a pre-defined causal discovery algorithm (such as the PC algorithm). This graph includes variables such as "outdoor temperature," "whether anyone is in the bedroom," "air conditioner on / off status," "air conditioner set temperature," and "actual indoor temperature." To further refine this causal graph, the system constructs target prompts using pre-defined prompt templates based on the current context information ("summer," "night," "someone in the bedroom"). For example, an extended prompt example is: "In a home environment, the variables 'outdoor temperature' and 'air conditioner on / off status' are statistically correlated. The current context is: summer night, user activity in the bedroom. Please determine the causal direction between the two based on common sense and briefly explain your reasoning. Options: A) Outdoor temperature → Air conditioner on / off status; B) Air conditioner on / off status → Outdoor temperature." The target prompts and the preliminary causal graph are input into a pre-defined large language model. The large model returns result "A," with the reason that "outdoor temperature is the reason that affects whether the user feels hot and decides to turn on the air conditioner, while turning on the air conditioner is the result." Based on this, the system determines the causal direction as "outdoor temperature → air conditioner on / off status." Simultaneously, the large model proactively supplemented the hypothesis that "user location" is another possible reason for "air conditioner on / off status" ("if the user is not in the bedroom, the air conditioner may not be turned on"). The system incorporated this as a new causal hypothesis into the causal graph for further verification. After this stage, the system obtained a supplementary causal graph with a clear causal direction, which has been validated and enhanced by common sense.

[0067] Then, the system, through its behavior recognition module, compares current behavior data (air conditioner not on), environmental data (indoor temperature 29℃, someone in the bedroom) with preset historical behavior data (air conditioner turned on at 10:15±15 PM on weekdays) to identify a significant user behavior deviation: "air conditioner not turned on at the usual time." Root cause analysis: The system calls a preset causal inference model to calculate the probability of various root cause hypotheses that could lead to this behavioral deviation being true on the current supplementary causal graph. An example analysis is as follows: P(root cause "outdoor temperature is suitable" | current outdoor temperature 28℃) = 20%; P(root cause "user has not yet entered the bedroom" | user is in the living room) = 65%; P(root cause "air conditioner malfunction" | air conditioner has no recent malfunction records) = 5%.

[0068] To verify the most probable cause, "the user is in the living room," the system simulated intervention in a pre-defined family digital model using a preset virtual intervention algorithm (such as do-calculus). Specifically, it simulated the state of "user location = bedroom," observing a significant increase in the probability of "air conditioner on / off status = on." This simulated intervention effect indirectly confirmed the strength of the causal path from user location to air conditioner on / off status. Based on this, the system adjusted the edge weights of this path in the causal graph. Through causal reasoning and intervention verification, the system determined that the most likely root cause of the current user behavior deviation is "the user is currently still active in the living room."

[0069] Based on the identified root cause "user activity in the living room" and the user profile's target preferences of "energy saving and comfort," the system matches data from a pre-defined root cause-control strategy mapping library. A rule matched in the strategy library might be: "IF Root Cause = 'User activity in room A' AND Target device located in room B AND System predicts user intention to enter room B (e.g., user moving towards room B) THEN Strategy = 'Delay turning on the target device, pre-starting it before the user enters room B'."

[0070] Once determined, the system inputs the matched structured strategy instructions, along with user profile interaction preferences (such as a preference for a minimalist style), into a pre-defined large language model to generate natural language suggestions that match the user's preferences. For example: "We've detected that you're still in the living room, and we expect you to enter the bedroom in 10 minutes. Should we automatically turn on the bedroom air conditioner to 26°C at that time?" If the user confirms their consent via voice or app, the system starts a countdown and sends a command to the bedroom air conditioner to turn it on and set the temperature to 26°C before the predicted time when the user enters the bedroom.

[0071] By acquiring user behavior data, environmental data, and user profiles, comprehensive multi-dimensional information influencing user behavior can be collected, providing a data foundation for subsequent analysis. Based on the behavior data, environmental data, and preset historical behavior data, user behavior deviation characteristics are determined, accurately identifying the differences between the user's current behavior and the usual pattern. By determining the user behavior deviation vector based on the user behavior deviation characteristics, user profile, and environmental data, multi-source heterogeneous deviation information can be transformed into a structured numerical vector, facilitating model processing. The user behavior deviation vector is input into a preset causal inference model, which performs causal reasoning on the deviation vector to determine the root cause of the user behavior deviation. This allows for accurate identification of the root cause of user behavior deviation, overcoming the difficulty in determining the root cause of behavior deviation in existing technologies. Finally, based on the root cause of the user behavior deviation, smart home control commands are determined, and the corresponding smart home devices are controlled according to these commands. Based on accurate root cause analysis, precise control commands can be formulated and executed, achieving smarter and more user-centric automated control of smart home devices, improving user experience and bringing energy-saving benefits.

[0072] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0073] Reference Figure 3 The diagram shows a structural block diagram of an embodiment of a smart home control device based on causal inference according to the present invention, the details of which are as follows: Data acquisition module 301 is used to acquire user behavior data, environmental data, and user profiles; User behavior deviation feature determination module 302 is used to determine user behavior deviation features based on the behavior data, the environmental data and preset historical behavior data; User behavior deviation vector determination module 303 is used to determine the user behavior deviation vector based on the user behavior deviation features, the user profile, and the environmental data; User behavior deviation root cause determination module 304 is used to input the user behavior deviation vector into a preset causal inference model, and perform causal inference on the user behavior deviation vector through the preset causal inference model to determine the root cause of user behavior deviation. The smart home control module 305 is used to determine smart home control commands based on the root causes of user behavior deviations, and to control the corresponding smart home devices according to the smart home control commands.

[0074] In one embodiment, the preset causal inference model is trained through the following modules: The historical data acquisition submodule is used to acquire historical user behavior data, historical environment data, historical user profiles, and corresponding root cause annotation data of user behavior deviations. The historical user behavior deviation feature determination submodule is used to determine the historical user behavior deviation features based on the historical user behavior data, historical environment data, and preset historical behavior data. The historical user behavior deviation vector determination submodule is used to determine the historical user behavior deviation vector based on the historical user behavior deviation characteristics, the historical user profile, and the historical environmental data. The preset causal inference model determination submodule is used to train an initial causal inference model by taking the historical user behavior deviation vector as input and the corresponding user behavior deviation root cause labeling data as output labels, so as to obtain the preset causal inference model.

[0075] In one embodiment, the historical data acquisition submodule includes: A standardized variable determination unit is used to determine standardized variables, which include: entity variables representing physical objects in the household, concept variables representing environmental states, user behaviors, or abstract concepts, as well as the attributes possessed by the entity variables and concept variables; The user behavior deviation root cause labeling data determination unit is used to acquire the historical user behavior data, label the user behavior deviation root causes corresponding to the samples in the historical user behavior data that deviate from the preset historical behavior data, and determine the user behavior deviation root cause labeling data.

[0076] In one embodiment, the historical user behavior deviation feature determination submodule includes: The preliminary causal graph determination unit is used to generate a preliminary causal graph based on the historical user behavior data, the historical environment data, and the historical user profile, using a preset causal discovery algorithm. The causal relationship determination unit is used to determine natural language causal relationships based on the preliminary causal graph. The target prompt word determination unit is used to determine target prompt words based on the natural language causal relationship and the preset domain prompt word template; The supplementary causal graph determination unit is used to input the target prompt word and the preliminary causal graph into a preset large language model to determine the supplementary causal graph; The simulated intervention effect determination unit is used to assign a specific value to at least one variable in the supplementary causal graph and determine the response of other variables in a preset family digital model through a preset virtual intervention algorithm, so as to determine the simulated intervention effect. The family causal graph determination unit is used to adjust the edge weights of the supplementary causal graph based on the preset historical behavioral data and the simulated intervention effect, and to determine the family causal graph. The user behavior deviation feature determination unit is used to determine the historical user behavior deviation features based on the family causal graph and preset historical behavior data.

[0077] In one embodiment, the historical user behavior deviation vector determination submodule includes: The vectorization processing unit is used to vectorize the historical user behavior deviation features, the historical user profile, and the historical environment data respectively to obtain historical deviation vector, historical profile vector, and historical environment vector. The historical user behavior deviation vector comprehensive determination unit is used to determine the historical user behavior deviation vector based on the historical deviation vector, the historical profile vector, and the historical environment vector.

[0078] In one embodiment, the smart home control module includes: The target control strategy determination submodule is used to match at least one target control strategy from a preset root cause-control strategy mapping library based on the root cause of the user behavior deviation. The target control strategy is used to eliminate or mitigate the root cause of the user behavior deviation. The smart home control command determination submodule is used to determine smart home control commands based on the target control strategy and current environmental data. The control commands include the target device identifier and the corresponding control parameters. The smart home control submodule is used to send the smart home control command to the smart home device corresponding to the target device identifier, so as to control the smart home device to perform corresponding operations.

[0079] The smart home control device based on causal inference in this invention can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This invention does not impose specific limitations.

[0080] The smart home control device based on causal inference in this embodiment of the invention can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this embodiment of the invention does not impose specific limitations.

[0081] The smart home control device based on causal inference provided in this invention can achieve... Figures 1 to 2 The various processes implemented by the smart home control device based on causal inference in the method embodiments will not be described again here to avoid repetition.

[0082] By acquiring user behavior data, environmental data, and user profiles, comprehensive multi-dimensional information influencing user behavior can be collected, providing a data foundation for subsequent analysis. Based on the behavior data, environmental data, and preset historical behavior data, user behavior deviation characteristics are determined, accurately identifying the differences between the user's current behavior and the usual pattern. By determining the user behavior deviation vector based on the user behavior deviation characteristics, user profile, and environmental data, multi-source heterogeneous deviation information can be transformed into a structured numerical vector, facilitating model processing. The user behavior deviation vector is input into a preset causal inference model, which performs causal reasoning on the deviation vector to determine the root cause of the user behavior deviation. This allows for accurate identification of the root cause of user behavior deviation, overcoming the difficulty in determining the root cause of behavior deviation in existing technologies. Finally, based on the root cause of the user behavior deviation, smart home control commands are determined, and the corresponding smart home devices are controlled according to these commands. Based on accurate root cause analysis, precise control commands can be formulated and executed, achieving smarter and more user-centric automated control of smart home devices, improving user experience and bringing energy-saving benefits.

[0083] 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 embodiment of a smart home control method based on causal inference and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0084] This invention also provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the various processes of the above-described embodiment of a smart home control method based on causal inference and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0085] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

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

[0087] 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, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0088] 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 based on causal inference, characterized in that, The method includes: Acquire user behavior data, environmental data, and user profiles; Based on the behavioral data, the environmental data, and the preset historical behavioral data, user behavior deviation characteristics are determined; Based on the user behavior deviation characteristics, the user profile, and the environmental data, determine the user behavior deviation vector; The user behavior deviation vector is input into a preset causal inference model, and the user behavior deviation vector is subjected to causal inference through the preset causal inference model to determine the root cause of the user behavior deviation. Based on the root cause of the user behavior deviation, determine the smart home control command, and control the corresponding smart home according to the smart home control command.

2. The smart home control method based on causal inference according to claim 1, characterized in that, The preset causal inference model is trained in the following manner: Acquire historical user behavior data, historical environment data, historical user profiles, and corresponding root cause annotation data for user behavior deviations; Based on the historical user behavior data, historical environment data, and preset historical behavior data, the deviation characteristics of historical user behavior are determined; Based on the historical user behavior deviation characteristics, the historical user profile, and the historical environmental data, determine the historical user behavior deviation vector; Using the historical user behavior deviation vector as input and the corresponding user behavior deviation root cause labeling data as output label, an initial causal inference model is trained to obtain the preset causal inference model.

3. The smart home control method based on causal inference according to claim 2, characterized in that, The acquisition of historical user behavior data, historical environment data, historical user profiles, and corresponding root cause annotation data for user behavior deviations includes: Determine standardized variables, which include: entity variables representing physical objects in the household, concept variables representing environmental states, user behaviors, or abstract concepts, as well as the attributes possessed by the entity variables and concept variables; Obtain the historical user behavior data, label the user behavior deviation root causes corresponding to the samples in the historical user behavior data that deviate from the preset historical behavior data, and determine the user behavior deviation root cause labeling data.

4. The smart home control method based on causal inference according to claim 2, characterized in that, The step of determining historical user behavior deviation characteristics based on the historical user behavior data, historical environment data, and preset historical behavior data includes: Based on the historical user behavior data, the historical environment data, and the historical user profile, a preliminary causal graph is generated using a preset causal discovery algorithm; Based on the preliminary causal graph, determine the causal relationships in natural language; Based on the natural language causal relationships and the preset domain prompt word template, the target prompt word is determined; Input the target prompt words and the preliminary causal graph into a preset large language model to determine the supplementary causal graph; By using a preset virtual intervention algorithm in a preset family digital model, at least one variable in the supplementary causal graph is assigned a specific value and the responses of other variables are determined, so as to determine the effect of the simulated intervention. The edge weights of the supplementary causal graph are adjusted based on the preset historical behavioral data and the simulated intervention effect to determine the family causal graph; Based on the family causal diagram and preset historical behavior data, the deviation characteristics of the historical user behavior are determined.

5. The smart home control method based on causal inference according to claim 2, characterized in that, The step of determining the historical user behavior deviation vector based on the historical user behavior deviation characteristics, the historical user profile, and the historical environmental data includes: The historical user behavior deviation features, the historical user profiles, and the historical environment data are vectorized to obtain historical deviation vectors, historical profile vectors, and historical environment vectors, respectively. The historical user behavior deviation vector is determined based on the historical deviation vector, the historical profile vector, and the historical environment vector.

6. The smart home control method based on causal inference according to claim 1, characterized in that, The step of determining smart home control commands based on the root causes of user behavior deviations, and controlling the corresponding smart home devices according to the smart home control commands, includes: Based on the root cause of the user behavior deviation, at least one target control strategy is matched from a preset root cause-control strategy mapping library. The target control strategy is used to eliminate or mitigate the root cause of the user behavior deviation. Based on the target control strategy and current environmental data, a smart home control command is determined, which includes the target device identifier and the corresponding control parameters. The smart home control command is sent to the smart home device corresponding to the target device identifier to control the smart home device to perform the corresponding operation.

7. The smart home control method based on causal inference according to claim 1, characterized in that, The behavioral data includes at least one of the following: user operation records of smart home devices, operation time, operation frequency, and operation sequence; the environmental data includes at least one of the following: indoor temperature and humidity, light intensity, outdoor weather information, and indoor activity areas collected by sensors; the user profile includes at least one of the following: user's age, gender, daily routine, device usage preferences, and sensitivity to environmental parameters.

8. A smart home control device based on causal inference, characterized in that, The device includes: The data acquisition module is used to acquire user behavior data, environmental data, and user profiles; The user behavior deviation feature determination module is used to determine user behavior deviation features based on the behavior data, the environmental data, and preset historical behavior data. The user behavior deviation vector determination module is used to determine the user behavior deviation vector based on the user behavior deviation features, the user profile, and the environmental data. The user behavior deviation root cause determination module is used to input the user behavior deviation vector into a preset causal inference model, and perform causal inference on the user behavior deviation vector through the preset causal inference model to determine the root cause of the user behavior deviation. The smart home control module is used to determine smart home control commands based on the root causes of user behavior deviations, and to control the corresponding smart home devices according to the smart home control commands.

9. 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 when the program or instructions are executed by the processor, they implement the steps of the smart home control method based on causal inference as described in claims 1-7.

10. 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 based on causal inference as described in claims 1-7.