CN114942757B - File generation method and system and electronic equipment - Google Patents

File generation method and system and electronic equipment Download PDF

Info

Publication number
CN114942757B
CN114942757B CN202210527332.XA CN202210527332A CN114942757B CN 114942757 B CN114942757 B CN 114942757B CN 202210527332 A CN202210527332 A CN 202210527332A CN 114942757 B CN114942757 B CN 114942757B
Authority
CN
China
Prior art keywords
model
format
file
plug
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210527332.XA
Other languages
Chinese (zh)
Other versions
CN114942757A (en
Inventor
贝晓狮
李京燕
张桥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Shi Guan Jin Yang Technology Development Co ltd
Original Assignee
Beijing Shi Guan Jin Yang Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Shi Guan Jin Yang Technology Development Co ltd filed Critical Beijing Shi Guan Jin Yang Technology Development Co ltd
Priority to CN202210527332.XA priority Critical patent/CN114942757B/en
Publication of CN114942757A publication Critical patent/CN114942757A/en
Application granted granted Critical
Publication of CN114942757B publication Critical patent/CN114942757B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a file generation method, a file generation system and electronic equipment, wherein a first plug-in is determined, the first plug-in is used for converting a file into a specific general format, a first model for modeling simulation is created in a specific application program, the first model is compiled, a model file in the first format is generated, the first plug-in is called, the model file in the first format is packaged into the specific general format through the first plug-in, and the model file packaged into the specific general format is led out. After the model is generated and compiled, in order to ensure that the compiled model file can be used in other software, the format of the compiled model file is further converted, so that the compiled model file is exported in a specific general format, the exported model file can be used in other software, and the situation that the model is not supported in other software is avoided.

Description

File generation method and system and electronic equipment
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a method, a system, and an electronic device for generating a file.
Background
Simulink is a visual simulation tool in MATLAB software, is a module diagram environment and is used for multi-domain simulation and model-based design, and can provide a graphic editor, a customizable module library and a solver, and can perform dynamic system modeling and simulation.
However, after the model is completed through Simulink, if the model is to be used by other software, there is a case where the other software cannot support the format of the model.
Disclosure of Invention
In view of this, the present application provides a method, a system and an electronic device for generating a file, which specifically includes:
a file generation method, comprising:
determining a first plug-in, the first plug-in being for converting a file into a specific generic format;
creating a first model for modeling simulation in a particular application;
compiling the first model to generate a model file in a first format;
calling the first plug-in, and packaging the model file in the first format into the specific general format through the first plug-in;
exporting the model files packaged into a specific general format.
Further, the calling the first plugin, through the first plugin, encapsulates the model file in the first format into the specific general format, including:
invoking the first plug-in, and verifying the model file in the first format based on the first plug-in;
and if the verification of the model file in the first format is passed, packaging the model file in the first format into the specific general format.
Further, the calling the first plugin, and verifying the model file in the first format based on the first plugin includes:
invoking the first plug-in, determining that the first model is compiled, and obtaining a model file in a first format generated after the first model is compiled;
and verifying the model file in the first format based on a verification function in the first plug-in.
Further, the encapsulating, by the first plug-in, the model file in the first format into the specific general format includes:
obtaining a configuration file;
and encapsulating the model file in the first format into the specific universal format based on the configuration file through the first plug-in.
Further, the method further comprises the following steps:
generating a first plug-in;
storing the first plug-in to an installation location of the specific application.
A document generation system, comprising:
a determining unit configured to determine a first plug-in, the first plug-in being configured to convert a file into a specific general format;
a creation unit for creating a first model for modeling simulation in a specific application;
the compiling unit is used for compiling the first model to generate a model file in a first format;
the calling unit is used for calling the first plug-in, and packaging the model file in the first format into the specific general format through the first plug-in;
and the export unit is used for exporting the model file packaged into a specific general format.
Further, the calling unit is configured to:
invoking the first plug-in, and verifying the model file in the first format based on the first plug-in; and if the verification of the model file in the first format is passed, packaging the model file in the first format into the specific general format.
Further, the calling unit calls the first plugin, and verifies the model file in the first format based on the first plugin, including:
the calling unit calls the first plug-in, determines that the first model is compiled, and obtains a model file in a first format generated after the first model is compiled; and verifying the model file in the first format based on a verification function in the first plug-in.
An electronic device, comprising:
a processor for determining a first plug-in for converting a file into a particular generic format; creating a first model for modeling simulation in a particular application; compiling the first model to generate a model file in a first format; calling the first plug-in, and packaging the model file in the first format into the specific general format through the first plug-in; exporting the model file packaged into a specific general format;
and the memory is used for storing a program for executing the processing procedure by the processor.
A readable storage medium for storing at least one set of instructions;
the set of instructions is for being invoked and at least performing a method of file generation as claimed in any one of the preceding claims.
According to the technical scheme, the file generation method, the file generation system and the electronic equipment disclosed by the application are used for determining the first plug-in, the first plug-in is used for converting the file into a specific general format, a first model for modeling simulation is created in a specific application program, the first model is compiled, a model file in the first format is generated, the first plug-in is called, the model file in the first format is packaged into the specific general format through the first plug-in, and the model file packaged into the specific general format is led out. After the model is generated and compiled, in order to ensure that the compiled model file can be used in other software, the format of the compiled model file is further converted, so that the compiled model file is exported in a specific general format, the exported model file can be used in other software, and the situation that the model is not supported in other software is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for generating a file according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of creating a first model with a specific application program according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a method for generating a file according to an embodiment of the present disclosure;
FIG. 4 is a flowchart of a method for generating a file according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a call window of a help module according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a plurality of functions and call flows included in a first plug-in according to an embodiment of the present disclosure;
FIG. 7 is a flowchart of a method for generating a file according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of a particular window disclosed in an embodiment of the present application;
FIG. 9 is a schematic diagram of a file generation system according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The application discloses a file generation method, a flow chart of which is shown in fig. 1, comprising the following steps:
step S11, determining a first plug-in, wherein the first plug-in is used for converting a file into a specific general format;
step S12, creating a first model for modeling simulation in a specific application program;
step S13, compiling the first model to generate a model file in a first format;
s14, calling a first plug-in, and packaging the model file in the first format into a specific general format through the first plug-in;
and S15, exporting the model file packaged into the specific general format.
When modeling by Simulink, the format of the model is specific, and if the model is to be applied by other software, it is easy to happen that the other software cannot support the format of the model.
To avoid this, in this solution, after modeling of the model is completed through Simulink, the model is encapsulated into a model file in a specific general format, so that other software can open and apply the model file in the specific general format.
The specific application through which the first model is created may be specifically a visual simulation tool Simulink in Matlab, as shown in fig. 2.
The first model is a model for modeling simulation, generally has input and output, and performs complex operations such as: a flight dynamics model, an engine model, or a motor model, etc.
After the first model is created, the first model needs to be compiled to generate a model file in the first format. The model file in the first format is a format corresponding to a model file which can be generated by a specific application program.
After generating the model file in the first format, the file generating method disclosed in the embodiment also calls the first plugin, and the model file in the first format is packaged into a specific general format based on the operation of the first plugin, so that the model file in the specific general format can be used by other software after being exported.
Wherein the first plugin is a plugin for converting a file into a specific general format.
Before the first model is created by the specific application program, the first plugin is selected in the specific application program, so that the first model is created on the basis of the first plugin, and after the first model is created, the first model is compiled, and finally the exported model file is a model file in a specific general format which is packaged by the first plugin.
The specific general format may be: the Functional Mock-up Units (FMU) 2.0CoSimulation format is that the first model is exported as a FMU file in the Functional Mock-up Units (FMU) 2.0CoSimulation format through the first plug-in, so that the FMU file can be run in software supporting the FMI2.0 protocol.
Specifically, the first plug-in may be: fmi2cosim.
In this embodiment, the first plug-in is selected in the Simulink in Matlab, so that the first model created in the Simulink is exported in a model file with a specific general format when being exported finally, and the first plug-in can be operated in any software supporting the FMI2.0 protocol, thereby avoiding the situation that the model is not supported in other software.
According to the file generation method disclosed by the embodiment, a first plug-in is determined, the first plug-in is used for converting a file into a specific general format, a first model for modeling simulation is created in a specific application program, the first model is compiled, a model file in the first format is generated, the first plug-in is called, the model file in the first format is packaged into the specific general format through the first plug-in, and the model file packaged into the specific general format is exported. After the model is generated and compiled, in order to ensure that the compiled model file can be used in other software, the format of the compiled model file is further converted, so that the compiled model file is exported in a specific general format, the exported model file can be used in other software, and the situation that the model is not supported in other software is avoided.
The embodiment discloses a file generation method, a flow chart of which is shown in fig. 3, comprising the following steps:
step S31, determining a first plug-in, wherein the first plug-in is used for converting a file into a specific general format;
step S32, a first model for modeling simulation is created in a specific application program;
step S33, compiling the first model to generate a model file in a first format;
step S34, calling a first plug-in, and checking the model file in the first format based on the first plug-in;
step S35, if the model file in the first format passes the verification, the model file in the first format is packaged into a specific general format;
step S36, the model file packaged into the specific general format is exported.
When the first plug-in is called and the model file in the first format is packaged through the first plug-in, the model file in the first format can be verified, and the subsequent generation of the model file in the specific general format can be performed only after the verification is passed.
The verification of the model file in the first format may be: and checking the model file in the first format through a check code, for example: obtaining a check code, determining whether the check code is correct, and only when the check code is correct, checking the model file in the first format, if the check code is incorrect, the model file in the first format fails to pass the check, and performing subsequent encapsulation in a specific general format on the model file; or obtaining license permission of the model file in the first format, checking whether the license permission is correct, if so, passing the check of the model file in the first format, and if not, failing to pass the check of the model file in the first format, and executing subsequent encapsulation in a specific general format on the model file.
The first plug-in comprises a verification module, which can be specifically a checklicense eproc.m, wherein the verification module is used for verifying a verification code of a model file in a first format, and the verification module can be realized through a verification function.
The first plug-in is called, and the verification of the model file in the first format based on the first plug-in can be specifically: and calling the first plugin, determining that the first model is compiled, obtaining a model file in a first format generated after the first model is compiled, and verifying the model file in the first format based on a verification function in the first plugin.
Before the model file in the first format is verified based on the verification function, the first plug-in is firstly required to be called, whether the compiling of the first model is completed or not is determined, and the verification process can be executed only after the compiling of the first model is completed.
The step of calling the first plugin and determining whether the compiling of the first model is completed can be achieved through a callback module, the callback module is achieved through a callback function, and specifically, the callback function is a function used for sequentially calling all functions in the first plugin in.
The first plug-in comprises at least: the system comprises a callback module, a verification module and a generation module for generating a model file with a specific general format, wherein the callback module is realized through a callback function, the verification module is realized through a verification function, and the generation module is realized through a generation function.
The callback function may be: fmi2cosim_make_ rtw _hook.m for sequentially calling a check function and a generation function after determining that the compilation of the first model is completed, so as to complete the encapsulation of a specific general format; when the callback function calls the check function, the check function checks the model file in the first format, and when the check passes, the callback function calls the generation function so as to package the model file in the first format into a specific general format, thereby realizing the generation of the model file in the specific general format so as to facilitate the derived model file to be in the specific general format.
The callback function determines that compiling of the first model is completed, and after the compiling of the first model is completed, a model file in a first format after the compiling of the first model is completed is obtained, so that a verification function is conveniently called, and verification is conducted on the model file in the first format.
Further, when the first model is compiled, a compiling button needs to be clicked, when a compiling instruction output by the compiling button is obtained, a specific application program executes a compiling process, and after compiling is completed, a model file in a first format is sent to the first plugin, so that the first plugin obtains the model file in the first format, and therefore compiling completion of the first model is determined.
According to the file generation method disclosed by the embodiment, a first plug-in is determined, the first plug-in is used for converting a file into a specific general format, a first model for modeling simulation is created in a specific application program, the first model is compiled, a model file in the first format is generated, the first plug-in is called, the model file in the first format is packaged into the specific general format through the first plug-in, and the model file packaged into the specific general format is exported. After the model is generated and compiled, in order to ensure that the compiled model file can be used in other software, the format of the compiled model file is further converted, so that the compiled model file is exported in a specific general format, the exported model file can be used in other software, and the situation that the model is not supported in other software is avoided.
The embodiment discloses a file generation method, a flowchart of which is shown in fig. 4, including:
step S41, determining a first plug-in, wherein the first plug-in is used for converting a file into a specific general format;
step S42, a first model for modeling simulation is created in a specific application program;
step S43, compiling the first model to generate a model file in a first format;
step S44, calling a first plug-in to obtain a configuration file;
step S45, packaging a model file in a first format into a specific general format based on a configuration file through a first plug-in;
step S46, the model file packaged into the specific general format is exported.
And calling a first plugin, and packaging the model file in the first format into a specific general format through the first plugin, wherein the first plugin is called, namely a callback function in the first plugin is called firstly, and after verification is completed through calling a verification function through the callback function, a generating function is called to package the model file.
When the generating function is called to package the model file, the generating function needs to obtain the configuration file, and the model file with a specific general format can be generated on the basis of the model file with the first format only based on the configuration file.
Wherein, the generating function can be: makefmufile.m.
The configuration file may be obtained from a configuration file generation module, wherein the configuration file generation module is implemented by a configuration file generation function, which may be: makevaluereference.m, reference count for the production variable. The configuration file generating function is used for generating a configuration file, and after the configuration file is generated, the configuration file generating function is used for calling the configuration file, so that the model file in the first format is packaged into the model file in the specific general format.
After the generating function encapsulates the model file in the first format into the model file in the specific general format based on the configuration file, the model file in the specific general format is sent to the configuration file generating module, so that the configuration file generating module applies the model file in the specific general format.
Further, the first card may further include: the help module is realized by a help function, and the help function can be: openhelpdoc.m for implementing the function of opening help documents, as shown in fig. 5.
In addition, as shown in fig. 6, the plurality of functions and call flows included in the first plug-in include: callback function fmi2cosim_make_ rtw _hook.m61, check function checklicense eproc.m62, generate function makefmufile.m63, profile generate function makevaluereference.m64 and help function openhelpdoc.m65.
The callback function fmi2cosim_make_ rtw _hook.m firstly calls a check function checklicense procedure.m, after the check is completed, calls a generating function makefmufile.m, generates a configuration file generated by a configuration file generating function makevaluereference.m so as to generate a model file with a specific general format, and after the generating function makevaluereference.m generates the model file with the specific general format, sends the model file with the specific general format to the configuration file generating function makevaluereference.m; in addition, the helper function openhelpdoc.m does not participate in the flow of encapsulating model files in a particular generic format, which is called separately.
According to the file generation method disclosed by the embodiment, a first plug-in is determined, the first plug-in is used for converting a file into a specific general format, a first model for modeling simulation is created in a specific application program, the first model is compiled, a model file in the first format is generated, the first plug-in is called, the model file in the first format is packaged into the specific general format through the first plug-in, and the model file packaged into the specific general format is exported. After the model is generated and compiled, in order to ensure that the compiled model file can be used in other software, the format of the compiled model file is further converted, so that the compiled model file is exported in a specific general format, the exported model file can be used in other software, and the situation that the model is not supported in other software is avoided.
The embodiment discloses a file generation method, a flowchart of which is shown in fig. 7, including:
step S71, generating a first plug-in, and storing the first plug-in to the installation position of a specific application program;
step S72, determining a first plug-in, wherein the first plug-in is used for converting the file into a specific general format;
step S73, creating a first model for modeling simulation in a specific application program;
step S74, compiling the first model to generate a model file in a first format;
step S75, calling a first plug-in, and packaging the model file in the first format into a specific general format through the first plug-in;
step S76, the model file packaged into the specific general format is exported.
First, a first plug-in is generated, the first plug-in is stored in an installation position of a specific application program, and before a first model is created by the specific application program, the first plug-in is selected so that the first model can be packaged into a specific general format after compiling is completed.
The first plug-in can be generated through TLC language or m language supported by a specific application program simulink of Matlab. Generating a first plug-in through TLC language, wherein the plurality of TLC files may be: interface TLC, used for configuration setting of parameter setting interface, etc.; fmi2_param.tlc for parameter creation and derivation parameter functions; fmi2_type.tlc for obtaining variable type, creating variable description, etc.; fmi2.Tlc for generating an internal xml description file of the model file FMU in a specific generic format; fmi2_code.tlc, which defines certain variables.
After the plug-in is generated, it is stored to the installation location of the simulink, such as: taking matlab2016b as an example, the mounting locations of matlab2016b are: c \ProgrammFiles\MATLAB\R 2016b, the first card is installed at the following position: c \ProgrammFiles\MATLAB\R2016 b\ rtw \c.
In storing the first plugin to the installation location of the simulink, determining the first plugin, that is, selecting the first plugin, the specific window may be opened by a parameter button under the simulink of the matlab, and clicking on the selection Browse to select the first plugin fmi2cosim. The specific window is used for further configuration and viewing, such as: setting a step size, checking a description document, configuring a presence position and the like, wherein the step size is a fixed step size or a variable step size.
After the model file FMU of the specific general format is generated, the model file FMU of the specific general format is exported, and the exported FMU file is stored in the engineering directory, that is, the location of the exported file for storing the specific application program.
According to the file generation method disclosed by the embodiment, a first plug-in is determined, the first plug-in is used for converting a file into a specific general format, a first model for modeling simulation is created in a specific application program, the first model is compiled, a model file in the first format is generated, the first plug-in is called, the model file in the first format is packaged into the specific general format through the first plug-in, and the model file packaged into the specific general format is exported. After the model is generated and compiled, in order to ensure that the compiled model file can be used in other software, the format of the compiled model file is further converted, so that the compiled model file is exported in a specific general format, the exported model file can be used in other software, and the situation that the model is not supported in other software is avoided.
The embodiment discloses a file generation system, the structure of which is shown in fig. 9, comprising:
a determining unit 91, a creating unit 92, a compiling unit 93, a calling unit 94 and an exporting unit 95.
Wherein the determining unit 91 is configured to determine a first plug-in, where the first plug-in is configured to convert a file into a specific general format;
the creation unit 92 is for creating a first model for modeling simulation in a specific application;
the compiling unit 93 is configured to compile the first model to generate a model file in a first format;
the calling unit 94 is configured to call the first plugin, and encapsulate the model file in the first format into a specific general format through the first plugin;
the exporting unit 95 is used for exporting the model files packaged into a specific general format.
Further, the calling unit is configured to:
calling a first plug-in, and checking the model file in the first format based on the first plug-in; and if the verification of the model file in the first format is passed, packaging the model file in the first format into a specific general format.
Further, the calling unit calls the first plugin, and verifies the model file in the first format based on the first plugin, including:
the calling unit calls the first plug-in to determine that the compiling of the first model is completed, and a model file in a first format generated after the compiling of the first model is obtained; and verifying the model file in the first format based on the verification function in the first plug-in.
Further, the calling unit is configured to:
obtaining a configuration file; and encapsulating the model file in the first format into a specific general format based on the configuration file through the first plug-in.
Further, the file generating system disclosed in this embodiment further includes:
a storage unit configured to: generating a first plug-in; the first plug-in is stored to the installation location of the particular application.
The file generating system disclosed in the present embodiment is implemented based on the file generating method disclosed in the foregoing embodiment, and will not be described herein.
The file generating system disclosed by the embodiment determines a first plugin, the first plugin is used for converting a file into a specific general format, a first model for modeling simulation is created in a specific application program, the first model is compiled, a model file in a first format is generated, the first plugin is called, the model file in the first format is packaged into the specific general format through the first plugin, and the model file packaged into the specific general format is exported. After the model is generated and compiled, in order to ensure that the compiled model file can be used in other software, the format of the compiled model file is further converted, so that the compiled model file is exported in a specific general format, the exported model file can be used in other software, and the situation that the model is not supported in other software is avoided.
The embodiment discloses an electronic device, a schematic structural diagram of which is shown in fig. 10, including:
a processor 101 and a memory 102.
The processor 101 is configured to determine a first plug-in, the first plug-in being configured to convert the file into a particular generic format; creating a first model for modeling simulation in a particular application; compiling the first model to generate a model file in a first format; calling a first plug-in, and packaging the model file in the first format into a specific general format through the first plug-in; exporting the model files packaged into a specific general format;
the memory 102 is used to store programs for the processor to perform the above-described processing procedures.
The electronic device disclosed by the embodiment determines a first plugin, the first plugin is used for converting a file into a specific general format, a first model for modeling simulation is created in a specific application program, the first model is compiled, a model file in a first format is generated, the first plugin is called, the model file in the first format is packaged into the specific general format through the first plugin, and the model file packaged into the specific general format is led out. After the model is generated and compiled, in order to ensure that the compiled model file can be used in other software, the format of the compiled model file is further converted, so that the compiled model file is exported in a specific general format, the exported model file can be used in other software, and the situation that the model is not supported in other software is avoided.
The embodiment of the present application further provides a readable storage medium, on which a computer program is stored, where the computer program is loaded and executed by a processor, to implement each step of the file generating method, and a specific implementation process may refer to descriptions of corresponding parts of the foregoing embodiment, which is not repeated in this embodiment.
The present application also proposes a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the method provided in various optional implementations of the file generation method aspect or the file generation system aspect, and the specific implementation process may refer to the description of the corresponding embodiment and will not be repeated.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (5)

1. A document generation method, comprising:
determining a first plugin, wherein the first plugin is used for converting a file into a specific general format, and comprises a callback function fmi2cosim_make_ rtw _hook.m, a check function checklicense eproc.m, a generation function makeFmu file.m and a configuration file generation function makeValuereference.m;
creating a first model for modeling simulation in a particular application;
compiling the first model to generate a model file in a first format;
invoking the first plug-in, determining that compiling of the first model is completed, and obtaining a model file in the first format generated after compiling of the first model;
calling the check function checklicense eproc.m to check the model file in the first format based on the callback function fmi2cosim_make_ rtw _hook m in the first plug-in;
if the verification of the model file in the first format is passed, calling the generating function makefmufile.m based on the callback function fmi2cosim_make_ rtw _hook.m in the first plug-in, and packaging the model file in the first format into the specific general format based on a configuration file generated by calling the configuration file generating function makevaluereference.m by the generating function makefmufile.m;
the model files packaged into a specific general format are exported for use in applications other than the specific application using the first format.
2. The method as recited in claim 1, further comprising:
generating the first plug-in;
storing the first plug-in to an installation location of the specific application.
3. A document generation system, comprising:
the determining unit is used for determining a first plugin, wherein the first plugin is used for converting a file into a specific general format and comprises a callback function fmi2cosim_make_ rtw _hook.m, a check function checklicense eproc.m, a generating function makeFmu file.m and a configuration file generating function makeValuereference.m;
a creation unit for creating a first model for modeling simulation in a specific application;
the compiling unit is used for compiling the first model to generate a model file in a first format;
the calling unit is used for calling the first plug-in, determining that the first model is compiled, and obtaining a model file in the first format generated after the first model is compiled; calling the check function checklicense eproc.m to check the model file in the first format based on the callback function fmi2cosim_make_ rtw _hook m in the first plug-in; if the verification of the model file in the first format is passed, calling the generating function makefmufile.m based on the callback function fmi2cosim_make_ rtw _hook.m in the first plug-in, and packaging the model file in the first format into the specific general format based on a configuration file generated by calling the configuration file generating function makevaluereference.m by the generating function makefmufile.m;
and the export unit is used for exporting the model files packaged into the specific general format, wherein the model files in the specific general format are used for application programs except for the specific application program using the first format.
4. An electronic device, comprising:
a processor, configured to determine a first plugin, where the first plugin is configured to convert a file into a specific general format, and the first plugin includes a callback function fmi2cosim_make_ rtw _hook.m, a check function checklicense eproc.m, a generation function makefmufile.m, and a configuration file generation function makevaluereference.m; creating a first model for modeling simulation in a particular application; compiling the first model to generate a model file in a first format; invoking the first plug-in, determining that compiling of the first model is completed, and obtaining a model file in the first format generated after compiling of the first model; calling the check function checklicense eproc.m to check the model file in the first format based on the callback function fmi2cosim_make_ rtw _hook m in the first plug-in; if the verification of the model file in the first format is passed, calling the generating function makefmufile.m based on the callback function fmi2cosim_make_ rtw _hook.m in the first plug-in, and packaging the model file in the first format into the specific general format based on a configuration file generated by calling the configuration file generating function makevaluereference.m by the generating function makefmufile.m; exporting the model files packaged into a specific general format for use in applications other than the specific application using the first format;
and the memory is used for storing a program for executing the processing procedure by the processor.
5. A readable storage medium for storing at least one set of instructions;
the set of instructions being for being invoked and at least performing the method of file generation as claimed in claim 1 or 2.
CN202210527332.XA 2022-05-16 2022-05-16 File generation method and system and electronic equipment Active CN114942757B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210527332.XA CN114942757B (en) 2022-05-16 2022-05-16 File generation method and system and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210527332.XA CN114942757B (en) 2022-05-16 2022-05-16 File generation method and system and electronic equipment

Publications (2)

Publication Number Publication Date
CN114942757A CN114942757A (en) 2022-08-26
CN114942757B true CN114942757B (en) 2023-07-21

Family

ID=82908144

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210527332.XA Active CN114942757B (en) 2022-05-16 2022-05-16 File generation method and system and electronic equipment

Country Status (1)

Country Link
CN (1) CN114942757B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002290A (en) * 2018-10-15 2018-12-14 昆明理工鼎擎科技股份有限公司 Integrated ECU embedded target code generator and automatic generation method
CN111309292A (en) * 2020-02-03 2020-06-19 西安微电子技术研究所 MATLAB/Simulink-based full-model executable program construction method
CN111444682A (en) * 2020-05-06 2020-07-24 南京大学 Method for converting system dynamics model into XM L file
CN111737890A (en) * 2020-08-11 2020-10-02 华南理工大学 Simulation method based on ADAMS near space vehicle variable mass lift-off process

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7698668B2 (en) * 2006-10-10 2010-04-13 Honeywell International Inc. Automatic translation of simulink models into the input language of a model checker
CN106354924A (en) * 2016-08-29 2017-01-25 中冶赛迪工程技术股份有限公司 FMI-based equipment cooperation simulation system and construction method
CN108614443B (en) * 2016-12-12 2020-09-22 中国航空工业集团公司西安航空计算技术研究所 PHM system model development and verification platform design method
US11042675B2 (en) * 2018-06-01 2021-06-22 The Mathworks, Inc. Systems and methods for automatically realizing models for co-simulation
CN111552636B (en) * 2020-04-17 2022-11-15 中国航空无线电电子研究所 Method for supporting AADL integration simulation by applying FMI protocol
CN112115604B (en) * 2020-09-14 2023-07-21 苏州同元软控信息技术有限公司 Combined simulation method and system for Modelica model and Simulink model and electronic equipment
CN112612219A (en) * 2020-12-24 2021-04-06 中国航发控制系统研究所 Joint simulation method based on model development
CN112667242B (en) * 2020-12-28 2023-08-22 北京世冠金洋科技发展有限公司 Method and device for encapsulating C codes into FMU

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002290A (en) * 2018-10-15 2018-12-14 昆明理工鼎擎科技股份有限公司 Integrated ECU embedded target code generator and automatic generation method
CN111309292A (en) * 2020-02-03 2020-06-19 西安微电子技术研究所 MATLAB/Simulink-based full-model executable program construction method
CN111444682A (en) * 2020-05-06 2020-07-24 南京大学 Method for converting system dynamics model into XM L file
CN111737890A (en) * 2020-08-11 2020-10-02 华南理工大学 Simulation method based on ADAMS near space vehicle variable mass lift-off process

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Differential protection of converter transformers;Krzysztof Solak等;《2016 17th International Scientific Conference on Electric Power Engineering (EPE)》;第1-4页 *
基于FMI的Simulink模型到Modelica模型的转换技术研究;董政;《cnki优秀硕士学位论文全文库 信息科技辑》(第01期);第I138-1855页 *

Also Published As

Publication number Publication date
CN114942757A (en) 2022-08-26

Similar Documents

Publication Publication Date Title
US9183360B1 (en) Obfuscation of automatically generated code
US7954059B2 (en) Automatic conversion of text-based code having function overloading and dynamic types into a graphical program for compiled execution
US7836426B2 (en) Automatic generation of application domain specific graphical programs
US7743362B2 (en) Automatic generation of application domain specific graphical programs
US20080022259A1 (en) Automatic Conversion of a Textual Language into a Graphical Program Representation
US7734455B1 (en) Test postcondition items for automated analysis and test generation
CN113238834B (en) Simulation model file processing method and device and electronic equipment
US20120030655A1 (en) Generating and Modifying Textual Code Interfaces from Graphical Programs
US20110067000A1 (en) Static Binding of Graphical Programs
CN111985055A (en) Model packaging method and device and electronic equipment
JPWO2004104824A1 (en) User interface application development device and development method
KR101350798B1 (en) Robot system controlled on the basis of opros platform and control method thereof
CN112667242A (en) Method and device for packaging C code into FMU
CN114895935A (en) Method and device for flashing vehicle ECU, electronic equipment and storage medium
CN114942757B (en) File generation method and system and electronic equipment
US20100275187A1 (en) Implementing a class oriented data flow program on a programmable hardware element
CN111399829A (en) Waveform modeling method and terminal based on model driving
JP2010049439A (en) System construction method using software model and modeling device
CN114721666A (en) Code packaging method and device
CN109359036A (en) Test method, device, computer readable storage medium and computer equipment
CN115185599A (en) Project deployment method, system and storage medium based on Golang
CN114115850A (en) Code generation method and device
US7451436B2 (en) Aggregate handling of operator overloading
US20100275070A1 (en) Conversion of a class oriented data flow program with inheritance to a structure oriented data flow program
CN109765838B (en) Method and device for generating configuration file of programmable logic controller

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant