Semi-physical real-time simulation method and system fused with neural network model

By grading physical models and using neural network models and GPU accelerated computing, the problem of time-consuming simulation of complex models is solved, efficient semi-physical real-time simulation is achieved, and simulation speed and accuracy are improved.

CN120409180APending Publication Date: 2025-08-01HIWING TECH ACAD OF CASIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510321177.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing semi-physical simulation systems take a long time in complex model simulation and reduce the accuracy of simulation results, making it difficult to find a balance between ensuring real-time and accuracy.

Method used

The fusion neural network model is adopted to divide the physical model into the first, second and third physical models with increasing complexity. The neural network model with predicted timing is used to fit and train the input data and output data, generate the trained physical model and deploy it to the simulation machine, and combine it with GPU acceleration calculation to achieve acceleration of the simulation process.

Benefits of technology

While ensuring the accuracy of simulation results, it significantly reduces simulation time, improves simulation speed, and meets the needs of real-time simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120409180A_ABST
    Figure CN120409180A_ABST
Patent Text Reader

Abstract

The invention discloses a semi-physical real-time simulation method and system fusing a neural network model. The method comprises the following steps: establishing a physical model; when the established model is a first physical model, deploying the first physical model to a simulation machine; when the established model is a second physical model, generating a first executable program according to the second physical model; when the established model is a third physical model, generating a second executable program according to the third physical model; first output data are obtained by changing input data of the first executable program and through model simulation; separating the second executable program to obtain a conventional fixed calculation part and a solver differential calculation part; carrying out fitting training by utilizing the neural network model for predicting the time sequence to respectively obtain a trained second physical model and a trained third physical model; deploying the trained second physical model to a simulation machine; and deploying the trained second physical model and the calculation process of the conventional fixed calculation part to a simulation machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of hardware-in-the-loop simulation and digital twin, and particularly to a hardware-in-the-loop real-time simulation method and system integrating a neural network model. Background Art

[0002] In a hardware-in-the-loop real-time simulation system, the system is composed of simulation models of different specialties running on each simulator. The simulation models obtain external data inputs and then run simulation programs to obtain relatively accurate simulation results, i.e., outputs, and these outputs are the input data of some simulation models. These simulation programs run in different simulation software and then achieve real-time simulation through various communication protocols.

[0003] In the current implementation path of the hardware-in-the-loop simulation system, in order to obtain relatively accurate simulation results, real physical models are used for simulation solution. However, to ensure the real-time performance of the system, the simulation step sizes of all simulation software need to be kept consistent, and all simulation program calculations need to be completed within one simulation step time. Therefore, for complex simulation physical models, generally, it is necessary to ensure the performance of the hardware devices of the corresponding simulator to obtain sufficient computing power. On the other hand, the model is also simplified, such as model order reduction, parameter reduction, and interpolation to reduce the simulation time consumption, so as to reduce the overall system time consumption and shorten the simulation step size.

[0004] However, for complex models, these simplification methods not only take a long time but also reduce the accuracy of the results of the hardware-in-the-loop simulation system. Summary of the Invention

[0005] The present invention provides a hardware-in-the-loop real-time simulation method and system integrating a neural network model, which can solve the technical problems in the prior art.

[0006] The present invention provides a hardware-in-the-loop real-time simulation method integrating a neural network model, wherein the method includes:

[0007] Establish a physical model, and the established physical model includes a first physical model, a second physical model, and a third physical model with increasing complexity in sequence;

[0008] When the established model is the first physical model, deploy the first physical model to the simulator;

[0009] When the established model is the second physical model, generate a first executable program according to the second physical model;

[0010] When the established model is the third physical model, generate a second executable program according to the third physical model;

[0011] For the first executable program, the first output data is obtained by changing the input data of the first executable program and performing model simulation.

[0012] For the second executable program, the second executable program is separated into a conventional fixed calculation part and a solver differential calculation part, and the second output data is obtained by performing the solver differential calculation according to the input data of the second executable program.

