Joint simulation method, device and equipment based on object class and interaction class mapping

Through a joint simulation method based on object class and interactive class mapping, the problem of inconsistent management of published ordering relationships in HLA is solved, and the system-management of published ordering units is realized, which reduces network traffic and supports dynamic modification, avoids Information discarded.

CN119025082BActive Publication Date: 2025-01-03NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411513088.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-01-03
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

In traditional methods, when HLA's declaration management service builds an announcement order relationship, subclass instances of federal members are received as parent instances, resulting in incomplete information and difficult to unify the publication order relationship management.

Method used

Using a joint simulation method based on the mapping of object classes and interactive classes, by assigning object classes and interactive class handles, calling the dynamic library interface to obtain the published ordering relationship, generate a request, and performing the addition or deletion of the relationship to the simulation service through the handle to ensure the release Unified management of ordering relationships.

Benefits of technology

It realizes unified management of published ordering relationships of simulation units, avoids the problem of attribute discarding when the parent class receives subclass instance data, reduces network traffic, and supports dynamic modification of relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025082B_ABST
    Figure CN119025082B_ABST
Patent Text Reader

Abstract

The present application relates to a joint simulation method, device and equipment based on object class and interaction class mapping. The method comprises: assigning object class handle and interaction class handle to object class and interaction class respectively through simulation service, when declaring events of object class and interaction class, the simulation unit respectively calls the object class active call interface and interaction class active call interface of dynamic library, obtains the corresponding published subscription relationship, generates corresponding request according to the published subscription relationship, the simulation unit respectively obtains the object class handle and interaction class handle, initiates corresponding request to simulation service through object class handle and interaction class handle, the simulation service performs adding or deleting operation of published subscription relationship on the corresponding relationship set in the association container according to the request; and performs joint simulation according to the published subscription relationship of each simulation unit in the relationship set. The adoption of this method can realize the unified management of published subscription relationship, which is beneficial for the subscriber to obtain subscription data accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of simulation data processing technology, and in particular to a co-simulation method, apparatus and device based on the mapping of object classes and interaction classes. Background Technology

[0002] Distributed simulation systems have many nodes, and each node sends and receives different data. In order to establish a data exchange relationship between nodes, a data interaction relationship matching strategy is needed.

[0003] Traditional methods employ a topic-based matching mechanism, establishing publication-subscription relationships between nodes on the same topic to send data related to that topic. This approach suffers from inconsistent hierarchical management of publication-subscription relationships, making unified management and maintenance difficult.

[0004] The original HLA (High-Level Simulation Architecture)-based declaration management service's announcement ordering relationship construction strategy resulted in the RTI (Run Time Infrastructure) assuming that the federation member was also interested in instances of all its subclasses when ordering an object class. The RTI would then treat the subclass instances as parent class instances and discard the subclass instance-specific attributes, leading to incomplete information.

[0005] Therefore, it is necessary to establish a more scientific and detailed guideline for constructing public ordering relationships to address the aforementioned technical issues. Summary of the Invention

[0006] Therefore, it is necessary to provide a co-simulation method, apparatus, and device based on the mapping of object classes and interaction classes to address the above-mentioned technical problems.

[0007] A co-simulation method based on the mapping of object classes and interaction classes, the method comprising:

[0008] The simulation service assigns object class handles and interaction class handles to the object class and interaction class, respectively;

[0009] When declaring events for object classes and interaction classes, the simulation unit calls the object class active call interface and the interaction class active call interface of the dynamic library respectively to obtain the corresponding publication and ordering relationship, and generates the corresponding request based on the publication and ordering relationship; the publication and ordering relationship includes the current simulation unit's publication relationship or ordering relationship with the target object class or interaction class; the publication relationship includes publication requirements and cancellation publication requirements; the ordering relationship includes ordering requirements and cancellation ordering requirements;

[0010] The simulation unit obtains the object class handle and the interaction class handle respectively, and sends corresponding requests to the simulation service through the object class handle and the interaction class handle. The simulation service performs the addition or deletion operation of the published ordering relationship in the corresponding relationship set in the associated container according to the request; the relationship set includes the object class published relationship set, the object class ordering relationship set, the interaction class published relationship set, and the interaction class ordering relationship set.

[0011] Joint simulation is performed based on the published ordering relationships of each simulation unit in the relationship set.

[0012] A co-simulation device based on object class and interaction class mapping, the device comprising:

