Multi-core parallel simulation method, device and electronic equipment

By encapsulating the simulation entity and management module into independent processes and using the intelligent scheduling module to dynamically adjust resource allocation and communication, the communication bottleneck and load imbalance problems in multi-core parallel simulation are solved, and efficient multi-core simulation is achieved.

CN119938311BActive Publication Date: 2025-09-26BEIJING AEROSPACE CHENXIN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411815019.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-09-26
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

Multi-core parallel simulation technology suffers from high communication overhead and unbalanced load, which leads to low simulation efficiency, especially in large-scale and complex systems.

Method used

The simulation entity and management module are encapsulated as independent processes, and the resource usage and task progress are monitored in real time through the intelligent scheduling module, the execution order and resource allocation are dynamically adjusted, and zero-copy technology and message queues are used to optimize inter-process communication.

Benefits of technology

It significantly reduces communication overhead and synchronization complexity, improves load balancing, fully utilizes multi-core system resources, and improves simulation efficiency. It is particularly suitable for large-scale complex simulation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938311B_ABST
    Figure CN119938311B_ABST
Patent Text Reader

Abstract

The present disclosure provides a multi-core parallel simulation method, device and electronic device, which relate to the field of computer simulation technology. The method includes: determining all simulation entities in the simulation environment; encapsulating all simulation entities in the simulation environment into independently running entity processes, and encapsulating the message manager module, object manager module and time manager module into independently running management processes; running each entity process and management process in parallel on their respective pre-allocated computing cores, and monitoring each computing core; determining the overloaded computing core based on the resource usage data and task completion progress of the entity process and management process on each computing core; and dynamically adjusting the execution order and resource allocation of the entity process and management process on the overloaded computing core. The present disclosure effectively achieves load balancing through real-time monitoring and dynamic adjustment, avoiding the situation where some cores are overloaded while other cores are idle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer simulation technology, and in particular to a multi-core parallel simulation method, device, and electronic device. Background Art

[0002] In modern simulation systems, as simulation scale and complexity continue to increase, traditional single-core simulation engines are increasingly facing insufficient computing power, unable to meet the demand for efficient simulation. In particular, in the simulation of complex systems, the interaction and time synchronization requirements of numerous simulated entities create performance bottlenecks for single-core simulation. To address this issue, multi-core parallel simulation engines have emerged. By leveraging the parallel computing power of multi-core processors, multi-core simulation can decompose simulation tasks into multiple subtasks and assign them to different processor cores for simultaneous execution, significantly improving simulation efficiency.

[0003] However, the application of multi-core parallel simulation technology also brings new challenges. Because each simulation entity in parallel simulation runs as an independent process, frequent communication between processes can significantly increase communication overhead. Especially in large-scale simulation scenarios, inter-process communication often becomes a bottleneck for the entire system. In addition, uneven load distribution between different cores can cause some cores to be overloaded, while others may be idle, failing to fully utilize the system's computing resources. Summary of the Invention

[0004] The present disclosure provides a multi-core parallel simulation method, device, and electronic device, aiming to solve the problems existing in the above-mentioned background technology. To solve the above-mentioned technical problems, the present disclosure is implemented as follows:

[0005] In a first aspect, an embodiment of the present disclosure provides a multi-core parallel simulation method, the method comprising:

[0006] Determining all simulation entities in a simulation environment, wherein the simulation entities are independent simulation objects in the simulation environment;

[0007] Encapsulating all simulation entities in the simulation environment into independently running entity processes, and encapsulating a message manager module, an object manager module, and a time manager module into independently running management processes, wherein the message manager module is used to receive and transmit instructions between the entity processes, the object manager module is used to store and manage relevant information of the simulation environment, and the time manager module is used to manage the simulation time of the simulation environment;

[0008] Run each entity process and management process in parallel on their respective pre-assigned computing cores, and monitor the resource usage data and task completion progress of the entity process and management process on each computing core through the intelligent scheduling module. The resource usage data includes CPU usage and memory occupancy;

[0009] Determine the overloaded computing core based on the resource usage data and task completion progress of the physical and management processes on each computing core;

[0010] The intelligent scheduling module dynamically adjusts the execution order and resource allocation of the entity processes and management processes on the overloaded computing core.

[0011] Optionally, encapsulating all simulation entities in the simulation environment into independently running entity processes, and encapsulating the message manager module, the object manager module, and the time manager module into independently running management processes, includes:

[0012] Assign a unique identifier to each simulation entity, and encapsulate each simulation entity into an independently running entity process through the process management tool according to the type and attributes of each simulation entity;

[0013] By using the process management tool, the message manager module, the object manager module and the time manager module are respectively encapsulated into independently running management processes;

[0014] Initialize each entity process and management process.

[0015] Optionally, initializing each entity process and management process includes:

[0016] Set task priorities for each entity process and management process, and allocate initial computing cores to each entity process and management process;

[0017] Setting the initial state of each entity process, including position, state, and behavior rules;

[0018] For the management process corresponding to the message manager module, establish communication channels between various entity processes and set parameters of each communication channel;

[0019] For the management process corresponding to the object manager module, load the relevant information of the simulation environment and configure a query interface, wherein the query interface is used to query the relevant information of the simulation environment stored in the object manager module;

[0020] For the management process corresponding to the time manager module, an initial simulation time and an acceleration ratio are set, and the initial simulation time and the acceleration ratio are synchronized to all entity processes.

[0021] Optionally, dynamically adjusting the execution order and resource allocation of the entity processes and management processes on the overloaded computing core by the intelligent scheduling module includes:

[0022] Determining the task urgency of each entity process and management process on the overloaded computing core based on the resource usage data and task priorities of the entity processes and management processes on the overloaded computing core;

[0023] Through the intelligent scheduling module, a scheduling strategy based on a heuristic learning algorithm is used to adjust the execution order and resource allocation of the physical processes and management processes on the overloaded computing core according to the task urgency of each physical process and management process on the overloaded computing core. Among them, the process with a higher task urgency is adjusted to a higher execution order, resources are preferentially allocated to the process with a higher task urgency, and the process with a lower task urgency is allocated to an idle computing core for processing.

[0024] Optionally, the method further includes:

[0025] Collecting scheduling policy samples, the scheduling policy samples including resource usage data of entity processes and management processes on each computing core, task completion progress, and adjusted execution efficiency;

[0026] Evaluate the collected scheduling policy samples to determine the load of each computing core;

[0027] Update the weight parameters of the heuristic learning algorithm based on the load of each computing core;

[0028] The scheduling strategy based on the updated heuristic learning algorithm is fed back to the intelligent scheduling module.

[0029] Optionally, after running the entity processes and the management process in parallel on their respective pre-allocated computing cores, the method further includes:

[0030] Monitor the status of physical processes and management processes on each computing core and detect abnormal process status, including process crash, process timeout, resource exhaustion and communication interruption;

[0031] When an abnormal process state is detected, the abnormal type, the identifier of the abnormal process and the resource information occupied by the abnormal process are reported to the intelligent scheduling module;

[0032] The intelligent scheduling module determines the severity and impact range of the abnormal process state and classifies the abnormal process state into recoverable abnormality and unrecoverable abnormality;

