Universal reduced-order model workflow independent packaging method and related device

By reconstructing the reduced-order model workflow using C language and encapsulating it based on the functional model interface standard specification, the problem of the inability to decouple model encapsulation tools in existing technologies is solved. This enables cross-platform independent deployment and collaborative simulation of the reduced-order model in the digital twin system, improving the flexibility and application capabilities of modeling.

CN121722435APending Publication Date: 2026-03-24BEIHANG UNIV +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-22
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies make it difficult to achieve cross-platform, portable, independent deployment and collaborative simulation of machine learning-based reduced-order models in digital twin systems, mainly because encapsulation tools cannot completely decouple the original modeling dependency library and simulation runtime environment.

Method used

By obtaining the model calculation parameters, the workflow of the reduced-order model is reconstructed using C language, the encapsulated interface code file is built, and the encapsulation is carried out according to the functional model interface standard specification to form a functional model unit file that conforms to industry standards.

Benefits of technology

It enables plug-and-play and independent deployment of reduced-order models in cross-platform digital twin systems, improving the flexibility of complex system modeling and engineering application capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121722435A_ABST
    Figure CN121722435A_ABST
Patent Text Reader

Abstract

The invention discloses a universal reduced-order model workflow independent packaging method and a related device, and relates to the technical field of reduced-order model packaging, and the method comprises the following steps: based on model calculation parameters depended on by the reduced-order model workflow, carrying out code reconstruction on the reduced-order model workflow by using a C language to obtain a workflow script file; processing the functional model interface standard specification, the workflow script file and the instance data structure by utilizing a C language, and constructing a packaging interface code file; compiling the workflow script file and the packaging interface code file to obtain a dynamic link library; constructing a model description file according to the functional model interface standard specification; and packaging the dynamic link library and the model description file based on a directory structure defined by a functional model interface standard specification to obtain a functional model unit file. According to the method, plug-and-play, independent deployment and co-simulation of the reduced-order model workflow in the digital twin system are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of reduced-order model encapsulation technology, and in particular to a general method and related apparatus for independent encapsulation of reduced-order model workflows. Background Technology

[0002] In recent years, the concept of digital twins has gained widespread attention in the industrial and engineering fields. Constructing digital twin systems with real-time simulation capabilities has become a crucial requirement for dynamically mapping and predicting the state of physical objects in virtual space. Especially in systems involving complex multi-physics coupling, such as those in aviation and shipbuilding, the complex physical mechanisms of the actual objects and the large system structure present challenges such as high computational load and low efficiency when directly using high-fidelity models for real-time simulation. Therefore, constructing reduced-order models that can preserve key physical characteristics while significantly improving computational efficiency has become a necessary means to achieve real-time simulation of digital twins.

[0003] In complex system modeling, different components or subsystems are often implemented using different modeling methods and simulation tools. To achieve system-level simulation, models from different sources and of different types must be effectively integrated and run collaboratively. Currently, the Functional Mock-up Interface (FMI), as a tool-independent open standard, can encapsulate models built using different modeling methods into Functional Mock-up Units (FMUs), and has become the mainstream model integration technology. To ensure the effective operation of digital twin systems in actual deployment platforms, the constructed functional model units should be able to execute independently in a general simulation environment, without relying on their original modeling tools or specific simulation platforms.

[0004] Currently, some modeling and simulation software supports building reduced-order models and exporting them as functional model units conforming to functional model interface standards. However, the reduced-order modeling methods built into these software programs are usually limited in flexibility and difficult to adapt to the needs of complex systems and diverse simulation scenarios. In contrast, building reduced-order models based on general-purpose programming languages ​​and combining them with machine learning algorithms has gradually become a widely adopted technical approach due to its advantages such as flexible modeling and adaptability to complex nonlinear systems. However, such machine learning-based reduced-order models typically involve a computational workflow consisting of multiple stages, including data preprocessing, feature extraction, and model inference. In the process of encapsulating them into standard functional model units, existing encapsulation tools still struggle to completely decouple the original modeling dependency libraries or simulation runtime environment when integrating the complete computational workflow. This results in the generated functional model units being unable to run independently of the original development environment during actual deployment, limiting their widespread application in cross-platform, portable digital twin systems. Summary of the Invention

