A smart home control method and system

By using a two-level state machine to judge multiple event signals and room topology relationships, combined with a strong learning mechanism for user actions, the misjudgment problem in smart home control is solved, and accurate identification of user status and room is achieved, thereby improving the automation level and user experience of smart homes.

CN121325638BActive Publication Date: 2026-04-07SHANDONG BITTEL INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing smart home control methods rely on a single trigger signal, which can easily misjudge the user's status, fail to accurately reflect the actual occupancy, lack comprehensive consideration of spatial paths and user habits, resulting in control that does not conform to real usage scenarios, and lack coordinated management of smart home functions such as curtains, fresh air, dehumidification, and volume.

Method used

By combining multiple types of event signals with room topology, a two-level state machine is used to determine the user's state. A strong learning mechanism for user actions is introduced, and a context vector and a dual-track mechanism are used to select control commands, thereby achieving more stable and user-friendly smart home control.

Benefits of technology

It improves the stability of occupancy detection and room positioning, gradually adapts to user habits, and quickly adapts to seasonal changes or sudden scene changes, enhancing the reliability and personalization of smart homes and ensuring long-term stable operation in the home environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121325638B_ABST
    Figure CN121325638B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of smart home control, and discloses a control method and system for a smart home, which comprises the following steps: acquiring an event signal and a room topology relationship, and performing normalization processing on the event signal; performing judgment of a two-stage state machine according to the event signal and the room topology relationship, wherein the two-stage state machine comprises an entry-level state machine and a room-level state machine; the entry-level state machine judges an in-house state and an out-of-house state of a user, and the room-level state machine is triggered when the entry-level state machine judges that the in-house state is achieved; the room-level state machine judges a room where the user is located; a control instruction set is generated according to the room topology relationship, user feedback is acquired, and a control instruction is selected and executed from the control instruction set through a double-track mechanism according to a judgment result of the two-stage state machine and the user feedback, so that the control of the smart home is realized. The method has reliability, intelligence and expandability, can realize long-term stable operation in an actual home environment, and has outstanding application value.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of smart home control, in particular to a control method and system of smart home. BACKGROUND

[0002] The existing smart home control mostly relies on a single trigger signal, such as detecting whether there is a person through a passive infrared sensor (PIR) in the room, or inferring whether the user is at home through the network status of the mobile phone. This kind of control method based on a single event has obvious shortcomings: on the one hand, the PIR is easily affected by pets, light or installation position and mis-triggered, resulting in the system incorrectly turning on or off the smart home; on the other hand, the network status of the mobile phone cannot accurately reflect the real occupancy, and the mobile phone may be disconnected from the network in the home, or the user's temporary visitor has not connected to the network, which will cause misjudgment. In addition, although the door magnet can reflect the opening action, it still cannot accurately distinguish between the in-house state and the out-of-house state without the coordination of other signals.

[0003] In actual use, the control of most smart homes is still limited to simple rules such as "turn on the light when there is a person, turn off the light when there is no person" or "start the air conditioner when the temperature exceeds the threshold", lacking comprehensive consideration of space path and user habits, which easily leads to control that does not conform to the real use scenario. At the same time, the existing control is mostly fixed on lighting and air conditioning, lacking coordinated management of smart home such as curtains, fresh air, dehumidification, and volume. Users often need to manually adjust the smart home, and the system cannot learn from these manual operations, so it cannot gradually adapt to the actual preferences of the user.

[0004] Therefore, a method is needed that can combine multiple event signals, make a two-level state machine judgment based on the room topology relationship, and introduce a user action reinforcement learning mechanism on this basis, so as to realize more stable and user habit-adapted smart home control. SUMMARY

[0005] In view of the above problems, the present application is proposed.

[0006] To solve the above technical problems, the present application provides the following technical solutions: a control method of smart home, comprising: acquiring event signals and room topology relationship, and performing normalization processing on the event signals;

[0007] performing a two-level state machine judgment according to the event signals and the room topology relationship, the two-level state machine comprising an in-house level state machine and a room level state machine, the in-house level state machine judging the in-house state and the out-of-house state of the user, the room level state machine being triggered when the in-house level state machine judges the in-house state, and the room level state machine judging the room where the user is located;

[0008] The control instruction set is generated according to the room topological relation, user feedback is acquired, and the control instruction is selected and executed from the control instruction set through a double-track mechanism according to the judgment result of the two-stage state machine and the user feedback, so that the control of the smart home is realized.

[0009] As a preferred scheme of the smart home control method, the event signals include a mobile phone online event signal, an entrance door magnet opening and closing event signal, and a passive infrared triggering event signal.

[0010] The room topological relation includes obtaining a house structure, abstracting the house structure into a point-line graph to obtain the room topological relation, points representing rooms and lines representing corridors between the rooms, marking smart home types and smart home positions in the room topological relation according to the house structure, and positioning a triggering position of the passive infrared triggering event signal according to the room topological relation.

[0011] As a preferred scheme of the smart home control method, the normalization processing of the event signals includes converting the event signals into standardized records containing time stamps, source types, and binary state values.

[0012] The binary state values are uniformly represented by 0 / 1, for the mobile phone online event signal, the mobile phone online is 1 and the mobile phone offline is 0.

[0013] The entrance door magnet event signal is recorded as 1 when the door is in an open state and as 0 when the door is in a closed state.

[0014] The passive infrared triggering event signal is recorded as 1 when triggered and as 0 when not triggered.

