A method for constructing a behavior rule system based on behavior abstraction and inheritance
By using behavioral abstraction and inheritance methods to build a rule system in the simulation system, the problem of tight coupling between rules and models is solved, enabling users to quickly find and select rules, and improving the flexibility and efficiency of the simulation system.
Patent Information
- Application Number
- CN202410992756.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-07-24
AI Technical Summary
The rules and models in the existing simulation system are tightly coupled, making it difficult for users to quickly find the rules to achieve expected behaviors, and unable to meet the user's general selection needs for rules.
Using a method based on behavioral abstraction and inheritance, specific rules in the simulation model are extracted to form a set of specific rules, and a behavioral rule system is constructed through abstraction and inheritance relationships, allowing users to find specific specific rules in the rule system based on expected behavioral attributes.
It implements the encapsulation and organization of rules, allowing users to easily find rules that meet expected behaviors, and allows the simulation engine to explore specific rules through abstract rules, improving the user's operational flexibility and the efficiency of the simulation system.
Smart Images

Figure CN118520709B
Abstract
Description
Technical Field
[0001] The present application relates to the field of simulation technology, and in particular to a method for constructing a behavior rule system based on behavior abstraction and inheritance. Background Art
[0002] The present invention relates to the field of simulation, and in particular to the field of rule resource construction in simulation. Rules and models are both important simulation resources. Simulation models can be instantiated as simulation entities in a simulation engine. Rules determine the behavior of these simulation entities in a simulation environment. It obtains the state of the environment and entities in the simulation in real time, and makes real-time decisions on the actions that entities need to perform based on rule logic. Entities will interact with the environment and participate in simulation calculations according to the actions decided by the rules.
[0003] In the existing simulation system, rules are tightly coupled with models. Rules do not exist independently, and each rule is bound to a simulation model. After the simulation is started, the simulation entity corresponding to the simulation model will be created, and the rules will be triggered and executed accordingly. Once the rule is triggered, it will continue to execute until the end state is reached according to the logic described in the rule. In this process, users or algorithmic programs compiled by users cannot interfere with the execution of rules. The current implementation of rules has two disadvantages: one is that users cannot quickly find rules that can achieve the expected behavior, and the other is that it cannot meet the user's needs for generalized selection of rules: what is bound to the model is the rule that supports the model to complete a specific behavior. Summary of the invention
[0004] Based on this, it is necessary to provide a method for constructing a behavior rule system based on behavior abstraction and inheritance to address the above technical issues.
[0005] A method for constructing a behavior rule system based on behavior abstraction and inheritance, the method comprising:
[0006] Acquire a simulation model, extract specific rules from the simulation model, and form a specific rule set;
[0007] According to the preset conditions, abstract rules are extracted from the specific rule set to form an abstract rule set;
[0008] Construct a behavioral rule system based on the abstraction and inheritance relationship between the elements of the specific rule set and the abstract rule set, and between the elements in the abstract rule set;
[0009] Obtain the expected implementation behavior, and search for specific rules in the behavior rule system based on the attributes of the expected implementation behavior.
[0010] In one embodiment, obtaining the simulation model and extracting specific rules from the simulation model includes:
[0011] Extract specific fine-grained control instructions from the simulation model;
[0012] The instructions for completing specific behaviors in specific fine-grained control instructions are abstracted into specific rules that can be called individually.
[0013] In one embodiment, extracting abstract rules from a specific rule set according to preset conditions includes:
[0014] According to the abstraction and inheritance relationship of behaviors, abstract rules are extracted from the specific rule set.
[0015] In one embodiment, extracting abstract rules from specific rules according to the abstraction and inheritance relationship of behaviors includes:
[0016] The first step is to compare the similarity of each specific rule in pairs according to the dimensions of behavior category, scope, initiation domain, and implementation method. If two specific rules are similar in at least one dimension, then an abstract rule is created on the dimension with similarity.
[0017] For the generated abstract rules, the similarity of each abstract rule is compared two by two. If two abstract rules are similar in at least one dimension, a new abstract rule is created on the dimension with similarity.
[0018] The second step is to loop through the first step, traverse all specific rules and abstract rules, and obtain an abstract rule set.
[0019] In one embodiment, constructing a behavior rule system according to the abstraction and inheritance relationship between specific rules and abstract rules includes:
[0020] Based on the inheritance relationship between specific rules and abstract rules, and abstract rules, a behavioral rule system consisting of abstract rules and specific rules is constructed in accordance with the five-layer structure of behavior category, scope, initiation domain, implementation method, and specific rules.
[0021] In one embodiment, the construction of a behavior rule system consisting of abstract rules and specific rules according to the inheritance relationship between specific rules and abstract rules and the five-layer structure of behavior category, scope, initiation domain, implementation method, and specific rules includes:
[0022] Specific rules are at the bottom of the behavioral rule system, as leaf nodes;
[0023] For abstract rules without scope, point directly from the abstract rule of the behavior category to the abstract rule of the initiation domain;
[0024] For abstract rules with multiple scopes, initiation domains, and implementation methods, additional layers are inserted between layers.
[0025] In one embodiment, the obtaining of the expected implementation behavior and searching for a specific rule in the behavior rule system according to the attribute of the expected implementation behavior include:
[0026] Obtain the expected behavior, search for the required abstract rules or specific rules layer by layer according to the behavior category, scope, initiation domain, and implementation method, perform intelligent calculations with the task, environment, and entity state information in the simulation as input, and obtain specific specific rules.
[0027] After the behavior rule system proposed by the present invention encapsulates and organizes the rules, users can search for rules that meet the expected behavior according to the rule system. Moreover, users do not need to specify specific rules, but can provide abstract rules to be called, allowing the simulation engine to explore specific rules to be executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A flowchart of a method for constructing a behavior rule system based on behavior abstraction and inheritance in one embodiment;
[0029] Figure 2 A schematic diagram of a behavior rule system based on behavior abstraction and inheritance in one embodiment;
[0030] Figure 3 A schematic diagram of a rule system in a behavior rule system based on behavior abstraction and inheritance in one embodiment;
[0031] Figure 4 Schematic diagram of a drone simulation system rule system in one embodiment. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0033] A method for constructing a behavior rule system based on behavior abstraction and inheritance, such as Figure 1 As shown, the method includes:
[0034] Acquire a simulation model, extract specific rules from the simulation model, and form a specific rule set;
[0035] According to the preset conditions, abstract rules are extracted from the specific rule set to form an abstract rule set;
[0036] Construct a behavioral rule system based on the abstraction and inheritance relationship between the elements of the specific rule set and the abstract rule set, and between the elements in the abstract rule set;
[0037] Obtain the expected implementation behavior, and search for specific rules in the behavior rule system based on the attributes of the expected implementation behavior.
[0038] Specifically, a specific rule is a rule with logical implementation that can control the specific model to participate in the simulation. An abstract rule is an abstract rule without specific logical implementation. Specifically, inheritance means that if the behavioral goals of two rules are the same, and one rule constrains the way to achieve the goal based on the other rule, then it inherits from the other rule; abstraction means that based on a set of rules, its commonality is extracted to obtain an abstract rule, which can make the set of rules or behaviors all inherit from it. Specifically, obtaining a simulation model, extracting specific rules from the simulation model, and forming a specific rule set include: stripping the rules from the simulation model and organizing them as a type of independent simulation resources.
[0039] In one embodiment, obtaining the simulation model and extracting specific rules from the simulation model includes:
[0040] Extract specific fine-grained control instructions from the simulation model;
[0041] The instructions for completing specific behaviors in specific fine-grained control instructions are abstracted into specific rules that can be called individually.
[0042] Specifically, all processes involved in controlling the model and completing a certain behavior are abstracted into a program that can be called separately, namely a rule. The program reads the environment and model status, and after internal logical operations, it independently decides when to issue control instructions to the simulation entity of the model to control the entity to complete a certain behavior in the simulation environment. It can be understood that a rule can control the simulation entities of one or more models, and which entity is specifically controlled can be determined at runtime. When the simulation starts, the instance of the rule and the instance of the model are created at the same time, and the unique identifier of the model instance is passed to the rule in the form of a parameter. In this way, after the rule decides on the action, it can find the corresponding model entity to execute the action.
[0043] In one embodiment, extracting abstract rules from a specific rule set according to preset conditions includes:
[0044] According to the abstraction and inheritance relationship of behaviors, abstract rules are extracted from the specific rule set.
[0045] In one embodiment, Figure 2 As shown, the method includes: 1. decoupling rules from models, 2. extracting abstract rules, 3. building a rule system, 3. searching for rules based on the rule system, 4. searching and calling rules, that is, searching and selecting to call specific rules or to call abstract rules; if calling abstract rules, exploring the optimal specific rules in the subtree through the simulation engine.
[0046] The abstract rules extracted from the specific rules according to the abstraction and inheritance relationship of the behaviors include:
[0047] The first step is to compare the similarity of each specific rule in pairs according to the dimensions of behavior category, scope, initiation domain, and implementation method. If two specific rules are similar in at least one dimension, then an abstract rule is created on the dimension with similarity.
[0048] For the generated abstract rules, the similarity of each abstract rule is compared two by two. If two abstract rules are similar in at least one dimension, a new abstract rule is created on the dimension with similarity.
[0049] The second step is to loop through the first step, traverse all specific rules and abstract rules, and obtain an abstract rule set.
[0050] Specifically, behavior categories are coarse-grained divisions of behaviors according to their implementation purposes;
[0051] Scope is the class of objects affected by an action;
[0052] The initiation domain is the category of different tools and means that the initiator of behavior relies on to implement the behavior.
[0053] In one embodiment, Figure 3 As shown, the behavior rule system is constructed based on the abstraction and inheritance relationship between specific rules and abstract rules, including:
[0054] Based on the inheritance relationship between specific rules and abstract rules, and abstract rules, a behavioral rule system consisting of abstract rules and specific rules is constructed in accordance with the five-layer structure of behavior category, scope, initiation domain, implementation method, and specific rules.
[0055] In one embodiment, the construction of a behavior rule system consisting of abstract rules and specific rules according to the inheritance relationship between specific rules and abstract rules and the five-layer structure of behavior category, scope, initiation domain, implementation method, and specific rules includes:
[0056] Specific rules are at the bottom of the behavioral rule system, as leaf nodes;
[0057] For abstract rules without scope, point directly from the abstract rule of the behavior category to the abstract rule of the initiation domain;
[0058] For abstract rules with multiple scopes, initiation domains, and implementation methods, additional layers are inserted between layers.
[0059] In one embodiment, the obtaining of the expected implementation behavior and searching for a specific rule in the behavior rule system according to the attribute of the expected implementation behavior include:
[0060] Obtain the expected behavior, search for the required abstract rules or specific rules layer by layer according to the behavior category, scope, initiation domain, and implementation method, perform intelligent calculations with the task, environment, and entity state information in the simulation as input, and obtain specific specific rules.
[0061] Specifically, when using it, users can search for the required rules layer by layer according to the expected behavior, behavior category, scope, initiation domain, and method. The user's choice of rules can fall into any layer of the rule system, which means that the selected rules can be either abstract rules or specific rules. If it is an abstract rule, then the abstract / specific rules under it can be used as the exploration space of the simulation system. The simulation system selects the most appropriate specific rule to execute through experimental exploration or intelligent calculation based on the current simulation environment and behavior expectations.
[0062] As a specific example, a rule system is constructed. The rule system can be divided into several behavior categories, such as behavior category 1, behavior category 2, behavior category 3, etc., and then several corresponding abstract rules are extracted, such as abstract rule 1, abstract rule 2, abstract rule 3, etc. When an abstract rule has different scopes, different abstract rules can be further abstracted. For example, abstract rule 2 can be abstracted into abstract rule 4, abstract rule 5, abstract rule 6, etc. according to different scopes. Furthermore, abstract rule 6 can be further extracted into abstract rule 7, abstract rule 8, abstract rule 9, etc. according to different initiation domains. Abstract rule 8 can be extracted into abstract rule 10, abstract rule 11, abstract rule 12, etc. according to different implementation methods (implementation method 1, implementation method 2, implementation method 3, etc.). Abstract rule 12 can be extracted into specific rule 1, specific rule 2, specific rule 3, etc. according to different specific rules.
[0063] As a specific implementation, please refer to Figure 4 , taking a UAV simulation system as an example, the method proposed in the present invention is implemented:
[0064] First, separate the rules from the simulation model and organize them as a separate simulation resource. For example, the "drone grabs cargo" rule in the unmanned delivery scenario was originally mounted on the drone simulation model. Now we separate the rule and make it an independent simulation resource. In the simulation preparation stage, prepare 1 "drone grabs cargo" rule, 1 drone model, and several cargo models; set a global unique identifier for the drone model and pass the identifier as a parameter to the "drone grabs cargo" rule; when the simulation engine is initialized, the above rules and models will be instantiated into 1 "drone grabs cargo" rule entity, 1 drone model entity, and several cargo model entities. When the "drone grabs cargo" rule makes an action decision, it will use the interface instructions provided by the drone model to control the drone model entity with the corresponding global unique identifier to complete the corresponding grabbing action. In this way, all rules can be separated from the model and become an independent simulation resource.
[0065] Second, here we call the rules such as "drone grabbing cargo" which have logical implementation and can control specific models to participate in simulation as specific rules. At the same time, create abstract rules without specific logical implementation. From the perspective of behavior category, scope, initiation domain, and method, according to the abstraction and inheritance relationship of behavior, abstract rules are extracted from specific rules. Behavior categories can be divided according to categories such as grabbing, obstacle recognition, and maneuvering. The scope can be divided according to sea, air, and land. The initiation domain can be divided according to the take-off location of the drone, and can also be divided into sea, air, and land. The method can be divided as needed. For example, for obstacle recognition behavior, it can be divided according to vision, laser, infrared and other methods. Among them, the visual method can be further divided, including deep learning, other machine learning algorithms other than deep learning, and traditional visual algorithms. Finally, the abstract rule of "air-to-ground obstacle visual recognition based on deep learning" is formed, and its subordinate specific rules include "rotor-wing drone ground obstacle recognition based on YOLO algorithm", "fixed-wing drone ground obstacle recognition based on YOLO algorithm", "fixed-wing drone ground obstacle recognition based on RCNN algorithm", etc.
[0066] Third, based on the inheritance relationship between rules, a behavioral rule system consisting of abstract behaviors and specific rules is constructed according to the five-layer structure of behavior category, scope, initiation domain, method, and specific rules. The specific rules are at the bottom of the rule system as leaf nodes. Since the visual method was further subdivided in the previous step, two method layers were added below the air-to-land obstacle recognition.
[0067] Fourth, when using it, users can search for the required rules layer by layer according to the expected behavior, based on the action category, scope, initiation domain, and method. The user's choice of rules can fall on any layer of the rule system, which means that the selected rules can be either abstract rules or specific rules. If it is an abstract rule, such as "air-to-ground obstacle visual recognition based on deep learning", then the specific rules under it can be used as the exploration space of the simulation system. The simulation system will explore an optimal specific rule to execute by trying different rules. Within the scope of the user's frame based on the aerial platform and the use of deep learning methods, the simulation system can find specific rules to maximize the accuracy of land obstacle recognition as expected by the user through multiple rounds of testing.
[0068] After the behavior rule system of the behavior rule integration framework proposed by the present invention encapsulates and organizes the rules, users can search for rules that meet the expected behavior according to the rule system. In addition, users do not need to specify specific rules, but can provide abstract rules to be called to let the simulation engine explore the specific rules to be executed.
[0069] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for constructing a behavior rule system based on behavior abstraction and inheritance, characterized in that: The method comprises: Acquire a simulation model, extract specific rules from the simulation model, and form a specific rule set; According to the preset conditions, abstract rules are extracted from the specific rule set to form an abstract rule set, which specifically includes: According to the abstraction and inheritance relationship of behaviors, abstract rules are extracted from the specific rule set, including: The first step is to compare the similarity of each specific rule in pairs according to the dimensions of behavior category, scope, initiation domain, and implementation method. If two specific rules are similar in at least one dimension, then an abstract rule is created on the dimension with similarity. For the generated abstract rules, the similarity of each abstract rule is compared two by two. If two abstract rules are similar in at least one dimension, a new abstract rule is created on the dimension with similarity. The second step is to loop through the first step, traverse all specific rules and abstract rules, and obtain the abstract rule set; Based on the abstraction and inheritance relationship between the elements of the specific rule set and the abstract rule set, as well as between the elements in the abstract rule set, a behavior rule system is constructed, including: Based on the inheritance relationship between specific rules and abstract rules, and the five-layer structure of behavior category, scope, initiation domain, implementation method, and specific rules, a behavior rule system consisting of abstract rules and specific rules is constructed; Obtain the expected implementation behavior, and search for specific rules in the behavior rule system according to the attributes of the expected implementation behavior; Among them, the behavior category is a coarse-grained division of behaviors according to the purpose of implementation; Scope is the class of objects affected by an action; The initiation domain is the category of the initiator of the behavior, and the method is the category of different tools and means used to implement the behavior.
2. The method according to claim 1, characterized in that The obtaining of the simulation model and extracting specific rules from the simulation model include: Extract specific fine-grained control instructions from the simulation model; The instructions for completing specific behaviors in specific fine-grained control instructions are abstracted into specific rules that can be called individually.
3. The method according to claim 2, characterized in that The behavior rule system composed of abstract rules and specific rules is constructed according to the inheritance relationship between specific rules and abstract rules and the five-layer structure of behavior category, scope, initiation domain, implementation method and specific rules, including: Specific rules are at the bottom of the behavioral rule system, as leaf nodes; For abstract rules without scope, point directly from the abstract rule of the behavior category to the abstract rule of the initiation domain; For abstract rules with multiple scopes, initiation domains, and implementation methods, additional layers are inserted between layers.
4. The method according to claim 3, characterized in that The obtaining of the expected implementation behavior and searching for a specific rule in the behavior rule system according to the attribute of the expected implementation behavior include: Obtain the expected behavior, search for the required abstract rules or specific rules layer by layer according to the behavior category, scope, initiation domain, and implementation method, perform intelligent calculations with the task, environment, and entity state information in the simulation as input, and obtain specific specific rules.
