A cross-system real-time simulation scheduling method and system

By introducing a model bus and a distributed joint simulation bus into cross-system joint simulation, data interaction and joint simulation scheduling of cross-system models are realized, solving the problems of model interconnection and scheduling in the existing technology, and improving simulation efficiency and accuracy. .

CN117997761BActive Publication Date: 2025-01-24CHINA STATE SHIPBUILDING CORP LTD RESEARCH INSTITUTE 719
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410185891.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-19
Publication Date
2025-01-24
Estimated Expiration
2044-02-19

AI Technical Summary

Technical Problem

The existing technology cannot achieve direct interconnection across systems, cross-platform and diversified models, and the lack of unified integration, scheduling and management, making it difficult to achieve data interaction and joint simulation scheduling of functional models and performance models.

Method used

This paper proposes a cross-system real-time simulation scheduling method and system, using the model bus as a hub for model synchronization solution and data interaction to achieve distributed, multi-node joint simulation of cross-domain, cross-tool, and cross-scale models. The system includes a master node, distributed nodes and a distributed joint simulation bus. It implements performance model integration and scheduling through FMU integration, and implements functional model integration and scheduling through TCP and UDP protocols.

Benefits of technology

Realize data interaction and joint simulation scheduling across system models, support the access and scheduling of multiple simulation models, ensure the time synchronization and data consistency between the models, and improve the simulation efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117997761B_ABST
    Figure CN117997761B_ABST
Patent Text Reader

Abstract

The present invention discloses a cross-system real-time simulation scheduling method and system, including: the master node is the core of the joint simulation, the joint simulation integrated control center, and the initiating node of the process. The master node uniformly publishes time to the distributed nodes to ensure the time consistency of each node and avoid being affected by the local time of the node host. The distributed node is the core service for model access, realizing all-round management and scheduling of the model, and can interact with physical equipment and test benches through rich extension interfaces to realize virtual joint simulation. The distributed joint bus service supports flexible access of various types of protocols, and data collection between node services is implemented based on the DDS middleware of the publish-subscribe mode to ensure rapid linkage of the system. The present invention is based on the master-slave mode architecture to realize cross-system function and performance model scheduling that supports multiple strategy forms, and supports the timing unification and stable operation of function and performance models in cross-system joint simulation scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cross-system joint simulation, and more specifically, relates to a cross-system real-time simulation scheduling method and system. Background Art

[0002] Since there are barriers between cross-system, cross-platform, and diversified models, they cannot be directly interconnected and lack unified integration, scheduling, and management. Therefore, how to solve the data interaction and joint simulation scheduling of functional models and performance models is a key issue. By proposing a cross-system real-time simulation scheduling method and system, with the model bus as the hub for model synchronous solution and data interaction, distributed, multi-node joint simulation of cross-domain, cross-tool, and cross-scale models is realized. Summary of the invention

[0003] In view of the defects existing in the above-mentioned prior art, the present invention proposes a cross-system real-time simulation scheduling method and system, including a master node, distributed nodes and a distributed joint simulation bus. In the cross-system joint simulation process, the function and performance models are located on each distributed node, supporting the access of each simulation model, and realizing the integration and scheduling of the performance model through the FMU integration mode; and realizing the integration and scheduling with the function model through the network communication TCP and UDP protocol communication forms.

[0004] The master node is a joint simulation integrated control node, which configures and initiates joint simulation tasks, and controls, interacts with and monitors all nodes;

[0005] The distributed nodes are model access nodes that manage and schedule models, including model input, model output, stepping, control, and loading and unloading;

[0006] The distributed joint simulation bus provides an interface based on a unified abstract channel to send and receive data;

[0007] The main node includes a human-computer interaction interface, which uploads the performance model and the functional model through files or integrated configuration based on the human-computer interaction method, and builds a cross-system simulation scenario based on the graphical interaction interface, including arranging models and associated models, configuring parameters and model operation nodes;

