Modelica platform and UE4 co-simulation system based on publishing / subscribing mechanism
Through the collaborative simulation system of the Modelica platform and UE4, the three-dimensional rendering capabilities of Opendds middleware and UE4 are used to solve the problem that the Modelica platform simulation results are not intuitive enough, and multi-view and all-round simulation situation display is realized, which improves the simulation effect.
Patent Information
- Application Number
- CN202510568436.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-13
- Publication Date
- 2025-08-12
AI Technical Summary
The simulation results of the existing Modelica platform are not intuitive enough, especially in the field of large-scale aerospace simulation, the three-dimensional display effect is poor, which cannot meet the needs of global engineering results and construction performance, and there are problems of damage or missing model conversion interfaces.
The Modelica platform based on the publish/subscribe mechanism is adopted and the UE4 collaborative simulation system is used to establish a data transmission channel through the Opendds middleware, and the three-dimensional simulation capabilities of UE4 are used, combined with the dynamic data transmission of Opendds and the UE4 blueprint system to achieve multi-view and all-round simulation situation display.
The collaborative simulation between the Modelica platform and UE4 is realized, the visualization effect of simulation results is improved, the rendering ability of natural phenomena is enhanced, the problem of intuition of model display is solved, and the visualization needs of large-scale aerospace simulation fields are met.
Smart Images