[0013] The handle allocation module is used by the simulation service to allocate object class handles and interaction class handles respectively for object classes and interaction classes;

[0014] The request generation module is used to, when declaring events for object classes and interaction classes, have the simulation unit call the object class active call interface and the interaction class active call interface of the dynamic library respectively to obtain the corresponding publication and ordering relationship, and generate the corresponding request based on the publication and ordering relationship; the publication and ordering relationship includes the current simulation unit's publication relationship or ordering relationship with the target object class or interaction class; the publication relationship includes publication requirements and cancellation publication requirements; the ordering relationship includes ordering requirements and cancellation ordering requirements;

[0015] The relationship establishment module is used by the simulation unit to obtain object class handles and interaction class handles respectively, and to send corresponding requests to the simulation service through the object class handles and interaction class handles. The simulation service performs add or delete operations on the corresponding relationship set in the association container according to the request; the relationship set includes object class published relationship set, object class order relationship set, interaction class published relationship set, and interaction class order relationship set.

[0016] The co-simulation module is used to perform co-simulation based on the published ordering relationships of each simulation unit in the relationship set after the published ordering relationship is established.

[0017] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:

[0018] The simulation service assigns object class handles and interaction class handles to the object class and interaction class, respectively;

[0019] When declaring events for object classes and interaction classes, the simulation unit calls the object class active call interface and the interaction class active call interface of the dynamic library respectively to obtain the corresponding publication and ordering relationship, and generates the corresponding request based on the publication and ordering relationship; the publication and ordering relationship includes the current simulation unit's publication relationship or ordering relationship with the target object class or interaction class; the publication relationship includes publication requirements and cancellation publication requirements; the ordering relationship includes ordering requirements and cancellation ordering requirements;

[0020] The simulation unit obtains the object class handle and the interaction class handle respectively, and sends corresponding requests to the simulation service through the object class handle and the interaction class handle. The simulation service performs the addition or deletion operation of the published ordering relationship in the corresponding relationship set in the associated container according to the request; the relationship set includes the object class published relationship set, the object class ordering relationship set, the interaction class published relationship set, and the interaction class ordering relationship set.

[0021] Joint simulation is performed based on the published ordering relationships of each simulation unit in the relationship set.

[0022] The aforementioned co-simulation method, apparatus, and device based on the mapping of object classes and interaction classes allow simulation units to upload the publication and subscription relationships of object classes and interaction classes to the simulation service via interface calls. The simulation service then manages these relationships uniformly, ensuring consistent understanding within the co-simulation process. It also provides a service interface for quickly querying publication and subscription relationships for subsequent simulation business calls. This invention not only supports simulation units declaring publication and subscription relationships of object classes and interaction classes during the simulation preparation phase but also supports dynamically modifying these relationships during simulation execution. Compared to HLA, where instances of parent classes can receive instance data from child classes, this invention restricts both parent and child classes to call the subscription object class / interaction class interface. Subscribing parent classes can only receive instance data from their own parent classes, and subscribing child classes can only receive instance data from their own child classes. This avoids the problem of child-specific attribute information being discarded when an instance of a parent class receives instance data from a child class. In this embodiment, the publication and subscription relationships of data senders and receivers can be uniformly managed at the class level according to the data (object classes and interaction classes) requirements of the simulation units in co-simulation, reducing network traffic. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating a co-simulation method based on the mapping of object classes and interaction classes in one embodiment.

[0024] Figure 2 This is a flowchart illustrating the object class process in one embodiment;

[0025] Figure 3 This is a schematic diagram illustrating the process of canceling the publication of an object class in one embodiment;

[0026] Figure 4 This is a schematic diagram of the interactive class process in one embodiment;

[0027] Figure 5 This is a schematic diagram of the process for canceling the publication of interactive classes in one embodiment;

[0028] Figure 6 This is a schematic diagram of the ordering object class process in one embodiment;

[0029] Figure 7 This is a schematic diagram of the process for canceling an order object class in one embodiment;

[0030] Figure 8 This is a schematic diagram of the ordering interaction process in one embodiment;

[0031] Figure 9 This is a schematic diagram of the cancel order interaction process in one embodiment;

[0032] Figure 10 This is a structural block diagram of a co-simulation device based on the mapping of object classes and interaction classes in one embodiment;

