Method and device for automatically identifying and repairing abnormal behaviors of equipment and medium
By building environmental characterization and using hybrid model inspection technology, comprehensive detection and repair of equipment abnormal behavior is solved, abnormality caused by environmental changes and user operations are identified and repaired, and the stability and user experience of equipment operation are improved.
Patent Information
- Application Number
- CN202410024837.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-08
- Publication Date
- 2025-07-08
AI Technical Summary
The prior art is difficult to fully and correctly identify equipment abnormal behavior, especially due to changes in environmental status and user operations, and lacks effective abnormality repair strategies.
Through an environment-centric approach, environmental characterization is constructed, the abnormal behavior of the equipment is identified using hybrid model inspection technology, and the event-driven method is used to repair it, combining linear timing logic and metric timing logic to generate repair strategies.
实现了对设备异常行为的深入分析和全面检测,降低了环境建模难度,支持非专业用户的属性定义,增强了修复策略与用户意图的一致性。
Smart Images

Figure CN120276888A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of software engineering and ubiquitous computing, and in particular, to a method, device, and medium for automatically identifying and repairing abnormal behaviors of devices centered around the environment. Background Art
[0002] With the booming development of the Internet of Things (IoT), a large number of devices and automated applications have been deployed into the environments of people's daily life and work, bringing great convenience to people's lives. In such an environment, various factors such as the deployed applications, users in the environment, and changes in the external environment jointly affect the devices deployed in the environment. How to ensure that the operating state of the devices meets the expectations of users is crucial.
[0003] In the fields of software engineering and ubiquitous computing, through model checking methods, specific types of applications deployed in the environment can be modeled, and it can be determined whether the execution of the applications will cause abnormal device behaviors. However, the root causes of abnormal device behaviors in the environment are not limited to the calls of applications to devices. They may also come from changes in the environmental state and offline operations of users on devices in the environment. At the same time, the execution effects of devices are closely related to the environmental state. Therefore, device abnormal behavior detection oriented to applications cannot comprehensively and correctly identify all potential device abnormal behaviors. On the other hand, the repair of abnormal behaviors needs to ensure that the usage requirements of users are met. How to select the correct abnormal repair strategy is particularly important. Summary of the Invention
[0004] The purpose of the present invention is to provide a method, device, and medium for automatically identifying and repairing abnormal behaviors of devices centered around the environment. By automatically analyzing potential abnormal behaviors corresponding to user-defined environmental attributes from the environmental level rather than the application level, detecting and repairing abnormal identifications based on the environmental state changes caused by different devices in the environment, and ensuring good real-time performance.
[0005] The purpose of the present invention can be achieved through the following technical solutions:
[0006] A method for automatically identifying and repairing abnormal behaviors of devices centered around the environment includes the following steps:
[0007] S1, respectively obtain spatial information in the environment and device information deployed in the environment based on an environmental space model that describes the topological structure relationship of different spaces in the environment and the states and attributes of each space, and a device description model that describes the impact of device services on the environmental state under different environmental states, and automatically merge them into an environmental representation that describes the physical environment in the digital space;
[0008] S2. Obtain the abnormal device behaviors in the environment that violate the spatio-temporal security constraints defined by the end user through the environment attribute template based on the static environment information provided in the environment representation, and convert the environment attributes configured by the user into Linear Temporal Logic (LTL) and Metric Temporal Logic (MTL).
[0009] S3. Use the hybrid model checking technique to detect the linear temporal logic describing the spatial state attributes and the metric temporal logic describing the time trace attributes on the Büchi automaton that describes the environmental state transition constructed from the device information and spatial information described in the environment representation, identify potential violations and generate repair strategies.
[0010] S4. At runtime, monitor the device services in the environment representation that may cause violations in an event-driven manner, identify the abnormal device behaviors occurring in the environment, and select the corresponding repair strategies for anomaly repair.
[0011] The device services include sensing event services and executable action services. Among them, the sensing event services describe all events provided by the device, and the executable action services describe all executable actions provided by the device, and detail the effects of the action under different environmental conditions.
[0012] The environmental space model defines the ID, type, attributes, state of the space, and its relationship with other spaces. By instantiating all spatial information into specific space instances and automatically connecting the spaces based on the location relationship, the representation of the space concept is completed.
[0013] In the device description model, the device information and device state respectively describe the basic information and working state of the device. Based on the device information and device state, a device instance is generated, and the device instance is connected to the event and action instances provided by the device.
[0014] The specific process of automatically merging them into an environment representation that describes the physical environment in the digital space is as follows: Associate it with the environmental space according to the device location information in the device information, and associate the impact of the device service on the environmental space with the target space with the space where the device is located as the coordinate.
[0015] The specific steps of step S2 are as follows: The end user selects the corresponding environmental attribute template according to the environmental attribute description information, and selects the corresponding environmental values according to the environmental static information provided in the environmental representation and fills them into the environmental attribute template to complete the configuration; Automatically convert the attributes related to the environmental space state into formally defined linear temporal logic formulas, and convert the attributes related to the temporal trajectory of the environmental state into metric temporal logic formulas.
[0016] The specific steps of step S3 are as follows: According to the linear temporal logic formula and metric temporal logic formula corresponding to the environmental attributes, select the relevant device information and space information from the environmental representation to construct a Büchi automaton that includes all potential device abnormal behaviors, and use model checking technology to identify the abnormal states and device services that cause the abnormal states in the Büchi automaton according to the linear temporal logic formula and metric temporal logic formula, and record them as abnormal device behaviors; By identifying the device services that transfer from abnormal states to non-abnormal states, record them as possible repair strategies.
[0017] The specific steps of step S4 are as follows: During the operation of the system, monitor the environmental representation state in an event-driven manner, identify the device abnormal behaviors recorded during offline analysis, and preferentially select legal behaviors with the same function as the detected device abnormal behaviors to replace the illegal behaviors, so as to repair the abnormal behaviors on the premise of ensuring the user's operation intention for the device.
[0018] An environment-centered device abnormal behavior automatic recognition and repair device includes a memory, a processor, and a program stored in the memory. When the processor executes the program, it implements the method as described above.
[0019] A storage medium stores a program, and when the program is executed, it implements the method as described above.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] (1) The environmental modeling and representation method proposed by the present invention makes a fine-grained description of the interaction between the environmental context and device services, thus supporting in-depth and comprehensive analysis of device abnormal behaviors. At the same time, based on the proposed device description model and environmental space model, the present invention further supports the automatic construction of environmental representations and reduces the difficulty of environmental modeling.
[0022] (2) The environmental attribute description method proposed by the present invention can help end-users without professional development experience define the attributes that the spatial state and temporal trajectory in the environment need to meet through template configuration and easily click with the mouse on the visual interface, reducing the complexity of attribute definition; at the same time, it supports experts with professional development experience to directly write more complex environmental attributes according to the proposed attribute definition syntax, enhancing the flexibility of environmental attribute definition.
[0023] (3) The environment-centered device abnormal behavior detection method proposed by the present invention makes up for the deficiency of existing methods that only consider the applications deployed in the environment and lack the detection of device abnormal states caused by offline user behaviors and environmental changes.
[0024] (4) The device abnormal behavior repair method proposed by the present invention takes into account the possible user intentions contained in the device actions that lead to violations, and preferentially selects legal device services with the same effect to replace the abnormal behaviors when repairing abnormal behaviors, enhancing the consistency between the abnormal repair strategy and the user intentions. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a schematic diagram of the method flow of the present invention;
[0026] Figure 2 is a conceptual model diagram of the environmental representation constructed by the present invention;
[0027] Figure 3 is a schematic diagram of the environmental attribute template definition in an embodiment;
[0028] Figure 4 is a schematic diagram of the syntax definition of the MTL formula in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0029] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment is implemented on the premise of the technical solution of the present invention, and gives the detailed implementation manner and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0030] This embodiment provides an environment-centered device abnormal behavior automatic recognition and repair method, which analyzes the spatial and device information in the environment by using the model checking method in the offline stage, identifies potential device abnormal behaviors and finds possible repair solutions; monitors the environment in the form of event-driven during system operation, identifies device abnormal behaviors occurring in the environment, and selects a repair strategy that meets the user intentions for abnormal repair. Specifically, as Figure 1 shown, it includes the following steps:
[0031] S1. Based on the environmental space model that describes the topological structure relationships of different spaces in the environment and the states and attributes of each space, and the device description model that describes the impact of device services (perception events, executable actions) on the state of the environment under different environmental states, obtain the space information in the environment and the device information deployed in the environment respectively, and automatically merge them into an environmental representation that describes the physical environment in the digital space.
[0032] In this embodiment, a structured conceptual model is used to model the effects of the event types and action types provided by the devices deployed in the environmental space on the space state under different environmental conditions. The conceptual model of its environmental representation is as Figure 2 shown.
[0033] Among them, the "space" concept defines the space state and topological structure in the physical environment. The relationships between different spaces include "adjacent" and "reachable". The "device" concept defines the concept of environmental devices deployed in the physical environment, and describes its installation location through the deployment relationship "located in" with the space. The "event" concept is connected to the device through the "provide" relationship, and defines the device services of the perception event type provided by the device. The event will update the corresponding state of the environmental space, and it is connected to the corresponding space through the "update" relationship. The "action" concept defines the executable functions provided by the device, and it is connected to the corresponding device that provides the action through the "provide" relationship. The "effect" concept describes the impact of different actions on the space state in the environment (such as the environmental temperature rises, the environmental humidity drops, etc.), and it is connected to the action with this effect through the "has" relationship, and is connected to the target space described by this effect through the "affect" relationship. The "environmental condition" defines the specific environmental space state required to produce the effect (for example, the window-opening action has the effect of cooling the environment, and its environmental condition is that the outdoor temperature is lower than the indoor temperature), and it is connected to the associated environmental space through the "according to" relationship, and is connected to the effect that needs to meet this environmental condition through the "needs to meet" relationship.
[0034] In order to automatically instantiate the environmental concept model into an environmental representation for a specific environment, the present invention proposes a device description model and an environmental space model to provide the device information and space information in the environment, and automatically convert them into an environmental representation according to the conceptual model.
[0035] The environmental space model defines the ID, type, attributes, state of the space, and its relationships with other spaces. By instantiating all the space information into specific space instances and automatically connecting them based on the position relationship, the representation of the space concept can be completed.
[0036] In the device description model, device information and device status respectively describe the basic information and working status of a device. These information are used to generate device instances, and these instances are connected to the event and action instances provided by the device. The event service describes all the events provided by the device. The action service describes all the executable actions provided by the device and details the effects that the action has under different environmental conditions. All the device instances generated by the device description model can be automatically associated with spatial instances according to the location information of the device, so as to complete the construction of environmental representation.
[0037] This embodiment uses a graph database (i.e., Neo4J) to create and maintain instances and relationships of environmental representation, where instances correspond to nodes and the relationships between instances correspond to directed edges between nodes. In the offline stage, the environmental representation provides static interaction information between device services and spatial status. During runtime, the representation updates the corresponding spatial and device status according to events and actions. By querying the graph database, environmental status information, environmental event subscription information, and device action invocation information can be obtained. The specific configuration interfaces and customization interfaces are named as follows:
[0038] The interface for querying the current environmental status is: / getCurrentState
[0039] The interface for querying environmental historical events is: / getHistoeyEvent
[0040] The interface for subscribing to environmental perception events is: / subscribeEvent
[0041] The interface for invoking a device to execute an action is: / executeAction
[0042] S2. Obtain the abnormal device behaviors that violate spatio-temporal safety constraints in the environment defined by the end user through the environmental attribute template configuration based on the environmental static information provided in the environmental representation, and convert the environmental attributes configured by the user into Linear Temporal Logic (LTL) and Metric Temporal Logic (MTL).
[0043] This embodiment proposes a template-based method for describing environmental attributes, and its template information is as Figure 3 shown. Among them, templates #1 to #4 are LTL templates for describing environmental spatial status attributes, and templates #5 to #8 are MTL templates for describing environmental temporal status trajectories. The end user selects the corresponding template according to the environmental attribute description information and fills in the corresponding environmental values according to the environmental static information provided in the environmental representation to complete the configuration. The configured template will be converted into the corresponding LTL / MTL formula for subsequent attribute detection.
[0044] To support experts with development experience in more flexibly defining environment attributes, this embodiment supports directly writing LTL formulas or MTL formulas that meet specific syntax formats as an alternative to the template-based attribute configuration method. Among them, the syntax definition of the MTL formula is as Figure 4 shown. All MTL formulas that meet the syntax requirements can be used for subsequent abnormal behavior detection and repair.
[0045] In this embodiment, a corresponding attribute configuration information parsing service is developed using the Python language to specifically perform adhoc parsing on each type of attribute template and complete its automated conversion to LTL / MTL formulas.
[0046] S3. The hybrid model checking technique is used to detect the linear temporal logic describing the spatial state attributes and the metric temporal logic describing the temporal trace attributes on the Büchi automaton that describes the environmental state transition constructed from the device information and spatial information described in the environmental representation, identify potential violations, and generate repair strategies.
[0047] Specifically, according to the linear temporal logic formula and the metric temporal logic formula corresponding to the environmental attributes, relevant device information and spatial information are selected from the environmental representation to construct a Büchi automaton that contains all potential device abnormal behaviors, and the abnormal states and device services that lead to the occurrence of abnormal states in the Büchi automaton are identified according to the linear temporal logic formula and the metric temporal logic formula through model checking technology and recorded as abnormal device behaviors; by identifying the device services that transfer from abnormal states to non-abnormal states and recording them as possible repair strategies.
[0048] In a preferred embodiment, the model checking method and the method of constructing an MTL parser are respectively used to detect the environmental spatial state and environmental temporal trace anomalies according to the information described in the environmental representation, and determine whether there are abnormal states that do not meet the user-defined environmental attributes.
[0049] The process of identifying environmental spatial state anomalies based on the model checking method is as follows:
[0050] A1: For each LTL formula, relevant device information is extracted from the environmental representation to construct an environmental Büchi automaton that contains all possible abnormal behaviors.
[0051] A2: Negate the LTL formula describing the environmental attributes to convert it into an LTL formula describing the violation of the environmental attributes, and combine each negated formula with the corresponding environmental Büchi automaton through the Cartesian product to find the states in all environmental Büchi automata that violate the environmental attributes.
[0052] A3: Find all state transitions from the normal environmental state to the state that violates the environmental attributes and their corresponding pre - environmental states, and record each event or action that causes the environment to transition from the normal state to the abnormal state as a violation behavior of the device.
[0053] A4: Listen for perception events and device actions in the environment during runtime, and determine whether the newly occurred events or actions are recorded as violation behaviors in the current state.
[0054] The process of identifying environmental temporal trace anomalies based on the MTL parser is as follows:
[0055] B1: For each MTL formula, parse it according to the MTL syntax definition, and split it into a trace trigger Trigger, a tracking timer Timer, and a state constraint Condition.
[0056] B2: Use the same model - checking method for the state condition Condition that the environment needs to satisfy during the tracking process. By constructing an environmental Büchi automaton and combining it with the negation of Condition, find all environmental states that violate Condition and the device services that cause this state, and record them together with the corresponding Trigger and Timmer as an environmental temporal trace Trace.
[0057] B3: During runtime, listen for environmental perception events related to the environmental trigger Trigger for each Trace. Whenever Trigger is triggered, judge Condition within Timer. If Condition is not satisfied, it is identified as an anomaly; if Condition is satisfied, it is identified as normal.
[0058] This embodiment uses the SPOT model - checking tool to complete the construction of the environmental representation Büchi automaton, the conversion of the negation of the LTL formula, and the combination of the negated LTL formula and the Büchi automaton during the process of detecting environmental spatial state anomalies; uses the PLY tool to construct a parser for MTL formulas based on the above - defined MTL syntax to complete the conversion from MTL formulas to Traces.
[0059] S4. During runtime, monitor the device services in the environmental representation that may cause violations in an event - driven manner, identify abnormal device behaviors occurring in the environment, and select corresponding repair strategies for anomaly repair.
[0060] Specifically, during the operation of the system, the environmental representation state is monitored in an event-driven manner to identify the abnormal device behaviors recorded during offline analysis, and legal behaviors with the same function as the detected abnormal device behaviors are preferentially selected to replace the illegal behaviors, so as to achieve the repair of abnormal behaviors while ensuring the user's operation intention for the device.
[0061] In a preferred embodiment, a model checking method is adopted to find feasible repair strategies for the illegal behaviors that violate the LTL and MTL formulas, and repair strategies with the same effect as the illegal behaviors are preferentially selected for execution. The abnormal behavior repair process is as follows:
[0062] C1: For each LTL / MTL formula, analyze the environmental Büchi automaton marked with abnormal states obtained during the abnormal identification process, find the device execution actions that transfer each abnormal state to a normal state, and record them as potential repair strategies.
[0063] C2: During operation, find all the corresponding repair strategies for all the identified abnormal behaviors, and filter out the repair strategies that will not cause new abnormalities. If there is no legal repair strategy, an alarm is issued.
[0064] C3: Among all the legal repair strategies, preferentially select the repair actions with the same effect as the abnormal device behaviors that lead to the current abnormal state for execution; if not, randomly execute any legal repair strategy.
[0065] In this embodiment, the SPOT model checking tool is used to complete the retrieval of potential repair strategies in C1, the Python language is used to develop the corresponding runtime abnormal behavior repair service to complete the screening of runtime abnormal behavior repair strategies, and the execution function interface of the corresponding device is queried by calling the environmental representation module to complete the execution of abnormal repair.
[0066] This embodiment also provides an environment-centered automatic identification and repair device for abnormal device behaviors, including a memory, a processor, and a program stored in the memory. When the processor executes the program, the method described above is implemented.
[0067] If the above functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this 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 for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0068] The preferred specific embodiments of the present invention have been described in detail above. It should be understood that those of ordinary skill in the art can make many modifications and variations based on the concept of the present invention without creative efforts. Therefore, all technical solutions that can be obtained by those skilled in the art in the technical field based on the concept of the present invention through logical analysis, reasoning, or limited experiments on the basis of the prior art should fall within the protection scope determined by the claims.
Claims
1. An automatic recognition and repair method for abnormal behaviors of environment-centered devices, characterized in that Including the following steps: S1. Based on the environmental space model that describes the topological structure relationship of different spaces in the environment and the states and attributes of each space, and the device description model that describes the impact of device services on the environmental state under different environmental states, obtain the space information in the environment and the device information deployed in the environment respectively, and automatically merge them into an environmental representation that describes the physical environment in the digital space; S2. Obtain the abnormal device behaviors that violate the spatio-temporal security constraints in the environment defined by the end user through the environmental attribute template configuration based on the environmental static information provided in the environmental representation, and convert the environmental attributes configured by the user into linear temporal logic and metric temporal logic; S3. Use the hybrid model checking technology to detect the linear temporal logic that describes the space state attributes and the metric temporal logic that describes the time trace attributes on the Büchi automaton that describes the environmental state transition constructed by the device information and space information described in the environmental representation respectively, identify potential violations and generate repair strategies; S4. At runtime, monitor the device services in the environmental representation that may cause violations in an event-driven manner, identify the abnormal device behaviors that occur in the environment, and select the corresponding repair strategies to repair the anomalies.
2. The method for automatically identifying and repairing abnormal behaviors of an environment-centered device according to claim 1, characterized in that, The device services include sensing event services and executable action services. Among them, the sensing event services describe all events provided by the device, the executable action services describe all executable actions provided by the device, and detail the effects of the actions under different environmental conditions.
3. The method for automatically identifying and repairing abnormal behaviors of an environment-centered device according to claim 1, characterized in that, The environmental space model defines the ID, type, attributes, states of the space and its relationship with other spaces. By instantiating all space information into specific space instances and automatically connecting the spaces based on the location relationship, the representation of the space concept is completed.
4. The automatic recognition and repair method for abnormal behavior of an environment-centered device according to claim 1, characterized in that In the device description model, the device information and device status respectively describe the basic information and working status of the device. Based on the device information and device status, a device instance is generated, and the device instance is connected to the event and action instances provided by the device.
5. The method for automatically identifying and repairing abnormal behaviors of an environment-centered device according to claim 1, characterized in that The automatically merging them into an environmental representation that describes the physical environment in the digital space specifically means: associating the device location information in the device information with the environmental space, and associating the impact of the device service on the environmental space with the target space with the space where the device is located as the coordinate.
6. The method for automatically identifying and repairing abnormal behaviors of an environment-centered device according to claim 1, characterized in that, The step S2 specifically means: the end user selects the corresponding environmental attribute template according to the environmental attribute description information, and selects the corresponding environmental value according to the environmental static information provided in the environmental representation and fills it into the environmental attribute template to complete the configuration; automatically convert the attributes related to the environmental space state into formally defined linear temporal logic formulas, and convert the attributes related to the environmental state time trace into metric temporal logic formulas.
7. An automatic recognition and repair method for abnormal behaviors of an environment-centered device according to claim 1, characterized in that, The specific steps of step S3 are as follows: According to the linear temporal logic formula and the metric temporal logic formula corresponding to the environmental attributes, relevant device information and spatial information are selected from the environmental representation to construct a Büchi automaton that includes all potential device abnormal behaviors, and the abnormal states and device services that lead to the occurrence of abnormal states in the Büchi automaton are identified by model checking technology according to the linear temporal logic formula and the metric temporal logic formula, and they are recorded as abnormal device behaviors; By identifying the device services that transfer from abnormal states to non-abnormal states and recording them as possible repair strategies.
8. An automatic recognition and repair method for abnormal behaviors of an environment-centered device according to claim 1, characterized in that, The specific steps of step S4 are as follows: During the operation of the system, the environmental representation state is monitored in an event-driven manner, the device abnormal behaviors recorded during offline analysis are identified, and legal behaviors with the same function as the detected device abnormal behaviors are preferentially selected to replace the illegal behaviors, so as to realize the repair of abnormal behaviors on the premise of ensuring the user's operation intention for the device.
9. An environment-centered device abnormal behavior automatic recognition and repair device, comprising a memory, a processor, and a program stored in the memory, characterized in that, When the processor executes the program, the method described in any one of claims 1-8 is implemented.
10. A storage medium, on which a program is stored, characterized in that, When the program is executed, the method described in any one of claims 1-8 is implemented.