Method and system for dynamically configuring and triggering event policies

By using static dictionary descriptors and similarity matching to optimize event strategies in intelligent robot systems, the high maintenance costs and security risks of event handling in existing technologies are solved, thereby improving flexibility and accuracy.

CN119312106BActive Publication Date: 2025-11-21NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411482401.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-11-21
Estimated Expiration
2044-10-23

AI Technical Summary

Technical Problem

Existing event handling methods result in high maintenance costs, poor scalability, and security vulnerabilities in software systems, and are unable to adapt to event handling in different scenarios and with different needs.

Method used

Preset events are described using static dictionary-style descriptors. An event processing system is built, and target preset events are determined through similarity matching and priority. Event triggering strategies are dynamically configured, and the complexity of the strategies is optimized using a state machine model and control flow diagram.

Benefits of technology

It achieves flexibility and scalability in event handling, ensures the accuracy of intelligent robot status updates and clarity of control, and reduces system complexity and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312106B_ABST
    Figure CN119312106B_ABST
Patent Text Reader

Abstract

The application relates to a method and system for dynamically configuring and triggering an event strategy, which comprises the following steps: setting a plurality of preset events of an intelligent agent, and acquiring event descriptors of the preset events; constructing an event processing system, and performing similarity matching between original events and the event descriptors of the preset events; and updating a system state of the intelligent agent. The application ensures that the control of the intelligent robot is accurate and clear, and the state updating of the intelligent robot is accurate and timely.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of robots, in particular to a method for dynamically configuring and triggering event strategies and a system thereof. BACKGROUND

[0002] With the development of information technology, event processing has become an indispensable part of software systems. Event processing refers to the process of responding and handling events triggered by external or internal factors, such as user operations, system state changes, and exceptions. The purpose of event processing is to realize the functions and logic of software systems and improve their usability and reliability. Event processing usually requires designing different event strategies according to different event types and trigger conditions, i.e., rules and methods for classifying, abstracting, triggering, and responding to events. The design of event strategies needs to consider factors such as event effectiveness, complexity, and flexibility to ensure the correctness and efficiency of event processing.

[0003] However, the existing event processing methods have the following problems: event strategy configuration and update are not flexible: traditional processing methods usually hard-code event strategies in software systems, which has the following disadvantages: increases the maintenance cost of software systems, and each time the event strategy is modified or added, the software system needs to be recompiled and deployed; reduces the scalability of software systems, and cannot adapt to event processing under different scenarios and requirements; affects the security of software systems, and if there are vulnerabilities or errors in the event strategy, it may cause the software system to appear abnormal or crash, thereby affecting the accuracy of the state update of the robot.

[0004] Therefore, it is necessary to provide a method for dynamically configuring and triggering event strategies and a system thereof to solve the above problems. SUMMARY

[0005] The present application provides a method for dynamically configuring and triggering event strategies and a system thereof to solve the problems of existing methods that increase the maintenance cost of software systems, each time the event strategy is modified or added, the software system needs to be recompiled and deployed; reduce the scalability of software systems, and cannot adapt to event processing under different scenarios and requirements; affect the security of software systems, and if there are vulnerabilities or errors in the event strategy, it may cause the software system to appear abnormal or crash, further affecting the accuracy of the state update of the robot.

[0006] The method for dynamically configuring and triggering event strategies of the present application adopts the following technical scheme, comprising:

[0007] A plurality of preset events of the agent are set, and each preset event is described by a descriptor in the form of a static dictionary to obtain an event descriptor, the event descriptor representing a current system state of the agent; the event descriptor includes an event type, an event attribute, an event priority, and a weight of the event attribute; wherein, the preset event includes an event trigger condition and an action performed by the agent after the event is triggered; the native event includes an object recognized by the agent and a recognition result;

[0008] An event processing system is constructed based on the event descriptor, and the event processing system is used to perform similarity matching between the native event and the preset event according to the event attribute and the event type of the native event and the event attribute and the event type in the event descriptor of the preset event when the native event occurs;