[0015] As a preferred scheme of the smart home control method, the entrance-level state machine judges the in-house state and the out-of-house state of the user, including, in the out-of-house state, when detecting that the entrance door magnet event signal changes from 0 to 1 at a time t1, in the entrance observation interval t1

[0016] If the mobile phone online event signal is 1, the in-house state is judged.

[0017] If the passive infrared triggering event signal is 1, the in-house state is judged.

[0018] After the in-house state is judged, a control instruction is issued and the room-level state machine is triggered.

[0019] In the in-house state, when detecting that the entrance door magnet event signal changes from 0 to 1 at a time t2, in the interval t2

[0020] If the passive infrared trigger event signal is always 0, and the mobile phone in-network event signal detects 0, it is determined that the user is away from home;

[0021] After determining that the user is away from home, a control instruction is sent out;

[0022] wherein, represents the time point of triggering of the passive infrared trigger event signal; represents the determination time of the in-home state machine, which is a fixed value set by the user.

[0023] As a preferred scheme of the intelligent home control method, the room-level state machine determines the room in which the user is located, including setting the room in which the user is located as the entrance when triggering the room-level state machine, and marking the adjacent room of the room A in which the user is located as B according to the room topology relationship and the passive infrared trigger event signal;

[0024] When the passive infrared trigger event signal in B is 1, the determination is performed in the moving observation interval .

[0025] If the passive infrared trigger event signal in B is 1 again, it is determined that the user is moving, the room in which the user is located is set as B, and a control instruction is sent out;

[0026] If the passive infrared trigger event signal in A is 1, the determination of the room-level state machine is interrupted, the room in which the user is located is still A, and no control instruction is sent out;

[0027] wherein, represents the time point of triggering of the passive infrared trigger event signal; A represents the room in which the user is located; and B represents the adjacent room of the room in which the user is located; represents the determination time of the room-level state machine, which is a fixed value set by the user.

[0028] As a preferred scheme of the intelligent home control method, the user feedback is obtained, including establishing a user feedback window for each intelligent home , and taking the operation of the user on the intelligent home in the user feedback window as the user feedback;

[0029] wherein, represents the time point of adjusting the intelligent home i according to the control instruction; represents the user feedback time of the intelligent home i, which is a fixed value set according to the type of the intelligent home;

[0030] The user feedback includes the affirmation and the revocation of the user to the control instruction, the revocation is that the user makes a reverse adjustment to the control instruction in the user feedback window, and the affirmation is that the user makes a positive adjustment to the control instruction in the user feedback window.

[0031] As a preferred scheme of the intelligent home control method, wherein: the selecting and executing a control instruction from the control instruction set according to the judgment result of the two-level state machine and the user feedback comprises constructing a context vector , comprising an in-home state, an out-of-home state and a user's room, initializing a strategy parameter vector of each candidate control instruction a in the control instruction set to 0, calculating a linear score of a according to the context vector and the strategy parameter vector of a, selecting and executing a control instruction through a double-track mechanism of a main track and a shadow track, the main track comprising:

[0032] performing a deterministic maximization selection in the control instruction set:

[0033] ;

[0034] wherein, represents the control instruction selected and executed at time t, corresponding to a gear of the intelligent home; represents a candidate control instruction a in the control instruction set that maximizes ; represents the linear score of a;

[0035] issuing the control instruction and executing, calculating a reward of the control instruction according to the user feedback, the reward being 1 when the user feedback is positive and -1 when the user feedback is withdrawn, updating the strategy parameter vector of according to the reward of the control instruction , the updated strategy parameter vector being used for the linear score calculation of next time the control instruction is selected, and the update formula of the strategy parameter vector is:

[0036] ;

[0037] wherein, represents an assignment symbol; represents the strategy parameter vector of the control instruction ; η represents a learning rate; represents the user feedback, i.e. 1 or -1; the updated strategy parameter vector is used for the linear score calculation of next time the control instruction is selected;

[0038] the shadow track comprising:

[0039] according to the linear score and the executed control instruction The shadow track action set is constructed, and the shadow track action set includes a reverse first, a boundary exchange item, an adjacent weakening item and an adjacent strengthening item, the reverse first is a control instruction with the minimum linear score, the boundary exchange item is a control instruction with the second largest linear score, the adjacent weakening item is a control instruction corresponding to the previous gear of the smart home of the executed control instruction, and the adjacent strengthening item is a control instruction corresponding to the next gear of the smart home of the executed control instruction;

[0040] According to the control instruction The reward of the shadow track action set is calculated according to the user feedback, when the control instruction a` in the shadow track action set is affirmed by the user feedback, and the user feedback of the executed control instruction When the same context vector is directly executed in the next time, wherein a` represents the control instruction in the shadow track action set.

[0041] If multiple control instructions in the shadow track action set are affirmed, the priority is reverse first> boundary exchange item> adjacent weakening item> adjacent strengthening item, and the control instruction a` with higher priority is executed in the next time with the same context vector .

[0042] When no control instruction in the shadow track action set is affirmed, or a` and are affirmed at the same time, the control instruction is not replaced, and the main track is executed.

[0043] A control system of a smart home adopting any method of the present application, wherein: a collection module acquires an event signal and a room topology relationship, and performs normalization processing on the event signal;

[0044] A judgment module performs judgment of a two-level state machine according to the event signal and the room topology relationship, the two-level state machine includes a home-level state machine and a room-level state machine, the home-level state machine judges an in-home state and an out-of-home state of a user, and the room-level state machine is triggered when the home-level state machine judges the in-home state, and the room-level state machine judges a room in which the user is located;