[0008] The master node also includes a joint simulation integrated control system, which generates and issues a joint simulation model configuration file; the joint simulation integrated control system performs simulation scheduling, including timing each model, using time accumulation, and when it is detected that the token state of the registered model that has reached the next step is in the sent state, the time accumulation is stopped, and the registered model that has not been solved in the registered model that has reached the next step is completed.

[0009] The distributed nodes perform initialization and verification, including obtaining information such as collectable data points, simulation steps, simulation unit lists, and controllable models during the deployment and operation of the system nodes, and performing basic verification of the model using configuration test cases; and executing model scheduling based on the model tasks sent by the master node through unified instructions, starting joint simulation according to the instructions of the simulation configuration, and sending data to the master node and other nodes that require data through a publish-subscribe mechanism.

[0010] The distributed joint simulation bus transmits data between nodes based on the DDS middleware in the publish-subscribe mode.

[0011] The master node uses the control interface provided by the joint simulation scenario to start and stop the joint simulation scenario. It can start and stop the scenario with one click through the interface provided by the tool and provide a control interface to the outside.

[0012] Through the control interface provided by the joint simulation scene, the current simulation scene section is recorded when analyzing typical working conditions during the virtual-real interaction process, the simulation is restored through the recovery control interface, and the control interface is provided to the outside;

[0013] Through the control interface provided by the joint simulation scenario, the simulation process can be accelerated / decelerated, and synchronization with the real physical system can be achieved through flexible acceleration and deceleration;

[0014] The control interface provided by the joint simulation scenario is used to control the control units in the system.

[0015] In the simulation scheduling process, the minimum step size of the entire system is used as the basic scheduling unit. A joint simulation scheduling instruction sequence is generated, and scheduling instructions are issued to each node according to the sequence. After receiving the scheduling instructions, each node model completes execution and data exchange.

[0016] The joint simulation integrated control system performs simulation scheduling including:

[0017] Import the time module that provides time-related function methods;

[0018] Define a ModelTimer class for timing the solution time of the model, the ModelTimer class includes an __init__(self) initialization method for setting the initial timer state, a start(self) timing method for recording the current time as the start time, a stop(self) method for stopping the timing, calculating the elapsed time and adding it to the total time, and a get_total_time(self) method for obtaining the accumulated total time; based on the model timer class, create an instance of the model timer, and use the start(self) method to start timing, the stop(self) method to stop timing, and the get_total_time(self) method to obtain the accumulated total time;

[0019] Create an empty model timer object dictionary model_timers to store the timer objects corresponding to each model;

[0020] Create a model state dictionary registered_models, including the token state, current step size, and next step size information of each model;

[0021] Use the time.time() function to get the start time stamp and save it in the variable start_time;

[0022] Use a while loop to perform model calculations until all registered models are solved.

[0023] The distributed nodes schedule the model tasks based on the unified instructions sent by the master node, including:

[0024] Define parameters, including the number of distributed nodes N, the model task list model_tasks containing the model tasks to be executed, and the task scheduling list task_schedule used to record the tasks assigned to each node;

[0025] The master node distributes the model task list model_tasks evenly to N distributed nodes;

[0026] The distributed node receives the task scheduling instruction assigned by the master node and updates the local task scheduling list task_schedule;

[0027] Model task scheduling loop, enters the loop until all model tasks are completed;

[0028] The distributed node checks the local task scheduling list task_schedule to find the next task to be executed;

[0029] Distributed nodes execute model tasks, including executing currently assigned tasks;

[0030] The distributed node marks the current task as completed;

[0031] The master node waits for all distributed nodes to complete the current task;

[0032] The master node checks whether all distributed nodes have completed the current task. If so, it assigns the next unfinished task to the node;

[0033] All model tasks completed.