[0009] The preset event corresponding to the maximum priority in the preset priority of all the preset events matched successfully is taken as a target preset event, the target preset event is triggered by the native event, and the system state of the agent is updated after the target preset event is triggered by the native event.

[0010] Preferably, the step of describing each preset event by a descriptor in the form of a static dictionary to obtain an event descriptor is:

[0011] The event type, the event attribute, the current system state of the agent, the event priority, and the weight of the event attribute of each preset event are obtained.

[0012] The event type, the event attribute, the current system state of the agent, the event priority, and the weight of the event attribute of the preset event are represented in a structured format, and the representation result is taken as the event descriptor.

[0013] The structured format is XML or JSON.

[0014] Preferably, the step of constructing the event processing system is:

[0015] The event processing system is abstracted into a set of states, a set of inputs, a set of outputs, and a set of state transition functions by using a state machine model.

[0016] The set of states is the specific characteristics of the agent in different times, places, and conditions in the event descriptor; the set of inputs is the native event; the set of outputs is the operation steps or methods from the input native event to the processing result, used to respond to the native event; and the set of state transition functions is the similarity matching logic between the native event and the event descriptor of the preset event.

[0017] Preferably, the step of performing similarity matching between the native event and the event descriptor of the preset event is:

[0018] Based on the event type and event attributes of the native event, and the corresponding event type, event attributes, and weights of the event attributes in the event descriptor of each preset event, the similarity between the native event and each preset event is obtained.

[0019] Native events with a similarity greater than a preset similarity threshold are used as preset events for successful matching.

[0020] Preferably, the expression for the similarity between native events and preset events is:

[0021]

[0022] In the formula, Indicates the similarity between native events and preset events; This represents the weight of the i-th event attribute in the event descriptor of the preset event; This represents the i-th event attribute in the event descriptor of the preset event; This represents the i-th event property of the native event. This represents the distance between the i-th event attribute in the event descriptor of the preset event and the i-th event attribute of the native event. This indicates the total number of event attributes in the event descriptor of the preset event.

[0023] Preferably, it further includes:

[0024] The control flow diagram of the event processing system is constructed based on the event descriptor. Each node in the control flow diagram represents the state or operation of the event processing system, and each path represents the transition from one agent's state to another.

[0025] The complexity of the control flow diagram is determined by the number of paths, nodes, and connected components in the control flow diagram.

[0026] Using the complexity of the control flow diagram as the optimization objective, a heuristic algorithm is employed to optimize the strategy method of this invention until the complexity of the optimized strategy method is minimized. The optimized strategy method corresponding to the minimum complexity is then used as the final dynamic configuration and triggering event strategy method.

[0027] Preferably, the expression for controlling the complexity of the flowchart is:

[0028]

[0029] In the formula, Control flow diagram The complexity; Control flow diagram The total number of paths in; Control flow diagram the number of nodes in the graph; P represents the control flow graph the number of connected components of the graph.

[0030] A system for dynamically configuring and triggering event strategies, comprising:

[0031] A parameter setting module for setting a plurality of preset events of an agent, each of the preset events being described by a descriptor in the form of a static dictionary to obtain an event descriptor, the event descriptor representing a current system state of the agent; the event descriptor including an event type, an event attribute, an event priority, and a weight of the event attribute; wherein the preset event includes an event triggering condition and an action performed by the agent after the event is triggered; and the native event includes an object recognized by the agent and a recognition result.

[0032] An event matching module for constructing an event processing system based on the event descriptor, the event processing system being configured to perform similarity matching between the native event and the preset event according to the event attribute and the event type of the native event and the event attribute and the event type in the event descriptor of the preset event when the native event occurs.

[0033] and a state updating module for taking a preset event corresponding to a maximum priority among preset priorities of all the matching preset events as a target preset event, triggering the target preset event by the native event, and updating the system state of the agent according to an action performed by the agent after the target preset event is triggered by the native event.

[0034] The beneficial effects of the present application are:

[0035] The preset events are classified and abstracted by the event processing system, the event strategies are dynamically configured and updated based on the preset events, the flexibility and scalability of event processing are realized, the native event is taken as a triggering condition for state transition, the event strategies are optimized based on complexity, the preset events are ensured to be effectively triggered and the triggering logic is not overly complex, the control of the intelligent robot is ensured to be accurate and clear, and the state update of the intelligent robot is ensured to be accurate and timely. BRIEF DESCRIPTION OF DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0037] Figure 1 A flowchart of a method for dynamically configuring and triggering event strategies of the present application. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the protection scope of the present application.

[0039] An embodiment of a method for dynamically configuring and triggering event strategy of the present application, as shown in Figure 1 , comprises:

[0040] S1, setting a plurality of preset events of an intelligent agent, and obtaining an event descriptor of the preset event;

[0041] Specifically, a plurality of preset events of an intelligent agent are set, and a descriptor in the form of a static dictionary is used to describe each preset event to obtain an event descriptor, the event descriptor representing the current system state of the intelligent agent; the event descriptor includes an event type, an event attribute, an event priority, and a weight of the event attribute; wherein, the preset event includes an event triggering condition and an action performed by the intelligent agent after the event is triggered; the native event includes an object recognized by the intelligent agent and a recognition result.

[0042] The step of obtaining an event descriptor by using a descriptor in the form of a static dictionary to describe each preset event is: obtaining an event type, an event attribute, an event triggering condition, an event priority, and a weight of the event attribute of each preset event; representing the event type, the event attribute, the event triggering condition, the event priority, and the weight of the event attribute of the preset event in a structured format, and taking the representation result as the event descriptor; wherein, the structured format is XML or JSON. In this embodiment, the event type, the event attribute, the event triggering condition, the event priority, and the weight of the event attribute of the preset event are represented in a structured format (such as XML or JSON), the representation result is taken as the descriptor of the event, and stored in an external file, so as to facilitate dynamic modification and update. An event descriptor can be represented as:

[0043]

[0044] wherein, is an event type, i.e., a category of the event, such as "system event" and "user event", indicating the general classification of the event; is an event attribute, the event attribute including feature, time, and location information, the event attribute being represented in the form of a vector: , is the i-th event attribute; The priority of an event is indicated by an integer or floating-point number. The larger the value, the higher the priority of the event. This is used to determine the priority of each preset event. This represents the weights of different event attributes, with the weight of the i-th event attribute being... And satisfy For intelligent robots, an abstract event uses different fields to specify the triggering conditions of the event (such as the confidence that a visual sensor sees a flower with a confidence level greater than 95%) and the behavior after the trigger (such as making a waving gesture).

[0045] S2. Build an event handling system and perform similarity matching between the event descriptors of native events and preset events;

[0046] Specifically, an event handling system is built based on event descriptors. When a native event occurs, the event handling system performs similarity matching between the native event and the preset event based on the event attributes and event type of the native event and the event attributes and event type in the event descriptor of the preset event.

[0047] Step 21, constructing the event processing system includes: using a state machine model, abstracting the event processing system into a set of states, a set of inputs, a set of outputs, and a set of state transition functions; wherein, a set of states are the specific characteristics of the agent reflected by the event descriptors at different times, places, and conditions; a set of inputs are the original events; a set of outputs are the processes or methods, that is, the specific operation steps or methods of the system in response to the processing results of the input events; and a set of state transition functions are the similarity matching logic between the event descriptors of the original events and the preset events.

[0048] Step 22, the steps for similarity matching between the event descriptors of native events and preset events are as follows:

[0049] Because similarity matching primarily relies on event type and event attributes, when the native event... When it occurs, based on the native event Event types and event properties , will native events With the preset event descriptor Event types and event properties Similarity matching is performed. Specifically, in this embodiment, based on the event type and event attributes of the native event, and the corresponding event type, event attributes, and weights of the event attributes in the event descriptor of each preset event, the similarity between the native event and each preset event is obtained; native events with similarity greater than a preset similarity threshold are considered successfully matched preset events. In this embodiment, the similarity threshold is set to 0.8. The expression for the similarity between the native event and the preset event is:

[0050]

