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

By allocating handles to object classes and interaction classes and calling interfaces to generate requests, the problem of inconsistent management of published ordering relationships in distributed simulation systems is solved, achieving unified management and efficient communication of the simulation system.

CN119025082AActive Publication Date: 2024-11-26NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In distributed simulation systems, the matching of data interaction relationships between nodes suffers from inconsistent management of published ordering relationships, making unified management difficult. Furthermore, in HLA, the parent class receives child class instance data, resulting in incomplete information.

Method used

By assigning handles to object classes and interaction classes, calling the dynamic library interface to obtain the published ordering relationship, generating a request, and performing add or delete operations on the relationship set to the simulation service through the handle, unified management of the published ordering relationship of object classes and interaction classes is achieved.

Benefits of technology

It enables accurate communication and coordination between modules in the simulation system, avoids information loss, reduces network traffic, and supports dynamic relationship management during the simulation preparation and operation phases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025082A_ABST
    Figure CN119025082A_ABST
Patent Text Reader

Abstract

The invention relates to a joint simulation method, device and equipment based on object class and interaction class mapping. The method comprises the steps that an object class handle and an interaction class handle are distributed for an object class and an interaction class through a simulation service, when event declaration of the object class and the interaction class is carried out, a simulation unit calls an object class active calling interface and an interaction class active calling interface of a dynamic library to obtain a corresponding publishing and ordering relation, and the object class and the interaction class are published according to the publishing and ordering relation. Generating a corresponding request according to the publishing and ordering relationship, respectively acquiring an object type handle and an interaction type handle by a simulation unit, initiating the corresponding request to a simulation service through the object type handle and the interaction type handle, and adding or deleting the publishing and ordering relationship to a corresponding relationship set in an associated container by the simulation service according to the request; and performing joint simulation according to the publishing and ordering relationship of each simulation unit in the relationship set. By adopting the method, the unified management of the published ordering relationship can be realized, and the ordering party can accurately obtain the ordering data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of simulation data processing, and in particular to a joint simulation method, device and equipment based on object class and interaction class mapping. Background Art

[0002] Distributed simulation systems have many nodes, and the data sent and received by each node are different. In order to establish a publishing and subscription relationship for data between nodes, a data interaction relationship matching strategy is needed.

[0003] The traditional method uses the Topic matching mechanism to establish a publish-subscribe relationship between nodes of the same topic so that data of the topic can be sent. This method has the problems of inconsistent management of the publish-subscribe relationship matching level, and it is difficult to achieve unified management and maintenance of publish-subscribe management.

[0004] In the original HLA (High-Level Simulation Architecture)-based declaration management service, the publishing subscription relationship construction strategy is that when a federation member subscribes to an object class, the RTI (Run Time Infrastructure) will assume that the federation member is also interested in all its subclass instances and receive the subclass instances as parent class instances, while the attributes unique to the subclass instances are discarded, resulting in incomplete information.

[0005] Based on this, it is necessary to establish a more scientific and detailed public subscription relationship building criteria in response to the above technical issues. Summary of the invention

[0006] Based on this, it is necessary to provide a joint simulation method, device and equipment based on object class and interaction class mapping to address the above technical problems.

[0007] A joint simulation method based on object class and interaction class mapping, the method comprising: 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; Joint simulation is performed based on the published subscription relationship of each simulation unit in the relationship set.

[0008] A joint simulation device based on object class and interaction class mapping, the device comprising: 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; The joint simulation module is used to perform joint simulation according to the published subscription relationship of each simulation unit in the relationship set after the published subscription relationship is established.

[0009] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: 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; Joint simulation is performed based on the published subscription relationship of each simulation unit in the relationship set.

