Simulation system construction method and device, computer equipment and storage medium

By encapsulating the basic units of large-scale complex systems into multiple local service providers and managing and scheduling them on different processors, the problem of excessive host machine load is solved, achieving more efficient simulation system performance and scalability.

CN120892136APending Publication Date: 2025-11-04JIANGNAN INST OF COMPUTING TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510988268.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-17
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

In the parallel simulation of large-scale complex systems, traditional techniques increase the load on the host machine, which limits the scalability and performance of the operating system simulation.

Method used

The basic unit of the system to be simulated is encapsulated into multiple local service providers. Each local service provider runs on a different processor and manages and schedules the entity using a preset operating mechanism and communication mechanism. Communication messages are transmitted by constructing a transmission channel.

Benefits of technology

This reduces frequent context switching at the operating system level, lowers the scheduling burden, and improves the overall performance and scalability of the simulation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892136A_ABST
    Figure CN120892136A_ABST
Patent Text Reader

Abstract

The invention relates to a simulation system construction method and device, computer equipment and a storage medium. The method comprises the steps that entities corresponding to all basic units in a to-be-simulated system are created, and all the entities are packaged into a plurality of different local servers; the local servers run in different processors; and controlling each local server to operate each entity by adopting a preset operation mechanism, and simulating the operation of the to-be-simulated system. By adopting the method, frequent context switching of a large number of entities at the operating system level can be reduced, the scheduling burden of the operating system is reduced, and the expandability and the resource utilization rate of the simulation system are enhanced, so that the overall performance of the simulation system is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a simulation system construction method and device, computer equipment and storage medium. BACKGROUND

[0002] For a large-scale complex system, such as a wafer-level chip, a large number of prefabricated components can be integrated on the wafer-level chip, such as computing cores, storage modules, routing components, etc. The simulation of the large-scale complex system actually provides a parallel simulation environment for the large-scale system-level simulation and accelerates the simulation process.

[0003] In the prior art, the parallel simulation of each simulation object in the system is mainly to create each simulation object as a process or a thread on a host computer, and to manage and schedule each simulation object as a user-level thread.

[0004] However, the prior art may aggravate the load of the host computer and restrict the scalability and performance of the simulation scale of the operating system. SUMMARY

[0005] Therefore, it is necessary to provide a simulation system construction method, device, computer equipment and storage medium capable of guaranteeing the overall performance of the simulation system to solve the above technical problems.

[0006] In a first aspect, the present application provides a simulation system construction method, comprising:

[0007] creating entities corresponding to each basic unit in a to-be-simulated system, and encapsulating each entity into a plurality of different local service providers; each local service provider runs on a different processor;

[0008] controlling each local service provider to run each entity using a preset running mechanism to simulate the running of the to-be-simulated system.

[0009] In one embodiment, controlling each local service provider to run each entity using a preset running mechanism comprises:

[0010] controlling each local service provider to schedule each entity using a preset scheduling manner;

[0011] controlling each local service provider to transmit communication messages between each entity using a preset communication mechanism.

[0012] In one embodiment, controlling each local service provider to transmit communication messages between each entity using a preset communication mechanism comprises:

[0013] controlling each local service provider to transmit communication messages between each entity using a preset communication mechanism based on a plurality of transmission channels of each entity constructed in advance.

[0014] In one of the embodiments, the method further comprises:

[0015] In the case that each local service is single-threaded, the method further comprises:

[0016] In the case that each local service is multi-threaded, the method further comprises:

[0017] In one of the embodiments, the method further comprises:

[0018] Creating a communication port for each entity;

[0019] Based on the communication information between each basic unit, constructing multiple transmission channels for each entity.

[0020] In one of the embodiments, the method further comprises:

[0021] For each entity, obtaining the communication message in the transmission channel of the entity; the communication message comprises the label information of the receiving entity;

[0022] When the label information indicates that the local service where the receiving entity is located is the same as the local service where the entity is located, copying the communication message to the transmission channel corresponding to the receiving entity;