[0051] wherein, represents the similarity between the primitive event and the preset event; represents the weight of the i-th event attribute in the event descriptor of the preset event; represents the i-th event attribute in the event descriptor of the preset event; represents the i-th event attribute of the primitive event, represents the distance value between the i-th event attribute in the event descriptor of the preset event and the i-th event attribute of the primitive event; represents the total number of event attributes in the event descriptor of the preset event; represents the distance value between the event type in the event descriptor of the preset event and the event type of the primitive event.

[0052] For the intelligent robot, the "visual sensor recognizes the object" is a primitive event, the event type of the primitive event is flower, the event attributes of the primitive event are: the confidence of the object being flower = 99%, the color of the flower and the position information; and the preset event is "seeing the flower waving hand", the triggering condition is that the confidence of the flower is higher than 95%, and the waving hand action is executed after triggering.

[0053] S3, updating the system state of the agent;

[0054] Specifically, the preset event corresponding to the maximum priority in the preset priority corresponding to all the matched preset events is taken as a target preset event, the target preset event is triggered by the primitive event, and the system state of the agent is updated according to the action executed by the agent after triggering the target preset event by the primitive event.

[0055] In the embodiment, when the event is successfully matched, the preset event with the highest priority among the matched preset events is triggered according to the priority of the matched preset event The triggering of the preset event, that is, the triggering logic of the preset event in the embodiment depends on the similarity and the priority . The similarity measures the matching degree of the primitive event and the preset event, and the priority reflects the importance of the primitive event in multiple alternative preset events. In order to enhance the flexibility and accuracy of the system, the basis for event triggering is not only whether the matching is successful or not, but also needs to be screened through the comprehensive calculation of the similarity and the priority to select the optimal event for response. That is, the priority of the preset event is represented according to the event priority defined in the event descriptor of the preset event , the matched preset events are sorted and screened. According to the target parameters defined in the descriptor of the triggering event, the corresponding process or method is executed, and the current state is updated.

[0056] It should be noted that decoupling the preset event from the response logic improves the effectiveness of the event processing system. Taking a smart robot as an example, when multiple preset events are met, such as "seeing flowers waving hands" and "swaying heads when idle", both of which are matched by the similarity matching result, i.e., both are matched preset events, the priority of "seeing flowers waving hands" is set to be higher than that of "swaying heads when idle" .Although both preset events are successfully matched, since "seeing flowers waving hands" is preset to have a higher priority, the preset event of "seeing flowers waving hands" is triggered at this time. After completing the waving action, the state of the smart robot is updated to "just waved hands", and the priority of "seeing flowers waving hands" is reduced to avoid repeated triggering, thereby ensuring the diversity and dynamic adjustment capability of the event processing system. Although both preset events are successfully matched, since "seeing flowers waving hands" is preset to have a higher priority, the preset event of "seeing flowers waving hands" is triggered at this time. After completing the waving action, the state of the smart robot is updated to "just waved hands", and the priority of "seeing flowers waving hands" is reduced to avoid repeated triggering, thereby ensuring the diversity and dynamic adjustment capability of the event processing system.

[0057] Further comprising: an optimization step of a method for dynamically configuring and triggering an event strategy: constructing a control flowchart of an event processing system based on an event descriptor, each node in the control flowchart representing a state or operation of the event processing system, and each path representing a transition from one state of an agent to another state; obtaining the complexity of the control flowchart based on the number of paths, the number of nodes, and the number of connected components in the control flowchart; taking the complexity of the control flowchart as an optimization target, and using a heuristic algorithm to optimize the strategy method of steps S1-S3 until the complexity of the optimized strategy method is minimized, and taking the optimized strategy method corresponding to the minimum complexity as the final dynamic configuration and triggering event strategy method.

[0058] wherein the expression of the complexity of the control flowchart is:

[0059]