[0034] Starting the joint simulation further includes: the distributed nodes start the joint simulation within the specified simulation time according to the simulation configuration instructions, and the master node acts as a source of the simulation time to ensure that each node steps according to the same simulation time, and further includes:

[0035] Define parameters, including total simulation time T_sim, simulation step dt, and current simulation time t;

[0036] The master node initializes the simulation time t=0;

[0037] Distributed nodes receive simulation time t=0;

[0038] Joint simulation loop: enter the loop until the simulation time reaches the total duration T_sim;

[0039] The master node broadcasts the current simulation time t to all distributed nodes;

[0040] The distributed node receives the simulation time broadcast by the master node and updates the local simulation time t=t_received, where t_received is the simulation time received from the master node;

[0041] Perform joint simulation tasks, and each node performs the corresponding simulation task according to the current simulation time t;

[0042] The master node waits for all distributed nodes to complete the current simulation step;

[0043] The distributed node completes the current simulation step and notifies the master node;

[0044] The master node checks whether all distributed nodes have completed the current simulation step. If so, it updates the simulation time t=t+dt;

[0045] The simulation ends.

[0046] In the process of virtual joint debugging data interaction, the simulation model is controlled based on distributed nodes by formulating interfaces with joint simulation scenarios, including:

[0047] Initialization information interface, used to obtain basic information of simulation model, including the attributes of output data, the attributes of input data and basic controllable information of the model;

[0048] Real-time data interface, used to obtain real-time simulation data of each model unit and node during the simulation process, supporting active acquisition of data and event notification through model node ID, name, etc.;

[0049] System model control interface, used for overall interface control of joint simulation scenarios, including start, stop, pause, step, accelerate, and decelerate;

[0050] Model unit control interface, used to control a certain model unit during the simulation process;

[0051] The simulation time synchronization interface is used to obtain the system running time in the current joint simulation scenario, and then compare and calibrate the time with the actual equipment running time.

[0052] The master node takes the start of simulation as the starting time, and publishes the simulation time to distributed nodes through the data service bus based on the preset frequency. Each node subscribes to the time topic and receives the unified time data regularly, which is used for model time synchronization and disconnection reconnection and other mechanism processing.

[0053] The master node also includes a status monitoring module to monitor the joint simulation scenario, including real-time monitoring of key elements such as running time and resource usage, and evaluate and analyze the running status of the joint simulation scenario.

[0054] The integration and calling of the model of the present invention completes the integration and scheduling of the model through the slave node of the master-slave mode. The scheduling part mainly consists of two parts: model scheduling and joint simulation scheduling. The simulation model node scheduling is deployed on each distributed node, and the initialization, start and stop and step control of the model are realized through the model access service, and the data exchange with the model is completed during the simulation process; the joint simulation comprehensive scheduling service is an independent operation service, which realizes the interaction with each node through distributed communication, uniformly manages each node, and schedules and distributes the data between nodes according to the simulation configuration, and establishes a unified time service to ensure the time consistency of each node model. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0056] Figure 1 A cross-system real-time simulation scheduling system is shown.

[0057] Figure 2 FIG. 2 shows the co-simulation scheduling queue.

[0058] Figure 3 It shows that data is collected in real time.

[0059] Figure 4 It shows the model verification.

[0060] Figure 5 The model schedule is shown.

[0061] Figure 6 FIG. 1 is a simulation schedule showing mixed step sizes across systems. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0063] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.

[0064] It should be understood that although the terms first, second, third, etc. may be used to describe ... in the embodiments of the present invention, these ... should not be limited to these terms. These terms are only used to distinguish .... For example, without departing from the scope of the embodiments of the present invention, the first ... may also be referred to as the second ..., and similarly, the second ... may also be referred to as the first ....

[0065] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0066] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0067] It should also be noted that the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the commodity or device including the elements.