Figure CN120470780A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer simulation, and in particular relates to a collaborative simulation system of a Modelica platform and UE4 based on a publish / subscribe mechanism. Background Art
[0002] At present, computer simulation has become an important means of analysis, research, testing, evaluation, development and skills training of complex large systems, and has been widely used in important fields of various industries such as national defense, manufacturing, energy, transportation, agriculture and medicine, education, economy, weather forecasting, etc. With the continuous application of simulation in various industries and fields, engineering simulation visualization has made good progress in the field of simulation because it uses computer graphics to visualize the engineering space environment and design schemes, express the schemes intuitively and vividly, sort out design ideas, or convey design intentions to third parties accurately and quickly.
[0003] Modelica is a multi-domain unified modeling language with great development potential. It can be applied to simulation modeling in many fields. OpenModelica is an open source implementation of simulation based on the Modelica language. It provides modeling, compilation, simulation, and result display functions based on the Modelica language. There are two problems with the Modelica-based simulation approach: First, because the simulation results of the Modelica platform are mainly displayed in one-dimensional or two-dimensional form, especially in the field of large-scale aerospace simulation, the display of simulation results is not intuitive enough and it is difficult to highlight the changing characteristics of the simulation results. Second, the three-dimensional display of simulation results of mainstream simulation software in the engineering field is not prominent, the physical simulation effect is poor, and the rendering ability of natural phenomena such as lighting and weather is even lacking.
[0004] Models created with existing simulation software generally lack a model conversion interface, resulting in corruption or loss of models after importing them into the simulation engine. For simulation scenarios that require integration with the specific layout of the Digital Earth, the visualization views provided by these simulation software cannot guarantee the overall project effect and construction performance. Summary of the Invention
[0005] The purpose of the present invention is to address the above problems and provide a collaborative simulation system between the Modelica platform and UE4 based on a publish / subscribe mechanism, apply the excellent animation scene rendering capabilities of UE4 to the field of object simulation, establish a data transmission channel between the Modelica platform and UE4 software based on Opendds middleware, and realize collaborative object simulation between the Modelica platform and UE4.
[0006] In order to achieve the above object, the technical solution provided by the present invention is: The co-simulation system of the Modelica platform and UE4 based on the publish / subscribe mechanism includes: OpenModelica simulation platform: used to model simulation objects and set simulation parameters; compile Modelica model files to generate executable files, run the executable files, output and display simulation results, and transmit simulation data to Opendds middleware; Opendds middleware: uses publish / subscribe mechanism to transmit data by configuring publisher and subscriber. UE4 simulation scene module: Generates a terrain model corresponding to the simulated terrain scene, imports simulation objects, and constructs a three-dimensional simulation space corresponding to the real simulation scene, providing users with a multi-perspective, all-round simulation situation display; receives simulation data from the OpenModelica simulation platform through the Opendds middleware, and loads the simulation data into the visual scene simulation model to achieve collaborative simulation.
[0007] Preferably, the Opendds middleware uses the OpenModelica platform as the publishing end.
[0008] Furthermore, the Opendds middleware uses UE4 software as the subscription end.
[0009] Preferably, the Opendds middleware subscription end adopts a recorder mode, which is adaptable to a variety of data structure types and data transmission topics.
[0010] Preferably, the Opendds middleware realizes effective data transmission by defining a data transmission service based on two interface layers, the first layer of the data transmission service of the two interface layers is the DCPS layer, and the second layer is the data local reconstruction layer; the DCPS layer transmits data from the publisher to the subscriber by matching the publisher / subscriber topics and QoS protocols, the data writer transmits the simulation result data to the publisher, and the data reader reads the data from the subscriber.
[0011] The method of the collaborative simulation system includes: Step 1: Use the Modelica platform to perform simulation modeling and obtain the model file in the Modelica language; parse the model file and convert it into C / C++ language simulation code; Step 2: Utilize the publish / subscribe mechanism of Opendds middleware, with the Modelica platform as the publisher and UE4 software as the subscriber. Generate C / C++ language code for the publisher and subscriber, respectively. Integrate the code with the Modelica platform and UE4 software, respectively, to establish a data transmission channel between the Modelica platform and UE4 software. Step 3: Create a UE4 simulation scene, load the Opendds subscriber plug-in in the simulation scene, and encapsulate the interface function in the Opendds subscriber plug-in as a blueprint node. Call the subscriber in the UE4 simulation scene, receive the simulation object data, and load the simulation object in the simulation scene; load local resources, set the camera perspective of the simulation object, and start the multi-perspective visualization simulation of the simulation object.
[0012] Furthermore, step 1 specifically includes: establishing a Modelica model using the OpenModelica platform and generating a Modelica model file in a specified path; converting the Modelica language in the Modelica model file into C / C++ language; and finally compiling and linking the converted C / C++ file and the publishing end code file to generate an .exe executable simulation model; performing real-time simulation or offline simulation on the executable simulation model and outputting simulation result data.
[0013] Preferably, the step 2 specifically includes: Step 2.1: Configure the publisher and subscriber to use the same domain value; register the data type transmitted during the simulation, and configure the data type agreed upon by the publisher and subscriber; configure the topic corresponding to the registered data type, and customize a specific name for each topic in the domain, corresponding to the specific data type published by the publisher; Step 2.2: Configure data writers and publishers. The publisher passes data to the Opendds middleware through the data writer. Each data writer corresponds to a specific topic. The publisher uses the data writer's specified type interface to publish data samples on the bound topic. The data writer encodes the simulated transmission data and passes it to the publisher for transmission. The publisher obtains the data to be published and passes it to all subscribers in the domain. Step 2.3: Configure the topic corresponding to the registered data type on the subscriber side. Customize a specific name for each topic in the domain and correspond it to the specific data type published by the publisher. The subscriber obtains data by identifying the topic name published by the publisher. Configure data readers and subscribers. Subscribers receive data from publishers and transmit the acquired data to all associated data readers. Configure monitoring code on the subscriber side and transmit the monitored data type to subscribers. Data readers obtain data from subscribers, decode it into the corresponding topic data type, and finally transmit the data to the middleware subscriber node integrated in the UE4 scene. Step 2.4: Define and express the data transmission service according to the interface description language for the type of data to be transmitted, obtain the interface description language file for the data definition and expression, compile the interface description language file, and map it to the C++ type support file; Step 2.5: Generate the publisher and subscriber executable files and run them to start data transmission.
[0014] Preferably, in step 2.5, an MPC file is written, and engineering processing of the MPC file is performed to generate source code files of the publishing end and the subscribing end.
[0015] Preferably, step 3 specifically includes: 3.1) Write an Opendds subscriber-side plug-in module for the UE4 external dynamic plug-in, write the Opendds subscriber-side source code into the plug-in and compile it for use; 3.2) Call the Opendds subscriber plug-in module node in the level blueprint of the UE4 scene, link the nodes in the blueprint editor, compile the blueprint, and output the subscriber receiving data instance; 3.3) Use 3DS MAX, CATIA, UG, and World Machine software to generate simulation object models and load the simulation object models into the simulation scene; 3.4) Load the Cesium for Unreal plug-in in the UE4 software and load the digital globe for the UE4 simulation scene; 3.5) Configure camera angles to provide users with multi-angle, all-round simulation situation display.
[0016] Compared with the prior art, the present invention has the following beneficial effects: 1) The present invention implements collaborative object simulation between the Modelica platform and UE4 software, solving the problem of the lack of intuitive display of simulation results in Modelica software. Compared with existing mainstream simulation software in the engineering field, the collaborative simulation method of the present invention has better physical simulation effects, stronger rendering capabilities for natural phenomena, and better global effects of simulation scenes, especially in the field of large-scale aerospace simulation, where the simulation results have good visual effects.
[0017] 2) In view of the data transmission characteristics of the simulation field, which have multiple data sources, large multi-source data volume, complex structure, and frequent transmission, the present invention adopts Opendds as the transmission middleware to meet the data transmission requirements of the collaborative simulation system.
[0018] 3) Given the technical characteristics of DDS itself, this technology is mainly used in replicated distributed systems that require real-time and efficient data transmission. Developers can apply Opendds to a single computer or deploy it in a distributed manner on different computer devices without having to pay attention to its underlying physical communication protocol, providing a multi-scenario simulation method.
[0019] 4) The latest Opendds supports DynamicType, a dynamic data type. The data structure type can be modified on the publishing side, or when a data transmission topic is added, the subscriber uses the recorder method to receive the new data type without modifying or compiling the code. In response to changes in simulation software result data, the subscriber can receive data at the lowest cost.
[0020] 5) UE4's unique blueprint system provides developers with an intuitive and clear editing interface. Compared with the complete use of code, this graphical programming method has a significant advantage in development efficiency. The functions of this collaborative simulation system are mainly implemented using blueprints.
[0021] 6) This invention utilizes the excellent rendering capabilities of the UE4 engine to combine the global terrain seamless simulation scene with the Modelica platform. In terms of simulation visual effects, compared with the 3D scene that comes with the simulation software, the UE4 scene is more realistic and better meets the simulation requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The present invention will be further described below with reference to the accompanying drawings.
[0023] Figure 1 Schematic diagram of collaborative simulation between the OpenModelica platform and UE4 according to an embodiment of the present invention.
[0024] Figure 2 Schematic diagram of the process of secondary development software simulation for OpenModelica.
[0025] Figure 3 A flow chart for building Opendds middleware.
[0026] Figure 4 Schematic diagram of an MPC project file according to an embodiment of the present invention.
[0027] Figure 5 Diagram of the code for extending the subscriber side for dynamic data.
[0028] Figure 6 This is a schematic diagram of the process of building a UE4 simulation scene according to an embodiment of the present invention.
[0029] Figure 7 This is a schematic diagram of a method for calling a plug-in on the subscription side of the Opendds middleware on the UE4 scene side according to an embodiment of the present invention.
[0030] Figure 8 This is a rendering of the main interface of a simulation project according to an embodiment of the present invention.
[0031] Figure 9 This is a multi-perspective simulation example effect diagram of a simulation project according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The simulation object in the embodiment is an aircraft.
[0033] like Figure 1 As shown in the figure, the co-simulation system of Modelica platform and UE4 based on publish / subscribe mechanism includes: OpenModelica platform: A software platform based on Openmodelica secondary development is selected for simulation modeling to obtain a model file in the Modelica language; the model file is parsed, the language of the model file is converted, and the executable file is compiled.
[0034] Opendds middleware: Opendds adopts a publish / subscribe architecture, emphasizes data-centricity, and provides a rich set of QoS service quality strategies to ensure real-time, efficient, and flexible data distribution, meeting the needs of various distributed real-time communication applications. Data is transmitted by configuring the Opendds middleware publisher and subscriber. At the same time, Opendds supports dynamic data expansion. When the transmission data type changes, the project subscriber code does not need to be recompiled to successfully receive the dynamically expanded data from the publisher.
[0035] UE4 simulation scene module: It uses 3DS MAX, World Machine and other software to generate terrain models corresponding to the simulated terrain scene, imports simulation object aircraft models, ground inspection equipment, launch equipment and other models, and constructs an ultra-large three-dimensional simulation space corresponding to the real simulation scene. It provides simulation researchers with a multi-perspective, all-round simulation situation display, and provides a more intuitive and realistic judgment basis for simulation data results. It receives simulation result data through middleware, loads the result data into the visual scene simulation model, and performs collaborative simulation.
[0036] The collaborative simulation method between the Modelica platform and UE4 based on the publish / subscribe mechanism includes the following steps: Step 1: OpenModelica secondary development software simulation process is as follows Figure 2 As shown in the figure, Modelica physical simulation software, after modeling is completed, save the Modelica model and generate a Modelica model file (.mo file) in the specified path; set the simulation parameters, and then call the simulation function to compile the Modelica model file to generate an executable file (.exe file), run the executable file through the execution module, output and display the simulation results, and transmit the simulation data to the middleware publishing end node.
[0037] Step 2: The process of creating a data transmission channel based on Opendds middleware is as follows Figure 3As shown in the figure, OpenDDS defines a service for participants in a distributed deployment program to efficiently transfer data. This service is divided into two interface layers: the first layer is the DCPS layer (Data Centric Publish Subscribe), and the second layer is the DLRL layer (Data Local Reconstruction Layer). The DCPS layer transfers data from publishers to subscribers by matching publisher / subscriber topics and QoS protocols. Data writers transmit simulation results to publishers, and data readers read data from subscribers.
[0038] Step 2.1: The publisher and subscriber configure the same domain value. In different domains, different programs on the same group of hosts or on the same host will be isolated from each other and unable to transmit data. The API interface Creat_participant is used to configure the publisher and subscriber to be located in the same logical communication network, and the use of a unified domain value enables DCPS to exchange data. Register the simulation transmission data type. The API interface DemoTopic1TypeSupportImpl is obtained through the custom data type in the IDL interface file. Call DemoTopic1TypeSupportImpl to configure the publisher and subscriber to communicate with each other using the agreed data type DemoTopic1. Configure the registered data type to correspond to the topic. The API interface createtopic is used to create a topic. The name of the dynamically extended data structure is written in the createtopic function. Each topic in the domain must have a customized specific name and correspond to the specific data type published by the publisher. The publishing process specifies the topic when publishing data, and the subscriber obtains data by requesting the corresponding topic.
[0039] Step 2.2: Configure the Data Writer and Publisher. Call the creat_publisher and creat_datawriter APIs to create the Data Writer and Publisher, respectively. The simulation software's inherited middleware publisher passes data to Opendds via the Data Writer. Each Data Writer corresponds to a specific topic. The publisher uses the Data Writer's specified type interface to publish data samples on the bound topic. The Data Writer first encodes the simulation transmission data and then passes it to the publisher for transmission. The publisher obtains the data to be published and passes it to all subscribers in its domain.
[0040] Step 2.3: Similar to Steps 2.1 and 2.2, register the subscriber domain and data type. Configure the topic corresponding to the registered data type. The create_typeless_topic API is used to create a typeless topic. Enter the name of the dynamically extended data structure in the create_typeless_topic function. Each topic in the domain must be customized and named to correspond to the specific data type published by the publisher. The publisher specifies the topic when publishing data, and the subscriber obtains the data by requesting the corresponding topic.
[0041] Configure the Data Reader and Subscriber by calling the create_subscriber and create_datareader APIs, respectively. Subscribers receive data from publishers and transmit it to all associated Data Readers. Subscribers use the create_recorder function to configure the recorder listening code, which listens for dynamically expanded data types and transmits them to subscribers. Data Readers retrieve data from subscribers, decode it into the corresponding topic data type, and transmit it to the middleware subscriber node integrated into the UE4 scene.
[0042] Step 2.4: Define and represent the data transmission service according to the interface description language for the data type that needs to be transmitted, and obtain the IDL file that defines and represents the data. The "@" annotation is used in the IDL file to specify the data type that the Data Distribution Service (DDS) needs to transmit and process. In order to generate the C++ code for the type support necessary for transmitting the data type, after the IDL is written, it is processed and compiled by the TAO IDL compiler and the Opendds IDL compiler, and finally mapped to the C++ type support file.
[0043] Step 2.5: Write the MPC file and perform MPC engineering processing to generate the VC project file. The content of the MPC file is as follows: Figure 4 Start running the publisher and subscriber executable files to start dynamic data extension type transmission. Configure the dynamic data extension subscriber code as shown below. Figure 5 shown.
[0044] Step 3: Load the Opendds subscriber plug-in in the UE4 scene, encapsulate the interface function in the Opendds subscriber plug-in as a blueprint node, and the UE4 scene receives data by calling the subscriber node and simulates the physical model. The UE4 super-large terrain map construction process is as follows: Figure 6 shown.
[0045] Step 3.1: In the UE4 external dynamic plug-in module, the plug-in module code is the subscriber code described in steps 2.3, 2.4, and 2.5. Compile the subscriber code to obtain the middleware subscriber plug-in module. This module is automatically encapsulated by UE4 as a visual blueprint node.
[0046] Step 3.2: Call the middleware subscription end plug-in module node in the UE4 scene level blueprint to complete the link between UE4 and Opendds. UE4 calls the blueprint node as follows Figure 7 As shown in the figure, Event BeginPlay is the main function called by the blueprint, the OpenDDSPlugin Init node encapsulates the Opendds subscriber code and initializes Opendds, the node parameters Ptopic and Stopic define the publish and subscribe topics respectively, rtps defines the transmission method, Set time by event is a timer that sets the output data interval for subscription data, GetMSG Content is a custom event used to obtain subscription data from the subscriber and transmit the data to the structure split node Break DDSmessage, which splits the structure into the data types required for scene calls, and Print String prints the received data.
[0047] Step 3.3: Generate simulation object models using a combination of 3DS MAX, CATIA, UG, World Machine and other software. The UE4 scene model format is FBX. Non-FBX format models can be converted to FBX format models through CAD Exchange software.
[0048] Step 3.4: Load the Cesium for Unreal plug-in in UE4, load the digital globe into the UE4 scene, and generate a large three-dimensional virtual space corresponding to the real simulation scene.
[0049] Step 3.5: Configure camera perspectives for the simulation object model to provide simulation researchers with a multi-perspective, comprehensive simulation situation display, providing a more intuitive and realistic basis for judging simulation data results. After completing the subscription plugin loading and the Cesium for Unreal plugin on the UE4 scene side, and attaching the model simulation perspective camera, you can compile the entire simulation scene, start the UE4 scene, and begin the visual simulation.
[0050] In the simulation project of the embodiment, the digital earth is first loaded, and the UE4 scene calls the Opendds subscription port plug-in through the UE4 level blueprint node OpenDDSPlugin Init. The subscription end recorder receives the data sample function encapsulated in this node. By calling this node, the middleware can be used to transmit data in the scene, and the aircraft model is further imported. In order to improve the scene simulation demonstration effect, multiple cameras are hung on the model. By splitting the simulation screen, multiple cameras and multiple perspectives are set to monitor the missile flight status in real time. Figure 8 Shown is the main interface of the aircraft simulation project of the embodiment. Figure 9 The simulation results of the aircraft simulation process from different perspectives are shown. The project simulation scene uses Cesium Digital Earth, and 10-level tile maps are loaded in the Digital Earth, which can be used to simulate and analyze the global flight of the aircraft. The implementation results of the method of the present invention show that the simulation result data of each group of aircraft can be fully received during the simulation process, and the data transmission delay can meet the scene display requirements. During the entire simulation process of the aircraft's launch, takeoff, and accelerated flight, the flight coordinates match the geographical coordinates of the Digital Earth, and the heading angle and flight attitude match to achieve zero error display on the model flight status, accurately reaching the flight destination from the flight starting point.
[0051] In summary, by linking the Opendds middleware with the UE4 simulation scene, Opendds technology simplifies the configuration process of various complex data transmission protocols, greatly improves the flexibility of data transmission through a data-centric publish / subscribe method, and makes the linking process of multiple different software more convenient. In view of the characteristics of this technology itself, Opendds is particularly suitable for the data transmission needs of the simulation field with multiple data sources, large multi-source data volume, complex structure, and frequent transmission. At the same time, Opendds supports dynamic data expansion between the publisher and the subscriber. When facing changes in the parameter variable type of the simulation result, no matter how the publisher changes the transmission data type, or increases the number and content of data transmission topics, the subscriber does not need to modify the code or compile the code a second time, and the subscriber can successfully receive the data type dynamically expanded by the publisher.
[0052] On the UE4 scene side, the custom plug-in module provided by UE4 makes loading the Opendds subscription terminal more flexible, and project requirements can be met without learning or modifying the underlying UE4 source code. UE4's powerful scene rendering capabilities have unparalleled advantages in building simulation scenes. Compared with traditional simulation scene effects, UE4's rendering of natural scene effects such as simulation object models, ultra-large seamless terrain loading, and sky and atmospheric lighting are more realistic and closer to the effects of actual experimental scenes. Therefore, by leveraging the distributed bridging capabilities of the Opendds middleware, the collaborative simulation requirements of the Modelica platform and UE4 are realized. At the same time, this collaborative simulation system, utilizing UE4, can effectively adapt to the current visual simulation platform's requirements for displaying simulation results.
Claims
1. The collaborative simulation system of Modelica platform and UE4 based on publish / subscribe mechanism is characterized by: include: OpenModelica simulation platform: used to model simulation objects and set simulation parameters; Compile the Modelica model file to generate an executable file, run the executable file, output and display the simulation results, and transmit the simulation data to the Opendds middleware; Opendds middleware: uses publish / subscribe mechanism to transmit data by configuring publisher and subscriber. UE4 simulation scene module: Generates a terrain model corresponding to the simulated terrain scene, imports simulation objects, and constructs a three-dimensional simulation space corresponding to the real simulation scene, providing users with a multi-perspective, all-round simulation situation display; receives simulation data from the OpenModelica simulation platform through the Opendds middleware, and loads the simulation data into the visual scene simulation model to achieve collaborative simulation.
2. The collaborative simulation system according to claim 1, characterized in that: The Opendds middleware uses the OpenModelica platform as the publishing end.
3. The collaborative simulation system according to claim 2, characterized in that: The Opendds middleware uses UE4 software as the subscription end.
4. The collaborative simulation system according to claim 3, wherein: The Opendds middleware subscription end adopts a recorder mode, which is adaptable to a variety of data structure types and data transmission topics.
5. The collaborative simulation system according to claim 4, characterized in that: The Opendds middleware realizes effective data transmission by defining a data transmission service based on two interface layers. The first layer of the data transmission service of the two interface layers is the DCPS layer, and the second layer is the data local reconstruction layer; the DCPS layer transmits data from the publisher to the subscriber by matching the publisher / subscriber end topics and QoS protocols, the data writer transmits the simulation result data to the publisher, and the data reader reads the data from the subscriber.
6. The collaborative simulation system method according to any one of claims 1 to 5, wherein: The method comprises: Step 1: Use the Modelica platform to perform simulation modeling and obtain the model file in the Modelica language; parse the model file and convert it into C / C++ language simulation code; Step 2: Utilize the publish / subscribe mechanism of Opendds middleware, with the Modelica platform as the publisher and UE4 software as the subscriber. Generate C / C++ language code for the publisher and subscriber, respectively. Integrate the code with the Modelica platform and UE4 software, respectively, to establish a data transmission channel between the Modelica platform and UE4 software. Step 3: Create a UE4 simulation scene, load the Opendds subscriber plug-in in the simulation scene, and encapsulate the interface function in the Opendds subscriber plug-in as a blueprint node. Call the subscriber in the UE4 simulation scene, receive the simulation object data, and load the simulation object in the simulation scene; load local resources, set the camera perspective of the simulation object, and start the multi-perspective visualization simulation of the simulation object.
7. The method according to claim 6, characterized in that The step 1 specifically includes: establishing a Modelica model using the OpenModelica platform and generating a Modelica model file in a specified path; converting the Modelica language in the Modelica model file into C / C++ language; and finally compiling and linking the converted C / C++ file and the publishing end code file to generate an .exe executable simulation model; performing real-time simulation or offline simulation on the executable simulation model and outputting simulation result data.
8. The method according to claim 7, characterized in that The step 2 specifically includes: Step 2.1: Configure the publisher and subscriber to use the same domain value; register the data type transmitted during the simulation, and configure the data type agreed upon by the publisher and subscriber; configure the topic corresponding to the registered data type, and customize a specific name for each topic in the domain, corresponding to the specific data type published by the publisher; Step 2.2: Configure data writers and publishers. The publisher passes data to the Opendds middleware through the data writer. Each data writer corresponds to a specific topic. The publisher uses the data writer's specified type interface to publish data samples on the bound topic. The data writer encodes the simulated transmission data and passes it to the publisher for transmission. The publisher obtains the data to be published and passes it to all subscribers in the domain. Step 2.3: Configure the topic corresponding to the registered data type on the subscriber side. Customize a specific name for each topic in the domain and correspond it to the specific data type published by the publisher. The subscriber obtains data by identifying the topic name published by the publisher. Configure data readers and subscribers. Subscribers receive data from publishers and transmit the acquired data to all associated data readers. Configure monitoring code on the subscriber side and transmit the monitored data type to subscribers. Data readers obtain data from subscribers, decode it into the corresponding topic data type, and finally transmit the data to the middleware subscriber node integrated in the UE4 scene. Step 2.4: Define and express the data transmission service according to the interface description language for the type of data to be transmitted, obtain the interface description language file for the data definition and expression, compile the interface description language file, and map it to the C++ type support file; Step 2.5: Generate the publisher and subscriber executable files and run them to start data transmission.
9. The method according to claim 8, characterized in that In the step 2.5, an MPC file is written, and engineering processing of the MPC file is performed to generate source code files of the publishing end and the subscribing end.
10. The method according to claim 9, characterized in that Step 3 specifically includes: 3.1) Write an Opendds subscriber-side plug-in module for the UE4 external dynamic plug-in, write the Opendds subscriber-side source code into the plug-in and compile it for use; 3.2) Call the Opendds subscriber plug-in module node in the level blueprint of the UE4 scene, link the nodes in the blueprint editor, compile the blueprint, and output the subscriber receiving data instance; 3.3) Use 3DS MAX, CATIA, UG, and World Machine software to generate simulation object models and load the simulation object models into the simulation scene; 3.4) Load the Cesium for Unreal plug-in in the UE4 software and load the digital globe for the UE4 simulation scene; 3.5) Configure camera angles to provide users with multi-angle, all-round simulation situation display.