[0005] The purpose of this application is to provide a general method and related apparatus for independently encapsulating reduced-order model workflows, which can enable plug-and-play, independent deployment and collaborative simulation of reduced-order model workflows in digital twin systems.

[0006] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a general method for independently encapsulating reduced-order model workflows, including: Obtain the model calculation parameters that the reduced-order model workflow depends on; Based on the model calculation parameters, the reduced-order model workflow is refactored using C language to obtain a workflow script file; The C language is used to process the obtained functional model interface standard specifications, workflow script files, and preset instance data structures to build encapsulated interface code files; The workflow script file and the encapsulated interface code file are compiled to obtain a dynamic link library; Based on the aforementioned functional model interface standard specification, a model description file is constructed; the model description file is used to define the external interface characteristics of the reduced-order model. Based on the directory structure defined by the functional model interface standard specification, the dynamic link library and the model description file are encapsulated to obtain the functional model unit file.

[0007] Optionally, obtain the model calculation parameters that the reduced-order model workflow depends on, specifically including: The script program is used to read and parse the acquired reduced-order model workflow file to obtain the model calculation parameters on which the reduced-order model workflow depends; the reduced-order model workflow file is a model file constructed by a high-level programming language; the model calculation parameters include one or more of the following: weight matrix, bias vector, mean vector, variance vector, and principal component basis vector.

[0008] Optionally, based on the model calculation parameters, the workflow of the reduced-order model is refactored using C language to obtain a workflow script file, specifically including: The calculation parameters of the model are expressed in the form of constant arrays to obtain static constant data; The calculation logic of the static constant data and the reduced-order model workflow is refactored using C language to obtain a workflow script file; the workflow script file includes multiple calculation functions.

[0009] Optionally, the encapsulated interface code file includes an interface function set, calculation function declarations, and instance data structures; the acquired functional model interface standard specification, workflow script file, and preset instance data structures are processed using C language to construct the encapsulated interface code file, specifically including: Based on the standard functional model interface specification, an interface function set is constructed; the interface function set includes at least initialization functions, simulation step call functions, and variable read / write interface functions. Multiple calculation functions in the workflow script file are declared to obtain the calculation function declarations; Based on the interface function set, the calculation function declaration, and the instance data structure, an encapsulated interface code file is constructed; the instance data structure includes defined input variables that receive external input, output variables that store calculation results, and parameter variables that store the internal state of the model.

[0010] Optionally, the workflow script file and the encapsulated interface code file are compiled to obtain a dynamic link library, specifically including: The workflow script file and the encapsulated interface code file are compiled and linked using C / C++ compilation tools to obtain a dynamic link library that can be directly loaded and executed on the target operating system.

[0011] Optionally, the model description file is an XML format file, which includes the version information, encoding method, variable list and attributes of the functional model unit file; the variable list corresponds to the input variables, output variables and parameter variables in the instance data structure.

[0012] Optionally, based on the directory structure defined by the functional model interface standard specification, the dynamic link library and the model description file are encapsulated to obtain a functional model unit file, specifically including: Based on the directory structure defined by the functional model interface standard specification, construct the root directory and subdirectories under the root directory; The model description file is placed in the root directory, and the dynamic link library is placed in the subdirectory to obtain the functional model unit file.

[0013] In a second aspect, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the general reduced-order model workflow independent encapsulation method described in any one of the above.

[0014] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the general reduced-order model workflow independent encapsulation method described in any one of the above.

[0015] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the general reduced-order model workflow independent encapsulation method described in any one of the above.

[0016] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a general method and related apparatus for independently encapsulating the workflow of a reduced-order model. By refactoring the code of the reduced-order model workflow using C language based on the model calculation parameters, the coupling problem between the original modeling dependency library and the simulation environment is solved. The calculation process that depends on a specific modeling language and runtime library is transformed into C language code that is pure calculation logic and does not depend on external libraries, thereby ensuring the cross-platform portability of the reduced-order model and laying the foundation for subsequent independent encapsulation.

[0017] By using the C language to process the functional model interface standard specification, workflow script file, and preset instance data structure, and constructing encapsulated interface code files, the problems of inconsistent interface encapsulation and lack of functional model standardization are solved, realizing the standardization and repeatability of functional models. Moreover, by compiling the workflow script file and encapsulated interface code file to obtain a dynamic link library, the problem of poor multi-platform compatibility is solved, and the dynamic loading and execution of functional models in different systems is realized.

[0018] By constructing model description files according to the functional model interface standard specification and encapsulating dynamic link libraries and model description files based on the directory structure defined by the functional model interface standard specification, functional model unit files that conform to industry standards and structural specifications are formed. This ensures that the encapsulated results can be correctly identified, loaded and integrated by various simulation platforms that support functional model interfaces. It realizes plug-and-play, independent deployment and collaborative simulation of the reduced-order model workflow in cross-platform and portable digital twin systems, which significantly improves the flexibility of complex system modeling and engineering application capabilities. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 An application environment diagram for a general reduced-order model workflow independent encapsulation method provided in Embodiment 1 of this application; Figure 2 A flowchart illustrating a general method for independently encapsulating a reduced-order model workflow, as provided in Embodiment 1 of this application; Figure 3 A schematic diagram of the framework for a general method for independently encapsulating a reduced-order model workflow, provided in Embodiment 1 of this application; Figure 4 This is a schematic diagram of the framework for the independent encapsulation method of the reduced-order model of the finite element simulation model of complex structural components provided in Embodiment 2 of this application; Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of this application. Detailed Implementation

[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0023] Example 1 The general reduced-order model workflow independent encapsulation method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be set up independently, integrated into server 104, or placed in the cloud or on another server. Terminal 102 can send model calculation parameters to server 104. Based on the model calculation parameters, server 104 uses C language to refactor the reduced-order model workflow to obtain a workflow script file; it uses C language to process the functional model interface standard specification, workflow script file, and instance data structure to construct an encapsulated interface code file; it compiles the workflow script file and encapsulated interface code file to obtain a dynamic link library; it constructs a model description file according to the functional model interface standard specification; and it encapsulates the dynamic link library and model description file based on the directory structure defined by the functional model interface standard specification to obtain a functional model unit file. Server 104 can then send the obtained functional model unit file back to terminal 102.

[0024] The terminal 102 can be, but is not limited to, various desktop computers, laptops, and IoT devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers, or it can be a cloud server.

[0025] In one exemplary embodiment, such as Figures 2-3 As shown, a general method for independently encapsulating a reduced-order model workflow is provided. This method is executed by a computer device, specifically a terminal or server, or both. In this embodiment, the method is applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 201 to 206. Wherein: Step 201: Obtain the model calculation parameters that the reduced-order model workflow depends on; the model calculation parameters include machine learning model parameters and data processing model parameters.

[0026] Step 202: Based on the model calculation parameters, the workflow of the reduced-order model is refactored using C language to obtain a workflow script file; the workflow script file is a refactored code file that includes complete calculation logic.

[0027] Step 203: Use C language to process the obtained functional model interface standard specifications, workflow script files and preset instance data structures to build encapsulated interface code files.

[0028] Step 204: Compile the workflow script file and the encapsulated interface code file to obtain a dynamic link library.

[0029] Step 205: Construct a model description file according to the functional model interface standard specification; the model description file is used to define the external interface characteristics of the reduced-order model.

[0030] Step 206: Based on the directory structure defined by the functional model interface standard specification, encapsulate the dynamic link library and model description file to obtain the functional model unit file.

[0031] By implementing steps 201 to 206 above, the workflow of the reduced-order model is refactored using C language based on the model calculation parameters. This solves the coupling problem between the original modeling dependency library and the simulation environment, and realizes the transformation of the calculation process that depends on a specific modeling language and runtime library into C language code that does not depend on external libraries and is pure calculation logic. This ensures the cross-platform portability of the reduced-order model and lays the foundation for subsequent independent encapsulation.

[0032] By using the C language to process the functional model interface standard specification, workflow script file, and preset instance data structure, and constructing encapsulated interface code files, the problems of inconsistent interface encapsulation and lack of functional model standardization are solved, realizing the standardization and repeatability of functional models. Moreover, by compiling the workflow script file and encapsulated interface code file to obtain a dynamic link library, the problem of poor multi-platform compatibility is solved, and the dynamic loading and execution of functional models in different systems is realized.