[0045] A control module generates a control instruction set according to the room topology relationship, acquires user feedback, and selects and executes a control instruction from the control instruction set through a double-track mechanism according to a judgment result of the two-level state machine and the user feedback, so as to realize control of the smart home.

[0046] The method of the present application overcomes the misjudgment problem caused by single sensor triggering or mobile phone network exception, and improves the stability of occupancy detection and room positioning. On this basis, a user action reinforcement learning mechanism is introduced, the manual operation of the user is taken as a feedback signal, and the action strategy parameters are updated online, so that the control result gradually fits the real use habit. At the same time, a double-track mechanism of main track and shadow track is designed, when the user denies the main track instruction but affirms the shadow track candidate, the system can directly use the affirmed shadow instruction in the next similar scene, so as to realize rapid adaptation to seasonal switching or scene mutation, and make up for the lag of the main track progressive learning. Through the complementation of progressive learning and rapid replacement, the present application is enhanced in reliability, intelligence and personalization, and can be stably operated in a home environment for a long time, and has outstanding application value. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0048] Figure 1 The overall flowchart of the control method of the smart home provided in Embodiment 1 of the present application. DETAILED DESCRIPTION

[0049] In order to make the above-mentioned purposes, features and advantages of the present application more apparent and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the protection scope of the present application.

[0050] Embodiment 1, refer to Figure 1 For an embodiment of the present application, a control method of a smart home is provided, comprising:

[0051] S1: acquiring event signals and room topology relationship, and performing normalization processing on the event signals.

[0052] Further, the event signals and the room topology relationship are acquired, the event signals include mobile phone in-network event signals, opening and closing event signals of the entrance door magnet, and passive infrared triggering event signals.

[0053] Specifically, the mobile phone network activity signal is obtained through the home Wi-Fi router or access point. The system periodically reads the recent online time and signal strength of family members' mobile phones and other terminals. When a terminal is detected connecting to the home Wi-Fi, it is determined that the mobile phone is online; when a terminal is detected disconnecting from the home Wi-Fi, it is determined that the mobile phone is offline. This signal can objectively reflect whether family members are within the residential coverage area. The door sensor's opening and closing event signal is obtained through a reed switch or Hall sensor installed on the door. When the door is opened or closed, the door sensor module generates a corresponding open or closed event signal. The door sensor's opening and closing event signal can accurately reflect the user's door opening and closing actions and is an important basis for the entry-level state machine to determine the home's presence and absence status.

[0054] Passive infrared trigger event signals are acquired by passive infrared sensors installed in the room. An event signal is triggered when a change in infrared thermal radiation from a human body is detected. Passive infrared trigger event signals directly reflect a user's activity in the room and are an important basis for the room-level state machine to determine the user's location.

[0055] The system obtains the house structure and abstracts it into a point-line diagram to obtain the room topology. Points represent rooms (i.e., living room, bedroom, kitchen, etc.) and lines represent corridors between rooms. Based on the house structure, the system marks the location of smart home devices in the room topology and locates the triggering position of passive infrared trigger event signals based on the room topology, thereby determining the user's room.

[0056] Furthermore, the raw output of event signals differs across smart home devices: mobile phone network activity events reported by home routers are typically provided as recent online timestamps or signal strength values; door sensor open / close events are indicated by an open or closed status; and passive infrared trigger events may be one-time trigger pulses or periodically reported information. Directly using these raw event signals would make comparisons impossible within the same decision-making process due to differences in timelines and formats.

[0057] Therefore, this invention normalizes the event signals. All event signals are uniformly converted into standardized records containing timestamps, source types, and binary status values. The binary status values ​​are uniformly represented by 0 / 1. Specifically, for mobile phone network-connected event signals, a time threshold is set, and the difference between the most recent online time and the current time is calculated. If the difference is less than or equal to the time threshold, it is 1 (online); if the difference is greater than the time threshold, it is 0 (offline).

[0058] The magnetic event signal of the entrance door is recorded as 1 when the door is open and 0 when the door is closed.

[0059] The passive infrared trigger event signal is recorded as 1 when human activity is detected (passive infrared trigger), and as 0 when no activity is detected (passive infrared not triggered). Through normalization processing, event signals from different sources are unified to the same time base and data format, enabling them to directly drive the judgment of the two-level state machine. This ensures that the judgment of the in-home status, out-of-home status, and room level are all based on consistent objective data, improving the accuracy and reproducibility of the control method.

[0060] S2: Execute a two-level state machine judgment based on the event signal and room topology relationship. The two-level state machine includes an entrance-level state machine and a room-level state machine. The entrance-level state machine judges the user's in-home status and out-of-home status. When the entrance-level state machine judges the user to be in-home, it triggers the room-level state machine. The room-level state machine judges the room where the user is located.

[0061] Furthermore, the entry-level state machine uses changes in the entry door sensor as a timing anchor point. Only after detecting the instantaneous event of the entry door sensor changing from 0 to 1 is a preset short time interval activated to collect evidence related to returning home / leaving home. The reason for using the door sensor activation as a prerequisite is to ensure that subsequent judgments are closely related to actual entry and exit behavior in time, avoiding being misled by occasional passive infrared triggers or the mobile phone's network status during periods without entry or exit activity.

[0062] Specifically, in the away state, when the door magnetic event signal is detected at time... When it changes from 0 to 1, during the home visit observation period Inside:

[0063] If the mobile phone's network event signal is 1, it is determined to be in an online state;