[0013] A neural network model for predicting time series is used to fit and train the input data and the first output data of the first executable program, and the input data and the second output data of the second executable program, respectively, to obtain a trained second physical model and a trained third physical model.

[0014] Deploy the trained second physical model to the simulator.

[0015] Deploy the calculation process of the trained second physical model and the conventional fixed calculation part to the simulator.

[0016] Preferably, the first physical model is deployed to the simulator using simulation software.

[0017] Preferably, the trained second physical model is deployed to the simulator using C++ or python.

[0018] Preferably, the calculation process of the trained second physical model and the conventional fixed calculation part is deployed to the simulator using C++.

[0019] Preferably, the first executable program and the second executable program are C++ programs.

[0020] The present invention also provides a hardware-in-the-loop real-time simulation system integrating a neural network model, wherein the system includes:

[0021] A model establishment module for establishing physical models, and the established physical models include a first physical model, a second physical model, and a third physical model with increasing complexity in sequence.

[0022] A deployment module for deploying the first physical model to the simulator when the established model is the first physical model.

[0023] A generation module for generating a first executable program according to the second physical model when the established model is the second physical model, wherein the first output data is obtained by changing the input data of the first executable program and performing model simulation.

[0024] The generation module is further configured to generate a second executable program according to the third physical model when the established model is the third physical model, wherein the second executable program is separated into a conventional fixed calculation part and a solver differential calculation part, and the solver differential calculation is performed according to the input data of the second executable program to obtain second output data;

[0025] The training module is configured to perform fitting training on the input data and the first output data of the first executable program and the input data and the second output data of the second executable program by using a neural network of a prediction time series, and respectively obtain a trained second physical model and a trained third physical model;

[0026] The deployment module is further configured to deploy the trained second physical model to the simulator;

[0027] The deployment module is further configured to deploy the trained second physical model and the calculation process of the conventional fixed calculation part to the simulator.

[0028] Preferably, the first physical model is deployed to the simulator by using simulation software.

[0029] Preferably, the trained second physical model is deployed to the simulator by using C++ or python.

[0030] Preferably, the trained second physical model and the calculation process of the conventional fixed calculation part are deployed to the simulator by using C++.

[0031] Preferably, the first executable program and the second executable program are C++ programs.

[0032] Through the above technical solutions, for a complex physical model, a method for realizing semi-physical real-time simulation by fusing a neural network model is proposed, which can reduce the simulation time while ensuring the accuracy of the simulation results and improve the simulation speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings included are used to provide a further understanding of the embodiments of the present invention, which form a part of the specification, are used to illustrate the embodiments of the present invention, and together with the written description are used to explain the principles of the present invention. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.

[0034] Figure 1 Shows a flowchart of a semi-physical real-time simulation integrating a neural network model according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments may be combined with each other. The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and in no way restricts the present invention and its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0036] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0037] Unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present invention. At the same time, it should be understood that, for the sake of convenience of description, the dimensions of the various parts shown in the drawings are not drawn in actual proportional relationships. Technologies, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and devices should be regarded as part of the authorization specification. In all the examples shown and discussed here, any specific value should be interpreted as merely exemplary and not as a limitation. Therefore, other examples of the exemplary embodiments may have different values. It should be noted that: similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.

[0038] Figure 1 The flowchart of the hardware-in-the-loop real-time simulation of a fusion neural network model according to an embodiment of the present invention is shown.

[0039] As Figure 1 shown, an embodiment of the present invention provides a hardware-in-the-loop real-time simulation method for a fusion neural network model, where the method includes:

[0040] Establish a physical model, and the established physical model includes a first physical model, a second physical model, and a third physical model with increasing complexity in sequence;

[0041] Among them, the first physical model can be a simple model, the second physical model can be a complex model, and the third physical model can be a highly complex model.

[0042] When the established model is the first physical model, deploy the first physical model to the simulator;

[0043] When the established model is the second physical model, generate the first executable program according to the second physical model;

[0044] When the established model is the third physical model, generate the second executable program according to the third physical model;