[0033] By constructing model description files according to the functional model interface standard specification and encapsulating dynamic link libraries and model description files based on the directory structure defined by the functional model interface standard specification, functional model unit files that conform to industry standards and structural specifications are formed. This ensures that the encapsulated results can be correctly identified, loaded and integrated by various simulation platforms that support functional model interfaces. It realizes plug-and-play, independent deployment and collaborative simulation of the reduced-order model workflow in cross-platform and portable digital twin systems, which significantly improves the flexibility of complex system modeling and engineering application capabilities.

[0034] Furthermore, step 201 involves obtaining the model calculation parameters upon which the reduced-order model workflow depends, specifically including: A script is used to read and parse the acquired reduced-order model workflow file to obtain the model calculation parameters that the reduced-order model workflow depends on. The reduced-order model workflow file is a model file constructed using a high-level programming language. The model calculation parameters include one or more of the following: weight matrix, bias vector, mean vector, variance vector, and principal component basis vectors. Specifically, for the data processing steps commonly used in the reduced-order model calculation workflow, such as data standardization, feature extraction, and model prediction, a Python script loads and reads the model files that each step depends on, such as .pkl format object storage files and .pth format neural network model files, to obtain the model calculation parameters. Then, the calculation workflow is reconstructed using C language as the workflow script file required for subsequent encapsulation.

[0035] Furthermore, in step 202, based on the model calculation parameters, the reduced-order model workflow is refactored using C language to obtain a workflow script file, specifically including: Step 2021: Express the model calculation parameters in the form of a constant array to obtain static constant data.

[0036] Step 2022: Use C language to refactor the calculation logic of the static constant data and the reduced-order model workflow to obtain a workflow script file. The workflow script file includes multiple calculation functions, specifically a main calculation function and multiple sub-functions. The main calculation function calls multiple sub-functions in sequence to complete different calculation steps. The calculation of each sub-function depends on the static constant data.

[0037] Furthermore, the encapsulated interface code file includes an interface function set, computation function declarations, and instance data structures; in step 203, the obtained functional model interface standard specification, workflow script file, and preset instance data structures are processed using C language to construct the encapsulated interface code file, specifically including: Step 2031: Based on the standard functional model interface specification, construct an interface function set. The interface function set should include at least initialization functions (such as the instantiation function `fmi2Instantiate`), simulation step call functions (`fmi2DoStep`), and variable read / write interface functions (such as the function to set real variables `fmi2SetReal` and the function to retrieve real variables `fmi2GetReal`). Specifically, the simulation step call function, during its execution, assigns input data to input variables in the instance data structure, calls the main calculation function in the workflow script file to perform calculations, and stores the calculation results in output variables in the instance data structure.

[0038] Step 2032: Declare multiple calculation functions in the workflow script file to obtain the calculation function declarations.

[0039] Step 2033: Based on the interface function set, calculation function declaration, and instance data structure, construct the encapsulated interface code file; the instance data structure includes defined input variables that receive external input, output variables that store calculation results, and parameter variables that store the internal state of the model.

[0040] Further, step 204 involves compiling the workflow script file and the encapsulated interface code file to obtain a dynamic link library, specifically including: The workflow script files and encapsulated interface code files are compiled and linked using the built-in C / C++ compiler tools of Microsoft Visual Studio to obtain a dynamic link library that can be directly loaded and executed on the target operating system.

[0041] Furthermore, in step 205, the model description file is an XML format file, which includes version information, encoding method, variable list and attributes of the functional model unit file; the variable list corresponds to the input variables, output variables and parameter variables in the instance data structure.

[0042] Furthermore, in step 206, based on the directory structure defined by the functional model interface standard specification, the dynamic link library and model description file are encapsulated to obtain the functional model unit file, specifically including: Step 2061: Based on the directory structure defined by the functional model interface standard specification, construct the root directory and its subdirectories.

[0043] Step 2062: Place the model description file in the root directory and the dynamic link library in the subdirectory to obtain the functional model unit file.