[0068] Real-time simulation scheduling is the core of cross-system joint simulation. Distributed joint simulation is realized in the form of one master and multiple slaves. The master node mainly receives simulation input, remotely deploys models to each node and completes initialization. During simulation, centralized multi-system simulation joint scheduling is completed, and the control instructions of each node are uniformly issued by the master node. The slave node completes the access and actual scheduling of the terminal model, and monitors the model status and other information in real time. The simulation data bus is based on the publish-subscribe mode to realize flexible information interaction between nodes.

[0069] Based on the joint simulation configuration, the master node will remotely control the deployment of each node. The model file is transmitted using the FTP protocol. The distributed nodes integrate the FTP service, and the master node remotely completes the upload of the FMU model file or the secondary packaged model file.

[0070] Simulation control mainly involves management and control during operation. The module provides two parts: human-computer interaction interface control and background control. Background control can provide interface services to software such as 3D visualization, mainly including the following modes of control:

[0071] The start and stop control of the joint simulation scenario is achieved through the control interface provided by the joint simulation scenario. One-click start and stop can be achieved through the interface provided by the tool, and a control interface is provided to the outside.

[0072] Through the control interface provided by the joint simulation scene, it is possible to record the current simulation scene section when analyzing typical working conditions during the virtual-reality interaction process, restore the simulation through the recovery control interface, and provide a control interface to the outside.

[0073] The simulation process can be accelerated / decelerated through the control interface provided by the joint simulation scenario, and synchronization with the real physical system can be achieved through flexible acceleration / deceleration.

[0074] Through the control interface provided by the joint simulation scenario, controllable units in the system, such as pumps and valves, can be controlled.

[0075] Among them, the joint simulation integrated control system uses the accumulation of natural time to time each model, and when it detects that the token state of the registered model that has reached the next step is in the sent state, it stops the natural accumulation of time and waits for the registered model that has not been solved to complete the solution in the registered model that has reached the next step. This ensures the unity of the physical time of each model in the joint simulation, so that the logic of the joint simulation will not be confused, and the simulation efficiency is improved.

[0076] The joint simulation integrated control system performs simulation scheduling further including:

[0077] Import the time module that provides time-related function methods;

[0078] Define a ModelTimer class for timing the solution time of the model, the ModelTimer class includes an __init__(self) initialization method for setting the initial timer state, a start(self) timing method for recording the current time as the start time, a stop(self) method for stopping the timing, calculating the elapsed time and adding it to the total time, and a get_total_time(self) method for obtaining the accumulated total time; based on the model timer class, create an instance of the model timer, and use the start(self) method to start timing, the stop(self) method to stop timing, and the get_total_time(self) method to obtain the accumulated total time;

[0079] Create an empty model timer object dictionary model_timers to store the timer objects corresponding to each model;

[0080] Create a model state dictionary registered_models, including the token state, current step size, and next step size information of each model;

[0081] Use the time.time() function to get the start time stamp and save it in the variable start_time;

[0082] Use a while loop to perform model calculations until all registered models are solved.

[0083] Among them, the joint simulation process fully considers the differences in simulation step sizes of different system models. Therefore, in the simulation scheduling process, the minimum step size of the entire system is used as the basic scheduling unit, such as Figure 2 As shown, by generating a joint simulation scheduling instruction sequence and issuing scheduling instructions to each node according to the sequence, each node model completes execution and data exchange after receiving the scheduling instruction.

[0084] The master node service issues instructions uniformly through the simulation data bus service. When issuing instructions, the model ID is used for identification. Each distributed node receives the instruction and identifies it before executing it.

[0085] Receive the status of the node execution result, obtain the status after the key node ends, and block the joint simulation process when the key node executes abnormally.

[0086] Among them, a unified time service is realized through a high-precision timer. The time starts from the simulation as 0, the minimum unit is ms, and the simulation time is regularly released to the entire platform through the data service bus at a frequency of 10Hz.