[0060] In the formula, represents the complexity of the control flowchart ; represents the total number of paths in the control flowchart ; represents the number of nodes in the control flowchart ; and P represents the control flowchart The number of connected components is usually 1. When reading the configuration file of the dynamic configuration and triggering event strategy, the possible triggering paths in the event strategy are analyzed. That is, the total number of paths in the control flow graph corresponding to the event strategy is analyzed by using the McCabe complexity algorithm. Based on the event descriptor, the control flow graph (CFG) of the event processing system is constructed, wherein each node in the control flow graph represents a state or operation of the event processing system, each edge in the control flow graph represents a path from one state to another state, and reflects the complexity of the control structure of the event strategy. The advantage of this step is that the complexity of the event strategy can be quickly evaluated without executing the event strategy, thereby improving the maintainability and optimizability of the event processing system.

[0061] If the complexity of a certain event strategy is high, it indicates that the control logic of the event strategy is too complex and needs to be simplified. Therefore, the complexity of the event strategy with high complexity is reduced. That is, the dynamic configuration and triggering event strategy is optimized by using a heuristic algorithm with the complexity as the target, and the dynamic configuration and triggering event strategy scheme with the minimum complexity is taken as the final dynamic configuration and triggering event strategy method, so as to simplify the complexity of the event strategy and improve the maintainability of the system. The difference between the complexity of the final dynamic configuration and triggering event strategy after optimization and the complexity before optimization is quantified by the following formula:

[0062]

[0063] -

[0064] The complexity reduction brought by optimization is measured by The greater indicates the better optimization effect, that is, the smaller the complexity, the better the optimization of the scheme, so the minimum complexity is selected as the optimization target in this embodiment.

[0065] ​​​The system for dynamically configuring and triggering event strategy comprises a parameter setting module, an event matching module and a state updating module. The parameter setting module is used for setting a plurality of preset events of an agent. Each preset event is described by a descriptor in a static dictionary form to obtain an event descriptor, which can represent a current system state of the agent. The event descriptor comprises an event type, an event attribute, an event priority and a weight of the event attribute. The preset event comprises an event triggering condition and an action performed by the agent after the event is triggered. The native event comprises an object recognized by the agent and a recognition result. The event matching module is used for constructing an event processing system based on the event descriptor. The event processing system is used for performing similarity matching between a native event and a preset event according to an event attribute and an event type of the native event and the event attribute and the event type in the event descriptor of the preset event when the native event occurs. The state updating module is used for taking a preset event corresponding to a maximum priority in preset priorities of all the preset events matched successfully as a target preset event, triggering the target preset event by using the native event, and updating a system state of the agent according to an action performed by the agent after the target preset event is triggered by the native event.

[0066] The above merely describes the preferred embodiment of the present application, but should not be used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method of dynamically configuring a policy with a triggering event, the method comprising: The application comprises the following steps: a plurality of preset events of an intelligent agent are set, and each preset event is described by a descriptor in the form of a static dictionary to obtain an event descriptor, which can represent the current system state of the intelligent agent; the event descriptor comprises an event type, an event attribute, an event priority, and a weight of the event attribute; the preset event comprises an event triggering condition and an action performed by the intelligent agent after the event is triggered; and the original event comprises an object recognized by the intelligent agent and a recognition result; an event processing system is constructed based on the event descriptor, and the event processing system is used to perform similarity matching between the original event and the preset event according to the event attribute and the event type of the original event and the event attribute and the event type in the event descriptor of the preset event when the original event occurs; the preset event corresponding to the maximum priority in the preset priority of all the preset events matched successfully is taken as a target preset event, the target preset event is triggered by the original event, and the system state of the intelligent agent is updated after the target preset event is triggered by the original event; wherein, before implementing the dynamic configuration and triggering event strategy, the dynamic configuration and triggering event strategy is optimized, and the specific optimization steps comprise: a control flow chart of the event processing system is constructed based on the event descriptor, each node in the control flow chart represents a state or operation of the event processing system, and each path represents a transition from one state of an intelligent agent to another state; the complexity of the control flow chart is obtained according to the number of paths, the number of nodes, and the number of connected components in the control flow chart; the complexity of the control flow chart is taken as an optimization target, a heuristic algorithm is used to optimize the method of the dynamic configuration and triggering event strategy until the complexity of the optimized strategy method is minimum, and the optimized strategy method corresponding to the minimum complexity is taken as the final dynamic configuration and triggering event strategy method.