[0044] Example 2 In another exemplary embodiment of this application, such as Figure 4As shown, the method of independently encapsulating a general workflow for reducing the order of a finite element simulation model of a complex structural component is illustrated using a reduced-order model as an example: Step 1: Obtain the model calculation parameters upon which the reduced-order model workflow depends. Based on these parameters, refactor the reduced-order model workflow using C language to obtain the workflow script file. Specifically, the reduced-order model of the complex structural component finite element simulation model focuses on the structural stress field. The reduced-order model uses the inlet and outlet pressures of the structural component and valve opening as input variables to predict the stress field. The stress field prediction calculation workflow includes input data preprocessing, low-dimensional stress field feature prediction, and full-order stress field reconstruction, involving input data standardization models, neural network models, network output standardization models, stress field PCA dimensionality reduction models, and stress field standardization models. The above model files are built using Python. The neural network model file is saved as a .pth format file, and the other model files are saved as .pkl format files.

[0045] The Python script reads the model calculation parameters relied upon by the above-mentioned reduced-order model workflow and writes the parameters into the C language script as static, constant double-precision floating-point variables. The calculation parameters of the standardized model include the mean vector and variance vector; the calculation parameters of the principal component analysis (PCA) dimensionality reduction model include the principal component basis vectors and the stress field mean vector; and the calculation parameters of the neural network model include the weight matrices and bias vectors of each layer of the network.

[0046] The computational workflow was restructured using C language scripts: First, a data standardization function was written in C to standardize the input variables based on the computational parameters of the standardization model. Next, a neural network feedforward function was written to input the calculation results of the standardization function into the neural network model. Then, an inverse standardization function was written to inversely standardize the neural network's calculation results based on the computational parameters of the standardization model output by the network. Next, an inverse PCA function was written and performed based on the computational parameters of the stress field PCA model to obtain stress field data restored to high dimensions. Finally, inverse standardization was performed based on the computational parameters of the stress field standardization model to restore the stress field data to its true numerical magnitude. This entire computational workflow was then compiled and called within the `pipeline_predict()` function.

[0047] Step 2: Construct the encapsulation interface code file. Compile the workflow script file and the encapsulation interface code file to obtain a dynamic link library. Specifically: First, declare the `pipeline_predict()` function in the encapsulation interface code file and import the declarations of standard functions / classes of the FMI protocol through the header file `fmi2Functions.h`. Then, construct the FMU instance data structure "Instance", containing four member variables: input variables x1, x2, and x3 (component inlet pressure, outlet pressure, and valve opening, respectively) and output variable y (maximum structural stress). Finally, write the code implementation for the functions shown in Table 1: In the `fmi2Instantiate` function, initialize the structure and assign values ​​to the member variables of `Instance` with the initial values ​​of the simulation object. In the `fmi2DoStep` function, assign the FMU input data in each time step to the corresponding input member variable of `Instance`, call the `pipeline_predict()` function to calculate the result, and assign it to the corresponding output member variable of `Instance`. In the `fmi2GetReal` function, return the specified member variable of `Instance`. In the `fmi2SetReal` function, assign values ​​to the specified member variables of `Instance`. In the `fmi2Reset` function, initialize the member variables of `Instance` (same as initialization). Apart from the functions implemented above, the remaining functions in the table below have no substantial computational logic and are implemented as placeholders.

[0048] Table 1 Calculation Function Table

[0049] The workflow script files and encapsulated interface code files are compiled and linked using the built-in C / C++ compiler in Microsoft Visual Studio to obtain a dynamic link library.

[0050] Step 3: Construct the model description file. Based on the directory structure defined by the Functional Model Interface (FMI) standard specification, encapsulate the dynamic link library and the model description file to obtain the functional model unit file. Specifically: write the model description file according to the format specified in the FMI protocol. This model description file must include necessary elements such as version information, encoding method, model description, and variable definitions. Place the model description file in the root folder of the working directory (i.e., the root directory in the directory structure), and place the dynamic link library generated in Step 2 in the folder "working directory / binaries / win64" (i.e., a subdirectory under the root directory). Encapsulate the above working directory into a .fmu format compressed package to achieve FMU encapsulation.

[0051] Example 3 This application also provides an application scenario that utilizes the aforementioned general method for independent encapsulation of reduced-order model workflows. Specifically, the independent encapsulation method provided in this embodiment can be applied to a general scenario for independent encapsulation of reduced-order model workflows. The independent encapsulation scenario includes a model calculation parameter stage and an independent encapsulation stage; the model calculation parameter stage is used to obtain the model calculation parameters upon which the reduced-order model workflow depends, and the independent encapsulation stage is used to construct functional model unit files based on the model calculation parameters. The independent encapsulation method provided in this embodiment belongs to both the model calculation parameter stage and the independent encapsulation stage.

[0052] Example 4 In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 5 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores and processes data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a general-purpose, reduced-order model workflow independent encapsulation method.

[0053] Those skilled in the art will understand that Figure 5 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0054] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0055] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0056] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0057] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0058] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0059] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0060] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A general method for independently encapsulating the workflow of a reduced-order model, characterized in that, include: Obtain the model calculation parameters that the reduced-order model workflow depends on; Based on the model calculation parameters, the reduced-order model workflow is refactored using C language to obtain a workflow script file; The C language is used to process the obtained functional model interface standard specifications, workflow script files, and preset instance data structures to build encapsulated interface code files; The workflow script file and the encapsulated interface code file are compiled to obtain a dynamic link library; Based on the aforementioned functional model interface standard specification, a model description file is constructed; the model description file is used to define the external interface characteristics of the reduced-order model. Based on the directory structure defined by the functional model interface standard specification, the dynamic link library and the model description file are encapsulated to obtain the functional model unit file.

2. The general method for independent encapsulation of reduced-order model workflows according to claim 1, characterized in that, Obtain the model calculation parameters that the reduced-order model workflow depends on, specifically including: The script program is used to read and parse the acquired reduced-order model workflow file to obtain the model calculation parameters on which the reduced-order model workflow depends; the reduced-order model workflow file is a model file constructed by a high-level programming language; the model calculation parameters include one or more of the following: weight matrix, bias vector, mean vector, variance vector, and principal component basis vector.

3. The general method for independently encapsulating reduced-order model workflows according to claim 1, characterized in that, Based on the calculated parameters of the model, the workflow of the reduced-order model is refactored using C language to obtain a workflow script file, which specifically includes: The calculation parameters of the model are expressed in the form of constant arrays to obtain static constant data; The calculation logic of the static constant data and the reduced-order model workflow is refactored using C language to obtain a workflow script file; the workflow script file includes multiple calculation functions.

4. The general method for independent encapsulation of reduced-order model workflows according to claim 3, characterized in that, The encapsulated interface code file includes an interface function set, calculation function declarations, and instance data structures. The acquired functional model interface standard specifications, workflow script files, and preset instance data structures are processed using C language to construct the encapsulated interface code file, specifically including: Based on the standard functional model interface specification, an interface function set is constructed; the interface function set includes at least initialization functions, simulation step call functions, and variable read / write interface functions. Multiple calculation functions in the workflow script file are declared to obtain the calculation function declarations; Based on the interface function set, the calculation function declaration, and the instance data structure, an encapsulated interface code file is constructed; the instance data structure includes defined input variables that receive external input, output variables that store calculation results, and parameter variables that store the internal state of the model.

5. The general method for independently encapsulating reduced-order model workflows according to claim 1, characterized in that, The workflow script file and the encapsulated interface code file are compiled to obtain a dynamic link library, specifically including: The workflow script file and the encapsulated interface code file are compiled and linked using C / C++ compilation tools to obtain a dynamic link library that can be directly loaded and executed on the target operating system.

6. The general method for independently encapsulating reduced-order model workflows according to claim 1, characterized in that, The model description file is an XML format file, which includes the version information, encoding method, variable list and attributes of the functional model unit file; the variable list corresponds to the input variables, output variables and parameter variables in the instance data structure.

7. The general method for independently encapsulating reduced-order model workflows according to claim 1, characterized in that, Based on the directory structure defined in the functional model interface standard specification, the dynamic link library and the model description file are encapsulated to obtain a functional model unit file, specifically including: Based on the directory structure defined by the functional model interface standard specification, construct the root directory and subdirectories under the root directory; The model description file is placed in the root directory, and the dynamic link library is placed in the subdirectory to obtain the functional model unit file.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the general reduced-order model workflow independent encapsulation method according to any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the general reduced-order model workflow independent encapsulation method as described in any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the general reduced-order model workflow independent encapsulation method as described in any one of claims 1-7.