[0023] When the label information indicates that the local service where the receiving entity is located is different from the local service where the entity is located, encapsulating the communication message based on the communication protocol, and transmitting the encapsulated communication message to the transmission channel corresponding to the receiving entity through the physical network between the local service where the receiving entity is located and the local service where the entity is located.

[0024] In a second aspect, the application further provides a simulation system construction device, comprising:

[0025] An encapsulation module is configured to create entities corresponding to each basic unit in a to-be-simulated system, and encapsulate each entity into a plurality of different local services; each local service runs on a different processor;

[0026] A simulation module is configured to control each local service to adopt a preset running mechanism to run each entity, and simulate the running of the to-be-simulated system.

[0027] In a third aspect, the application further provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0028] create entities corresponding to each basic unit in the system to be simulated, and encapsulate each entity into a plurality of different local service providers; each local service provider runs on a different processor;

[0029] control each local service provider to run each entity using a preset running mechanism, and simulate the running of the system to be simulated.

[0030] In a fourth aspect, the present application also provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the following steps:

[0031] create entities corresponding to each basic unit in the system to be simulated, and encapsulate each entity into a plurality of different local service providers; each local service provider runs on a different processor;

[0032] control each local service provider to run each entity using a preset running mechanism, and simulate the running of the system to be simulated.

[0033] In a fifth aspect, the present application also provides a computer program product comprising a computer program, the computer program being executed by a processor to implement the following steps:

[0034] create entities corresponding to each basic unit in the system to be simulated, and encapsulate each entity into a plurality of different local service providers; each local service provider runs on a different processor;

[0035] control each local service provider to run each entity using a preset running mechanism, and simulate the running of the system to be simulated.

[0036] The simulation system construction method, device, computer device and storage medium described above create entities corresponding to each basic unit in the system to be simulated, and encapsulate each entity into a plurality of different local service providers; each local service provider runs on a different processor; and control each local service provider to run each entity using a preset running mechanism, and simulate the running of the system to be simulated. In this method, the local service provider is taken as a management unit and runs on the processor of the host computer to manage the corresponding entity, which can reduce the frequent context switching of the operating system layer for a large number of entities, reduce the scheduling burden of the operating system, and thus improve the overall performance of the simulation system. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiment or related art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0038] Figure 1 application environment diagram of the simulation system construction method in one embodiment;

[0039] Figure 2 flowchart of the simulation system construction method in one embodiment;

[0040] Figure 3 structure block diagram of the simulation system construction in one embodiment;

[0041] Figure 4 flowchart of running each entity by using preset running mechanism in one embodiment;

[0042] Figure 5 flowchart of scheduling each entity by using preset scheduling mode in one embodiment;

[0043] Figure 6 flowchart of constructing multiple transmission channels of each entity in one embodiment;

[0044] Figure 7 flowchart of transmitting communication messages between each entity in one embodiment;

[0045] Figure 8 structure block diagram of the simulation system construction apparatus in one embodiment;

[0046] Figure 9 internal structure diagram of the computer device in one embodiment. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not used to limit the present application.

[0048] The simulation system construction method provided by the embodiments of the present application can be applied to, for example, Figure 1The application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data required by the server 104 to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The terminal 102 sends a simulation system construction request carrying the system information to be simulated to the server 104, and the server 104 receives the simulation system construction request, and creates entities corresponding to each basic unit in the system to be simulated based on the system information to be simulated, and encapsulates each entity into a plurality of different local service providers; Each local service provider runs on a different processor; Control each local service provider to run each entity using a preset running mechanism to simulate the operation of the system to be simulated. Among them, the terminal 102 can be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers and the like. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0049] In an exemplary embodiment, as shown in Figure 2 , a simulation system construction method is provided, which is applied to the server in Figure 1 for example, including the following steps 202 to 204. Among them:

[0050] Step 202, create entities corresponding to each basic unit in the system to be simulated, and encapsulate each entity into a plurality of different local service providers; Each local service provider runs on a different processor.