[0033] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0035] This invention's method is based on the KD-JLink (Distributed Simulation Middleware) system. KD-JLink is a distributed simulation platform that supports integrated LVC joint simulation training, typically consisting of a central server and multiple simulation nodes. Each simulation node acts as a simulation unit, establishing a connection with the simulation service. Data interaction between simulation units is conducted through the simulation service, and simulation units using the same data protocol form a joint simulation. This invention's method constructs a publication and subscription relationship criterion to uniformly manage the publication and subscription of object classes and interaction classes of simulation units, ensuring a consistent understanding within the joint simulation. During simulation execution, the control mechanism of the simulation middleware is utilized to reduce the amount of data in the network.

[0036] In one embodiment, such as Figure 1 As shown, a co-simulation method based on the mapping between object classes and interaction classes is provided, including the following steps:

[0037] Step 102: The simulation service assigns object class handles and interaction class handles to the object class and interaction class, respectively.

[0038] An object class refers to a class in a simulation system that represents a specific entity or object. Each object class represents an entity unit in the simulation environment, such as a vehicle or an airplane. These classes define the object's state and behavior through attributes and methods. The definition and registration of object classes are usually completed within the simulation system so that simulation units can recognize and interact with them.

[0039] Interaction classes are used to define communication or data exchange between simulation units. For example, in unmanned platform adversarial simulation, an interaction class can define the behavior of one unit transmitting information to another. Registration and management of interaction classes are implemented through specific interface devices, ensuring effective information exchange between simulation units.

[0040] At the start of the simulation, the simulation service assigns a unique handle to each object class and interaction class within the co-simulation. This handle plays a crucial role in the co-simulation, serving as a unique identifier to ensure that all operations on object classes and interaction classes are performed through this handle. This mechanism helps maintain the independence and consistency of different objects and interaction classes during the simulation process, avoiding confusion or conflicts. The method of this invention manages the publication and subscription relationships of object classes and interaction classes based on handles.

[0041] Once the simulation service assigns handles to object classes and interaction classes, all subsequent operations, such as state changes, event triggering, and data transmission, must be performed through these handles. This invention manages the publication and subscription relationships of object classes and interaction classes based on these handles. This mechanism not only improves the management efficiency of simulation but also ensures accurate communication and coordination between modules in a distributed simulation system.

[0042] Step 104: When declaring events for object classes and interaction classes, the simulation unit calls the object class active call interface and the interaction class active call interface of the dynamic library respectively to obtain the corresponding published ordering relationship and generate the corresponding request based on the published ordering relationship.

[0043] Publishing a subscription relationship includes the publishing or subscription relationship of the current simulation unit to the target object class or interaction class; publishing a relationship includes publishing a requirement and canceling a publishing requirement; subscription a relationship includes subscribing a requirement and canceling a subscribing requirement.

[0044] The method of this invention provides the simulation unit with eight active invocation interfaces in the form of a C++ dynamic library: PublishObjectClass (publishing object class), UnPublishObjectClass (unpublishing object class), PublishInteractionClass (publishing interaction class), UnPublishInteractionClass (unpublishing interaction class), SubscribeObjectClass (subscribing object class), UnSubscribeObjectClass (unsubscribing object class), SubscribeInteractionClass (subscribing interaction class), and UnSubscribeInteractionClass (unsubscribing interaction class). The simulation unit can call these interfaces to declare its intention to produce and consume messages (object classes and interaction classes) to the co-simulation.

[0045] Step 106: The simulation unit obtains the object class handle and the interaction class handle respectively, and sends corresponding requests to the simulation service through the object class handle and the interaction class handle. The simulation service performs the add or delete operation of the published order relationship on the corresponding relationship set in the associated container according to the request.

[0046] Associative containers like sets have the characteristics of unique and ordered elements, and fast lookup speed. The method of this invention uses sets as the storage structure for publishing subscription relationships. The relationship sets include object-class published relationship sets, object-class subscription relationship sets, interaction-class published relationship sets, and interaction-class subscription relationship sets.

[0047] Step 108: Perform joint simulation based on the published ordering relationships of each simulation unit in the relationship set.

[0048] In the aforementioned co-simulation method based on the mapping of object classes and interaction classes, the simulation service allocates object class handles and interaction class handles respectively. When declaring events for object classes and interaction classes, the simulation unit calls the object class active call interface and the interaction class active call interface of the dynamic library respectively to obtain the corresponding published ordering relationship. Based on the published ordering relationship, a corresponding request is generated. The simulation unit obtains the object class handle and the interaction class handle respectively, and sends the corresponding request to the simulation service through the object class handle and the interaction class handle. The simulation service performs the addition or deletion operation of published ordering relationship on the corresponding relationship set in the associated container according to the request. The relationship set includes the object class published relationship set, the object class ordering relationship set, the interaction class published relationship set, and the interaction class ordering relationship set. Co-simulation is performed based on the published ordering relationship of each simulation unit in the relationship set. This embodiment of the invention can realize unified management of published ordering relationships, which is beneficial for orderers to accurately obtain ordering data.

