A method and device for realizing joint simulation between software based on ZMQ
The joint simulation between XSIM and EXata software is realized through ZeroMQ, which solves the problem of low simulation efficiency caused by the complexity of the high-level architecture communication protocol, improves the simulation efficiency of the communication network and the fidelity of the simulation environment, and provides a more effective method for mobile network research. reference.
Patent Information
- Application Number
- CN202411021849.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-29
AI Technical Summary
The communication protocol of the high-level architecture is complex, which leads to the problem of low data transmission efficiency when the simulated communication network is large-scale.
ZeroMQ is used to implement joint simulation between software. By obtaining the XSIM simulation topology, converting it into a network simulation topology, and using EXata and XSIM simulation engine processing to generate ZMQ-based joint simulation results to improve data transfer efficiency.
The network simulation efficiency is improved, the problem of low efficiency of the HLA mechanism in the existing technology is compensated, and a more realistic mobile network simulation environment and a more effective research reference are achieved.
Smart Images

Figure CN118590922B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software joint simulation, and in particular to a method and device for realizing joint simulation between software based on ZMQ. Background Art
[0002] ZMQ, also known as ZeroMQ, also known as ØMQ, 0MQ or ZMQ, is a powerful messaging library that combines the features of network and concurrent frameworks to provide developers with the ability to build efficient and scalable multi-core applications. Whether it requires inter-process communication, network transmission or building distributed systems, ZeroMQ can provide flexible and efficient solutions.
[0003] EXata is a complete platform for simulating large-scale wired and wireless networks. The "virtual network" created by EXata can communicate and exchange data with all components in the real physical network, such as various network applications, network equipment, network users and network management tools, etc. Its outstanding performance in the research, development, evaluation, simulation training and other aspects of communication networks helps users shorten the R&D cycle and improve efficiency.
[0004] The XSIM simulation platform is a mature simulation application platform and a professional simulation development platform. As a simulation application platform, the platform comes with a series of tools and a rich professional model library, which supports users to use existing resources to conduct research, demonstration, testing and training directly in professional fields; the platform supports various forms of applications, including: centralized analysis and demonstration, centralized operation distributed management and control, multi-federation distributed operation, etc. As a development platform, the platform provides an efficient simulation operation engine and a complete modeling framework to support users in model research and development. It provides a series of tools such as component development, model assembly, scenario editing, experimental design, management control, scenario operation, situation display, analysis and evaluation before, during and after the simulation.
[0005] (1) Network virtual simulation
[0006] Network virtual simulation refers to the introduction of simulation modeling methods and technologies into the field of mobile networks. By modeling and simulating network parameters such as node types and communication channel properties in mobile networks and running them through a specific platform, the entire network can be dynamically operated, thereby deepening researchers' understanding and knowledge of network operation mechanisms.
[0007] (2) Joint Simulation
[0008] The existing XSIM software, as a mobile network modeling software, only builds node models and link models in the network environment, and cannot fully model and simulate various network protocols. However, EXata can achieve high-precision simulation in communication network protocols. Therefore, the combination of XSIM and EXata simulation software can give full play to their respective advantages and make up for each other's relatively weak links, making the constructed mobile network more reasonable, the simulation environment more realistic, and the result parameters more effective, providing a real and effective simulation reference for specific research in various aspects of mobile networks.
[0009] The existing technology usually uses high level of architecture (HLA) as the basic framework of joint simulation, but the problem is that the network simulation efficiency is low. Since the communication protocol of the high level architecture is relatively complex, when the simulated communication network is large in scale and requires interactive services and routing information, if the HLA mechanism is fully used to complete data transmission, the efficiency is low. Summary of the invention
[0010] The technical problem to be solved by the present invention is that the communication protocol for the high-level architecture is relatively complex. When the simulated communication network is large in scale and requires information such as interactive services and routing, if the HLA mechanism is fully adopted to complete data transmission, the efficiency is low. A method and device for realizing joint simulation between software based on ZMQ are provided, and ZMQ is used to realize joint simulation between software to solve the problem of low network simulation efficiency existing in HLA.
[0011] In order to solve the above technical problems, the first aspect of the embodiment of the present invention discloses a method for realizing joint simulation between software based on ZMQ, the method comprising:
[0012] S1, obtain XSIM simulation topology;
[0013] S2, converting the XSIM simulation topology to obtain a network simulation topology;
[0014] S3, using the EXata simulation engine and the XSIM simulation engine, processing the network simulation topology to obtain a ZMQ-based joint simulation result.
[0015] As an optional implementation manner, in the first aspect of the embodiment of the present invention, converting the XSIM simulation topology to obtain a network simulation topology includes:
[0016] S21, using a preset network scenario parsing program to load the XSIM simulation topology in XML format;
[0017] S22, parsing the XSIM simulation topology to obtain network configuration information and network entity information;
[0018] The network configuration information includes network quantity information, network name information and network connection status information;
[0019] S23, processing the network configuration information and the network entity information to obtain a network simulation topology.
[0020] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the processing of the network configuration information and the network entity information to obtain a network simulation topology includes:
[0021] S231, processing the network configuration information to obtain EXata network configuration information;
[0022] S232, parsing the network entity information to obtain configuration parameters;
[0023] S233, processing the configuration parameters to obtain node parameter configuration information in EXata;
[0024] S234, processing the EXata network configuration information and the node parameter configuration information in the EXata to obtain a network simulation topology.
[0025] As an optional implementation, in the first aspect of the embodiment of the present invention, the network simulation topology is processed using the EXata simulation engine and the XSIM simulation engine to obtain a ZMQ-based joint simulation result, including:
[0026] S31, using the EXata simulation engine to process the network simulation topology to obtain first network simulation operation data;
[0027] S32, using ZMQ to process the first network simulation operation data to obtain second network simulation operation data;
[0028] S33, using an XSIM simulation engine, processing the second network simulation operation data to obtain third network simulation operation data;
[0029] S34, using ZMQ to process the third network simulation operation data to obtain fourth network simulation operation data;
[0030] S35, sending the fourth network simulation operation data to the EXata simulation engine;
[0031] S36, determine whether the simulation operation is completed. If so, output the fourth network simulation operation data to obtain the ZMQ-based joint simulation result; if not, execute S31.
[0032] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the using ZMQ to process the first network simulation operation data to obtain the second network simulation operation data includes:
[0033] S321, using ZMQ to create a message receiving thread on the EXata simulation engine side;
[0034] S322: Utilize the message receiving thread to process the first network simulation operation data to obtain second network simulation operation data.
[0035] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the using of the XSIM simulation engine to process the second network simulation operation data to obtain the third network simulation operation data includes:
[0036] S341, using ZMQ to create a message sending thread on the XSIM simulation engine side;
[0037] S342, using the message sending thread to receive the running message generated by the XSIM simulation engine;
[0038] The operation messages include entity movement messages, entity state change messages and inter-entity service messages;
[0039] S343, using the message sending thread, processing the running message to obtain a ZMQ data packet, and sending the ZMQ data packet to the message receiving thread;
[0040] S344, using the message receiving thread, processing the ZMQ data packet to obtain third network simulation operation data.
[0041] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the using the message receiving thread to process the ZMQ data packet to obtain the third network simulation operation data includes:
[0042] S3441, using the message receiving thread, determining the message type of the ZMQ data packet, and if it is the first time to receive, creating an APP_Messanger application on the node entity of EXata;
[0043] S3442, using the APP_Messanger application, sending the ZMQ data packet from the application layer to the transport layer to obtain third network simulation operation data;
[0044] S3443: If it is not the first time to receive, the ZMQ data packet is sent from the application layer to the transport layer to obtain the third network simulation operation data.
[0045] A second aspect of an embodiment of the present invention discloses a device for realizing joint simulation between software based on ZMQ, the device comprising:
[0046] The simulation topology acquisition module is used to obtain the XSIM simulation topology;
[0047] A simulation topology conversion module, used to convert the XSIM simulation topology to obtain a network simulation topology;
[0048] The joint simulation module is used to process the network simulation topology using the EXata simulation engine and the XSIM simulation engine to obtain a joint simulation result based on ZMQ.
[0049] As an optional implementation manner, in the second aspect of the embodiment of the present invention, converting the XSIM simulation topology to obtain a network simulation topology includes:
[0050] S21, using a preset network scenario parsing program to load the XSIM simulation topology in XML format;
[0051] S22, parsing the XSIM simulation topology to obtain network configuration information and network entity information;
[0052] The network configuration information includes network quantity information, network name information and network connection status information;
[0053] S23, processing the network configuration information and the network entity information to obtain a network simulation topology.
[0054] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the processing of the network configuration information and the network entity information to obtain a network simulation topology includes:
[0055] S231, processing the network configuration information to obtain EXata network configuration information;
[0056] S232, parsing the network entity information to obtain configuration parameters;
[0057] S233, processing the configuration parameters to obtain node parameter configuration information in EXata;
[0058] S234, processing the EXata network configuration information and the node parameter configuration information in the EXata to obtain a network simulation topology.
[0059] As an optional implementation, in the second aspect of the embodiment of the present invention, the network simulation topology is processed using the EXata simulation engine and the XSIM simulation engine to obtain a ZMQ-based joint simulation result, including:
[0060] S31, using the EXata simulation engine to process the network simulation topology to obtain first network simulation operation data;
[0061] S32, using ZMQ to process the first network simulation operation data to obtain second network simulation operation data;
[0062] S33, using an XSIM simulation engine, processing the second network simulation operation data to obtain third network simulation operation data;
[0063] S34, using ZMQ to process the third network simulation operation data to obtain fourth network simulation operation data;
[0064] S35, sending the fourth network simulation operation data to the EXata simulation engine;
[0065] S36, determine whether the simulation operation is completed. If so, output the fourth network simulation operation data to obtain the ZMQ-based joint simulation result; if not, execute S31.
[0066] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the using ZMQ to process the first network simulation operation data to obtain the second network simulation operation data includes:
[0067] S321, using ZMQ to create a message receiving thread on the EXata simulation engine side;
[0068] S322: Utilize the message receiving thread to process the first network simulation operation data to obtain second network simulation operation data.
[0069] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the using of the XSIM simulation engine to process the second network simulation operation data to obtain the third network simulation operation data includes:
[0070] S341, using ZMQ to create a message sending thread on the XSIM simulation engine side;
[0071] S342, using the message sending thread to receive the running message generated by the XSIM simulation engine;
[0072] The operation messages include entity movement messages, entity state change messages and inter-entity service messages;
[0073] S343, using the message sending thread, processing the running message to obtain a ZMQ data packet, and sending the ZMQ data packet to the message receiving thread;
[0074] S344, using the message receiving thread, processing the ZMQ data packet to obtain third network simulation operation data.
[0075] As an optional implementation, in the second aspect of the embodiment of the present invention, the using the message receiving thread to process the ZMQ data packet to obtain the third network simulation operation data includes:
[0076] S3441, using the message receiving thread, determining the message type of the ZMQ data packet, and if it is the first time to receive, creating an APP_Messanger application on the node entity of EXata;
[0077] S3442, using the APP_Messanger application, sending the ZMQ data packet from the application layer to the transport layer to obtain third network simulation operation data;
[0078] S3443: If it is not the first time to receive, the data packet is sent from the application layer to the transport layer to obtain the third network simulation operation data.
[0079] The third aspect of the present invention discloses another device for realizing joint simulation between software based on ZMQ, the device comprising:
[0080] A memory storing executable program code;
[0081] a processor coupled to the memory;
[0082] The processor calls the executable program code stored in the memory to execute part or all of the steps in the method for implementing joint simulation between software based on ZMQ disclosed in the first aspect of the embodiment of the present invention.
[0083] The fourth aspect of the present invention discloses a computer-storable medium, which stores computer instructions. When the computer instructions are called, they are used to execute part or all of the steps in the method for implementing joint simulation between software based on ZMQ disclosed in the first aspect of an embodiment of the present invention.
[0084] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0085] The present invention implements the joint simulation of mobile networks of XSIM software and EXata software based on ZMQ. As mobile network modeling software, the existing XSIM software only constructs the link model of the physical layer in the network environment, and cannot comprehensively model and simulate various network protocols. However, EXata can realize high-precision simulation in terms of communication network protocols. Therefore, the combination of XSIM and EXata simulation software can give play to their respective advantages and make up for each other's relatively weak links, so that the constructed mobile network is more reasonable, the simulation environment is more realistic, and the result parameters are more effective, providing a real and effective simulation reference for specific research on various aspects of mobile networks. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0087] Figure 1 It is a flowchart of a method for realizing joint simulation between software based on ZMQ disclosed in an embodiment of the present invention;
[0088] Figure 2 It is a flowchart of another method for realizing joint simulation between software based on ZMQ disclosed in an embodiment of the present invention;
[0089] Figure 3 is a topology conversion flow chart disclosed in an embodiment of the present invention;
[0090] Figure 4 It is a message interaction process based on ZMQ disclosed in an embodiment of the present invention;
[0091] Figure 5 It is a structural diagram of a device for realizing joint simulation between software based on ZMQ disclosed in an embodiment of the present invention;
[0092] Figure 6 It is a structural diagram of another ZMQ-based joint simulation device between software disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0093] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0094] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or equipment that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or equipment.
[0095] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0096] The technical problem to be solved by the present invention is that the communication protocol of the high-level architecture is relatively complex. When the scale of the simulated communication network is large and information such as interactive services and routing is required, if the HLA mechanism is fully used to complete the data transmission, the efficiency is low. A method and device for realizing joint simulation between software based on ZMQ is provided, including obtaining an XSIM simulation topology; converting the XSIM simulation topology to obtain a network simulation topology; using an EXata simulation engine and an XSIM simulation engine to process the network simulation topology to obtain a joint simulation result based on ZMQ. The present invention uses ZMQ to realize joint simulation between software, solving the problem of low network simulation efficiency in HLA. The specific application scenario of the present invention is joint simulation of wireless communication networks. In the field of scientific research, there are still some problems in using EXata to realize wireless communication network simulation. For example, using EXata alone for simulation can only show the physical communication network, and it is difficult to distinguish the network dynamic interaction properties of nodes and information flows. This technology can realize the analysis of the network dynamic interaction properties of nodes and information flows in wireless networks by combining the network node interaction simulation data generated by the XSIM simulation engine with the network simulation data generated by the EXata simulation engine. This technology is of great significance for studying the network dynamic interaction properties of wireless communication network card nodes and information flows.
[0097] ZeroMQ (ZMQ for short) is a multi-threaded network library based on message queues. It encapsulates network communication, message queues, thread scheduling and other functions, and provides a simple API to the upper layer. The application loads the library file and calls the API function to achieve high-performance network communication. ZMQ is not software. Specific usage process: Use XSIM to build a wireless communication network topology map. During the simulation process, when the wireless communication network topology node generates network communication business, XSIM will hand it over to EXata for processing through the ZMQ interface; EXata builds a wireless network communication model (this model is derived from the XSIM simulation topology as mentioned above). When its ZMQ interface receives the wireless communication network entity communication business behavior from XSIM, it drives its internal network communication simulation by itself and sends the communication results back to XSIM through its ZMQ interface; XSIM receives the network simulation data fed back by EXata, combines the information transmission content and the current wireless communication network interaction status, and updates the topology status of the built wireless communication network topology map. The joint simulation of XSIM and EXata based on the ZMQ interface will continue until the end of the simulation. The following are detailed descriptions.
[0098] Embodiment 1
[0099] See also Figure 1 , Figure 11 is a flow chart of a method for realizing joint simulation between software based on ZMQ disclosed in an embodiment of the present invention. Figure 1 The described method for realizing joint simulation between software based on ZMQ is applied to solve the problem of low efficiency when the communication network is large in scale and requires interactive services and routing information, if the HLA mechanism is fully used to complete data transmission, the embodiment of the present invention does not make any limitation. Figure 1 As shown, the method for realizing joint simulation between software based on ZMQ may include the following operations:
[0100] S1, obtain XSIM simulation topology;
[0101] S2, converting the XSIM simulation topology to obtain a network simulation topology;
[0102] S3, using the EXata simulation engine and the XSIM simulation engine, processing the network simulation topology to obtain a ZMQ-based joint simulation result.
[0103] XSIM simulation topology is the simulation topology structure defined in the XSIM software, which is preset before simulation;
[0104] Optionally, converting the XSIM simulation topology to obtain a network simulation topology includes:
[0105] S21, using a preset network scenario parsing program to load the XSIM simulation topology in XML format;
[0106] In this embodiment, the network scenario analysis program is not limited and can be implemented using existing analysis software such as Gephi.
[0107] S22, parsing the XSIM simulation topology to obtain network configuration information and network entity information;
[0108] The network configuration information includes network quantity information, network name information and network connection status information;
[0109] Network entity information includes various types of equipment in the computer network, such as node equipment, communication equipment, etc.
[0110] S23, processing the network configuration information and the network entity information to obtain a network simulation topology.
[0111] Optionally, the processing the network configuration information and the network entity information to obtain a network simulation topology includes:
[0112] S231, processing the network configuration information to obtain EXata network configuration information;
[0113] S232, parsing the network entity information to obtain configuration parameters;
[0114] S233, processing the configuration parameters to obtain node parameter configuration information in EXata;
[0115] S234, processing the EXata network configuration information and the node parameter configuration information in the EXata to obtain a network simulation topology.
[0116] Optionally, the network simulation topology is processed by using the EXata simulation engine and the XSIM simulation engine to obtain a ZMQ-based joint simulation result, including:
[0117] S31, using ZMQ to create a message sending thread on the XSIM simulation engine side;
[0118] S32, using ZMQ to create a message receiving thread on the EXata simulation engine side;
[0119] S33, using the message sending thread to receive the running message generated by the XSIM simulation engine;
[0120] The operation messages include entity movement messages, entity state change messages and inter-entity service messages;
[0121] S34, using the message sending thread to process the running message to obtain a ZMQ data packet, and sending the ZMQ data packet to the message receiving thread;
[0122] S35, using the message receiving thread to process the ZMQ data packet to obtain a ZMQ-based joint simulation result.
[0123] Optionally, the network simulation topology is processed by using the EXata simulation engine and the XSIM simulation engine to obtain a ZMQ-based joint simulation result, including:
[0124] S31, using the EXata simulation engine to process the network simulation topology to obtain first network simulation operation data;
[0125] S32, using ZMQ to process the first network simulation operation data to obtain second network simulation operation data;
[0126] S33, using an XSIM simulation engine, processing the second network simulation operation data to obtain third network simulation operation data;
[0127] S34, using ZMQ to process the third network simulation operation data to obtain fourth network simulation operation data;
[0128] S35, sending the fourth network simulation operation data to the EXata simulation engine;
[0129] S36, determine whether the simulation operation is completed. If so, output the fourth network simulation operation data to obtain the ZMQ-based joint simulation result; if not, execute S31.
[0130] The end condition of the simulation operation is to run the XSIM simulation engine and the EXata simulation engine in sequence. If the running status of the nodes in the two networks is the same, the two software will perform joint simulation through the ZMQ thread. When the running results are completed, the joint simulation ends (that is, the simulation operation ends).
[0131] Optionally, the using ZMQ to process the first network simulation operation data to obtain second network simulation operation data includes:
[0132] S321, using ZMQ to create a message receiving thread on the EXata simulation engine side;
[0133] S322: Utilize the message receiving thread to process the first network simulation operation data to obtain second network simulation operation data.
[0134] Optionally, the using an XSIM simulation engine to process the second network simulation operation data to obtain third network simulation operation data includes:
[0135] S341, using ZMQ to create a message sending thread on the XSIM simulation engine side;
[0136] S342, using the message sending thread to receive the running message generated by the XSIM simulation engine;
[0137] The operation messages include entity movement messages, entity state change messages and inter-entity service messages;
[0138] S343, using the message sending thread, processing the running message to obtain a ZMQ data packet, and sending the ZMQ data packet to the message receiving thread;
[0139] S344, using the message receiving thread, processing the ZMQ data packet to obtain third network simulation operation data.
[0140] Optionally, the using the message receiving thread to process the ZMQ data packet to obtain third network simulation operation data includes:
[0141] S3441, using the message receiving thread, determining the message type of the ZMQ data packet, and if it is the first time to receive, creating an APP_Messanger application on the node entity of EXata;
[0142] The node entity of EXata is the node of the network generated by EXata;
[0143] APP_Messanger is an application used for communication.
[0144] S3442, using the APP_Messanger application, sending the ZMQ data packet from the application layer to the transport layer to obtain third network simulation operation data;
[0145] S3443: If it is not the first time to receive, the ZMQ data packet is sent from the application layer to the transport layer to obtain the third network simulation operation data.
[0146] It can be seen that the present invention implements the joint simulation of mobile networks of XSIM software and EXata software based on ZMQ. As a mobile network modeling software, the existing XSIM software only constructs the link model of the physical layer in the network environment, and cannot comprehensively model and simulate various network protocols. However, EXata can achieve high-precision simulation in terms of communication network protocols. Therefore, the combination of XSIM and EXata simulation software can give play to their respective advantages and make up for each other's relatively weak links, making the constructed mobile network more reasonable, the simulation environment more realistic, and the result parameters more effective, providing a real and effective simulation reference for specific research on various aspects of mobile networks.
[0147] Embodiment 2
[0148] See also Figure 2 , Figure 2 1 is a flow chart of another method for realizing joint simulation between software based on ZMQ disclosed in an embodiment of the present invention. Figure 2 The described method for realizing joint simulation between software based on ZMQ is applied to solve the problem of low efficiency when the communication network is large in scale and requires interactive services and routing information, if the HLA mechanism is fully used to complete data transmission, the embodiment of the present invention does not make any limitation. Figure 2 As shown, the method for realizing joint simulation between software based on ZMQ may include the following operations:
[0149] Step S1, data conversion
[0150] Before the simulation starts, the simulation topology defined in the XSIM software is converted into a data format that can be read by the EXata software, including the network simulation topology, node communication parameters, and default settings of each layer communication protocol. The topology conversion process is as follows: Figure 3 As shown:
[0151] 1) The network scenario parser loads the XSIM network topology in XML format;
[0152] 2) The program parses the network configuration content in XML, including the number of networks, names, entities contained in the network, network connection status, etc.;
[0153] 3) The program generates the network partition information in the EXata configuration file according to the EXata configuration file format;
[0154] 4) Parse the configuration information of entities in the network and generate node parameter configuration information in EXata based on the configuration parameters;
[0155] 5) After all entity information is converted, the network simulation scenario is generated and saved.
[0156] Step S2, joint simulation
[0157] EXata reads the generated file and parses it, waiting for joint simulation with XSIM. Run XSIM and EXata software in sequence. If the nodes in the two networks are in the same running state, that is, the two softwares are jointly simulated through the ZMQ thread, the running results are completed, and the joint simulation ends. The message interaction process based on ZMQ is as follows Figure 4 As shown:
[0158] 1) Use the ZMQ framework to create a message sending thread on the XSIM side;
[0159] 2) Use the ZMQ framework to create a message receiving thread on the EXata side;
[0160] 3) The XSIM sending thread receives the operation messages generated by XSIM during the network operation, including entity movement messages, entity status change messages, inter-entity service messages, etc.;
[0161] 4) The sending thread generates a ZMQ data packet of the corresponding type according to the message type and sends it;
[0162] 5) After receiving the message on the EXata side, the receiving thread performs different operations according to the message type. If it is the first time to receive the message, the APP_Messanger application is created on the EXata node entity;
[0163] 6) APP_Messanger sends messages from the application layer to the transport layer, and then transmits them layer by layer using the protocol stack provided by EXata;
[0164] 7) After the EXata simulation is completed, the results are fed back to the XSIM end. XSIM receives the EXata simulation results and changes its own network status according to the network status fed back by EXata, and continues the simulation until the simulation ends.
[0165] In this embodiment, the simulation network is built in XSIM, and then converted into a format that can be read by EXata with the help of XSIM. The two networks of XSIM and EXata are actually different formats of the same scene, which is also the basis for their joint simulation. During joint simulation, XSIM and EXata each open the network topology file in the corresponding format, simulate at the same time, and exchange data through their respective ZMQ interfaces until the joint simulation ends.
[0166] Embodiment 3
[0167] See also Figure 5 , Figure 5 This is a flow chart of a joint simulation device between software based on ZMQ disclosed in an embodiment of the present invention. Figure 5 The described ZMQ-based software joint simulation device is used to solve the problem of low efficiency when the communication network is large in scale and requires interactive services and routing information, if the HLA mechanism is fully used to complete data transmission, the embodiment of the present invention does not limit it. Figure 5 As shown, the joint simulation device between software based on ZMQ may include the following operations:
[0168] S301, a simulation topology acquisition module, used to acquire an XSIM simulation topology;
[0169] S302, a simulation topology conversion module, used to convert the XSIM simulation topology to obtain a network simulation topology;
[0170] S303, a joint simulation module, is used to process the network simulation topology using the EXata simulation engine and the XSIM simulation engine to obtain a joint simulation result based on ZMQ.
[0171] Embodiment 4
[0172] See also Figure 6 , Figure 6 This is another flowchart of a joint simulation device between software based on ZMQ disclosed in an embodiment of the present invention. Figure 6The described ZMQ-based software joint simulation device is used to solve the problem of low efficiency when the communication network is large in scale and requires interactive services and routing information, if the HLA mechanism is fully used to complete data transmission, the embodiment of the present invention does not limit it. Figure 6 As shown, the joint simulation device between software based on ZMQ may include the following operations:
[0173] A memory 401 storing executable program codes;
[0174] a processor 402 coupled to the memory 401;
[0175] The processor 402 calls the executable program code stored in the memory 401 to execute the steps of the method for realizing joint simulation between software based on ZMQ described in the first and second embodiments.
[0176] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0177] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0178] Finally, it should be noted that the method and device for realizing joint simulation between software based on ZMQ disclosed in the embodiment of the present invention discloses only the preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for realizing joint simulation between software based on ZMQ, characterized in that: The method comprises: S1, obtain XSIM simulation topology; S2, converting the XSIM simulation topology to obtain a network simulation topology; S3, using the EXata simulation engine and the XSIM simulation engine, processing the network simulation topology to obtain a ZMQ-based joint simulation result, including: S31, using the EXata simulation engine to process the network simulation topology to obtain first network simulation operation data; S32, using ZMQ to process the first network simulation operation data to obtain second network simulation operation data; S33, using an XSIM simulation engine, processing the second network simulation operation data to obtain third network simulation operation data; S34, using ZMQ to process the third network simulation operation data to obtain fourth network simulation operation data; S35, sending the fourth network simulation operation data to the EXata simulation engine; S36, determine whether the simulation operation is completed. If so, output the fourth network simulation operation data to obtain the ZMQ-based joint simulation result; if not, execute S31.
2. The method for realizing joint simulation between software based on ZMQ according to claim 1, characterized in that: The converting the XSIM simulation topology to obtain a network simulation topology includes: S21, using a preset network scenario parsing program to load the XSIM simulation topology in XML format; S22, parsing the XSIM simulation topology to obtain network configuration information and network entity information; The network configuration information includes network quantity information, network name information and network connection status information; S23, processing the network configuration information and the network entity information to obtain a network simulation topology.
3. The method for realizing joint simulation between software based on ZMQ according to claim 2, characterized in that: The processing of the network configuration information and the network entity information to obtain a network simulation topology includes: S231, processing the network configuration information to obtain EXata network configuration information; S232, parsing the network entity information to obtain configuration parameters; S233, processing the configuration parameters to obtain node parameter configuration information in EXata; S234, processing the EXata network configuration information and the node parameter configuration information in the EXata to obtain a network simulation topology.
4. The method for realizing joint simulation between software based on ZMQ according to claim 1, characterized in that: The using ZMQ to process the first network simulation operation data to obtain second network simulation operation data includes: S321, using ZMQ to create a message receiving thread on the EXata simulation engine side; S322: Utilize the message receiving thread to process the first network simulation operation data to obtain second network simulation operation data.
5. The method for realizing joint simulation between software based on ZMQ according to claim 1, characterized in that: The using of the XSIM simulation engine to process the second network simulation operation data to obtain the third network simulation operation data includes: S341, using ZMQ to create a message sending thread on the XSIM simulation engine side; S342, using the message sending thread to receive the running message generated by the XSIM simulation engine; The operation messages include entity movement messages, entity state change messages and inter-entity service messages; S343, using the message sending thread, processing the running message to obtain a ZMQ data packet, and sending the ZMQ data packet to the message receiving thread; S344, using the message receiving thread, processing the ZMQ data packet to obtain third network simulation operation data.
6. The method for realizing joint simulation between software based on ZMQ according to claim 5, characterized in that: The method of using the message receiving thread to process the ZMQ data packet to obtain third network simulation operation data includes: S3441, using the message receiving thread, determining the message type of the ZMQ data packet, and if it is the first time to receive, creating an APP_Messanger application on the node entity of EXata; S3442, using the APP_Messanger application, sending the ZMQ data packet from the application layer to the transport layer to obtain third network simulation operation data; S3443: If it is not the first time to receive, the data packet is sent from the application layer to the transport layer to obtain the third network simulation operation data.
7. A joint simulation device between software based on ZMQ, characterized in that: The device comprises: The simulation topology acquisition module is used to obtain the XSIM simulation topology; A simulation topology conversion module, used to convert the XSIM simulation topology to obtain a network simulation topology; The joint simulation module is used to process the network simulation topology using the EXata simulation engine and the XSIM simulation engine to obtain a joint simulation result based on ZMQ, including: S31, using the EXata simulation engine to process the network simulation topology to obtain first network simulation operation data; S32, using ZMQ to process the first network simulation operation data to obtain second network simulation operation data; S33, using an XSIM simulation engine, processing the second network simulation operation data to obtain third network simulation operation data; S34, using ZMQ to process the third network simulation operation data to obtain fourth network simulation operation data; S35, sending the fourth network simulation operation data to the EXata simulation engine; S36, determine whether the simulation operation is completed. If so, output the fourth network simulation operation data to obtain the ZMQ-based joint simulation result; if not, execute S31.
8. A joint simulation device between software based on ZMQ, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the joint simulation method between software based on ZMQ as described in any one of claims 1-6.
9. A computer storable medium, characterized in that: The computer storable medium stores computer instructions, and when the computer instructions are called, they are used to execute the joint simulation method between software based on ZMQ as described in any one of claims 1-6.
