A black box home automation ruleset reconstruction method based on interactive verification

By constructing a black-box home automation rule set reconstruction method based on interaction verification, the problems of insufficient universality and interaction relationship discovery in the acquisition and management of smart home automation rules are solved, thereby improving the stability and security of smart home systems and supporting dynamic rule updates.

CN122174959APending Publication Date: 2026-06-09SHANXI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANXI UNIV
Filing Date
2026-02-11
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing methods for acquiring and managing smart home automation rules suffer from insufficient universality, difficulty in automatically discovering real device interaction relationships, and inadequate consideration of entity differences and system dynamism, resulting in low security and stability.

Method used

A black-box home automation rule set reconstruction method based on interactive verification is adopted. By constructing a data preprocessing module, a confidence association tree construction module, and a candidate rule generation module, combined with an entity controllability modeling mechanism, the implicit trigger-condition-action rule structure is automatically reconstructed, realizing the automatic discovery and modeling of the real interaction relationship of entities, and supporting dynamic rule updates.

Benefits of technology

It improves the efficiency and accuracy of rule reconstruction, enhances the stability and security of the system, supports online model updates and optimization, and has good practicality and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122174959A_ABST
    Figure CN122174959A_ABST
Patent Text Reader

Abstract

The application discloses a black-box home automation rule set reconstruction method based on interactive verification and belongs to the technical field of network security. In view of the deficiencies existing in the current intelligent home automation rule discovery and management, the confidence between the trigger attribute and the condition attribute is established through knowledge learning, the efficiency of obtaining rules is improved, and the inefficiency of exhaustion is effectively overcome. The application also proposes a rule causal chain modeling method based on event sequence analysis. By analyzing the time sequence of entity state interaction, different entity state changes occurring continuously are mapped into a "trigger entity-action entity" pair, and entities maintaining a stable state between the trigger and the action are automatically identified as condition candidate entities, so that the automatic generation and structured expression of the automation rule are realized. Experimental results show that the application achieves good results in collecting automation rules in the real world. Therefore, the application can be used for intelligent home system anomaly detection and network space security maintenance.
Need to check novelty before this filing date? Find Prior Art

Claims

1. A black-box home automation rule set reconstruction method based on interactive verification, characterized in that: The method includes the following steps: Step 1: Construct a black-box home automation rule set reconstruction algorithm model framework based on interactive verification, which includes a data preprocessing module, a confidence association tree construction module, a candidate rule generation module, and a rule postprocessing module, and form a closed-loop interaction with the open-source home automation platform through an interface mechanism; Step 2: Data Preprocessing: In the data preprocessing module, the Python programming language is used to uniformly process the automated rule data and the entity data of the open-source home automation platform; the rule data is cleaned and paired relationships are extracted; at the same time, all entities and their attribute information in the open-source home automation platform are obtained through a real-time bidirectional communication interface, and the entity domain is divided according to the entity's execution capabilities and functional characteristics to obtain the trigger entity set, condition entity set, and action entity set. Step 3: Confidence Association Tree Construction: In the confidence association tree construction module, based on the pairing relationships extracted in Step 2, the confidence of the trigger condition attribute association is calculated to obtain the trigger-condition attribute association confidence table, and a quantitative association model between the trigger attribute and the condition attribute is constructed. Taking a trigger entity and its trigger attribute in the trigger entity set as the root node, and based on the trigger-condition attribute association confidence table, the association confidence is used as the quantitative basis to select the condition entity and its attribute with the strongest association with the trigger attribute in descending order, and a hierarchical entity association tree structure is constructed. Step 4: Candidate Rule Generation: In the candidate rule generation module, the entity association tree constructed in Step 3 is used as the search space constraint. A breadth-first traversal strategy is adopted to systematically explore the tree structure. By controlling and observing the state of controllable trigger entities, controllable condition entities, and action entities layer by layer, an interactive verification process between trigger-condition-action is constructed. When an action entity is detected to produce an effective linkage response to the state combination applied to the current traversal path, the trigger-condition-action structure corresponding to the traversal path is recorded as a candidate automated rule, realizing black-box verification and automatic reconstruction of unknown rules. Step 5: Rule generation and standardization: In the post-processing of rules, the candidate rules obtained in Step 4 are represented in a unified structure, and the candidate rules are standardized into a standard trigger-condition-action form. The rule set is then aggregated, deduplicated, and merged to output a set of automated rules that are clear in structure, semantically unified, and free of redundancy.

2. The method for reconstructing a black-box home automation rule set based on interactive verification according to claim 1, characterized in that: The specific steps of data preprocessing in step 2 are as follows: Step 2.1: Rule Data Acquisition: Use the Python programming language to read raw rule data from the automated rule data source. The rule data contains at least three parts: trigger, condition, and action information. Perform uniform field formatting on the acquired data to form a rule dataset with a consistent structure, which will serve as the input for Step 2.

