Method and system for generating a package of free-to-compile FMU files, method and system for executing
Patent Information
- Application Number
- CN202610952631.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2046-06-30
AI Technical Summary
[0005]鉴于上述的分析,本发明实施例旨在提供一种免编译FMU文件包生成方法及系统、执行方法及系统,用以解决现有技术中FMU文件包的编译打包生成过程环境依赖强、跨平台兼容差、灵活性低的技术问题
将数据转换字典和增强型模型描述文件独立于代理模型的ONNX格式模型文件,实现业务数据转换与代理模型推理的解耦,以数据转换字典、增强型模型描述文件、ONNX格式模型文件作为FMU文件包的组成部分,无需进行代理模型源代码的编译,搭配通用执行引擎,实现FMU文件包的免编译快速生成,并可用于跨平台通用执行,降低了代理模型融入协同仿真的技术门槛和复杂度,用户无需掌握编译知识,只需按照约定生成模型和字典文件,即可完成FMU打包,使得AI专家也能轻松参与工业仿真。本发明实施例的方法和系统严格遵循FMI和ONNX两大开放标准,确保了广泛的工具兼容性,通过数据转换字典的设计,可以灵活处理各种复杂的数据类型和转换需求。
Smart Images

Figure CN122526617B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and system for generating and executing a compilation-free FMU file package. Background Technology
[0002] In the field of industrial digital simulation and machine learning model deployment technology, with the deepening application of machine learning (ML) and artificial intelligence (AI) technologies in industry, how to quickly, cost-effectively, and universally deploy trained proxy models (such as neural networks) into traditional FMI-based industrial simulation workflows has become a prominent technical challenge. ONNX (OpenNeural Network Exchange), as an open machine learning model format, provides a unified representation for models trained on different frameworks.
[0003] A Functional Mock-up Interface (FMI) is a tool-independent standard used to support the exchange and co-simulation of proxy models across different simulation environments / platforms. The packaged file is called an FMU. Traditional FMU creation is highly complex, requiring the proxy model source code (e.g., C / C++) to be compiled separately for different target platforms (e.g., Windows, Linux) to generate platform-specific binary dynamic libraries. In existing technologies, the FMU packaging process is tightly coupled with business logic, requiring business code to be hard-coded into the FMU file package. This results in a strong binding between execution and business logic, necessitating a complete recompilation and repackaging of the entire platform's source code for any new business changes. The FMU file package generation process suffers from numerous pain points, such as strong environment dependencies requiring complex compilation toolchains; poor cross-platform compatibility requiring separate compilation and packaging for each platform; high technical barriers, requiring users to possess compilation and low-level system knowledge; and a cumbersome and inflexible process, where even minor model modifications necessitate re-compiling and repackaging the entire process.
[0004] Therefore, there is an urgent need for a method and system for generating and executing FMU file packages without compilation, which can directly, quickly, and without compilation convert ONNX format proxy models into standard FMU file packages, and ensure that they can be correctly called and executed in various simulation environments / platforms. This reduces the dependence of model generation on the environment and the technical threshold and complexity of integrating proxy models into co-simulation, enabling proxy models to be used out of the box in the field of industrial simulation. Summary of the Invention
[0005] Based on the above analysis, the embodiments of the present invention aim to provide a method and system for generating FMU file packages without compilation, as well as an execution method and system, to solve the technical problems of strong environment dependence, poor cross-platform compatibility, and low flexibility in the compilation and packaging generation process of FMU file packages in the prior art.
[0006] On one hand, embodiments of the present invention provide a method for generating a compilation-free FMU file package, including: Obtain the sample service dataset, data transformation dictionary, and general execution engine corresponding to the target simulation service; wherein, the general execution engine is obtained through pre-compilation; The agent model is trained based on the sample business dataset to obtain the trained agent model; Based on the target simulation service and the trained proxy model, the corresponding ONNX format model file and enhanced model description file are determined; wherein, the enhanced model description file conforms to the FMI standard and includes variable-tensor mapping relationships; The general execution engine, the data transformation dictionary, the ONNX format model file, and the enhanced model description file are compressed and packaged to form an FMU file package.
[0007] Furthermore, each initial training sample in the sample business dataset includes multiple sample business data. The agent model is trained based on the sample business dataset to obtain the trained agent model, including: Based on the data conversion dictionary, the format of each sample business data of each initial training sample is converted to generate the corresponding standardized training sample; Based on the variable-tensor mapping relationship, tensor transformation is performed on each of the standardized training samples to generate the corresponding sample tensor. The proxy model is trained using all the sample tensors to obtain the trained proxy model.
[0008] Furthermore, based on the target simulation service and the trained proxy model, the corresponding ONNX format model file and enhanced model description file are determined, including: Export the trained proxy model as an ONNX format model file; Based on the trained surrogate model, a corresponding enhanced model description file is generated according to the FMI standard.
[0009] Furthermore, based on the trained surrogate model, a corresponding enhanced model description file is generated according to the FMI standard, including: Based on the trained surrogate model, a corresponding basic model description file is generated according to the FMI standard; The extended tags of the base model description file are updated based on the variable-tensor mapping relationship to obtain the enhanced model description file.
[0010] Furthermore, the general execution engine, the data transformation dictionary, the ONNX format model file, and the enhanced model description file are compressed and packaged to form an FMU file package, including: Place the general execution engine in the binaries folder, the data conversion dictionary and the ONNX format model file in the resources folder, and the enhanced model description file in the root directory; Using a packaging tool, the binaries folder, the resources folder, and the enhanced model description file are compressed and packaged to form the FMU file package.
[0011] On the other hand, embodiments of the present invention provide a method for executing a compilation-free FMU file package, applied to a simulation platform, including: The FMU file package is loaded; wherein the FMU file package includes a general execution engine, a data transformation dictionary, an ONNX format model file, and an enhanced model description file, and the FMU file package is generated according to the method in the preceding step; The general execution engine is used to parse the enhanced model description file and establish a variable-tensor mapping table; the ONNX format model file is loaded and a proxy model instance is created; Acquire simulation business data generated by real-time simulation; Based on the simulation business data, the data transformation dictionary, and the variable-tensor mapping table, the corresponding prediction business data is obtained using the general execution engine and the proxy model instance.
[0012] Furthermore, based on the simulation business data, the data transformation dictionary, and the variable-tensor mapping table, and utilizing the general execution engine and the proxy model instance, the corresponding prediction business data is obtained, including: Based on the simulation business data, the data conversion dictionary, and the variable-tensor mapping table, the corresponding simulation tensor is obtained using the general execution engine; Based on the simulation tensor, the corresponding prediction tensor is obtained using the proxy model instance; Based on the prediction tensor, the data transformation dictionary, and the variable-tensor mapping table, the corresponding prediction business data is obtained using the general execution engine.
[0013] Furthermore, the simulation tensor is obtained through the following steps: Based on the data conversion dictionary, the simulation business data is format-converted to generate corresponding simulation numerical data; Based on the variable-tensor mapping table, the simulation numerical data is transformed into tensors to generate the simulation tensors.
[0014] On the other hand, embodiments of the present invention provide a system for generating FMU file packages without compilation, comprising: The information acquisition module is used to acquire the sample business dataset, data transformation dictionary, and general execution engine corresponding to the target simulation business; wherein, the general execution engine is obtained through pre-compilation; The model training module is used to train the agent model based on the sample business dataset to obtain the trained agent model. The file generation module is used to determine the corresponding ONNX format model file and enhanced model description file based on the target simulation service and the trained proxy model; wherein the enhanced model description file conforms to the FMI standard; The file compression module is used to compress and package the general execution engine, the data conversion dictionary, the ONNX format model file, and the enhanced model description file to form an FMU file package.
[0015] On the other hand, embodiments of the present invention provide a compilation-free FMU file package execution system, applied to a simulation platform, comprising: The data acquisition module is used to acquire simulation business data generated by real-time simulation. The inference module is used to load the FMU file package; wherein the FMU file package includes the enhanced model description file, the ONNX format model file, the data transformation dictionary, and the general execution engine; The inference module is also used to parse the enhanced model description file using the general execution engine, establish a variable-tensor mapping table, load the ONNX format model file, and create a proxy model instance; The inference module is also used to obtain corresponding prediction business data based on the simulation business data, the data conversion dictionary, and the variable-tensor mapping table, using the general execution engine and the proxy model instance.
[0016] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects: By separating the data transformation dictionary and enhanced model description file from the proxy model's ONNX format model file, the decoupling of business data transformation and proxy model inference is achieved. The data transformation dictionary, enhanced model description file, and ONNX format model file are used as components of the FMU file package. This eliminates the need to compile the proxy model's source code. Combined with a general execution engine, the FMU file package can be generated quickly and without compilation, and can be used for cross-platform execution. This lowers the technical threshold and complexity of integrating the proxy model into co-simulation. Users do not need compilation knowledge; they only need to generate the model and dictionary files according to the conventions to complete the FMU packaging, enabling AI experts to easily participate in industrial simulation. The method and system of this invention strictly adhere to the two major open standards, FMI and ONNX, ensuring broad tool compatibility. Through the design of the data transformation dictionary, various complex data types and transformation requirements can be flexibly handled.
[0017] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description
[0018] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. Figure 1 This is a flowchart illustrating a method for generating a compilation-free FMU file package according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the internal structure of a non-compilable FMU file package in an embodiment of the present invention; Figure 3 This is a flowchart illustrating a method for executing a non-compiled FMU file package according to an embodiment of the present invention; Figure 4 This is a flowchart illustrating another method for executing a non-compiled FMU file package in an embodiment of the present invention; Figure 5 This is a schematic diagram of the main modules of a compile-free FMU file package generation system in an embodiment of the present invention; Figure 6 This is a schematic diagram of the main modules of a non-compiled FMU file package execution system according to an embodiment of the present invention. Detailed Implementation
[0019] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0020] A specific embodiment 1 of the present invention discloses a method for generating a compilation-free FMU file package, such as... Figure 1 As shown, it includes: Step S1: Obtain the sample service dataset, data transformation dictionary, and general execution engine corresponding to the target simulation service; wherein the general execution engine is obtained through pre-compilation.
[0021] Obtain the sample business dataset, data transformation dictionary, and general execution engine corresponding to the target simulation business.
[0022] In this embodiment, the target simulation service refers to the business process that requires reasoning based on a proxy model during simulation, including reasoning based on business data corresponding to business design variables and obtaining business data corresponding to business result variables. For example, the target simulation service creates an FMU for an industrial fan vibration status monitoring scenario, where the business design variables are the fan vibration signal and the fan start / stop status, and the business result variable is the fan health status.
[0023] The sample business dataset is constructed based on historical data of the actual industrial production process corresponding to the target simulation business. It includes multiple sets of historical business data corresponding to business design variables and business result variables. Each set of historical business data constitutes an initial training sample, and the historical business data serves as the sample business data. In other embodiments, the target simulation software matching the target simulation business can also be used to simulate the actual industrial production process, and the sample business dataset can be constructed based on the simulation data generated by the simulation calculation. Based on the aforementioned example, the business data corresponding to the fan vibration signal (business design variable) is the vibration signal feature value; the business data corresponding to the fan start / stop status (business design variable) is the fan start / stop identifier (the value range includes on and off); and the business data corresponding to the fan health status (business result variable) is the health status identifier (the value range includes normal, abnormal, and dangerous). Each business data is collected periodically, and the vibration signal feature value, fan start / stop identifier, and health status identifier collected each time constitute a set of historical business data, i.e., an initial training sample.
[0024] The data conversion dictionary includes conversion rules for business design variables, used to convert business-type data corresponding to business design variables into numerical data. The converted numerical data can be used as input data for subsequent proxy model training or as input data for the proxy model during execution. It also includes conversion rules for business result variables, used to convert the numerical data corresponding to the proxy model's output results into business-type data, obtaining business data corresponding to business result variables that conform to business specifications. In this embodiment, the data conversion dictionary can be pre-built based on the target simulation business. Based on the aforementioned example, the conversion rule corresponding to the wind turbine vibration signal (business design variable) is as follows: ,in, This is the business-type data corresponding to the wind turbine vibration signal (i.e., the original collected vibration signal characteristic values, which are numerical values in this example). This refers to the numerical data corresponding to the wind turbine vibration signal (i.e., the vibration signal characteristic values after format conversion); the conversion rules for the wind turbine start / stop status (business design variable) are as follows: ,in, This refers to the business data corresponding to the start / stop status of the wind turbines (i.e., the original wind turbine start / stop identifiers collected). This refers to the numerical data corresponding to the wind turbine start / stop status (i.e., the wind turbine start identifier after format conversion); the conversion rule for the wind turbine health status (business result variable) is as follows. ,in, This refers to the business-type data corresponding to the health status of the wind turbine (i.e., the original health status identifier collected). This refers to the numerical data corresponding to the health status of the wind turbine (i.e., the health status identifier after format conversion).
[0025] The general execution engine, obtained through pre-compilation, possesses the ability to parse enhanced model description files, perform business data format conversions and tensor conversions, and execute proxy models. It is an execution engine decoupled from the proxy model. In this embodiment, the general execution engine includes an XML parser, a dictionary loading module, a proxy model loading module, an ONNX Runtime, and a format conversion module. The XML parser is used to load the enhanced model description file and establish a variable-tensor mapping table during the execution of the FMU file package. The dictionary loading module is used to load the data conversion dictionary during the execution of the FMU file package. The proxy model loading module is used to load the ONNX format model file during the execution of the FMU file package and create proxy model instances on the simulation platform. The ONNX Runtime ensures the runtime environment of the proxy model during the execution of the FMU file package and supports forward computation and inference of any proxy model. The format conversion module is used to perform format conversions and tensor conversions based on the data conversion dictionary and the variable-tensor mapping table during the execution of the FMU file package. Furthermore, for different operating systems, a general execution engine in the corresponding format is pre-compiled. For example, for win64 systems, the dll format is used, such as onnxmodel.dll, with a file size of about 550kb; for linux64 and LinuxARM64 systems, the so format is used, such as onnxmodel.so, with a file size of about 650kb; and for macOS x64 systems, the dylib format is used, such as libdaoos_onnx_fmu.dylib, with a file size of about 600kb.
[0026] Furthermore, this also includes acquiring a proxy model and constructing variable-tensor mapping relationships based on the target simulation business and the proxy model. This includes mapping relationships between all business design variables and the model input tensors of the proxy model, and mapping relationships between all outcome design variables and the model output tensors of the proxy model. Taking the mapping relationship between all business design variables and model input tensors as an example, it is constructed based on the input variable order, number of input variables, and input variable format of the model input tensors of the proxy model, as well as the variable order, number of variables, and data format after format conversion of all business design variables. This is used to define the rules for adjusting the order of all business design variables and the data mapping rules. Based on the aforementioned example, the data mapping rule between the numerical data corresponding to the wind turbine health status (outcome design variable) and the model output tensors of the proxy model is as follows: ,in, Output tensor data corresponding to the tensor to the model (i.e., health status identifier after tensor transformation). This refers to the numerical data corresponding to the health status of the wind turbine (i.e., the health status identifier after format conversion).
[0027] Step S2: Train the agent model based on the sample business dataset to obtain the trained agent model.
[0028] The agent model is trained based on the sample business dataset to obtain the trained agent model. In this embodiment, each initial training sample in the sample business dataset includes multiple sample business data, and step S2 includes steps S21-S23.
[0029] Step S21: Based on the data conversion dictionary, perform format conversion on the sample business data of each initial training sample to generate the corresponding standardized training sample.
[0030] For each initial training sample, according to the data conversion dictionary, the business data of each sample of the initial training sample is converted according to the corresponding conversion rules to generate the corresponding sample numerical data. The sample numerical data constitute the standardized training sample.
[0031] In this embodiment, if the sample service data is numerical, the corresponding conversion rule is to maintain the value, meaning the sample numerical data and the sample service data are the same. If the sample service data is non-numerical, the format is converted according to the corresponding conversion rule. For example, based on the previous example, if the sample service data (i.e., the health status identifier) corresponding to the wind turbine health status is abnormal, the corresponding sample numerical data is 1. It can be understood that bidirectional format conversion between sample service data and sample numerical data can be performed based on each sample service data according to the corresponding conversion rule.
[0032] For example, the sample business data corresponding to all business design variables of each initial training sample consists of 12 vibration signal feature values and 1 wind turbine start / stop identifier. The sample business data corresponding to all business result variables consists of 1 health status identifier. According to the corresponding conversion rules, the 12 vibration signal feature values remain unchanged, and the wind turbine start / stop identifier and health status identifier are converted into numerical form to obtain the corresponding standard training sample.
[0033] In other embodiments, if the sample business data is continuous data, no processing is performed; if the sample business data is discrete data (including discrete real numbers and integers), the values are first sorted, then converted into an ascending array, establishing a mapping relationship between discrete data and array indices, and then the consecutive integers of the n indices are used as the corresponding sample numerical data; if the sample business data is string data, the characters are first sorted to obtain a corresponding string array, the strings are converted into corresponding array indices, and then converted into n consecutive integers as sample numerical data; if the sample business data is of Boolean type, it is directly converted into 0 and 1 integers as sample numerical data.
[0034] Step S22: Based on the variable-tensor mapping relationship, perform tensor transformation on each of the standardized training samples to generate the corresponding sample tensor.
[0035] Based on the variable-tensor mapping relationship, tensor transformation is performed on each standardized training sample to generate a corresponding sample tensor. In this embodiment, the sample tensor includes the sample tensor data corresponding to the model input tensor and the model output tensor.
[0036] Based on the mapping relationship between all business design variables and model input tensors, the order of sample numerical data corresponding to all business design variables in each standardized training sample is adjusted and the data is mapped to obtain sample tensor data corresponding to the model input tensor. The order of each element in the obtained sample tensor data is consistent with the order of the input variables, the number of elements is consistent with the number of input variables, and the format of each element conforms to the input variable format requirements. Based on the same principle, the order of sample numerical data corresponding to all business result variables in each standardized training sample is adjusted and the data is mapped to obtain sample tensor data corresponding to the model output tensor.
[0037] Based on the aforementioned example, the mapping relationship between all business design variables and model input tensors stipulates that the order, quantity, and numerical normalization of each business design variable remain unchanged. Therefore, the order and quantity of each vibration signal feature value and the wind turbine start / stop indicator are kept constant. The vibration signal feature values are normalized to obtain the sample tensor data (input_1 tensor) corresponding to the model input tensor. Similarly, the mapping relationship between all business result variables and model output tensors stipulates that the order, quantity, and data mapping of each business result variable remain unchanged. ,in, Output the tensor data corresponding to the tensor for the model. For numerical data corresponding to business outcome variables, if the health status identifier after format conversion is 1, vector mapping is performed, and the corresponding sample tensor data (output_1 tensor) is: .
[0038] It should be noted that if the number of input variables corresponding to the proxy model is inconsistent with the number of business design variables, then a vector is constructed using the sample numerical data corresponding to all business design variables in each standardized training sample. This vector is then mapped to a vector with the same dimension as the number of input variables, serving as the sample tensor data corresponding to the model input tensor. The same principle can be used to obtain the sample tensor data corresponding to the model output tensor.
[0039] Understandably, bidirectional tensor transformation can be performed on the standardized training samples and sample tensors based on the variable-tensor mapping relationship.
[0040] Step S23: Train the proxy model using all the sample tensors to obtain the trained proxy model.
[0041] The surrogate model is trained using all sample tensors to obtain the trained surrogate model. In this embodiment, the sample tensor data corresponding to the model input tensor in each sample tensor is used as the input to the surrogate model to obtain the corresponding generated tensor. The corresponding loss value is calculated based on the generated tensor corresponding to each sample tensor and the sample tensor data corresponding to the model output tensor in the sample tensor. The surrogate model is trained using the loss value to obtain the trained surrogate model. The training process can use existing techniques, and there are no restrictions here.
[0042] Furthermore, the surrogate model can be one or more of the following: multinomial response surface model, kriging model, radial basis function model, convolutional neural network model, or other surrogate models in the prior art. If there are multiple surrogate models, each surrogate model is trained separately based on steps S22-S23 to obtain each trained surrogate model.
[0043] Step S3: Based on the target simulation service and the trained proxy model, determine the corresponding ONNX format model file and enhanced model description file; wherein, the enhanced model description file conforms to the FMI standard and includes variable-tensor mapping relationships.
[0044] Based on the target simulation service and the trained proxy model, determine the corresponding ONNX format model file and enhanced model description file, wherein the enhanced model description file conforms to the FMI standard. Step S3 includes steps S31-S32.
[0045] Step S31: Export the trained proxy model as an ONNX format model file.
[0046] The trained surrogate model is exported as an ONNX format model file. In this embodiment, the ONNX format model file refers to the ONNX file corresponding to the surrogate model, such as model.onnx. Existing technologies can be used to export the trained surrogate model as an ONNX format model file. For example, if the surrogate model is built and trained using the PyTorch framework, the torch.onnx tool is used to export it as the corresponding ONNX file; if the TensorFlow / Keras framework is used, the tf2onnx tool is used to export it as the corresponding ONNX file. ONNX (Open Neural Network Exchange) refers to an open format for representing deep neural network models.
[0047] Step S32: Based on the trained surrogate model, generate the corresponding enhanced model description file according to the FMI standard.
[0048] Based on the trained surrogate model, a corresponding enhanced model description file is generated according to the FMI standard. This file is used to standardize the data structure, type, default value, and value range of the input and output parameters of the trained surrogate model, including steps S321-S322.
[0049] Step S321: Based on the trained surrogate model, generate the corresponding basic model description file according to the FMI standard.
[0050] Based on the trained surrogate model, a corresponding basic model description file is generated according to the FMI standard. Specifically, based on the data structure of the model input tensor and model output tensor of the trained surrogate model, a basic model description file conforming to the Functional Mock-up Interface (FMI) standard is generated. The FMI standard includes a definition specification for a basic model description file. The generated basic model description file is mainly used for a standardized description of the data structure, type, default value, and value range of the model's input and output parameters. It also supports the description and definition of the surrogate model's execution program and execution environment. In this embodiment, the execution environment is the default Co-Simulation built-in solver of FMU, and the execution program is a general-purpose execution engine. After obtaining the trained surrogate model, the data structure, type, and range of the surrogate model's model input tensor and model output tensor are already determined. Based on the definition specification of the FMI model description file, a basic model description file conforming to the FMI standard for the surrogate model is automatically generated.
[0051] Step S322: Update the extended tags of the basic model description file based on the variable-tensor mapping relationship to obtain the enhanced model description file.
[0052] An enhanced model description file is obtained by updating the extended tags of the basic model description file based on the variable-tensor mapping relationship. Specifically, the basic model description includes extended tags. The extended tags are updated with the variable-tensor mapping relationship to obtain the enhanced model description file, clarifying the mapping relationship between business design variables and model input tensors, and the mapping relationship between business result variables and model output tensors. In this embodiment, the extended tags include ScalarVariable tags and Annotations tags. The ScalarVariable tag specifies the tensor name mapping, and the Annotations tag specifies the tensor shape information. Utilizing the custom extension capabilities of the FMI standard, a description of the variable-tensor mapping relationship is added to the enhanced model description file. For example, <scalarvariable name="vibration_features" valuereference="0" causality="input" variability="continuous"> <Realstart="0.0" / > <annotations> <annotation name="onnx:tensor_name"> input_1< / annotation> <annotation name="onnx:tensor_shape"> [1, 12]< / annotation> < / annotations> < / scalarvariable> By extending the labels, support for complex proxy models with multiple input tensors is achieved. For example, the first business design variable corresponds to the value at the 0th position of the first tensor input1 in the proxy model; the second business design variable corresponds to the value at the 3rd position of the second tensor input2 in the proxy model.
[0053] Furthermore, if there are multiple proxy models, then based on the target simulation service and each trained proxy model, the ONNX format model file and enhanced model description file corresponding to each proxy model are obtained according to step S3.
[0054] Step S4: Compress and package the general execution engine, the data conversion dictionary, the ONNX format model file, and the enhanced model description file to form an FMU file package.
[0055] The general execution engine, data transformation dictionary, ONNX format model file and enhanced model description file are compressed and packaged to form an FMU file package, including steps S41-S42.
[0056] Step S41: Place the general execution engine into the binaries folder, place the data conversion dictionary and the ONNX format model file into the resources folder, and place the enhanced model description file into the root directory.
[0057] In this embodiment, the general execution engine is placed in the binaries folder, the data transformation dictionary and ONNX format model files are placed in the resources folder, and the enhanced model description file is placed in the root directory, such as... Figure 2 As shown, Mymodel.fmu represents the FMU file package, binaries / represents the binaries folder, resources / represents the resources folder, onnxmodel.dll and onnxmodel.so represent the general execution engines for Win64 and Linux64 systems, respectively, model.onnx represents the ONNX format model file, data_dict.json represents the data transformation dictionary, and modelDescription.xml represents the enhanced model description file.
[0058] Step S42: Using a packaging tool, compress and package the binaries folder, the resources folder, and the enhanced model description file to form the FMU file package.
[0059] Using a packaging tool, the binaries folder, resources folder, and enhanced model description files are compressed and packaged to form an FMU file package. In this embodiment, the packaging tool can be a compression and packaging tool in the prior art, or the export tool built into the architecture adopted by the proxy model can be used. It is understood that the compression and packaging in this embodiment standardizes and compresses the files in each folder and root directory, without excluding compilation processing, to generate an FMU format compressed file. The compression and packaging is completely independent of the compilation environment, reducing the packaging time from several hours to seconds.
[0060] Furthermore, if there are multiple proxy models, then in step S4, the general execution engine, data conversion dictionary, each ONNX format model file and each enhanced model description file are compressed and packaged to form an FMU file package.
[0061] Furthermore, if the target simulation service includes multiple sub-tasks, the corresponding sample service dataset and data conversion dictionary can be obtained for each sub-task. Referring to steps S2-S3, the ONNX format model file and enhanced model description file corresponding to each sub-task can be obtained. In step S4, the general execution engine, each data conversion dictionary, each ONNX format model file and each enhanced model description file are compressed and packaged to form an FMU file package.
[0062] In this embodiment, the general execution engine is decoupled from the ONNX format model files of each proxy model, facilitating parallel inference of multiple proxy models and proxy model replacement. The model input tensors and model output tensors of the proxy models are defined and described through an enhanced model description file, and the variable-tensor mapping relationship is agreed upon. This associates business design variables with proxy model inputs and proxy model outputs with business result variables, completing the extraction and isolation of variable factors in traditional dynamic link libraries. The general execution engine only needs to parse the enhanced model description file, load the ONNX format model files and data conversion dictionary, solving the problems in traditional FMU packaging where simulation variables and the execution process inside the DLL are closely related to business issues, requiring modifications and adjustments to the DLL's source code and recompilation for different proxy models.
[0063] The ONNX format model file, data transformation dictionary, and enhanced model description file are used to fully represent the business-related data of different FMUs. The general binary program (general execution engine, onnxmodel.dll / .so) no longer contains any business calculation logic or special data processing logic. The business calculation and inference logic is expressed by the ONNX format model file. The special data processing logic is defined by the agreed rules in onnxmodel.dll / .so, which defines a set of logic implementations for automatically parsing, matching, and transforming the enhanced model description file and data transformation dictionary. This allows the general execution engine to be compiled and adapted to all FMU packaged businesses at once. By extracting and configuring the differences, the general execution engine is decoupled from the ONNX format model files of each proxy model.
[0064] A specific embodiment 2 of the present invention discloses a method for executing FMU file packages without compilation, applied to a simulation platform, such as... Figure 3 As shown, it includes: Step S5: Load the FMU file package; wherein the FMU file package includes a general execution engine, a data transformation dictionary, an ONNX format model file, and an enhanced model description file, and the FMU file package is generated according to the method of steps S1-S4.
[0065] After obtaining the FMU file package, the simulation platform loads the general execution engine within it. The FMU file package includes the general execution engine, a data transformation dictionary, ONNX format model files, and enhanced model description files. This FMU file package is obtained according to steps S1-S4. In this embodiment, after obtaining the FMU file package, the simulation platform decompresses it to a system temporary directory and loads the general execution engine. This ensures that all packaged resources have a complete set of decompressed resources in a linked directory. This temporary directory is the runtime directory of the general execution engine. Based on relative paths, the corresponding ONNX format model files in the resources directory can be obtained. The general execution engine is implemented using the FMI interface standard and can be directly loaded by third-party FMU simulation platforms that also conform to the FMI interface calling standard.
[0066] The following is an example of the FMUState state structure after the general execution engine is loaded: pub struct FMUState{ / / 1. Model Description (parsed from modeLDescription.xmL) model_description:Option <modeldescription>, / / 2. ONNX Actuator (encapsulating ONNXRuntime session) onnx_executor:Option <std::cell::RefCell <onnxexecutor>>, / / 3. Data dictionary (from model_dict.json) data_dict: JsonValue, / / 4. Unified value storage (supports all FMI2 data types) values: HashMap<String, FmuValue> , / / 5. Data Converter (Application of Input / Output Transformation) transformer: DataTransformer, / / 6. Variable initializer (reads default values from XML) variable_initializer: VariableInitializer, / / 7. Performance Metrics (Monitoring Execution Efficiency) performance_metrics: PerformanceMetrics, / / 8. Models and Resource Paths model_path: String, resource_path: String, / / 9. FMU Status Flags state: Fmi2Status, } Use HashMap<String, FmuValue> The system provides unified management of business simulation data across four data types: Real, Integer, Boolean, and String. The FmuValue enumeration type supports Real, Integer, Boolean, and String types. It utilizes RefCell. <onnxexecutor>Internal mutability is implemented, allowing modification of the executor state under immutable references. These immutable references correspond to the `fmi2SetXXX` interfaces used to set input parameter values during the execution of the FMU file package (XXX represents one of four corresponding data types, fixed according to the interface function name). In `FMUState`, a HashMap is used for this purpose.<String, FmuValue> It directly receives and stores all input value names and specific object information for use in subsequent data conversion.
[0067] Step S6: Use the general execution engine to parse the enhanced model description file and establish a variable-tensor mapping table; load the ONNX format model file and create a proxy model instance.
[0068] The general execution engine is used to parse the enhanced model description file to obtain the code model description information such as the definition description of the model input tensor and model output tensor of the proxy model, as well as the variable-tensor mapping relationship. Based on the variable-tensor mapping relationship, a variable-tensor mapping table is established to represent the mapping relationship between business design variables and model input tensors, and the mapping relationship between business result variables and model output tensors. This table is used to convert simulation numerical data into simulation tensors and prediction tensors into prediction numerical data.
[0069] The general execution engine loads the ONNX format model file through the `fmi2Instantiate` instantiation function and creates a proxy model instance on the simulation platform. Using the temporary directory decompressed at runtime, and based on the general execution engine (onnxmodel.dll / .so), the actual path of the ONNX format model file in the temporary directory is obtained via a relative path. This runtime determination of the actual location is based on the agreed-upon relative path structure. In this embodiment, the file path of the ONNX format model file is determined only during instantiation, rather than during compilation after generating the FMU file package.
[0070] Furthermore, the general execution engine also loads the data transformation dictionary into the simulation platform's memory.
[0071] The execution method of this embodiment achieves isolation mapping of six dimensions of business differences—variable quantity, variable name, variable type, tensor mapping, data transformation, and model results—through an enhanced model description file, a data transformation dictionary, and an ONNX format model file. These variables include business design variables and business result variables. For example, in traditional solutions, these are bound at compile time; this embodiment uses an enhanced model description file... <modelvariables>The number of child nodes is configured using variables. The variable names are configured through the `name` attribute in the enhanced model description file and the `fmu_variable_name` variable in the data transformation dictionary. <real> / <integer>The tag +FmuValue enumerates the runtime dispatch configuration variable types. Tensor mapping is configured through the onnx:tensor_name extension in the enhanced model description file and the tensor_name field in the data transformation dictionary. Data transformation (including data type, order, and format) is configured declaratively through the operations array in the data transformation dictionary. The computation graph is automatically parsed by ONNXRuntime and loaded at runtime through the ONNX format model file.
[0072] Step S7: Obtain the simulation business data generated by real-time simulation.
[0073] In this embodiment, the simulation business data refers to the business data corresponding to the business design variables generated by real-time simulation in the simulation platform, which can be generated by the simulation module in the simulation platform through real-time simulation.
[0074] Step S8: Based on the simulation business data, the data transformation dictionary, and the variable-tensor mapping table, obtain the corresponding prediction business data using the general execution engine and the proxy model instance.
[0075] Based on simulation business data, data transformation dictionary and variable-tensor mapping table, the corresponding prediction business data is obtained using a general execution engine and agent model instance, including steps S81-S83.
[0076] Step S81: Based on the simulation business data, the data conversion dictionary, and the variable-tensor mapping table, the corresponding simulation tensor is obtained using the general execution engine.
[0077] Based on simulation business data, data conversion dictionary and variable-tensor mapping table, the general execution engine performs format conversion and tensor conversion to obtain the corresponding simulation tensors.
[0078] In this embodiment, the simulation tensor is obtained through steps S811-S812.
[0079] Step S811: Based on the data conversion dictionary, perform format conversion on the simulation business data to generate corresponding simulation numerical data.
[0080] For each business design variable, the simulation business data is converted according to the corresponding variable name in the data conversion dictionary to generate the corresponding simulation numerical data. The process of obtaining the sample numerical data corresponding to the business design variable can be referred to in step S21, which will not be repeated here.
[0081] Step S812: Based on the variable-tensor mapping table, perform tensor transformation on the simulation numerical data to generate the simulation tensor.
[0082] For all simulation numerical data corresponding to business design variables, tensor transformation is performed according to the variable-tensor mapping table, including order adjustment and data mapping, to generate simulation tensors. In this embodiment, the simulation tensors include the simulation tensor data corresponding to the model input tensors. The order adjustment and data mapping of the simulation numerical data corresponding to all business design variables can be referred to in step S22 to obtain the sample tensor data corresponding to the model input tensors, which will not be repeated here.
[0083] Step S82: Based on the simulation tensor, obtain the corresponding prediction tensor using the surrogate model instance.
[0084] The simulation tensor is used as input to the surrogate model instance. The ONNX Runtime environment is invoked to perform forward computation and inference using the surrogate model instance to obtain the corresponding prediction tensor.
[0085] Step S83: Based on the prediction tensor, the data transformation dictionary, and the variable-tensor mapping table, the corresponding prediction business data is obtained using the general execution engine.
[0086] Based on the prediction tensor, data transformation dictionary, and variable-tensor mapping table, a general execution engine is used to perform tensor transformation and format conversion to obtain the corresponding prediction business data.
[0087] First, for the prediction tensor, based on the mapping relationship between all result design variables and model output variables in the variable-tensor mapping table, the prediction tensor is transformed into a tensor to obtain the prediction numerical data corresponding to all result design variables. The reverse transformation can be performed by referring to the process of obtaining the sample tensor data corresponding to the model output tensor in step S22, which will not be elaborated here.
[0088] Secondly, for the predicted numerical data corresponding to each result design variable, the corresponding predicted business data is obtained according to the data conversion dictionary. The process of obtaining the sample numerical data corresponding to the result design variable in step S21 can be reversed, which will not be elaborated here.
[0089] It is understandable that the simulation module in the simulation platform that performs real-time simulation is different from the target simulation software in step S1. The simulation module generates business data (i.e., simulation business data) corresponding to the design variables. After format conversion and tensor conversion, it is handed over to the proxy model instance to perform inference, obtain the prediction tensor, and after tensor conversion and format conversion, obtain the prediction business data corresponding to the business result variables.
[0090] Furthermore, if the FMU file package includes ONNX format model files and enhanced model description files corresponding to multiple proxy models, steps S6-S7 can be executed in parallel to establish variable-tensor mapping tables and proxy model instances corresponding to each proxy model. Using the general execution engine and each proxy model instance, multiple prediction business data can be obtained, and the final prediction business data can be determined according to the voting mechanism.
[0091] Furthermore, if the FMU file package includes a data transformation dictionary, an ONNX format model file, and an enhanced model description file corresponding to multiple subtasks, then in step S6, each enhanced model description file is parsed, and the execution order of each proxy model instance is determined according to the input and output variables corresponding to each proxy model. For example, if the output variable of proxy model A is the same as the input variable of proxy model B, then step S7 is executed first based on the proxy model instance corresponding to proxy model A, and then step S7 is executed based on the proxy model instance corresponding to proxy model B, until all proxy model instances are executed, and the final prediction business data is obtained.
[0092] In a specific embodiment 3 of the present invention, based on the scenario of industrial fan vibration state monitoring as the target simulation service, the execution process of the method for generating a non-compiled FMU file package (steps 1-4) and the execution method (steps 5-7) are described. The non-compiled FMU file execution method is combined with... Figure 3 Please provide an explanation.
[0093] Step 1: Obtain the sample business dataset, proxy model, and general execution engine corresponding to the target simulation business, and establish the data transformation dictionary (vibration_dict.json) and variable-tensor mapping relationship.
[0094] In this scenario, the sample business data corresponding to all business design variables are vibration signal feature values, and the sample business data corresponding to all result design variables are health status indicators (e.g., normal, abnormal, dangerous).
[0095] Step 2: Train the agent model based on the sample business dataset to obtain the trained agent model, and export the corresponding ONNX format model file.
[0096] Specifically, a one-dimensional convolutional neural network (1D-CNN) is trained using PyTorch to classify the feature values of vibration signals. After training, the model is exported as vibration_model.onnx.
[0097] Step 3: Based on the target simulation business and the trained agent model, determine the enhanced model description file.
[0098] Specifically, a description file generation tool (which can be a script or software module, and is the standard description definition file for FMU, essentially an XML file conforming to the FMU standard, describing some basic information about FMU, execution environment dependencies, and input / output parameter definitions) is used to generate an enhanced model description file (modelDescription.xml). In this file, we define an input variable `vibration_features` (a 12-dimensional array of real numbers) and an output variable `health_status` (an integer enumeration type, 0 / 1 / 2). By extending annotations or naming conventions (e.g., associating variable names with tensor names), we explicitly map `vibration_features` to the ONNX model's `input_1` tensor, and `health_status` to the `argmax` result of the `output_1` tensor. For example, "input_metadata": { "tensor_name": "input_1", "shape": [1, 12], "mean": [0.5, 0.3, ..., 1.2], "std": [0.1, 0.2, ..., 0.5] }, "output_metadata": { "tensor_name": "output_1", "class_labels": ["Normal", "Warning", "Danger"] } This indicates that the original 12-dimensional vibration signal feature values need to be normalized by subtracting the mean and dividing the standard deviation before they can be input into a tensor named input_1; the output tensor output_1 is a 3-dimensional vector, and its maximum value index corresponds to the category in class_labels.
[0099] Step 4: Use a packaging tool to create an FMU file package.
[0100] Use a packaging tool to package the following files into WindTurbineMonitor.fmu: –vibration_model.onnx → Place in / resources / –vibration_dict.json → Place in / resources / –modelDescription.xml → Place in the root directory – Place the pre-compiled onnxmodel.dll for Windows 64-bit platforms in / binaries / win64 / – (Optional) Compile onnxmodel.so for Linux platform → Place in / binaries / linux64 / Complete the generation of the FMU file package that does not require compilation.
[0101] Step 5: Load the FMU file package, use the general execution engine to parse the enhanced model description file, establish a variable-tensor mapping table; load the ONNX format model file, create a proxy model instance; parse the data transformation dictionary.
[0102] The simulation platform loads and initializes the FMU file package according to its own system architecture (such as Windows 64-bit), calling the exported functions in / binaries / win64 / onnxmodel.dll. During the initialization of the general execution engine (onnxmodel.dll), it parses the enhanced model description file (modelDescription.xml), loads the data transformation dictionary (vibration_dict.json), establishes the corresponding mapping relationships and transformation rules in memory, and loads the ONNX format model file (vibration_model.onnx). After loading is complete, the general execution engine returns a success message for initialization. The FMU file package (WindTurbineMonitor.fmu) can be imported by the user into a simulation platform that supports FMI (such as SimulationX); an automatic parser for the description file modelDescription.xml in the root directory of the FMU can be implemented using Rust or C++.
[0103] Step 6: Obtain the simulation business data generated by real-time simulation.
[0104] The simulation module of the simulation platform calculates a set of vibration signal characteristic values [f1, f2, ..., f12] (i.e., simulation service data) at each simulation step. Figure 4 The business input data is then transmitted to the general execution engine.
[0105] Step 7: Based on the simulation business data, data transformation dictionary, and variable-tensor mapping table, obtain the predicted business data using the general execution engine and proxy model instance.
[0106] The internal data mapping module of the general execution engine (onnxmodel.dll) normalizes the characteristic values of the vibration signal based on the data transformation dictionary and variable-tensor mapping table, and fills them into the input_1 tensor. Figure 4 The process involves querying input transformation rules, returning transformation parameters, and performing input data transformation. Then, the transformed tensor data is transmitted to the proxy model instance (i.e.,...). Figure 4 In the ONNX model, the ONNX Runtime is called to perform model inference with the proxy model instance, and the output_1 tensor with the value [0.05, 0.15, 0.80] is obtained. This output tensor data is then returned to the general execution engine.
[0107] The general execution engine's data mapping module calculates the index value 2 (i.e., the predicted numerical data) by performing argmax on the output tensor data. Then, based on the data transformation dictionary, it determines the final state as "Danger" (or directly outputs the integer 2, i.e., the predicted business data). Figure 4 The process involves querying output conversion rules, returning inverse conversion parameters, and performing output data conversion. It then returns business output data (the `health_status` variable) to the simulation model on the simulation platform. The simulation module can then trigger alarms or execute shutdown logic based on this result.
[0108] This embodiment constructs a general execution engine and designs a mechanism for automatically parsing and mapping enhanced model description files and dynamically loading and executing proxy models. This completely removes content related to business variability from the FMU executable program, pre-compiles the business-decoupled executable program into a general execution engine, and achieves automatic mapping and execution through configuration and dictionaries. The general execution engine can be used permanently after being compiled once. When generating the FMU file package, the pre-compiled general execution engine is used directly to generate the FMU enhanced model description file, and combined with the ONNX format model file and the ONNX model matching data conversion dictionary JSON, the compression and packaging process of the FMU file package is essentially a multi-file compression process, which can be completely separated from the compilation environment.
[0109] Based on the enhanced model description file of FMU, the FMU parameters (i.e., business simulation data) are automatically parsed, mapped, and converted into standard proxy model simulation tensors, enabling direct application of the proxy model obtained through general training.
[0110] A specific embodiment 4 of the present invention discloses a system for generating FMU file packages without compilation, such as... Figure 5 As shown, it includes: The information acquisition module is used to acquire the sample business dataset, data transformation dictionary, and general execution engine corresponding to the target simulation business; wherein, the general execution engine is obtained through pre-compilation; The model training module is used to train the agent model based on the sample business dataset to obtain the trained agent model. The file generation module is used to determine the corresponding ONNX format model file and enhanced model description file based on the target simulation service and the trained proxy model; wherein the enhanced model description file conforms to the FMI standard; The file compression module is used to compress and package the general execution engine, the data conversion dictionary, the ONNX format model file, and the enhanced model description file to form an FMU file package.
[0111] The above-described generation method and generation system embodiments are based on the same principle, and their related aspects can be referenced from each other to achieve the same technical effect. For specific implementation processes, please refer to the foregoing embodiments, which will not be repeated here.
[0112] A specific embodiment 5 of the present invention discloses a compilation-free FMU file package execution system, applied to a simulation platform, such as... Figure 6 As shown, it includes: The data acquisition module is used to acquire simulation business data generated by real-time simulation. The inference module is used to load the FMU file package; wherein the FMU file package includes the enhanced model description file, the ONNX format model file, the data transformation dictionary, and the general execution engine; The inference module is also used to parse the enhanced model description file using the general execution engine, establish a variable-tensor mapping table, load the ONNX format model file, and create a proxy model instance; The inference module is also used to obtain corresponding prediction business data based on the simulation business data, the data conversion dictionary, and the variable-tensor mapping table, using the general execution engine and the proxy model instance.
[0113] The above-described implementation method and system embodiments are based on the same principle, and their related aspects can be referenced from each other to achieve the same technical effect. For specific implementation processes, please refer to the foregoing embodiments, which will not be repeated here.
[0114] In summary, the method and system for generating and executing a non-compiled FMU file package according to embodiments of the present invention have at least one of the following beneficial effects: By separating the data transformation dictionary and enhanced model description file from the ONNX format model file of the proxy model, the business data transformation and proxy model inference are decoupled. The data transformation dictionary, enhanced model description file, and ONNX format model file are used as components of the FMU file package. There is no need to compile the proxy model source code. With the general execution engine, the FMU file package can be generated quickly without compilation and can be used for cross-platform general execution, which reduces the technical threshold and complexity of integrating the proxy model into co-simulation.
[0115] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0116] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.< / integer> < / real> < / modelvariables> < / onnxexecutor> < / onnxexecutor> < / modeldescription>
Claims
1. A method for generating a compilation-free FMU file package, characterized in that, include: Obtain the sample business dataset, data conversion dictionary, and general execution engine corresponding to the target simulation business; wherein, the general execution engine is obtained through pre-compilation and includes an XML parser, a dictionary loading module, a proxy model loading module, ONNXRuntime, and a format conversion module; The agent model is trained based on the sample business dataset to obtain the trained agent model; Based on the target simulation service and the trained proxy model, the corresponding ONNX format model file and enhanced model description file are determined; wherein, the enhanced model description file conforms to the FMI standard and includes variable-tensor mapping relationships; The general execution engine, the data transformation dictionary, the ONNX format model file, and the enhanced model description file are compressed and packaged to form an FMU file package; Based on the target simulation service and the trained proxy model, determine the corresponding ONNX format model file and enhanced model description file, including: Export the trained proxy model as an ONNX format model file; Based on the trained agent model, a corresponding basic model description file is generated according to the FMI standard; The extended tags of the base model description file are updated based on the variable-tensor mapping relationship to obtain the enhanced model description file.
2. The method according to claim 1, characterized in that, Each initial training sample in the sample business dataset includes multiple sample business data; The agent model is trained based on the sample business dataset to obtain the trained agent model, including: Based on the data conversion dictionary, the format of each sample business data of each initial training sample is converted to generate the corresponding standardized training sample; Based on the variable-tensor mapping relationship, tensor transformation is performed on each of the standardized training samples to generate the corresponding sample tensor. The proxy model is trained using all the sample tensors to obtain the trained proxy model.
3. The method according to claim 1, characterized in that, The general execution engine, the data transformation dictionary, the ONNX format model file, and the enhanced model description file are compressed and packaged into an FMU file package, including: Place the general execution engine in the binaries folder, the data conversion dictionary and the ONNX format model file in the resources folder, and the enhanced model description file in the root directory; Using a packaging tool, the binaries folder, the resources folder, and the enhanced model description file are compressed and packaged to form the FMU file package.
4. A method for executing a non-compiled FMU file package, characterized in that, Applications in simulation platforms include: The FMU file package is loaded; wherein, the FMU file package includes a general execution engine, a data transformation dictionary, an ONNX format model file, and an enhanced model description file, and the FMU file package is generated according to the method described in claim 1; the general execution engine includes an XML parser, a dictionary loading module, a proxy model loading module, an ONNX Runtime, and a format conversion module; the enhanced model description file conforms to the FMI standard and includes variable-tensor mapping relationships; The general execution engine is used to parse the enhanced model description file and establish a variable-tensor mapping table; the ONNX format model file is loaded and a proxy model instance is created; Acquire simulation business data generated by real-time simulation; Based on the simulation business data, the data transformation dictionary, and the variable-tensor mapping table, the corresponding prediction business data is obtained using the general execution engine and the proxy model instance.
5. The method according to claim 4, characterized in that, Based on the simulation business data, the data transformation dictionary, and the variable-tensor mapping table, and utilizing the general execution engine and the proxy model instance, the corresponding prediction business data is obtained, including: Based on the simulation business data, the data conversion dictionary, and the variable-tensor mapping table, the corresponding simulation tensor is obtained using the general execution engine; Based on the simulation tensor, the corresponding prediction tensor is obtained using the proxy model instance; Based on the prediction tensor, the data transformation dictionary, and the variable-tensor mapping table, the corresponding prediction business data is obtained using the general execution engine.
6. The method according to claim 5, characterized in that, The simulation tensor is obtained through the following steps: Based on the data conversion dictionary, the simulation business data is format-converted to generate corresponding simulation numerical data; Based on the variable-tensor mapping table, the simulation numerical data is transformed into tensors to generate the simulation tensors.
7. A system for generating FMU file packages without compilation, characterized in that, include: The information acquisition module is used to acquire the sample business dataset, data conversion dictionary, and general execution engine corresponding to the target simulation business; wherein, the general execution engine is obtained through pre-compilation and includes an XML parser, a dictionary loading module, a proxy model loading module, an ONNX Runtime, and a format conversion module; The model training module is used to train the agent model based on the sample business dataset to obtain the trained agent model. The file generation module is used to determine the corresponding ONNX format model file and enhanced model description file based on the target simulation service and the trained proxy model; wherein, the enhanced model description file conforms to the FMI standard and includes variable-tensor mapping relationships; The file compression module is used to compress and package the general execution engine, the data conversion dictionary, the ONNX format model file, and the enhanced model description file to form an FMU file package; Based on the target simulation service and the trained proxy model, determine the corresponding ONNX format model file and enhanced model description file, including: Export the trained proxy model as an ONNX format model file; Based on the trained agent model, a corresponding basic model description file is generated according to the FMI standard; The extended tags of the base model description file are updated based on the variable-tensor mapping relationship to obtain the enhanced model description file.
8. A system for executing FMU file packages without compilation, characterized in that, Applications in simulation platforms include: The data acquisition module is used to acquire simulation business data generated by real-time simulation. The inference module is used to load the FMU file package; wherein, the FMU file package is The method described in claim 1 generates an enhanced model description file, an ONNX format model file, a data conversion dictionary, and a general execution engine; the enhanced model description file conforms to the FMI standard and includes variable-tensor mapping relationships; the general execution engine includes an XML parser, a dictionary loading module, a proxy model loading module, an ONNX Runtime, and a format conversion module. The inference module is also used to parse the enhanced model description file using the general execution engine, establish a variable-tensor mapping table, load the ONNX format model file, and create a proxy model instance; The inference module is also used to obtain corresponding prediction business data based on the simulation business data, the data conversion dictionary, and the variable-tensor mapping table, using the general execution engine and the proxy model instance.
Citation Information
Patent Citations
Data processing method and device, computer equipment and storage medium
CN113641337A
Computer-implemented method and orchestration system for orchestrating configuration of simulation based on digital twin model of modular device
CN117813562A
Method, device and equipment for packaging ONNX model into FMU
CN119883222A
Interface document generation method and device, storage medium and program product
CN121349528A
Calibration description file generation method and device, storage medium and equipment
CN122064334A