[0087] The simulation data service based on the publish-subscribe model completes time distribution. The time is unified using an independent topic. Each node subscribes to the time topic and regularly receives unified time data, which is used for model time synchronization and disconnection reconnection and other mechanism processing.

[0088] Among them, status monitoring mainly monitors the current operation of the joint simulation scenario, including real-time monitoring of key elements such as running time and resource usage, and evaluates and analyzes the running status of the joint simulation scenario.

[0089] Among them, the main purpose is to collect key variables and output data during the simulation process, using two modes: passive event notification collection and timed update collection, and display them in real time, such as Figure 3 The module obtains data from the interface provided to the joint simulation scenario according to the configuration in the simulation management, caches the simulation situation information in real time and stores it in the database.

[0090] Real-time data collection supports dual-mode collection and supports flexible expansion of multiple interface modes. It uses the collected data for real-time verification and display, and provides various display methods such as charts to provide convenient real-time monitoring services.

[0091] Obtain the CPU, memory and other operating status of each distributed simulation node in real time, monitor the current resource usage status of all nodes, and flexibly control the simulation advancement rate.

[0092] Obtain the current model status from distributed nodes in real time, including model time and model status, and monitor the running status of each model in real time.

[0093] Among them, during the virtual joint debugging data interaction process, the distributed slave nodes, based on the distributed node service, achieve in-depth control of the simulation model by formulating interfaces with the joint simulation scenario. The main interfaces are as follows:

[0094] The initialization information interface is used to obtain the basic information of the simulation model, including the properties of the output data, the properties of the input data, and the basic controllable information of the model.

[0095] The real-time data interface is used to obtain real-time simulation data of each model unit and node during the simulation process. It supports two modes of data information acquisition, including active data acquisition through model node ID, name, etc. and event notification, to ensure the real-time nature of the data.

[0096] The system model control interface is oriented to the overall interface control of the joint simulation scenario, including start, stop, pause, step, accelerate, decelerate and other functional points. Among them, the temporary time needs to ensure the current real-time simulation storage and be able to run the simulation normally after recovery; the acceleration and deceleration functions are mainly used to synchronize with the actual equipment time when errors occur.

[0097] The model unit control interface controls a certain model unit during the simulation process, such as the control functions of pumps, valves and other equipment.

[0098] The simulation time synchronization interface is mainly used to obtain the system running time in the current joint simulation scenario, and then compare and calibrate the time with the actual equipment running time.

[0099] Among them, model verification, obtaining the system node deployment and operation process can collect data points, simulation steps, simulation unit lists and controllable models and other information and confirming with the actual configuration, and basic verification of the model through configuration test cases, such as Figure 4 shown.

[0100] Model scheduling refers to the detailed scheduling implementation method through node services during simulation and experiment. Figure 5 shown.

[0101] Through data synchronization, the input, output, and state automation control of each frame of the digital model are synchronized, and the state synchronization of multiple models is achieved based on the distributed bus. On the other hand, when there is an error between the model state / output and the physical measurement value, the correction strategy and correction parameters are adjusted in real time, and the error data is accumulated. The digital model can be analyzed and optimized comprehensively based on the accumulated data.

[0102] Among them, in the joint simulation process, cross-system scheduling relies on the master node to complete the model task execution scheduling through unified instruction sending, and the data is sent to the master node service and other required data node services through the publish-subscribe mechanism after the node model data is output through topic publishing.

[0103] Among them, the parameters are defined, including the number of distributed nodes N, the model task list model_tasks containing the model tasks to be executed, and the task scheduling list task_schedule for recording the tasks assigned to each node;

[0104] The master node distributes the model task list model_tasks evenly to N distributed nodes;

[0105] The distributed node receives the task scheduling instruction assigned by the master node and updates the local task scheduling list task_schedule;

[0106] Model task scheduling loop, enters the loop until all model tasks are completed;

[0107] The distributed node checks the local task scheduling list task_schedule to find the next task to be executed;