2. Step 2.2: Rule Data Cleaning and Effective Pair Filtering: A cleaning script was written using the Python programming language to process the rule data as follows: 1) Delete rule records with missing fields, incomplete structure, or that cannot be parsed; 2) Delete duplicate or semantically equivalent redundant rule records; 3) Only retain valid pairs where there is a clear logical relationship between the trigger attribute and the condition attribute; After the above processing, clean and reliable "trigger attribute - condition attribute" pairing data is obtained, which serves as the input for step 2.3; Step 2.3: Entity and Attribute Acquisition: By calling the real-time bidirectional communication interface provided by the open-source home automation platform, a communication connection is established with the platform based on the interface protocol, and an entity status acquisition command is sent to obtain complete information of all entities in the smart home system; the entity information includes at least entity identifier, entity status, and entity attribute set; the acquired entity information is uniformly organized into a standardized entity dataset, which is used as input for Step 2.4; Step 2.4: Entity Execution Capability Determination and Entity Domain Division: Based on whether an entity possesses direct execution capability and the functional characteristics of its domain, entities are classified and processed as follows: 1) When an entity directly changes its running state or triggers a physical action through a service call, it is classified as a strong execution domain entity; 2) When an entity has callable capabilities but is used for logical control, scheduling management, or parameter configuration, it is classified as a weak execution domain entity; 3) When an entity is only used for state perception and environmental monitoring and does not have direct execution capabilities, it is classified as an entity in the observation domain; The triggering entity set consists of strong execution domain entities, the condition entity set consists of strong execution domain entities, weak execution domain entities, and observation domain entities, and the action entity set consists of strong execution domain entities. Step 2.5: Data Standardization and Result Output: Use the Python programming language to encapsulate and store the above results in a unified format; store the strong execution domain, weak execution domain, and observation domain entity sets as independent data sets respectively.

3. The method for reconstructing a black-box home automation rule set based on interactive verification according to claim 2, characterized in that: The specific steps for constructing the confidence association tree in step 3 are as follows: Step 3.1: Constructing Trigger-Condition Association Relationships and Calculating Association Confidence: Using the Python programming language, statistical analysis is performed on the paired data obtained in Step 2. Based on the above calculations, a "Trigger-Condition Attribute Association Confidence Table" is constructed between the trigger attribute and the condition attribute, including: 1) Count the number of times each pair of trigger attributes and condition attributes appears in the rule data; 2) Count the frequency of each triggering attribute in all rule data; 3) Calculate the association confidence between the trigger attribute and the condition attribute based on the statistical results. The expression is as follows: in, This indicates the confidence level of the association between the triggering attribute and the conditional attribute. Indicates the trigger attribute Total number of occurrences Indicates the trigger attribute Conditional attributes The number of times they appear at the same time The smallest positive number introduced to prevent the denominator from being zero; Step 3.2: Root Node Selection: Select a triggering entity from the triggering entity set obtained in Step 2, and select a triggering attribute from the attribute set of that entity. Use this as the root node of the entity association tree. The root node is represented in binary form as follows: in, Indicates the trigger entity identifier, This indicates that the entity attribute is triggered; Step 3.3: Candidate Association Node Retrieval: Using the current node as the trigger point, retrieve all corresponding attributes from the trigger-condition attribute association confidence table to obtain a candidate node set. in, This indicates the confidence level of the association between the currently triggering attribute and the corresponding condition attribute. Indicates the conditional entity identifier. Represents conditional entity attributes; The obtained candidate node set is sorted from high to low according to the association confidence; a minimum confidence threshold is set, and all candidate nodes with a confidence level lower than the threshold are removed to ensure that the selected association has statistical reliability. Step 3.4: Child Node Selection and Hierarchical Construction: From the filtered candidate node set, select nodes in descending order of confidence as child nodes of the current node; establish parent-child relationships between the current node and the selected child nodes, and use the association confidence as the weight value of the corresponding association edge; complete the construction of the entity association tree. The expansion of this branch will terminate when any of the following conditions are met: 1) No new candidate nodes were found in the association confidence table; 2) The current node level has reached the preset maximum depth; Step 3.5: Structured Storage of Entity Association Tree: The completed entity association tree is stored in structured data format, including node information and edge information. 1) Node information: entity identifier, attribute name, hierarchy depth; 2) Edge information: the relationship between parent and child nodes and their corresponding association confidence weights.