[0033] For the recoverable exception, the abnormal process state is restored to the most recent stable state; for the unrecoverable exception, whether to restart the affected process or isolate the abnormal process is determined based on the severity and impact scope of the abnormal process state.

[0034] Optionally, running the entity processes and the management process in parallel on their respective pre-allocated computing cores includes:

[0035] Starting the entity process corresponding to each simulation entity in the simulation environment, and independently running each entity process on its own pre-assigned computing core based on the initial state of each entity process;

[0036] Starting the management processes corresponding to the message manager module, the object manager module, and the time manager module, respectively, and independently running each management process on its own pre-assigned computing core;

[0037] Based on zero-copy technology and message queues, messages between various entity processes and management processes are received and transmitted through communication channels between various entity processes;

[0038] Dynamically update the relevant information of the simulation environment and record event logs; send the relevant information of the simulation environment to the entity process in response to an access instruction from the entity process through the query interface of the object manager module;

[0039] Through the time manager module, a blocking-based virtual time alignment mechanism is used to synchronize time between different entity processes within a simulation step, where the simulation step is determined according to the initial simulation time and the speedup ratio.

[0040] Optionally, the method further includes:

[0041] When the simulation is finished, the object manager module collects and summarizes all data generated during the simulation process, including the status data and event logs of each simulation entity, and the performance indicators of each entity process and management process.

[0042] In a second aspect, an embodiment of the present disclosure provides a multi-core parallel simulation device, which is used to perform the steps of a multi-core parallel simulation method, and the device includes:

[0043] A first determining module is used to determine all simulation entities in the simulation environment, wherein the simulation entities are independent simulation objects in the simulation environment;

[0044] an encapsulation module for encapsulating all simulation entities in the simulation environment into independently running entity processes, and for encapsulating a message manager module, an object manager module, and a time manager module into independently running management processes, wherein the message manager module is used to receive and transmit instructions between the entity processes, the object manager module is used to store and manage relevant information of the simulation environment, and the time manager module is used to manage the simulation time of the simulation environment;

[0045] The simulation operation module is used to run each entity process and management process in parallel on their pre-assigned computing cores, and monitor the resource usage data and task completion progress of the entity process and management process on each computing core through the intelligent scheduling module. The resource usage data includes CPU usage and memory occupancy;

[0046] A second determining module is configured to determine an overloaded computing core based on resource usage data and task completion progress of the entity processes and management processes on each computing core;

[0047] An adjustment module is used to dynamically adjust the execution order and resource allocation of the entity processes and management processes on the overloaded computing core through the intelligent scheduling module.

[0048] Optionally, the encapsulation module includes:

[0049] The simulation process encapsulation submodule is used to assign a unique identifier to each simulation entity and encapsulate each simulation entity into an independently running entity process through the process management tool according to the type and attributes of each simulation entity;

[0050] A management process encapsulation submodule, configured to encapsulate the message manager module, the object manager module, and the time manager module into independently running management processes through the process management tool;

[0051] The initialization submodule is used to initialize each entity process and management process.

[0052] Optionally, the initialization submodule includes:

[0053] A first setting unit is used to set a task priority for each entity process and management process, and allocate an initial computing core to each entity process and management process;

[0054] A second setting unit is used to set the initial state of each entity process, wherein the initial state includes a position, a state, and a behavior rule;

[0055] A first initialization unit is used to establish communication channels between various entity processes for the management process corresponding to the message manager module and set parameters of each communication channel;

[0056] a second initialization unit, configured to load relevant information of the simulation environment into a management process corresponding to the object manager module, and configure a query interface for querying relevant information of the simulation environment stored in the object manager module;

[0057] The third initialization unit is configured to set an initial simulation time and an acceleration ratio for the management process corresponding to the time manager module, and synchronize the initial simulation time and the acceleration ratio to all entity processes.

[0058] Optionally, the adjustment module includes:

[0059] a task urgency determination submodule, configured to determine the task urgency of each entity process and management process on the overloaded computing core based on resource usage data and task priorities of the entity processes and management processes on the overloaded computing core;

[0060] An adjustment submodule is used to adjust the execution order and resource allocation of the entity processes and management processes on the overloaded computing core according to the task urgency of each entity process and management process on the overloaded computing core through the intelligent scheduling module and a scheduling strategy based on a heuristic learning algorithm, wherein processes with higher task urgency are adjusted to a higher execution order, resources are preferentially allocated to processes with higher task urgency, and processes with lower task urgency are allocated to idle computing cores for processing.

[0061] Optionally, the device further comprises:

[0062] A collection module for collecting scheduling policy samples, wherein the scheduling policy samples include resource usage data of entity processes and management processes on each computing core, task completion progress, and adjusted execution efficiency;

[0063] The evaluation module is used to evaluate the collected scheduling policy samples and determine the load of each computing core;

[0064] The weight parameter update module is used to update the weight parameters of the heuristic learning algorithm according to the load of each computing core;

[0065] The feedback application module is used to feed back the scheduling strategy based on the updated heuristic learning algorithm to the intelligent scheduling module.

[0066] Optionally, the device further comprises:

[0067] A monitoring module, configured to monitor the status of physical processes and management processes on each computing core and detect abnormal process status, including process crash, process timeout, resource exhaustion, and communication interruption;

[0068] An exception reporting module is used to report the exception type, the identifier of the abnormal process and the resource information occupied by the abnormal process to the intelligent scheduling module when an abnormal process state is detected;

[0069] a determination module, configured to determine the severity and impact scope of the abnormal process state through the intelligent scheduling module, and classify the abnormal process state into recoverable abnormality and unrecoverable abnormality;

[0070] The exception handling module is used to restore the abnormal process state to the most recent stable state for the recoverable exception; for the unrecoverable exception, determine whether to restart the affected process or isolate the abnormal process based on the severity and impact scope of the abnormal process state.

[0071] Optionally, the simulation operation module includes:

[0072] A first running submodule is configured to start a corresponding entity process of each simulation entity in the simulation environment, and independently run each entity process on a pre-assigned computing core based on the initial state of each entity process;

[0073] a second running submodule, configured to start management processes corresponding to the message manager module, the object manager module, and the time manager module, and independently run each management process on its own pre-assigned computing core;

[0074] The message management submodule is used to receive and transmit messages between various entity processes and the management process through the communication channels between various entity processes based on zero-copy technology and message queues;

[0075] The object management submodule is configured to dynamically update the relevant information of the simulation environment and record event logs; and to send the relevant information of the simulation environment to the entity process in response to an access instruction from the entity process through the query interface of the object manager module;

[0076] The time management submodule is used to synchronize the time of different entity processes within a simulation step by using a blocking-based virtual time alignment mechanism through the time manager module, where the simulation step is determined according to the initial simulation time and the speedup ratio.

[0077] Optionally, the device further comprises:

[0078] The data summary module is used to collect and summarize all data generated during the simulation process through the object manager module when the simulation is completed, including the status data and event logs of each simulation entity, as well as the performance indicators of each entity process and management process.

[0079] In a third aspect, an embodiment of the present disclosure provides an electronic device comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of a multi-core parallel simulation method when executed by the processor.

[0080] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:

[0081] The present disclosure encapsulates the message manager module, object manager module and time manager module into independent management processes, and uniformly handles inter-process communication and time synchronization, thereby significantly reducing communication overhead and synchronization complexity, and overcoming the communication bottleneck problem in large-scale simulation scenarios in traditional methods. Secondly, the intelligent scheduling module monitors the resource usage and task progress of each computing core in real time, and can dynamically adjust the execution order and resource allocation of overloaded cores, avoiding the problem of overload or idleness of certain cores caused by load imbalance in traditional methods. Through this intelligent scheduling mechanism, the present invention significantly improves the load balancing of multi-core simulation, fully utilizes the computing resources of the multi-core system, and thus greatly improves the simulation efficiency, and is particularly suitable for the efficient operation of large-scale and complex simulation systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for describing the embodiments of the present disclosure.

[0083] Figure 1 This is a schematic diagram of the steps of a multi-core parallel simulation method provided by an embodiment of the present disclosure;

[0084] Figure 2 This is a schematic diagram of the overall process of a multi-core parallel simulation method provided by an embodiment of the present disclosure;

[0085] Figure 3 This is a structural block diagram of a multi-core parallel simulation device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0086] The following will clearly and completely describe the technical solutions in the embodiments of the present disclosure in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0087] The disclosed embodiments provide a multi-core parallel simulation method applicable to multiple simulation fields, including military simulation, traffic simulation, robotics simulation, and other environments involving complex simulation tasks. Military simulations offer significant advantages, particularly in military simulations. These complex red-blue confrontation scenarios require real-time simulation of numerous entities (such as combat units, weapon systems, and tactical strategies), as well as dynamic interaction and coordination between these entities. By encapsulating simulation entities into independently running entity processes and integrating independent modules such as message management, object management, and time management, this method enables efficient interaction and time synchronization between the red and blue sides in simulated combat. In particular, in military simulations involving red-blue confrontations, this method dynamically monitors resource usage across cores through an intelligent scheduling module, ensuring efficient utilization of computing resources for complex tactical simulations. Furthermore, the disclosed heuristic learning algorithm optimizes resource allocation based on the real-time combat situation, ensuring the smooth execution of high-priority critical tasks (such as command systems and core tactical actions) and avoiding delays or simulation stalls caused by uneven load. In addition, the zero-copy technology and message queue provided by the present invention ensure that combat information between the red and blue teams can be transmitted quickly and with low overhead, greatly improving the real-time and accuracy of combat simulation.

[0088] Figure 1 FIG. 1 is a schematic diagram of the steps of a multi-core parallel simulation method provided by an embodiment of the present disclosure. Figure 1 As shown, the method includes:

[0089] Step S101: determining all simulation entities in a simulation environment, where the simulation entities are independent simulation objects in the simulation environment.

[0090] Step S102: encapsulate all simulation entities in the simulation environment into independently running entity processes, and encapsulate the message manager module, object manager module and time manager module into independently running management processes, respectively. The message manager module is used to receive and transmit instructions between each entity process, the object manager module is used to store and manage relevant information of the simulation environment, and the time manager module is used to manage the simulation time of the simulation environment.

[0091] In step S103, each entity process and management process runs in parallel on their respective pre-allocated computing cores, and the resource usage data and task completion progress of the entity process and management process on each computing core are monitored through the intelligent scheduling module. The resource usage data includes CPU usage and memory occupancy.

[0092] Step S104 : determining an overloaded computing core based on the resource usage data and task completion progress of the physical processes and management processes on each computing core.

[0093] Step S105 : Dynamically adjust the execution order and resource allocation of the entity processes and management processes on the overloaded computing core through the intelligent scheduling module.

[0094] Regarding step S101, a simulation environment refers to a virtual space used to simulate a specific scenario or mission. For example, in a military simulation, the simulation environment can be a complex battlefield or battle scenario, encompassing a variety of elements such as terrain, weather conditions, and mission objectives. More specifically, in a simulated battle, the simulation environment can encompass various combat terrains, including a city, a mountain, or an ocean. It can also include weather factors (such as rain and fog) or day / night variations that influence the outcome of the battle. Simulated entities are independent, interactive objects within the simulation environment. Each simulated entity has independent state, behavioral logic, and interaction mechanisms. For example, in a military simulation, a simulated entity can be a combat unit (such as a tank, fighter jet, ship, infantry), or a combat command system, communications equipment, or drones. Each simulated entity has specific attributes and missions, such as a tank for the Red Team or a fighter jet for the Blue Team.

[0095] In step S102, each simulated entity in the simulation environment (such as combat units, weapon systems, and command systems) is encapsulated as an independent running process. Independent processes mean that each simulated entity can run as a separate task on different cores of a multi-core processor without interfering with each other. For example, a Red Team tank, as one of the simulated entities, can be encapsulated as an independent process. Its task is to advance to a designated target area according to predefined rules and engage the Blue Team's defense system. Its independent process will be responsible for calculating the tank's trajectory, ammunition consumption, and target shooting. A Blue Team fighter jet, as another simulated entity, is also encapsulated as an independent process. Its process needs to calculate flight paths, identify enemy targets, and conduct bombing strikes in real time. By encapsulating each simulated entity as an independent process, multiple simulated entities can run in parallel on different CPU cores, thereby improving the simulation system's ability to handle complex combat scenarios. In addition to the simulated entities, the management module is also encapsulated as an independent process. The message manager module is responsible for receiving, sending, and processing communication instructions between the various simulated entity processes. During the simulation, combat units on the Red and Blue sides need to exchange information in real time, such as combat orders and enemy position reports. The message manager is responsible for efficiently and low-latency processing of this information. The object manager module is used to store and manage various states and information within the simulation environment, such as the current state of each simulated entity (position, health points, mission progress, etc.) and environmental information (terrain, weather conditions, etc.). This module ensures that each simulated entity process can quickly access the required global information, ensuring simulation consistency. The time manager module is used to synchronize time processes within the simulation environment, ensuring that all simulated entity operations occur on a unified timeline. After the simulation entity processes and management module processes are encapsulated, they will run on their assigned CPU cores. Each core can independently process different simulation entities or management modules.

[0096] In step S103, each entity process and management process is assigned to a different computing core for parallel computing. Multiple processes can execute simultaneously, reducing the overall simulation time. During the parallel execution process, the intelligent scheduling module monitors the resource usage data and task completion progress of the entity and management processes on each computing core in real time. Resource usage data refers to information about the computing resources consumed by each process on the computing core during the simulation, primarily including CPU utilization and memory usage. Specifically, CPU utilization indicates the degree to which a computing core is utilized over a certain period of time, expressed as a percentage. For example, if a core has been executing a process for 0.5 seconds out of the past second, the CPU utilization of that core is 50%. Memory utilization indicates the amount of memory occupied by a process during execution, expressed in MB (megabytes) or GB (gigabytes). Task completion progress is the completion status of tasks executed by each process during the simulation, reflecting the amount of work completed by each process within a specific time period and the degree of progress compared to the predetermined plan or target.