[0049] In one embodiment, joint simulation based on the publication and subscription relationships of each simulation unit in the relationship set includes: if the current simulation unit has a publication requirement for the target object class, the simulation unit declares to the simulation service through the publication object class service that it has the ability to produce target object class data, and is responsible for registering object instances of the target object class and updating object instance data; if the current simulation unit has a publication requirement for the target interaction class, the simulation unit declares to the simulation service through the publication interaction class service that it has the ability to produce target interaction class data, and is responsible for updating interaction data; if the current simulation unit has a subscription requirement for the target object class, the simulation unit declares to the simulation service through the subscription object class service that it intends to consume target object class data, and when a simulation unit updates the object instance data of the target object class in the joint simulation, the simulation service forwards the object instance data of the target object class to the current simulation unit; if the current simulation unit has a subscription requirement for the target interaction class, the simulation unit declares to the simulation service through the subscription interaction class service that it intends to consume target interaction class data, and when a simulation unit updates the interaction data of the target interaction class in the joint simulation, the simulation service forwards the interaction data of the target interaction class to the current simulation unit.

[0050] In this embodiment, the publishing direction simulation server publishes object instance data and interaction data, and the ordering party orders the target object class and interaction class. If a simulation unit in the co-simulation updates the object instance data of the target object class or the interaction data of the target interaction class, the simulation service will forward the updated data to the ordering party.

[0051] In one embodiment, the interface actively invoked by the object class includes publishing the object class interface, canceling the publishing of the object class interface, ordering the object class interface, and canceling the ordering of the object class interface; the interface actively invoked by the interaction class includes publishing the interaction class interface, canceling the publishing of the interaction class interface, ordering the interaction class interface, and canceling the ordering of the interaction class interface.

[0052] In one embodiment, the simulation service includes publishing object class services, canceling publishing object class services, ordering object class services, canceling ordering object class services, publishing interactive services, canceling publishing interactive services, ordering interactive services, and canceling ordering interactive services.

[0053] In one embodiment, the simulation service performs an operation to add or delete published ordering relationships on the corresponding set of relationships in the associated container according to a request. This includes: when the simulation unit initiates a publication request or cancellation request for an object class or an interaction class to the simulation service, the simulation service performs an operation to add or delete published ordering relationships on the set of published object class relationships or the set of published interaction class relationships in the associated container according to the request; and when the simulation unit initiates a subscription request or cancellation request for an object class or an interaction class to the simulation service, the simulation service performs an operation to add or delete published ordering relationships on the set of published object class ordering relationships or the set of published interaction class ordering relationships in the associated container according to the request.

[0054] In one embodiment, the simulation service performs an add or delete operation on the object class publication relationship set or interaction class publication relationship set in the associated container according to a request, including: the simulation service receives a request to publish an object class; if the received request is valid, it parses the request to obtain the object class publication relationship, obtains the target object class to be published based on the object class publication relationship, and if the target object class is not published, it adds the object class publication relationship to the object class publication relationship set; the simulation service receives a request to cancel publishing an object class; if the received request to cancel publishing an object class is valid, it parses the request to cancel publishing an object class to obtain the object class publication relationship, obtains the target object class to be canceled based on the object class publication relationship, and if the target object class is not published, it adds the object class publication relationship to the object class publication relationship set. If the target object class has already been published, then the object class publication relationship is deleted from the object class publication relationship set. When the simulation service receives a request to publish an interaction class, if the received request is valid, it parses the request to obtain the interaction class publication relationship, and obtains the target interaction class to be published based on the interaction class publication relationship. If the target interaction class has not been published, then the interaction class publication relationship is added to the interaction class publication relationship set. When the simulation service receives a request to cancel publishing an interaction class, if the received request is valid, it parses the request to obtain the interaction class publication relationship, and obtains the target interaction class to be canceled based on the interaction class publication relationship. If the target interaction class has already been published, then the interaction class publication relationship is deleted from the interaction class publication relationship set.