[0010] In the above-mentioned joint simulation method, device and equipment based on the mapping of object class and interaction class, the simulation unit uploads the publication and subscription relationship of the object class and the interaction class to the simulation service by calling the interface, and the simulation service manages it uniformly, which can ensure that the joint simulation has a consistent understanding of this, and at the same time provides a service interface for quickly querying the publication and subscription relationship for subsequent simulation business calls. The present invention not only supports the simulation unit to declare the publication and subscription relationship of the object class and the interaction class in the simulation preparation stage, but also supports the dynamic modification of the publication and subscription relationship of the object class and the interaction class during the simulation operation process. Compared with the instance of the parent class in HLA that can receive the instance data of the child class, the present invention constrains that both the parent class and the child class need to call the subscription object class / interaction class interface, and the subscription of the parent class can only receive the instance data of the parent class, and the subscription of the child class can only receive the instance data of the child class, thereby avoiding the problem that the attribute information specific to the child class is discarded when the instance of the parent class receives the instance data of the child class. In the embodiment of the present invention, the publication and subscription relationship of the data sender and receiver can be uniformly managed from the class level according to the demand of the simulation unit for data (object class and interaction class) in the joint simulation, thereby reducing the communication volume in the network. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 A schematic diagram of a process of a joint simulation method based on object class and interaction class mapping in one embodiment; Figure 2 A schematic diagram of a process flow of publishing an object class in one embodiment; Figure 3 A schematic diagram of a process of canceling the publication of an object class in one embodiment; Figure 4 A schematic diagram of an interactive process flow is disclosed in one embodiment; Figure 5 A schematic diagram of a process of canceling a publication interaction in one embodiment; Figure 6 A schematic diagram of a process of ordering an object class in one embodiment; Figure 7 A schematic diagram of a process of canceling a subscription object class in one embodiment; Figure 8 A schematic diagram of an ordering interaction process in an embodiment; Fig. 9 A schematic diagram of an interactive process for canceling a subscription in one embodiment; Fig.10 It is a structural block diagram of a joint simulation device based on object class and interaction class mapping in one embodiment; Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0012] 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.

[0013] The method of the present invention is implemented based on the KD-JLink (distributed simulation middleware) system. KD-JLink is a distributed simulation platform that supports LVC integrated joint simulation training. It is usually composed of a central server and multiple simulation nodes. Each simulation node is connected to the simulation service as a simulation unit. The data interaction between simulation units is carried out through the simulation service. Simulation units using the same data protocol form a joint simulation. The method of the present invention uniformly manages the publication and subscription of the object class and the interaction class of the simulation unit by constructing a publication and subscription relationship criterion, and has the same understanding in the joint simulation. The control mechanism of the simulation middleware is used to reduce the amount of data in the network during the simulation operation.

[0014] In one embodiment, Figure 1 As shown, a joint simulation method based on object class and interaction class mapping is provided, comprising the following steps: Step 102: The simulation service allocates an object class handle and an interaction class handle to the object class and the interaction class respectively.

[0015] Object class refers to the class that represents a specific entity or object in the simulation system. Each object class represents a physical unit in the simulation environment, such as a vehicle, aircraft, etc. These classes define the state and behavior of the object through attributes and methods. The definition and registration of object classes are usually completed in the simulation system so that simulation units can recognize and interact.

[0016] Interaction classes are used to define the communication or data exchange between simulation units. For example, in an unmanned platform confrontation simulation, an interaction class can define the behavior of one unit passing information to another unit. The registration and management of interaction classes are implemented through specific interface devices to ensure that information can be effectively exchanged between simulation units.

[0017] At the beginning of the simulation, the simulation service will assign a unique handle in the joint simulation to the object class and the interaction class. This handle plays a key role in the joint simulation. As a unique identifier, it ensures that all operations of the object class and the interaction class are performed through this handle. This mechanism helps to maintain the independence and consistency of different objects and interaction classes in the simulation process and avoid confusion or conflict. The method of the present invention manages the publication and subscription relationship of the object class and the interaction class based on the handle.

[0018] After the simulation service assigns a handle to an object class and an interaction class, all subsequent operations, such as state change, event triggering, data transmission, etc., must be performed through the handle. The method of the present invention manages the publishing and subscription relationship of the object class and the interaction class based on the handle. This mechanism not only improves the management efficiency of the simulation, but also ensures accurate communication and coordination between modules in the distributed simulation system.

[0019] Step 104, 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.

[0020] The publishing and subscribing relationship includes the publishing relationship or subscribing relationship of the current simulation unit to the target object class or the interactive class; the publishing relationship includes publishing requirements and canceling publishing requirements; the subscribing relationship includes subscribing requirements and canceling subscribing requirements.

[0021] The method of the present invention adopts the form of C++ dynamic library to provide 8 active calling interfaces for the simulation unit, namely, PublishObjectClass (publishing object class), UnPublishObjectClass (cancel publishing object class), PublishInteractionClass (publishing interaction class), UnPublishInteractionClass (cancel publishing interaction class), SubscribeObjectClass (subscribe object class), UnSubscribeObjectClass (cancel subscribe object class), SubscribeInteractionClass (subscribe interaction class) and UnSubscribeInteractionClass (cancel subscribe interaction class). The simulation unit can declare their intention to produce and consume messages (object class and interaction class) to the joint simulation by calling these interfaces.