2. The method of claim 1, wherein, The step of describing each preset event by a descriptor in the form of a static dictionary to obtain an event descriptor comprises the following steps: the event type, the event attribute, the event priority, and the weight of the event attribute of each preset event are obtained; the event type, the event attribute, the event priority, and the weight of the event attribute of the preset event are represented in a structured format, and the representation result is taken as the event descriptor; wherein, the structured format is XML or JSON.

3. The method of claim 1, wherein, The step of constructing the event processing system comprises the following steps: the event processing system is abstracted into a set of states, a set of inputs, a set of outputs, and a set of state transition functions by using a state machine model; wherein, the set of states is the specific characteristics of the intelligent agent in different times, places, and conditions in the event descriptor; the set of inputs is the original event; the set of outputs is the operation steps or methods from the input original event to the processing result, which is used to respond to the original event; and the set of state transition functions is the similarity matching logic between the original event and the event descriptor of the preset event.

4. The method and system for dynamically configuring and triggering event policy according to claim 1, wherein, The step of performing similarity matching between the original event and the event descriptor of the preset event comprises the following steps: the similarity between the original event and each preset event is obtained according to the event type and the event attribute of the original event, the corresponding event type and event attribute in the event descriptor of each preset event, and the weight of the event attribute. The native event with the similarity greater than the preset similarity threshold is taken as a matched preset event.

5. The method of claim 4, wherein, The expression of the similarity of the native event and the preset event is: wherein, represents the similarity between the native event and the preset event; represents the weight of the i-th event attribute in the event descriptor of the preset event; represents the i-th event attribute in the event descriptor of the preset event; represents the i-th event attribute of the native event, represents the distance value between the i-th event attribute in the event descriptor of the preset event and the i-th event attribute of the native event; represents the total number of event attributes in the event descriptor of the preset event.

6. The method of claim 1, wherein, The expression of the complexity of the control flow chart is: wherein denotes the complexity of the control flow graph ; denotes the total number of paths in the control flow graph ; denotes the number of nodes in the control flow graph ; P denotes the number of connected components of the control flow graph .

7. A system for dynamically configuring a policy with a triggering event, the system comprising: The method comprises the following steps: The parameter setting module is configured to set a plurality of preset events of the agent, and to describe each preset event by using a descriptor in a static dictionary form to obtain an event descriptor, the event descriptor representing a current system state of the agent. The event descriptor comprises an event type, an event attribute, an event priority, and a weight of the event attribute; the preset event comprises an event trigger condition and an action performed by the agent after the event is triggered; and the native event comprises an object recognized by the agent and a recognition result. The event matching module is configured to construct an event processing system based on the event descriptor, the event processing system being configured to, when a native event occurs, perform similarity matching between the native event and a preset event according to an event attribute and an event type of the native event and an event attribute and an event type in an event descriptor of the preset event. The state updating module is configured to take a preset event corresponding to a maximum priority among preset priorities of all matched preset events as a target preset event, trigger the target preset event by using the native event, and update a system state of the agent according to an action performed by the agent after the target preset event is triggered. Before implementing the dynamic configuration and triggering event strategy, the dynamic configuration and triggering event strategy is optimized, and the specific optimization steps comprise: A control flow chart of the event processing system is constructed based on the event descriptor, each node in the control flow chart representing a state or operation of the event processing system, and each path representing a transition from one state of the agent to another state; the complexity of the control flow chart is obtained according to a number of paths, a number of nodes, and a number of connected components in the control flow chart; the complexity of the control flow chart is taken as an optimization target, a heuristic algorithm is used to optimize the method of the dynamic configuration and triggering event strategy until the complexity of the optimized strategy method is minimum, and the optimized strategy method corresponding to the minimum complexity is taken as the final dynamic configuration and triggering event strategy method.

Citation Information

Patent Citations

  • Method and apparatus for the automatic analysis of computer software

    CA2162020A1

  • Dynamic event trigger control method for nonlinear multi-agent system

    CN113515066A