[0055] In this embodiment, as Figure 2 The diagram illustrates the object class publishing process. During the simulation run, the simulation unit calls the object class publishing service to declare to the co-simulation that the simulation unit can produce data for a specified object class. Upon receiving this request, the simulation service saves the current simulation unit's publishing relationship for that object class in the data storage. After successful object class publishing, the simulation unit can register object instances of that object class and update the object instance data. This service must be called once for each object class to be published, even if these object classes belong to the same class hierarchy. Subsequent business logic can query whether a specified object class has been published through the IsObjectClassPublished (object class publication status) service.

[0056] like Figure 3 The diagram illustrates the process of canceling the publication of an object class. During the simulation run, the simulation unit calls the Cancel Publication of Object Class service to declare to the co-simulation that the simulation unit will no longer produce data for the specified object class. After receiving the request, the simulation service will delete the current simulation unit's publication relationship for that object class from the data storage. After successfully canceling the publication of the object class, the simulation unit is no longer responsible for updating the object instance data of that object class.

[0057] like Figure 4The diagram illustrates the process of publishing interactive classes. During the simulation run, the simulation unit calls the publish interactive class service to declare to the co-simulation that the simulation unit can produce data for a specified interactive class. Upon receiving this request, the simulation service saves the current simulation unit's publication relationship for that interactive class in the data storage. After successful publication, the simulation unit can update the data for that interactive class. This service must be called once for each interactive class to be published, even if these interactive classes belong to the same class hierarchy. Subsequent business logic can query whether a specified interactive class has been published through the IsInteractionClassPublished (whether the interactive class is published) service.

[0058] like Figure 5 The diagram shown illustrates the process of canceling the publication of an interactive class. During the simulation run, the simulation unit calls the cancel publication service to declare to the co-simulation that the simulation unit will no longer produce data for the specified interactive class. After receiving the request, the simulation service will delete the current simulation unit's publication relationship for that interactive class from the data storage. After successfully canceling the publication of the interactive class, the simulation unit is no longer responsible for updating the data of that interactive class.

[0059] In one embodiment, the simulation service performs an operation to add or delete subscription relationships in the set of object class subscription relationships or the set of interaction class subscription relationships in the associated container according to a request, including: the simulation service receives a subscription request for an object class; if the received subscription request is valid, it parses the subscription request to obtain the object class subscription relationship, obtains the target object class to be subscribed based on the object class subscription relationship, and if the target object class is not subscribed, it adds the object class subscription relationship to the set of object class subscription relationships; the simulation service receives a cancellation request for an object class; if the received cancellation request is valid, it parses the cancellation request to obtain the object class subscription relationship, obtains the target object class to be cancelled based on the object class subscription relationship, and if the target object class is not subscribed, it adds the object class subscription relationship to the set of object class subscription relationships. If an object class has already been ordered, the object class order relationship is deleted from the object class order relationship set. When the simulation service receives an order request for an interactive class, if the received order request is valid, it parses the order request to obtain the interactive class order relationship, and obtains the target interactive class to be ordered based on the interactive class order relationship. If the target interactive class has not been ordered, the interactive class order relationship is added to the interactive class order relationship set. When the simulation service receives a request to cancel an interactive class order, if the received cancellation request is valid, it parses the cancellation request to obtain the interactive class order relationship, and obtains the target interactive class to be canceled based on the interactive class order relationship. If the target interactive class has already been ordered, the interactive class order relationship is deleted from the interactive class order relationship set.

[0060] In this embodiment, as Figure 6The flowchart shown illustrates the ordering process for object classes. During the simulation run phase, the simulation unit calls the ordering object class service to declare to the co-simulation that the simulation unit can consume object instance data of the specified object class. After receiving the request, the simulation service will save the current simulation unit's ordering relationship for that object class in the data storage.

[0061] like Figure 7 The flowchart shown illustrates the process of canceling an order for an object class. During the simulation run, the simulation unit calls the cancel order service to declare to the co-simulation that the simulation unit will no longer consume data of the specified object class. After receiving the request, the simulation service will delete the current simulation unit's order relationship for that object class from the data storage.

[0062] like Figure 8 The diagram illustrates the ordering process for interactive classes. During the simulation run, the simulation unit calls the "Order Interactive Class" service to declare to the co-simulation that it can consume data of a specified interactive class. Upon receiving this request, the simulation service saves the current simulation unit's ordering relationship for that interactive class in the data storage. After a successful order, whenever a simulation unit in the co-simulation updates the data of that interactive class, the simulation service forwards the data to the current simulation unit. This service must be called once for each interactive class to be ordered, even if these object classes belong to the same class hierarchy. Subsequent business logic can query whether a specified interactive class has been ordered through the "IsInteractionClassSubscribed (Whether the Interactive Class is Subscribed)" service.