[0097] Involving step S104, the intelligent scheduling module continuously monitors the resource usage data (such as CPU usage and memory occupancy) and task completion progress of each computing core. If the CPU usage of a core is close to or reaches 100%, it means that the computing power of the core has been fully utilized and may be overloaded. If the memory occupancy of a core is also close to its maximum capacity, it may cause performance degradation or the task to be unable to continue. If the task completion progress of a core lags significantly behind other cores, it may indicate that the core is overloaded and cannot complete the task in time. By comprehensively analyzing the above data, the intelligent scheduling module can determine which computing cores are in an overloaded state. An overloaded computing core refers to a core in a multi-core processor whose resource usage (such as CPU and memory) exceeds its designed or acceptable working range, resulting in the core being unable to effectively process the tasks assigned to it. Suppose in a simulation task, there are 4 computing cores, each running a different process. After monitoring, the following resource usage data was obtained: Core 1: CPU usage 95%, memory usage 80%; Core 2: CPU usage 30%, memory usage 50%; Core 3: CPU usage 20%, memory usage 30%; Core 4: CPU usage 100%, memory usage 90%. In this example, the CPU usage of both Core 1 and Core 4 is very high, especially Core 4, which has reached 100%, indicating that it is overloaded. The specific judgment rule can be compared with a preset threshold, or a load score can be calculated based on the weighted calculation of resource usage data and task completion progress, which is not limited in the present embodiment.

[0098] In step S105, the intelligent scheduling module identifies all physical processes and management processes running on the overloaded computing core identified in step S104. Scheduling policies are adjusted accordingly for the physical processes and management processes on the overloaded computing core, primarily adjusting the execution order and resource allocation. Scheduling policies are adjusted and optimized in real time, making the entire adjustment process dynamic. Specifically, regarding execution order adjustments, the intelligent scheduling module dynamically adjusts the execution order of each process based on its importance and urgency. Critical tasks (such as traffic light status changes) can also be prioritized to ensure timely execution. On the overloaded computing core, the intelligent scheduling module can reorder the execution of tasks, prioritizing processes that have a greater impact on simulation results or those that are lagging behind to reduce overall latency. Regarding resource allocation adjustments, the intelligent scheduling module can reduce the CPU time slices of certain low-priority processes on the overloaded computing core, allocating more computing resources to higher-priority processes. If certain processes consume excessive memory, potentially disrupting the normal operation of other processes, the intelligent scheduling module can optimize memory allocation to ensure sufficient memory resources for all processes.

[0099] The present disclosure encapsulates the message manager module, object manager module and time manager module into independent management processes, and uniformly handles inter-process communication and time synchronization, thereby significantly reducing communication overhead and synchronization complexity, and overcoming the communication bottleneck problem in large-scale simulation scenarios in traditional methods. Secondly, the intelligent scheduling module monitors the resource usage and task progress of each computing core in real time, and can dynamically adjust the execution order and resource allocation of overloaded cores, avoiding the problem of overload or idleness of certain cores caused by load imbalance in traditional methods. Through this intelligent scheduling mechanism, the present invention significantly improves the load balancing of multi-core simulation, fully utilizes the computing resources of the multi-core system, and thus greatly improves the simulation efficiency, and is particularly suitable for the efficient operation of large-scale and complex simulation systems.

[0100] Exemplarily, the encapsulation of all simulation entities in the simulation environment into independently running entity processes, and the encapsulation of the message manager module, the object manager module and the time manager module into independently running management processes, include: assigning a unique identifier to each simulation entity, and encapsulating each simulation entity into an independently running entity process through a process management tool according to the type and attributes of each simulation entity; encapsulating the message manager module, the object manager module and the time manager module into independently running management processes through the process management tool; and initializing each entity process and management process.

[0101] In a simulation environment, each simulated entity (such as a red or blue soldier, a tank, etc.) is assigned a unique identifier to distinguish and manage them throughout the simulation. This identifier can be an integer, a string, or some other unique value. A corresponding process is created based on the type (e.g., vehicle, soldier, weapon) and attributes (e.g., speed, state, position, etc.) of each simulated entity. The process management tool is responsible for creating and managing these independent processes. The various process management tools have been described previously and will not be repeated here. Similarly, the process management tool is used to create the message manager process, the object manager process, and the time manager process. Each management module also runs independently. After process creation, each process is initialized, including setting its location, state, and behavior rules to ensure that each process has the correct state and functionality at the start of the simulation.

[0102] Through the above steps, all simulation entities and management modules in the simulation environment are effectively encapsulated as independently running processes, making the simulation system efficient and easy to expand. Each process can independently perform its tasks while simultaneously coordinating and exchanging information through the management module, thus enabling complex multi-core parallel simulation.

[0103] Exemplarily, the initialization of each entity process and management process includes: setting a task priority for each entity process and management process, and allocating an initial computing core to each entity process and management process; setting an initial state of each entity process, wherein the initial state includes position, state, and behavior rules; for the management process corresponding to the message manager module, establishing a communication channel between each entity process, and setting parameters of each communication channel; for the management process corresponding to the object manager module, loading relevant information of the simulation environment, and configuring a query interface, wherein the query interface is used to query relevant information of the simulation environment stored in the object manager module; for the management process corresponding to the time manager module, setting an initial simulation time and acceleration ratio, and synchronizing the initial simulation time and the acceleration ratio to all entity processes.

[0104] During initialization, each process is assigned a task priority to ensure proper scheduling of their execution order. Each process is also assigned an initial computing core to ensure independent operation. Each entity process is initialized to its initial state, including its location, status, and behavior rules.

[0105] For the management process corresponding to the message manager module, communication channels are established between various entity processes, and parameters of each communication channel are set to ensure that information can be transmitted in a timely manner.

[0106] For the management process corresponding to the object manager module, relevant information about the simulation environment is loaded and a query interface is configured. The query interface is a set of functions or methods used to access and obtain relevant information in the simulation environment. The query interface allows each entity process to access relevant information in the simulation environment stored in the object manager module, thereby enabling information sharing and interaction. When the status of a simulation entity changes, the relevant information in the object manager can be updated through the query interface, ensuring that other processes can obtain the latest status.

[0107] For the management process corresponding to the Time Manager module, set the initial simulation time and speedup ratio. For example, set the initial simulation time to 0 seconds (initial time = 0) and the speedup ratio to 1 (speedup ratio = 1, indicating that real time and simulation time are the same). Send the initial time and speedup ratio to all entity processes through the Message Manager module to ensure that they run within the same time frame.

[0108] Through the above steps, each entity process and management process in the simulation system is effectively initialized, ensuring that the simulation can proceed smoothly, laying a solid foundation for subsequent simulation execution, and ensuring that each process can run independently according to predetermined rules and states, while at the same time being able to effectively coordinate and exchange information through the management module.

[0109] Exemplarily, the intelligent scheduling module dynamically adjusts the execution order and resource allocation of the physical processes and management processes on the overloaded computing core, including: determining the task urgency of each physical process and management process on the overloaded computing core based on the resource usage data and task priority of the physical processes and management processes on the overloaded computing core; through the intelligent scheduling module, using a scheduling strategy based on a heuristic learning algorithm, adjusting the execution order and resource allocation of the physical processes and management processes on the overloaded computing core according to the task urgency of each physical process and management process on the overloaded computing core, wherein the process with higher task urgency is adjusted to a front execution order, resources are preferentially allocated to the process with higher task urgency, and the process with lower task urgency is allocated to the idle computing core for processing.

