Multi-source heterogeneous model joint simulation method, device, equipment and medium based on FMI
Through the FMI-based multi-source heterogeneous model joint simulation method, the initialization and data transmission problems in multi-FMU joint simulation are solved, and efficient and accurate joint simulation of multi-disciplinary and multi-field heterogeneous models is realized, and the simulation results are improved. Accuracy and efficiency.
Patent Information
- Application Number
- CN202111052781.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-09
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-09-09
AI Technical Summary
The existing multi-module system simulation software has problems such as initialization sequence, data transmission and remote collaborative simulation during multi-FMU joint simulation, which affects the accuracy and efficiency of simulation results.
Using the FMI-based multi-source heterogeneous model joint simulation method, by deploying local and remote FMU model libraries, using proxy servers to obtain remote FMU, parsing and instantiating FMU, and using the FMU-proxy framework to implement remote call and data transmission algorithms to ensure multiple Initialization and data transmission of FMU.
The effectiveness and accuracy of multidisciplinary and multi-field heterogeneous model joint simulation was improved, and normal and correct simulation experiments of multi-FMU systems were realized. The average error of the simulation results was within 0.1%, reflecting the effectiveness of the method.
Smart Images

Figure CN113791793B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of simulation, and in particular to a FMI-based multi-source heterogeneous model joint simulation method, device, equipment and medium. Background Art
[0002] At present, multi-module system simulation software at home and abroad mainly adopts technologies such as custom code, integrated coupling and co-simulation. Integrated software development is usually implemented using application programming interfaces (APIs), which require developers to fully master the models of each module and independent interfaces, form a consortium, and jointly develop in a cooperative or shared intellectual property model. With the rapid development and widespread application of simulation technology, there is an increasing need for multiple software tools with different functions and independent intellectual property rights to realize co-simulation experiments. Therefore, FMI (The Functional Mock-up Interface) allows simulation models to be shared between different tools, so that co-simulation can integrate multiple independent simulation tools into one, without the need for all parties to adopt a cooperative or shared model to establish collaborative simulation.
[0003] At present, simulation software such as ADAMS can realize different degrees of joint simulation with MATLAB, AMESim, ANSYS, etc. Many scholars at home and abroad have carried out a lot of research work based on their simulation needs. The paper "Joint Simulation of Hydraulic System of Hyperstatic Hydraulic Support Based on AMESim and ADAMS" uses the method of joint simulation of ADAMS and AMESim to simulate and analyze the bearing capacity of the hyperstatic hydraulic support under different working conditions; the paper "ABS Test Analysis Based on Joint Simulation of ADAMS and MATLAB" proposes to establish a whole vehicle model with ABS (Antilock brake system) system in ADAMS, and build a fuzzy PID control system based on the road surface recognition system of the vehicle body deceleration in Simulink to realize the joint braking simulation under different road conditions based on ADAMS and SImulink; the paper "The Combined Simulation of High-Speed Parallel Manipulator Based on MATLAB, SolidWorks and ADAMS" converts the SOLIDWORKS model into MATLAB / Simulink model and ADAMS model respectively, and realizes the joint simulation of ADAMS mechanical platform and Simulink control platform; the paper "Integrated Simulation of Multi-source Heterogeneous Models of Aircraft Subsystems Based on FMI" chooses to use multiple FMU models to complete the simulation experiment of the aircraft.
[0004] The above-mentioned joint simulation experiments can be roughly divided into two categories. The first category mainly uses customized code, integrated coupling and joint simulation technology, while the second category is carried out using the international general model interface standard (Functional Mock-up Interface, FMI). The limitations of the first type of simulation experiments have been mentioned above and will not be repeated here. In the second category, "Integrated Simulation of Multi-Source Heterogeneous Models of Aircraft Subsystems Based on FMI" is mainly aimed at a specific field, and the models to be solved are limited to aircraft, and do not support remote collaborative development and simulation experiments.
[0005] Most of the above research contents focus on how to associate multiple FMUs (Functional Mock-up Units) and how to call simulation functions in FMI, but rarely mention the initialization order of multiple FMU joint simulation, the solution of cascade initialization of multiple FMUs, the experimental accuracy of multiple FMU joint simulation, and multiple FMU remote collaborative simulation. In the actual multi-FMU joint simulation experiment, since FMU comes from many softwares and is almost a black box for users, the initialization configuration of FMU and the data transmission between multiple FMUs will directly affect the quality of joint simulation and the accuracy of the results. This patent mainly conducts corresponding research on the above issues and provides corresponding implementation methods. Summary of the invention
[0006] With the rapid development and widespread application of simulation technology, multiple software tools with different functions and independent intellectual property rights are increasingly needed to realize joint simulation experiments, and the characteristics of multidisciplinary integration in simulation experiments are becoming increasingly prominent. In order to improve the effectiveness, accuracy and simulation efficiency of multidisciplinary and multi-domain heterogeneous model joint simulation, simulation models are shared between different tools based on FMI, and the FMU-proxy framework is used to realize remote calling and model parsing of FMU models. An FMU data transmission algorithm is proposed to improve the experimental accuracy of multi-FMU joint simulation.
[0007] In a first aspect, an embodiment of the present invention provides a multi-source heterogeneous model joint simulation method based on FMI, comprising the following steps:
[0008] Step S100, the local computer deploys the local FMU model library, and the remote server deploys the remote FMU model library;
[0009] Step S200, the local computer obtains the remote FMU from the remote server through the proxy server, and the obtained remote FMU and the local FMU model library together form an available FMU model library;
[0010] Step S300, parsing the FMU in the available FMU model library to obtain parsing information, the simulation software generates a graphical description of the FMU according to the parsing information, generates an FMU model on a canvas, and obtains the association relationship between multiple FMU interfaces;
[0011] Step S400, calling the instantiation function of FMI to instantiate the FMU and obtain the FMU instance;
[0012] Step S500, initializing the FMU instance;
[0013] Step S600, obtaining a minimum simulation step length, and performing a single-step solution on each FMU with the minimum simulation step length;
[0014] Step S700, if the variable T is greater than or equal to the simulation end time of a certain FMU model, call the release instance function of the FMU to release the FMU instance, until all FMU instances are released and the simulation ends;
[0015] The initial value of variable T is 0, and each time a minimum simulation step length Δt is executed min , and add them to the T variable.
[0016] Preferably, the step of the local computer obtaining the remote FMU from the remote server through the proxy server includes: starting the proxy server of the local computer, the proxy server obtaining the information and location of the available FMU according to the IP address and RPC port of the remote server, and the proxy server obtaining the remote FMU according to the information and location of the available FMU.
[0017] Preferably, the proxy server can obtain one or more FMUs through a set of RPCs.
[0018] Preferably, the proxy server periodically sends heartbeat signals via HTTP to regularly update the list of available FMUs and determine that the remote server is online.
[0019] Preferably, the FMU parsing information is obtained by parsing the .xml description file in the FMU; the parsing information includes the unique identification code of the FMU, model variables, variable types, simulation step size, simulation start time, simulation end time, tolerance, simulation state and simulation state quantity.
[0020] Preferably, the step of initializing the FMU instance includes: traversing all FMU instances, determining whether the FMU instance has an interface that requires initialization conditions, and if not, directly entering step S600; if there is an interface that requires initialization conditions, determining whether the interface is associated with other FMUs, and if the interface is not associated with other FMUs, entering step S600; if the interface is associated with other FMUs, using a recursive method to obtain its initial conditions and assign values.
[0021] Preferably, the method of obtaining the initial conditions and performing the assignment using a recursive method includes: initializing the associated FMU, determining whether the parameters associated with the initial conditions of the initialized associated FMU are 0 or null; if not, obtaining the initial value to initialize the FMU; if so, searching forward for the next FMU associated with this FMU, and repeatedly executing the operation of initializing the associated FMU until the parameters associated with the initial conditions of the initialized associated FMU are not 0 or null.
[0022] In a second aspect, an embodiment of the present invention provides a multi-source heterogeneous model joint simulation device based on FMI, comprising:
[0023] Deployment module: local computer deploys local FMU model library, and remote server deploys remote FMU model library;
[0024] An FMU model library generation module, in which a local computer obtains a remote FMU from a remote server through a proxy server, and the obtained remote FMU and a local FMU model library are combined to form an available FMU model library;
[0025] A parsing module, which parses the FMU in the available FMU model library to obtain parsing information, and the simulation software generates a graphical description of the FMU according to the parsing information, generates an FMU model on a canvas, and obtains the association relationship between multiple FMU interfaces;
[0026] Instantiate the module, call the instantiation function of FMI, instantiate the FMU, and obtain the FMU instance;
[0027] Instance module, initializes the FMU instance;
[0028] A solution module obtains a minimum simulation step size and performs single-step solution on each FMU with the minimum simulation step size;
[0029] In the simulation module, if the variable T is greater than or equal to the simulation end time of a certain FMU model, the release instance function of the FMU is called to release the FMU instance until all FMU instances are released and the simulation ends;
[0030] The initial value of variable T is 0, and each time a minimum simulation step length Δt is executed min , and add them to the T variable.
[0031] In a third aspect, an embodiment of the present invention proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements any one of the methods described above when executing the computer program.
[0032] In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute any of the methods described above.
[0033] The embodiment of the present invention proposes a multi-source heterogeneous model joint simulation method, device, equipment and medium based on FMI, which has solved the problems of the inability to perform remote collaborative simulation and the low degree of restoration of simulation results in the prior art. Compared with the prior art, the beneficial results of the embodiment of the present invention are:
[0034] When simulating a multi-FMU system, it is possible to parse FMUs from various sources, and with the help of the multi-source heterogeneous model collaborative simulation data transmission algorithm of the present invention, the initial condition setting and the data transmission between FMUs are completed, and when multiple FMUs have simulation steps of different sizes and different simulation start and end times, the system can complete the simulation experiment normally and correctly. Comparing the simulation results of the FMU joint simulation with the simulation results of the original model development software, it is found that the average simulation error is within 0.1%, which fully demonstrates the effectiveness of the invention method. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 is a flow chart of an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of a single-step solution of an FMU according to an embodiment of the present invention;
[0038] Figure 3 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0040] Reference Figure 1 The specific implementation steps of the FMI-based multi-source heterogeneous model joint simulation method of the embodiment of the present invention are as follows:
[0041] Step S100: The local computer deploys the local FMU model library, and the remote server deploys the remote FMU model library.
[0042] Specifically, the FMU (Functional Mock-up Unit) model library refers to mathematical models or industrial models built in different professional software, which form a collection of multiple .fmu files based on the FMI2.0 standard. Since the models in the FMU model library all follow an interface standard, the FMU models formed in different professional software can be directly reused to quickly complete system integration simulation. The local FMU model library and the remote FMU model library can be flexibly deployed on local computers and remote servers according to user needs.
[0043] Step S200: The local computer obtains the remote FMU from the remote server through the proxy server, and the obtained remote FMU and the local FMU model library together form an available FMU model library.
[0044] Specifically, the proxy server of the local computer is started, and the proxy server obtains the information and location of the available FMU according to the IP address and RPC (Remote Procedure Call) port of the remote server. The proxy server obtains the remote FMU according to the information and location of the available FMU, and the obtained remote FMU and the local FMU model library together form an available FMU model library.
[0045] Preferably, the proxy server can obtain one or more FMUs through a set of RPCs.
[0046] Preferably, the proxy server periodically sends a heartbeat signal via HTTP (Hyper Text Transfer Protocol), regularly updates the list of available FMUs, and determines that the remote server is online.
[0047] Step S300, parse the FMU in the available FMU model library to obtain parsing information, and the simulation software generates a graphical description of the FMU according to the parsing information, generates an FMU model on the canvas, and obtains the association relationship between multiple FMU interfaces. Since the fmu models are all stored in the form of .fmu files, it is not intuitive and inefficient to access them directly through software program calls. Therefore, the embodiment of the present invention obtains the connection interface, parameters, and icon information of each model by reading and parsing the xml file in the .fmu file, presents the fmu model in a visual graphical form, and displays the connection and data flow relationship between different fmu models by dragging lines on the graphic canvas, so that the joint simulation experiment is both intuitive and simple.
[0048] Specifically, by parsing the .xml description file in the FMU, the FMU parsing information can be obtained, and the parsing information includes the unique identification code of the FMU, model variables, variable types, simulation step size, simulation start time, simulation end time, tolerance, simulation status, simulation status quantity and other information.
[0049] Preferably, after the simulation software generates a graphical description of the FMU according to the analytical information, the FMU model is generated on the canvas by dragging and dropping, and the association relationship between multiple FMU interfaces is indicated in the form of connecting lines.
[0050] Step S400, calling the instantiation function of FMI to instantiate the FMU and obtain the FMU instance.
[0051] Among them, the model parameter information set by the user in the simulation software interface is obtained, and the model parameter information is assigned to the corresponding FMU instance.
[0052] Step S500, initializing the FMU instance.
[0053] Specifically, the steps of initializing the FMU instance include: traversing all FMU instances, determining whether the FMU instance has an interface that requires initialization conditions, if not, directly entering step S600; if there is an interface that requires initialization conditions, determining whether the interface is associated with other FMUs, if the interface is not associated with other FMUs, entering step S600, if the interface is associated with other FMUs, using a recursive method to obtain its initial conditions and assign values.
[0054] Among them, the method of obtaining its initial conditions and assigning values using a recursive method includes: initializing the associated FMU, determining whether the parameters associated with the initial conditions of the initialized associated FMU are 0 or null; if not, obtaining the initial value to initialize the FMU; if so, looking forward for the next FMU associated with this FMU, and repeatedly executing the operation of initializing the associated FMU until the parameters associated with the initial conditions of the initialized associated FMU are not 0 or null.
[0055] Step S600, obtaining a minimum simulation step length, and performing single-step solution on each FMU with the minimum simulation step length.
[0056] Specifically, obtain the simulation step size of all FMUs that constitute the system and find the minimum step size Δt min That is the minimum simulation step size.
[0057] Specifically, when performing a single-step solution on each FMU with the minimum simulation step length, a variable T with an initial value of 0 is first defined, and each time a minimum simulation step length Δt is executed min, they are all accumulated into the T variable; if T is greater than or equal to the simulation start time of a certain FMU, the single-step solution function of the FMU is executed; if T is greater than or equal to the simulation duration of the Nth step of a certain FMU, that is, N*Δt, the single-step solution function of the FMU is executed.
[0058] Specifically, when each FMU performs a single-step solution, it obtains its association with other FMUs and assigns and retrieves values to the relevant input and output interfaces. Figure 2 According to the connection relationship between the multi-fmu models, at each simulation step Δt min Assign and retrieve values for each fmu, obtain the output y1 of the fmu1 model at time T, and assign it to u1 of FMU2 at time T, obtain y1 of FMU2 at time T, then assign y1 of FMU1 at time T to u1 of FMU3, and assign y1 of FMU2 at time T to u2 of FMU3, so as to obtain y1 of FMU3 at time T.
[0059] Step S700: If the variable T is greater than or equal to the simulation end time of a certain FMU model, call the release instance function of the FMU to release the FMU instance until all FMU instances are released and the simulation ends; wherein the initial value of the variable T is 0, and each execution of a minimum simulation step length Δt min , and add them to the T variable.
[0060] The embodiment of the present invention is based on the FMI standard and adopts the FMU-proxy framework to complete the parsing of multi-source heterogeneous FMU files, and allows users to complete remote or local access and calling from any platform in almost any language, and then display the FMU model in a graphical manner. The user builds a multi-FMU joint simulation system by dragging and creating link lines, and then uses the inter-FMU data transmission algorithm to complete the FMU instantiation, initialization configuration and single-step simulation data flow, thereby completing the system simulation of the joint structure of multiple FMUs.
[0061] Corresponding to any of the above-mentioned embodiments, another aspect of the present invention provides a multi-source heterogeneous model joint simulation device based on FMI, including:
[0062] Deployment module: local computer deploys local FMU model library, and remote server deploys remote FMU model library;
[0063] An FMU model library generation module, in which a local computer obtains a remote FMU from a remote server through a proxy server, and the obtained remote FMU and a local FMU model library are combined to form an available FMU model library;
[0064] A parsing module, which parses the FMU in the available FMU model library to obtain parsing information, and the simulation software generates a graphical description of the FMU according to the parsing information, generates an FMU model on a canvas, and obtains the association relationship between multiple FMU interfaces;
[0065] Instantiate the module, call the instantiation function of FMI, instantiate the FMU, and obtain the FMU instance;
[0066] Instance module, initializes the FMU instance;
[0067] A solution module obtains a minimum simulation step size and performs single-step solution on each FMU with the minimum simulation step size;
[0068] In the simulation module, if the variable T is greater than or equal to the simulation end time of a certain FMU model, the release instance function of the FMU is called to release the FMU instance until all FMU instances are released and the simulation ends;
[0069] The initial value of variable T is 0, and each time a minimum simulation step length Δt is executed min , and add them to the T variable.
[0070] Corresponding to any of the above-mentioned embodiments, the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any of the above embodiments when executing the program.
[0071] Figure 3 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0072] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0073] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0074] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0075] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0076] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0077] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0078] The electronic device of the above embodiment is used to implement the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0079] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method described in any of the above embodiments.
[0080] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0081] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0082] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.
[0083] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A multi-source heterogeneous model joint simulation method based on FMI, characterized in that: The following steps are involved: Step S100, the local computer deploys the local FMU model library, and the remote server deploys the remote FMU model library; Step S200, the local computer obtains the remote FMU from the remote server through the proxy server, and the obtained remote FMU and the local FMU model library together form an available FMU model library; Step S300, parsing the FMU in the available FMU model library to obtain parsing information, the simulation software generates a graphical description of the FMU according to the parsing information, generates an FMU model on a canvas, and obtains the association relationship between multiple FMU interfaces; Step S400, calling the instantiation function of FMI to instantiate the FMU and obtain the FMU instance; Step S500, initializing the FMU instance; Step S600, obtaining a minimum simulation step length, and performing a single-step solution on each FMU with the minimum simulation step length; Get the simulation step size of all FMUs that make up the system and find the minimum step size That is, the minimum simulation step size. When performing single-step solution on each FMU with the minimum simulation step size, first define a variable T with an initial value of 0. , all are accumulated into the T variable; if T is greater than or equal to the simulation start time of a certain FMU, the single-step solution function of the FMU is executed; if T is greater than or equal to the simulation duration of the Nth step of a certain FMU, that is , then execute the single-step solution function of the FMU; Step S700, if the variable T is greater than or equal to the simulation end time of a certain FMU model, call the release instance function of the FMU to release the FMU instance, until all FMU instances are released and the simulation ends.
2. The method according to claim 1, characterized in that The step of the local computer obtaining the remote FMU from the remote server through the proxy server includes: starting the proxy server of the local computer, the proxy server obtaining the information and location of the available FMU according to the IP address and RPC port of the remote server, and the proxy server obtaining the remote FMU according to the information and location of the available FMU.
3. The method according to claim 2, characterized in that The proxy server can obtain one or more FMUs through a set of RPCs.
4. The method according to claim 3, characterized in that The proxy server periodically sends heartbeat signals via HTTP to regularly update the list of available FMUs and confirm that the remote server is online.
5. The method according to claim 1, characterized in that The FMU parsing information is obtained by parsing the .xml description file in the FMU; the parsing information includes the unique identification code of the FMU, model variables, variable types, simulation steps, simulation start time, simulation end time, tolerance, simulation state and simulation state quantity.
6. The method according to claim 5, characterized in that The steps of initializing the FMU instance include: traversing all FMU instances, determining whether the FMU instance has an interface that requires initialization conditions, and if not, directly entering step S600; if there is an interface that requires initialization conditions, determining whether the interface is associated with other FMUs, and if the interface is not associated with other FMUs, entering step S600; if the interface is associated with other FMUs, using a recursive method to obtain its initial conditions and assign values.
7. The method according to claim 6, characterized in that The method of obtaining the initial conditions and performing the assignment using a recursive method includes: initializing the associated FMU, determining whether the parameters associated with the initial conditions of the initialized associated FMU are 0 or null; if not, obtaining the initial value to initialize the FMU; if so, searching forward for the next FMU associated with this FMU, and repeatedly executing the operation of initializing the associated FMU until the parameters associated with the initial conditions of the initialized associated FMU are not 0 or null.
8. A multi-source heterogeneous model joint simulation device based on FMI, characterized in that: include: Deployment module: local computer deploys local FMU model library, and remote server deploys remote FMU model library; The FMU model library generation module, the local computer obtains the remote FMU from the remote server through the proxy server, and the obtained remote FMU and the local FMU model library together form an available FMU model library; A parsing module, which parses the FMU in the available FMU model library to obtain parsing information, and the simulation software generates a graphical description of the FMU according to the parsing information, generates an FMU model on a canvas, and obtains the association relationship between multiple FMU interfaces; Instantiate the module, call the instantiation function of FMI, instantiate the FMU, and obtain the FMU instance; Instance module, initializes the FMU instance; A solution module obtains a minimum simulation step size and performs single-step solution on each FMU with the minimum simulation step size; Get the simulation step size of all FMUs that make up the system and find the minimum step size That is, the minimum simulation step size. When performing single-step solution on each FMU with the minimum simulation step size, first define a variable T with an initial value of 0. , all are accumulated into the T variable; if T is greater than or equal to the simulation start time of a certain FMU, the single-step solution function of the FMU is executed; if T is greater than or equal to the simulation duration of the Nth step of a certain FMU, that is , then execute the single-step solution function of the FMU; In the simulation module, if the variable T is greater than or equal to the simulation end time of a certain FMU model, the release instance function of the FMU is called to release the FMU instance until all FMU instances are released and the simulation ends; The initial value of variable T is 0, and each time a minimum simulation step is executed , and add them to the T variable.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the computer program. 10 . A non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method according to claim 1 .
