A simulation method, device, electronic device and storage medium
By allocating processing tasks according to the coupling degree of simulation events in the simulation system, and using the distinction processing strategies of the main engine and the co-engine, the problem of low parallel performance under the spatial division method is solved, and the parallel processing efficiency of simulation events is improved.
Patent Information
- Application Number
- CN202310555595.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-05-17
AI Technical Summary
In simulation fields such as industrial manufacturing, when using spatial division to handle simulation events with high coupling, multiple processors need frequent communication and interaction, resulting in low parallel performance.
The main engine calculates the coupling degree between the current simulation event and multiple simulation events associated with the timing. If the coupling degree is greater than the preset threshold, it will be processed by the main engine. Otherwise, it will be processed by the co-engine to reduce the main engine and co-engine communication interaction between.
It effectively improves the parallel performance of handling simulation events, reduces the frequency of communication interaction between multiple co-engines, and improves the parallel acceleration effect.
Smart Images

Figure CN116562041B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of simulation, and in particular to a simulation method, device, electronic device and storage medium. Background Art
[0002] At present, in the simulation fields of industrial manufacturing, military operations or experimental teaching, spatial partitioning and other methods are usually used to achieve parallel simulation. Taking the simulation field of industrial manufacturing as an example, there are many workshops on the industrial assembly line, and different workshops are almost independent of each other in space. Therefore, spatial partitioning of workshops can be used to achieve parallel simulation. However, in the specific practice process, it is found that when using spatial partitioning to process simulation events with high coupling, multiple processors need to communicate and interact frequently. Therefore, the parallel performance of using spatial partitioning to process simulation events is low. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a simulation method, device, electronic device and storage medium, which are used to improve the problem of low parallel performance in processing simulation events.
[0004] The embodiment of the present application provides a simulation method, including: calculating the coupling degree between the current simulation event and multiple simulation events that are related in time sequence through the main engine; judging whether the coupling degree is greater than a preset threshold; if so, processing the current simulation event through the main engine, otherwise, processing the current simulation event through the co-engine to obtain a processing result. In the implementation process of the above scheme, when the main engine determines that the coupling degree between the current simulation event and multiple simulation events is greater than a preset threshold, the current simulation event is handed over to the main engine for processing, otherwise it is handed over to the co-engine for processing, so there is no need for frequent communication and interaction between the main engine and the co-engine or between multiple co-engines, so the parallel performance of processing simulation events can be effectively improved.
[0005] Optionally, in the embodiment of the present application, after obtaining the processing result, the process further includes: processing the processing result and multiple simulation events by the main engine to obtain the simulation result. In the implementation process of the above scheme, the processing result and multiple simulation events are processed by the main engine, thereby improving the situation where frequent communication and interaction are required between the main engine and the cooperative engine, and effectively improving the parallel performance of processing simulation events.
[0006] Optionally, in an embodiment of the present application, the current simulation event is processed by the co-engine, including: determining whether multiple behavior operations are decoupled from the current simulation event; if so, forwarding the multiple behavior operations to multiple co-engines through the main engine, so that the multiple co-engines respectively process the multiple behavior operations in parallel, and one co-engine is used to process at least one behavior operation. In the implementation process of the above scheme, the main engine decouples the multiple behavior operations from the current simulation event and forwards them to multiple co-engines, thereby improving the situation where frequent communication and interaction are required between the main engine and the co-engine, and effectively improving the parallel performance of processing simulation events.
[0007] Optionally, in an embodiment of the present application, after determining whether to decouple multiple behavior operations from the current simulation event, it also includes: if multiple behavior operations are not decoupled from the current simulation event, processing the multiple behavior operations through the main engine.
[0008] Optionally, in an embodiment of the present application, multiple behavior operations are forwarded to multiple co-engines through the main engine, including: calling different service interfaces through the main engine so that the service interfaces forward the behavior operations to the co-engines when they are called. In the implementation process of the above scheme, different service interfaces are called by the main engine so that the service interfaces forward the behavior operations to the co-engines when they are called, thereby improving the situation where frequent communication and interaction are required between the main engine and the co-engine, and effectively improving the parallel performance of processing simulation events.
[0009] Optionally, in an embodiment of the present application, the collaborative engine includes: a parallel computing engine, a spatial service engine and / or a graph computing service engine.
[0010] The embodiment of the present application also provides a simulation device, including: a coupling degree calculation module, which is used to calculate the coupling degree between the current simulation event and multiple simulation events that are related in time sequence through the main engine; a coupling degree judgment module, which is used to judge whether the coupling degree is greater than a preset threshold; a simulation event processing module, which is used to process the current simulation event through the main engine if the coupling degree is greater than the preset threshold, otherwise, process the current simulation event through the cooperative engine to obtain a processing result.
[0011] Optionally, in the embodiment of the present application, it also includes: a simulation result acquisition module, which is used to process the processing results and multiple simulation events through the main engine to obtain simulation results.
[0012] Optionally, in an embodiment of the present application, the simulation event processing module includes: a behavior operation judgment submodule, used to judge whether to decouple multiple behavior operations from the current simulation event; a first operation forwarding submodule, used to forward the multiple behavior operations to multiple co-engines through the main engine if multiple behavior operations are decoupled from the current simulation event, so that the multiple co-engines can process the multiple behavior operations in parallel respectively, and one co-engine is used to process at least one behavior operation.
[0013] Optionally, in the embodiment of the present application, the simulation event processing module further includes: a second operation forwarding submodule, configured to process multiple behavior operations if multiple behavior operations are not decoupled from the current simulation event.
[0014] Optionally, in an embodiment of the present application, the first operation forwarding submodule includes: a service interface calling unit, which is used to call different service interfaces through the main engine, so that the service interface forwards the behavior operation to the cooperative engine when being called.
[0015] Optionally, in an embodiment of the present application, the collaborative engine includes: a parallel computing engine, a spatial service engine and / or a graph computing service engine.
[0016] An embodiment of the present application further provides an electronic device, including: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method described above is performed.
[0017] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described above is executed.
[0018] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and in part will become apparent from the description, or will be understood by implementing the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 A schematic diagram of a simulation method provided in an embodiment of the present application is shown;
[0021] Figure 2 A schematic diagram of the structure of the main engine and the auxiliary engine provided in an embodiment of the present application is shown;
[0022] Figure 3 A schematic diagram of the structure of a simulation device provided in an embodiment of the present application is shown;
[0023] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0024] The technical solutions 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 only a part of the embodiments in the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the embodiments of the present application claimed for protection, but merely represents the selected embodiments in the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the embodiments of the present application.
[0025] It is understandable that the "first" and "second" in the embodiments of the present application are used to distinguish similar objects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit the difference.
[0026] It should be noted that the simulation method provided in the embodiment of the present application can be executed by an electronic device, where the electronic device refers to a device terminal or server with the function of executing a computer program, such as a smart phone, a personal computer, a tablet computer, a personal digital assistant or a mobile Internet device. A server refers to a device that provides computing services through a network, such as an x86 server and a non-x86 server, and a non-x86 server includes a mainframe, a minicomputer, a Linux operating system server, and a UNIX operating system server.
[0027] The following introduces the application scenarios in which the simulation method is applicable. The application scenarios here include but are not limited to: industrial manufacturing, military operations or experimental teaching and other simulation fields. For ease of understanding and explanation, the simulation field of industrial manufacturing is used as an example. When it is necessary to simulate many workshops on an industrial assembly line, if the traditional simulation method that does not distinguish the degree of coupling is used, the parallel benefits brought about by the task will be consumed by the communication and input and output (I / O) overhead, making it difficult to achieve the effect of parallel acceleration. At this time, the simulation method can be used to effectively distinguish the degree of coupling of simulation events, so as to reduce the frequency of communication interactions between multiple cooperative engines, and the simulation method can also be used to reduce the frequency of communication interactions between the main engine and the cooperative engine, thereby improving the parallel performance of processing simulation events and effectively achieving the technical effect of parallel acceleration.
[0028] See also Figure 1 The flowchart of the simulation method provided by the embodiment of the present application is shown; the main idea of the simulation method is that the main engine is responsible for scheduling simulation events, that is, it is responsible for forwarding simulation events with a coupling degree less than a preset threshold (also known as loose coupling) to the co-engine for processing, while the main engine mainly processes simulation events with a coupling degree greater than a preset threshold (also known as tight coupling), thereby improving the situation where frequent communication and interaction is required between the main engine and the co-engine or between multiple co-engines, thereby improving the parallel performance of processing simulation events. The implementation method of the above-mentioned simulation method may include:
[0029] Step S110: calculating, by the main engine, the coupling degree between the current simulation event and a plurality of simulation events that are related in time sequence.
[0030] The above-mentioned temporally related means that the timing is continuous, or the timing jumps according to a preset duration. Among them, the timing is continuous, which means that a simulation event occurs every second, and the timing jumps according to a preset duration. For example, a simulation event occurs every preset duration (assuming it is 0.3 seconds), and a simulation event jumps every 0.3 seconds.
[0031] See also Figure 2 The structural diagram of the main engine and the co-engine provided by the embodiment of the present application is shown; the main engine mainly processes simulation events with a coupling degree greater than a preset threshold, and is responsible for the scheduling of simulation events, and the main engine is responsible for forwarding simulation events with a coupling degree less than a preset threshold to the co-engine for processing, and after the co-engine processes the simulation event and obtains the processing result, the co-engine can forward the processing result to the main engine, so that the main engine continues to process subsequent simulation events according to the processing result and other simulation events. Therefore, the main engine is responsible for the driving part of the entire simulation event (including timing logic and business logic), and the business logic here may include: maneuvering, perception information, information transmission, decision processing and action strike, etc.
[0032] It is understandable that the main engine and the co-engine can be installed on the same physical machine (such as the same server), and the main engine and the co-engine in this case can forward simulation events through message passing, function call or shared memory, etc. The main engine and the co-engine can also be installed on different physical machines (such as different servers), and the main engine and the co-engine can communicate with each other through a network (such as a local area network or a wide area network).
[0033] Step S120: determining whether the coupling degree is greater than a preset threshold.
[0034] Coupling refers to the degree of coupling between simulation events. The current simulation event is allocated (i.e., whether it is processed by the main engine or the co-engine) according to the degree of coupling between the current simulation event and other simulation events in the time series. The coupling degree can represent the influence relationship between different events. The coupling degree ranges from 1 to 0. The higher the value, the greater the coupling degree and the more difficult it is to run in parallel. Here, two simulation events are used as an example to explain the coupling degree calculation process between multiple simulation events. Assume that two different simulation events are represented as e i , e j , if the simulation event e i For simulation event e j With strong causal relationships, such as e j All inputs are e i The output of the simulation event e i With simulation event j The coupling degree between them is defined as 1. Similarly, if the simulation event e i With simulation event j The occurrence of the simulation event e i With simulation event j The coupling degree between them is defined as O.
[0035] The implementation of the above step S120 is, for example, to use an executable program compiled or interpreted by a preset programming language to calculate the coupling degree between the current simulation event and multiple simulation events, and to determine whether the coupling degree is greater than a preset threshold; wherein the programming languages that can be used are, for example, C, C++, Java, BASIC, JavaScript, LISP, Shell, Perl, Ruby, Python, SimScript, and PHP, etc. The calculation process of the coupling degree between the above multiple simulation events is, for example, assuming that the simulation event set is represented by E= <e 1 , e 2 , e 3 ,…,e n>, each simulation event in the simulation event set can be represented as e 1 , e 2 , e 3 , ..., e n Etc. Specifically, the above-mentioned multiple simulation events can also be used to construct a coupling graph, for example: using simulation events as nodes and the causal relationship between simulation events as edges to construct a coupling graph. The causal relationship between the above-mentioned simulation events can be a directed edge, and the directed edge indicates that the simulation event at the starting point affects the simulation event at another end point. Therefore, the coupling relationship between multiple simulation events can constitute the above-mentioned coupling graph.
[0036] Step S130: If the coupling degree is greater than a preset threshold, the current simulation event is processed by the main engine.
[0037] The implementation method of the above step S130 is, for example: since the main engine is mainly responsible for the driving part of the entire simulation event (including sequential logic and business logic), the main engine can flexibly schedule and execute the simulation event in time. When the coupling degree between the current simulation event and other multiple simulation times is greater than a preset threshold, the current simulation event is processed by the main engine, that is, the main engine is mainly responsible for the calculation and processing of the simulation event with a higher coupling degree.
[0038] Step S140: If the coupling degree is less than or equal to the preset threshold, the current simulation event is processed by the cooperative engine to obtain a processing result.
[0039] It can be understood that the above coupling degrees are specifically classified into: influencing coupling degree, influenced coupling degree, comprehensive coupling degree, influencing proportion coupling degree, influenced proportion coupling degree, proportion coupling degree, etc.
[0040] The impact coupling degree refers to the k The total impact coupling degree in a set of simulation events (i.e., a simulation event set) is the simulation event as a node e in the coupling graph. k The sum of the out-degrees of k .
[0041] The affected coupling degree refers to the k The total impact coupling degree of a set of simulation events (i.e., a set of simulation events) is the simulation event in the coupling graph as a node e k The sum of the in-degrees of k .
[0042] The comprehensive coupling degree refers to the k The comprehensive impact coupling degree of a set of simulation events (i.e., a set of simulation events) is the simulation event in the coupling graph as a node ek The sum of the out-degree and in-degree of k , then T k =I k +B k Among them, T k It can represent node e k The comprehensive coupling degree, I k Can represent node e k The coupling degree of influence, B k Can represent node e k The affected coupling degree.
[0043] The coupling degree of influence ratio refers to the k The influence ratio coupling degree in a set of simulation events (i.e., a set of simulation events) is the influence coupling degree in the coupling graph divided by the number of edges in the coupling graph. The influence ratio coupling degree can be expressed as OI k =I k / M; among them, OI k Represents node e k The influence ratio of coupling degree, I k Represents node e k The influence coupling degree of , M represents the number of edges in the coupling graph.
[0044] The coupling degree of the affected proportion refers to the k The affected coupling ratio in a set of simulation events (i.e., a set of simulation events) is the affected coupling ratio in the coupling graph divided by the number of edges in the coupling graph. The affected coupling ratio can be expressed as OB k =B k / M; among them, OB k Represents node e k The coupling degree of the affected proportion, I k Represents node e k The coupling degree of influence, B k It can represent node e k The affected coupling degree of is, and M represents the number of edges in the coupling graph.
[0045] The comprehensive proportion coupling degree refers to the k The comprehensive coupling degree of a set of simulation events (i.e., a set of simulation events) is the comprehensive coupling degree of influence in the coupling graph divided by the number of edges in the coupling graph. The comprehensive coupling degree can be expressed as OT k =T k / M; among them, OT k Represents node e k The comprehensive proportion coupling degree, T k Represents node e k The comprehensive coupling degree of , M represents the number of edges in the coupling graph.
[0046] The proportion coupling degree refers to the proportion of a simulation event in the simulation event set. The coupling degree is the sum of the number of all other simulation events related to the simulation event, and the sum of the coupling degrees of interaction with other simulation events is defined as the absolute interaction coupling degree; the absolute interaction coupling degree of the simulation event divided by the total interaction coupling degree of the simulation event set is defined as the interaction coupling degree proportion.
[0047] In the above implementation process, when the main engine determines that the degree of coupling between the current simulation event and multiple simulation events that are related in time sequence is greater than a preset threshold, the current simulation event is handed over to the main engine for processing; otherwise, it is handed over to the cooperative engine for processing. Therefore, there is no need for frequent communication and interaction between the main engine and the cooperative engine or between multiple cooperative engines, thereby effectively improving the parallel performance of processing simulation events.
[0048] As an optional implementation of the above step S140, when the current simulation event is processed by the cooperative engine, the decoupled behavior operation may be forwarded to the cooperative engine. This implementation may include:
[0049] Step S141: Determine whether multiple behavior operations are decoupled from the current simulation event.
[0050] The implementation method of the above step S141 is, for example, that when the main engine processes the current simulation event, it can also decouple the current simulation event and use an executable program compiled or interpreted by a preset programming language to determine whether to obtain multiple behavior operations decoupled from the current simulation event. Among them, the programming languages that can be used are, for example, C, C++, Java, BASIC, JavaScript, LISP, Shell, Perl, Ruby, Python, SimScript, PHP, etc.
[0051] Step S142: if multiple behavior operations are decoupled from the current simulation event, the multiple behavior operations are forwarded to multiple co-engines through the main engine, so that the multiple co-engines process the multiple behavior operations in parallel respectively, and one co-engine is used to process at least one behavior operation.
[0052] It is understandable that the above-mentioned parallel processing can be asynchronous parallel processing or synchronous parallel processing. Therefore, the specific implementation of the parallel processing should not be understood as a limitation of the embodiments of the present application.
[0053] As an optional implementation of the above step S140, after determining whether multiple behavior operations are decoupled from the current simulation event, the following steps are further included:
[0054] Step S143: If multiple behavior operations are not decoupled from the current simulation event, the multiple behavior operations are processed by the main engine.
[0055] As a first optional implementation of the above step S142, when the main engine forwards multiple behavior operations to multiple co-engines, the behavior operations can be forwarded to the co-processing engine group by calling different interfaces. The co-processing engine group is coordinated and executed internally, that is, the multiple co-engines in the co-processing engine group are not executed simultaneously or synchronously. This implementation may include:
[0056] Step S142a: different service interfaces are called by the main engine, so that when the service interface is called, the behavior operation is forwarded to the co-processing engine group.
[0057] The service interface refers to the service interface between the main engine and the co-processing engine, wherein the main engine and the co-engine can process and schedule multiple behavior operations decoupled from simulation events through various service interfaces. For example, the main engine calls the space service interface, so that when the space service interface is called, the behavior operation of the space service simulation event is forwarded to the co-processing engine group, so that the co-processing engine group performs operations such as adding (Insert), deleting (Delete), querying (Query) and updating (Update) in the space service interface, thereby realizing the maintenance of physical space information.
[0058] An implementation example of the above step S142a is as follows: different service interfaces are called by the main engine, so that when the service interface is called, the behavior operation is forwarded to the co-processing engine group, and the co-processing engine group is composed of different co-engines, each co-engine corresponds to a service type, and the co-engines in the co-processing engine group and the main engine can realize information transmission and synchronization through the message interface. Similarly, the co-engines in the co-processing engine group and other co-processing engines can also realize information transmission and synchronization through the message interface, thereby completing function calls and data sharing. The co-processing engine group may include but is not limited to: a graph computing co-engine group, a parallel computing engine group, a space service engine group and / or an information network service engine group; wherein the space service engine group is used to provide space moving object indexing, environmental space search, electromagnetic interference environment interference value indexing, space reconnaissance detection, electromagnetic environment support components, parallel acceleration index components and other services; the information network service engine group is used to provide information network graph modeling methods, graph index support components, graph structure support components, parallel acceleration index components and other services; the graph computing service engine group is used to calculate relevant data in the graph database (such as knowledge graph, etc.), for example: indexing and computing support for the topological structure of the graph generated by the topological relationship of the entity, etc.; the parallel computing engine group is used to provide parallel computing related services, such as using hardware such as graphics processing unit (GPU) to assist in computing; after being called by the main engine, the space service engine can provide support for the simulation computing of the main engine by adding, deleting, querying, updating and other operations on the corresponding entity attributes.
[0059] As a second optional implementation of the above step S142, the main engine may forward multiple behavior operations to multiple co-engines, that is, the processing actions between the multiple co-engines may be performed simultaneously or synchronously. This implementation may include:
[0060] Step S142b: forwarding the behavior operation to multiple co-engines through the main engine, so that the multiple co-engines process the multiple behavior operations in parallel respectively, and one co-engine is used to process at least one behavior operation.
[0061] An implementation example of the above-mentioned step S142b is as follows: the main engine forwards the behavior operation to multiple asynchronous or synchronous co-engines through a unified interface, so that the multiple co-engines respectively process multiple behavior operations in parallel. The unified interface here may be an agreed-upon implementation, and operations such as adding (Insert), deleting (Delete), querying (Query) and updating (Update) may be implemented through the unified interface.
[0062] As an optional implementation of the above simulation method, after obtaining the processing result, it also includes:
[0063] Step S150: Processing the processing result and multiple simulation events through the main engine to obtain a simulation result.
[0064] It can be understood that there are two types of processing results. The first is that the subsequent simulation event needs the processing result to participate in the calculation processing (for example, the processing result of the first simulation event is needed to participate in the calculation of the second simulation event, and the second simulation event is the subsequent simulation event that follows the first simulation event in time sequence). Therefore, it is necessary to wait for the processing result to be obtained before continuing to process the subsequent simulation time and promote the driving of the simulation event; the second is that the subsequent simulation event does not need the processing result to participate in the calculation processing, but the subsequent simulation time far away needs the processing result to participate in the calculation processing (for example, the processing result of the first simulation event is not needed to participate in the calculation of the second simulation event, but the processing result of the first simulation event and the processing result of the second simulation event are needed to participate in the calculation of the third simulation event, and the first simulation event, the second simulation event and the third simulation event are closely followed in time sequence); in this case, there is no need to wait for the processing result to be obtained, and the driving of the simulation event can also be promoted.
[0065] The implementation method of the above step S150 is, for example: the main engine forwards the simulation event with a coupling degree less than a preset threshold to the cooperative engine for processing. After receiving the simulation event sent by the main engine, the cooperative engine processes the simulation event and obtains a processing result. Then, the cooperative engine can forward the processing result to the main engine, so that the main engine continues to process the processing result and subsequent simulation events to obtain a simulation result. After obtaining the processing result, the main engine continues to process the processing result and subsequent simulation events to obtain a simulation result.
[0066] As an optional implementation of the above-mentioned simulation method, the above-mentioned co-engine includes but is not limited to: a graph computing service engine, a parallel computing engine group, a space service engine and / or an information network service engine; wherein, the graph computing co-engine is used to calculate relevant data in a graph database (such as a knowledge graph, etc.), specifically, for example: indexing and computing support of the topological structure of the graph generated by the topological relationship of the entity; the space service engine is used to provide space moving object indexing, environmental space search, electromagnetic interference environment interference value indexing, space reconnaissance detection, electromagnetic environment support components, parallel acceleration index components and other services, the parallel computing engine group is used to provide parallel computing related services, such as using hardware such as graphics processing unit (GPU) to assist in computing; the information network service engine is used to provide information network graph modeling methods, graph index support components, graph structure support components, parallel acceleration index components and other services, and after being called by the main engine, the space service engine can provide support for the simulation computing of the main engine by adding, deleting, querying, updating and other operations on the corresponding entity attributes.
[0067] It is understandable that the above-mentioned cooperative engine can also be a high-performance computing engine, an intelligent auxiliary decision-making engine, an extraction and generation engine, a situation assessment engine, a situation display engine, etc.
[0068] See also Figure 3 The structure diagram of the simulation device provided in the embodiment of the present application is shown; the embodiment of the present application provides a simulation device 200, including:
[0069] The coupling degree calculation module 210 is used to calculate the coupling degree between the current simulation event and multiple simulation events that are related in time sequence through the main engine.
[0070] The coupling degree determination module 220 is used to determine whether the coupling degree is greater than a preset threshold.
[0071] The simulation event processing module 230 is used to process the current simulation event through the main engine if the coupling degree is greater than a preset threshold, and otherwise, process the current simulation event through the cooperative engine to obtain a processing result.
[0072] Optionally, in the embodiment of the present application, it also includes:
[0073] The simulation result acquisition module is used to process the processing results and multiple simulation events through the main engine to obtain the simulation results.
[0074] Optionally, in an embodiment of the present application, the simulation event processing module includes:
[0075] The behavior operation judgment submodule is used to judge whether to decouple multiple behavior operations from the current simulation event.
[0076] The first operation forwarding submodule is used to forward the multiple behavior operations to multiple co-engines through the main engine if multiple behavior operations are decoupled from the current simulation event, so that the multiple co-engines can process the multiple behavior operations in parallel respectively, and one co-engine is used to process at least one behavior operation.
[0077] Optionally, in the embodiment of the present application, the simulation event processing module further includes:
[0078] The second operation forwarding submodule is used to process the multiple behavior operations through the main engine if the multiple behavior operations are not decoupled from the current simulation event.
[0079] Optionally, in the embodiment of the present application, the first operation forwarding submodule includes:
[0080] The service interface calling unit is used to call different service interfaces through the main engine, so that when the service interface is called, the behavior operation is forwarded to the cooperative engine.
[0081] Optionally, in an embodiment of the present application, the collaborative engine includes: a parallel computing engine, a spatial service engine and / or a graph computing service engine.
[0082] It should be understood that the device corresponds to the above-mentioned simulation method embodiment and can execute the various steps involved in the above-mentioned method embodiment. The specific functions of the device can be referred to in the above description. To avoid repetition, the detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the operating system (OS) of the device.
[0083] See also Figure 4 The electronic device 300 provided in the embodiment of the present application includes: a processor 310 and a memory 320, wherein the memory 320 stores machine-readable instructions executable by the processor 310, and when the machine-readable instructions are executed by the processor 310, the above method is executed.
[0084] The embodiment of the present application also provides a computer-readable storage medium 330, on which a computer program is stored, and the computer program is executed by the processor 310 to execute the above method. The computer-readable storage medium 330 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk.
[0085] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0086] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed device and method can also be implemented in other ways. The device embodiments described above are only schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a part of a module, a program segment or a code, and a part of a module, a program segment or a code includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also be different from the order of occurrence marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which is mainly determined by the functions involved.
[0087] In addition, each functional module of each embodiment in the embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. In addition, in the description of this specification, the description of reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present application. In this specification, the schematic representation of the above terms does not necessarily have to be directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples without contradicting each other.
[0088] The above description is only an optional implementation manner of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application.
Claims
1. A simulation method, It is characterized in that include: The coupling degree between the current simulation event and multiple simulation events related in time sequence is calculated through the main engine; Determining whether the coupling degree is greater than a preset threshold; If yes, the current simulation event is processed by the main engine; otherwise, the current simulation event is processed by the co-engine to obtain a processing result; Among them, multiple behavior operations are forwarded to multiple cooperative engines through the main engine, including: calling different service interfaces through the main engine, so that when the service interface is called, the behavior operation is forwarded to the cooperative engine; the main engine is responsible for the driving part of the business logic and timing logic of the entire current simulation event, and the business logic includes: maneuvering, perception information, information transmission, decision processing and action strike.
2. The method according to claim 1, It is characterized in that After obtaining the processing result, the method further includes: The processing result and the multiple simulation events are processed by the main engine to obtain a simulation result.
3. The method according to claim 1, It is characterized in that The processing of the current simulation event by the co-engine includes: Determining whether to decouple multiple behavior operations from the current simulation event; If so, the multiple behavior operations are forwarded to the multiple cooperative engines through the main engine, so that the multiple cooperative engines respectively process the multiple behavior operations in parallel, and one cooperative engine is used to process at least one behavior operation.
4. The method according to claim 3, It is characterized in that After determining whether to decouple multiple behavior operations from the current simulation event, the method further includes: If the multiple behavior operations are not decoupled from the current simulation event, the multiple behavior operations are processed by the main engine.
5. The method according to any one of claims 1 to 4, It is characterized in that The collaborative engine includes: a parallel computing engine, a spatial service engine and / or a graph computing service engine.
6. A simulation device, It is characterized in that include: A coupling degree calculation module is used to calculate the coupling degree between the current simulation event and multiple simulation events that are related in time sequence through the main engine; A coupling degree judgment module, used to judge whether the coupling degree is greater than a preset threshold; A simulation event processing module, configured to process the current simulation event through the main engine if the coupling degree is greater than a preset threshold, and otherwise process the current simulation event through the cooperative engine to obtain a processing result; Among them, multiple behavior operations are forwarded to multiple cooperative engines through the main engine, including: calling different service interfaces through the main engine, so that when the service interface is called, the behavior operation is forwarded to the cooperative engine; the main engine is responsible for the driving part of the business logic and timing logic of the entire current simulation event, and the business logic includes: maneuvering, perception information, information transmission, decision processing and action strike.
7. The device according to claim 6, It is characterized in that Also includes: The simulation result obtaining module is used to process the processing result and the multiple simulation events through the main engine to obtain the simulation result.
8. An electronic device, It is characterized in that include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method according to any one of claims 1 to 5 is performed.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is executed.
