Automatic generation method from SysML to Modelica model

The automatic generation method from SysML to Modelica solves the problems of heavy workload and error-prone in the traditional development model, achieves efficient and accurate system design and verification, and improves development efficiency and quality.

CN118535147APending Publication Date: 2024-08-23HANGZHOU HUAWANG SYST TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410269999.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-11
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The traditional development model based on documents and manual coding has a heavy workload, is prone to errors, and has poor maintainability of artifacts, resulting in low development efficiency, high costs, and poor quality.

Method used

Provide an automatic generation method from SysML to Modelica model. By constructing Modelica metamodel, creating metaclass, verifying the correctness of the model, and generating a complete Modelica model according to the hierarchical structure, the ontology knowledge base is used for semantic analysis and reasoning to automatically realize model generation. .

Benefits of technology

Significantly improve development efficiency, reduce development costs, improve development quality, reduce developers' workload, and improve design correctness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535147A
    Figure CN118535147A
Patent Text Reader

Abstract

The invention discloses a method for automatically generating a model from SysML to Modelica. The method comprises the following steps: S01, constructing a Modelica meta-model according to the SysML model; s02, creating a Modelica meta-class according to the model type, filling internal elements of an instance object according to internal components to form an instance, and verifying according to the internal definition of the meta-class after the meta-class is created, so as to ensure the correctness of the generated Modelica model; and S03, creating a directory according to the hierarchical structure, and outputting a complete mo file to generate a Modelica model. According to the automatic generation method from the SysML to the Modelica model, the mapping relation between the SysML model and the Modelica model is firstly determined, and a correctness checking mechanism of the SysML model and the Modelica model is built in; a user can construct a SysML model and import the model into an ontology knowledge base to analyze semantic correctness of the SysML model, then a model conforming to Modelica specifications can be automatically generated through a mapping technology, and a complete Modelica model file is generated through a hierarchical structure relation for Modelica simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of model-driven management, and in particular to a method for automatically generating a SysML to Modelica model. Background Art

[0002] Model-driven engineering is a software engineering method that emphasizes the use of models to design, analyze, and generate systems. Its core idea is to design systems through models, and then use tools and techniques to automatically generate code or other system implementations.

[0003] As disclosed in the publication (announcement) number: CN109815617A, the publication (announcement) date: 2019-05-28, a simulation model driving method is disclosed, comprising the following steps: determining the hierarchical relationship between simulation models according to the connection type and calculating the level of each simulation model based on the simplex method, wherein the simulation model is an IOCE multi-level combination model; issuing broadcast drive commands one by one from the highest level to the lowest level; judging whether the level of the current broadcast drive command is the same as the level of the simulation model, if the same, driving the simulation model of this layer, otherwise, not driving the simulation model of this layer. The present invention determines the relationship between the levels of a multi-level simulation model, converts the timing relationship between simulation models at each level into the hierarchical relationship of the model, and realizes the recording and scheduling of the driving timing.

[0004] Or Publication (Announcement) Number: CN110490973B, Publication (Announcement) Date: 2022-09-16, a model-driven multi-view shoe model 3D reconstruction method is disclosed, including: selecting an initial model; extracting the contour of the initial model mask image and the contour of the shoe image mask to be restored at the same shooting angle; obtaining the single-view image grid deformation result; obtaining the grid deformation result of each view, and performing joint optimization to obtain the final deformation result; obtaining the intersection of the shoe image and the model image at the same shooting angle as the mapping pixel, back-projecting the image color to all visible vertices under the camera parameters, calculating the median of the overlapping part and filling the hole part, and obtaining the final texture-mapped shoe model. The present invention estimates the presentation angle of the shoe image in the video according to the walking posture of the character in the video, and then adjusts the shoe model to the angle to produce the shoe image at the same angle. It is an auxiliary work of image matching, which can greatly reduce the error caused by different viewing angles and improve the accuracy.

[0005] In the prior art including the above two patents, the development mode of the traditional mode of documentation and manual coding is labor-intensive, prone to errors and has poor maintainability of artifacts. Summary of the invention

[0006] The purpose of the present invention is to provide a method for automatically generating a SysML to Modelica model, which can effectively solve the problems of heavy workload, easy error, poor maintainability of artifacts, etc. in the traditional development mode based on documents and manual coding, and can significantly improve development efficiency, reduce development costs and improve development quality.

[0007] In order to achieve the above object, the present invention provides the following technical solutions:

[0008] A method for automatically generating a SysML model into a Modelica model comprises the following steps:

[0009] S01. Build Modelica metamodel based on SysML model;

[0010] S02. Create a Modelica metaclass according to the model type, and fill the internal elements of the instance object according to the internal components to form an instance. After the metaclass is created, verify it according to the internal definition of the metaclass to ensure the correctness of the generated Modelica model.

[0011] S03. Create a directory according to the hierarchical structure and output the complete mo file to generate a Modelica model.

[0012] Preferably, the method for constructing the Modelica metamodel in step S01 includes:

[0013] S11. SysM is a general domain-independent modeling language;

[0014] S12. The mo file exported by the constructed metamodel complies with the Modelica syntax specification, and obtains the basic classification of SysML model similar to that of Modelica.

[0015] Preferably, the embodiment is composed based on the basic metaclass requirements of ModelicaML in the system that conform to the Modelica syntax specification, and improves the Modelica syntax and term definition / belonging definition to achieve structural mapping between the model and Modelica and relationship mapping between the model and Modelica.

[0016] Preferably, the method for verifying according to the internal definition of the metaclass is to check the variables and equations in the model and verify the stability and consistency of the system. If problems are found during the verification process, the Modelica model is debugged and corrected.

[0017] Preferably, in addition to checking the variables and equations in the model, it should also include checking the equations, initialization values ​​and connections of the model.

[0018] Preferably, the step of generating the Modelica model in step S03 includes:

[0019] S31, generating a catalog according to the hierarchical structure of the SysML system model, and establishing the relationship between the models according to the components and types in the instance model;

[0020] S32, generating a Modelica model with a complete structure that conforms to the Modelica syntax structure based on the relationship, and comparing it with the original SysML model;

[0021] S33. Export the generated Modelica model according to the directory structure. The exported directory structure contains all types, modules, and hierarchical structures involved in the entire model.

[0022] In the above technical solution, the method for automatically generating a SysML to Modelica model provided by the present invention has the following beneficial effects: by importing the system design knowledge described by the model into the ontology knowledge base for semantic analysis, knowledge reasoning and ontology mapping, a model that conforms to the Modelica syntax specification can be derived. The model can serve as the basis for subsequent system development and serve the detailed design and verification process of the system. Since the process is automatically implemented based on ontology reasoning and related algorithms, it can reduce the workload of developers and help improve the correctness of the design. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0024] Figure 1 A schematic diagram of the SysML to Modelica model generation process provided in an embodiment of the present invention;

[0025] Figure 2 A schematic diagram of a basic classification structure similar to that of Modelica for the SysML model provided in an embodiment of the present invention;

[0026] Figure 3 A schematic diagram of a Modelica metaclass provided by an embodiment of the present invention;

[0027] Figure 4 A schematic diagram of a Modelica model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] like Figure 1-4 As shown, a method for automatically generating a SysML model to a Modelica model includes the following steps:

[0030] S01. Build Modelica metamodel based on SysML model;

[0031] S02. Create a Modelica metaclass according to the model type, and fill the internal elements of the instance object according to the internal components to form an instance. After the metaclass is created, verify it according to the internal definition of the metaclass to ensure the correctness of the generated Modelica model.

[0032] S03. Create a directory according to the hierarchical structure and output the complete mo file to generate the Modelica model ( Figure 4 ).

[0033] Furthermore, the method for constructing the Modelica metamodel in step S01 includes:

[0034] S11. SysM is a general domain-independent modeling language;

[0035] S12. The mo file exported by the constructed metamodel conforms to the Modelica syntax specification, and the basic classification of SysML model is similar to that of Modelica ( Figure 2 ).

[0036] Secondly, the composition of the embodiment is based on the basic metaclass requirements of ModelicaML in the system that conform to the Modelica syntax specification, and improves the Modelica syntax and term definition / belonging definition to achieve the structural mapping between the model and Modelica and the relationship mapping between the model and Modelica.

[0037] It should be noted that Modelica metaclasses such as Figure 3 shown.

[0038] Furthermore, the verification method based on the internal definition of the metaclass is to check the variables and equations in the model and verify the stability and consistency of the system. If problems are found during the verification process, the Modelica model is debugged and corrected.

[0039] Furthermore, this should include checking the model's equations, initialization values, and connections in addition to checking the variables and equations in the model.

[0040] Furthermore, the step of generating the Modelica model in step S03 includes:

[0041] S31, generating a catalog according to the hierarchical structure of the SysML system model, and establishing the relationship between the models according to the components and types in the instance model;

[0042] S32, generating a Modelica model with a complete structure that conforms to the Modelica syntax structure based on the relationship, and comparing it with the original SysML model;

[0043] S33. Export the generated Modelica model according to the directory structure. The exported directory structure contains all types, modules, and hierarchical structures involved in the entire model.

[0044] In the above technology, by importing the system design knowledge described by the model into the ontology knowledge base for semantic analysis, knowledge reasoning and ontology mapping, a model that conforms to the Modelica syntax specification can be derived. This model can serve as the basis for subsequent system development and serve the detailed design and verification process of the system. Since this process is automatically implemented based on ontology reasoning and related algorithms, it can reduce the workload of developers and help improve the correctness of the design.

[0045] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0046] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.

[0047] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0048] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0049] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

[0050] The embodiments of the present application also provide a specific implementation of an electronic device capable of implementing all steps of the method in the above embodiments, and the electronic device specifically includes the following contents:

[0051] Processor, memory, communications interface and bus;

[0052] Wherein, the processor, memory, and communication interface communicate with each other via the bus;

[0053] The processor is used to call the computer program in the memory, and when the processor executes the computer program, all the steps in the method in the above embodiment are implemented.

[0054] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the method in the above embodiments, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps of the method in the above embodiments are implemented.

[0055] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the hardware + program embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. Although the embodiment of this specification provides the method operation steps described in the embodiment or flow chart, more or less operation steps can be included based on conventional or non-creative means. The order of steps listed in the embodiment is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the embodiments of this specification, the functions of each module can be implemented in the same one or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The present invention is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the process and / or box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0056] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment. In the description of this specification, the description of the reference term "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of this specification.

[0057] In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradicting each other. The above is only an embodiment of the embodiment of this specification and is not intended to limit the embodiment of this specification. For those skilled in the art, the embodiment of this specification may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiment of this specification shall be included in the scope of the claims of the embodiment of this specification.

Claims

1. A method for automatically generating a SysML model into a Modelica model, characterized in that: The following steps are involved: S01. Build Modelica metamodel based on SysML model; S02. Create a Modelica metaclass according to the model type, and fill the internal elements of the instance object according to the internal components to form an instance. After the metaclass is created, verify it according to the internal definition of the metaclass to ensure the correctness of the generated Modelica model. S03. Create a directory according to the hierarchical structure and output the complete mo file to generate a Modelica model.

2. The method for automatically generating a SysML model into a Modelica model according to claim 1, characterized in that: The method for constructing the Modelica metamodel in step S01 includes: S11. SysM is a general domain-independent modeling language; S12. The mo file exported by the constructed metamodel complies with the Modelica syntax specification, and obtains the basic classification of SysML model similar to that of Modelica.

3. The method for automatically generating a SysML model to a Modelica model according to claim 1, characterized in that: The above-mentioned embodiment is based on the basic metaclass requirements of ModelicaML in the system that conform to the Modelica syntax specification, and improves the Modelica syntax and term definition / belonging definition to achieve the structural mapping between the model and Modelica and the relationship mapping between the model and Modelica.

4. The method for automatically generating a SysML model into a Modelica model according to claim 1, characterized in that: The method of verification based on the internal definition of the metaclass is to check the variables and equations in the model and verify the stability and consistency of the system. If problems are found during the verification process, debug and correct the Modelica model.

5. The method for automatically generating a SysML model to a Modelica model according to claim 4, characterized in that: This should include checking the model's equations, initialization values, and connections in addition to examining the variables and equations in the model.

6. The method for automatically generating a SysML model into a Modelica model according to claim 1, characterized in that: The step of generating the Modelica model in step S03 includes: S31, generating a catalog according to the hierarchical structure of the SysML system model, and establishing the relationship between the models according to the components and types in the instance model; S32, generating a Modelica model with a complete structure that conforms to the Modelica syntax structure based on the relationship, and comparing it with the original SysML model; S33. Export the generated Modelica model according to the directory structure. The exported directory structure contains all types, modules, and hierarchical structures involved in the entire model.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for automatically generating a SysML model from a Modelica model according to any one of claims 1 to 6 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for automatically generating a SysML model from a Modelica model as claimed in any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Data interaction association mapping transmission method for SKTC task model

    CN119475796A

  • Conversion method and system based on SysML and Modelica model semantic mapping

    CN120780317A