[0064] If the passive infrared trigger event signal is 1, it is determined that the user is in an in-home state.

[0065] After determining that the room is in an in-room state, a control command is issued and the room-level state machine is triggered.

[0066] The entry-level state machine determines the occupancy status when the resident is not continuously scanning all event signals, but rather using the "entry door sensor event signal changing from 0 to 1" as the sole trigger condition. This design has two considerations: first, the opening and closing action of the door sensor directly corresponds to the actual door opening behavior, providing the most stable and intuitive physical evidence of residents entering and leaving the residence; second, using the door sensor event as an anchor point allows for a compact determination interval in time, avoiding erroneous inferences about the resident's status based on occasional signals when there is no entry or exit activity.

[0067] Within this determination interval, the present invention further introduces two types of complementary event signals as confirmation criteria:

[0068] A mobile phone network event signal of 1 indicates that within a short period after the door sensor is triggered, the home network detects that the resident's mobile device has reconnected or remained online. This reflects the typical behavior pattern of most residents, namely that their mobile phones remain connected to the home wireless network after entering the house, and therefore logically can serve as reliable evidence that "someone has entered the house".

[0069] A passive infrared trigger event signal of 1 indicates that the sensor in the entryway or living room area detected human activity after being triggered by the door magnetic sensor. This signal is introduced to compensate for the limitations of mobile phone network event signals, such as when visitors do not carry the bound terminal, or when the resident's terminal is in airplane mode or powered-off network mode. Through passive infrared signals, entry actions can still be confirmed even when the smart home system is offline.

[0070] In the in-home state, when the door magnetic event signal is detected at time... When it changes from 0 to 1, during the home visit observation period Inside:

[0071] If the passive infrared trigger event signal is always 0 and the mobile phone network event signal is 0, it is determined to be an off-site state;

[0072] Once the system determines that the property is in an abandoned state, a control command is issued.

[0073] in, Indicates the time point at which the magnetic signal of the entrance door is triggered; This represents the decision time of the entry-level state machine, a fixed value set by the user.

[0074] When the entry-level state machine is in the "at-home" state, the determination of whether someone has left home is also based on the trigger condition that the "entry door magnetic event signal changes from 0 to 1 at a certain moment". By using the door magnetic action as the trigger anchor point, other event signals can be monitored centrally within a specific time period, reducing interference from daily indoor activities.

[0075] Within this time interval, the system further combines two types of signals as confirmation conditions:

[0076] The passive infrared trigger event signal remained at 0, meaning that no new human activity was detected in any room of the residence after the door sensor was opened. This indicates that no one stayed or moved inside the house after the door was opened, providing crucial evidence that the house was vacant.

[0077] A mobile phone network activity signal of 0 indicates that the smart home terminal bound to the residential network left network coverage or disconnected within a certain period after the door sensor was opened. This situation closely matches the actual behavior of a user leaving their residence with their mobile phone, thus supplementing the judgment of the infrared sensor.

[0078] It should be noted that the state of being away from home can only be determined if both the passive infrared trigger event signal is always 0 and the mobile phone network event signal is 0. The state of being away from home means that there is no one in the room, not that someone has left. Therefore, if the passive infrared trigger event signal can still be detected as 1, it means that someone is still in the room, so the state of being away from home is not triggered.

[0079] It should also be noted that the decision time of the entry-level state machine... When the system is initially deployed, a fixed value is set, such as a range of several seconds to more than ten seconds, to ensure that relevant event signals can be stably captured during the process of residents completing actions such as opening and entering the door.

[0080] During system operation, this judgment time can be adjusted by users according to their actual usage habits. Users can modify the length of this time interval through the application, control panel, or other interactive methods to better suit their personal coming and going rhythms and the differences among family members.

[0081] Furthermore, upon being triggered, the system first sets the user's current room as the entryway, as the entryway is the first space most residents pass through upon entering their home, serving as an initial reference point for room location. Based on this, the system combines room topology relationships to determine all adjacent rooms of the current room A, and collectively marks these adjacent rooms as candidate set B.

[0082] When the passive infrared trigger event signal in B is 1, in the moving observation range Internal execution judgment:

[0083] If the passive infrared trigger event signal in room B is 1 again, it is determined that the user has moved, the room where the user is located is set as B, and a control command is issued. When a passive infrared trigger occurs in a room in the candidate set B, the system does not immediately assume that the user has entered that room, but instead enters a preset movement observation interval. Within the movement observation interval, if an infrared trigger occurs again in that room, it can be confirmed that the user has indeed moved from room A to that room. The system then updates the "user's room" to the adjacent room B and outputs the control command corresponding to room B. This secondary confirmation is to avoid incorrect judgments caused by single false alarms, brief disturbances, or environmental noise, thereby improving the accuracy and stability of room positioning.

[0084] If the passive infrared trigger event signal in room A is 1, the room-level state machine's judgment is interrupted, the user's room remains A, and no control command is issued. If a new passive infrared trigger signal appears in the original room A within the movement observation interval, it indicates that the user is still in the current room and has not actually moved. At this time, the room-level state machine will immediately interrupt the current round of movement judgment, keeping the user's room A, and will not issue any new control commands. This effectively avoids unnecessary control switching caused by brief body movements or environmental interference, thereby maintaining the stability of the home system during operation and the consistency of the user experience.

[0085] in, Indicates the time point when the passive infrared trigger event signal is triggered; A represents the room where the user is located; B represents the adjacent room to the user's room; This represents the decision time of the room-level state machine, a fixed value set by the user.