[0063] like Figure 9 The diagram illustrates the process of canceling an interactive class subscription. During the simulation run, the simulation unit calls the cancel interactive class subscription service to declare to the co-simulation that the simulation unit will no longer consume the data of the specified interactive class. After receiving the request, the simulation service will delete the current simulation unit's subscription relationship for the interactive class from the data storage. After the interactive class subscription is successfully canceled, when a simulation unit in the co-simulation updates the data of the interactive class, the simulation service will no longer forward the interactive class data to the current simulation unit.

[0064] In the above process, the steps to determine whether the received request is valid include: after receiving the request, the simulation service obtains the co-simulation handle, simulation unit handle, and object class handle through deserialization, and checks whether the co-simulation handle, simulation unit handle, and object class handle are valid through three interfaces: whether co-simulation exists, whether simulation unit exists, and whether object class exists. If invalid, the corresponding error code is returned; if valid, the process proceeds to the next step.

[0065] In one embodiment, after the simulation service performs an operation to add or delete subscription relationships on the set of object class subscription relationships in the associated container according to the request, the method further includes: checking whether other simulation units in the co-simulation have registered object instances of the object class; if so, obtaining object instance information and triggering a callback function to discover object instance registration or delete object instance registration, thereby implementing subscription or cancellation.

[0066] In this embodiment, as Figure 6 The flowchart shown illustrates the process of ordering an object class. It checks if any other simulation unit in the co-simulation has registered an object instance of that class. If so, it retrieves the object instance information and triggers the object instance registration discovery callback function. After successful ordering, whenever a simulation unit in the co-simulation updates the object instance data of that class, the simulation service forwards the object instance data to the current simulation unit. This service must be called once for each object class to be ordered, even if these object classes belong to the same class hierarchy. Subsequent business logic can query whether a specified object class has been ordered through the IsObjectClassSubscribed (object class subscribed) service.

[0067] like Figure 7 The flowchart shown illustrates the process of canceling an object class subscription. It checks if any other simulation unit in the co-simulation has registered an object instance of that object class. If so, it retrieves the object instance information and triggers the object instance deletion callback function. After successfully canceling the object class subscription, when another simulation unit in the co-simulation updates the object instance data of that object class, the simulation service will no longer forward that object class data to the current simulation unit.

[0068] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0069] In one embodiment, such as Figure 10 As shown, a co-simulation device based on the mapping of object classes and interaction classes is provided, including:

[0070] The handle allocation module 1002 is used to allocate object class handles and interaction class handles respectively for the simulation service.

[0071] The request generation module 1004 is used to, when declaring events for object classes and interaction classes, call the active call interface of the dynamic library for the object class and the active call interface for the interaction class respectively to obtain the corresponding publication and ordering relationship, and generate the corresponding request based on the publication and ordering relationship; the publication and ordering relationship includes the publication relationship or ordering relationship of the current simulation unit to the target object class or interaction class; the publication relationship includes publication requirements and cancellation publication requirements; the ordering relationship includes ordering requirements and cancellation ordering requirements;

[0072] The relationship establishment module 1006 is used by the simulation unit to obtain the object class handle and the interaction class handle respectively, and to send corresponding requests to the simulation service through the object class handle and the interaction class handle. The simulation service performs the addition or deletion operation of the published ordering relationship on the corresponding relationship set in the association container according to the request. The relationship set includes the object class published relationship set, the object class ordering relationship set, the interaction class published relationship set, and the interaction class ordering relationship set.

[0073] The co-simulation module 1008 is used to perform co-simulation based on the published ordering relationships of each simulation unit in the relationship set after the published ordering relationship is established.

[0074] Specific limitations regarding the co-simulation device based on object class and interaction class mapping can be found in the limitations of the co-simulation method based on object class and interaction class mapping mentioned above, and will not be repeated here. Each module in the aforementioned co-simulation device based on object class and interaction class mapping can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0075] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 11As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a co-simulation method based on object class and interaction class mapping. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0076] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0077] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above.

