Disclosure of Invention
In view of the above, the embodiments of the present application provide an information transmission method and apparatus for a distributed joint simulation system, which solve the information interaction problem between heterogeneous and remote systems by using the object interoperability technology of a multi-mode communication mechanism and the external access gateway design, thereby improving the efficiency and reliability of information transmission and providing efficient and reliable information transmission support for joint operation simulation experiments.
The embodiment of the application provides the following technical scheme that an information transmission method for a distributed joint simulation system comprises the following steps:
According to the communication requirements of the distributed joint simulation system in different simulation scenes, determining a plurality of communication modes, respectively designing corresponding communication protocols for each communication mode, and generating mapping relations among the simulation scenes, the communication modes and the communication protocols in a distributed joint simulation master node;
Constructing communication middleware for carrying out distributed joint simulation communication management, respectively generating an object agent of each distributed joint simulation working node, establishing a unified communication protocol between the communication middleware and each object agent, and distributing the mapping relation to each object agent through the communication middleware;
And transmitting the simulation scene or the communication mode determined by the user in the distributed joint simulation master node to each object agent through the communication middleware, so that the object agent determines a communication protocol corresponding to the simulation scene or the communication mode according to the mapping relation, switches the communication mode of the working node and converts the communication protocol of the working node.
According to one embodiment of the application, the method further comprises:
issuing a simulation scene or a communication mode determined by a user in the distributed joint simulation master node to each object agent through the communication middleware, and issuing a communication protocol conversion starting time and a conversion duration to each object agent;
And if the current working node does not complete the conversion of the communication protocol in the conversion duration, the object agent of the current working node sends a conversion incomplete message to the distributed joint simulation master node through the communication middleware.
According to one embodiment of the application, each object agent registers the attribute information of the working node to the communication middleware and is used for calling remote objects by other distributed joint simulation working nodes according to the node registration information in the communication middleware, wherein the attribute information comprises node instances, names and appointed unique identification information.
According to one embodiment of the application, when the communication middleware receives a remote call request sent by the object agent of any working node to other working nodes, the registration information of the working node is queried in the communication middleware, whether the working node is subjected to information registration or not and whether the registration information is complete or not is determined, and therefore the safety of the working node is verified.
According to one embodiment of the application, the method further comprises designing an external access gateway, defining an interface of the external access gateway in the communication middleware, registering the external access gateway in the communication middleware, and configuring gateway parameters in the communication middleware to integrate the external access gateway into the communication middleware.
According to one embodiment of the application, the heterogeneous system is connected to the external access gateway through the loading part to transmit system data information in a Service interface or a background transfer mode, wherein the Service interface comprises a Web Service or a RESTful API, and the background transfer mode comprises a message queue or a file transfer mode.
According to one embodiment of the application, the communication modes include a data publish/subscribe mode, a distributed object communication mode, a point-to-point communication mode, and a broadcast communication mode.
The application also provides an information transmission device for the distributed joint simulation system, which comprises:
The mapping relation generation module is used for determining a plurality of communication modes according to communication requirements of the distributed joint simulation system in different simulation scenes, designing corresponding communication protocols for each communication mode respectively, and generating mapping relation among the simulation scenes, the communication modes and the communication protocols in a distributed joint simulation master node;
The communication middleware construction module is used for constructing communication middleware for carrying out distributed joint simulation communication management, respectively generating an object agent of each distributed joint simulation working node, establishing a unified communication protocol between the communication middleware and each object agent, and distributing the mapping relation to each object agent through the communication middleware;
And the instruction issuing module is used for issuing the simulation scene or the communication mode determined by the user in the distributed joint simulation main node to each object agent through the communication middleware, so that the object agent determines a communication protocol corresponding to the simulation scene or the communication mode according to the mapping relation, and switches the communication mode of the working node and converts the communication protocol of the working node.
Compared with the prior art, the method and the device have the advantages that at least one technical scheme adopted by the embodiment of the specification at least comprises the steps that the communication relationship between the communication middleware and the object agent is constructed through the multi-mode communication mechanism and the external access gateway design, so that the high-efficiency interconnection of heterogeneous and remote systems can be realized, the defect of the traditional distributed simulation mechanism in the interconnection of heterogeneous systems is overcome, and the reliability of interconnection among the systems is improved. In addition, the embodiment of the invention designs the external access gateway, supports an external system to access the gateway component through the loading part, transmits system data information in a service interface mode, can also support information such as a database or a file to be transmitted in a background transfer mode, improves the expansibility and the reliability of the system, enhances the user interaction experience, supports various data formats and protocols, can conveniently access new simulation systems or equipment, and has good expansibility.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Other advantages and effects of the present application will become apparent to those skilled in the art from the following disclosure, which describes the embodiments of the present application with reference to specific examples. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. The application may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present application. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
As shown in fig. 1, an embodiment of the present invention provides an information transmission method for a distributed joint simulation system, including:
S101, determining a plurality of communication modes according to communication requirements of a distributed joint simulation system in different simulation scenes, respectively designing corresponding communication protocols for each communication mode, and generating mapping relations among the simulation scenes, the communication modes and the communication protocols in a distributed joint simulation master node;
s102, constructing a communication middleware for carrying out distributed joint simulation communication management, respectively generating an object agent of each distributed joint simulation working node, establishing a unified communication protocol between the communication middleware and each object agent, and distributing the mapping relation to each object agent through the communication middleware;
s103, the simulation scene or the communication mode determined by the user in the distributed joint simulation master node is issued to each object agent through the communication middleware, so that the object agent determines a communication protocol corresponding to the simulation scene or the communication mode according to the mapping relation, and switches the communication mode of the working node and converts the communication protocol of the working node.
Aiming at a complex distributed joint simulation system, the embodiment of the invention constructs a communication middleware for realizing high-efficiency interconnection among the systems, sets an object agent for each system working node, and establishes a unified communication protocol and a communication interface between the communication middleware and the object agent. When the system main node receives a communication mode switching instruction or a simulation scene switching instruction, the corresponding communication mode or simulation scene is only required to be forwarded to each object agent through a communication middleware, a complex data processing process, an analysis and calculation process and the like are not required to be carried out, the operation efficiency of the system main node is not influenced, when each object agent receives the communication mode or simulation scene switching message, the corresponding communication protocol is obtained from a locally cached mapping relation table, and the switching of the communication mode and the conversion of the communication protocol are completed in the local node, so that the efficient and reliable intercommunication interconnection is realized.
The communication middleware in the present embodiment serves as a core component of the multimode communication mechanism, which is responsible for managing communication modes, protocols, data transmission, and the like. In specific implementation, the construction process of the communication middleware mainly comprises (1) setting a communication mode manager for registering, managing and scheduling different communication modes, (2) setting a data transmission engine for packaging, transmitting and decapsulating data and supporting various data formats (such as JSON, XML, binary system and the like), (3) setting a message queue for caching and scheduling data to be transmitted to ensure the sequence and reliability of data transmission, and (4) setting a load equalizer, wherein the communication middleware is required to set the load equalizer for dynamically distributing communication resources according to network load conditions and avoiding network congestion because the communication middleware is responsible for transmitting, managing and the like of multiple data.
In this embodiment, object agents are respectively set for the working nodes in each distributed joint simulation system, so as to simplify the complexity of data transmission, control management and remote object call. The main purpose of the setting is to provide a middle layer between the working nodes and between the working nodes and the main nodes, so that remote objects can be called or data interaction can be carried out between the nodes like the local objects are called, and network communication details of the bottom layer are not needed to be concerned. Moreover, each node interacts with a remote object through the object agent, so that the coupling degree of the nodes is reduced. On the other hand, the object agent can also provide guarantee for the security of the node, verify the identity and authority of the interaction node, and can also provide a data caching function, so that repeated calling of remote objects is reduced.
In some embodiments of the invention, the communication modes include a data publish/subscribe mode, a distributed object communication mode, a point-to-point communication mode, and a broadcast communication mode. In specific implementation, the data publishing/subscribing mode is suitable for a large-scale data distribution scene, the simulation nodes can publish data and subscribe interested data, the distributed object communication mode is suitable for an interaction scene with low delay and high real-time performance, supports direct object call among the simulation nodes, the point-to-point communication mode is suitable for direct communication between two nodes, the broadcasting communication mode is suitable for a one-to-many data broadcasting scene, and a proper communication mode is determined according to communication requirements of a system simulation scene.
In order to ensure the reliability and real-time performance of interconnection of all nodes in a simulation system, in some embodiments of the present invention, the method further includes issuing a simulation scene or a communication mode determined by a user in the distributed joint simulation master node to each object agent through the communication middleware, issuing a communication protocol conversion start time and a conversion duration to each object agent, and if the conversion of a communication protocol is not completed in the conversion duration by a current working node, sending a conversion incompletion message to the distributed joint simulation master node by the object agent of the current working node through the communication middleware.
In the implementation, a master node in the simulation system generates a communication protocol conversion starting time and a conversion time while transmitting a communication mode or a simulation scene to each object agent, and simultaneously transmits the communication protocol conversion starting time and the conversion time to the object agents of each working node through a communication middleware, so that each working node performs a communication protocol conversion action at a unified communication protocol conversion time, and the uniformity and the instantaneity of the system are ensured. On the other hand, judging whether the current node finishes protocol conversion within the conversion time period through the object agent of each working node, if the current node fails and does not finish conversion after the conversion time period, sending a conversion incomplete message to a main node of the system through the object agent of the node so as to further test and maintain the node, and if the system main node does not receive the conversion incomplete message fed back by the working node after the conversion time period, considering that the working node finishes mode switching and communication protocol conversion successfully. According to the embodiment, the communication protocol conversion starting time and the conversion time are set, so that the uniformity and the reliability of the system are further improved, and the efficiency and the reliability of information transmission are improved.
In order to facilitate remote invocation among the nodes, in some embodiments of the present invention, the method further includes that each object agent registers attribute information of the working node to the communication middleware, and is used for other distributed joint simulation working nodes to invoke remote objects according to node registration information in the communication middleware, where the attribute information includes node instance, naming and specified unique identification information. Each working node registers attribute information of the node in the communication middleware so as to ensure that other working nodes can find and call. In specific implementation, the node instance refers to a specific object created according to a certain class or template of the node, the naming is used for facilitating other simulation nodes to find and access the node through the name, the specified unique identification information is used for facilitating other simulation nodes to find accurately, and specifically, the identification information can be a character string and can comprise function description, position information and the like of the node.
In order to ensure the security of data call when the inter-call between the nodes is performed, in some embodiments of the present invention, when the communication middleware receives a remote call request sent by the object agent of any working node to other working nodes, the registration information of the working node is queried in the communication middleware, and whether the working node performs information registration or not and whether the registration information is complete or not is determined, so as to verify the security of the working node. Through the verification mode, the security of the mutual calling among the nodes is ensured, and only legal simulation nodes can register and access remote objects.
In some embodiments of the invention, the method further comprises designing an external access gateway, defining an interface of the external access gateway in the communication middleware, registering the external access gateway in the communication middleware, and configuring gateway parameters in the communication middleware to integrate the external access gateway into the communication middleware.
In this embodiment, an external access gateway is designed, and the external access gateway is responsible for accessing an external system (such as a heterogeneous simulation system, a database, a file system, etc.) into a joint simulation platform, so as to implement interaction and sharing of data.
In the implementation, before designing the external access gateway, the type of the external system to be accessed, such as a database, a file system, a Web service, other simulation systems, etc., needs to be determined first, and the transmission mode and the data format of the data, such as real-time data stream, batch data transmission, file transmission, etc., are determined according to the type of the external system, and the data format, such as JSON, XML, binary data, etc. And then designing the architecture of the external access gateway according to the determined content, wherein the gateway architecture can comprise a protocol adapter for supporting various communication protocols such as HTTP, webSocket, FTP, TCP/IP and the like to realize communication between an external system and the gateway, a data format converter for converting the data format of the external system into a standard format in the joint simulation system, a service interface for providing a unified API interface for the external system to call, a background transfer service for supporting transfer transmission of a database or a file, and a security module for realizing identity authentication, data encryption and access control.
When the method is implemented, the heterogeneous system is accessed to the external access gateway through the loading part, and the transmission of system data information is carried out in a Service interface or a background transfer mode, wherein the Service interface comprises a Web Service or a RESTful API, and the background transfer mode comprises a message queue or a file transfer mode.
As shown in fig. 2, the present application further provides an information transmission device for a distributed joint simulation system, including:
The mapping relation generation module is used for determining a plurality of communication modes according to communication requirements of the distributed joint simulation system in different simulation scenes, designing corresponding communication protocols for each communication mode respectively, and generating mapping relation among the simulation scenes, the communication modes and the communication protocols in a distributed joint simulation master node;
The communication middleware construction module is used for constructing communication middleware for carrying out distributed joint simulation communication management, respectively generating an object agent of each distributed joint simulation working node, establishing a unified communication protocol between the communication middleware and each object agent, and distributing the mapping relation to each object agent through the communication middleware;
And the instruction issuing module is used for issuing the simulation scene or the communication mode determined by the user in the distributed joint simulation main node to each object agent through the communication middleware, so that the object agent determines a communication protocol corresponding to the simulation scene or the communication mode according to the mapping relation, and switches the communication mode of the working node and converts the communication protocol of the working node.
When the method is implemented, the instruction issuing module is further used for issuing a communication protocol conversion starting time and conversion duration to each object agent while issuing a simulation scene or a communication mode determined by a user in the distributed joint simulation master node to each object agent through the communication middleware, and if the conversion of the communication protocol is not completed in the conversion duration by the current working node, the object agent of the current working node sends a conversion incompletion message to the distributed joint simulation master node through the communication middleware.
In the implementation, as shown in fig. 3, the device further includes an information registration module, configured to register, by using each object agent, attribute information of the working node to the communication middleware, and use the attribute information to call a remote object by using other distributed joint simulation working nodes according to node registration information in the communication middleware, where the attribute information includes node instance, naming and specified unique identification information.
In implementation, as shown in fig. 3, the apparatus further includes a verification module, configured to, when the communication middleware receives a remote call request sent by the object agent of any working node to another working node, query registration information of the working node in the communication middleware, and determine whether the working node performs information registration and whether the registration information is complete, so as to verify security of the working node.
In specific implementation, as shown in fig. 3, the device further includes an external access gateway design module, configured to design an external access gateway, define an interface of the external access gateway in the communication middleware, register the external access gateway in the communication middleware, and configure gateway parameters in the communication middleware to integrate the external access gateway into the communication middleware.
According to the embodiment of the invention, the communication relationship between the communication middleware and the object agent is constructed through the multi-mode communication mechanism and the external access gateway design, so that the high-efficiency interconnection of heterogeneous and remote systems can be realized, the defect of the traditional distributed simulation mechanism in the interconnection of heterogeneous systems is overcome, and the reliability of interconnection among the systems is improved. In addition, the embodiment of the invention designs the external access gateway, supports an external system to access the gateway component through the loading part, transmits system data information in a service interface mode, can also support information such as a database or a file to be transmitted in a background transfer mode, improves the expansibility and the reliability of the system, enhances the user interaction experience, supports various data formats and protocols, can conveniently access new simulation systems or equipment, and has good expansibility.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the scope of the present application should be included in the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.