Parallel simulation engine optimization method based on dynamic load balancing
Through dynamic load balancing and time synchronization optimization, combined with the component modeling technology of the simulation model, the problems of load imbalance, time synchronization difficulties and poor model reusability in the parallel simulation engine are solved, and high simulation efficiency and resource utilization are achieved.
Patent Information
- Application Number
- CN202510774761.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-16
AI Technical Summary
Existing parallel simulation engines have problems in load balancing, time synchronization and model reuse, resulting in low simulation efficiency and low resource utilization.
Through dynamic load balancing, time synchronization optimization and simulation model reuse technologies, including building data flow graphs to divide simulation processes, real-time monitoring of node loads, and the use of improved empty message algorithms and componentized modeling technology, dynamic adjustment of simulation processes and cross-platform reuse are achieved.
It significantly improves simulation efficiency, increases simulation efficiency and resource utilization by more than 30%, reduces development costs and time, and enhances the reusability and cross-platform collaborative working capabilities of simulation models.
Smart Images

Figure CN120653441A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer simulation, and in particular to a parallel simulation engine optimization method based on dynamic load balancing. Background Art
[0002] With the continuous development of simulation technology, parallel simulation engines are increasingly being used in various industries, especially in the field of adversarial simulation. However, existing parallel simulation engines still have many problems in load balancing, time synchronization, and model reuse, resulting in low simulation efficiency and low resource utilization.
[0003] First, load imbalance: In parallel simulation, the load distribution across nodes is uneven, causing some nodes to be overloaded while others remain idle, impacting overall simulation efficiency. Second, time synchronization is difficult: In parallel simulation, the time synchronization mechanism between logical processes is complex, which can easily lead to causal errors or deadlocks. Third, model reusability is poor: Existing simulation engines lack support for model reuse, forcing developers to repeatedly develop existing simulation models, increasing development costs and time. Summary of the Invention
[0004] The embodiment of the present invention provides a parallel simulation engine optimization method based on dynamic load balancing, which optimizes the time synchronization mechanism by dynamically adjusting the allocation and migration of simulation processes, and improves the reusability of simulation models, thereby improving the efficiency and resource utilization of parallel simulation.
[0005] The present invention provides a parallel simulation engine optimization method based on dynamic load balancing, comprising: By building a data flow graph to divide the simulation process, the node load is monitored in real time and dynamically adjusted to achieve static and dynamic load balancing of the simulation process and ensure load balancing of each node; The null message algorithm with look-ahead is used to achieve time synchronization between simulation processes to ensure the correctness of simulation results. Adopt component modeling technology to achieve component management and cross-platform reuse of simulation models, thus improving the reusability of the models; Monitor the load of each node in real time and dynamically adjust the allocation and migration of simulation processes based on the load conditions.
[0006] In some examples, partitioning the simulation process by constructing a data flow graph includes: Before the simulation is executed, a data flow graph is constructed based on the dependency relationships between simulation processes. The nodes in the data flow graph represent simulation processes, and the edges represent the dependency relationships between processes. By analyzing the data flow graph, the simulation process is divided using the spectral clustering algorithm or the topological sorting algorithm. The spectral clustering algorithm divides the simulation process into multiple subgraphs by calculating the eigenvalues and eigenvectors of the Laplacian matrix of the data flow graph, ensuring that the dependencies within the subgraphs are tight and the dependencies between subgraphs are loose. The topological sorting algorithm identifies the non-dependent processes in the data flow graph and assigns them to different nodes to ensure that the simulation processes can be executed in parallel.
[0007] In some examples, the real-time monitoring of node load and dynamic adjustment includes: A counter is maintained for each simulation process to record the load of the current node. When a process starts to execute, the counter is incremented by 1, and when the execution ends, the counter is decremented by 1. Count the counter values of each node. When the counter value of a node exceeds the preset threshold, migrate some simulation processes on the node to the target node with lighter load. During the migration process, all current data information of the migrated process is extracted, and a new simulation process is created on the target node.
[0008] In some examples, the time synchronization between simulation processes is achieved by using a look-ahead-introduced null message algorithm to ensure the correctness of simulation results, including: A dynamic adjustment mechanism of the look-ahead amount is introduced into the null message algorithm, wherein the look-ahead amount is dynamically adjusted according to the frame period of the simulation process; When sending an empty message, the look-ahead amount information is carried to ensure that the receiver can adjust the simulation time according to the look-ahead amount.
[0009] In some examples, the componentized modeling technology is used to implement componentized management and cross-platform reuse of simulation models, thereby improving the reusability of the models, including: Decompose the simulation model into multiple independent components, each of which interacts with other components through standard interfaces; Cross-platform simulation model reuse is achieved through MPI.
[0010] In some examples, real-time monitoring of the load of each node and dynamically adjusting the allocation and migration of simulation processes according to the load may include: Monitor the load of each node in real time and dynamically adjust the allocation and migration of simulation processes according to the load conditions to avoid node overload or idleness and improve simulation efficiency and resource utilization.
[0011] In some examples, the method further comprises: Generate a parallel simulation project through the parallel simulation engine code automatic generation tool to automatically generate a complete project of parallel simulation application based on the simulation model and configuration information input by the user.
[0012] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art: This invention significantly improves the technical effect of the parallel simulation engine through dynamic load balancing, time synchronization optimization, and simulation model reuse. The specific effects are as follows: (1) Dynamic load balancing: By monitoring the load of each node in real time and dynamically adjusting the distribution and migration of simulation processes according to the load, the load of each node is ensured to be balanced, thus avoiding node overload or idleness and improving the simulation efficiency by more than 30%.
[0013] (2) Time synchronization optimization: By improving the empty message algorithm, the look-ahead amount is dynamically adjusted to reduce unnecessary empty message sending, and the time synchronization efficiency is improved by more than 20%, ensuring the correctness of the simulation results.
[0014] (3) Simulation model reuse: Through component-based modeling and cross-platform support, the reusability of simulation models has been significantly improved, and the developers' repetitive development work has been reduced by more than 50%, reducing development costs and time.
[0015] (4) Improved resource utilization: By optimizing the allocation and migration of simulation processes, the utilization of computing resources is improved, resource waste is reduced, and the overall resource utilization is increased by more than 25%.
[0016] (5) Cross-platform support: Cross-platform simulation model reuse is achieved through MPI, ensuring that simulation models on different platforms can be seamlessly integrated and work together, thereby improving the flexibility and scalability of simulation applications.
[0017] The present invention has been widely used in the field of countermeasure simulation, significantly improving simulation efficiency and resource utilization, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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 those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 It is a schematic diagram of a method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 those skilled in the art without creative work shall fall within the scope of protection of the present invention.
[0021] In the following description, specific embodiments of the present invention will be described with reference to steps and symbols performed by one or more computers, unless otherwise specified. Therefore, these steps and operations will be mentioned several times as being performed by a computer, and computer execution as referred to herein includes operations by a computer processing unit that represents electronic signals of data in a structured form. This operation converts the data or maintains it at a location in the computer's memory system, which can be reconfigured or otherwise change the operation of the computer in a manner familiar to testers in the field. The data structure in which the data is maintained is a physical location in the memory, which has specific characteristics defined by the data format. However, the principles of the present invention are described in the above text, which does not represent a limitation, and testers in the field will understand that the various steps and operations below can also be implemented in hardware.
[0022] As used herein, the terms "module" or "unit" may be considered software objects executed on the computing system. The various components, modules, engines, and services herein may be considered implementation objects on the computing system. While the devices and methods herein are preferably implemented in software, they may also be implemented in hardware and remain within the scope of protection of the present invention.
[0023] It will be understood by those skilled in the art that, unless expressly stated otherwise, the singular forms "a", "an", and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0024] The embodiment of the present invention effectively solves the above problems through technical means such as dynamic load balancing, time synchronization optimization and simulation model reuse, and improves the efficiency and resource utilization of parallel simulation. It includes the following steps: Figure 1 As shown: Step 1: Construct a data flow graph and partition the simulation processes: Before executing the simulation, a data flow graph is constructed based on the dependencies between the simulation processes. Nodes in the data flow graph represent simulation processes, and edges represent dependencies between processes. By analyzing the data flow graph, the simulation processes are partitioned using either a spectral clustering algorithm or a topological sorting algorithm. The spectral clustering algorithm calculates the eigenvalues and eigenvectors of the graph's Laplacian matrix to partition the simulation processes into multiple subgraphs, ensuring tight dependencies within the subgraphs and loose dependencies between subgraphs. The topological sorting algorithm identifies independent processes in the data flow graph and assigns them to different nodes, ensuring parallel execution of the simulation processes. Using these two algorithms, simulation processes are rationally distributed across nodes, ensuring load balancing across nodes.
[0025] Step 2: Real-time monitoring of node load and dynamic adjustment: During the simulation execution process, the system monitors the load of each node in real time. Each simulation process maintains a counter to record the load of the current node. When a process begins execution, the counter is incremented by 1; after execution ends, the counter is decremented by 1. By counting the counter values of each node, the system can grasp the load status of each node in real time. When the counter value of a node exceeds the preset threshold, the system will migrate some simulation processes on that node to nodes with lighter loads (such as those whose counter values do not exceed the preset threshold). During the migration process, the system will extract all current data information of the migrated process and create a new simulation process on the target node to ensure smooth migration of the simulation process. By dynamically adjusting the distribution of simulation processes, the system can effectively avoid node overload or idleness and ensure load balancing across nodes.
[0026] Step 3: Optimize the time synchronization mechanism: In order to ensure time synchronization between simulation processes, the present invention adopts an improved empty message algorithm. The traditional empty message algorithm avoids deadlock by sending empty messages, but it will generate a large amount of empty message communication, affecting the simulation efficiency. The present invention introduces a dynamic adjustment mechanism of the look ahead amount in the empty message algorithm. The look ahead amount is dynamically adjusted according to the frame period size of the simulation process to reduce unnecessary empty message sending. When sending an empty message, the system will carry the look ahead amount information to ensure that the recipient can adjust the simulation time according to the look ahead amount to avoid unnecessary empty message sending. By optimizing the time synchronization mechanism, the system can effectively reduce the frequency of sending empty messages and improve the efficiency of time synchronization.
[0027] Step 4: Realize component-based reuse of simulation models: In order to improve the reusability of simulation models, the present invention adopts component-based modeling technology. By decomposing the simulation model into multiple independent components, each component can interact with other components through a standard interface. Component-based modeling technology not only reduces the coupling between models, but also improves the reusability of the models. In addition, the present invention realizes cross-platform simulation model reuse through MPI (Message Passing Interface). As a standard message passing interface, MPI can ensure that simulation models on different platforms can be seamlessly integrated and work together. Through component-based modeling and cross-platform support, the system can effectively improve the reusability of simulation models and reduce the repetitive development work of developers.
[0028] Step 5: Monitoring and Scheduling Simulation Processes: The system uses the monitoring and scheduling module to monitor the load of each node in real time and dynamically adjust the allocation and migration of simulation processes based on load conditions. The monitoring and scheduling module not only handles load balancing but also time synchronization and model reuse across simulation processes. Through real-time monitoring and dynamic scheduling, the system ensures efficient execution of simulation processes, avoids node overload or idleness, and improves simulation efficiency and resource utilization.
[0029] Step 6: Generate a parallel simulation project and execute the simulation: After completing simulation process partitioning, load balancing, time synchronization optimization, and model reuse, the system generates a parallel simulation project using the parallel simulation engine code generation tool. This tool automatically generates a complete parallel simulation application project based on the simulation model and configuration information entered by the user. Users can select a configuration scheme using the parallel simulation system's run configuration management tool and start the parallel simulation program. During simulation execution, the system records simulation data in real time and summarizes and displays the simulation results after completion. By automatically generating parallel simulation projects and executing simulations, the system significantly simplifies the simulation application development process and improves simulation efficiency.
[0030] The overall technical solution of the present invention effectively solves the problems of load imbalance, time synchronization difficulties and poor model reusability in the parallel simulation engine by constructing data flow diagrams, real-time load monitoring, optimizing time synchronization, realizing model reuse, monitoring and scheduling simulation processes, and generating parallel simulation projects, thereby improving the efficiency and resource utilization of parallel simulation.
[0031] The above is a detailed introduction to a parallel simulation engine optimization method based on dynamic load balancing provided by an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A parallel simulation engine optimization method based on dynamic load balancing, characterized in that: include: By building a data flow graph to divide the simulation process, the node load is monitored in real time and dynamically adjusted to achieve static and dynamic load balancing of the simulation process and ensure load balancing of each node; The null message algorithm with look-ahead is used to achieve time synchronization between simulation processes to ensure the correctness of simulation results. Adopt component modeling technology to achieve component management and cross-platform reuse of simulation models, thus improving the reusability of the models; Monitor the load of each node in real time and dynamically adjust the allocation and migration of simulation processes based on the load conditions.
2. The method according to claim 1, characterized in that The method of dividing the simulation process by constructing a data flow graph includes: Before the simulation is executed, a data flow graph is constructed based on the dependency relationships between simulation processes. The nodes in the data flow graph represent simulation processes, and the edges represent the dependency relationships between processes. By analyzing the data flow graph, the simulation process is divided using the spectral clustering algorithm or the topological sorting algorithm. The spectral clustering algorithm divides the simulation process into multiple subgraphs by calculating the eigenvalues and eigenvectors of the Laplacian matrix of the data flow graph, ensuring that the dependencies within the subgraphs are tight and the dependencies between subgraphs are loose. The topological sorting algorithm identifies the non-dependent processes in the data flow graph and assigns them to different nodes to ensure that the simulation processes can be executed in parallel.
3. The method according to claim 2, characterized in that The real-time monitoring of node load and dynamic adjustment includes: A counter is maintained for each simulation process to record the load of the current node. When a process starts to execute, the counter is incremented by 1, and when the execution ends, the counter is decremented by 1. Count the counter values of each node. When the counter value of a node exceeds the preset threshold, migrate some simulation processes on the node to the target node with lighter load. During the migration process, all current data information of the migrated process is extracted, and a new simulation process is created on the target node.
4. The method according to claim 3, characterized in that The time synchronization between simulation processes is achieved by using the empty message algorithm that introduces the look-ahead value to ensure the correctness of the simulation results, including: A dynamic adjustment mechanism of the look-ahead amount is introduced into the null message algorithm, wherein the look-ahead amount is dynamically adjusted according to the frame period of the simulation process; When sending an empty message, the look-ahead amount information is carried to ensure that the receiver can adjust the simulation time according to the look-ahead amount.
5. The method according to claim 4, characterized in that The component-based modeling technology is used to implement component-based management and cross-platform reuse of simulation models, thereby improving the reusability of the models, including: Decompose the simulation model into multiple independent components, each of which interacts with other components through standard interfaces; Cross-platform simulation model reuse is achieved through MPI.
6. The method according to claim 5, characterized in that The real-time monitoring of the load of each node and the dynamic adjustment of the distribution and migration of simulation processes according to the load include: Monitor the load of each node in real time and dynamically adjust the allocation and migration of simulation processes according to the load conditions to avoid node overload or idleness and improve simulation efficiency and resource utilization.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Generate a parallel simulation project through the parallel simulation engine code automatic generation tool to automatically generate a complete project of parallel simulation application based on the simulation model and configuration information input by the user.