[0078] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0079] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A joint simulation method based on object class and interaction class mapping, the method is implemented in a joint simulation system, characterized in that: The method comprises: The simulation service allocates object class handles and interaction class handles to the object class and interaction class respectively; When declaring events of the object class and the interaction class, the simulation unit calls the object class active call interface and the interaction class active call interface of the dynamic library respectively, obtains the corresponding publication subscription relationship, and generates a corresponding request according to the publication subscription relationship; the publication subscription relationship includes the publication relationship or subscription relationship of the current simulation unit to the target object class or interaction class; the publication relationship includes the publication demand and the cancellation demand; the subscription relationship includes the subscription demand and the cancellation demand; The simulation unit obtains the object class handle and the interaction class handle respectively, and initiates corresponding requests to the simulation service through the object class handle and the interaction class handle. The simulation service performs an add or delete operation of a publication subscription relationship on the corresponding relationship set in the association container according to the request; the relationship set includes an object class publication relationship set, an object class subscription relationship set, an interaction class publication relationship set, and an interaction class subscription relationship set; Perform joint simulation according to the published subscription relationship of each simulation unit in the relationship set; The joint simulation based on the published subscription relationship of each simulation unit in the relationship set includes: If the current simulation unit has a publication requirement for the target object class, the simulation unit declares to the simulation service through the publication object class service that it has the ability to generate target object class data, and is responsible for registering the object instance of the target object class and updating the object instance data; If the current simulation unit has a publishing demand for the target interaction class, the simulation unit declares to the simulation service that it has the ability to produce the target interaction class data through the publishing interaction class service, and is responsible for updating the interaction data; If the current simulation unit has a subscription demand for the target object class, the simulation unit declares its intention to consume the target object class data to the simulation service through the subscription object class service. When a simulation unit in the joint simulation updates the object instance data of the target object class, the simulation service forwards the object instance data of the target object class to the current simulation unit. If the current simulation unit has a subscription demand for the target interaction class, the simulation unit declares its intention to consume the target interaction class data to the simulation service by subscribing to the interaction class service. When a simulation unit in the joint simulation updates the interaction data of the target interaction class, the simulation service forwards the interaction data of the target interaction class to the current simulation unit.

2. The method according to claim 1, characterized in that The object class active call interface includes a publish object class interface, a cancel publish object class interface, a subscribe object class interface and a cancel subscribe object class interface; the interaction class active call interface includes a publish interaction class interface, a cancel publish interaction class interface, a subscribe interaction class interface and a cancel subscribe interaction class interface.

3. The method according to claim 1, characterized in that The simulation service includes publishing object class service, canceling publishing object class service, ordering object class service, canceling ordering object class service, publishing interaction class service, canceling publishing interaction class service, ordering interaction class service and canceling ordering interaction class service.

4. The method according to claim 1, characterized in that: The simulation service performs the operation of adding or deleting the published subscription relationship on the corresponding relationship set in the association container according to the request, including: When the simulation unit initiates a publication request or a cancel publication request of an object class or an interaction class to the simulation service, the simulation service performs an add or delete operation of a publication subscription relationship on the object class publication relationship set or the interaction class publication relationship set in the association container according to the request; When the simulation unit initiates an object class or interaction class subscription request or a cancellation request to the simulation service, the simulation service performs an add or delete operation on the published subscription relationship for the object class subscription relationship set or the interaction class subscription relationship set in the association container according to the request.

5. The method according to claim 4, characterized in that The simulation service performs the operation of adding or deleting the publication subscription relationship on the object class publication relationship set or the interaction class publication relationship set in the association container according to the request, including: The simulation service receives a request to publish an object class. If the received request to publish an object class is valid, the simulation service parses the request to publish an object class to obtain an object class publication relationship. According to the object class publication relationship, the target object class to be published is obtained. If the target object class is not published, the object class publication relationship is added to the object class publication relationship set. The simulation service receives a request to cancel publishing of an object class, and if the received request to cancel publishing of an object class is valid, the request to cancel publishing of the object class is parsed to obtain an object class publishing relationship, and a target object class to be canceled according to the object class publishing relationship is obtained, and if the target object class has been published, the object class publishing relationship is deleted from the object class publishing relationship set; The simulation service receives a request to publish an interactive class. If the received request to publish an interactive class is valid, the request to publish an interactive class is parsed to obtain an interactive class publication relationship. According to the interactive class publication relationship, a target interactive class to be published is obtained. If the target interactive class is not published, the interactive class publication relationship is added to the interactive class publication relationship set. The simulation service receives a request to cancel the publication of an interaction class. If the received request to cancel the publication of an interaction class is valid, the request to cancel the publication of the interaction class is parsed to obtain the interaction class publication relationship. According to the interaction class publication relationship, the target interaction class that needs to be unpublished is obtained. If the target interaction class has been published, the interaction class publication relationship is deleted from the interaction class publication relationship set.