[0108] Distributed nodes execute model tasks, including executing currently assigned tasks;

[0109] The distributed node marks the current task as completed;

[0110] The master node waits for all distributed nodes to complete the current task;

[0111] The master node checks whether all distributed nodes have completed the current task. If so, it assigns the next unfinished task to the node;

[0112] All model tasks completed.

[0113] The starting of the joint simulation further includes: the distributed nodes start the joint simulation within the specified simulation time according to the simulation configuration instruction, and the master node acts as the source of the simulation time to ensure that each node steps according to the same simulation time, and further includes:

[0114] Define parameters, including total simulation time T_sim, simulation step dt, and current simulation time t;

[0115] The master node initializes the simulation time t=0;

[0116] Distributed nodes receive simulation time t=0;

[0117] Joint simulation loop: enter the loop until the simulation time reaches the total duration T_sim;

[0118] The master node broadcasts the current simulation time t to all distributed nodes;

[0119] The distributed node receives the simulation time broadcast by the master node and updates the local simulation time t=t_received, where t_received is the simulation time received from the master node;

[0120] Perform joint simulation tasks, and each node performs the corresponding simulation task according to the current simulation time t;

[0121] The master node waits for all distributed nodes to complete the current simulation step;

[0122] The distributed node completes the current simulation step and notifies the master node;

[0123] The master node checks whether all distributed nodes have completed the current simulation step. If so, it updates the simulation time t=t+dt;

[0124] The simulation ends.

[0125] The simulation management function module mainly obtains basic information about the system model, generates a unique identifier, avoids repeated interactions during multiple uses in the future, and can record caches. Other information, including output data, monitoring data, and controllable model units during the simulation process, can be viewed and managed through the human-computer interaction interface, and supports manual adjustment.

[0126] When the model runs abnormally, the simulation and time update are suspended, such as disconnection, simulation execution error, etc. The specific abnormal handling is as follows:

[0127] The service will automatically reconnect when it is disconnected. After successful reconnection, the master node will issue a recalibrated time to continue the simulation.

[0128] If the simulation fails, re-step according to the strategy and calibrate the time.

[0129] Terminate the simulation or use the previous value output according to the strategy configuration.

[0130] In the process of cross-system function and performance joint simulation, due to the different fields and systems involved, the accuracy and step size of the system simulation models in each field are inconsistent. Therefore, how to solve the scheduling of multiple step sizes and accuracy models is the main problem faced in realizing cross-system joint simulation scheduling.

[0131] In the joint simulation process of cross-system function and performance models, the functional models are mainly based on processes, functions, discrete events, etc. Therefore, when participating in the simulation process, the main purpose is to trigger task events in typical scenarios, and there is no step problem. Therefore, asynchronous hybrid simulation scheduling mainly solves the step scheduling and data exchange of performance models.

[0132] Among them, for the multi-step hybrid simulation scheduling method, firstly, based on the three elements of real-time simulation model input, output and step, the minimum step is used as the basic scheduling unit, and the time synchronization of all nodes is guaranteed through the unified time service. When initializing the simulation, the least common multiple of the step length of the whole system model is used as a cycle to generate a simulation sequence of two cycles; secondly, during the simulation process, the main control service completes the instruction issuance at the corresponding time node according to the simulation instruction sequence, and notifies each model node to complete the Step execution; finally, between models with data exchange, the node with the least common multiple of the step length of both parties of the data exchange is used as the data exchange agreement node to complete the data exchange of the asynchronous model, such as Figure 6 shown.

[0133] The cross-system functional model and performance model joint simulation process is mainly divided into three stages. First, the developed performance model and functional model are uploaded through files or integrated configurations through human-computer interaction. Then, a cross-system simulation scenario is constructed through a graphical interactive interface by dragging and dropping, and models are arranged, associated models, configuration parameters, and model running nodes are configured.