[0086] S3: Generates a set of control commands based on the room topology, obtains user feedback, and selects and executes control commands from the set of control commands through a dual-track mechanism based on the judgment results of the two-level state machine and user feedback, thereby realizing the control of smart homes.

[0087] Furthermore, a set of control commands is generated based on the room topology, where each control command corresponds to a specific setting of a smart home device, such as air conditioner - turn on - cooling - 26 degrees Celsius. Based on the room topology, the types of smart home devices installed in the room and their controllable functional ranges are obtained. The specific settings or parameter values ​​allowed by the manufacturer are then queried to generate the control command set. The control command set is a collection of all smart home control commands, and each command represents a specific executable instruction for a particular smart home device. For example, smart lighting typically supports different brightness percentages and color temperature ranges. The smart lighting control command set is defined as several fixed settings (such as 0%, 20%, 40% brightness and common color temperatures of 2700K, 3500K, 4000K) to ensure that the control signals can be accurately executed by the actual smart home devices. Similarly, the air conditioner temperature is limited to common ranges (such as 24℃, 25℃, 26℃) and supplemented with mode switching (cooling or ventilation), so that the action set covers common scenarios while avoiding the learning and computational complexity caused by continuous settings. For smart home devices such as curtains, blinds, fresh air systems, dehumidifiers, or humidifiers, the control commands are discretized based on the specific settings or parameter values ​​provided by the manufacturer. For smart home devices with binary or few settings, such as water heaters and audio-visual devices, the start / stop or volume limit percentage is directly used as the content of the action set.

[0088] The process of obtaining user feedback includes establishing a user feedback window for each smart home device. The user's actions on smart home devices within the user feedback window will be used as user feedback.

[0089] in, This indicates the timing point for adjusting the smart home device based on control commands; This indicates the user feedback time for smart home devices. These are fixed values ​​set according to the type of smart home system. User feedback is divided into user affirmation and cancellation of control commands. Cancellation occurs when the user makes a reverse adjustment to the control command within the user feedback window. For example, the system turns on a light, and the user immediately turns it off; or the system sets the air conditioner temperature to 25°C, and the user quickly changes the temperature back to a lower value. In this case, the system determines that the control did not meet the user's expectations and records it as cancelled.

[0090] The term "affirmative" refers to situations where the user does not make any reverse adjustments to the control command within the user feedback window, or the user performs further operations in the same direction. For example, if the system has already adjusted the light brightness to 40%, and the user further increases it to 60%; or if the system has activated the smart home ventilation system, and the user maintains that state or selects a higher fan speed. In these cases, the system determines that the control conforms to the user's usage habits and records it as "affirmative."

[0091] Furthermore, selecting and executing control instructions from the control instruction set based on the judgment results of the two-level state machine and user feedback includes constructing a context vector. , Composed of the in-home status, out-of-home status, and the user's current room, a safety boundary check is performed on each candidate control command 'a' in the control command set. Specifically, the safety boundary check includes the following aspects:

[0092] Firstly, physical protection constraints for smart homes. For compressor-based smart home devices like air conditioners, minimum start-stop time constraints are set to prevent frequent switching on and off within a short period, thus avoiding mechanical damage. For lighting smart home devices, the minimum dimming step size is limited to prevent rapid flickering. For motor-driven smart home devices, the start-stop frequency is limited to prevent overload operation.

[0093] Secondly, nighttime noise and illumination restrictions. Based on the judgment results of the two-level state machine, additional restrictions are set for specific actions within a certain time period. For example, during the period from 23:00 at night to 06:00 the next day, volume output exceeding a preset threshold is prohibited, and the brightness of the lights is limited to a specified percentage to ensure the comfort of nighttime use.

[0094] Third, power mutual exclusion constraints. For high-power smart home appliances such as water heaters, electric ovens, and air conditioner outdoor units, establish mutual exclusion groups. When one smart home appliance is in operation, other high-power smart home appliances in the same group should not be turned on at the same time, thereby avoiding overload or power outage of the home power distribution system due to excessive instantaneous total power.

[0095] Fourth, the rated range constraints for smart home systems. The set temperature of the air conditioner, the target humidity for humidification or dehumidification, the opening degree of the curtains, and other adjustable parameters must be limited to the rated safe operating range of the smart home system. For example, the set temperature of the air conditioner must not be lower than the minimum value indicated by the manufacturer, and the opening degree of the curtains is only allowed to be selected within the range of 0% to 100% of their physical travel.

[0096] Control instructions that satisfy the safety boundary check from the control instruction set are selected as candidate control instructions 'a'. The policy parameter vector of 'a' is initialized to 0. The linear score of 'a' is calculated using the linear inner product of the context vector and the policy parameter vector, i.e., the dot product of the current context vector and the policy parameter vector corresponding to 'a'.

[0097] ;

[0098] Control commands are selected and executed via a dual-track mechanism consisting of a main track and a shadow track. The main track includes:

[0099] Perform deterministic maximization selection from the set of control instructions:

[0100] ;

[0101] in, This represents the strategy parameter vector for candidate control command a in room A; Represents the matrix transpose symbol; This refers to the control instruction selected and executed at time t; Indicates the set of control commands Inside, take The largest candidate control instruction 'a'; This represents the linear score of a.

[0102] Issue control commands And execute it to achieve smart home control.

[0103] Calculate control commands based on user feedback. The reward is 1 point when the user feedback is positive and -1 point when the user withdraws. This is based on control instructions. Rewards Update The updated strategy parameter vector is used for the next selection of control commands. The linear score calculation, and the update formula for the policy parameter vector, are expressed as:

[0104] ;

[0105] in, Indicates the assignment operator; Indicates control commands The policy parameter vector; η represents the learning rate; This indicates user feedback, either 1 or -1.

[0106] When the reward is positive, the update item direction is... Consistency causes the policy parameter vector to converge towards this context, thereby improving control commands in similar scenarios. The rating increases the likelihood of it being selected again; when the reward is negative, the update direction is adjusted accordingly. Conversely, it causes the policy parameter vector to move away from This reduces the number of control commands. Scoring in similar scenarios. This shows that the update formula for the policy parameter vector is equivalent to a one-step update in stochastic gradient ascent, which can gradually adjust the parameters with each incoming sample, causing the policy to converge in a direction that better aligns with user habits.

[0107] The learning rate η is crucial for the system's stability and adaptability. To prevent excessively large single-step updates from causing policy oscillations, a fixed upper limit is set for the learning rate to ensure that each update remains within a controllable range. During system cold starts or when there are few samples, the learning rate is set to a small to medium value, such as 0.05 to 0.10, to strike a balance between learning speed and stability. When consecutive negative rewards occur (e.g., user withdrawals or triggering safety boundaries), the system decays the learning rate by a fixed percentage, such as halving it, to quickly reduce the update magnitude and avoid drastic parameter fluctuations. Conversely, when consecutive positive rewards occur, the learning rate is slightly increased without exceeding the fixed upper limit, thereby accelerating the convergence to user habits. The learning rate remains stable and controllable dynamically, allowing the update process to absorb user operating habits in real time without disrupting the overall control consistency and security due to excessive adjustments.

[0108] The shadow track includes:

[0109] According to linear scoring and the control commands executed Construct a shadow track action set, which includes the first reverse action, boundary swap, adjacent weakening action, and adjacent strengthening action. The first reverse action is the control instruction with the smallest linear score, the boundary swap is the control instruction with the second largest linear score, the adjacent weakening action is the control instruction executed corresponding to the previous level of the smart home, and the adjacent weakening action is the control instruction executed corresponding to the next level of the smart home.

[0110] It's important to note that the shadow track action set is used to construct candidate control commands that conflict with the main track. This allows for the rapid identification of alternatives when user feedback conflicts with the main track, without requiring step-by-step updates to the main track's strategy parameter vector. Specifically, the "reverse first choice" refers to the control command with the lowest linear score in the current set of control commands, typically corresponding to the most functionally or state-opposite situation to the executed command. For example, when the main track executes "turn on the air conditioner to cool to 26°C," the reverse first choice might be "turn off the air conditioner" or "turn on the fan mode." This type of control command represents situations where the user might have a completely opposite preference to the main track command.

[0111] Boundary interchange items refer to the control instruction that ranks second in linear score among the current candidate control instructions, representing the candidate control instruction that competes most fiercely with the main track selection. For example, when the main track is selected as "Draw the curtains to 80% open", the boundary interchange item might be "Draw the curtains to 70% open". This type of control instruction is mainly used to check whether there is a deviation in the boundary between the top two instructions in the main track ranking.

[0112] Adjacent weakening terms refer to control commands executed by the main rail that are in the next lower gear of the same device. For example, when the main rail executes "air conditioning cooling 26°C", the adjacent weakening term might be "air conditioning cooling 27°C". This type of control command reflects situations where the user may want to slightly reduce or conservatively adjust the operation based on the main rail.

[0113] Adjacent enhancement items refer to control commands executed by the main rail that are at the next higher level within the same device. For example, when the main rail executes "air conditioning cooling 26°C", the adjacent enhancement item might be "air conditioning cooling 25°C". This type of control command reflects situations where the user may want a slight increase or a more aggressive response compared to the main rail's action.

[0114] By constructing the above four types of shadow instructions, the system can cover different possibilities such as completely opposite to the main track, closest to competition, and slightly enhanced or weakened, so as to quickly find alternative control instructions that conform to the user's true intention when the user feedback negates the result of the main track.

[0115] According to control commands The reward for the shadow track action set is calculated based on user feedback. This reward is given when the user feedback for control instruction a' in the shadow track action set is positive, and the control instruction is executed. When the user feedback is "cancel", in the next instance with the same context vector When the system directly executes the control instruction 'a' from the shadow track action set, where 'a' represents the control instruction in the shadow track action set, it indicates a direct conflict between the control result selected by the main track and the user's expectations, while the shadow track candidates contain instructions that the user explicitly approves. Since the main track is adjusted via policy parameter vectors, limited by the learning rate, it cannot make significant adjustments the next time control instructions are issued. There's even a possibility that the user might cancel the request, only to have the same control instruction issued again. To avoid repeatedly executing instructions that don't meet the user's expectations, the system directly executes the approved shadow instruction the next time the same context vector appears. Through this rapid replacement mechanism, the system can immediately correct control deviations, improve user experience, and quickly adapt to changes in the environment that alter user needs (e.g., the need to turn on the air conditioner after summer). All control instruction adjustments are based on user needs, requiring no additional environmental data collection or complex analysis calculations.