[0051] Among them, the system to be simulated refers to the target system that needs to be simulated by computer simulation technology, which includes but is not limited to vehicle control system, urban traffic system, integrated circuit, communication network, distributed computing platform and wafer level chip, etc. The basic unit refers to the smallest functional unit or component unit constituting the system to be simulated. In different types of systems to be simulated, the specific form of the basic unit may be different, for example, in the process of simulating the wafer level chip system, the basic unit can be a computing core, a storage unit, a routing module, etc. The entity is an encapsulated body for encapsulating the basic unit in the system to be simulated in the simulation system. The local service provider is a management unit for managing and scheduling a plurality of entities in the simulation system, which is mapped to the basic running unit of the physical processor. Specifically, the local service provider runs in the form of an operating system process, and further, each local service provider can run in parallel on multiple processors or in multiple processes of an operating system.

[0052] Exemplarily, according to the system information to be simulated, each basic unit in the system to be simulated is identified, and an entity corresponding to each basic unit is created, which is used to encapsulate the state information and behavior logic of the corresponding basic unit. Please refer to Figure 3 , Figure 3 A structural block diagram of the simulation system is constructed, and a plurality of entities are divided and encapsulated into a plurality of different local service providers, which are responsible for managing and scheduling operations of the managed entities. In this embodiment, the local service provider is taken as a management unit, which runs on the processor of the host computer to manage the corresponding entities, and can control the local service provider to provide better scalability for the running of the managed entities by using the multi-thread mechanism of the processor.

[0053] Alternatively, the global service provider can also be controlled to centrally manage each local service provider, and the global service provider runs in the form of an operating system process. In a feasible embodiment, the global service provider can be controlled to centrally collect and manage the simulation information of the local service providers, including the number of local service providers, IP nodes running on the local service providers, and the like. In the communication process between the local service providers, the local service providers can query the simulation information collected by the global service provider to obtain the communication address (such as the IP node information) of the local service provider to be transmitted; alternatively, in order to reduce the system bottleneck caused by frequent centralized queries, each local service provider can also be controlled to locally cache the commonly used communication address of the local service provider to be transmitted, so that in the subsequent communication process of the local service provider, the local cache is preferentially used for fast resolution, thereby reducing the access pressure of the local service provider to the global service provider and improving the communication efficiency between the local service providers and the overall performance and scalability of the simulation system.

[0054] In a feasible embodiment, each basic unit to be simulated is obtained, and each basic unit is grouped according to the communication situation of each basic unit, such as grouping the frequently communicating basic units into the same basic unit group, to obtain a plurality of basic unit groups; for each basic unit group, the basic unit group is mapped to a corresponding local service provider, and the basic units of the basic unit group are encapsulated into the entities of the local service provider. Alternatively, for each functional node in the target system, the functional node can be mapped to a local service provider, and a plurality of functional units in the functional node can be encapsulated into the entities of the local service provider, wherein each functional node contains a plurality of functionally closely related functional units. In this embodiment, the frequently communicating entities are encapsulated into the same local service provider, which helps to reduce the communication overhead across processes or across processors, thereby improving the overall execution efficiency and running performance of the simulation system.

[0055] In step 204, each local service provider is controlled to run each entity by using a preset running mechanism to simulate the running of the system to be simulated.

[0056] The running mechanism includes a scheduling manner and a communication mechanism, and is used to guide the local service to schedule and run the managed entity.

[0057] For example, the control is performed on each local service to schedule and run the entity managed thereby according to a preset running mechanism, so as to simulate the running process of a target system, that is, the system to be simulated. The running mechanism can include a scheduling manner, a communication mechanism, a state synchronization mechanism, and the like. In this embodiment, the running of the entity is scheduled by each local service according to the preset running mechanism, so that the actual running state and dynamic interaction process of the target system in terms of task scheduling, resource allocation, module communication, and the like can be restored in the simulation system, thereby achieving the function verification and performance evaluation of the target system, and improving the controllability and observability of the complex behavior of the target system. In this embodiment, by controlling the local service running on the host processor, the local service can digest the communication overhead between the internal entities thereof based on the preset running mechanism, so as to achieve higher performance simulation.