[0110] Before dynamic adjustments are made, the intelligent scheduling module first determines the task urgency of each process based on the resource usage and task priorities of each entity and management process on the overloaded computing core. If a process's resource usage is close to its maximum, it may be facing a performance bottleneck and has a high task urgency. As previously mentioned, the higher the process's priority, the higher its task urgency. High-priority processes should be prioritized. If a process's task completion progress significantly lags behind other processes, it indicates that it requires more resources and a higher priority. Consider a traffic simulation environment with the following entity processes on an overloaded computing core: Vehicle 1 (CPU usage 90%, priority 1, task completion progress 40%); Vehicle 2 (CPU usage 70%, priority 2, task completion progress 60%); Traffic light (CPU usage 100%, priority 1, task completion progress 30%); and Pedestrian 1 (CPU usage 50%, priority 3, task completion progress 20%). Based on this information, the intelligent scheduling module can assess that Vehicle 1 and Traffic light have high task urgency because their resource usage is nearing the upper limit and their completion progress is lagging. Vehicle 2's task has medium urgency, while Pedestrian 1's task has the lowest urgency. Once the task urgency of each process is determined, the intelligent scheduling module dynamically adjusts it using a scheduling strategy based on a heuristic learning algorithm. In this disclosed embodiment, a scheduling strategy based on a heuristic learning algorithm dynamically optimizes and adjusts the execution order and resource allocation of each entity process and management process during the simulation using a heuristic learning method. Heuristic learning algorithms solve problems based on experience and heuristic rules. Unlike traditional algorithms, heuristic algorithms do not necessarily guarantee the optimal solution; instead, they use empirical rules, regulations, or intuition to find a "good enough" solution. Specifically, processes with higher task urgency are prioritized. For example, the tasks of traffic lights and vehicle 1 have higher urgency, so their execution order will be increased. Computing resources are prioritized for processes with higher task urgency. For example, the traffic light process requires more CPU time slices to process state changes, so it can be allocated more CPU time. Processes with lower task urgency, such as Pedestrian 1, can be assigned to idle computing cores to avoid further burdening overloaded cores. In the above example, the intelligent scheduling module can reorder the traffic light process to first and allocate more CPU time. It can also reorder vehicle 1 to second, ensuring it completes its task on time. It can also reorder vehicle 2 to third, as it has a higher priority but relatively good resource usage, allowing it to be delayed slightly. It can also reassign pedestrian 1's process to an idle core (let's say core 2) to reduce pressure on the overloaded core.The intelligent scheduling module ensures the simulation system continues to operate efficiently even in the face of overload conditions through real-time monitoring and dynamic adjustments. The scheduling strategy is implemented dynamically, meaning the simulation system continuously adjusts the execution order and resource allocation of processes based on real-time resource usage data and task completion progress.

[0111] By dynamically adjusting the physical processes and management processes on overloaded computing cores through the intelligent scheduling module, the simulation system can effectively manage resources, optimize the execution sequence, and ensure that key tasks can be completed in a timely manner, thereby improving overall simulation efficiency and responsiveness.

[0112] Exemplarily, the method also includes: collecting scheduling policy samples, the scheduling policy samples including resource usage data, task completion progress and adjusted execution efficiency of the physical processes and management processes on each computing core; evaluating the collected scheduling policy samples to determine the load conditions of each computing core; updating the weight parameters of the heuristic learning algorithm according to the load conditions of each computing core; and feeding back the scheduling strategy based on the updated heuristic learning algorithm to the intelligent scheduling module.

[0113] During the simulation, the intelligent scheduling module continuously monitors and records the execution of the scheduling strategy, and collects scheduling strategy samples, including resource usage data, task completion progress, and adjusted execution efficiency. The adjusted execution efficiency is recorded after the scheduling strategy is adjusted, including the changes in the execution efficiency of each process, such as response time, delay, etc.

[0114] After collecting sufficient scheduling policy samples, the intelligent scheduling module evaluates them to determine the load of each computing core. By analyzing the resource usage data for each core, it determines whether there is overload or resource idleness. Based on the evaluation results, the intelligent scheduling module updates the weight parameters of the heuristic learning algorithm to optimize the scheduling policy. Specifically, based on the load of each core, it identifies the factors that lead to overload or inefficient execution. Based on the analysis results, the weight parameters in the heuristic learning algorithm are adjusted to better adapt to the current simulation environment and task requirements. For example, if the evaluation shows that the state change of a simulation entity has a significant impact on the core load, the intelligent scheduling module can increase the weight of this simulation entity in the scheduling algorithm, ensuring that it receives higher scheduling priority. Finally, the updated scheduling policy is fed back to the intelligent scheduling module for application in the next simulation run. In other words, in the next simulation run, the intelligent scheduling module will use the updated policy for dynamic scheduling to improve overall efficiency and responsiveness.

[0115] By collecting scheduling strategy samples, evaluating load conditions, updating the weight parameters of the heuristic learning algorithm, and feeding the updated strategy back to the intelligent scheduling module, the simulation system can achieve self-optimization, improve resource utilization and system efficiency, and ensure that the simulation system can adapt to the ever-changing environment and task requirements, thereby providing a more efficient simulation experience.

[0116] Exemplarily, after running each entity process and management process in parallel on their respective pre-allocated computing cores, the method further includes: monitoring the process status of the entity process and management process on each computing core, detecting abnormal process status, the abnormal process status including process crash, process timeout, resource exhaustion and communication interruption; when an abnormal process status is detected, reporting the abnormal type, the identifier of the abnormal process and the resource information occupied by the abnormal process to the intelligent scheduling module; through the intelligent scheduling module, determining the severity and impact scope of the abnormal process status, and dividing the abnormal process status into recoverable exceptions and unrecoverable exceptions; for the recoverable exception, restoring the abnormal process status to the most recent stable state; for the unrecoverable exception, determining whether to restart the affected process or isolate the abnormal process based on the severity and impact scope of the abnormal process status.

[0117] During parallel execution, the intelligent scheduling module monitors the status of the physical and management processes running on each computing core in real time. Abnormal process states include process crashes (a process terminates unexpectedly and cannot continue execution); process timeouts (a process fails to complete its scheduled task within the specified time); resource exhaustion (the resources required by the process (such as CPU and memory) are exhausted, resulting in the inability to continue execution); and communication interruptions (communication issues between processes prevent information from being transmitted). During monitoring, the intelligent scheduling module detects abnormal states based on preset conditions and thresholds. Once an anomaly is detected, the anomaly type, the identifier of the abnormal process, and information about the resources occupied by the process are recorded.

[0118] The intelligent scheduling module further determines the severity of the exception based on the exception type and the scope of impact, and divides the exception status into recoverable exceptions and unrecoverable exceptions. Recoverable exceptions are abnormal process states that can be recovered by adjusting or restarting the process, such as process timeout or resource exhaustion. Unrecoverable exceptions require more complex processing, such as process crashes or communication interruptions. For recoverable exceptions, the intelligent scheduling module will attempt to restore the abnormal process state to the most recent stable state. Optionally, resources can be reallocated, process parameters can be adjusted, or the process can be restarted. For unrecoverable exceptions, the intelligent scheduling module needs to determine whether to restart the affected process or isolate the abnormal process based on the severity and scope of impact to prevent the abnormal process from affecting other normal running processes.

[0119] By monitoring process status, detecting anomalies, reporting anomaly information, determining anomaly severity, recovering from recoverable anomalies, and handling unrecoverable anomalies, the present disclosure effectively manages process stability and performance. This series of steps ensures that the system can respond quickly to anomalies, minimizing the impact on simulation operations and improving overall simulation efficiency and reliability.

[0120] Exemplarily, the method of running each entity process and management process in parallel on their respective pre-allocated computing cores includes: starting the entity process corresponding to each simulation entity in the simulation environment, and running each entity process independently on its respective pre-allocated computing core based on the initial state of each entity process; starting the management process corresponding to the message manager module, the object manager module and the time manager module, and running each management process independently on its respective pre-allocated computing core; receiving and transmitting messages between each entity process and the management process through the communication channel between each entity process based on zero copy technology and message queues; dynamically updating relevant information of the simulation environment and recording event logs; sending relevant information of the simulation environment to the entity process in response to an access instruction from the entity process through the query interface of the object manager module; and performing time synchronization on different entity processes within a simulation step by utilizing a blocking-based virtual time alignment mechanism through the time manager module, wherein the simulation step is determined based on the initial simulation time and the acceleration ratio.

[0121] When a simulation is started, the entity processes corresponding to each simulation entity are started. Each entity process should run independently on a pre-assigned computing core based on its initial state. The message manager module, object manager module, and time manager module start their corresponding management processes, which also run independently and in parallel on the pre-assigned computing cores.

[0122] During parallel operation, each entity process and the management process must exchange information through communication channels. Zero-copy technology and message queues effectively reduce inter-process communication overhead and improve efficiency. For example, when a vehicle process needs to obtain the status of a traffic light, it can send a request to the message manager module through the message queue. The message manager module then uses zero-copy technology to pass the traffic light status information directly to the vehicle process, avoiding duplicate data copies.

[0123] During the simulation process, the state of the simulation environment may change. The object manager module is responsible for dynamically updating this relevant information and ensuring that all entity processes have access to the latest environment data. All relevant entity processes can obtain the latest environment information through the query interface in order to make appropriate decisions. All events and state changes should be recorded in the event log for subsequent analysis and debugging. For example, when the state of a simulation entity changes, the time manager module records this event, including the timestamp, the old state of the simulation entity, and the new state. At the same time, the object manager module provides a query interface to respond to access instructions from the entity process and send it relevant information about the simulation environment.

[0124] It will be appreciated that the object manager provides entity management functionality, namely, proactive, real-time management of all simulated entities within the simulation environment, including operations such as searching, modifying, and deleting simulated entities. Furthermore, the entity state pool can be used as a collection to store the current states of all simulated entities. Similarly, the model state pool can be used as a logical framework to store and manage behavioral and motion models of entity processes.

[0125] The Time Manager module uses a blocking-based virtual time alignment mechanism to synchronize the progress of different entities within a simulation step. The simulation step is determined by the initial simulation time and the speedup ratio. Assuming an initial simulation time of 0 seconds and a speedup ratio of 2, the simulation step is set to 1 second. This blocking-based virtual time alignment mechanism forces faster entities to wait for slower entities, thus achieving synchronization across the entire simulation process. Consider a traffic simulation scenario with two vehicles (Car A and Car B) and a traffic light. Car A computes faster, while Car B computes slower. The Time Manager monitors the computational progress of both vehicles. When Car A completes its computation, it enters a waiting state until Car B completes its computation. This ensures that within the same simulation step, all entities update their states at the same point in time, avoiding logical errors caused by asynchronous computation (for example, Car A making decisions before Car B has updated its position). For entities with less critical simulation accuracy, the Time Manager allows for asynchronous computational updates. Consider an airplane and a car in the same traffic simulation. An aircraft's motion model might require a position update at every simulation step, as aircraft travel much faster than ground vehicles and their motion state changes more rapidly. Therefore, updating the aircraft's position at every simulation step is reasonable. Meanwhile, vehicles, due to their relatively slow speeds and in some situations (such as waiting at a red light) insignificant state changes, can be set to update their position every 10 simulation steps. This asynchronous update approach significantly reduces computational overhead and improves simulation efficiency, while maintaining reasonable accuracy throughout the simulation.

[0126] By starting entity processes and management processes, efficient communication based on zero-copy technology, dynamically updating simulation environment information, recording event logs, responding to access instructions, and time synchronization mechanisms, the traffic simulation system can achieve efficient and accurate simulation operation, ensuring that the various components in the simulation process can work in coordination, thereby providing realistic simulation and analysis results.

[0127] Exemplarily, the method further includes: when the simulation ends, collecting and summarizing all data generated during the simulation process through the object manager module, including status data and event logs of each simulation entity, and performance indicators of each entity process and management process.

[0128] During the simulation, all status data and event logs are recorded in real time. At the end of the simulation, the object manager module collects this data from various entity processes and management processes. This collected data is organized to ensure a uniform format for subsequent analysis. This data is aggregated to generate a comprehensive report. This aggregated data is stored in a database or file system for subsequent access and analysis.

[0129] By using the data collected and summarized by the Object Manager module at the end of the simulation, this paper can effectively evaluate the simulation results, identify problems, and optimize the system. This not only provides an important basis for subsequent research and improvement, but also provides data support for simulation management and planning.

[0130] Figure 2 FIG. 1 is a schematic diagram of the overall process of a multi-core parallel simulation method provided by an embodiment of the present disclosure. Figure 2As shown, the simulation process starts, assigning each simulation entity a unique identifier and encapsulating it as an independent entity process. The message manager module is initialized to establish communication channels between entity processes. Simulation environment information is loaded, and query interfaces are configured to support information queries. The initial simulation time and acceleration ratio are set and synchronized across all entity processes. The message manager, object manager, and time manager modules are encapsulated as independent management processes. During the simulation, the message manager module runs, responsible for receiving and transmitting instructions between entity processes, ensuring effective communication within the simulation. The object manager module runs, managing and updating simulation environment information and responding to query requests from entity processes. The time manager module runs, using a virtual time alignment mechanism to synchronize the time steps of entity processes and coordinate the advancement of simulation time. Entity processes run independently, executing on pre-assigned computing cores based on their initial states. During the simulation, the intelligent scheduling module runs, monitoring resource usage of both entity and management processes on each computing core. It collects CPU and memory usage, dynamically adjusting task priorities and resource allocation for overloaded cores based on task completion progress. The intelligent scheduling module detects abnormal states in each process during the simulation. The severity of the anomaly is determined, and recoverable anomalies are restored, or processes with unrecoverable anomalies are restarted or isolated until no more abnormal processes remain. The simulation continues in a healthy state until the end of the simulation. The object manager module runs, collecting all simulation data, including status data, event logs, and performance metrics for each simulation entity. This collected data is stored in a database for subsequent analysis. The intelligent scheduling module evaluates the collected scheduling policy samples and analyzes the load on each core. Based on the evaluation results, the weight parameters of the heuristic learning algorithm are updated to optimize future scheduling policies. The simulation process is now complete, and all processes terminate.

[0131] Figure 3 This is a structural block diagram of a multi-core parallel simulation device provided by an embodiment of the present disclosure. Figure 3 As shown, the steps for executing a multi-core parallel simulation method include:

[0132] A first determining module 201 is configured to determine all simulation entities in a simulation environment, wherein the simulation entities are independent simulation objects in the simulation environment;

[0133] An encapsulation module 202 is configured to encapsulate all simulation entities in the simulation environment into independently running entity processes, and to encapsulate a message manager module, an object manager module, and a time manager module into independently running management processes, wherein the message manager module is configured to receive and transmit instructions between the entity processes, the object manager module is configured to store and manage relevant information of the simulation environment, and the time manager module is configured to manage the simulation time of the simulation environment;

[0134] The simulation operation module 203 is used to run each entity process and management process in parallel on their respective pre-assigned computing cores, and monitor the resource usage data and task completion progress of the entity process and management process on each computing core through the intelligent scheduling module. The resource usage data includes CPU usage and memory occupancy;

[0135] A second determining module 204 is configured to determine an overloaded computing core based on resource usage data and task completion progress of the physical processes and management processes on each computing core;

[0136] The adjustment module 205 is configured to dynamically adjust the execution order and resource allocation of the entity processes and management processes on the overloaded computing core through the intelligent scheduling module.

[0137] Exemplarily, the packaging module includes:

[0138] The simulation process encapsulation submodule is used to assign a unique identifier to each simulation entity and encapsulate each simulation entity into an independently running entity process through the process management tool according to the type and attributes of each simulation entity;

[0139] A management process encapsulation submodule, configured to encapsulate the message manager module, the object manager module, and the time manager module into independently running management processes through the process management tool;

[0140] The initialization submodule is used to initialize each entity process and management process.

[0141] Exemplarily, the initialization submodule includes:

[0142] A first setting unit is used to set a task priority for each entity process and management process, and allocate an initial computing core to each entity process and management process;

[0143] A second setting unit is used to set the initial state of each entity process, wherein the initial state includes a position, a state, and a behavior rule;

[0144] A first initialization unit is used to establish communication channels between various entity processes for the management process corresponding to the message manager module and set parameters of each communication channel;

[0145] a second initialization unit, configured to load relevant information of the simulation environment into a management process corresponding to the object manager module, and configure a query interface for querying relevant information of the simulation environment stored in the object manager module;

[0146] The third initialization unit is configured to set an initial simulation time and an acceleration ratio for the management process corresponding to the time manager module, and synchronize the initial simulation time and the acceleration ratio to all entity processes.

[0147] Exemplarily, the adjustment module includes:

[0148] a task urgency determination submodule, configured to determine the task urgency of each entity process and management process on the overloaded computing core based on resource usage data and task priorities of the entity processes and management processes on the overloaded computing core;

[0149] An adjustment submodule is used to adjust the execution order and resource allocation of the entity processes and management processes on the overloaded computing core according to the task urgency of each entity process and management process on the overloaded computing core through the intelligent scheduling module and a scheduling strategy based on a heuristic learning algorithm, wherein processes with higher task urgency are adjusted to a higher execution order, resources are preferentially allocated to processes with higher task urgency, and processes with lower task urgency are allocated to idle computing cores for processing.

[0150] Exemplarily, the device further includes:

[0151] A collection module for collecting scheduling policy samples, wherein the scheduling policy samples include resource usage data of entity processes and management processes on each computing core, task completion progress, and adjusted execution efficiency;

[0152] The evaluation module is used to evaluate the collected scheduling policy samples and determine the load of each computing core;

[0153] The weight parameter update module is used to update the weight parameters of the heuristic learning algorithm according to the load of each computing core;

[0154] The feedback application module is used to feed back the scheduling strategy based on the updated heuristic learning algorithm to the intelligent scheduling module.

[0155] Exemplarily, the device further includes:

[0156] A monitoring module, configured to monitor the status of physical processes and management processes on each computing core and detect abnormal process status, including process crash, process timeout, resource exhaustion, and communication interruption;

[0157] An exception reporting module is used to report the exception type, the identifier of the abnormal process and the resource information occupied by the abnormal process to the intelligent scheduling module when an abnormal process state is detected;

[0158] a determination module, configured to determine the severity and impact scope of the abnormal process state through the intelligent scheduling module, and classify the abnormal process state into recoverable abnormality and unrecoverable abnormality;

[0159] The exception handling module is used to restore the abnormal process state to the most recent stable state for the recoverable exception; for the unrecoverable exception, determine whether to restart the affected process or isolate the abnormal process based on the severity and impact scope of the abnormal process state.

[0160] Exemplarily, the simulation operation module includes:

[0161] A first running submodule is configured to start a corresponding entity process of each simulation entity in the simulation environment, and independently run each entity process on a pre-assigned computing core based on the initial state of each entity process;

[0162] a second running submodule, configured to start management processes corresponding to the message manager module, the object manager module, and the time manager module, and independently run each management process on its own pre-assigned computing core;

[0163] The message management submodule is used to receive and transmit messages between various entity processes and the management process through the communication channels between various entity processes based on zero-copy technology and message queues;

[0164] The object management submodule is configured to dynamically update the relevant information of the simulation environment and record event logs; and to send the relevant information of the simulation environment to the entity process in response to an access instruction from the entity process through the query interface of the object manager module;

[0165] The time management submodule is used to synchronize the time of different entity processes within a simulation step by using a blocking-based virtual time alignment mechanism through the time manager module, where the simulation step is determined according to the initial simulation time and the speedup ratio.

[0166] Exemplarily, the device further includes:

[0167] The data summary module is used to collect and summarize all data generated during the simulation process through the object manager module when the simulation is completed, including the status data and event logs of each simulation entity, as well as the performance indicators of each entity process and management process.

[0168] An embodiment of the present disclosure also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the above-mentioned various processes in an embodiment of a multi-core parallel simulation method and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0169] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, apparatuses, and electronic devices. Therefore, the embodiments of the present disclosure may take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0170] The embodiments of the present disclosure are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, and electronic devices according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer readable memory that can guide a computer or other programmable data processing terminal device to work in a specific way, so that the instructions stored in the computer readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 a process or multiple processes and / or boxes Figure 1A step that specifies a function in one or more boxes.