[0022] Step 106, 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 the adding or deleting operation of the publishing subscription relationship on the corresponding relationship set in the association container according to the request.

[0023] The associative container set has the characteristics of unique and ordered elements and fast search speed. The method of the present invention uses set as the storage structure of the publication and subscription relationship. The relationship set includes the object class publication relationship set, the object class subscription relationship set, the interaction class publication relationship set and the interaction class subscription relationship set.

[0024] Step 108, performing joint simulation according to the published subscription relationship of each simulation unit in the relationship set.

[0025] In the above-mentioned joint simulation method based on object class and interaction class mapping, object class handles and interaction class handles are respectively allocated to object classes and interaction classes through simulation services. When declaring events of 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 subscription relationship, and generates corresponding requests according to the published subscription relationship. 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 the addition or deletion operation of the published subscription 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 subscription relationship set, the interaction class published relationship set and the interaction class subscription relationship set, and the joint simulation is performed according to the published subscription relationship of each simulation unit in the relationship set. The embodiment of the present invention can realize the unified management of the published subscription relationship, which is conducive to the subscriber to accurately obtain the subscription data.

[0026] In one embodiment, joint simulation is performed according to the publication and subscription relationship of each simulation unit in the relationship set, including: 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 produce 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 interaction class, the simulation unit declares to the simulation service through the publication interaction class service that it has the ability to produce the target interaction class data, 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 to the simulation service through the subscription object class service the intention to consume the 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 demand for the target interaction class, the simulation unit declares to the simulation service through the subscription interaction class service the intention to consume the 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.

[0027] In this embodiment, the publisher publishes object instance data and interaction data to the simulation server, and the subscriber subscribes to the target object class and interaction class. If a simulation unit in the joint simulation updates the object instance data of the target object class or the interaction data of the target interaction class, the simulation service forwards the updated data to the subscriber.

[0028] In one embodiment, the object class actively calls the interface including publishing object class interface, unpublishing object class interface, subscribing object class interface and unsubscribing object class interface; the interaction class actively calls the interface including publishing interaction class interface, unpublishing interaction class interface, subscribing interaction class interface and unsubscribing interaction class interface.

[0029] In one embodiment, the simulation service includes publish object class service, cancel publish object class service, subscribe object class service, cancel subscribe object class service, publish interaction class service, cancel publish interaction class service, subscribe interaction class service and cancel subscribe interaction class service.

[0030] In one embodiment, the simulation service performs the operation of adding or deleting the published subscription relationship on the corresponding relationship set in the associated container according to the request, including: when the simulation unit initiates a publication request or cancels a publication request for an object class or an interaction class to the simulation service, the simulation service performs the operation of adding or deleting the published subscription relationship on the object class publication relationship set or the interaction class publication relationship set in the associated container according to the request; when the simulation unit initiates a subscription request or cancels a subscription request for an object class or an interaction class to the simulation service, 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 associated container according to the request.

[0031] In one embodiment, the simulation service performs an operation of adding or deleting a publication subscription relationship on an object class publication relationship set or an interactive class publication relationship set in an associated container according to a request, including: the simulation service receives a request to publish an object class, and 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, and obtains a target object class to be published according to the object class publication relationship; 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 the publication of an object class, and if the received request to cancel the publication of an object class is valid, the simulation service parses the request to cancel the publication of an object class to obtain an object class publication relationship, and obtains a target object class to be canceled according to the object class publication relationship; if the target object class is not published, the simulation service adds the object class publication relationship to the object class publication relationship set; If the target object class has been published, the object class publication relationship is deleted from the object class publication 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 the interactive class is parsed to obtain the interactive class publication relationship, and the target interactive class to be published is obtained according to the interactive class publication relationship. If the target interactive class has not been 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 interactive class. If the received request to cancel the publication of an interactive class is valid, the request to cancel the publication of an interactive class is parsed to obtain the interactive class publication relationship, and the target interactive class to be canceled is obtained according to the interactive class publication relationship. If the target interactive class has been published, the interactive class publication relationship is deleted from the interactive class publication relationship set.