[0116] If multiple control commands in the shadow track action set are affirmed, the priority is: reverse first > boundary swap > adjacent weakening > adjacent strengthening, in the next same context vector. The higher-priority instruction 'a' is executed first. This is because the reverse first instruction represents a control command whose execution result is completely opposite to the main instruction; it is most likely to be the user's true intention when the user cancels the main instruction. The boundary swap instruction represents the control command that competes most fiercely with the main instruction; its affirmation indicates a deviation in the main instruction's boundary judgment. Adjacent weakening and strengthening instructions correspond to the user's desired slightly weaker or stronger tendencies, respectively, and are therefore placed later in the priority order. By fixing the priority order, the instruction that best matches the user's intention can be quickly determined when multiple shadow instructions are affirmed simultaneously, avoiding uncertainty in priority selection.

[0117] When no control command is affirmed in the shadow track action set, or a` and When both commands are affirmed, the control instruction is not replaced, and the main track is executed. When no instruction in the shadow track's action set is affirmed, or when an instruction in the shadow track is affirmed simultaneously with an instruction executed in the main track, the system does not trigger a replacement but maintains the execution of the main track. This is because in such cases, the user's intent does not directly conflict with the main track's result, or there is ambiguous affirmation between instructions, lacking a clear replacement condition. If a replacement were still performed in this situation, it might cause frequent system fluctuations and reduce control stability.

[0118] From a practical perspective, the shadow track compensates for the shortcomings of the main track. The main track employs a deterministic maximization selection based on linear scoring, and its learning process often requires gradual parameter correction through multiple positive and negative feedbacks. This results in slower convergence during seasonal changes or sudden scene shifts. For example, during the transition from summer to autumn, a user might change the air conditioner setting from "cooling 26°C" to "off" all at once. The main track needs multiple learning cycles to gradually elevate "off" to the preferred setting. However, the shadow track, through a rapid replacement mechanism, can immediately set "off" as the target execution command for the next round with a single combination of "undo + affirmation" feedback, thus quickly adapting to the environment. Therefore, the shadow track solves the main track's lag in rapidly adapting to sudden user needs, achieving complementarity between the two: the main track ensures overall control stability and gradual learning, while the shadow track provides immediate correction and rapid adaptation capabilities.

[0119] In this invention, event signals are acquired and normalized by combining them with room topology relationships, ensuring that data enters the two-level state machine for judgment under a unified timeline and format. The entry-level state machine can robustly determine the entry and exit states, while the room-level state machine determines the user's room location under room topology constraints. Furthermore, this invention introduces a strong learning mechanism for user actions based on the two-level state machine, collecting and analyzing user feedback as objective signals, constructing context vectors, and combining them with safety boundaries for action selection and online updates. This ensures that the control strategy continuously adapts to the user's real habits and lifestyle while maintaining the safety of smart home operation and controllable energy consumption.

[0120] This invention ensures the accuracy and reproducibility of occupancy determination through a two-level state machine, avoiding misjudgments caused by relying on a single signal in traditional smart homes. Through a strong learning mechanism based on user actions, the system can progressively optimize control decisions based on natural user behavior without requiring subjective user feedback, achieving personalized and precise control over various smart home devices such as lights, air conditioners, curtains, and ventilation systems. Therefore, this invention not only improves the automation level and user experience of smart homes but also achieves excellent results in energy management and smart home lifespan protection.

[0121] Example 2, in an exemplary embodiment, also provides a smart home control system, including:

[0122] The acquisition module obtains event signals and room topology relationships, and performs normalization processing on the event signals.

[0123] The judgment module performs a two-level state machine judgment based on the event signal and the room topology relationship. The two-level state machine includes an entrance-level state machine and a room-level state machine. The entrance-level state machine judges the user's in-home status and out-of-home status. When the entrance-level state machine judges the user to be in-home, it triggers the room-level state machine, which judges the room where the user is located.

[0124] The control module generates a set of control commands based on the room topology, obtains user feedback, and selects and executes control commands from the set of control commands through a dual-track mechanism based on the judgment results of the two-level state machine and user feedback, thereby realizing the control of smart homes.

[0125] If the above functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer smart home device (which can be a personal computer, server, or network smart home device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0126] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or smart home (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or smart home). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or smart home.

[0127] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0128] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0129] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A control method for smart homes, characterized in that, include: The event signals and room topology are acquired, and the event signals are normalized. The event signals include mobile phone network event signals, door magnetic sensor opening and closing event signals, and passive infrared trigger event signals. The two-level state machine is executed based on the event signal and the room topology relationship. The two-level state machine includes an entrance-level state machine and a room-level state machine. The entrance-level state machine determines the user's in-home status and out-of-home status. When the entrance-level state machine determines that the user is in-home, the room-level state machine is triggered. The room-level state machine determines the room where the user is located. A set of control commands is generated based on the room topology, and user feedback is obtained. Based on the judgment results of the two-level state machine and user feedback, control commands are selected and executed from the set of control commands through a dual-track mechanism to realize the control of smart home. The normalization process for the event signal includes converting the event signal into a standardized record containing a timestamp, source type, and binary state value. The binary state values ​​are uniformly represented by 0 / 1. For the mobile phone on-network event signal, the mobile phone on the network is 1 and the mobile phone off-network is 0. The magnetic event signal of the entrance door is recorded as 1 when the door is open and 0 when the door is closed; The passive infrared trigger event signal is recorded as 1 when triggered and as 0 when not triggered; The step of selecting and executing control instructions from the control instruction set based on the judgment results of the two-level state machine and user feedback includes constructing a context vector. , The control command consists of the user's in-home status, out-of-home status, and the room they are in. For each candidate control command 'a' in the control command set, the strategy parameter vector of 'a' is initialized to 0, and then determined based on the context vector. The linear score of a is calculated using the policy parameter vector of a, and control commands are selected and executed through a dual-track mechanism of main track and shadow track. The main track includes: Perform deterministic maximization selection from the set of control instructions: ; in, This indicates the control command selected and executed at time t, corresponding to a level of the smart home system. Indicates the set of control commands Inside, take The largest candidate control instruction 'a'; This represents the linear score of a; Issue control commands And execute, calculate control commands based on user feedback The reward is 1 when the user feedback is positive and -1 when the user feedback is negative, based on the control instructions. Rewards Update The updated strategy parameter vector is used for the next selection of control commands. The linear score calculation, and the update formula for the policy parameter vector, are expressed as: ; in, Indicates the assignment operator; Indicates control commands The policy parameter vector; η represents the learning rate; This represents user feedback, either 1 or -1; the updated policy parameter vector is used for the next selection of control commands. Linear score calculation; The shadow track includes: According to linear scoring and the control commands executed Construct a set of shadow track actions, which includes the first reverse action, the boundary swap, the adjacent weakening action, and the adjacent strengthening action. The first reverse action is the control instruction with the smallest linear score, the boundary swap is the control instruction with the second largest linear score, the adjacent weakening action is the control instruction executed corresponding to the previous level of the smart home, and the adjacent weakening action is the control instruction executed corresponding to the next level of the smart home. According to control commands The reward for the shadow track action set is calculated based on user feedback. This reward is given when the user feedback for control instruction a' in the shadow track action set is positive, and the control instruction is executed. When the user feedback is "cancel", in the next instance with the same context vector At this time, the control instruction a` in the shadow track action set is executed directly, where a` represents the control instruction in the shadow track action set; If multiple control commands in the shadow track action set are affirmed, the priority is: reverse first > boundary swap > adjacent weakening > adjacent strengthening, in the next same context vector. The higher-priority a` will be executed at that time; When no control command is affirmed in the shadow track action set, or a` and When both are affirmed, the control commands are not replaced, and the main track is executed.

2. The smart home control method as described in claim 1, characterized in that: The room topology relationship includes: obtaining the house structure, abstracting the house structure into a point-line diagram to obtain the room topology relationship, where points represent rooms and lines represent corridors between rooms, marking the smart home type and smart home location in the room topology relationship according to the house structure, and locating the triggering location of the passive infrared trigger event signal according to the room topology relationship.

3. The smart home control method as described in claim 2, characterized in that: The in-home state machine determines the user's in-home and out-of-home status, including, in the out-of-home state, when an in-home door magnetic event signal is detected at time [time missing]. When it changes from 0 to 1, during the home visit observation period Inside: If the mobile phone's network event signal is 1, it is determined to be in an online state; If the passive infrared trigger event signal is 1, it is determined that the user is in an in-home state. After determining that the user is in an in-home state, a control command is issued and the room-level state machine is triggered. In the in-home state, when the door magnetic event signal is detected at time... When it changes from 0 to 1, in the interval Inside: If the passive infrared trigger event signal is always 0 and the mobile phone network event signal is 0, it is determined to be an off-site state; Once the system determines that the property is in an abandoned state, a control command is issued. in, Indicates the time point at which the magnetic signal of the entrance door is triggered; This represents the decision time of the entry-level state machine, a fixed value set by the user.

4. The smart home control method as described in claim 3, characterized in that: The room-level state machine determines the user's room by setting the user's room as the entrance hall when the room-level state machine is triggered, and marking the adjacent room of the user's room A as B according to the room topology and passive infrared trigger event signal. When the passive infrared trigger event signal in B is 1, in the moving observation range Internal execution judgment; If the passive infrared trigger event signal in B is 1 again, it is determined that the user has moved, the user's room is set as B, and a control command is issued. If the passive infrared trigger event signal in A is 1, the room-level state machine judgment is interrupted, the user's room is still A, and no control command is issued. in, Indicates the time point when the passive infrared trigger event signal is triggered; A represents the room where the user is located; B represents the adjacent room to the user's room; This represents the decision time of the room-level state machine, a fixed value set by the user.

5. The smart home control method as described in claim 4, characterized in that: The process of obtaining user feedback includes establishing a user feedback window for each smart home device. The user's actions on smart home devices within the user feedback window will be used as user feedback. in, This indicates the timing point for adjusting the smart home device based on control commands; This indicates the user feedback time for smart home devices. These are fixed values ​​set according to the type of smart home; User feedback is divided into user affirmation and cancellation of control commands. Cancellation means that the user has made a reverse adjustment to the control command in the user feedback window, while affirmation means that the user has made a positive adjustment to the control command in the user feedback window.

6. A smart home control system, applied to the smart home control method according to any one of claims 1 to 5, characterized in that, include: The acquisition module obtains event signals and room topology relationships, and performs normalization processing on the event signals; The judgment module performs a two-level state machine judgment based on the event signal and the room topology relationship. The two-level state machine includes an entrance-level state machine and a room-level state machine. The entrance-level state machine judges the user's in-home status and out-of-home status. When the entrance-level state machine judges the in-home status, it triggers the room-level state machine, which judges the room where the user is located. The control module generates a set of control commands based on the room topology, obtains user feedback, and selects and executes control commands from the set of control commands through a dual-track mechanism based on the judgment results of the two-level state machine and user feedback, thereby realizing the control of smart homes.

Citation Information

Patent Citations

  • Methods and systems for managing shipment of an item using a wireless node network

    CN112492526A

  • Home automatic control method and device based on complex event processing

    CN114880134A