An autonomous value-added method and system based on a rule tree
By constructing a rule tree and behavioral logic model for autonomous monitoring, the problems of intelligent decision-making and task continuity in unattended simulation training systems are solved. This enables autonomous operation and resource optimization of simulation training stations, thereby improving the intelligence of training and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA STATE SHIPBUILDING CORP LTD RESEARCH INSTITUTE 719
- Filing Date
- 2025-06-18
- Publication Date
- 2026-06-26
AI Technical Summary
Existing simulation training systems struggle to achieve intelligent decision-making, task continuity, and resource optimization in unattended situations. They require high levels of human operator involvement, making the training process prone to interruptions. Static rules are unable to handle complex situations, and there is a lack of real-time status feedback and adjustment mechanisms.
A rule-tree-based autonomous monitoring method is constructed. The rule tree is generated through the rule node structure of condition fields and action fields. The execution pointer is maintained by combining the behavioral logic model to realize task scheduling and interrupt switching. The state data is collected to form a state vector for path adjustment, and a priority management mechanism is introduced.
It enables unattended autonomous operation of the simulation training station, reducing idle time, ensuring the continuity of the training process, improving the level of intelligence, and possessing adaptive and closed-loop verification capabilities, thereby improving training accuracy and resource utilization.
Smart Images

