Multi-machine simulation method, device and equipment based on network message and storage medium
By dividing the system into multiple parallel modules and synchronizing network messages across multiple simulation nodes, the problem of insufficient memory and computing power in large-scale systems is solved, thereby improving simulation speed and reducing memory consumption, and achieving scalability and compatibility.
Patent Information
- Application Number
- CN202410964527.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
As system scale increases, the insufficient memory resources and computing power of a single machine lead to simulation speed becoming a bottleneck. Existing technologies such as multi-process simulation and on-chip interconnect multi-core acceleration exhibit problems of increased memory consumption and extended simulation time in large-scale systems.
The system to be simulated is divided into multiple parallel modules, which are deployed on multiple simulation nodes and connected through a network message interface. A message synchronization mechanism is used to synchronize state information, and finally the simulation results of the entire system are formed. The simulation process is optimized by using a synchronization tree structure and a heartbeat synchronization algorithm.
It significantly improves simulation speed, reduces single-machine memory consumption, has scalability and compatibility, reduces debugging costs, and adapts to different system sizes and interconnection rules.
Smart Images

Figure CN118984279A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of system simulation, and in particular relates to a multi-machine simulation method, device, equipment and storage medium based on network messages. Background Art
[0002] As the semiconductor industry enters the post-Moore era, product chips compete in terms of integration scale and complexity. Therefore, the system design stage can effectively reduce the cost of tape-out and even determine the success or failure of the product. System simulation technology can help reduce risks in the design stage.
[0003] However, as the scale of the system continues to increase, simulation speed becomes a bottleneck. In order to improve the running speed of system simulation software, parallel solutions are usually adopted, such as multi-process simulation, on-chip interconnect multi-core acceleration and other technologies; however, as the scale of system simulation requirements continues to expand, these technologies have obvious shortcomings. Summary of the invention
[0004] The purpose of this application is to provide a multi-machine simulation method, device, equipment and storage medium based on network messages, aiming to use multi-machine simulation to solve the problems of insufficient memory resources and insufficient computing power of a single machine, improve the system simulation speed, and alleviate the speed bottleneck of large-scale system simulation.
[0005] According to a first aspect of the present application, a multi-machine simulation method based on network messages is provided, comprising:
[0006] The system to be simulated is divided into multiple parallel modules, and each parallel module is deployed to a corresponding simulation node to perform simulation, and multiple simulation nodes are connected through a network message interface;
[0007] When multiple simulation nodes are executing simulation simultaneously, the simulation status information of the multiple simulation nodes is synchronized through a message synchronization mechanism, and based on the simulation status information, the simulation results of all parallel modules are summarized until the simulation result of the entire system to be simulated is formed.
[0008] In an optional implementation manner, dividing the system to be simulated into a plurality of parallel modules further comprises:
[0009] When the system to be simulated includes multi-stage routers and multiple switches, the multi-stage routers are deployed to a first simulation node for simulation, and each switch and the network card connected thereto are deployed to an independent simulation node different from the first simulation node for simulation.
[0010] In an optional implementation manner, the synchronizing the simulation state information of the multiple simulation nodes further includes:
[0011] Form a synchronization tree structure according to multiple parallel modules;
[0012] In the current cycle, a heartbeat message is sent to the leaf node and the root node of the synchronization tree structure, blocking is performed, and heartbeat message feedback from the leaf node and the root node is received;
[0013] Repeat the above steps until the preset n cycles are reached.
[0014] According to a second aspect of the present application, a multi-machine simulation device based on network messages is provided, comprising:
[0015] A division unit is used to divide the system to be simulated into multiple parallel modules, and deploy each parallel module to a corresponding simulation node to perform simulation, and multiple simulation nodes are connected through a network message interface;
[0016] The synchronization unit is used to synchronize the simulation status information of multiple simulation nodes through a message synchronization mechanism during the process of multiple simulation nodes executing simulation simultaneously, and based on the simulation status information, summarize the simulation results of all parallel modules until the simulation result of the entire system to be simulated is formed.
[0017] A third aspect of the present application provides an electronic device, including a processor and a memory, wherein the memory stores a plurality of instructions, and the processor is used to read the instructions and execute the method of the first aspect.
[0018] A fourth aspect of the present application provides a computer-readable storage medium, which stores a plurality of instructions, and the plurality of instructions can be read by a processor to execute the method of the first aspect.
[0019] Compared with the related art, the technical solution of this application has the following advantages:
[0020] As the scale of the system increases, the acceleration effect of this solution becomes more obvious. The greater the acceleration, the less the single-machine memory consumption, thus reducing the single-machine memory consumption; the network message interface is widely used in the Internet field, the technology is mature, the data monitoring is convenient, and the debugging cost is reduced; it can be flexibly deployed or defined according to the system scale and interconnection rules; when adding new devices or modules, only the interconnection message channel needs to be added, which can be coordinated with the traditional single-machine parallel acceleration solution, and has scalability and compatibility.
[0021] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained through the structures and processes indicated in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. It is obvious that the drawings described below are certain embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 It is a schematic diagram of a system composed of multiple modules according to related technologies.
[0024] Figure 2 It is a flowchart of a multi-machine simulation method based on network messages according to an exemplary embodiment of the present application.
[0025] Figure 3 is a schematic diagram of a synchronization tree according to an exemplary embodiment of the present application.
[0026] Figure 4 It is a schematic diagram of a large-scale fat tree network according to an exemplary embodiment of the present application.
[0027] Figure 5 It is a schematic diagram of a networking division scheme according to an exemplary embodiment of the present application.
[0028] Figure 6 is based on Figure 4 Schematic diagram of the synchronization tree structure generated by the networking division.
[0029] Figure 7 It is a schematic diagram of a heartbeat synchronization process according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] The method provided in the present application can be implemented in the following terminal environment, and the terminal may include one or more of the following components: a processor, a memory, and a display screen. The memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method described in the following embodiments.
[0032] The processor may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire terminal, and executes various functions of the terminal and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory.
[0033] The memory may include random access memory (RAM) or read-only memory (ROM). The memory may be used to store instructions, programs, codes, code sets or instructions.
[0034] The display screen is used to display the user interface of each application.
[0035] In addition, those skilled in the art can understand that the structure of the above terminal does not constitute a limitation on the terminal, and the terminal may include more or fewer components, or combine certain components, or arrange the components differently. For example, the terminal also includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, and a power supply, which will not be described in detail here.
[0036] Network message interfaces are widely used in the Internet field. As the scale of system simulation requirements continues to expand, technologies such as multi-process simulation and on-chip interconnect multi-core acceleration have obvious shortcomings: on the one hand, as the scale of simulation increases, the memory resources consumed increase proportionally, which may cause the memory demand of the simulation software to exceed the memory capacity of a single machine, making the simulation impossible; on the other hand, due to the limited computing power of the machine, the time required for the same simulation time increases proportionally with the expansion of the simulation scale, making it impossible to output the simulation results in a timely manner.
[0037] like Figure 1 As shown in the figure, assume that a system consists of three modules, namely Module A, Module B, and Module C. For the sake of description, assume that the memory requirement of each module is M and the simulation time consumed by each module is T. According to the traditional solution, the total memory consumed by the simulation is 3×M and the total simulation time consumed is 3×T, which is also the memory required and time consumed for stand-alone simulation.
[0038] This solution deploys the three modules to three different computing nodes and runs them simultaneously, and realizes interconnection and communication through the network message interface. With this solution, the simulation time of each computing node is T, and the memory resources consumed are M. The simulation completion time is reduced to 1 / 3 of the original time, and the resource consumption of each computing node is also reduced to 1 / 3 of the original time.
[0039] Based on the above analysis, in order to solve the problems existing in the related technology, see Figure 2The multi-machine simulation method based on network messages provided in the specific implementation manner of the present application includes:
[0040] Step 201: Divide the system to be simulated into multiple parallel modules, and deploy each parallel module to a corresponding simulation node to perform simulation. Multiple simulation nodes are connected via a network message interface.
[0041] for Figure 1 The small-scale system shown in the figure establishes a synchronous data structure such as Figure 3 As shown. Figure 4 The large-scale system based on the fat-tree networking structure shown above first needs to be divided into parallel modules.
[0042] In an optional embodiment, the partitioning rule may be a partitioning scheme that minimizes the variance of the execution time of each partition or minimizes the total number of connections between partitions. To simplify the description, it is assumed that the router, switch, and network card have the same operating speed. The following partitioning rule is used.
[0043] Package the L3 router and L2 router and deploy them on node 1. Package each L1 switch and the network card connected to the switch and deploy them on node 2. Since there are x L1 switches, deploy x L1 switches and the connected network cards on x nodes. The nodes communicate with each other through the network message interface.
[0044] The excitation module runs faster and its execution time can be ignored. Figure 5 The network division diagram shown in the figure, the generated synchronization tree structure is as follows Figure 6 shown.
[0045] Step 202: When multiple simulation nodes are executing simulation simultaneously, the simulation status information of the multiple simulation nodes is synchronized through a message synchronization mechanism, and the simulation results of all parallel modules are aggregated to form the simulation result of the system to be simulated.
[0046] The core of this solution is to realize multi-machine collaborative simulation, that is, message synchronization. This synchronization algorithm is also called the heartbeat synchronization algorithm. The actual simulation system topology is not necessarily a tree structure. Figure 1 If we remove one of the edges of the ring, we can convert it into Figure 3 The tree structure shown. Figure 3 The schematic diagram of the inter-module synchronization process of the architecture shown is as follows Figure 7 All nodes execute the same synchronization algorithm, and only the root node and leaf nodes need to be synchronized.
[0047] Exemplarily, the simulation status information may include simulation time, data to be input, and data to be output, wherein the simulation time is broadcast to each simulation node to achieve time synchronization, the data to be input is taken out from the message interface, and the data to be output is placed in the message interface cache to achieve data synchronization.
[0048] Specifically, a synchronization tree structure is formed according to a plurality of parallel modules. In the current cycle, a heartbeat message is sent to the leaf node and the root node of the synchronization tree structure, blocking is performed, and heartbeat message feedback from the leaf node and the root node is received. The above steps are repeated until a preset n cycles are reached.
[0049] Table 1 shows the statistics of single-machine simulation. For the sake of comparison, it is assumed that the simulation time of all devices is the same, and the total simulation time is linearly related to the number of devices:
[0050] T single =m+n+(x+1)*y;
[0051] Table 1
[0052]
[0053] Table 2
[0054]
[0055] Table 2 shows the statistics of multi-machine simulation. As shown in Table 2, the simulation time is related to the node allocation. The total simulation time T multi Depends on the node with the largest simulation time:
[0056] T multi =max(m+n,1+y)
[0057] From the simulation time point of view, the simulation speed improvement efficiency is:
[0058] The reduction factor of memory consumption of a single node can also be calculated according to the above principle, that is, the memory consumption is:
[0059] Among them, M multi is the memory consumed by a single node during simulation; M single It is the memory consumption during stand-alone simulation.
[0060] According to the test results of an actual networking model, the actual simulation speed was increased by 37 times.
[0061] It can be seen that the multi-machine simulation method based on network messages in the specific implementation of the present application has the following advantages compared with the related technologies:
[0062] As the scale of the system increases, the acceleration effect of this solution becomes more obvious. The greater the acceleration, the less the single-machine memory consumption, thus reducing the single-machine memory consumption; the network message interface is widely used in the Internet field, the technology is mature, the data monitoring is convenient, and the debugging cost is reduced; it can be flexibly deployed or defined according to the system scale and interconnection rules; when adding new devices or modules, only the interconnection message channel needs to be added, which can be coordinated with the traditional single-machine parallel acceleration solution, and has scalability and compatibility.
[0063] Accordingly, the present application provides a multi-machine simulation device based on network messages in a second aspect, comprising:
[0064] A division unit is used to divide the system to be simulated into multiple parallel modules, and deploy each parallel module to a corresponding simulation node to perform simulation, and multiple simulation nodes are connected through a network message interface;
[0065] The synchronization unit is used to synchronize the simulation status information of multiple simulation nodes through a message synchronization mechanism during the process of multiple simulation nodes executing simulation simultaneously, and based on the simulation status information, summarize the simulation results of all parallel modules until the simulation result of the entire system to be simulated is formed.
[0066] The above-mentioned device can be implemented by the multi-machine simulation method based on network messages provided by the embodiment of the first aspect above. The specific implementation method can be found in the description of the embodiment of the first aspect, which will not be repeated here.
[0067] It is understood that the structures, names and parameters described in the above embodiments are only examples. Those skilled in the art can also easily think of combinations and adjustments to the structural features of the above embodiments according to the use requirements, and should not limit the concept of the present application to the specific details of the above examples.
[0068] The present application also provides an electronic device, including a processor and a memory, wherein the memory stores a plurality of instructions, and the processor is used to read the instructions and execute any one of the methods in the aforementioned first aspect. The processor and the memory may be connected via a bus or in other ways, taking the bus connection as an example. The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components and other chips, or a combination of the above-mentioned various types of chips.
[0069] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method in the embodiment of the present application. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiment.
[0070] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0071] The present application also provides an electronic device, comprising a processor and a memory connected to the processor, wherein the memory stores a plurality of instructions, and the instructions can be loaded and executed by the processor, so that the processor can perform any one of the methods in the first aspect described above. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0072] Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that he or she may still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A multi-machine simulation method based on network messages, characterized in that: include: The system to be simulated is divided into multiple parallel modules, and each parallel module is deployed to a corresponding simulation node to perform simulation, and multiple simulation nodes are connected through a network message interface; When multiple simulation nodes are executing simulation simultaneously, the simulation status information of the multiple simulation nodes is synchronized through a message synchronization mechanism, and based on the simulation status information, the simulation results of all parallel modules are summarized until the simulation result of the entire system to be simulated is formed.
2. The multi-machine simulation method based on network messages according to claim 1 is characterized in that: The step of dividing the system to be simulated into a plurality of parallel modules further comprises: When the system to be simulated includes multi-stage routers and multiple switches, the multi-stage routers are deployed to a first simulation node for simulation, and each switch and the network card connected thereto are deployed to an independent simulation node different from the first simulation node for simulation.
3. The multi-machine simulation method based on network messages according to claim 1 is characterized in that: The step of synchronizing the simulation status information of the plurality of simulation nodes further comprises: Form a synchronization tree structure according to multiple parallel modules; In the current cycle, a heartbeat message is sent to the leaf node and the root node of the synchronization tree structure, blocking is performed, and heartbeat message feedback from the leaf node and the root node is received; Repeat the above steps until the preset n cycles are reached.
4. The multi-machine simulation method based on network messages according to claim 1 is characterized in that: The simulation state information includes simulation time, data to be input, and data to be output, and synchronizing the simulation state information further includes: The simulation time is broadcast to each simulation node to achieve time synchronization, the data to be input is taken out from the message interface, and the data to be output is put into the message interface cache to achieve data synchronization.
5. A multi-machine simulation device based on network messages, characterized in that: include: A division unit is used to divide the system to be simulated into multiple parallel modules, and deploy each parallel module to a corresponding simulation node to perform simulation, and multiple simulation nodes are connected through a network message interface; The synchronization unit is used to synchronize the simulation status information of multiple simulation nodes through a message synchronization mechanism during the process of multiple simulation nodes executing simulation simultaneously, and based on the simulation status information, summarize the simulation results of all parallel modules until the simulation result of the entire system to be simulated is formed.
6. The multi-machine simulation device based on network messages according to claim 5 is characterized in that: The division unit is further used for: When the system to be simulated includes multi-stage routers and multiple switches, the multi-stage routers are deployed to a first simulation node for simulation, and each switch and the network card connected thereto are deployed to an independent simulation node different from the first simulation node for simulation.
7. The multi-machine simulation device based on network messages according to claim 5 is characterized in that: The synchronization unit is further used for: Form a synchronization tree structure according to multiple parallel modules; In the current cycle, a heartbeat message is sent to the leaf node and the root node of the synchronization tree structure, blocking is performed, and heartbeat message feedback from the leaf node and the root node is received; Repeat the above steps until the preset n cycles are reached.
8. The multi-machine simulation device based on network messages according to claim 5, characterized in that: The simulation state information includes simulation time, data to be input, and data to be output, and the simulation state information is synchronized, and the synchronization unit is further used to: The simulation time is broadcast to each simulation node to achieve time synchronization, the data to be input is taken out from the message interface, and the data to be output is put into the message interface cache to achieve data synchronization.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the processor is used to read the instructions and execute the multi-machine simulation method based on network messages as claimed in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the plurality of instructions can be read by a processor and executed by the multi-machine simulation method based on network messages as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method for realizing distributed simulation synchronization
CN102201907A
Parallel simulation data processing method based on tree communication structure
CN105955710A
Multi-branch parallel simulation method
CN111008065A
Simulation system control method and device, equipment and storage medium
CN112764356A
Entity network distributed physical simulation method and device, equipment and storage medium
CN115809530A