[0171] Although the preferred embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present disclosure.

[0172] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used solely to distinguish one entity or operation from another, and do not necessarily require or imply any actual relationship or order between these entities or operations. Furthermore, the term "comprising" or any other variant thereof is intended to encompass non-exclusive inclusion, such that a process, method, article, or terminal device comprising a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, article, or terminal device. Without further limitation, elements qualified by the phrase "comprising..." do not preclude the presence of additional identical elements in the process, method, article, or terminal device comprising the elements. The above detailed description of the multi-core parallel simulation method, apparatus, and electronic device provided by the present disclosure has been provided. Specific examples have been used herein to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is intended only to facilitate understanding of the method and its core concepts. Furthermore, those skilled in the art will appreciate that variations in the specific implementation and scope of application are possible based on the concepts of the present disclosure. In summary, the contents of this specification should not be construed as limiting the present disclosure.

Claims

1. A multi-core parallel simulation method, characterized in that: The method comprises: Determining all simulation entities in a simulation environment, wherein the simulation entities are independent simulation objects in the simulation environment; Encapsulating all simulation entities in the simulation environment into independently running entity processes, and encapsulating a message manager module, an object manager module, and a time manager module into independently running management processes, wherein the message manager module is used to receive and transmit instructions between the entity processes, the object manager module is used to store and manage relevant information of the simulation environment, and the time manager module is used to manage the simulation time of the simulation environment; Run each entity process and management process in parallel on their respective pre-assigned computing cores, and monitor the resource usage data and task completion progress of the entity process and management process on each computing core through the intelligent scheduling module. The resource usage data includes CPU usage and memory occupancy; Determine the overloaded computing core based on the resource usage data and task completion progress of the physical and management processes on each computing core; Dynamically adjusting the execution order and resource allocation of the entity processes and management processes on the overloaded computing core through the intelligent scheduling module; Starting the entity process corresponding to each simulation entity in the simulation environment, and independently running each entity process on its own pre-assigned computing core based on the initial state of each entity process; Starting the management processes corresponding to the message manager module, the object manager module, and the time manager module, respectively, and independently running each management process on its own pre-assigned computing core; Based on zero-copy technology and message queues, messages between various entity processes and management processes are received and transmitted through communication channels between various entity processes; Dynamically update the relevant information of the simulation environment and record event logs; send the relevant information of the simulation environment to the entity process in response to an access instruction from the entity process through the query interface of the object manager module; Through the time manager module, different entity processes are synchronized in time within a simulation step using a blocking-based virtual time alignment mechanism.