6. The method according to claim 4, characterized in that The simulation service performs the operation of adding or deleting the published subscription relationship on the object class subscription relationship set or the interaction class subscription relationship set in the association container according to the request, including: The simulation service receives a request for ordering an object class. If the received request for ordering an object class is valid, the request for ordering an object class is parsed to obtain an object class ordering relationship. According to the object class ordering relationship, a target object class to be ordered is obtained. If the target object class is not ordered, the object class ordering relationship is added to the object class ordering relationship set. The simulation service receives a request to cancel the subscription of an object class, and if the received request to cancel the subscription of an object class is valid, the request to cancel the subscription of the object class is parsed to obtain an object class subscription relationship, and a target object class that needs to be unsubscribed is obtained according to the object class subscription relationship, and if the target object class has been subscribed, the object class subscription relationship is deleted from the object class subscription relationship set; The simulation service receives a subscription interaction class request. If the received subscription interaction class request is valid, the subscription interaction class request is parsed to obtain an interaction class subscription relationship. A target interaction class to be subscribed is obtained according to the interaction class subscription relationship. If the target interaction class is not subscribed, the interaction class subscription relationship is added to the interaction class subscription relationship set. The simulation service receives a request to cancel the subscription of an interactive class. If the received request to cancel the subscription of an interactive class is valid, the request to cancel the subscription of the interactive class is parsed to obtain an interactive class subscription relationship. According to the interactive class subscription relationship, a target interactive class that needs to be canceled is obtained. If the target interactive class has been subscribed, the interactive class subscription relationship is deleted from the interactive class subscription relationship set.

7. The method according to claim 3, characterized in that After the simulation service performs the operation of adding or deleting the published subscription relationship on the object class subscription relationship set in the association container according to the request, the following further includes: Check whether other simulation units in the joint simulation have registered object instances of the object class. If so, obtain the object instance information and trigger the discovery object instance registration callback function or the deletion object instance registration callback function to implement subscription or cancellation.

8. A joint simulation device based on object class and interaction class mapping, characterized in that: The device comprises: A handle allocation module is used for simulating services to allocate object class handles and interaction class handles to object classes and interaction classes respectively; The request generation module is used for, when making event declarations of object classes and interaction classes, the simulation unit respectively calls the object class active call interface and the interaction class active call interface of the dynamic library to obtain the corresponding publication subscription relationship, and generates a corresponding request according to the publication subscription relationship; the publication subscription relationship includes the publication relationship or subscription relationship of the current simulation unit to the target object class or interaction class; the publication relationship includes publication requirements and cancellation requirements; the subscription relationship includes subscription requirements and cancellation requirements; A relationship establishment module is used for the simulation unit to obtain the object class handle and the interaction class handle respectively, and initiate a corresponding request to the simulation service through the object class handle and the interaction class handle. The simulation service performs an add or delete operation of the publication subscription relationship on the corresponding relationship set in the association container according to the request; the relationship set includes an object class publication relationship set, an object class subscription relationship set, an interaction class publication relationship set, and an interaction class subscription relationship set; A joint simulation module, used for performing joint simulation according to the published subscription relationship of each simulation unit in the relationship set after establishing the published subscription relationship; The joint simulation module is also used for, if the current simulation unit has a publication demand for the target object class, the simulation unit declares to the simulation service through the publication object class service that it has the ability to generate the target object class data, and is responsible for registering the object instance of the target object class and updating the object instance data; if the current simulation unit has a publication demand for the target interactive class, the simulation unit declares to the simulation service through the publication interactive class service that it has the ability to produce the target interactive class data, and is responsible for updating the interactive data; if the current simulation unit has a subscription demand for the target object class, the simulation unit declares to the simulation service the intention to consume the target object class data through the subscription object class service, and when a simulation unit in the joint simulation updates the object instance data of the target object class, the simulation service forwards the object instance data of the target object class to the current simulation unit; If the current simulation unit has a subscription demand for the target interaction class, the simulation unit declares its intention to consume the target interaction class data to the simulation service by subscribing to the interaction class service. When a simulation unit in the joint simulation updates the interaction data of the target interaction class, the simulation service forwards the interaction data of the target interaction class to the current simulation unit.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.