CN-122019429-A - Bidirectional routing method, system, equipment and medium oriented to multi-level model
Abstract
The application relates to a bidirectional routing method, a bidirectional routing system, bidirectional routing equipment and a bidirectional routing medium for a multi-level model. The method comprises the steps of analyzing an object description file and obtaining model publishing and subscribing information defined in the object description file. And constructing a multi-level object tree model of the father-son inheritance relationship by taking the created root model as a father model. An object routing table and an interaction routing table are created within each object tree model entity based on relationships of the object tree models. And according to the established object routing table, realizing point-to-point direct access between objects. And coordinating the cooperative behavior among a plurality of objects by means of the interactive routing table to complete task cooperation and state synchronization. After creating the object local blackboard for each class of object, the subsystem copies the object from the local blackboard of the parent system to complete the inheritance and sharing of the object data. The method gives consideration to high-efficiency point-to-point communication, flexible coordination and data inheritance, and realizes high-efficiency communication and coordination across layers and subsystems.
Inventors
- AI CHUAN
- Yin Lujia
- QIN LONG
- JU RUSHENG
- XU KAI
- LIU YUAN
- TAN GAO
Assignees
- 中国人民解放军国防科技大学
Dates
- Publication Date
- 20260512
- Application Date
- 20260413
Claims (10)
- 1. A bi-directional routing method oriented to a multi-level model, the method comprising: Analyzing a wanted file and acquiring entity list information defined in the wanted file; analyzing the object description file according to the path of the object description file in the wanted file, and acquiring the model publishing and subscribing information defined in the object description file; constructing a multi-level object tree model of a father-son inheritance relationship by taking the created root model as a father model; creating an object routing table and an interaction routing table in each object tree model entity according to the relation of the object tree models; According to the established object routing table, point-to-point direct access between objects is realized; Coordinating the cooperative behavior among a plurality of objects by means of the interactive routing table to complete task cooperation and state synchronization; After creating the object local blackboard for each class of object, the subsystem copies the object from the local blackboard of the parent system to complete the inheritance and sharing of the object data.
- 2. The method of claim 1, wherein creating an object routing table and an interaction routing table within each of said object tree model entities based on relationships of said object tree models, comprises: traversing all models under the root model to obtain system entities corresponding to the models; performing upward propagation, and recursively calling a forwarding function of a parent system if the current system subscribes to the current object and the parent system exists; executing downward propagation, traversing all subsystems, and recursively calling a forwarding function of the current subsystem if the current subsystem issues the current object to the parent system; recording the traversed system entities, and recording the established routing relationship into an object routing table of each system; executing upward propagation, and recursively calling a forwarding function of a parent system if the current system subscribes the current interaction and the parent system exists; executing downward propagation, traversing all subsystems, and recursively calling a forwarding function of the current subsystem if the current subsystem issues current interaction to the parent system; And recording the traversed system entities, and recording the established routing relationship into an interactive routing table of each system.
- 3. The method of claim 2, wherein after creating the object local blackboard for each class of objects, the subsystem copies the objects from the local blackboard of the parent system, and performs inheritance and sharing of the object data, comprising: After the route establishment between the father system and the current system is completed, traversing all object identifiers stored in a local blackboard of the father system to form a list to be processed; And inquiring the object subscription set of the current system, judging whether the object identifier traversed currently exists in the object subscription set, and if so, copying the data of the current object from the local blackboard of the father system to the local blackboard of the current system.
- 4. A method according to any one of claims 1 to 3, wherein implementing point-to-point direct access between objects according to the established object routing table comprises: When an object to be created, deleted or updated exists, traversing a corresponding model creation list, a model deletion list or a model update list according to the operation type of the object; Traversing the object routing table according to each object in the created list, and determining all model identifications subscribed to the current object; generating a corresponding object event for each subscription model, and respectively inserting the object event into a priority event queue or a cache event queue according to whether a sender and a receiver belong to the same engine; And the engine dispatcher takes out the event execution callback from the event queue, so that the subscription model completes the operations of creating, deleting or updating the object on the local blackboard of the father system, and the point-to-point direct access among the objects is realized.
- 5. The method of claim 4, wherein coordinating collaborative behavior among a plurality of objects with the interaction routing table to complete task collaboration and state synchronization comprises: when a current interaction is generated, traversing all target model sets under an object in the current interaction; Inquiring the interaction routing table according to each model in the target model set, judging whether the current model subscribes the current interaction, if so, generating interaction events for the current model, and respectively inserting the events into a priority event queue or a cache event queue according to whether the interaction parties belong to the same engine; And the engine dispatcher takes out the interaction event execution callback from the event queue, and the subscription model accesses and processes the current interaction through the local interface so as to coordinate the cooperative behavior among a plurality of objects and complete task cooperation and state synchronization.
- 6. The method of claim 5, wherein parsing the object description file according to the path of the object description file in the desired file to obtain model publish-subscribe information defined in the object description file, comprises: Analyzing the object description file according to the path of the object description file in the wanted file, traversing the model in the object description file, and initializing model information; Traversing the release object set in the object description file, and storing the release object into the release information set of the corresponding model; Traversing the subscription object set in the object description file, and storing the subscription object into the subscription information set of the corresponding model; traversing the release interaction set in the object description file, and storing release interactions into the release interaction set of the corresponding model; Traversing the subscription interaction set in the object description file, and storing the subscription interaction into the subscription interaction set of the corresponding model; Integrating the publishing information set, the subscribing information set, the publishing interaction set and the subscribing interaction set to obtain the model publishing subscription information defined in the object description file.
- 7. The method of claim 6, wherein constructing a multi-level object tree model of parent-child inheritance relationships with the created root model as a parent model comprises: taking the created root model as a father model and registering the father model to a model manager; Establishing a parent-child hierarchical relationship, and recursively adding and configuring a subsystem under the parent model; And if the newly created model does not belong to the same group, adding the parameters of the newly created model into a batch processing list, delaying the creation of the routing table, and completing the synchronization of the parent system by corresponding to the subsystem synchronization function.
- 8. A multi-level model oriented bi-directional routing system, the system comprising: The system comprises a wanted file analyzing module, a storage module and a storage module, wherein the wanted file analyzing module is used for analyzing wanted files and acquiring entity list information defined in the wanted files; The subscription information acquisition module is used for analyzing the object description file according to the path of the object description file in the wanted file to acquire the model release subscription information defined in the object description file; The model building module is used for building a multi-level object tree model of the father-son inheritance relationship by taking the created root model as a father model; the routing table construction module is used for creating an object routing table and an interactive routing table in each object tree model entity according to the relation of the object tree models; The access module is used for realizing point-to-point direct access among objects according to the established object routing table; the cooperative communication module is used for coordinating cooperative behaviors among a plurality of objects by means of the interactive routing table to complete task cooperation and state synchronization; and the data sharing module is used for copying the objects from the local blackboard of the parent system by the subsystem after creating the object local blackboard for each class of objects, and completing inheritance and sharing of the object data.
- 9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
- 10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
Description
Bidirectional routing method, system, equipment and medium oriented to multi-level model Technical Field The application relates to the technical field of multi-level simulation model cooperative communication, in particular to a multi-level model oriented bidirectional routing method, a multi-level model oriented bidirectional routing system, multi-level simulation model oriented bidirectional routing equipment and a multi-level model oriented bidirectional routing medium. Background With the continued development of modern simulation systems, distributed computing, and complex system modeling, multi-level object system construction and data interaction become key challenges. In such systems, a large number of model entities with hierarchical relationships are often involved, and state synchronization, instruction delivery, and collaborative computation are frequently required between these entities. Currently, common system architectures mostly employ a centralized data bus and a hierarchical message forwarding mechanism. The centralized architecture is simple in structure, but as the number of entities increases, buses are easy to become performance bottlenecks and difficult to adapt to hierarchical entity organization, while the traditional hierarchical forwarding mechanism accords with an entity tree structure, data interaction often needs to be transferred layer by layer through intermediate nodes, so that the universality delay is high, the instantaneity is poor, and direct and efficient cooperation of cross-layer and cross-subsystem is difficult to support. Furthermore, sharing and inheritance of object data often relies on global replication or frequent remote access, increasing the risk of network overhead and data inconsistencies. The prior art lacks a comprehensive data interaction scheme which can achieve hierarchical entity management, efficient point-to-point communication, flexible collaboration and data inheritance. Therefore, a data method for supporting bidirectional routing and efficient access to a multi-level object system is urgently needed to improve the overall performance, instantaneity and expandability of the system. Disclosure of Invention Based on this, it is necessary to provide a bidirectional routing method, system, device and medium for a multi-level model, which can improve the efficiency, flexibility and expandability of collaborative communication of a multi-level simulation system. A bi-directional routing method oriented to a multi-level model, the method comprising: And analyzing the wanted file to obtain entity list information defined in the wanted file. And analyzing the object description file according to the path of the object description file in the wanted file, and acquiring the model publishing and subscribing information defined in the object description file. And constructing a multi-level object tree model of the father-son inheritance relationship by taking the created root model as a father model. An object routing table and an interaction routing table are created within each object tree model entity based on relationships of the object tree models. And according to the established object routing table, realizing point-to-point direct access between objects. And coordinating the cooperative behavior among a plurality of objects by means of the interactive routing table to complete task cooperation and state synchronization. After creating the object local blackboard for each class of object, the subsystem copies the object from the local blackboard of the parent system to complete the inheritance and sharing of the object data. A bi-directional routing system oriented to a multi-level model, the system comprising: and the wanted file analysis module is used for analyzing the wanted file and acquiring entity list information defined in the wanted file. And the subscription information acquisition module is used for analyzing the object description file according to the path of the object description file in the wanted file to acquire the model publishing subscription information defined in the object description file. And the model construction module is used for constructing a multi-level object tree model of the father-son inheritance relationship by taking the created root model as a father model. And the routing table construction module is used for creating an object routing table and an interactive routing table in each object tree model entity according to the relation of the object tree models. And the access module is used for realizing point-to-point direct access among the objects according to the established object routing table. And the cooperative communication module is used for coordinating cooperative behaviors among a plurality of objects by means of the interactive routing table to complete task cooperation and state synchronization. And the data sharing module is used for copying the objects from the local blackboard of the parent sys