2. The method according to claim 1, characterized in that Said encapsulating all simulation entities in the simulation environment into independently running entity processes, and encapsulating the message manager module, the object manager module and the time manager module into independently running management processes, comprises: Assign a unique identifier to each simulation entity, and encapsulate each simulation entity into an independently running entity process through the process management tool according to the type and attributes of each simulation entity; By using the process management tool, the message manager module, the object manager module and the time manager module are respectively encapsulated into independently running management processes; Initialize each entity process and management process.

3. The method according to claim 2, characterized in that Initializing each entity process and management process includes: Set task priorities for each entity process and management process, and allocate initial computing cores to each entity process and management process; Setting the initial state of each entity process, including position, state, and behavior rules; For the management process corresponding to the message manager module, establish communication channels between various entity processes and set parameters of each communication channel; For the management process corresponding to the object manager module, load the relevant information of the simulation environment and configure a query interface, wherein the query interface is used to query the relevant information of the simulation environment stored in the object manager module; For the management process corresponding to the time manager module, an initial simulation time and an acceleration ratio are set, and the initial simulation time and the acceleration ratio are synchronized to all entity processes.

4. The method according to claim 2, characterized in that The dynamically adjusting the execution order and resource allocation of the entity processes and management processes on the overloaded computing core by the intelligent scheduling module includes: Determining the task urgency of each entity process and management process on the overloaded computing core based on the resource usage data and task priorities of the entity processes and management processes on the overloaded computing core; Through the intelligent scheduling module, a scheduling strategy based on a heuristic learning algorithm is used to adjust the execution order and resource allocation of the physical processes and management processes on the overloaded computing core according to the task urgency of each physical process and management process on the overloaded computing core. Among them, the process with a higher task urgency is adjusted to a higher execution order, resources are preferentially allocated to the process with a higher task urgency, and the process with a lower task urgency is allocated to an idle computing core for processing.

