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

File generation method and system and electronic equipment Download PDF

Info

Publication number
CN114942757A
CN114942757A CN202210527332.XA CN202210527332A CN114942757A CN 114942757 A CN114942757 A CN 114942757A CN 202210527332 A CN202210527332 A CN 202210527332A CN 114942757 A CN114942757 A CN 114942757A
Authority
CN
China
Prior art keywords
format
plug
model
file
model file
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.)
Granted
Application number
CN202210527332.XA
Other languages
Chinese (zh)
Other versions
CN114942757B (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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Geometry (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a file generation method, a file generation system and electronic equipment, wherein a first plug-in is determined and 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 to generate a model file in the first format, 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. According to the scheme, 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 can be exported in a specific general format, the exported model file can be used in other software, and the phenomenon that the model is not supported in other software is avoided.

Description

File generation method and system and electronic equipment
Technical Field
The present application relates to the field of data processing, and in particular, to a file generation method, system and electronic device.
Background
Simulink is a visual simulation tool in MATLAB software, is a modular diagram environment, is used for multi-domain simulation and model-based design, can provide a graphic editor, a customizable module library and a solver, and can perform dynamic system modeling and simulation.
However, after a model is made by Simulink, if the model is to be used by other software, there is a case where the format of the model cannot be supported by other software.
Disclosure of Invention
In view of this, the present application provides a file generation method, a system and an electronic device, and the specific scheme is as follows:
a file generation method, comprising:
determining a first plug-in, wherein the first plug-in is used for converting a file into a specific universal format;
creating a first model for modeling a 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 universal format through the first plug-in;
exporting the model file packaged into a specific general format.
Further, the invoking the first plug-in, and encapsulating the model file in the first format into the specific common format through the first plug-in, includes:
calling the first plug-in, and checking the model file in the first format based on the first plug-in;
and if the model file in the first format passes the verification, packaging the model file in the first format into the specific universal format.
Further, the invoking the first plug-in and checking the model file in the first format based on the first plug-in include:
calling 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 checking the model file in the first format based on a checking function in the first plug-in.
Further, the encapsulating, by the first plug-in, the model file in the first format into the specific common format includes:
obtaining a configuration file;
encapsulating, by the first plug-in, the model file in the first format into the particular common format based on the configuration file.
Further, the method also comprises the following steps:
generating a first plug-in;
storing the first plug-in to an installation location of the particular application.
A file generation system, comprising:
the file conversion device comprises a determining unit, a converting unit and a converting unit, wherein the determining unit is used for determining a first plug-in, and the first plug-in is used for converting a file into a specific general format;
a creating 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 exporting unit is used for exporting the model file encapsulated into the specific general format.
Further, the invoking unit is configured to:
calling the first plug-in, and checking the model file in the first format based on the first plug-in; and if the model file in the first format passes the verification, packaging the model file in the first format into the specific universal format.
Further, the invoking unit invokes the first plug-in, and verifies the model file in the first format based on the first plug-in, including:
the calling unit calls the first plug-in to determine that the first model is compiled, and a model file in a first format generated after the first model is compiled is obtained; and checking the model file in the first format based on the checking function in the first plug-in.
An electronic device, comprising:
a processor configured to determine a first plug-in for converting a file to a specific common format; creating a first model for modeling a 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 universal format through the first plug-in; exporting the model file packaged into a specific universal format;
and the memory is used for storing the program of the processor for executing the processing procedure.
A readable storage medium storing at least one set of instructions;
the set of instructions is for being called and performing at least the method of file generation as described in any of the above.
According to the technical scheme, the file generation method, the file generation system and the electronic device determine the first plug-in, the first plug-in is used for converting files into a specific general format, a first model for modeling simulation is created in a specific application program, the first model is compiled to generate a model file in the first format, 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. According to the scheme, 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 can be exported in a specific general format, the exported model file can be used in other software, and the phenomenon 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 used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of a file generation method disclosed in an embodiment of the present application;
FIG. 2 is a schematic diagram of a method for creating a first model through an application-specific program according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a file generation method disclosed in an embodiment of the present application;
FIG. 4 is a flowchart of a file generation method disclosed in an embodiment of the present application;
FIG. 5 is a diagram illustrating a call window of a help module according to an embodiment of the present disclosure;
FIG. 6 is a diagram illustrating 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 file generation method disclosed in an embodiment of the present application;
FIG. 8 is a schematic illustration of a specific window disclosed in an embodiment of the present application;
FIG. 9 is a schematic structural diagram of a document generating system according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The application discloses a file generation method, a flow chart of which is shown in fig. 1, comprising:
step S11, determining a first plug-in, wherein the first plug-in is used for converting the 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;
step 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 step S15, exporting the model files packaged into the specific universal format.
When modeling is performed by Simulink, the format of the model is specific, and if the model is to be applied by other software, the format of the model cannot be supported by other software.
In order to avoid the situation, after the modeling of the model is completed through Simulink, the model is packaged into the model file in the specific general format, so that other software can open and apply the model file in the specific general format.
The specific application, by which the first model is created, may be embodied as the visualization simulation tool Simulink in Matlab, as shown in fig. 2.
Where the first model is a model used for modeling simulation, usually with inputs and outputs, the model itself 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 also needs to be compiled so as to generate a model file in a first format. The model file in the first format, that is, the format corresponding to the model file that can be generated by the specific application program itself.
The file generation method disclosed in this embodiment also calls the first plug-in after generating the model file in the first format, and based on the operation of the first plug-in, the model file in the first format is packaged into a specific general format, so that the model file in the specific general format can be used by other software after being exported.
The first plug-in is a plug-in used for converting the file into a specific universal format.
Before creating the first model through the specific application program, first selecting a first plug-in the specific application program, so that the first model is created on the basis of the first plug-in, and compiling the first model after creating the first model, wherein the finally exported model file is a model file in a specific universal format packaged by the first plug-in.
The specific common format may be: the Functional Mock-up Units (FMU)2.0 Cooperation format is a FMU file which is exported to the Functional Mock-up Units (FMU)2.0 Cooperation format through a first plug-in, so that the FMU file can run in software supporting FMI2.0 protocol.
Specifically, the first plug-in may be: fmi2cosim.
In this embodiment, the first plug-in is selected from the Simulink in Matlab, so that the first model created in the Simulink is exported in a model file of a specific general format when finally exported, and can run in any software supporting the FMI2.0 protocol, thereby avoiding the occurrence of a situation that the model is not supported in other software.
The file generation method disclosed by the embodiment comprises the steps of determining a first plug-in, wherein the first plug-in is used for converting a file into a specific general format, creating a first model for modeling simulation in a specific application program, compiling the first model to generate a model file in the first format, calling the first plug-in, packaging the model file in the first format into the specific general format through the first plug-in, and exporting the model file packaged into the specific general format. According to the scheme, 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 can be exported in a specific general format, the exported model file can be used in other software, and the phenomenon 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. 3, and the method comprises the following steps:
step S31, determining a first plug-in, wherein the first plug-in is used for converting the file into a specific general format;
step S32, creating a first model for modeling simulation 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 verifying 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;
and step S36, exporting the model file packaged into the specific universal format.
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 only after the verification is passed, the subsequent generation of the model file in the specific general format can be performed.
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, such as: obtaining a check code, determining whether the check code is correct, wherein the model file in the first format can pass the check only when the check code is correct, and if the check code is wrong, the model file in the first format cannot pass the check, so that the subsequent packaging of the specific universal format is not performed on the model file; or, acquiring license permission of the model file in the first format, checking whether the license permission is correct, if so, checking that the model file in the first format passes, and if not, checking that the model file in the first format fails, and not performing subsequent packaging in a specific universal format on the model file.
The first plug-in component comprises a verification module, which can be named as checklicense eProc.m specifically, the verification module is used for verifying the verification code of the model file in the first format, and the verification module can be realized through a verification function.
The method includes the steps of calling a first plug-in, verifying a model file in a first format based on the first plug-in, and specifically includes: calling the first plug-in, determining that the first model is compiled, obtaining a model file in the 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.
Before the model file in the first format is verified based on the verification function, the first plug-in is called first, 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 plug-in and determining whether the compiling of the first model is completed or not can be realized through a callback module, the callback module is realized through a callback function, and specifically, the callback function is a function used for sequentially calling each function in the first plug-in.
In the first insert at least: the device 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 by a callback function, the verification module is realized by a verification function, and the generation module is realized by a generation function.
The callback function may be: fmi2cosim _ make _ rtw _ hook.m for sequentially calling the check function and the generate function after it is determined that the compilation of the first model is completed, so as to complete the encapsulation of the specific common format; when the callback function calls the check function, the check function checks the model file in the first format, and when the check is passed, the callback function calls the generating 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, and facilitating the exported model file to be in the specific general format.
The callback function determines that the compiling of the first model is completed, and after the compiling of the first model is completed, the compiled model file in the first format is obtained, so that the check function can be called conveniently, and the model file in the first format can be checked.
Furthermore, when the first model is compiled, the compiling button needs to be clicked, when a compiling instruction output by the compiling button is obtained, the specific application program executes a compiling flow, and after the compiling is finished, the model file in the first format is sent to the first plug-in unit, so that the first plug-in unit obtains the model file in the first format, and the compiling of the first model is determined to be finished.
The file generation method disclosed by the embodiment comprises the steps of determining a first plug-in, wherein the first plug-in is used for converting a file into a specific general format, creating a first model for modeling simulation in a specific application program, compiling the first model to generate a model file in the first format, calling the first plug-in, packaging the model file in the first format into the specific general format through the first plug-in, and exporting the model file packaged into the specific general format. According to the scheme, 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 can be exported in a specific general format, the exported model file can be used in other software, and the phenomenon 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, and the method comprises the following steps:
step S41, determining a first plug-in, wherein the first plug-in is used for converting the file into a specific general format;
step S42, creating a first model for modeling simulation 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 the model file in the first format into a specific universal format through the first plug-in based on the configuration file;
and step S46, exporting the model file packaged into the specific universal 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, wherein the calling of the first plug-in is to firstly call a callback function in the first plug-in, and after the callback function calls a verification function to complete verification, 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 the 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 may be: makefmufile.
The configuration file may be obtained from a configuration file generation module, where the configuration file generation module is implemented by a configuration file generation function, and the configuration file generation function may be: makevalue reference.m, count reference to make variables. The configuration file generation function is used for generating a configuration file, and after the configuration file is generated, the configuration file is called by the generation function, so that the model file in the first format is packaged into the model file in the specific general format.
After the generating function packages 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 can apply the model file in the specific general format.
Further, the first plug-in unit can further comprise: the help module is realized by a help function, and the help function can be: openhellpoc.m for implementing the open help document function, as shown in fig. 5.
In addition, as shown in fig. 6, the functions and call flows included in the first plug-in include: the callback function fmi2 cosine _ make _ rtw _ hook.m61, the check function checkLicenseProc.m62, the generate function MakeFmuFile.m63, the configuration file generate function MakeValueReference.m64, and the help function OpenHelpDoc.m 65.
The callback function fmi2 cosine _ make _ rtw _ hook.m firstly calls a check function checkLicenseProc.m, after the check is completed, a generating function makeFmuFile.m is called, the generating function makeFmuFile.m calls a configuration file to generate a configuration file generated by a 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, the model file with the specific general format is sent to the configuration file generating function makeValueReference.m again; in addition, the help function openhellppoc.m does not participate in the flow of encapsulating a model file of a specific general format, which is called separately.
The file generation method disclosed by the embodiment comprises the steps of determining a first plug-in, wherein the first plug-in is used for converting a file into a specific general format, creating a first model for modeling simulation in a specific application program, compiling the first model to generate a model file in the first format, calling the first plug-in, packaging the model file in the first format into the specific general format through the first plug-in, and exporting the model file packaged into the specific general format. According to the scheme, 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 can be exported in a specific general format, the exported model file can be used in other software, and the phenomenon 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, and the method comprises the following steps:
step S71, generating a first plug-in, and storing the first plug-in to the installation position of the 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;
and step S76, exporting the model file packaged into the specific universal format.
The method comprises the steps of firstly generating a first plug-in, storing the first plug-in at the installation position of a specific application program, and firstly selecting the first plug-in before creating a first model through the specific application program so that the first model can be packaged into a specific general format after being compiled.
Wherein, the first plug-in can be generated by TLC language or m language supported by specific application simulink of Matlab. The first plug-in is generated by a TLC language, which includes a plurality of TLC files that may be: interface TLC for configuration setting of parameter setting interface; fmi2_ param.tlc for parameter creation and derivation parameter functions; fmi2_ type.tlc for obtaining variable types, creating variable descriptions, etc.; fmi2.tlc for generating an internal xml description file of the model file FMU of a specific general format; tlc of fmi2_ code for defining certain variables.
After the plug-in is generated, it is stored to the mounting location of the simulink, such as: taking matlab2016b as an example, the installation position of matlab2016b is as follows: c, if \ ProgrammFiles \ MATLAB \ R2016b, the installation position of the first plug-in component is as follows: c \ ProgramFiles \ MATLAB \ R2016b \ rtw \ C.
When the first plug-in is stored in the mounting position of the simulink, the first plug-in is determined, namely, the first plug-in is selected, a specific window is opened by a parameter button under the simulink of matlab, and the selection Browse is clicked to select the first plug-in fmi2 common. The special window is used for further configuration and viewing, such as: setting step length, wherein the step length is fixed step length or variable step length, checking an explanation document, configuring a location of the presence and the like.
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 an engineering directory, which is a location where the export file of the specific application is stored.
The file generation method disclosed by the embodiment comprises the steps of determining a first plug-in, wherein the first plug-in is used for converting a file into a specific general format, creating a first model for modeling simulation in a specific application program, compiling the first model to generate a model file in the first format, calling the first plug-in, packaging the model file in the first format into the specific general format through the first plug-in, and exporting the model file packaged into the specific general format. According to the scheme, 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 can be exported in a specific general format, the exported model file can be used in other software, and the phenomenon that the model is not supported in other software is avoided.
The embodiment discloses a file generation system, a schematic structural diagram of which is shown in fig. 9, and the file generation system includes:
a determining unit 91, a creating unit 92, a compiling unit 93, a calling unit 94 and a deriving unit 95.
The determining unit 91 is configured to determine a first plug-in, where the first plug-in is used to convert a file into a specific general format;
the creating unit 92 is used 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 a first plug-in, and package the model file in the first format into a specific general format through the first plug-in;
the export unit 95 is used to export the model file encapsulated into a specific generic format.
Further, the calling unit is configured to:
calling a first plug-in, and verifying the model file in the first format based on the first plug-in; and if the model file in the first format passes the verification, packaging the model file in the first format into a specific universal format.
Further, the calling unit calls a first plug-in, and verifies the model file in the first format based on the first plug-in, including:
the calling unit calls the first plug-in to determine that the first model is compiled, and a model file in a first format generated after the first model is compiled is obtained; and checking the model file in the first format based on the checking function in the first plug-in.
Further, the calling unit is configured to:
obtaining a configuration file; the model file in the first format is encapsulated into a specific common format by the first plug-in based on the configuration file.
Further, the file generating system disclosed in this embodiment further includes:
a storage unit to: generating a first plug-in; the first plug-in is stored to the installation location of the particular application.
The file generation system disclosed in this embodiment is implemented based on the file generation method disclosed in the above embodiment, and details are not described here.
The file generation system disclosed in this embodiment determines a first plug-in, where the first plug-in is used to convert a file into a specific general format, create a first model for modeling simulation in a specific application program, compile the first model to generate a model file in the first format, call the first plug-in, package the model file in the first format into the specific general format through the first plug-in, and export the model file packaged into the specific general format. According to the scheme, 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 can be exported in a specific general format, the exported model file can be used in other software, and the phenomenon 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, and the electronic device includes:
a processor 101 and a memory 102.
The processor 101 is configured to determine a first plug-in, where the first plug-in is configured to convert a file into a specific common format; creating a first model for modeling a 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 file packaged into a specific universal format;
the memory 102 is used for storing a program for the processor to execute the above-described processing procedure.
The electronic device disclosed in this embodiment determines a first plug-in, where the first plug-in is used to convert a file into a specific general format, create a first model for modeling simulation in a specific application program, compile the first model to generate a model file in the first format, call the first plug-in, package the model file in the first format into the specific general format through the first plug-in, and export the model file packaged into the specific general format. According to the scheme, 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 can be exported in a specific general format, the exported model file can be used in other software, and the phenomenon that the model is not supported in other software is avoided.
The embodiment of the present application further provides a readable storage medium, where a computer program is stored, and the computer program is loaded and executed by a processor to implement each step of the file generation method, where a specific implementation process may refer to descriptions of corresponding parts in the foregoing embodiment, and details are not described 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 instruction from the computer-readable storage medium, and executes the computer instruction, so that the electronic device executes the methods provided in the various optional implementation manners in the aspect of the file generation method or the aspect of the file generation system, and the specific implementation process may refer to the description of the corresponding embodiment, which is not described herein again.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
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 components and steps have been described above generally in terms of their functionality in order to clearly illustrate this 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 implementation. 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. A software module may reside 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 (10)

1. A file generation method, comprising:
determining a first plug-in, wherein the first plug-in is used for converting a file into a specific universal format;
creating a first model for modeling a 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 universal format through the first plug-in;
exporting the model file packaged into a specific general format.
2. The method of claim 1, wherein said invoking the first plug-in, encapsulating the model file in the first format into the specific common format via the first plug-in, comprises:
calling the first plug-in, and checking the model file in the first format based on the first plug-in;
and if the model file in the first format passes the verification, packaging the model file in the first format into the specific universal format.
3. The method of claim 2, wherein invoking the first plug-in, checking the model file in the first format based on the first plug-in, comprises:
calling 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 checking the model file in the first format based on a checking function in the first plug-in.
4. The method of claim 1, wherein encapsulating, by the first plug-in, the model file in the first format into the specific common format comprises:
obtaining a configuration file;
encapsulating, by the first plug-in, the model file in the first format into the particular common format based on the configuration file.
5. The method of claim 1, further comprising:
generating a first plug-in;
storing the first plug-in to an installation location of the particular application.
6. A file generation system, comprising:
the file conversion device comprises a determining unit, a converting unit and a converting unit, wherein the determining unit is used for determining a first plug-in, and the first plug-in is used for converting a file into a specific general format;
a creating 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 universal format.
7. The system of claim 6, wherein the calling unit is configured to:
calling the first plug-in, and checking the model file in the first format based on the first plug-in; and if the model file in the first format passes the verification, packaging the model file in the first format into the specific universal format.
8. The system of claim 7, wherein the calling unit calls the first plug-in, and wherein checking the model file in the first format based on the first plug-in comprises:
the calling unit calls the first plug-in to determine that the first model is compiled, and a model file in a first format generated after the first model is compiled is obtained; and checking the model file in the first format based on the checking function in the first plug-in.
9. An electronic device, comprising:
a processor configured to determine a first plug-in for converting a file to a specific common format; creating a first model for modeling a 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 universal format through the first plug-in; exporting the model file packaged into a specific universal format;
and the memory is used for storing the program of the processor for executing the processing procedure.
10. A readable storage medium storing at least one set of instructions;
the set of instructions is for being called and performing at least a method of file generation as claimed in any one of claims 1-5.
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 true CN114942757A (en) 2022-08-26
CN114942757B 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 (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080086705A1 (en) * 2006-10-10 2008-04-10 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
CN108614443A (en) * 2016-12-12 2018-10-02 中国航空工业集团公司西安航空计算技术研究所 PHM system models are developed and Design for Verification Platform method
CN109002290A (en) * 2018-10-15 2018-12-14 昆明理工鼎擎科技股份有限公司 Integrated ECU embedded target code generator and automatic generation method
US20190370420A1 (en) * 2018-06-01 2019-12-05 The Mathworks, Inc. Systems and methods for automatically realizing models for co-simulation
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
CN111552636A (en) * 2020-04-17 2020-08-18 中国航空无线电电子研究所 Method for supporting AADL integration simulation by applying FMI protocol
CN111737890A (en) * 2020-08-11 2020-10-02 华南理工大学 Simulation method based on ADAMS near space vehicle variable mass lift-off process
CN112115604A (en) * 2020-09-14 2020-12-22 苏州同元软控信息技术有限公司 Modelica model and Simulink model combined simulation method and system and electronic equipment
CN112612219A (en) * 2020-12-24 2021-04-06 中国航发控制***研究所 Joint simulation method based on model development
CN112667242A (en) * 2020-12-28 2021-04-16 北京世冠金洋科技发展有限公司 Method and device for packaging C code into FMU

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080086705A1 (en) * 2006-10-10 2008-04-10 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
CN108614443A (en) * 2016-12-12 2018-10-02 中国航空工业集团公司西安航空计算技术研究所 PHM system models are developed and Design for Verification Platform method
US20190370420A1 (en) * 2018-06-01 2019-12-05 The Mathworks, Inc. Systems and methods for automatically realizing models for co-simulation
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
CN111552636A (en) * 2020-04-17 2020-08-18 中国航空无线电电子研究所 Method for supporting AADL integration simulation by applying FMI protocol
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
CN112115604A (en) * 2020-09-14 2020-12-22 苏州同元软控信息技术有限公司 Modelica model and Simulink model combined simulation method and system and electronic equipment
CN112612219A (en) * 2020-12-24 2021-04-06 中国航发控制***研究所 Joint simulation method based on model development
CN112667242A (en) * 2020-12-28 2021-04-16 北京世冠金洋科技发展有限公司 Method and device for packaging C code into FMU

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
KRZYSZTOF SOLAK等: "Differential protection of converter transformers", 《2016 17TH INTERNATIONAL SCIENTIFIC CONFERENCE ON ELECTRIC POWER ENGINEERING (EPE)》, pages 1 - 4 *
董政: "基于FMI的Simulink模型到Modelica模型的转换技术研究", 《CNKI优秀硕士学位论文全文库 信息科技辑》, no. 01, pages 138 - 1855 *

Also Published As

Publication number Publication date
CN114942757B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
US9183360B1 (en) Obfuscation of automatically generated code
US10185546B2 (en) Service extraction and application composition
US20050235260A1 (en) User interface application development device and development method
US10684936B2 (en) Observer for simulation test and verification
CN113238834B (en) Simulation model file processing method and device and electronic equipment
CN111985055A (en) Model packaging method and device and electronic equipment
Bonfiglio et al. Executable models to support automated software FMEA
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
CN102915403B (en) A kind of computer platform device parameter visualized graphs editor collocation method
CN114942757B (en) File generation method and system and electronic equipment
CN111399829A (en) Waveform modeling method and terminal based on model driving
CN111596905A (en) Method, device, storage medium and terminal for generating java object
da Silva et al. On the automatic generation of timed automata models from function block diagrams for safety instrumented systems
JP2010049439A (en) System construction method using software model and modeling device
CN115617337A (en) Target frame based display model method and device, electronic equipment and storage medium
CN114721666A (en) Code packaging method and device
CN112784417B (en) Avionics distributed joint simulation method and system based on SysML
CN114115850A (en) Code generation method and device
KR20070049126A (en) Asadal : system for providing feature-oriented software product line engineering environment
CN109765838B (en) Method and device for generating configuration file of programmable logic controller
Gallina et al. Using safety contracts to guide the integration of reusable safety elements within ISO 26262
Koskinen et al. Profile-based approach to support comprehension of software behavior
Combemale et al. A design pattern for executable DSML
CN108304194B (en) Program generation method and device and electronic equipment

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