[0032] In this embodiment, if Figure 2 As shown in the flowchart of object class publication, during the simulation operation phase, the simulation unit calls the object class publication service to declare to the joint simulation that the simulation unit can produce data of the specified object class. After receiving the request, the simulation service will save the publication relationship of the current simulation unit to the object class in the data storage. After the object class is successfully published, the simulation unit can register the object instance of the 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 businesses can query whether the specified object class is published through the IsObjectClassPublished (Is the object class published) service.

[0033] like Figure 3 As shown in the flowchart of unpublishing an object class, during the simulation running phase, the simulation unit calls the unpublishing object class service to declare to the joint simulation that the simulation unit will no longer produce data of the specified object class. After receiving the request, the simulation service will delete the publication relationship of the current simulation unit to the object class in the data storage. After successfully unpublishing the object class, the simulation unit is no longer responsible for updating the object instance data of the object class.

[0034] like Figure 4The schematic diagram of the published interaction class process is shown. During the simulation running phase, the simulation unit calls the published interaction class service to declare to the joint simulation that the simulation unit can produce data of the specified interaction class. After receiving the request, the simulation service will save the current simulation unit's publication relationship for the interaction class in the data storage. After the interaction class is successfully published, the simulation unit can update the data of the interaction class. This service must be called once for each interaction class to be published, even if these interaction classes belong to the same class hierarchy. Subsequent businesses can query whether the specified interaction class is published through the IsInteractionClassPublished service.

[0035] like Figure 5 The flowchart of canceling the publication of interaction classes is shown in the figure. During the simulation running phase, the simulation unit calls the cancel publication service of the interaction class to declare to the joint simulation that the simulation unit will no longer produce data of the specified interaction class. After receiving the request, the simulation service will delete the publication relationship of the current simulation unit to the interaction class in the data storage. After the interaction class is successfully canceled, the simulation unit is no longer responsible for updating the data of the interaction class.

[0036] In one embodiment, the simulation service performs an operation of adding or deleting a published subscription relationship on an object class subscription relationship set or an interactive class subscription relationship set in an associated container according to a request, including: the simulation service receives an object class subscription request, and if the received object class subscription request is valid, the simulation service parses the object class subscription request to obtain the object class subscription relationship, obtains a target object class to be subscribed according to the object class subscription relationship, and if the target object class is not subscribed, adds the object class subscription relationship to the object class subscription relationship set; the simulation service receives an object class cancellation request, and if the received object class cancellation request is valid, the simulation service parses the object class cancellation request to obtain the object class subscription relationship, obtains a target object class to be cancelled according to the object class subscription relationship, and if the target object class is not subscribed, adds the object class subscription relationship to the object class subscription relationship set. 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, and if the received subscription interaction class request is valid, the subscription interaction class request is parsed to obtain the interaction class subscription relationship, and the target interaction class that needs to be subscribed is obtained according to the interaction class subscription relationship, and if the target interaction class has not been subscribed, the interaction class subscription relationship is added to the interaction class subscription relationship set; the simulation service receives a cancellation interaction class request, and if the received cancellation interaction class request is valid, the cancellation interaction class request is parsed to obtain the interaction class subscription relationship, and the target interaction class that needs to be canceled is obtained according to the interaction class subscription relationship, and if the target interaction class has been subscribed, the interaction class subscription relationship is deleted from the interaction class subscription relationship set.

[0037] In this embodiment, if Figure 6As shown in the flowchart of ordering object classes, during the simulation running phase, the simulation unit calls the ordering object class service to declare to the joint simulation that the simulation unit can consume the object instance data of the specified object class. After receiving the request, the simulation service will save the ordering relationship of the current simulation unit to the object class in the data storage.

[0038] like Figure 7 As shown in the flowchart of cancelling the object class subscription, during the simulation running phase, the simulation unit calls the cancelling object class subscription service to declare to the joint simulation that the simulation unit no longer consumes the data of the specified object class. After receiving the request, the simulation service will delete the subscription relationship of the current simulation unit to the object class in the data storage.