[0045] For the first executable program, obtain the first output data by changing the input data of the first executable program and performing model simulation;

[0046] For the second executable program, separate the second executable program into a conventional fixed calculation part and a solver differential calculation part, and execute the solver differential calculation according to the input data of the second executable program to obtain the second output data;

[0047] Use the neural network model for predicting time series to fit and train the input data and the first output data of the first executable program and the input data and the second output data of the second executable program, and respectively obtain the trained second physical model and the trained third physical model;

[0048] Deploy the trained second physical model to the simulator;

[0049] Deploy the calculation process of the trained second physical model and the conventional fixed calculation part to the simulator.

[0050] Through the above technical solution, for a complex physical model, a method for realizing hardware-in-the-loop real-time simulation by fusing a neural network model is proposed, which can reduce the simulation time-consuming while ensuring the accuracy of the simulation results and improve the simulation speed.

[0051] According to an embodiment of the present invention, use simulation software to deploy the first physical model to the simulator.

[0052] According to an embodiment of the present invention, use C++ or python to deploy the trained second physical model to the simulator.

[0053] According to an embodiment of the present invention, use C++ to deploy the calculation process of the trained second physical model and the conventional fixed calculation part to the simulator.

[0054] According to an embodiment of the present invention, the first executable program and the second executable program are C++ programs.

[0055] An embodiment of the present invention also provides a hardware-in-the-loop real-time simulation system integrating a neural network model. The system includes:

[0056] A model establishment module for establishing physical models, including a first physical model, a second physical model, and a third physical model with increasing complexity in sequence.

[0057] A deployment module for deploying the first physical model to the simulator when the established model is the first physical model.

[0058] A generation module for generating a first executable program according to the second physical model when the established model is the second physical model, where the first output data is obtained by changing the input data of the first executable program and performing model simulation.

[0059] The generation module is also used for generating a second executable program according to the third physical model when the established model is the third physical model. The second executable program is separated into a conventional fixed calculation part and a solver differential calculation part, and the second output data is obtained by performing the solver differential calculation according to the input data of the second executable program.

[0060] A training module for fitting and training the input data and the first output data of the first executable program and the input data and the second output data of the second executable program by using a neural network with predictive time series to obtain a trained second physical model and a trained third physical model respectively.

[0061] The deployment module is also used for deploying the trained second physical model to the simulator.

[0062] The deployment module is also used for deploying the calculation process of the trained second physical model and the conventional fixed calculation part to the simulator.

[0063] Through the above technical solutions, for complex physical models, a method for realizing hardware-in-the-loop real-time simulation by integrating a neural network model is proposed, which can reduce the simulation time while ensuring the accuracy of the simulation results and improve the simulation speed.

[0064] According to an embodiment of the present invention, the first physical model is deployed to the simulator by using simulation software.

[0065] According to an embodiment of the present invention, the trained second physical model is deployed to the simulator by using C++ or python.

[0066] According to an embodiment of the present invention, the calculation process of the trained second physical model and the conventional fixed calculation part is deployed to the simulator by using C++.

[0067] According to an embodiment of the present invention, the first executable program and the second executable program are C++ programs.

[0068] The following describes a hardware-in-the-loop real-time simulation method for a fused neural network model of the present invention in combination with examples. Specifically, the method includes:

[0069] Step 1: In the modeling process of the model in the hardware-in-the-loop real-time simulation system, for simple physical models, they can be modeled first, and then the established simple physical models can be directly deployed on the simulator of the hardware-in-the-loop real-time simulation system. For some relatively complex physical models, such as dynamic models, fluid mechanics models, etc., relatively real and complete physical models are established in the model establishment process, and then the simulator deployment is realized through subsequent steps.

[0070] Step 2: After completing the modeling of the complex model in the modeling software, a physical model that cannot be deployed on the real-time operating system is obtained; at the same time, for this physical model, a simulation model such as C++ code that can be easily deployed can be generated in the software. Through this operation, an executable program with input and output interfaces retained (all internal parameters are retained) can be obtained, and a detailed model with various calculation parameters and solver calculation formulas (separating fixed parameters and solvers) can also be obtained.

[0071] Step 3: Considering factors such as the number of model parameters, the size and quantity of the model, and the software simulation time, the complex physical model can be divided into a complex model and a highly complex model. Two methods can be used to obtain neural network training data: For the complex model, since the solution speed directly through the generated executable program is within an acceptable range, it can be directly carried out through an automated script program. After changing the input data such as the external force load, thermal load, electromagnetic environment, and other physical field inputs of the model, the output data can be obtained through model simulation. For the highly complex model, since the solution speed of the generated executable program is not within an acceptable range, the executable program can be separated to obtain invariant steps such as fixed parameters (i.e., the fixed operation part) and variable links such as solver differential calculation (the solver differential calculation part). By reducing the complexity of the training model (i.e., only training the solver model), the purpose of reducing the training cost can be achieved. Similarly, training data collection is carried out for the input and output of the solver. The input data of the complex model comes from external data, while the input data of the separated highly complex model comes from external data and internal data. Therefore, the highly complex model can also obtain the influence of parameter design in the model design link on the output by changing the internal input data.

[0072] Step 4: Based on the input-output of the complex model collected in Step 3 and the solver input-output separated from the highly complex model, neural network methods are used for fitting and training. To predict the results of the next simulation step, a neural network for predicting time series is designed inside the neural network. At the same time, to obtain the influence from different physical fields, the design of the neural network model and feature fusion are carried out. Since the neural network has the characteristic of sharing parameters, the number of parameters of the trained model is greatly reduced compared to the original physical model. At the same time, the improvement of the generalization ability will obtain the ability to predict the output of the input parameter space that is partially not included in the training data. This will enable the neural network to obtain a better fitting ability than the interpolation table and the simplified model.

[0073] Step 5: In the neural network model deployment phase, the complex model can be deployed using platforms such as C++ and Python. The deployment of these programming languages has strong compatibility with the underlying layer and relatively high computing efficiency compared to simulation software, making it suitable for running on the simulator of the hardware-in-the-loop real-time simulation system. For the highly complex model, other separated internal links (fixed computing processes separated from the highly complex model) can be retained, and the solver function of the existing technology can be replaced, and the deployment can be completed using C++. Among them, the deployed software will use the acceleration ability of the GPU for calculation during the simulation deduction phase. Due to the natural computing advantages of the GPU, its computing speed will be significantly faster than the original CPU simulation operation running on the simulation software and the executable C++ program. Therefore, in the engineering deployment phase, this method can also reduce the time consumption and improve the simulation speed, so as to achieve the real-time performance of the hardware-in-the-loop simulation system while ensuring the accuracy of the model. For other simple models, the simulation software running method can still be used for deployment on other simulators.

[0074] That is, after the physical model is completed with modeling design in the simulation software, it can be divided into simple models and complex models according to the complexity of the physical model. The simple models can be directly deployed on the simulator (running on the simulation software). The complex models can be divided into complex models and highly complex models according to the running speed of the generated C++ program and the model complexity. For the complex models, the C++ program is used to collect training data, and the output is obtained through external parameter input for fitting and neural network model training. Finally, the obtained neural network model is deployed on the simulator (C++ or Python). Due to the unacceptable training cost of the highly complex model, important solver links and other core links can be separated, and the core neural network model can be obtained through the neural network model training specifically for the core links. Since the other links are C++ programs, the neural network model can be directly deployed using C++ and embedded into the original C++ program for deployment on the simulator. The operation of all neural network models can use the GPU hardware for calculation and acceleration.

[0075] By adopting a GPU high-performance computing hardware platform, neural network model fitting, real-time operating system platform deployment, etc., the problems existing in the hardware-in-the-loop real-time simulation system for complex physical models, such as high requirements for the performance of logical computing units, large amounts of physical model parameters, and slow simulation deduction speed, are solved to a certain extent.