[0134] Among them, after the configuration is completed, a joint simulation model configuration file is generated and sent to the joint simulation master node service. After the node service decomposes the configuration, it is sent to each node according to the configuration to perform initialization and verification; after the initialization is completed, the joint simulation can be started. During the joint simulation process, the master node service will perform unified scheduling, distribute scheduling instructions according to the simulation configuration, and record the entire process data in real time during the simulation process.

[0135] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0136] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0137] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0138] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0139] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0140] The above introduces the preferred embodiments of the present invention, which is intended to make the spirit of the present invention clearer and easier to understand, but is not intended to limit the present invention. All modifications, substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection outlined by the claims attached to the present invention.

Claims

1. A cross-system real-time simulation scheduling method, comprising a master node, distributed nodes and a distributed joint simulation bus, characterized in that: The master node is a joint simulation integrated control node, which configures and initiates joint simulation tasks, and controls, interacts with and monitors all nodes; The distributed nodes are model access nodes that manage and schedule models, including model input, model output, stepping, control, and loading and unloading; The distributed joint simulation bus provides an interface based on a unified abstract channel to send and receive data; The main node includes a human-computer interaction interface, which uploads the performance model and the functional model through files or integrated configuration based on the human-computer interaction method, and builds a cross-system simulation scenario based on the graphical interaction interface, including arranging models and associated models, configuring parameters and model operation nodes; The master node also includes a joint simulation integrated control system, which generates and issues a joint simulation model configuration file; the joint simulation integrated control system performs simulation scheduling, including timing each model, using time accumulation, and when it is detected that the token state of the registered model that has reached the next step is in the sent state, the time accumulation is stopped, and the registered model that has not been solved in the registered model that has reached the next step is completed. The distributed nodes perform initialization and verification, including obtaining information such as collectable data points, simulation steps, simulation unit lists, and controllable models during the deployment and operation of the system nodes, and using configuration test cases to perform model verification on the model; and based on the model tasks sent by the master node through unified instructions, perform model scheduling, start joint simulation according to the instructions of the simulation configuration, and send data to the master node and other nodes that require data through a publish-subscribe mechanism; The distributed joint simulation bus is based on the DDS middleware of the publish-subscribe mode to transmit data between nodes; The joint simulation integrated control system performs simulation scheduling further comprising: Import the time module that provides time-related function methods; Define a ModelTimer class for timing the solution time of the model, the ModelTimer class includes an __init__(self) initialization method for setting the initial timer state, a start(self) timing method for recording the current time as the start time, a stop(self) method for stopping the timing, calculating the elapsed time and adding it to the total time, and a get_total_time(self) method for obtaining the accumulated total time; based on the model timer class, create an instance of the model timer, and use the start(self) method to start timing, the stop(self) method to stop timing, and the get_total_time(self) method to obtain the accumulated total time; Create an empty model timer object dictionary model_timers to store the timer objects corresponding to each model; Create a model state dictionary registered_models, including the token state, current step size, and next step size information of each model; Use the time.time() function to get the start time stamp and save it in the variable start_time; Use a while loop to perform model calculations until all registered models are solved; The distributed nodes schedule the model tasks based on the unified instructions sent by the master node, including: Define parameters, including the number of distributed nodes N, the model task list model_tasks containing the model tasks to be executed, and the task scheduling list task_schedule used to record the tasks assigned to each node; The master node distributes the model task list model_tasks evenly to N distributed nodes; The distributed node receives the task scheduling instruction assigned by the master node and updates the local task scheduling list task_schedule; Model task scheduling loop, enters the loop until all model tasks are completed; The distributed node checks the local task scheduling list task_schedule to find the next task to be executed; Distributed nodes execute model tasks, including executing currently assigned tasks; The distributed node marks the current task as completed; The master node waits for all distributed nodes to complete the current task; The master node checks whether all distributed nodes have completed the current task. If so, it assigns the next unfinished task to the node; All model tasks completed; Starting the joint simulation further includes: the distributed nodes start the joint simulation within the specified simulation time according to the simulation configuration instructions, and the master node acts as a source of the simulation time to ensure that each node steps according to the same simulation time, and further includes: Define parameters, including total simulation time T_sim, simulation step dt, and current simulation time t; The master node initializes the simulation time t=0; Distributed nodes receive simulation time t=0; Joint simulation loop: enter the loop until the simulation time reaches the total duration T_sim; The master node broadcasts the current simulation time t to all distributed nodes; The distributed node receives the simulation time broadcast by the master node and updates the local simulation time t=t_received, where t_received is the simulation time received from the master node; Perform joint simulation tasks, and each node performs the corresponding simulation task according to the current simulation time t; The master node waits for all distributed nodes to complete the current simulation step; The distributed node completes the current simulation step and notifies the master node; The master node checks whether all distributed nodes have completed the current simulation step. If so, it updates the simulation time t=t+dt; The simulation ends.