[0039] like Figure 8 As shown in the flowchart of ordering interaction classes, during the simulation running phase, the simulation unit calls the ordering interaction class service to declare to the joint simulation that the simulation unit can consume the data of the specified interaction class. After receiving the request, the simulation service will save the subscription relationship of the current simulation unit to the interaction class in the data storage. After the ordering of the interaction class is successful, when a simulation unit in the joint simulation updates the data of the interaction class, the simulation service will forward the interaction class data to the current simulation unit. This service must be called once for each interaction class to be ordered, even if these object classes belong to the same class hierarchy. Subsequent businesses can query whether the specified interaction class is ordered through the IsInteractionClassSubscribed service.

[0040] like Fig. 9 As shown in the flowchart of cancelling the subscription of interaction classes, during the simulation running phase, the simulation unit calls the cancelling the subscription of interaction classes service to declare to the joint simulation that the simulation unit no longer consumes the data of the specified interaction class. After receiving the request, the simulation service will delete the subscription relationship of the current simulation unit to the interaction class in the data storage. After the subscription of the interaction class is successfully canceled, when a simulation unit in the joint simulation updates the data of the interaction class, the simulation service will no longer forward the interaction class data to the current simulation unit.

[0041] In the above process, the step of determining whether the received request is valid includes: after the simulation service receives the request, it obtains the joint simulation handle, the simulation unit handle and the object class handle through deserialization, and checks whether the joint simulation handle, the simulation unit handle and the object class handle are valid through three interfaces: whether the joint simulation exists, whether the simulation unit exists and whether the object class exists. If invalid, it returns the corresponding error code; if valid, it proceeds to the next step.

[0042] In one embodiment, after the simulation service performs the operation of adding or deleting the published subscription relationship on the object class subscription relationship set in the associated container according to the request, it also includes: checking whether there are other simulation units in the joint simulation that have registered the object instance of the object class, and if so, obtaining the object instance information, and triggering the discovery of the object instance registration callback function or the deletion of the object instance registration callback function to implement subscription or cancellation.

[0043] In this embodiment, if Figure 6 The flowchart of ordering object classes shown in the figure checks whether other simulation units in the joint simulation have registered object instances of the object class. If so, the object instance information is obtained and the object instance registration callback function is triggered. After the object class is successfully ordered, when a simulation unit in the joint simulation updates the object instance data of the object class, the simulation service will forward the object instance data of the object class 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 businesses can query whether the specified object class is ordered through the IsObjectClassSubscribed (Is the object class subscribed) service.

[0044] like Figure 7 The flowchart of unsubscribing an object class shown in the figure checks whether other simulation units in the joint simulation have registered an object instance of the object class. If so, the object instance information is obtained, and the callback function for deleting the object instance registration is triggered. After the object class is unsubscribed successfully, when a simulation unit in the joint simulation updates the object instance data of the object class, the simulation service will no longer forward the object class data to the current simulation unit.

[0045] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed 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 part of the sub-steps or stages of other steps.

[0046] In one embodiment, Fig.10 As shown, a joint simulation device based on object class and interaction class mapping is provided, comprising: A handle allocation module 1002 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 1004 is used for, when making event declarations of the object class and the interaction class, 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 the publication demand and the cancellation demand; the subscription relationship includes the subscription demand and the cancellation demand; The relationship establishment module 1006 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 the object class publication relationship set, the object class subscription relationship set, the interaction class publication relationship set and the interaction class subscription relationship set; The joint simulation module 1008 is used to perform joint simulation according to the publication and subscription relationship of each simulation unit in the relationship set after the publication and subscription relationship is established.

[0047] For the specific definition of the joint simulation device based on object class and interaction class mapping, please refer to the definition of the joint simulation method based on object class and interaction class mapping in the above text, which will not be repeated here. Each module in the above-mentioned joint simulation device based on object class and interaction class mapping can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0048] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a joint simulation method based on object class and interaction class mapping is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.

[0049] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0050] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.

[0051] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.

[0052] The above-mentioned 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 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; Joint simulation is performed based on the published subscription relationship of each simulation unit in the relationship set.

2. The method according to claim 1, characterized in that 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.

3. 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.

4. 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.

5. 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.

6. The method according to claim 5, 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.

7. The method according to claim 5, 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.

8. The method according to claim 4, 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.

9. 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; The joint simulation module is used to perform joint simulation according to the published subscription relationship of each simulation unit in the relationship set after the published subscription relationship is established.

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

Citation Information

Patent Citations

  • HLA-based universal heterogeneous simulation system interconnection method

    CN103761388A

  • Method and architecture for adapting distributed simulation RTI in unreal engine

    CN118152039A