[0058] In the simulation system construction method described above, a plurality of basic units corresponding to the system to be simulated are encapsulated as entities, and a local service is responsible for centralized management and scheduling of the entities. Preferably, only one local service runs on each processor, so that the processor resources can be fully utilized, and the scheduling overhead caused by the sharing of the same processor by a plurality of local services can be reduced. Each local service schedules and runs a plurality of entities managed thereby according to a preset running mechanism. Compared with the situation in the prior art that each entity (basic unit) is created as a process or a thread on a host, and then each simulation object is directly scheduled by an operating system, thereby intensifying the load of the host and restricting the scalability of the simulation scale of the operating system, the frequent context switching of the operating system to a large number of entities can be reduced, the scheduling burden of the operating system can be reduced, the scalability and resource utilization of the simulation system can be enhanced, and thus the overall performance of the simulation system can be significantly improved.

[0059] In one example embodiment, as shown in FIG. 4, the control is performed on each local service to run each entity according to a preset running mechanism, including steps 402 to 404. In this embodiment, the control is performed on each local service to schedule and run each entity according to a preset running mechanism. Figure 4

[0060] In step 402, the control is performed on each local service to schedule each entity according to a preset scheduling manner.

[0061] The control is performed on each local service to effectively schedule and run a plurality of entities managed thereby according to a preset scheduling manner.

[0062] ​Exemplarily, in the simulation of a large-scale complex target system, there are a large number of entities, and each local service is responsible for managing and scheduling a plurality of entities under its jurisdiction. For each local service, the control of the local service acquires the basic state information of the entities managed by the local service, the basic state information including the ID number (unique identifier) of the entity, the working state including the states of start, run, pause and end; the control of the local service records the basic state information of each entity through a specific data structure, and organizes the entities into an entity queue based on the basic state information of each entity. Optionally, the entities in the local service have no priority distinction, that is, the local service can adopt a preset simple scheduling manner, such as a serial scheduling manner, to cyclically schedule each entity in the entity queue for running.

[0063] In step 404, the control controls each local service to adopt a preset communication mechanism to transmit the communication messages between the entities.

[0064] Exemplarily, the control controls each local service to adopt a preset communication mechanism to transmit the communication messages between the entities managed by the local service. In the simulation system, each entity communicates with each other by sending and receiving messages, but since the entity is only an object in the local service, it cannot directly communicate, and therefore must rely on the local service to which it belongs to forward the message. In a feasible embodiment, the local service is internally provided with a sending message queue and a receiving message queue for buffering the messages to be sent and received by the entities belonging to the local service, so as to ensure the orderly transmission and timely processing of the messages. In this embodiment, the control controls the local service to forward the messages for the entities in the local service, specifically, buffers the communication messages to be sent and received by the entities in the local service in the local service; since the local service can manage a plurality of entities, the local service can share a sending message queue and a receiving message queue for all the entities in the local service in a shared manner, thereby effectively reducing the resource occupation and overhead of the simulation system and improving the efficiency of the simulation system.

[0065] In addition, the local service is not only responsible for forwarding the messages between the entities managed by the local service, but also can transmit the messages to be sent by the entities to other local services through a physical network, that is, supports the communication between the entities across the local services.

[0066] In the embodiment, the local service providers are controlled to adopt the preset scheduling mode, so that the entities under the jurisdiction can be efficiently managed, the process of entity scheduling is simplified, and the scheduling bottleneck is avoided. Meanwhile, the preset communication mechanism is adopted, so that the local service providers can reliably forward the entity messages within the local service providers and across the local service providers. Specifically, for each local service provider, the communication overhead between the entities within the local service provider can be digested based on the preset communication mechanism, so that only the communication messages between the entities across the local service providers are sent out of the local service provider, the communication overhead across processes or across processors is significantly reduced, and higher performance simulation is achieved.

[0067] In an exemplary embodiment, the local service providers are controlled to adopt the preset communication mechanism to transmit the communication messages between the entities, including: controlling the local service providers to adopt the preset communication mechanism to transmit the communication messages between the entities based on the plurality of transmission channels of the entities which are constructed in advance.