2. A cross-system real-time simulation scheduling method as claimed in claim 1, characterized in that: The master node includes the following control modes: The control interface provided by the joint simulation scenario is used to start and stop the joint simulation scenario. The tool provides an interface to start and stop the scenario with one click, and provides a control interface to the outside world. Through the control interface provided by the joint simulation scene, the current simulation scene section is recorded when analyzing typical working conditions during the virtual-real interaction process, the simulation is restored through the recovery control interface, and the control interface is provided to the outside; Through the control interface provided by the joint simulation scenario, the simulation process can be accelerated / decelerated, and synchronization with the real physical system can be achieved through flexible acceleration and deceleration; The control interface provided by the joint simulation scenario is used to control the control units in the system.

3. A cross-system real-time simulation scheduling method as claimed in claim 1, characterized in that: In the simulation scheduling process, the minimum step size of the entire system is used as the basic scheduling unit. A joint simulation scheduling instruction sequence is generated, and scheduling instructions are issued to each node according to the sequence. After receiving the scheduling instructions, each node model completes execution and data exchange.

4. A cross-system real-time simulation scheduling method as claimed in claim 1, characterized in that: In the process of virtual joint debugging data interaction, the simulation model is controlled based on distributed nodes by formulating interfaces with joint simulation scenarios, including: Initialization information interface, used to obtain basic information of simulation model, including the attributes of output data, the attributes of input data and basic controllable information of the model; Real-time data interface, used to obtain real-time simulation data of each model unit and node during the simulation process, supporting active acquisition of data and event notification through model node ID, name, etc.; System model control interface, used for overall interface control of joint simulation scenarios, including start, stop, pause, step, accelerate, and decelerate; Model unit control interface, used to control a certain model unit during the simulation process; The simulation time synchronization interface is used to obtain the system running time in the current joint simulation scenario, and then compare and calibrate the time with the actual equipment running time.

5. A cross-system real-time simulation scheduling method as claimed in claim 1, characterized in that: The master node takes the start of simulation as the starting time, and publishes the simulation time to distributed nodes through the data service bus based on the preset frequency. Each node subscribes to the time topic and receives the unified time data regularly, which is used for model time synchronization and disconnection reconnection and other mechanism processing.

6. A cross-system real-time simulation scheduling method as claimed in claim 1, characterized in that: The master node also includes a status monitoring module to monitor the joint simulation scenario, including real-time monitoring of key elements such as running time and resource usage, and evaluate and analyze the running status of the joint simulation scenario.

7. A cross-system real-time simulation scheduling device, comprising: at least one processor; as well as at least one memory including computer program code, The at least one memory and the computer program code are configured to, together with the at least one processor, enable the apparatus to perform the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Multidisciplinary collaborative simulation method and system based on cloud platform

    CN111177899A

  • Scheduling method and device for super-real-time joint simulation

    CN113110114A

  • Distributed real-time simulation method

    CN113848752A