Figure CN120706790B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of autonomous monitoring technology based on rule trees, specifically to an autonomous monitoring method and system based on rule trees. Background Technology
[0002] In existing technologies, simulation training primarily relies on human operators for task simulation and training. In traditional simulation training systems, operators execute various operations according to training scripts, and the system records the results and adjusts the training process based on manually inputted information. Common techniques employed in this approach include:
[0003] Relying on the operator's real-time reactions and decisions, processes such as task execution and status feedback are completed.
[0004] The system controls the flow of training stations by pre-setting task scripts, enabling the system to execute tasks in a fixed logical order.
[0005] In some improved systems, a response mechanism based on condition-action rules is introduced to trigger corresponding actions according to specific conditions. However, the rules are relatively static and cannot dynamically adapt to complex situations.
[0006] In some highly intelligent simulation systems, behavior tree models have been attempted to be applied to process complex dynamic behaviors based on the selection and sequence of nodes. However, these models are more commonly used in game AI and robot control and have not yet been widely applied to intelligent decision-making in simulation training stations.
[0007] While the aforementioned technologies have improved the automation level of simulation training to some extent, they still have the following shortcomings when dealing with highly complex, unattended simulation training scenarios:
[0008] While human operators are highly involved, training stations remain idle outside of working hours, preventing 24 / 7 autonomous training. Preset scripts cannot adjust task execution paths based on real-time conditions, resulting in inflexible resource utilization.
[0009] Because manual operation depends on the operator's schedule, the training process is often interrupted, making long-term continuous training impossible. Static rules cannot cope with dynamic adjustments to the task chain, resulting in poor timeliness of task switching and emergency response.
[0010] Preset scripts can only execute linear task flows and lack intelligent decision-making mechanisms based on logical reasoning, making it impossible to simulate the complex thought processes of real operators. While behavior trees have some dynamic adjustment capabilities, they focus more on the order of behavior execution and lack rule-based reasoning capabilities, making it difficult to accurately reflect the operator's logical reasoning and status feedback mechanisms.
[0011] Existing simulation systems largely rely on external intervention for result evaluation and lack automated state feedback and adjustment mechanisms. They are unable to achieve adaptive adjustment and verification processes based on real-time state changes.
[0012] In summary, existing technologies struggle to simultaneously meet the demands for intelligent decision-making, task continuity, and resource optimization in unattended environments. Therefore, there is an urgent need for an autonomous monitoring system based on dynamic rule trees and behavioral logic engines to achieve intelligent decision-making, autonomous training, and closed-loop verification at simulation training stations, thereby improving the system's intelligence level and resource utilization. Summary of the Invention
[0013] In view of the above-mentioned problems, this invention proposes an autonomous monitoring method based on a rule tree, which includes: constructing a rule node structure of condition fields and action fields, and generating a rule tree structure according to the rule node structure and a standard task template.
[0014] A behavioral logic model is constructed based on the rule tree structure. The execution pointer is maintained through the behavioral logic model to control the progress of the task flow. In multi-task operation scenarios, task scheduling and interrupt switching are realized through the task priority management mechanism.
[0015] During task execution, status data is collected to form a status vector, and the task flow path is dynamically adjusted through a status deviation judgment and correction mechanism.
[0016] Implementing task scheduling and interrupt switching involves organizing the state set, action set, and state transition function in the form of a five-tuple using a behavioral logic model, maintaining execution pointers to control the progress of the task flow, and introducing a priority management mechanism to achieve multi-task scheduling and interrupt switching.
[0017] Dynamically adjusting the task flow path includes collecting status parameters to form a status vector, calculating the deviation by combining the target status vector, and generating a path adjustment suggestion label when the deviation exceeds a threshold, thereby driving the process optimization strategy.
[0018] As a preferred embodiment of the rule tree-based autonomous monitoring method described in this invention, the rule node structure includes: parsing the task information in the standard task template into multiple rule nodes, each rule node consisting of an input condition field, an action field, a jump target field, a priority field, and a node number field, and defining the state conditions that the node must meet before activation through the input condition field.
[0019] System state conditions include single sensor value judgment and multi-variable logic combination.
[0020] The action field describes the operation to be performed after the node is activated. The action field includes the operation type, target, and parameter configuration.
[0021] The jump target field is used to specify the next rule node identifier for the process transfer after the conditions are met. It supports static numbering and condition-based branch jumps.
[0022] Static numbering includes the direct input of the target node's number value. The static number should be consistent with the node number field of the target node and uniquely locate the rule node during the jump process.
[0023] The exception jump field is used to specify the process to be transferred to the exception handling node when the node action fails or the status is abnormal. The value of the exception jump field corresponds to the node number field of the rule node.
[0024] The priority field is an integer type and is used to provide scheduling basis when multiple tasks are executed in parallel.
[0025] The node number field is a unique identifier used for pointer location and status tracking during the execution process.
[0026] The rule node structure extracts the triggering conditions, expected actions and subsequent process branch relationships corresponding to each step of the operation by parsing the task step fields in the template, and maps and fills them into the above fields to form a rule node object, which is then organized into a node set according to the jump relationship.
[0027] The static number must be the same as the node number field value of the target node to ensure the uniqueness of the jump.
[0028] The exception jump field corresponds to the failover field in the standard task template, storing the number of the exception handling node.
[0029] As a preferred embodiment of the rule tree-based autonomous monitoring method described in this invention, the standard task template includes a structured data format.
[0030] The standard task template includes fields for task name, start condition, action sequence, status judgment, jump condition, target status, and exception handling.
[0031] The Task Name field is used to identify the current task scenario and operation goal, while the Start Condition field lists the set of states that the task depends on to start.
[0032] The action sequence field is used to define the operation units to be executed in sequence, the status judgment field is used to set the judgment logic expression after each action, and the jump condition field is used to determine the next operation branch based on the judgment result.
[0033] The target status field is used to set the expected status after the execution of key nodes.
[0034] The exception handling field is used to define the fault response path and emergency interruption process.
[0035] The standard task template is expressed in JSON structure and has the ability to nest task steps. Each task step contains four core fields: condition, action, next, and failover, which correspond to the input condition field, action field, jump target field, and exception jump field in the rule node structure. The template is parsed to read the task step data one by one, and the rule node structure is automatically generated according to the field values. Each rule node is assigned a unique number.
[0036] As a preferred embodiment of the rule tree-based autonomous monitoring method described in this invention, the generation of the rule tree structure includes: connecting the rule node structure parsed from the standard task template according to the jump target field to construct a directed connection relationship and form a task-driven rule tree graph structure.
[0037] For task steps that include branching decisions, an independent jump path is automatically generated for each conditional branch and connected to the parent node.
[0038] For the exception handling field, an alternative exception path is constructed in the rule tree structure and connected in parallel with the normal path in a branching manner to generate a complete rule tree structure containing the starting node, logical branches, conditional jumps and exception paths.
[0039] As a preferred embodiment of the rule tree-based autonomous monitoring method described in this invention, the construction of the behavioral logic model includes: mapping the rule nodes in the rule tree structure generated by the standard task template to state nodes in the behavioral logic model, using the input condition field of the rule node as the state activation criterion, the action field as the state trigger execution content, the jump target field as the state transition direction, and constructing a directed state jump structure according to the connection relationship in the rule tree.
[0040] The behavioral logic model includes a set of states, a set of actions, a state transition function, an initial state identifier, and a set of final states, represented by a quintuple structure.
[0041] The construction process includes assigning a corresponding behavior state to each rule node, adding the node's action field to the action set, constructing a state transition function based on the jump target field and input condition field in the node, and generating state transition edges.
[0042] When there are multiple conditional branches in a rule node, different state transition paths are generated for each condition. Multiple condition-state pair mappings are added to the state transition function, and the condition criteria are encoded and stored in the condition mapping table of the state transition function using Boolean logic structure.
[0043] When a rule node contains an exception handling field, an exception transition edge is added from the current state node to the exception handling state, and abnormal transition behavior is defined through an exception trigger function.
[0044] The abnormal transfer path is generated based on the abnormal jump field set in the rule node and is included in the abnormal state transfer function for unified management. The abnormal jump relationship has independent logical priority and can point to the recovery node, the termination node, and the abnormal handling node.
[0045] The construction process includes assigning a corresponding behavior state to each rule node, adding the node's action field to the action set, generating a mapping item in the state transition function based on the jump target field and the input condition field, and generating a mapping item for the abnormal state transition function for rule nodes with abnormal jump fields.
[0046] This forms a complete state transition network that supports normal path jumps, multi-condition branch control, and abnormal path switching.
[0047] During operation, the behavioral logic model maintains an execution pointer that points to the current behavioral state node in real time. In each round of task execution, it determines the next jump state based on the current state, input conditions, and state transition function, thereby realizing dynamic task advancement, path switching, and emergency jump control.
[0048] When a rule node has multiple conditional branches, the behavioral logic model generates an independent state transition path for each condition and embeds the conditional expression into the conditional mapping table of the state transition function.
[0049] As a preferred embodiment of the rule tree-based autonomous monitoring method described in this invention, the maintenance of the execution pointer to control the progress of the task includes: setting an execution pointer variable during task execution, the execution pointer being used to identify the currently executing state node in real time, and determining the next state node pointed to by the pointer within the task cycle based on the condition judgment result of the current state node and the state transition function in the behavioral logic model.
[0050] The execution pointer advancement process includes pointer initialization, state judgment, action triggering, transfer judgment, pointer update, and state recording.
[0051] When the task starts, the pointer is initialized to the initial state node. The input condition field corresponding to the current state node is periodically read and compared with the current state vector to determine whether the trigger condition is met.
[0052] When the conditions are met, the action execution function is called to issue an operation instruction to the task module, and after the action is executed, the execution pointer is updated according to the state transition function to point to the next state node.
[0053] When multiple jump paths exist, the path that meets the conditions is selected to complete the pointer jump.
[0054] When an action fails to execute or the state deviation exceeds the threshold, an exception handling process is triggered. The execution pointer is redirected to the specified exception state node through the exception jump function, and the emergency handling and process rollback logic is entered at the node.
[0055] The emergency response and process rollback logic includes: when the state deviation exceeds the threshold, the handling method is determined according to the configuration strategy; when set to forced mode, the exception handling process is triggered immediately, and the execution pointer is redirected to the exception state node through the exception jump function to enter the emergency response logic.
[0056] When set to suggestion mode, the redirection is not triggered immediately. Instead, a path adjustment suggestion label is generated, and path optimization evaluation and redirection control are performed through the path adjustment suggestion label.
[0057] The threshold judgment strategy can be configured by the user, supporting static setting of fixed thresholds and dynamic generation of difference tolerance ranges based on historical status data.
[0058] If the rule node is configured with an exception redirection field, the redirection specified by the field will be executed first; otherwise, exception handling will be triggered according to the state deviation.
[0059] The threshold can be dynamically calculated based on the sliding window mean of historical deviation data.
[0060] As a preferred embodiment of the rule tree-based autonomous monitoring method described in this invention, the implementation of task scheduling and interrupt switching includes: during task execution, binding and saving the current execution pointer state with the task context and storing it uniformly in the task stack structure.
[0061] The task context includes the current state node number, state vector snapshot, pointer jump path sequence, and action execution state information.
[0062] In a multi-tasking environment, the scheduler sorts resource allocation based on the priority field value of the tasks to be executed, with higher priority tasks receiving priority allocation of execution channels and computing resources.
[0063] During the task initialization phase, a scheduling queue is generated based on the priority order of the task set, and the concurrent execution of tasks is sorted according to the resource occupancy status.
[0064] The priority field can participate in the scheduler's preemption judgment, interrupt policy decision and task reuse compression mechanism, and takes effect when the task has not yet been executed and is in the pre-scheduling process stage.
[0065] The scheduler compares the priorities of currently executing tasks with those of tasks awaiting scheduling in real time. When a higher-priority task is detected entering the execution queue, the current task flow is interrupted, a push-to-save operation is triggered, and the current context is written to the stack.
[0066] When a high-priority task finishes execution or is interrupted, the scheduler pops the context information of the suspended task from the stack, reconstructs the task's pointer state and flow path, and repositions the execution pointer to the state node before the interruption, thus enabling the original task to resume from its breakpoint and the task flow to continue.
[0067] The task stack is set with a maximum depth threshold. When the stack depth is greater than or equal to the maximum depth threshold, the scheduler will process the task according to the configured policy.
[0068] The handling methods include rejecting new task interruption requests, postponing scheduling, and popping the lowest priority task context and merging it into a summary task.
[0069] Task stack operations employ a mutual exclusion access mechanism, supporting thread locking or atomic operation instructions to achieve concurrent control over the context push and pop processes.
[0070] The scheduler performs task integrity checks during each interrupt and recovery operation.
[0071] The context saving operation must be triggered at the end of the task cycle to ensure that data such as state vectors and pointer positions are snapshots of the same moment.
[0072] The priority field is also used for resource allocation sorting in non-interruption scenarios, with higher priority tasks getting computing resources first.
[0073] As a preferred embodiment of the rule tree-based autonomous monitoring method described in this invention, the state vector is constructed by: during task execution, collecting corresponding state parameter values based on the input condition fields set by the current state node, and constructing a state vector with a fixed structure to represent the running state of the current task step.
[0074] Status parameters include temperature, humidity, voltage, current, operation feedback flags, sensor activation status, and device response codes.
[0075] Each element corresponds one-to-one with the input condition field. The state vector is updated once in each task execution cycle, serving as the basic input for periodic state evaluation.
[0076] As a preferred embodiment of the rule-tree-based autonomous monitoring method described in this invention, wherein:
[0077] The dynamic adjustment of the task flow path includes: determining whether path adjustment needs to be triggered during task execution based on the numerical deviation between the current state vector and the target state reference value.
[0078] The current state vector is composed of state parameters collected in real time during task execution.
[0079] Status parameters include sensor values, device response codes, and environmental indicators. These status parameters are obtained by periodically collecting data from the measurement points mapped to the input condition fields of the rule nodes.
[0080] The target status reference value is provided by the target status field in the standard task template and is calculated by the cluster mean of the normal completion status vectors in the preset task rules and historical execution trajectory.
[0081] When the deviation value exceeds the predefined error threshold, a path adjustment suggestion label is generated in suggestion mode according to the configured threshold trigger strategy.
[0082] The deviation value is the Euclidean distance between the current state vector and the target state reference value. The squares of the differences between each component in the state vector and the target state component are calculated, then the sums are taken and the square root is taken to obtain the overall deviation degree.
[0083] The deviation is executed once after the state vector is updated in each cycle, ensuring that the data source is consistent with the calculation benchmark and avoiding logical errors caused by cross-cycle or recalculation.
[0084] The path adjustment suggestion labels include Allow rollback, switch branches, and pause task, but do not directly trigger jumps; they are only used as input for path control.
[0085] In forced mode, the deviation behavior is used as the entry point for abnormal event handling, and the abnormal state transition process is executed directly.
[0086] The threshold triggering strategy is a configurable item. During the initialization phase, it is defined as a priority suggestion to ensure that the path adjustment mechanism and the abnormal jump behavior maintain a mutually exclusive and non-conflicting response order in the scheduling process.
[0087] The target state vector is loaded from the standard task template during task initialization and can be dynamically adjusted based on historical successful states during execution.
[0088] Deviation calculation is performed immediately after the state vector is updated to ensure data timeliness.
[0089] The threshold can be dynamically calculated based on the sliding window mean of historical deviation data.
[0090] An autonomous monitoring system based on a rule tree is characterized by comprising: a rule tree construction module, a behavior execution control module, and a state perception and path adjustment module.
[0091] The rule tree construction module is used to construct the rule node structure of condition fields and action fields, and generate a rule tree structure according to the rule node structure and the standard task template.
[0092] The behavior execution control module is used to construct a behavior logic model based on a rule tree structure, maintain execution pointers through the behavior logic model to control the progress of the task flow, and realize task scheduling and interruption switching through a task priority management mechanism in a multi-task running scenario.
[0093] The state perception and path adjustment module is used to collect state data to form a state vector during task execution, and dynamically adjust the task flow path through a state deviation judgment and correction mechanism.
[0094] The beneficial effects of this invention are: by introducing rule trees and behavioral logic engines, unattended autonomous operation of training stations can be achieved, breaking the dependence of traditional training on human operators, effectively reducing the idle time of training stations, and making full use of existing resources.
[0095] The system can automatically execute various operation tasks according to the preset rule tree logic, ensuring the continuity and consistency of the training process, thereby avoiding training interruptions caused by the intermittency of manual operation and ensuring the continuity of training tasks.
[0096] By adopting a dynamic rule-based reasoning mechanism and adjusting the operational decision-making path through real-time status feedback, the system can simulate the judgment logic and behavioral patterns of real operators, giving it a certain degree of adaptability and improving the intelligence level of simulation training.
[0097] The system integrates a status monitoring and feedback mechanism, which performs status evaluation and decision adjustment after each operation, forming a complete closed-loop verification link. This enables timely detection and correction of erroneous operations, thereby improving the accuracy and reliability of training.
[0098] The decision path based on rule trees has a clear "condition-action" logical chain, which is more suitable for the characteristics of clear tasks and fixed processes in simulation training positions compared with behavior trees. This makes the operation logic clear and transparent, and facilitates system debugging and expansion.
[0099] The rule tree model has a modular structure, which can be flexibly adjusted or new rule nodes can be added according to the training task requirements, giving the system good scalability and maintainability, and facilitating subsequent functional upgrades and expansions. Attached Figure Description
[0100] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0101] Figure 1 The first embodiment of the present invention provides an overall flowchart of a rule tree-based autonomous monitoring method and system; Detailed Implementation
[0102] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0103] Example 1, referring to Figure 1 As an embodiment of the present invention, a self-monitoring method based on a rule tree is provided, comprising:
[0104] S1: Construct the rule node structure for condition fields and action fields, and generate a rule tree structure based on the rule node structure and the standard task template.
[0105] The task information in the standard task template is parsed into multiple rule nodes. Each rule node consists of an input condition field, an action field, a jump target field, a priority field, and a node number field. The state conditions that must be met before the node is activated are defined through the input condition field.
[0106] System state conditions include single sensor value judgment and multi-variable logic combination.
[0107] The action field describes the operation to be performed after the node is activated. The action field includes the operation type, target, and parameter configuration.
[0108] The jump target field is used to specify the next rule node identifier for the process transfer after the conditions are met. It supports static numbering or condition-based branch jumps.
[0109] The priority field is an integer type and is used to provide scheduling basis when multiple tasks are executed in parallel.
[0110] The node number field is a unique identifier used for pointer location and status tracking during the execution process.
[0111] The rule node structure extracts the triggering conditions, expected actions and subsequent process branch relationships corresponding to each step of the operation by parsing the task step fields in the template, and maps and fills them into the above fields to form a rule node object, which is then organized into a node set according to the jump relationship.
[0112] Furthermore, the standard task template is organized using a structured data format.
[0113] The standard task template includes fields for task name, start condition, action sequence, status judgment, jump condition, target status, and exception handling.
[0114] The Task Name field is used to identify the current task scenario and operation goal, while the Start Condition field lists the set of states that the task depends on to start.
[0115] The action sequence field is used to define the operation units to be executed in sequence, the status judgment field is used to set the judgment logic expression after each action, and the jump condition field is used to determine the next operation branch based on the judgment result.
[0116] The target status field is used to set the expected status after the execution of the key node.
[0117] The exception handling field is used to define the fault response path and emergency interruption process.
[0118] The standard task template is expressed in JSON structure and has the ability to nest task steps. Each task step contains four core fields: condition, action, next, and failover, which correspond to the input condition field, action field, jump target field, and exception jump field in the rule node structure. The template is parsed to read the task step data one by one, and the rule node structure is automatically generated according to the field values. Each rule node is assigned a unique number.
[0119] Furthermore, the rule node structure parsed from the standard task template is connected by path according to the jump target field to build a directed connection relationship and form a task-driven rule tree graph structure.
[0120] For task steps that include branching decisions, an independent jump path is automatically generated for each conditional branch and connected to the parent node.
[0121] For the exception handling field, an alternative exception path is constructed in the rule tree structure and connected in parallel with the normal path in a branching manner to generate a complete rule tree structure containing the starting node, logical branches, conditional jumps and exception paths.
[0122] S2: Construct a behavioral logic model based on the rule tree structure, maintain execution pointers through the behavioral logic model to control the progress of the task flow, and realize task scheduling and interrupt switching through the task priority management mechanism in multi-task running scenarios.
[0123] The rule nodes in the rule tree structure generated by the standard task template are mapped to state nodes in the behavioral logic model.
[0124] A preferred approach to mapping these nodes to state nodes in a behavioral logic model is as follows:
[0125] s i =φ(n i )
[0126] Among them, s i n represents the state node number in the behavioral logic model. i φ represents the rule node number in the rule tree, and φ represents the mapping function from the rule node to the state node.
[0127] The input condition field of the rule node is used as the state activation criterion, the action field is used as the state trigger execution content, the jump target field is used as the state transition direction, and a directed state jump structure is constructed according to the connection relationship in the rule tree.
[0128] The behavioral logic model includes a set of states, a set of actions, a state transition function, an initial state identifier, and a set of final states, represented by a quintuple structure.
[0129] The construction process includes assigning a corresponding behavior state to each rule node, adding the node's action field to the action set, constructing a state transition function based on the jump target field and input condition field in the node, and generating state transition edges.
[0130] A preferred scheme for generating state transition edges is:
[0131] δ(s i ,c k ) = s j
[0132] Where δ represents the state transition function, s i c represents the current state node. k This indicates the input condition field, s j This represents the target state node after the transition.
[0133] When there are multiple conditional branches in a rule node, different state transition paths are generated for each condition, and the conditional expressions are embedded in the model's transition function table as transition criteria.
[0134] When a rule node contains an exception handling field, an exception transition edge is added from the current state node to the exception handling state, and abnormal transition behavior is defined through an exception trigger function.
[0135] A preferred approach to defining abnormal transfer behavior is as follows:
[0136] δ f (s i ,e k ) = s e
[0137] Where, δ f s represents the function for jumping to an abnormal state. i Represents the current state node, e k Indicates the abnormal triggering condition, s e This indicates the target node in an abnormal state.
[0138] Abnormal states can be further linked to recovery nodes and termination nodes, enabling task flow interruption, rollback, and safe termination.
[0139] During operation, the behavioral logic model maintains an execution pointer that points to the current behavioral state node in real time. In each round of task execution, it determines the next jump state based on the current state, input conditions, and state transition function, thereby realizing dynamic task advancement, path switching, and emergency jump control.
[0140] The execution pointer state change record is used to support the execution of task backtracking, priority switching, and path correction strategies.
[0141] Furthermore, during task execution, an execution pointer variable is set. The execution pointer is used to identify the current state node being executed in real time, and within the task cycle, the next state node pointed to by the pointer is determined based on the condition judgment result of the current state node and the state transition function in the behavioral logic model.
[0142] A preferred method for determining the next state node pointed to by the pointer is:
[0143]
[0144] Among them, Ptr t+1 s represents the execution pointer position at time t+1 of the task cycle. t This indicates the current state node in the current cycle. This represents the set of condition fields that are successfully matched in period t, and δ represents the state transition function.
[0145] The execution pointer advancement process includes pointer initialization, state judgment, action triggering, transfer judgment, pointer update, and state recording.
[0146] When the task starts, the pointer is initialized to the initial state node. The input condition field corresponding to the current state node is periodically read and compared with the current state vector to determine whether the trigger condition is met.
[0147] When the conditions are met, the action execution function is called to issue an operation instruction to the task module, and after the action is executed, the execution pointer is updated according to the state transition function to point to the next state node.
[0148] When multiple jump paths exist, the path that meets the conditions is selected to complete the pointer jump based on the matching conditions;
[0149] When an action fails to execute or the state deviation exceeds the threshold, an exception handling process is triggered. The execution pointer is redirected to the specified exception state node through the exception jump function, and the emergency handling and process rollback logic is entered at the node.
[0150] Furthermore, during task execution, the current execution pointer state is bound to and saved with the task context and uniformly stored in the task stack structure.
[0151] The task context includes the current state node number, state vector snapshot, pointer jump path sequence, and action execution state information.
[0152] In a multi-tasking environment, the scheduler compares the priorities of currently executing tasks with those of tasks to be scheduled in real time. When a higher-priority task is detected to be entering the execution queue, the current task flow is interrupted, a stack push and save operation is triggered, and the current context is written to the stack.
[0153] A preferred solution for interrupting the current task flow is:
[0154]
[0155] Among them, P new P represents the priority value of a newly entered task. current Indicates the priority of the currently executing task. TriggerInterrupt indicates the scheduling behavior of interrupting the current task and saving the context.
[0156] When a high-priority task finishes execution or is interrupted, the scheduler pops the context information of the suspended task from the stack, reconstructs the task's pointer state and flow path, and repositions the execution pointer to the state node before the interruption, thus enabling the original task to resume from its breakpoint and the task flow to continue.
[0157] S3: Collect state data during task execution to form a state vector, and dynamically adjust the task flow path through a state deviation judgment and correction mechanism.
[0158] During task execution, based on the input condition fields set by the current state node, the corresponding state parameter values are collected, and a state vector with a fixed structure is constructed to represent the running state of the current task step.
[0159] A preferred approach to constructing a state vector with a fixed structure is as follows:
[0160]
[0161] in, This represents the current state vector during task period t. Let represent the measured value of the i-th state parameter during period t, and n represent the n-th state parameter.
[0162] Status parameters include temperature, humidity, voltage, current, operation feedback flags, sensor activation status, and device response codes.
[0163] Each element corresponds one-to-one with the input condition field. The state vector is updated once in each task execution cycle, serving as the basic input for periodic state evaluation.
[0164] Furthermore, based on the numerical deviation between the current state vector and the target state reference value, it is determined whether path adjustment needs to be triggered during task execution.
[0165] A preferred solution for adjusting the target state reference value is:
[0166]
[0167] in, Represents the desired target state vector. This represents the target setting value of the i-th state field, and n represents the n-th state parameter.
[0168] A preferred approach to determining whether path adjustment needs to be triggered during task execution is as follows:
[0169]
[0170] Where, Δ t express, This represents the current state vector during task period t. Let ||·||2 represent the desired target state vector, and let ||·||2 represent the Euclidean norm.
[0171] When the deviation value exceeds the predefined error threshold, a path adjustment suggestion label is generated according to the pre-configured path evaluation rules.
[0172] A preferred approach for predefined error thresholds is:
[0173]
[0174] Where, Δ t θ represents the current state deviation. t Generate-Tag represents the deviation threshold for period t. t This indicates the trigger action for generating path adjustment suggestion tags.
[0175] A preferred approach to generating path adjustment suggestion tags is:
[0176] Tag t =Π(s) t ,Δ t )
[0177] Among them, Tag t Let s represent the path suggestion label generated in period t, Π(·) represent the path optimization strategy function, and s t Indicates the current state node, Δ t This indicates the current state deviation value.
[0178] The path adjustment suggestion labels include options to allow rollback, branch switching, or task pause.
[0179] The path adjustment suggestion label does not directly trigger path jumps, but serves as input to the path control module for a state-driven task flow optimization suggestion generation mechanism.
[0180] The above embodiments also include a rule-tree-based autonomous monitoring system, specifically:
[0181] Rule tree construction module 100, behavior execution control module 200, state perception and path adjustment module 300.
[0182] The rule tree construction module 100 is used to construct the rule node structure of condition fields and action fields, and generate a rule tree structure according to the rule node structure and the standard task template.
[0183] The behavior execution control module 200 is used to construct a behavior logic model based on the rule tree structure, maintain execution pointers through the behavior logic model to control the progress of the task flow, and realize task scheduling and interruption switching through the task priority management mechanism in multi-task running scenarios.
[0184] The state awareness and path adjustment module 300 is used to collect state data to form a state vector during task execution, and dynamically adjust the task flow path through a state deviation judgment and correction mechanism.
[0185] Example 2, referring to the rule tree-based autonomous monitoring method, is an embodiment of the present invention, providing a rule tree-based autonomous monitoring method and system. To verify the beneficial effects of the present invention, a simulation experiment is conducted for scientific demonstration.
[0186] This simulation of a task-driven operation process in an industrial equipment management system first automatically parses the task structure and constructs a set of rule nodes by defining standard task templates in JSON format, and then defining them in a structured manner. Each node contains input condition fields, action fields, jump target fields, priority fields, and unique number fields, according to the task settings.
[0187] After template parsing, a logically complete directed rule tree structure is generated based on the jump relationships, and this structure is input into the behavioral logic model generation unit for mapping and construction. Each rule node is assigned a state number and bound to a state transition function, forming a state-action-path ternary structure. The behavioral model controls the execution pointer's progression, determining the task flow path and execution logic by judging state matching and conditional criteria in each cycle. During task execution, device operation data is continuously collected to form a standardized state vector, and a path adjustment suggestion tag is triggered when the state deviation exceeds a threshold.
[0188] The experimental design comprises six independent tasks, covering different initial states, priorities, and target states. During the experiment, the distance between the current state and the target state is dynamically evaluated, and behavioral suggestions are generated based on rules. Interruption mechanisms and task priority switching logic are triggered in tasks T003 and T006 to verify interrupt stack pushing and context recovery functions. In scenarios with significant task deviations, effective path adjustment suggestions for pausing and switching branches are generated.
[0189] All experiments were conducted on a simulation platform. State parameters were acquired once per cycle. Abnormal events were injected by a random disturbance module and bound to an exception handling path. Task execution results, including execution success rate, number of adjustments, and number of task interruptions and recoveries, were recorded in a table for analysis. The experimental data are shown in Table 1.
[0190] Table 1 Experimental Data
[0191]
[0192] As can be seen from the table, tasks T001, T004, and T006 encountered path adjustment tags during execution. T001 automatically adjusted its branch path under moderate deviation, maintaining a success rate of 95%, indicating that the path switching strategy of this invention can achieve local optimization and correction without interrupting the overall process. T004 successfully triggered the rollback strategy and smoothly entered the rollback path recovery process during execution, ultimately achieving a task success rate of 92%, which is superior to the stability of traditional non-rollback processes.
[0193] In contrast, although tasks T003 and T006 have high priority, their execution interruption mechanism is triggered when the state deviation is too large. In particular, T003 is judged to be in a risky state by the system, triggering a pause label and automatically saving the stack and temporarily storing the task. During the recovery process, the task reloads the context, rebuilds the execution path, and enters the safe jump logic. Although the task execution success rate drops to 76%, no abnormal exit occurs, indicating that the abnormal state jump function and the priority switching mechanism work together to ensure the integrity of the task.
[0194] Tasks T002 and T005, serving as control groups, exhibited stable success rates of 88% and 85% respectively, with deviation values less than 0.1 and no path adjustments. This verifies that, in scenarios where the path remains unchanged, the execution result is primarily affected by the complexity of the task structure and the success rate of the actions.
[0195] From an overall trend perspective, when the task state deviation exceeds 0.2, the path adjustment suggestion mechanism has a significant intervention effect. It can generate reasonable labels by combining the current state node and the deviation value, and trigger actions and pointer updates in conjunction with the state transition function in the behavioral logic model, thereby optimizing path selection.
[0196] Example 3, referring to the rule tree-based autonomous monitoring system, is an embodiment of the present invention. It provides a rule tree-based autonomous monitoring system, including: a rule tree construction module 100, a behavior execution control module 200, and a state perception and path adjustment module 300.
[0197] S4: The rule tree construction module 100 is used to construct the rule node structure of the condition field and the action field, and generate the rule tree structure according to the rule node structure and the standard task template.
[0198] It should also be noted that the rule tree construction module 100, as the starting point for task flow modeling, first constructs a rule tree structure composed of multiple rule nodes based on a standard task template. Each rule node contains input condition fields, action fields, jump target fields, etc., forming a structured logical path for task execution.
[0199] S5: The behavior execution control module 200 is used to construct a behavior logic model based on the rule tree structure, maintain execution pointers through the behavior logic model to control the progress of the task flow, and realize task scheduling and interruption switching through the task priority management mechanism in multi-task running scenarios.
[0200] It should also be noted that the behavior execution control module 200 maintains the execution pointer during task execution and drives the task flow according to the state transition function.
[0201] S6: The state awareness and path adjustment module 300 is used to collect state data to form a state vector during task execution, and dynamically adjust the task flow path through a state deviation judgment and correction mechanism.
[0202] It should also be noted that the state perception and path adjustment module 300 calculates the difference between the collected state vector and the preset target state value, generates state deviation information, and feeds it back to the behavior execution control module 200.
[0203] If a function is implemented as a software functional unit and sold or used as an independent product, it 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 device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of 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.
[0204] 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 device (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 device). 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 device.
[0205] More specific examples (a non-exhaustive list) of computer-readable media 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 programs can be printed, because programs 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.
[0206] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using 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. 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.
[0207] 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 self-monitoring method based on rule trees, characterized in that, include: Construct the rule node structure for condition fields and action fields, and generate a rule tree structure based on the rule node structure and standard task template; A behavioral logic model is constructed based on the rule tree structure. The execution pointer is maintained through the behavioral logic model to control the progress of the task flow. In a multi-task running scenario, task scheduling and interruption switching are realized through a task priority management mechanism. During task execution, status data is collected to form a status vector, and the task flow path is dynamically adjusted through a status deviation judgment and correction mechanism. Implementing task scheduling and interrupt switching includes organizing the state set, action set, and state transition function in the form of a five-tuple through a behavioral logic model, maintaining execution pointers to control the progress of the task flow, and introducing a priority management mechanism to realize multi-task scheduling and interrupt switching; Dynamically adjusting the task flow path includes collecting status parameters to form a status vector, combining the target status vector to calculate the deviation, and generating a path adjustment suggestion label when the deviation exceeds a threshold to drive the process optimization strategy. The rule node structure includes: The task information in the standard task template is parsed into multiple rule nodes. Each rule node consists of an input condition field, an action field, a jump target field, a priority field, and a node number field. The state conditions that must be met before the node is activated are defined by the input condition field. System state conditions include single sensor value judgment and multi-variable logic combination; The action field describes the operation to be performed after the node is activated. The action field includes the operation type, target, and parameter configuration. The jump target field is used to specify the next rule node identifier for the process transfer after the condition is met. It supports static numbering and condition-based branch jumps. Static numbering includes the direct input of the target node's number value. The static number should be consistent with the node number field of the target node and uniquely locate the rule node during the jump process. The exception jump field is used to specify the process to be transferred to the exception handling node when the node action fails or the status is abnormal. The value of the exception jump field corresponds to the node number field of the rule node. The priority field is an integer type and is used to provide scheduling criteria when multiple tasks are executed in parallel; The node number field is a unique identifier used for pointer location and status tracking in the execution process; The rule node structure extracts the triggering conditions, expected actions and subsequent process branch relationships corresponding to each step of the operation by parsing the task step fields in the template, and maps and fills them into the above fields to form a rule node object, which is then organized into a node set according to the jump relationship.
2. The rule-tree-based autonomous monitoring method as described in claim 1, characterized in that: The standard task template includes: The standard task template is organized using a structured data format; The standard task template includes fields for task name, start condition, action sequence, status judgment, jump condition, target status, and exception handling. The task name field is used to identify the current task scenario and operation goal, while the starting condition field lists the set of states that the task depends on to start. The action sequence field is used to define the operation units to be executed in sequence, the status judgment field is used to set the judgment logic expression after each action, and the jump condition field is used to determine the next operation branch based on the judgment result. The target status field is used to set the expected status after the key node is executed; The exception handling field is used to define the fault response path and emergency interruption process; The standard task template is expressed in JSON structure and has the ability to nest task steps. Each task step contains four core fields: condition, action, next, and failover, which correspond to the input condition field, action field, jump target field, and exception jump field in the rule node structure. The template is parsed to read the task step data one by one, and the rule node structure is automatically generated according to the field values. Each rule node is assigned a unique number.
3. The rule-tree-based autonomous monitoring method as described in claim 2, characterized in that: The generated rule tree structure includes: The rule node structure obtained from the parsed standard task template is connected by path according to the jump target field to build a directed connection relationship and form a task-driven rule tree graph structure. For task steps that include branching decisions, an independent jump path is automatically generated for each conditional branch and connected to the parent node; For the exception handling field, an alternative exception path is constructed in the rule tree structure and connected in parallel with the normal path in a branching manner to generate a complete rule tree structure containing the starting node, logical branches, conditional jumps and exception paths.
4. The rule-tree-based autonomous monitoring method as described in claim 3, characterized in that: The constructed behavioral logic model includes: The rule nodes in the rule tree structure generated by the standard task template are mapped to state nodes in the behavioral logic model. The input condition field of the rule node is used as the state activation criterion, the action field is used as the state trigger execution content, and the jump target field is used as the state transition direction. A directed state jump structure is constructed according to the connection relationship in the rule tree. The behavioral logic model includes a set of states, a set of actions, a state transition function, an initial state identifier, and a set of final states, represented by a quintuple structure. The construction process includes assigning a corresponding behavior state to each rule node, adding the node's action field to the action set, constructing a state transition function based on the jump target field and input condition field in the node, and generating state transition edges. When there are multiple conditional branches in a rule node, different state transition paths are generated for each condition. Multiple condition-state pair mapping relationships are added to the state transition function respectively, and the condition criteria are encoded and stored in the condition mapping table of the state transition function using Boolean logic structure. When a rule node contains an exception handling field, an exception transition edge is added from the current state node to the exception handling state, and abnormal transition behavior is defined through the exception triggering function. The abnormal transfer path is generated based on the abnormal jump field set in the rule node and is included in the abnormal state transfer function for unified management. The abnormal jump relationship has independent logical priority and points to the recovery node, the termination node, and the abnormal handling node. The construction process includes assigning a corresponding behavior state to each rule node, adding the node's action field to the action set, generating a mapping item in the state transition function based on the jump target field and the input condition field, and generating a mapping item for the abnormal state transition function for rule nodes with abnormal jump fields. A complete state transition network is formed that supports normal path jumps, multi-condition branch control, and abnormal path switching; During operation, the behavioral logic model maintains an execution pointer that points to the current behavioral state node in real time. In each round of task execution, it determines the next jump state based on the current state, input conditions, and state transition function, thereby realizing dynamic task advancement, path switching, and emergency jump control. The execution pointer state change record is used to support the execution of task backtracking, priority switching, and path correction strategies.
5. The rule-tree-based autonomous monitoring method as described in claim 4, characterized in that: The process of maintaining and executing pointer control tasks includes: During task execution, an execution pointer variable is set. The execution pointer is used to identify the current state node being executed in real time. Within the task cycle, the next state node pointed to by the pointer is determined based on the condition judgment result of the current state node and the state transition function in the behavioral logic model. The execution pointer advancement process includes pointer initialization, state judgment, action triggering, transfer judgment, pointer updating, and state recording; When the task starts, the pointer is initialized to the initial state node. The input condition field corresponding to the current state node is periodically read and compared with the current state vector to determine whether the trigger condition is met. When the conditions are met, the action execution function is called to issue an operation instruction to the task module, and after the action is executed, the execution pointer is updated according to the state transition function to point to the next state node; When multiple jump paths exist, the path that meets the conditions is selected to complete the pointer jump based on the matching conditions; When an action fails to execute or the state deviation exceeds the threshold, an exception handling process is triggered. The execution pointer is redirected to the specified exception state node through the exception jump function, and the emergency handling and process rollback logic is entered at the node. The emergency response and process rollback logic includes: when the state deviation exceeds the threshold, the handling method is determined according to the configuration strategy; when set to forced mode, the exception handling process is triggered immediately, and the execution pointer is redirected to the exception state node through the exception jump function to enter the emergency response logic. When set to suggestion mode, the jump is not triggered immediately, but a path adjustment suggestion label is generated. The path adjustment suggestion label is used for path optimization evaluation and jump control. The threshold judgment strategy is configured by the user, supporting static setting of fixed thresholds and dynamic generation of difference tolerance ranges based on historical status data.
6. The rule-tree-based autonomous monitoring method as described in claim 5, characterized in that: The implementation of task scheduling and interrupt switching includes: During task execution, the current execution pointer state is bound to the task context and saved, and then stored in the task stack structure. The task context includes the current state node number, state vector snapshot, pointer jump path sequence, and action execution state information; In a multi-tasking environment, the scheduler sorts and allocates resources based on the priority field value of the tasks to be executed, with higher priority tasks receiving priority allocation of execution channels and computing resources. During the task initialization phase, a scheduling queue is generated based on the priority order of the task set, and the concurrent execution of tasks is sorted according to the resource occupancy status. The priority field is involved in the scheduler's preemption judgment, interrupt policy decision and task reuse and compression mechanism, and takes effect when the task has not yet been executed and is in the pre-scheduling process stage. The scheduler compares the priorities of currently executing tasks with those of tasks to be scheduled in real time. When a higher-priority task is detected to enter the execution queue, the current task flow is interrupted, a stack push and save operation is triggered, and the current context is written to the stack. When a high-priority task finishes execution or is interrupted, the scheduler pops the context information of the suspended task from the stack, reconstructs the task's pointer state and flow path, and repositions the execution pointer to the state node before the interruption, thus realizing the breakpoint recovery of the original task and the continuation of the task flow. The task stack is set with a maximum depth threshold. When the stack depth is greater than or equal to the maximum depth threshold, the scheduler will process the task according to the configured policy. The handling methods include rejecting new task interruption requests, deferring scheduling, and popping the lowest priority task context and merging it into a summary task; Task stack operations employ a mutual exclusion access mechanism, supporting thread locking or atomic operation instructions to achieve concurrent control over the context push and pop processes. The scheduler performs task integrity checks during each interrupt and recovery operation.
7. The rule-tree-based autonomous monitoring method as described in claim 6, characterized in that: The constituting state vector includes: During task execution, based on the input condition fields set by the current state node, the corresponding state parameter values are collected, and a state vector with a fixed structure is constructed to represent the running state of the current task step. Status parameters include temperature, humidity, voltage, current, operation feedback flags, sensor activation status, and device response codes; Each element corresponds one-to-one with the input condition field. The state vector is updated once in each task execution cycle, serving as the basic input for periodic state evaluation.
8. The rule-tree-based autonomous monitoring method as described in claim 7, characterized in that: The dynamically adjusted task flow path includes: Based on the numerical deviation between the current state vector and the target state reference value, determine whether path adjustment needs to be triggered during task execution; The current state vector is composed of state parameters collected in real time during task execution; Status parameters include sensor values, device response codes, and environmental indicators. These status parameters are obtained by periodically collecting data from the measurement points mapped to the input condition fields of the rule nodes. The target status reference value is provided by the target status field in the standard task template and is calculated by the cluster mean of the normal completion status vectors in the preset task rules and historical execution trajectory. When the deviation value exceeds the predefined error threshold, a path adjustment suggestion label is generated in suggestion mode according to the configured threshold trigger strategy. The deviation value is the Euclidean distance between the current state vector and the target state reference value. The overall deviation is obtained by taking the square of the difference between each component of the state vector and the target state component, summing them up and taking the square root. The deviation is executed once after the state vector is updated in each cycle, to ensure that the data source is consistent with the calculation benchmark and to avoid logical errors caused by cross cycles or recalculation. The path adjustment suggestion labels include Allow rollback, switch branches, and pause task, but do not directly trigger jumps; they are only used as input for path control. In forced mode, the deviation behavior is used as the entry point for abnormal event handling, and the abnormal state transition process is executed directly. The threshold triggering strategy is a configurable item. During the initialization phase, it is defined as a priority suggestion to ensure that the path adjustment mechanism and the abnormal jump behavior maintain a mutually exclusive and non-conflicting response order in the scheduling process.
9. A rule-tree-based autonomous monitoring system, using the method as described in any one of claims 1-8, characterized in that: Includes a rule tree construction module (100), a behavior execution control module (200), and a state perception and path adjustment module (300). The rule tree construction module (100) is used to construct the rule node structure of the condition field and the action field, and generate the rule tree structure according to the rule node structure and the standard task template; The behavior execution control module (200) is used to construct a behavior logic model based on the rule tree structure, maintain execution pointers through the behavior logic model to control the progress of the task process, and realize task scheduling and interruption switching through a task priority management mechanism in a multi-task running scenario. The state perception and path adjustment module (300) is used to collect state data to form a state vector during task execution, and dynamically adjust the task flow path through a state deviation judgment and correction mechanism.