[0068] According to the preset communication mechanism, the local service providers are controlled to complete the information interaction between the entities based on the plurality of transmission channels between the entities which are constructed in advance. Specifically, the local service providers establish transmission channels between the entities, and the transmission channels include input channels and output channels for identifying the direction and corresponding relationship of the communication message transmission.

[0069] In a feasible embodiment, the transmission channels include input channels and output channels, and each entity is provided with an input port and an output port for receiving or sending the communication messages. According to the system information to be simulated, the communication relationship between the entities (basic units) is determined, and the transmission channels are constructed between each pair of entities having the communication relationship. The transmission channels can be used to store the communication messages, and the communication messages include but are not limited to the message content, the message type, the input end entity ID, the output end entity ID, and the corresponding message arrival time. The accuracy of the message transmission can be ensured, and the efficiency of the message transmission can be improved. For example, if it is determined according to the system information to be simulated that there is a communication relationship between entity 1 and entity 2, and entity 1 can send and receive communication messages to entity 2, then the input channel a and the output channel b from entity 1 to entity 2 are established between entity 1 and entity 2. If entity 1 is only used to send messages to entity 2, then the output channel b from entity 1 to entity 2 is established between entity 1 and entity 2.

[0070] In another possible embodiment, for each entity, the entity is provided with only one input channel and one output channel for communication with the local service, the entity can put the communication message to be transmitted into the corresponding output channel, the transmission channel can be used to store the communication message, and the communication message includes but is not limited to message content, message type, input entity ID, output entity ID (ID of the receiving entity), and corresponding message arrival time; the control local service acquires the communication message in the output channel of the entity, and controls the local service to put the communication message in the output channel of the entity into the input channel of the output entity based on the corresponding input entity ID in the communication message.

[0071] In this embodiment, the transmission channel between entities is constructed in advance, so that the communication path is fixed in the simulation process, the overhead caused by dynamic lookup of the communication target at runtime is avoided, the efficiency of message transmission is improved, and the communication delay across processes or across processors is reduced, and the overall communication efficiency is improved.

[0072] In one example embodiment, as shown in Figure 5 The step 402 includes the following steps:

[0073] Step 502, when each local service is single-threaded scheduling, controlling each local service to enumerate and schedule each entity in a preset scheduling manner.

[0074] For example, the single-threaded scheduling of the local service can be understood as that the local service only supports scheduling the entities managed by the local service in a single-threaded manner. Specifically, when the simulation system advances to the next unit time, the control local service enumerates each entity in the local service (i.e., traverses the entity queue in the local service), and determines whether the entity enumerated by the local service is in a ready state based on the basic state information of the entity; if the entity enumerated by the local service is not in the ready state, the control local service continues to enumerate the next entity until the local service enumerates an entity in the ready state; if the entity enumerated by the local service is in the ready state, the control local service immediately schedules the entity to execute the corresponding running logic.

[0075] Step 504, when each local service is multi-threaded scheduling, enumerating and scheduling each entity, and mapping the enumerated entity to an idle thread in the multi-threaded.

[0076] The local service can understand multi-thread scheduling as supporting scheduling of the entities managed thereby in a multi-thread mode. The control local service enumerates the plurality of entities managed thereby and maps an entity in a ready state to an idle thread in the plurality of threads contained in the local service. Optionally, the local service also functions as a management unit running in the form of an operating system process. In an environment supporting thread creation, a thread can be dynamically assigned to an entity in a ready state according to the multi-thread capability of the processor.

[0077] Exemplarily, when the simulation system advances to the next unit of time, the control local service enumerates each entity in the local service and determines whether the entity is in a ready state based on the basic state information of the entity in the local service. If the entity enumerated by the control local service is determined to be not in a ready state, the control local service continues to enumerate the next entity until an entity in a ready state is enumerated. If the entity enumerated by the control local service is in a ready state, the control local service starts a new thread and maps the entity in a ready state to the thread, or maps the entity in a ready state to an idle thread in the plurality of threads, and then schedules the entity to execute corresponding running logic. For example, in an environment of a processor supporting multi-threading, if the control local service currently has 10 entities in a management range, and entity 1 and entity 3 are in a ready state, the control local service can be controlled to assign thread 1 and thread 2 to entity 1 and entity 3, respectively, to achieve parallel running and improve the overall simulation efficiency. It should be noted that although the entities in a ready state are mapped to different threads for execution in parallel, the entity enumeration process itself is still in a serial mode, that is, the local service is still serially scheduled, and therefore the purpose of running entities in parallel in the local service is to improve the running speed of the entities, rather than to achieve complex interactions between the plurality of threads.