[0076] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by orientation words such as "front, back, up, down, left, right", "lateral, vertical, perpendicular, horizontal" and "top, bottom", etc. is usually based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description. Without contrary description, these orientation words do not indicate and imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the protection scope of the present invention; the orientation words "inside, outside" refer to the inside and outside relative to the contour of each component itself.

[0077] For the convenience of description, spatial relative terms such as "above...", "over...", "on the upper surface of...", "above" can be used here to describe the spatial positional relationship between a device or feature shown in the figure and other devices or features. It should be understood that the spatial relative terms are intended to include different orientations in use or operation in addition to the orientation described in the figure for the device. For example, if the device in the drawing is inverted, the device described as "above other devices or structures" or "over other devices or structures" will then be positioned as "below other devices or structures" or "under other devices or structures". Thus, the exemplary term "above..." can include both the orientations of "above..." and "below...". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and corresponding interpretations should be made for the spatial relative descriptions used here.

[0078] In addition, it should be noted that using words such as "first", "second" to limit components is only for the convenience of distinguishing the corresponding components. Without additional declaration, the above words have no special meaning. Therefore, it cannot be understood as a limitation on the protection scope of the present invention.

[0079] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A hardware-in-the-loop real-time simulation method integrating a neural network model, characterized in that, The method includes: Establishing physical models, including a first physical model, a second physical model, and a third physical model with increasing complexity in sequence; When the established model is the first physical model, deploying the first physical model to the simulator; When the established model is the second physical model, generating a first executable program according to the second physical model; When the established model is the third physical model, generating a second executable program according to the third physical model; For the first executable program, obtaining first output data by changing the input data of the first executable program and performing model simulation; For the second executable program, separating the second executable program into a conventional fixed calculation part and a solver differential calculation part, and performing solver differential calculation according to the input data of the second executable program to obtain second output data; Using a neural network model for predicting time series to perform fitting training on the input data and first output data of the first executable program and the input data and second output data of the second executable program, respectively obtaining a trained second physical model and a trained third physical model; Deploying the trained second physical model to the simulator; Deploying the calculation processes of the trained second physical model and the conventional fixed calculation part to the simulator.

2. The method according to claim 1, wherein Deploying the first physical model to the simulator using simulation software.

3. The method according to claim 2, wherein Deploying the trained second physical model to the simulator using C++ or Python.

4. The method according to claim 3, wherein Deploying the calculation processes of the trained second physical model and the conventional fixed calculation part to the simulator using C++.

5. The method according to claim 4, characterized in that, The first executable program and the second executable program are C++ programs.

6. A hardware-in-the-loop real-time simulation system integrating a neural network model, characterized in that, The system includes: A model establishment module for establishing physical models, including a first physical model, a second physical model, and a third physical model with increasing complexity in sequence; A deployment module for, when the established model is the first physical model, deploying the first physical model to the simulator; A generation module for, when the established model is the second physical model, generating a first executable program according to the second physical model, and obtaining first output data by changing the input data of the first executable program and performing model simulation; The generation module is further used for, when the established model is the third physical model, generating a second executable program according to the third physical model, separating the second executable program into a conventional fixed calculation part and a solver differential calculation part, and performing solver differential calculation according to the input data of the second executable program to obtain second output data; A training module for using a neural network for predicting time series to perform fitting training on the input data and first output data of the first executable program and the input data and second output data of the second executable program, respectively obtaining a trained second physical model and a trained third physical model; The deployment module is further used for deploying the trained second physical model to the simulator; The deployment module is further used for deploying the calculation processes of the trained second physical model and the conventional fixed calculation part to the simulator.

7. The system according to claim 6, wherein Deploying the first physical model to the simulator using simulation software.

8. The system according to claim 7, wherein Deploying the trained second physical model to the simulator using C++ or Python.

9. The system according to claim 8, wherein Deploy the calculation processes of the trained second physical model and the conventional fixed calculation part to the simulator using C++.

10. The system according to claim 9, wherein The first executable program and the second executable program are C++ programs.