Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
The embodiment of the invention provides an information interaction and clock synchronization platform based on multiple systems, which is used for realizing information interaction between digital twin model systems. In the embodiment of the invention, the digital twin model system can be an airplane, satellite, vehicle, radar and other systems with related attributes such as a simulation model, an operation algorithm, simulation equipment and the like, and a space-time information system for displaying space-time information such as multi-object positions, operation tracks and states.
As shown in fig. 1, the information interaction and clock synchronization platform based on multiple systems provided in the embodiment of the present invention may at least include: the system comprises a processor, a memory storing a computer program, and a plurality of communication modules having the same communication interface and communication protocol, wherein the processor is in communication connection with the memory and the communication interface.
In an embodiment of the present invention, the communication interface may be an existing standard interface, such as a Rest API. The communication protocol of the platform may be an existing standard protocol such as UDP or TCP.
Further, in an embodiment of the present invention, the processor is configured to implement the following steps when the computer program is executed:
S100, when a request instruction of any digital twin model system for establishing connection with a platform is received, a communication module is obtained from the current available communication modules to serve as a target communication module for communicating with the digital twin model system, and corresponding connection indication information is sent to the digital twin model system; the connection indication information at least comprises an ID, a communication protocol, a communication interface and a conversion instruction of the target communication module; the conversion instruction is used for instructing the digital twin model system to convert own communication protocol and communication interface to be the same as the communication protocol and communication interface of the target communication module respectively.
In the embodiment of the invention, any method for converting a communication protocol of a digital twin model system into the same communication protocol as that of a target communication module and converting a communication interface of the digital twin model system into the same communication interface as that of the target communication module belongs to the protection scope of the invention.
It is known to the person skilled in the art that if the current communication module has no available communication module, i.e. the platform is already full, access to the new digital twin model system can be achieved by adding communication modules, i.e. the platform support is scalable.
S200, judging whether the digital twin model system is connected for the first time or not in response to the fact that the digital twin model system is connected with the platform, and if so, acquiring simulation operation data of the digital twin model system at the current moment and simulation operation data before the digital twin model system is connected with the platform, wherein the simulation operation data are used as current simulation operation data of the digital twin model system; if not, acquiring simulation operation data of the digital twin model system at the current moment, and taking the simulation operation data as the current simulation operation data of the digital twin model system.
The S200 has the technical effects that complete simulation data of the model can be obtained, missing of the completed simulation data before accessing the platform is avoided, and accuracy of the data of the model can be ensured.
Those skilled in the art will appreciate that the data format of the data sent to the platform by each digital twin model system is a data format that complies with the communication protocol specification of the platform.
S300, acquiring an associated digital twin model system associated with the digital twin model system in the digital twin model system which is currently connected with the platform.
In the embodiment of the invention, the associated digital twin model system associated with the digital twin model system is a model system which performs the same simulation task as the digital twin model system and needs to receive simulation data of the digital twin model system, and the associated digital twin model system associated with the digital twin model system can be known through information sent by the digital twin model system.
S400, the current simulation operation data of the digital twin model system is sent to the corresponding associated digital twin model system through the corresponding target communication module.
Further, in another embodiment of the present invention, the conversion instruction is further configured to instruct the digital twin model system to synchronize its own time with the time of the platform.
In the embodiment of the invention, the time of the platform can be real time or virtual time. The real time may be, for example, beijing time, london time, etc. The virtual time may be a time based on a real time transformation, for example, may be a time later or earlier than the current real time. In a preferred embodiment, it may be a virtual time to ensure that the simulated data is secure.
In the embodiment of the invention, the time synchronization of each digital twin model can be realized by synchronizing with the time of the platform.
Further, in another embodiment of the present invention, in S400, if the sent current simulation running data includes time information, the time information is adjusted based on the time of the platform, so as to obtain adjusted time information. That is, the time in the transmitted simulation operation data is adjusted to be consistent with the time of the platform based on the time of the platform, for example, if the time of the digital twin model system is inconsistent with the time of the platform and there is a time difference Δt (which may be a positive number or a negative number), the adjustment mode is t+Δt, and t is the time in the transmitted current simulation operation data.
Further, in an embodiment of the present invention, when the computer program is executed, the processor is further configured to implement the steps of:
And S500, responding to the received response information sent by the associated digital twin model system, and sending the received response information to the corresponding digital twin model system, wherein the response information at least comprises information representing that the adjusted time information is received, namely, telling the sender that the time based on the time of the platform is received.
Compared with the previous embodiment, the digital twin model system does not adjust the own time to be the same as the time of the platform, but adjusts the time in the transmitted data to be the same as the time of the platform, which has the advantages of avoiding the situation that the time of the own server needs to execute other tasks and cannot be changed, and ensuring that the time references of all the digital twin model systems executing the same simulation task execute the tasks are consistent.
Further, in an embodiment of the present invention, when the computer program is executed, the processor is further configured to implement the steps of:
S600, when a task execution instruction sent by any digital twin model system is received, the task execution instruction is sent to an associated digital twin model system of the digital twin model system; the task execution instruction is generated based on a target simulation task executed by the digital twin model system and is used for indicating task information required to be executed by the associated digital twin model system.
In one illustrative embodiment, the format of the task execution instruction may be JSON data, which may be expressed as follows:
{id:”xxxxxxx”,scencId;“xxxxx”,time:“2000-05-00 00:00:00”,cmd:“create”,param:{}}
{id:”xxxxxxx”,scencId;“xxxxx”,time:“2000-05-00 00:00:00”,cmd:“move”,param:{}}
Wherein, id is the id of a scene object, and the scene object can be a simulation object such as radar, plane, vehicle and the like; scencId is the number of the scene; time is the Time of this piece of data, i.e., the execution Time of the simulation task; cmd is the type of the data instruction (e.g. "create" is the object to be created in the created object, i.e. the object to be created in the scene, "move" is the object to be moved in the scene, etc.); param is the parameter used for this object.
In S600, if the digital twin model system that sent the task execution instruction is not clock synchronized with the platform, the time in the task execution instruction may be adjusted based on the time of the platform.
S700, the received simulation operation data is sent to the digital twin model system sending the task execution instruction in response to the simulation operation data sent by the associated digital twin model system corresponding to the digital twin model system sending the task execution instruction, so that timely interaction of information of the digital twin model system is realized.
Further, in the embodiment of the present invention, if the simulation run data contains sensitive data, the simulation run data is encrypted.
In embodiments of the invention, the sensitive data may include the name, model, and location of the object, such as the name, model, and location of the aircraft. In the embodiment of the invention, the conventional encryption method can be adopted to encrypt the sensitive data.
Those skilled in the art will appreciate that the simulation operation data of the digital twin model system can be obtained based on the existing simulation method, and the present invention will not be repeated.
Further, in the embodiment of the invention, the platform adopts a B/S architecture.
Further, in the embodiment of the invention, the platform is constructed by using a Spring Boot or Spring Cloud framework. Specifically, the Spring Boot/Cloud micro-service interface and protocol architecture can be utilized to design, the services related to simulation analysis are packaged into micro-services, and each service of the micro-services is mutually coordinated and matched in the independent process of each service operation, so that functions of operation support, service safety, background service, service fault tolerance, service monitoring, service deployment and the like are provided, the functions of service division and management are facilitated, the expansion of simulation analysis algorithms is easy, different micro-service systems can be conveniently added gradually without affecting the existing services, dynamic loading and unloading of the micro-service systems are supported, and the systems can be added or removed as required during operation.
Further, in the embodiment of the present invention, the digital twin model system communicates with the platform through WebSocket and Redis protocols. The invention realizes the collaborative simulation based on the distributed by utilizing the WebSocket and the Redis, and realizes the information transfer of the data information such as scene objects, dynamic operation, simulation analysis and the like in the front end and the rear end under the distributed condition. The active pushing adopts WebSocket to realize the bidirectional data exchange transmission of the simulation operation data between the client and the server. And adopting a Redis message communication mode for publishing and subscribing (pub), wherein a sender (pub) sends a message, and a subscriber (sub) receives the message, subscribes and publishes the message, so as to perform distributed information transmission and support the timing and real-time subscription/publishing transmission of the information.
Further, when the computer program is executed, the processor is configured to implement the steps of:
in response to receiving a deletion of a digital twin model system from a digital twin model system currently connected to the platform, the connection of the digital twin model system to the platform is severed.
In summary, the information interaction and clock synchronization platform based on multiple systems provided by the embodiment of the invention ensures the consistency and the synchronism of information by carrying out data distribution and clock timing on each system connected to the platform through the platform in the communication process of each digital twin model system, reduces the time delay and the load in the information synchronization process between each system, thereby improving the synchronization speed and ensuring the consistency and the synchronism of interaction between multiple systems.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.