5. The method according to claim 4, characterized in that The method further comprises: Collecting scheduling policy samples, the scheduling policy samples including resource usage data of entity processes and management processes on each computing core, task completion progress, and adjusted execution efficiency; Evaluate the collected scheduling policy samples to determine the load of each computing core; Update the weight parameters of the heuristic learning algorithm based on the load of each computing core; The scheduling strategy based on the updated heuristic learning algorithm is fed back to the intelligent scheduling module.

6. The method according to claim 1, characterized in that After running the entity processes and the management process in parallel on their respective pre-allocated computing cores, the method further includes: Monitor the status of physical processes and management processes on each computing core and detect abnormal process status, including process crash, process timeout, resource exhaustion and communication interruption; When an abnormal process state is detected, the abnormal type, the identifier of the abnormal process and the resource information occupied by the abnormal process are reported to the intelligent scheduling module; The intelligent scheduling module determines the severity and impact range of the abnormal process state and classifies the abnormal process state into recoverable abnormality and unrecoverable abnormality; For the recoverable exception, the abnormal process state is restored to the most recent stable state; for the unrecoverable exception, whether to restart the affected process or isolate the abnormal process is determined based on the severity and impact scope of the abnormal process state.

7. The method according to claim 3, characterized in that The method of running the entity processes and the management process in parallel on their respective pre-allocated computing cores includes: Starting the entity process corresponding to each simulation entity in the simulation environment, and independently running each entity process on its own pre-assigned computing core based on the initial state of each entity process; Starting the management processes corresponding to the message manager module, the object manager module, and the time manager module, respectively, and independently running each management process on its own pre-assigned computing core; Based on zero-copy technology and message queues, messages between various entity processes and management processes are received and transmitted through communication channels between various entity processes; Dynamically update the relevant information of the simulation environment and record event logs; send the relevant information of the simulation environment to the entity process in response to an access instruction from the entity process through the query interface of the object manager module; Through the time manager module, a blocking-based virtual time alignment mechanism is used to synchronize time between different entity processes within a simulation step, where the simulation step is determined according to the initial simulation time and the speedup ratio.

8. The method according to claim 1, characterized in that The method further comprises: When the simulation is finished, the object manager module collects and summarizes all data generated during the simulation process, including the status data and event logs of each simulation entity, and the performance indicators of each entity process and management process.

9. A multi-core parallel simulation device, characterized in that: The device is used to perform the steps of the method according to any one of claims 1 to 8, comprising: A first determining module is used to determine all simulation entities in the simulation environment, wherein the simulation entities are independent simulation objects in the simulation environment; an encapsulation module for encapsulating all simulation entities in the simulation environment into independently running entity processes, and for encapsulating a message manager module, an object manager module, and a time manager module into independently running management processes, wherein the message manager module is used to receive and transmit instructions between the entity processes, the object manager module is used to store and manage relevant information of the simulation environment, and the time manager module is used to manage the simulation time of the simulation environment; The simulation operation module is used to run each entity process and management process in parallel on their pre-assigned computing cores, and monitor the resource usage data and task completion progress of the entity process and management process on each computing core through the intelligent scheduling module. The resource usage data includes CPU usage and memory occupancy; A second determining module is configured to determine an overloaded computing core based on resource usage data and task completion progress of the entity processes and management processes on each computing core; An adjustment module is used to dynamically adjust the execution order and resource allocation of the entity processes and management processes on the overloaded computing core through the intelligent scheduling module.

10. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the method according to any one of claims 1 to 8 when executed by the processor.

Citation Information

Patent Citations

  • Multi-core parallel simulation engine system supporting joint operations

    CN107193639A