4. The method for reconstructing a black-box home automation rule set based on interactive verification according to claim 3, characterized in that: The specific steps for generating candidate rules in step 4 are as follows: Step 4.1: Verification Environment Initialization: Read the entity domain partitioning results from Step 2, and obtain the trigger entity set, condition entity set, and action entity set respectively; extract entity identifiers from the action entity set and condition entity set and remove duplicates to form the action identifier set and condition identifier set respectively; obtain the initial state mapping of all action entities and the initial state mapping of all condition entities in batches through the real-time bidirectional communication interface of the open-source home automation platform; perform a unified reset operation on all controllable condition entities to return them to their default state, ensuring the initial consistency of the verification environment; Step 4.2: Generate data using a breadth-first traversal strategy based on the entity association tree: Starting from the root node of the current triggering entity and its triggering attributes in the entity association tree: 1) Generate a breadth-first traversal sequence based on the entity association tree structure; 2) Conditional nodes within the same level are considered equal in terms of their association confidence with their parent nodes; 3) Prioritize traversing high-confidence paths to improve rule validation efficiency and candidate rule hit rate; 4) Determine the number of controllable conditions to be applied based on the current traversal level; Step 4.3: Applying Controllable Conditions and Constructing Paths: Generated using a breadth-first traversal strategy based on the entity association tree. When the breadth-first traversal enters a certain condition node: 1) Determine the number of controllable conditions to be applied; 2) Obtain the set of target states set for the conditional entity; 3) Enumerate the target state set and apply state changes to each one one by one; 4) Construct the current condition structure from all the condition entities with applied states on the current path and their state values, which is used to describe the controllable combination of conditions on the current verification path. Step 4.4: Action Entity Linkage Detection and Differential Verification: After completing the trigger and current condition path state settings: 1) The change status of action entities and condition entities can be obtained in batches through a real-time bidirectional communication interface; 2) Determine the action entity that has changed as the action entity that has interacted, construct an action copy, and write the actual state after the trigger into its state field; 3) Construct a copy of the triggering entity, write the current triggering state into its state field, and ensure that the rule description is consistent with the actual execution. Step 4.5: Construction of the candidate set of uncontrollable conditions: When a valid interaction is detected between an action entity: 1) The original conditional state mapping and the latest conditional state mapping are used as inputs; 2) Construct snapshots of the states of conditional entities that are not directly controlled, forming a dataset of candidate rules for uncontrollable conditions; 3) Filter the candidate rule dataset to remove semantically meaningless or noisy attributes, and retain only entities and their attributes that have rule-conditional meaning; Step 4.6: Candidate Rule Encapsulation and Storage: Encapsulate the trigger-condition-action structure formed by the current traversal path into a candidate rule, which should include at least: Trigger: Entity identifier and trigger status; Current conditions: Controllable conditions and their status on the current path; Candidate condition: A snapshot of the state of an uncontrollable condition; Action: The entity identifier and its actual state after being linked; Original motion state: The original state of the motion entity before it is linked together; Candidate rules are written to an Excel file for easy viewing and operation, and a unique rule number is generated for storage. After the rules are stored, state reset and backtracking control are performed until all trigger states of the current triggering entity and its associated paths have been traversed.

5. The method for reconstructing a black-box home automation rule set based on interactive verification according to claim 4, characterized in that: The specific steps of rule post-processing in step 5 are as follows: Step 5.1: Import and structured parsing of candidate rules: Read the candidate rule dataset output in Step 4; the candidate rules shall contain at least the fields of trigger, action, current condition and candidate condition; The fields are subjected to structured and standardized parsing to convert the candidate rules into a standardized object form. The resulting set of structured candidate rules is used as the input for step 5.

2. Step 5.2: Construct aggregation keys and group and aggregate rules: Construct an aggregation key for each candidate rule. The aggregation key is jointly determined by the trigger end and the action end, including: trigger side key and action side key. Combine the two into an aggregation key for rule grouping. When the state of the trigger or action is a numerical state, the "numerical state ignores aggregation" strategy is adopted. 1) Numerical sample collection: Collect numerical state samples of entities appearing in the aggregation rule set. The entities include at least triggers, actions, and two types of conditions; 2) Clustering by entity: Iteratively cluster the numerical sample set of an entity using entity identifier as the unit to obtain one or more numerical intervals; 3) Interval replacement: Replace the numerical state of the entity in the rule with the interval expression of its corresponding interval. The threshold for iterative clustering is configured as an absolute threshold. With relative threshold And satisfy the following constraints: in, This is the current cluster center value; Group all candidate rules according to the aggregation key to obtain several rule groups; each rule group corresponds to the same type of trigger-action linkage relationship and serves as the input for step 5.3; Step 5.3: Condition set merging and deduplication: Perform merging and deduplication on the candidate rules in each rule group to obtain the aggregated rule set, which serves as the input for step 5.4; Step 5.4: Entity Name Backfilling and Rule Readability Generation: Construct an entity name mapping table and backfill the names of the rule entries to obtain the final automated rule set file.