[0078] In this embodiment, a single-thread scheduling mechanism is adopted, which can significantly simplify the scheduling control logic of the local service, avoid complex problems such as synchronization conflicts, competition for resources, and state consistency caused by multi-threading, and thus improve the stability and reliability of the simulation system. By using multi-thread scheduling, the entities in a ready state are mapped to a plurality of idle threads in the process to which the local service belongs for running, which can fully utilize the multi-core parallel processing capability provided by the host computer and improve the scalability and simulation efficiency of the simulation system.

[0079] In one exemplary embodiment, as shown in FIG. 6, Figure 6 the method further includes steps 602 to 604,

[0080] Step 602: Create a communication port for each entity.

[0081] Communication ports include input ports and output ports, used to enable information exchange between entities. Optionally, the communication relationships between entities (basic units) can be determined based on the information of the system to be simulated; based on the communication relationships between entities, a transmission channel between entities can be constructed according to the input ports and output ports of each entity.

[0082] Step 604: Based on the communication information between each basic unit, construct multiple transmission channels for each entity.

[0083] Communication information between basic units can be understood as the logical connection relationship or data interaction requirements between the basic units, or as the communication relationship between the basic units. For example, based on the logical connection relationship or data interaction requirements between the basic units in the system to be simulated, the communication relationship between the corresponding entities is determined; at least one transmission channel is constructed between each pair of entities with a communication relationship, and each transmission channel is associated with an output port and an input port, and the transmission channel is used to store communication messages.

[0084] In this embodiment, by creating communication ports for each entity and constructing corresponding transmission channels based on the communication information between basic units, the communication path in the simulation system is structured, which can improve the controllability and predictability of communication between entities, and also avoid the uncertainty and overhead caused by dynamic matching of communication targets at runtime, ensuring the communication efficiency between entities, thereby improving the stability and communication efficiency of the simulation system in a high-concurrency environment.

[0085] In one exemplary embodiment, such as Figure 7 As shown, each local service provider is controlled to use a preset communication mechanism to transmit communication messages between entities based on multiple pre-built transmission channels for each entity, including steps 702 to 706, wherein:

[0086] Step 702: For each entity, obtain the communication message in the entity's transmission channel; the communication message includes the tag information of the receiving entity.

[0087] Optionally, the transmission channel includes an input channel and an output channel; when the simulation system is advanced to the next unit time, for each local service provider, the local service provider is controlled to enumerate each entity in its interior, and when an entity in a ready state is enumerated, the local service provider is controlled to enumerate whether there is a communication message in the output channel of the entity in the ready state, and if there is a communication message, the communication message is forwarded to the corresponding receiving entity based on the tag information of the receiving entity carried in the communication message. Optionally, an entity can correspond to multiple output channels to respectively point to other entities, or only one output channel can be provided for pointing to the local service provider to which it belongs. The specific setting mode of the above output channel can be flexibly configured according to the communication demand of the system to be simulated, and the related content has been described in detail in the foregoing content, which will not be described here.

[0088] Step 704, when the tag information represents that the local service provider where the receiving entity is located is the local service provider where the entity is located, the communication message is copied into the transmission channel corresponding to the receiving entity.

[0089] When the local service provider is controlled to enumerate an entity in a ready state, and the output channel of the entity has a communication message, based on the tag information of the receiving entity carried in the communication message, it is judged whether the receiving entity is in the interior of the local service provider; if it is judged that the receiving entity is in the interior of the local service provider (i.e. the local service provider where the receiving entity is located is the local service provider where the entity is located), the local service provider is controlled to copy the communication message to the input channel corresponding to the receiving entity. The copying process can be completed by using the memory level copying mode, avoiding the transmission delay and synchronization overhead introduced by cross-process or physical network communication.

