Multi-device joint simulation method, computer device and storage device
By constructing a directed graph and netlist of data flow and updating causal relationship data in combination with a time-linked list, the complex simulation granularity and signal flow relationship between multiple devices are solved, and the accuracy and efficiency of simulation are improved.
Patent Information
- Application Number
- CN202411978250.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In complex digital simulation, the simulation granularity and signal flow relationship between multiple devices are complex, resulting in data synchronization and computing efficiency problems, affecting the accuracy and reliability of the simulation model.
By obtaining the device information of multiple devices to be simulated, a directed data flow graph and netlist are constructed, the trigger timing is obtained and the time link list is constructed, the causal relationship data of the node and the propulsion clock value of the simulation system are updated, and the nodes are called in sequence for calculations until the preset simulation end condition is met.
It improves the accuracy and efficiency of simulation, ensures the correct time sequence of node operations, avoids time logic errors, and improves the real-time and accuracy of simulation.
Smart Images

Figure CN119918253A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of digital simulation technology, and in particular to a multi-device joint simulation method, a computer device, and a storage device. Background Art
[0002] Digital simulation methods are an important means of conducting scientific research, data analysis, and process deduction. As research continues to deepen, it is necessary to build a hierarchical system or a more complex network structure to describe and analyze the processing process and operation mechanism of complex problems. Especially in the drills of relevant departments, such as radar equipment simulation training, a more fine-grained description is required. However, with the refinement of the basic model, the complexity of the model increases, there are feedback loops of different depths between nodes, and the signal flow graphs of models between different equipment are significantly different. The simulation granularity and signal flow relationship between different devices are complex, there is data coupling between the internal processing processes of electronic equipment, and data is difficult to synchronize under different processing clocks. These problems lead to a decrease in the accuracy and reliability of the simulation model, affecting the simulation effect and training quality. Summary of the invention
[0003] In view of this, the embodiments of the present disclosure provide a multi-device joint simulation method, a computer device, and a storage device, which can parallelly schedule simulation devices based on componentized nodes defined by a netlist, solving the simulation data synchronization and computing efficiency problems of complex fine-grained components.
[0004] In a first aspect, the present disclosure provides a multi-device joint simulation method, which adopts the following technical solution:
[0005] Get device information of multiple devices to be simulated;
[0006] Constructing a data flow directed graph based on the device information, wherein the data flow directed graph is composed of nodes representing each device to be simulated and directed edges representing data flow directions;
[0007] Constructing a netlist based on each directed edge and point information of each node in the data flow directed graph;
[0008] Acquire the trigger timing of the device to be simulated, and construct a time chain table based on the data flow directed graph and the trigger timing;
[0009] Based on the netlist and the time chain table, obtaining causal relationship data of the node, and updating the actual advancement time of the node and the advancement clock value of the simulation system;
[0010] When the causal relationship data between all nodes are acquired, the time chain table is updated;
[0011] According to the causal relationship data, the actual advancement time, the advancement clock value and the new time chain table, each node is called sequentially for calculation until a preset simulation end condition is met.
[0012] Optionally, the netlist is expressed as:
[0013] N{n(i,k,j,m)|i,j∈I,k∈K,m∈M};
[0014] Wherein, N represents the netlist; n(·) represents the connection function, n∈N; i and j represent nodes; k represents the output port; m represents the input port; I represents the node set; K represents the output port set; M represents the input port set; when n(i,k,j,m)=1, it means that the kth output port of the i-th node passes data to the mth input port of the j-th node; when n(i,k,j,m)=0, it means that the kth output port of the i-th node does not pass data to the mth input port of the j-th node.
[0015] Optionally, the acquiring the trigger timing of the device to be simulated and constructing a time chain table based on the data flow directed graph and the trigger timing includes:
[0016] Based on the data flow directed graph, construct a multi-branch tree;
[0017] Traversing all paths of the multi-branch tree to determine whether the current path has an algebraic ring structure;
[0018] If so, the input port attribute of the node with the algebraic ring structure is set to a slave port;
[0019] If not, set the input port attribute of the node included in the current path to the primary port;
[0020] Based on the input port attributes and the trigger timing, construct a time-triggered event list, wherein the time-triggered event list includes events and time stamps of the events;
[0021] Based on the simulation step size of each node, obtain the time scale of each node status update;
[0022] Merge the time stamps in the time-triggered event list and the time stamps of each node status update into a time stamp set;
[0023] Traversing the time scale set in time order, and generating a plurality of node trigger parameters in the traversal order, wherein the node trigger parameters include the time scale and the nodes participating in the calculation under the time scale;
[0024] The node trigger parameters are stored in a preset empty linked list to generate a time linked list.
[0025] Optionally, acquiring the causal relationship data of the node based on the netlist and the time chain table, and updating the actual advancement time of the node and the advancement clock value of the simulation system, includes:
[0026] Recording a timing value of a preset time counter, wherein the timing value is initially 0;
[0027] Select a node from the time linked list based on the timing value and call it;
[0028] Based on the netlist and the called node, updating the actual advancement time;
[0029] Record the causal relationship data of the called nodes;
[0030] Updating the timing value, and based on the new timing value, re-calling a new node from the time linked list and updating the advancement clock value until all nodes in the time linked list are called at least once;
[0031] The causal relationship data includes at least one of a predecessor node, predecessor data, a successor node, a connection relationship with the predecessor node and the successor node, a calculation result, and a calculation resource allocation result.
[0032] Optionally, updating the actual advancement time based on the netlist and the called node includes:
[0033] Based on the netlist, determining whether the called node has a predecessor node;
[0034] If not, the actual advancement time of the called node is updated, and the called node performs calculation;
[0035] If yes, determine whether the called node meets the preset advancement conditions;
[0036] If the conditions are met, it is determined that the predecessor node has prepared the predecessor data, and the called node performs calculation based on the prepared predecessor data;
[0037] Based on the first preset function, the second preset function and the current advancement clock value of the simulation system, updating the actual advancement time of each node;
[0038] If not, it is determined that the predecessor node has not prepared the predecessor data, and the called node does not perform calculations;
[0039] Based on the second preset function, the third preset function and the current advancement clock value of the simulation system, the actual advancement time of each node is updated.
[0040] Optionally, the expression of the preset advancement condition is:
[0041]
[0042] Among them, r represents the predecessor node of the called node; t(r) represents the actual advancement time of the predecessor node; u represents the called node; q(u) represents the simulation step of the u-th node; k represents the output port; m represents the input port; n(r,k,u,m)=1 means that the k-th output port of the r-th node transmits data to the m-th input port of the u-th node; I represents the node set; I represents the node set; K represents the output port set; p(u,k)=1 means that the attribute of the k-th output port of the u-th node is the main port; ∩ represents and.
[0043] Optionally, the expression of the first preset function is:
[0044] o′(x)=o(x)-(time1-time2-q(x));
[0045] Wherein, x represents an active node, and the active node includes a called node and a predecessor node; o′(x) represents the time offset after the active node is updated; o(x) represents the time offset before the active node is updated; time1 represents the time scale currently used by the time chain list; time2 represents the time scale last used by the time chain list; q(x) represents the simulation step size of the active node;
[0046] The expression of the second preset function is:
[0047] o'(y)=o(y)+(time1-time2);
[0048] Wherein, y represents an inactive node, and the inactive node includes nodes other than the called node and the predecessor node; o′(y) represents the time offset after the inactive node is updated; o(y) represents the time offset before the inactive node is updated;
[0049] The expression of the third preset function is:
[0050] o′(x)=o(x)+(time1-time2).
[0051] Optionally, updating the timing value includes:
[0052] Add the current timing value to the preset period value to obtain a new timing value;
[0053] The updating of the advancement clock value comprises:
[0054] The timestamp of the new node being called is set to the new advance clock value.
[0055] Optionally, the preset simulation end condition includes:
[0056] The actual advancement time of each node is greater than the preset simulation deadline.
[0057] In a second aspect, the embodiment of the present disclosure further provides a multi-device joint simulation system, which adopts the following technical solution:
[0058] An information acquisition module, used to acquire device information of multiple devices to be simulated;
[0059] A directed graph construction module, used to construct a data flow directed graph based on the device information, wherein the data flow directed graph is composed of nodes representing each device to be simulated and directed edges representing data flow directions;
[0060] A netlist construction module, used to construct a netlist based on each directed edge and point information of each node in the data flow directed graph;
[0061] A linked list construction module, used for obtaining the trigger timing of the device to be simulated, and constructing a time linked list based on the data flow directed graph and the trigger timing;
[0062] A system startup module, used to obtain causal relationship data of nodes based on the netlist and the time chain table, and update the actual advancement time of the nodes and the advancement clock value of the simulation system;
[0063] A linked list updating module, used to update the time linked list after the causal relationship data between all nodes are acquired;
[0064] The sequential calling module is used to sequentially call each node for calculation according to the causal relationship data, the actual advancement time, the advancement clock value and the new time chain table until the preset simulation end condition is met.
[0065] In a third aspect, the embodiments of the present disclosure further provide a computer device, which adopts the following technical solution:
[0066] YY+242341P-YX
[0067] The computer device comprises:
[0068] at least one processor; and,
[0069] a memory communicatively connected to the at least one processor; wherein,
[0070] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the multi-device joint simulation methods described above.
[0071] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute any of the multi-device joint simulation methods described above.
[0072] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program / instruction, which implements the steps of any of the above methods when executed by a processor.
[0073] The multi-device joint simulation method provided by the embodiment of the present disclosure can fully understand the hardware and software characteristics of the device to be simulated by acquiring device information, and provide accurate basic data for the subsequent data flow directed graph construction. The construction of the data flow directed graph makes the data flow relationship between nodes clear and visualized, which is convenient for understanding and analyzing the interaction logic between devices, and provides structured data support for the subsequent netlist construction and time chain table construction. The construction of the netlist digitizes the logical relationship of the data flow directed graph, which is convenient for the simulation system to calculate and schedule, and improves the accuracy and efficiency of the simulation. The construction of the time chain table combines the device trigger timing and the data flow directed graph, ensures that the time sequence of the node operation during the simulation process is correct, avoids logical errors in time, and improves the real-time and accuracy of the simulation. In the startup phase of the simulation system, by acquiring the causal relationship data of the node and updating the actual advancement time, the simulation system can accurately capture the causal relationship between the simulation devices, clarify the simulation call sequence, ensure that the time advancement during the simulation process is consistent with the actual device operation, and improve the accuracy and reliability of the simulation. Updating the time chain table ensures the accuracy of the operation sequence and time advancement of the simulation system at different time points, provides a node calling basis for the next round of simulation, and avoids simulation errors caused by inaccurate time chains. Then, based on the acquired causal relationship data and the time required for simulation, as well as the calling sequence provided by the new time chain table, the nodes can be called sequentially in the simulation loop for calculation, and the simulation system can simulate according to the preset logic and time sequence until the preset simulation end condition is met and the simulation ends. This method improves the accuracy and reliability of the simulation, ensures the correctness of time and logic during the simulation process, thereby improving the accuracy of the simulation results and realizing an efficient and accurate simulation process.
[0074] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0076] Figure 1 A schematic diagram of a multi-device joint simulation method provided in an embodiment of the present disclosure;
[0077] Figure 2 A schematic diagram of a data flow directed graph provided for an embodiment of the present disclosure;
[0078] Figure 3 A schematic diagram of a flow chart of a method for constructing a time chain table provided in an embodiment of the present disclosure;
[0079] Figure 4 A schematic diagram of a multi-branch tree provided in an embodiment of the present disclosure;
[0080] Figure 5 A schematic diagram of a flow chart of a method for running a simulation system in the startup phase provided by an embodiment of the present disclosure;
[0081] Figure 6 A flowchart of a method for updating actual propulsion time provided by an embodiment of the present disclosure;
[0082] Figure 7 A principle block diagram of a multi-device joint simulation system provided by an embodiment of the present disclosure;
[0083] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0084] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0085] It should be clear that the following embodiments of the present disclosure are described by specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other in the absence of conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0086] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0087] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0088] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0089] Reference Figure 1 The present disclosure provides a multi-device joint simulation method, comprising the following steps:
[0090] S1: Obtain device information of multiple devices to be simulated;
[0091] S2: construct a data flow directed graph based on the device information, wherein the data flow directed graph is composed of nodes representing each device to be simulated and directed edges representing the data flow relationship;
[0092] S3: construct a netlist based on each directed edge and point information of each node in the data flow directed graph;
[0093] S4: Obtain the trigger timing of the device to be simulated, and build a time chain table based on the data flow directed graph and the trigger timing;
[0094] S5: Based on the netlist and the time chain table, the causal relationship data of the node is obtained, and the actual advancement time of the node and the advancement clock value of the simulation system are updated;
[0095] S6: When the causal relationship data between all nodes is obtained, the time chain table is updated;
[0096] S7: Based on the causal relationship data, the actual advancement time, the advancement clock value and the new time chain list, each node is called sequentially for calculation until the preset simulation end condition is met.
[0097] The multi-device joint simulation method disclosed in the present invention can fully understand the hardware and software characteristics of the device to be simulated by obtaining device information, and provide accurate basic data for the subsequent data flow directed graph construction. The construction of the data flow directed graph makes the data flow relationship between nodes clear and visualized, which is convenient for understanding and analyzing the interaction logic between devices, and provides structured data support for the subsequent netlist construction and time chain table construction. The construction of the netlist digitizes the logical relationship of the data flow directed graph, which is convenient for the simulation system to calculate and schedule, and improves the accuracy and efficiency of the simulation. The construction of the time chain table combines the device trigger timing and the data flow directed graph, ensures that the time sequence of the node operation during the simulation process is correct, avoids logical errors in time, and improves the real-time and accuracy of the simulation. In the startup phase of the simulation system, by obtaining the causal relationship data of the node and updating the actual advancement time, the simulation system can accurately capture the causal relationship between the simulation devices, clarify the simulation call sequence, ensure that the time advancement during the simulation process is consistent with the actual device operation, and improve the accuracy and reliability of the simulation. Updating the time chain table ensures the accuracy of the operation sequence and time advancement of the simulation system at different time points, provides a node calling basis for the next round of simulation, and avoids simulation errors caused by inaccurate time chains. Then, based on the acquired causal relationship data and the time required for simulation, as well as the calling sequence provided by the new time chain table, the nodes can be called sequentially in the simulation loop for calculation, and the simulation system can simulate according to the preset logic and time sequence until the preset simulation end condition is met and the simulation ends. This method improves the accuracy and reliability of the simulation, ensures the correctness of time and logic during the simulation process, thereby improving the accuracy of the simulation results and realizing an efficient and accurate simulation process.
[0098] In S1, a simulation blueprint is obtained, and based on the blueprint, detailed information of each device that needs to participate in the simulation is collected, that is, various attributes of the device to be simulated, including key data such as device name, type, interface standard, communication protocol, and time characteristics. This information is organized and stored in a unified data format for subsequent processing and analysis.
[0099] In S2, the idea of componentized modeling is adopted to construct a data flow directed graph, wherein componentization means decomposing a complex system into several independent and reusable components, which are called "components". In the multi-device joint simulation method disclosed in the present invention, componentization means treating each device to be simulated as an independent component to simplify the complexity of the model and improve the flexibility and maintainability of the model. Specifically, these devices to be simulated are componentized in a graphical and wired manner, and a signal flow topology diagram between components is clearly constructed. This step helps to intuitively understand the data interaction relationship between devices and provides a solid foundation for subsequent simulation experiments. Under a specific scenario, a complete data flow directed graph is constructed based on these components and their signal flow relationships. Refer to Figure 2 The schematic diagram of the data flow directed graph is shown. The data flow directed graph consists of nodes and directed edges. Each node represents a device to be simulated, for example Figure 2 AL in , while directed edges explicitly indicate the direction and path of data flow, e.g. Figure 2 The arrows in the figure point to the direction of the data flow. Such a directed graph of data flow not only provides a global view of the simulation, but also becomes a key reference for the simulation experiment.
[0100] In S3, the point information of the node contains the device information of the device to be simulated. Through the directed edges in the data flow directed graph and the point information of each node, the input-output relationship of each node is clarified, and this input-output relationship is equivalent to a four-dimensional tensor to construct a netlist, which is used to describe the interaction and dependency between the devices to be simulated. The netlist is a four-dimensional matrix, and its expression is as follows:
[0101] N{n(i,k,j,m)|i,j∈I,k∈K,m∈M}; (Formula 1)
[0102] In Formula 1, N represents a netlist; n(·) represents a connection function, n∈N; i and j represent nodes, where i and j are set to facilitate the display of the connection relationship between nodes. Since there is a situation where a node flows data back to itself, node i and node j can represent two different nodes or the same node; k represents an output port; m represents an input port; I represents a node set; K represents an output port set; M represents an input port set; when n(i,k,j,m)=1, it means that the kth output port of the i-th node transfers data to the mth input port of the j-th node, and there is a connection relationship between the kth output port of the i-th node and the mth input port of the j-th node; when n(i,k,j,m)=0, it means that the kth output port of the i-th node does not transfer data to the mth input port of the j-th node, and there is no connection relationship between the kth output port of the i-th node and the mth input port of the j-th node.
[0103] In S4, before the simulation starts, the node configuration is performed, including setting the simulation time and simulation parameters of each node, wherein the simulation time includes the simulation start time T0 and the simulation end time T end , the simulation parameters include the simulation step. The simulation step of each node is combined into a simulation step set, and the expression of the simulation step set is as follows:
[0104] Q{q(l)∈R + |l∈I}; (Formula 2)
[0105] In Formula 2, Q represents the simulation step set; l represents a node, where l can represent any one of all nodes and is set to refer to all nodes; q(l) represents the simulation step of the lth node; R + Represents a positive real number.
[0106] Set the actual advancement time of each node. The expression of the actual advancement time is t(l). Set the initial value of the actual advancement time to 0, that is, t(l) = 0. Determine whether each node has a predecessor node based on the netlist. The predecessor node is a node that transfers data to the current node, that is, a node that completes calculations and outputs data before the current node during the simulation process. Set a predecessor data indication parameter for each node with a predecessor node. The expression of the predecessor data indication parameter is a(l). This parameter is used to indicate whether the predecessor data of the current node is ready. Initially, the predecessor data indication parameter is set to 0, that is, a(l) = 0, indicating that the predecessor data is not yet ready. Among them, the predecessor data refers to the data generated by the predecessor node and passed to the current node as the input of the current node. The current node needs to rely on the predecessor data to execute.
[0107] The configuration of the node also includes building a time list, see Figure 3 The flowchart of the method for constructing a time chain table is shown, "obtaining the trigger timing of the device to be simulated, and constructing a time chain table based on the data flow directed graph and the trigger timing" includes the following steps:
[0108] S41: construct a multi-branch tree based on the data flow directed graph, traverse all paths of the multi-branch tree, and record the path being traversed as the current path;
[0109] S42: Determine whether the current path has an algebraic ring structure; if so, execute S43; if not, execute S44;
[0110] S43: setting the input port attribute of the node with the algebraic ring structure to a slave port;
[0111] S44: setting the input port attribute of the node included in the current path to the primary port;
[0112] S45: constructing a time trigger event list based on input port attributes and trigger timing;
[0113] S46: based on the simulation step of each node, obtaining the time scale of each node state update;
[0114] S47: merging the time stamp in the time trigger event list and the time stamp of each node status update into a time stamp set;
[0115] S48: traverse the time stamp set in time order, and generate multiple node trigger parameters in the traversal order;
[0116] S49: Store the node trigger parameters into a preset empty linked list to generate a time linked list.
[0117] In S41-S44, the data flow directed graph is two-dimensional, and it is more convenient to construct a multi-branch tree based on this two-dimensional graph. Figure 4 The schematic diagram of the multi-branch tree is similar to the structural principle of the data flow directed graph. The multi-branch tree is composed of nodes and branches. Each node in the multi-branch tree represents a device to be simulated, and each branch represents the connection between the devices to be simulated.
[0118] Reference Figure 4 In the example, the path A→B→N→B, where B→N→B forms an algebraic ring structure. The algebraic ring structure means that the starting point and the end point of the current path are the same node, and the other nodes in this path are not repeated, that is, a loop occurs. If the data flow directed graph is directly used for simulation, the loop in the data flow directed graph may cause the simulation system (also known as the simulation engine) to fall into an infinite loop, resulting in simulation errors or even the crash of the simulation system. Therefore, by converting the data flow directed graph into a multi-branch tree, the ring structure is split into a sequential structure, and then by distinguishing the input port attributes of each node, the simulation system can clearly understand the flow of data, solve the problem of infinite loops, and facilitate the execution of simulation.
[0119] In order to record the input port attributes of each node, the attribute matrix is constructed and initialized. The expression of the attribute matrix is as follows:
[0120] P = p(i, k), i∈I, k∈K; (Formula 3)
[0121] In Formula 3, P represents an attribute matrix; p(i,k) is an attribute parameter, which represents the attribute of the kth output port of the i-th node.
[0122] Each attribute parameter in the attribute matrix is initialized to 1, that is, p(i,k)=1. When it is detected whether the current path has an algebraic ring structure, the attribute parameter corresponding to the node with the algebraic ring structure is modified to 0, that is, p(i,k)=0. After all paths of the multi-branch tree are traversed, the value of each attribute parameter in the attribute matrix will also be determined. At this time, for the i-th node, if p(i,k)=1, it means that the k-th output port attribute of the i-th node is the master port; if p(i,k)=0, it means that the k-th output port attribute of the i-th node is the slave port. For example, in Figure 4 In , the attribute of the input port of node B receiving data from node N is defined as a slave port; if p(i,k) is neither equal to 1 nor equal to 0, it means that the kth output port does not belong to the i-th node.
[0123] By determining the value of the attribute matrix, the simulation system can read the input port attributes of each node more quickly.
[0124] In S45, the trigger timing refers to the timing of the simulated device triggering each event during the simulation process. Based on the trigger timing of the simulated device, the time stamp of each event (also called trigger time or start time) is obtained, where the event refers to the business behavior of the node. The data flow direction of each node is clarified based on the input port attribute, and then the events are sorted according to the data flow direction of each node. Based on the sorting result, the event and its corresponding time stamp are combined into event trigger parameters. These event trigger parameters constitute a time trigger event list. The expression of the time trigger event list is as follows:
[0125] E{e(time,event)}; (Formula 4)
[0126] In Formula 4, E represents a time-triggered event list; e(·) represents an event trigger parameter, which is a two-dimensional structure; time represents the time scale of the event; and event represents an event.
[0127] In S46, the netlist, simulation time, simulation parameters, actual advancement time, precursor data indication parameters, attribute matrix, time trigger event list and other related data are stored in a preset file to generate a scenario description file. The scenario description file is transmitted to the simulation system, and the simulation system imports related data according to the scenario description file to provide data support for subsequent node simulation work.
[0128] In the simulation system's preparation phase for simulation work (also known as the initialization phase of the simulation system), the simulation system first parses the netlist in the assumption description file, and provides memory space for nodes that need predecessor data based on the node information provided by the netlist and the connection relationship between nodes, that is, to apply for and initialize the port data cache space for data transmission between nodes to prepare for the subsequent simulation process and ensure the accuracy and consistency of data transmission. Specifically, for nodes that do not require predecessor data, the simulation system does not need to set up a cache for them, and the default memory space size provided for them is 0; for nodes that require predecessor data, the simulation system will set up a memory for them, predict the memory value occupied by the predecessor data, and allocate a corresponding size of memory space to the node's memory based on this value. This memory space can be regarded as existing between two nodes with a connection relationship. After the predecessor node generates the predecessor data, the predecessor data can be directly stored in the corresponding memory space, so that the subsequent connected nodes can quickly access these predecessor data. These memory spaces constitute the port data cache space, and the expression of the port data cache space is as follows:
[0129]
[0130] In Formula 5, S represents the port data cache space; s(·) represents the memory space indicator function; and s(i,k,j,m) represents the size of the memory space provided by the mth input port of the jth node for the precursor data to be generated by the kth output port of the ith node.
[0131] After allocating memory space, the simulation system calls the initialization function of each model to load all models that need to participate in the simulation. These models can be physical models, behavioral models, environmental models, etc. They define the nodes in the simulation and the behavior of the nodes, and provide a basic simulation environment. After the simulation environment is deployed, the simulation system completes the parameter initialization of each node based on the assumption description file, including reading the simulation step of each node. In actual processing, a node may forget to set the simulation step or lose the simulation step of individual nodes during data transmission. Therefore, when there is no simulation step feedback for the node, it is processed according to the system default value so that the node has a new simulation step.
[0132] According to the simulation step of the node, the time scale of the node state update is calculated in advance. For example, if the simulation step of the node is 1 second, the node will update its state at the 1st second, 2nd second, 3rd second, etc.
[0133] In S47-S49, the time stamps in the time trigger event list and the time stamps calculated by the simulation step length of each node are merged to form a unified time stamp set. An empty linked list is created in advance, and then each time stamp in the time stamp set is traversed in chronological order. For each time stamp, the nodes that need to participate in the calculation under the time stamp are determined. Among them, the nodes participating in the calculation include two types, one is the node that executes the event; the other is the node that needs to update the status determined according to the simulation step length. These nodes include those models that need to update the status regularly, such as physical simulation, control logic, etc. Each time stamp and the nodes participating in the calculation under the time stamp are combined into a node trigger parameter (i.e., an entry). The generated node trigger parameters are stored in the empty linked list in sequence to generate a time linked list.
[0134] For example, two events are obtained through the time-triggered event list, namely event 1 and event 2. The time stamp of event 1 is 1 second, and the event involves node A; the time stamp of event 2 is 3 seconds, and the event involves node B. The simulation start time is 0 seconds, the simulation step length of node A is 1 second, and the time stamps of node A state update are calculated to be 0 seconds, 1 second, 2 seconds, 3 seconds, 4 seconds...; the simulation step length of node B is 2 seconds, and the time stamps of node B state update are calculated to be 0 seconds, 2 seconds, 4 seconds, 6 seconds... The merged time stamp set includes 0 seconds, 1 second, 2 seconds, 3 seconds, 4 seconds... Through merging, it is determined that the simulation system needs to update the status of node A and node B at 0 seconds after the subsequent simulation is officially started, process event 1 (involving node A) at 1 second, update the status of node A and node B at 2 seconds, process event 2 (involving node B) at 3 seconds, and update the status of node A at the same time, and so on. The expression of the time chain list is as follows:
[0135] G{g(time′,v)|v∈I}; (Formula 6)
[0136] In Formula 6, G represents the time list; g(·) represents the node trigger parameter; time′ represents the time scale, which is the merged time scale; v represents the node participating in the calculation under the time scale, which can be one or more.
[0137] Based on the above, the time-triggered event list is constructed according to the order of the topological signal flow, and the time linked list is constructed according to the chronological order. Through these two tables, the simulation system can simultaneously ensure that events are executed in the correct order and that the simulation time proceeds normally.
[0138] The simulation system also sets the time offset of each node. The time offset represents the time deviation of the node relative to the advancement clock value of the simulation system during the simulation process. The time deviation is caused by the data causality requirement in the calculation process. The advancement clock value refers to the reference time for simulation advancement, which is used to unify the simulation time of each node. The initial value of the time offset is 0. These time offsets are combined into a time offset set. The expression of the time offset set is as follows:
[0139] O{o(l)|l∈I}; (Formula 7)
[0140] In Formula 7, O represents a time offset set; o(l) represents the time offset of the lth node, and in the initial state, o(l)=0.
[0141] In the simulation system's preparation stage for simulation work, a time calculator is also set and initialized to record the timing value of the time calculator. The timing value is expressed as tt, and the timing value is initially 0, that is, tt=0.
[0142] In S5, the simulation system is started with the simulation start time as the starting point, marking the official start of the simulation process. Figure 5 The flowchart of the operation method of the simulation system startup phase is shown. "In the startup phase, based on the netlist and the time chain table, the causal relationship data of the node is obtained, and the actual advancement time of the node and the advancement clock value of the simulation system are updated", including the following steps:
[0143] S51: Select a node from the time linked list based on the timing value and call it;
[0144] S52: based on the netlist and the called nodes, updating the actual advancement time;
[0145] S53: Record the causal relationship data of the called node;
[0146] S54: updating the timing value, and based on the new timing value, re-calling a new node from the time linked list and updating the advancement clock value, until all nodes in the time linked list are called at least once.
[0147] In S51, a time stamp equal to the current timing value is searched from the time chain table, and the node participating in the calculation under the time stamp is called. The called node (also called the calculation node) may be one or more. The following expression is used to reflect the node screening and calling process:
[0148] u={v|g(time′,v)∈G,time′=tt}; (Formula 8)
[0149] In Formula 8, u represents the called node. Formula 8 means that from multiple node trigger parameters in the time chain table, a node trigger parameter whose time stamp is equal to the current timing value is selected, and the corresponding node is selected from the node trigger parameter and called.
[0150] Reference Figure 6 The flowchart of the actual advancement time updating method is shown, in S52, "updating the actual advancement time based on the netlist and the called node" includes the following steps:
[0151] S521: Based on the netlist, determine whether the called node has a predecessor node; if not, execute S522; if yes, execute S523;
[0152] S522: updating the actual advancement time of the called node, and the called node performs calculation;
[0153] S523: Determine whether the called node meets the preset advancement condition; if so, execute S524; if not, execute S526;
[0154] S524: Determine that the predecessor node has prepared the predecessor data, and the called node performs calculation based on the prepared predecessor data;
[0155] S525: updating the actual advancement time of each node based on the first preset function, the second preset function and the current advancement clock value of the simulation system;
[0156] S526: It is determined that the predecessor node has not prepared the predecessor data, and the called node does not perform calculation;
[0157] S527: Based on the second preset function, the third preset function and the current advancement clock value of the simulation system, update the actual advancement time of each node.
[0158] In S521 and S522, the connection relationship between nodes shown in the netlist is used to detect whether the called node has a predecessor node. If the called node does not have a predecessor node, it means that the execution of the called node does not need to rely on other nodes. The node time update function shown in the following formula 9 is directly used to update the actual advancement time of the called node, and the called node performs calculations, where the calculations include at least one of the state update and the execution event. The expression of the node time update function is as follows:
[0159] t(u)={time′|g(time′,v)∈G,time′=tt}; (Formula 9)
[0160] In formula 9, t(u) represents the actual advancement time of the called node. Formula 8 means that from multiple node trigger parameters in the time chain table, a node trigger parameter with a time stamp equal to the current timing value is selected, and the corresponding time stamp is selected from the node trigger parameter to update the actual advancement time of the called node. In essence, the actual advancement time of the called node is equal to the time stamp corresponding to the called node.
[0161] In S523-S527, when it is determined that the called node has a predecessor node, it means that the execution of the called node needs to depend on the predecessor node. At this time, it is necessary to determine whether the predecessor data is ready according to the preset advancement condition. Specifically, when the called node meets the preset advancement condition, it means that the predecessor node has been executed. Correspondingly, the predecessor data of the called node is ready. The predecessor data indication parameter of the called node is modified to 1, that is, a(u)=1, indicating that the called node can be executed next, and the called node will be calculated based on the prepared predecessor data. When the called node does not meet the preset advancement condition, it means that the predecessor node is being executed. Correspondingly, the predecessor data is not ready, and the called node cannot be executed. Among them, the expression of the preset advancement condition is as follows:
[0162]
[0163] In formula 10, r represents the predecessor node of the called node; t(r) represents the actual advancement time of the predecessor node; q(u) represents the simulation step of the u-th node, that is, the simulation step of the called node; n(r,k,u,m)=1 means that the k-th output port of the r-th node transmits data to the m-th input port of the u-th node, and there is a connection relationship between the k-th output port of the r-th node and the m-th input port of the u-th node; p(u,k)=1 means that the attribute of the k-th output port of the u-th node is the main port; ∩ represents and.
[0164] When it is determined that the predecessor node has prepared the predecessor data, the time offset of the active node is updated based on the preset first preset function, and the time offset of the inactive node is updated based on the preset second preset function. The time offsets of all nodes are composed of the time offsets of the active node and the time offsets of the inactive node, and the actual advancement time of each node is updated according to these time offsets. Among them, the active node refers to the node participating in the simulation operation in the current beat, and the active node includes the called node and the predecessor node; the inactive node refers to the node not participating in the simulation operation in the current beat, and the inactive node includes the nodes other than the called node and the predecessor node. The current beat is determined by the timing value, which represents the current time after the simulation time is discretized.
[0165] The expression of the first preset function is as follows:
[0166] o′(x)=o(x)-(time1-time2-q(x)); (Formula 11)
[0167] In Formula 11, x represents an active node; o′(x) represents the time offset after the active node is updated; o(x) represents the time offset before the active node is updated; time1 represents the time scale currently used by the time list, that is, the time scale in the time list that is equal to the current timing value; time2 represents the time scale last used by the time list, that is, the time scale in the time list that is equal to the previous timing value; q(x) represents the simulation step of the active node.
[0168] The expression of the second preset function is as follows:
[0169] o′(y)=o(y)+(time1-time2); (Formula 12)
[0170] In Formula 12, y represents an inactive node; o′(y) represents the time offset after the inactive node is updated; o(y) represents the time offset before the inactive node is updated;
[0171] After the time offset of each node is updated, the new actual advancement time of each node is calculated using the current advancement clock value of the simulation system and the updated time offset. The new actual advancement time is equal to the difference between the current advancement clock value and the updated time offset. The expression of the actual advancement time is as follows:
[0172] t′(l)=To(l); (Formula 13)
[0173] In Formula 13, t′(l) represents the actual advancement time after the node is updated; T represents the current advancement clock value of the simulation system.
[0174] When it is determined that the predecessor node is not ready for the predecessor data, the time offset of the active node is updated based on the third preset function, and the time offset of the inactive node is updated based on the second preset function. The actual advancement time of each node is updated according to these time offsets and formula 13. The expression of the third preset function is as follows:
[0175] o′(x)=o(x)+(time1-time2). (Formula 14)
[0176] In S53, the startup phase of the simulation system is equivalent to the internal warm-up of the system. All nodes are called at least once, and causal relationship data is recorded during the calling process. The causal relationship data includes predecessor nodes, predecessor data, successor nodes, connection relationships with predecessor nodes and successor nodes (that is, the flow of data before and after the called node), calculation results (including at least one of the results of state update and event execution), and at least one of the results of computing resource allocation (including the processor used by the called node, communication channel, etc.).
[0177] In S54, the current timing value is added to the preset cycle value to obtain a new timing value, which can be set to 1 second. Once the new timing value is obtained, the new corresponding time scale is immediately queried from the time chain table through the new timing value, and then the new node is called based on the new time scale, and the time scale of the called new node is set to the new advancement clock value. In this way, the actual advancement time of the node and the advancement clock value of the simulation system are repeatedly updated to keep the time synchronized, and the corresponding events or status updates are executed at the same time to advance the operation of the simulation until all nodes in the time chain table are called at least once.
[0178] In S6-S7, when all nodes are called at least once, it means that the startup phase is over and the pipeline phase begins. At this time, the simulation system has understood the causal relationship of all nodes, and updated all time scales in the time chain list, that is, each time scale is added to the preset period value to obtain a new time scale, and then the time chain list is called in a loop in the order of each node. After the time chain list is traversed once, the time chain list will be updated to feedback the next call time until the preset simulation end condition is met. According to the actual simulation requirements, the setting of the simulation end condition can be different. Here, the present application provides a simulation end condition, that is, when the actual advancement time of each node is greater than the preset simulation deadline, the simulation is ended and the corresponding nodes and memory space are released.
[0179] YY+242341P-YX
[0180] In the process of calling a node, it will respond to the corresponding event or other operation. In each beat, the simulation system transmits the predecessor data in the memory space to the port of the corresponding node through the shared memory or network communication interface according to the relationship between the sending and receiving nodes, and calls the corresponding node to perform an action. Synchronously, the node performs synchronous cache management of time and data. Based on the current actual advancement time and advancement clock value, the actual advancement time of the node will continue to be updated in the subsequent loop calling node. In order to unify the time of the node and the simulation system, the timing value and advancement clock value will continue to be updated. However, in the pipeline stage, there is no need to determine whether the called node meets the preset advancement condition. The time offset of the active node is directly updated based on the first preset function, and the time offset of the inactive node is updated based on the second preset function. Then, based on the time offset of these nodes and combined with formula 13, the corresponding actual advancement time can be updated.
[0181] Traditional methods can no longer meet the needs of digital simulation for describing and analyzing complex problems, and there is an urgent need to build a hierarchical system or a more sophisticated network structure. For example, in the traditional joint simulation of multiple types of equipment, the simulation objects can be divided into multiple levels according to the granularity, such as task level, combat level and engineering level. For the model with engineering-level granularity, the object it faces is usually the digital model of a single electronic equipment. With the increasing complexity of the functions of electronic equipment, the simulation requirements are gradually upgraded, especially for the fine characterization of the electromagnetic domain, which often requires a signal-level simulation granularity of microseconds (μs) or even nanoseconds (ns). However, the simulation granularity and signal flow of different components are complex. In the simulation process, not only causality and timing constraints need to be considered, but also computational efficiency and data synchronization across clock domains need to be taken into account.
[0182] Traditional multi-equipment digital models usually use the entire electronic equipment as a meta-model, and use a mixed step or dynamic step scheduling strategy through the communication middleware to handle information interaction and synchronization issues between platforms. However, this approach has problems such as insufficient meta-model granularity, low data interaction efficiency, and insufficient parallel scheduling capabilities. For the first problem, the traditional solution uses the entire electronic equipment as a meta-model, which cannot meet the simulation requirements of the new generation of electronic equipment. Although the introduction of fine-grained models can improve the description accuracy, it also increases the complexity of the model, resulting in multiple feedback loops between nodes, and the signal flow graphs between different equipment are significantly different, which poses a severe challenge to data synchronization and causality determination. For the second problem, the internal processing processes of electronic equipment in the traditional solution are coupled with each other, the data types are diverse and span multiple clock domains. The traditional data interaction method based on communication middleware is difficult to meet the computing efficiency requirements, especially when facing high refresh rate data interaction, it is particularly important to dynamically adjust the communication strategy. For the third problem, the traditional module sorting pipeline scheduling method for fine-grained equipment topology in the traditional solution is difficult to meet the parallel processing requirements. How to efficiently drive the advancement of multi-equipment simulation based on the new generation of graphical and process-oriented visualization module blueprints is still a difficulty.
[0183] In view of the above problems, the multi-device joint simulation method proposed in the present disclosure can realize the simulation advancement and data time synchronization of complex topological structures on the graph. By constructing the memory space between the transmitting and receiving nodes based on the netlist, the master / slave extension attribute of the port is automatically determined according to the directed graph depth judgment criterion, thereby solving the algebraic loop simulation problem of the feedback system. At the same time, causal judgment is performed in combination with the time chain table to ensure the scheduling timing of each node in the simulation system and the synchronization of node data under simulation advancement. In addition, this method can also meet the needs of dynamic simulation step adjustment.
[0184] In summary, this method is based on the componentized model parallel scheduling and data synchronization simulation method and simulation platform defined by the netlist, which can solve the problems of simulation advancement, data synchronization and computing efficiency of complex fine-grained components.
[0185] Reference Figure 7 The present disclosure provides a multi-device joint simulation system, comprising:
[0186] The information acquisition module 101 is used to acquire device information of multiple devices to be simulated;
[0187] A directed graph construction module 102 is used to construct a data flow directed graph based on the device information, wherein the data flow directed graph is composed of nodes representing each device to be simulated and directed edges representing data flow directions;
[0188] A netlist construction module 103, used to construct a netlist based on each directed edge and point information of each node in the data flow directed graph;
[0189] A linked list construction module 104 is used to obtain the trigger timing of the device to be simulated and to construct a time linked list based on the data flow directed graph and the trigger timing;
[0190] The system startup module 105 is used to obtain the causal relationship data of the node based on the netlist and the time chain table, and update the actual advancement time of the node and the advancement clock value of the simulation system;
[0191] The linked list updating module 106 is used to update the time linked list after the causal relationship data between all nodes are acquired;
[0192] The sequential calling module 107 is used to sequentially call each node for calculation according to the causal relationship data, the actual advancement time, the advancement clock value and the new time chain table until the preset simulation end condition is met.
[0193] The various variations and specific examples of the multi-device joint simulation method provided above are also applicable to the multi-device joint simulation system provided in the present disclosure. Through the above detailed description of the multi-device joint simulation method, those skilled in the art can clearly know the implementation method of the multi-device joint simulation system. For the sake of brevity of the specification, it will not be described in detail here.
[0194] The computer device according to the embodiment of the present disclosure includes a memory and a processor. The memory is used to store non-temporary computer-readable instructions. Specifically, the memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a
[0195] Hard disk, flash memory, etc.
[0196] The processor may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the computer device to perform desired functions. In one embodiment of the present disclosure, the processor is used to run the computer-readable instructions stored in the memory, so that the computer device performs all or part of the steps of the multi-device joint simulation method of each embodiment of the present disclosure.
[0197] Those skilled in the art should be able to understand that in order to solve the technical problem of how to obtain a good user experience, the present embodiment may also include well-known structures such as a communication bus and an interface, and these well-known structures should also be included in the protection scope of the present disclosure.
[0198] like Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure is shown, which is a schematic diagram of the structure of a computer device suitable for implementing the embodiment of the present disclosure. Figure 8 The computer device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0199] like Figure 8 As shown, the computer device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the computer device are also stored. The processor, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0200] Typically, the following devices can be connected to the I / O interface: input devices such as sensors or visual information acquisition devices; output devices such as display screens; storage devices such as tapes, hard disks, etc.; and communication devices. The communication device can allow the computer device to communicate with other devices (such as edge computing devices) wirelessly or by wire to exchange data. Figure 8 A computer device having various devices is shown, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0201] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processor, all or part of the steps of the multi-device joint simulation method of an embodiment of the present disclosure are executed.
[0202] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0204] According to the computer-readable storage medium of the embodiment of the present disclosure, non-transitory computer-readable instructions are stored thereon. When the non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the multi-device joint simulation method of each embodiment of the present disclosure are executed.
[0205] The above-mentioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or mobile hard disk), media with built-in rewritable non-volatile memory (e.g., memory card) and media with built-in ROM (e.g., ROM box).
[0206] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0207] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0208] In the present disclosure, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. The block diagrams of the devices, devices, equipment, and systems involved in the present disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.
[0209] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0210] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0211] YY+242341P-YX
[0212] Various changes, substitutions, and modifications of the techniques described herein may be made without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the present disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and actions described above. Currently existing or later to be developed processes, machines, manufactures, compositions of events, means, methods, or actions that perform substantially the same functions or achieve substantially the same results as the corresponding aspects described herein may be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or actions within their scope.
[0213] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0214] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A multi-device joint simulation method, characterized in that: include: Get device information of multiple devices to be simulated; Constructing a data flow directed graph based on the device information, wherein the data flow directed graph is composed of nodes representing each device to be simulated and directed edges representing data flow directions; Constructing a netlist based on each directed edge and point information of each node in the data flow directed graph; Acquire the trigger timing of the device to be simulated, and construct a time chain table based on the data flow directed graph and the trigger timing; Based on the netlist and the time chain table, obtaining causal relationship data of the node, and updating the actual advancement time of the node and the advancement clock value of the simulation system; When the causal relationship data between all nodes are acquired, the time chain table is updated; According to the causal relationship data, the actual advancement time, the advancement clock value and the new time chain table, each node is called sequentially for calculation until a preset simulation end condition is met.
2. The multi-device joint simulation method according to claim 1, characterized in that: The expression of the netlist is: N{n(i,k,j,m)|i,j∈I,k∈K,m∈M}; Wherein, N represents the netlist; n(·) represents the connection function, n∈N; i and j represent nodes; k represents the output port; m represents the input port; I represents the node set; K represents the output port set; M represents the input port set; when n(i,k,j,m)=1, it means that the kth output port of the i-th node passes data to the mth input port of the j-th node; when n(i,k,j,m)=0, it means that the kth output port of the i-th node does not pass data to the mth input port of the j-th node.
3. The multi-device joint simulation method according to claim 1, characterized in that: The step of obtaining the trigger timing of the device to be simulated and constructing a time chain table based on the data flow directed graph and the trigger timing includes: Based on the data flow directed graph, construct a multi-branch tree; Traversing all paths of the multi-branch tree to determine whether the current path has an algebraic ring structure; If so, the input port attribute of the node with the algebraic ring structure is set to a slave port; If not, set the input port attribute of the node included in the current path to the primary port; Based on the input port attributes and the trigger timing, construct a time-triggered event list, wherein the time-triggered event list includes events and time stamps of the events; Based on the simulation step size of each node, obtain the time scale of each node status update; Merge the time stamps in the time-triggered event list and the time stamps of each node status update into a time stamp set; Traversing the time scale set in time order, and generating a plurality of node trigger parameters in the traversal order, wherein the node trigger parameters include the time scale and the nodes participating in the calculation under the time scale; The node trigger parameters are stored in a preset empty linked list to generate a time linked list.
4. The multi-device joint simulation method according to claim 3, characterized in that: The step of acquiring the causal relationship data of the node based on the netlist and the time chain table, and updating the actual advancement time of the node and the advancement clock value of the simulation system includes: Recording a timing value of a preset time counter, wherein the timing value is initially 0; Select a node from the time linked list based on the timing value and call it; Based on the netlist and the called node, updating the actual advancement time; Record the causal relationship data of the called nodes; Updating the timing value, and based on the new timing value, re-calling a new node from the time linked list and updating the advancement clock value until all nodes in the time linked list are called at least once; The causal relationship data includes at least one of a predecessor node, predecessor data, a successor node, a connection relationship with the predecessor node and the successor node, a calculation result, and a calculation resource allocation result.
5. The multi-device joint simulation method according to claim 4, characterized in that: The updating of the actual advancement time based on the netlist and the called node includes: Based on the netlist, determining whether the called node has a predecessor node; If not, the actual advancement time of the called node is updated, and the called node performs calculation; If yes, determine whether the called node meets the preset advancement conditions; If the conditions are met, it is determined that the predecessor node has prepared the predecessor data, and the called node performs calculation based on the prepared predecessor data; Based on the first preset function, the second preset function and the current advancement clock value of the simulation system, updating the actual advancement time of each node; If not, it is determined that the predecessor node has not prepared the predecessor data, and the called node does not perform calculations; Based on the second preset function, the third preset function and the current advancement clock value of the simulation system, the actual advancement time of each node is updated.
6. The multi-device joint simulation method according to claim 5, characterized in that: The expression of the preset propulsion condition is: Among them, r represents the predecessor node of the called node; t(r) represents the actual advancement time of the predecessor node; u represents the called node; q(u) represents the simulation step of the u-th node; k represents the output port; m represents the input port; n(r,k,u,m)=1 means that the k-th output port of the r-th node transmits data to the m-th input port of the u-th node; I represents the node set; I represents the node set; K represents the output port set; p(u,k)=1 means that the attribute of the k-th output port of the u-th node is the main port; ∩ represents and.
7. The multi-device joint simulation method according to claim 6, characterized in that: The expression of the first preset function is: o′(x)=o(x)-(time1-time2-q(x)); Wherein, x represents an active node, and the active node includes a called node and a predecessor node; o′(x) represents the time offset after the active node is updated; o(x) represents the time offset before the active node is updated; time1 represents the time scale currently used by the time chain list; time2 represents the time scale last used by the time chain list; q(x) represents the simulation step size of the active node; The expression of the second preset function is: o'(y)=o(y)+(time1-time2); Wherein, y represents an inactive node, and the inactive node includes nodes other than the called node and the predecessor node; o′(y) represents the time offset after the inactive node is updated; o(y) represents the time offset before the inactive node is updated; The expression of the third preset function is: o′(x)=o(x)+(time1-time2).
8. The multi-device joint simulation method according to claim 1, characterized in that: The updating of the timing value comprises: Add the current timing value to the preset period value to obtain a new timing value; The updating of the advancement clock value comprises: The timestamp of the new node being called is set to the new advance clock value.
9. A computer device, characterized in that: The computer device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the multi-device joint simulation method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the multi-device joint simulation method described in any one of claims 1-8.
Citation Information
Patent Citations
Parallel time sequence propelling method suitable for discrete event system simulation and electronic equipment
CN114528066A
Time synchronization method and device for logistics network simulation and storage medium
CN115630937A
Event library-based simulator simulation method, system and equipment and medium
CN116011371A
Simulation operation control method based on task chain
CN118642823A
Event causality identification method and apparatus, computer device, and storage medium
WO2024230276A1