[0090] Step 706, when the tag information represents that the local service provider where the receiving entity is located is different from the local service provider where the entity is located, the communication message information is encapsulated based on the communication protocol, and the encapsulated communication message is transmitted to the transmission channel corresponding to the receiving entity through the physical network between the local service provider where the receiving entity is located and the local service provider where the entity is located.

[0091] If it is judged that the receiving entity is not in the local service provider (i.e. the local service provider where the receiving entity is located is different from the local service provider where the entity is located), the communication message needs to be transmitted between the local service providers. The local service provider is controlled to encapsulate the communication message based on a preset communication protocol, and the local service provider is controlled to send the encapsulated communication message to the local service provider where the receiving entity is located. The local service provider where the receiving entity is located is controlled to receive the communication message, and the local service provider where the receiving entity is located is controlled to accurately deliver the communication message to the input channel corresponding to the receiving entity according to the input entity ID in the communication message. In this embodiment, the standardized communication protocol and the network message encapsulation mechanism between the local service providers are adopted to ensure the reliable transmission of the communication message between the physical nodes and improve the communication reliability of the simulation system.

[0092] In this embodiment, the label information of the receiving entity included in the communication message is used to distinguish the communication path, and the message transmission between the same local service provider and multiple local service providers is realized. When the entities of the communication parties are located in the same local service provider, the local service provider is directly controlled to copy the communication message to the transmission channel of the receiving entity, so as to effectively reduce the communication overhead. When the entities of the communication parties belong to different local service providers, the local service provider is controlled to encapsulate the communication message based on a preset communication protocol, and the message transmission is completed through the physical network between the local service providers, so as to ensure the reliability and accuracy of the communication.

[0093] It should be understood that, although each step in the flowchart involved in the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.

[0094] Based on the same inventive concept, the present application also provides a simulation system construction device for implementing the simulation system construction method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more simulation system construction device embodiments provided below can refer to the limitations of the simulation system construction method described above, which will not be repeated here.

[0095] In one exemplary embodiment, as Figure 8As shown, an analog system construction apparatus is provided, comprising: a packaging module 802 and an analog module 804, wherein:

[0096] The packaging module 802 is configured to create entities corresponding to each basic unit in the system to be simulated, and to package each entity into a plurality of different local service providers respectively; each local service provider runs on a different processor;

[0097] The analog module 804 is configured to control each local service provider to run each entity using a preset running mechanism, and to simulate the running of the system to be simulated.

[0098] In an exemplary embodiment, the analog module 804 is further configured to control each local service provider to schedule each entity using a preset scheduling manner, and to control each local service provider to transmit communication messages between entities using a preset communication mechanism.

[0099] In an exemplary embodiment, the analog module 804 is further configured to control each local service provider to transmit communication messages between entities using a preset communication mechanism based on a plurality of transmission channels of each entity that are constructed in advance.

[0100] In an exemplary embodiment, the analog module 804 is further configured to, when each local service provider is single-threaded, control each local service provider to enumerate and schedule each entity using a preset scheduling manner; and when each local service provider is multi-threaded, enumerate and schedule each entity, and map the enumerated entity to an idle thread in the multi-thread.

[0101] In an exemplary embodiment, the analog system construction apparatus further comprises:

[0102] A channel construction module is configured to create a communication port of each entity, and to construct a plurality of transmission channels of each entity based on communication information between each basic unit.

[0103] In an exemplary embodiment, the analog module 804 is further configured to, for each entity, acquire a communication message in a transmission channel of the entity; the communication message comprises label information of a receiving entity; when the label information indicates that the local service provider where the receiving entity is located is the same as the local service provider where the entity is located, the communication message is copied to a transmission channel corresponding to the receiving entity; and when the label information indicates that the local service provider where the receiving entity is located is different from the local service provider where the entity is located, the communication message is encapsulated based on a communication protocol, and the encapsulated communication message is transmitted to the transmission channel corresponding to the receiving entity through a physical network between the local service provider where the receiving entity is located and the local service provider where the entity is located.

[0104] The modules in the simulation system construction apparatus can be implemented by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be invoked and executed by the processor to perform the operations corresponding to the modules.

[0105] In an example embodiment, a computer device, which can be a server, has an internal structure as shown in Figure 9 The computer device includes a processor, a memory, an input / output interface, and a communication interface. The processor, the memory, and the input / output interface are connected by a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store basic state information of entities. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with terminals outside through a network connection. The computer program is executed by the processor to implement a simulation system construction method.

[0106] Those skilled in the art can understand that Figure 9 The structure shown in the above

[0107] In an example embodiment, a computer device is provided, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0108] In an example embodiment, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.

[0109] In an example embodiment, a computer program product is provided, which includes a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.

[0110] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.

[0111] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments of each method. Any reference to a memory, database or other medium used in the embodiments provided by the present application can include at least one of a non-volatile and volatile memory. The non-volatile memory can include a read-only memory (ROM), a magnetic tape, a floppy disk, a flash memory, an optical storage, a high-density embedded non-volatile memory, a resistive memory (ReRAM), a magnetoresistive random access memory (MRAM), a ferroelectric memory (FRAM), a phase change memory (PCM), a graphene memory, etc. The volatile memory can include a random access memory (RAM) or an external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0112] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present disclosure.

[0113] The above embodiments only express several implementation ways of the present application, and the description is specific and detailed, but it should not be understood as a limitation to the patent scope of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A method for constructing a simulation system, characterized in that, The method includes: Create entities corresponding to each basic unit in the system to be simulated, and encapsulate each entity into multiple different local service providers; each local service provider runs on a different processor. Each of the local service providers is controlled to run each entity using a preset operating mechanism to simulate the operation of the system to be simulated.

2. The method according to claim 1, characterized in that, The control mechanism for each local service provider to operate each entity using a preset operating mechanism includes: The local service providers are controlled to schedule each entity using a preset scheduling method; Each of the local service providers is controlled to use a preset communication mechanism to transmit communication messages between the entities.

3. The method according to claim 2, characterized in that, The control mechanism for each local service provider to transmit communication messages between the entities using a preset communication mechanism includes: Each of the local service providers is controlled to use a preset communication mechanism to transmit communication messages between the entities based on multiple transmission channels pre-built by each entity.

4. The method according to claim 2 or 3, characterized in that, The control of each local service provider employs a preset scheduling method to schedule each entity, including: When each of the local service providers is single-threaded, control each of the local service providers to adopt the preset scheduling method and enumerate and schedule each of the entities; When each of the local service providers is a multi-threaded scheduler, each of the entities is enumerated and the enumerated entities are mapped to the idle threads in the multi-threaded scheduler.

5. The method according to claim 3, characterized in that, The method further includes: Create communication ports for each of the entities described; Based on the communication information between the basic units, multiple transmission channels are constructed for each entity.

6. The method according to claim 3, characterized in that, The control mechanism for each local service provider employs a preset communication mechanism, based on multiple pre-built transmission channels for each entity, to transmit communication messages between the entities, including: For each entity, obtain the communication messages in the entity's transmission channel; the communication messages include the tag information of the receiving entity; When the tag information indicates that the local service provider where the receiving entity is located is the local service provider where the entity is located, the communication message is copied to the transmission channel corresponding to the receiving entity; When the tag information indicates that the local service provider where the receiving entity is located is different from the local service provider where the entity is located, the communication message is encapsulated based on the communication protocol, and the encapsulated communication message is transmitted to the transmission channel corresponding to the receiving entity through the physical network between the local service provider where the receiving entity is located and the local service provider where the entity is located.

7. A simulation system construction apparatus, characterized in that, The device includes: The encapsulation module is used to create entities corresponding to each basic unit in the system to be simulated, and encapsulate each entity into multiple different local service providers; each local service provider runs on a different processor. The simulation module is used to control each local service provider to run each entity using a preset operating mechanism, simulating the operation of the system to be simulated.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.