Method and system for converting heterogeneous model files based on uml specification
By parsing, analyzing, and optimizing heterogeneous model files in the UML specification, data and model interoperability between different modeling tools is achieved, solving the compatibility problem of heterogeneous modeling tools, improving design efficiency and quality, and supporting model reuse and rapid iteration.
Patent Information
- Application Number
- CN202411799202.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-12-09
AI Technical Summary
In existing technologies, the interoperability and standardized transfer of data and models between different modeling tools are poor, which affects the efficiency and quality of the design process.
This paper provides a method for converting heterogeneous model files based on UML specifications, including parsing, analysis, model verification, creation of target project files, verification and optimization processes. It realizes intelligent mapping and automated conversion between metamodels, supports model reuse and compatibility, and provides a user-friendly interface and error handling.
It improves data and model interoperability between modeling tools, enhances the efficiency and quality of the design process, supports model reuse, promotes team collaboration and knowledge sharing, reduces conversion costs and technical barriers, and supports rapid iteration and agile development.
Smart Images

Figure CN119937985B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of application and development technology of Model-Based Systems Engineering (MBSE), System Modeling Language (SysML), and Unified Modeling Language (UML), and particularly to a method and system for converting heterogeneous model files based on UML specifications. Background Technology
[0002] MBSE (Model-Based System Design) is a methodology that utilizes digital models to support the entire system lifecycle, from conceptual design to verification and validation. Compared to traditional manual processes that rely on text, MBSE improves efficiency and accuracy by designing systems through digital modeling and simulation. When dealing with complex systems, such as those in aerospace, automotive, defense, and telecommunications, MBSE can clearly represent the complex relationships between systems and continuously optimize their performance through simulation and other methods.
[0003] SysML, one of the three pillars of MBSE (language, tools, and methodology), is a graphical modeling language that extends UML specifically for systems engineering. SysML provides at least nine... Figure 1 SysML uses graphical representations of system components and behaviors, and is widely used in the design and analysis of complex systems and equipment. It not only supports the graphical representation of system requirements, but also helps maintain the relationships between requirements, design, analysis, and verification.
[0004] In software engineering and systems engineering, Unified Modeling Language (UML), Systems Modeling Language (SysML), Business Process Modeling Language (BPMN), Architecture Modeling Language (UAF), and the Open Group Architecture Framework Language (TOGAF) are widely used standardized design and analysis languages. They help modeling engineers visualize, specify, construct, and document model systems by providing a series of graphical representation methods. However, due to different project requirements or team preferences, it may be necessary to convert project files between modeling tools from different vendors. Existing methods for achieving data and model interoperability and standardized transfer between different modeling tools are poor, affecting the efficiency and quality of the entire design process. Summary of the Invention
[0005] This invention provides a method and system for converting heterogeneous model files based on UML specifications, which can solve the technical problem of poor interoperability and standardized transfer of data and models between different modeling tools in the prior art, affecting the efficiency and quality of the entire design process.
[0006] According to one aspect of the present invention, a method for converting heterogeneous model files based on UML specifications is provided. The method includes: Step 1, parsing the current project file and marking it as being converted; Step 2, analyzing the current project file; Step 3, determining whether there are any referenced projects in the current project file that have not yet started conversion; if no referenced projects have not yet started conversion, proceed to the next step; if referenced projects have not yet started conversion, set an unresolved referenced project as the current project file, and repeat steps 1 and 2 until there are no referenced projects that have not yet started conversion; Step 4, determining the current... If the previous project has not been converted, proceed to the next step. If the current project has been converted, determine if it is the main project. If so, end the file conversion. If the current project is not the main project, set the previously converted project as the current project and proceed to step three. Step five: Perform model verification on the current project file. Step six: Create an empty target project file. Step seven: Extract data from the current project file to create resource objects and model data for the target project file. Step eight: Verify and optimize the target project and model. Step nine: Record the conversion log and proceed to step four until the file conversion is complete.
[0007] Furthermore, in step one, parsing the current project file specifically includes: reading the contents of the current project file, accessing the file system, and loading the file contents; identifying the file type and encoding, determining the file format, and if it is a compressed package, then decompressing it and reading the information of each file within the package, calling the corresponding tool plugin to read its contents, and if it is a specific special format, then writing specific special code to read its contents; selecting a suitable parser to parse the file; and converting the file contents into data structure objects.
[0008] Furthermore, in step two, the analysis of the current project file specifically includes: analyzing the referenced project information contained in the current project file, confirming the relationship between the referenced projects and whether there are circular references, so as to facilitate the confirmation of the conversion path during subsequent conversion; traversing the entire project file and distinguishing them according to their resource types; determining the correspondence between elements and other information objects in the current project file and the target project. If such a correspondence does not exist, the missing information is recorded in the conversion system. Similarly, if the various necessary information required to create the target project does not exist in the source project or cannot be automatically supplemented, the missing information is recorded in the conversion system; identifying and processing parts of the current project file that do not conform to the UML specification, and identifying and processing parts that do not conform to the business logic of the target project.
[0009] Furthermore, in step five, the model verification of the current project file specifically includes: checking the consistency of the current project file to ensure that there are no missing or incorrect element references, and to ensure that there are no missing references to project files or system resources; verifying whether the UML model of the source project file conforms to the version and configuration file of the UML specification supported by the target tool; and confirming that the model elements and project information necessary for creating the target project exist and are valid.
[0010] Furthermore, in step six, creating an empty target project file specifically includes: initializing an empty target project file; and setting the basic attributes of the target project file.
[0011] Furthermore, in step seven, extracting data from the current project file to create resource objects and model data for the target project file specifically includes: constructing various resource objects necessary for the target project file and setting their resource URIs; recursively parsing and synchronously creating resources in the target resource from the corresponding resources of the current project in the order of referencing project resources, semantic model resources, graphical model resources, and other resources, but without setting their basic attributes and reference attributes, only constructing this hierarchical structure according to their parent-child structure inclusion relationship; after constructing each node element corresponding to this resource hierarchy, recursively setting its basic attributes and reference attributes from the root node element. When a reference attribute is set on an element that has not yet been created, a waiting task can be generated. This task is executed after the element is created.
[0012] Furthermore, in step eight, verifying and optimizing the target project and model specifically includes: checking whether the converted target project file contains redundant or inconsistent model data; ensuring that all elements and relationships conforming to the OMG object management organization's UML specifications are correctly converted and logically consistent; ensuring that all graphical elements conforming to the OMG object management organization's DI specifications are correctly converted and logically consistent; and optimizing the model to improve readability and ease of subsequent maintenance.
[0013] Furthermore, in step nine, recording the conversion log specifically includes: recording key steps and decision points in the conversion process; recording any errors or warnings, as well as the solutions taken; and providing a summary report of the conversion process.
[0014] According to another aspect of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for converting heterogeneous model files based on UML specifications as described above.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the method for converting heterogeneous model files based on UML specifications as described above.
[0016] This invention provides a method for converting heterogeneous model files based on UML specifications. The main technical problem this method addresses is achieving interoperability and standardized transfer of data and models between different modeling tools, thereby improving the efficiency and quality of the entire design process. This method enables intelligent mapping between metamodels, automated conversion processes, automatic handling of referenced projects, compatibility and error handling. The converted target model undergoes model verification and testing, ensuring the security of the source project. Furthermore, third-party developers can configure and extend it to provide greater flexibility. Therefore, compared with existing technologies, the method for converting heterogeneous model files based on UML specifications provided by this invention solves the incompatibility problem of project files created by various vendors' modeling tools. By automating the conversion of project files generated by heterogeneous modeling tools, it supports model reuse, improves the implementation efficiency and quality of modeling engineers, enhances software compatibility, promotes team collaboration and knowledge sharing, reduces conversion costs and technical barriers, and supports rapid iteration and agile development. Attached Figure Description
[0017] The accompanying drawings, which form part of this specification, are provided to further illustrate embodiments of the invention and, together with the textual description, explain the principles of the invention. It is obvious that the drawings described below are merely some embodiments of the invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0018] Figure 1 A schematic diagram of the overall architecture of the conversion tool provided according to a specific embodiment of the present invention is shown;
[0019] Figure 2 A schematic diagram of the conversion process provided according to a specific embodiment of the present invention is shown;
[0020] Figure 3 A schematic diagram of an engineering reference relationship representation A provided according to a specific embodiment of the present invention is shown;
[0021] Figure 4 A schematic diagram of engineering reference relationships B provided according to a specific embodiment of the present invention is shown;
[0022] Figure 5 A schematic diagram of an engineering reference relationship representation C provided according to a specific embodiment of the present invention is shown;
[0023] Figure 6 A schematic diagram of engineering reference relationships provided according to a specific embodiment of the present invention is shown. Detailed Implementation
[0024] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0026] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the invention. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0027] like Figures 1 to 6As shown, according to a specific embodiment of the present invention, a method for converting heterogeneous model files based on UML specifications is provided. This method includes: Step 1, parsing the current project file and marking it as being converted; Step 2, analyzing the current project file; Step 3, determining whether there are any referenced projects in the current project file that have not yet started conversion; if no referenced projects have not yet started conversion, proceed to the next step; if referenced projects have not yet started conversion, set an unresolved referenced project as the current project file, and repeat steps 1 and 2 until there are no referenced projects that have not yet started conversion; Step 4, ... Determine if the current project has completed the conversion. If not, proceed to the next step. If the current project has completed the conversion, determine if it is the main project. If so, end the file conversion. If the current project is not the main project, set the previously converted project as the current project and proceed to step three. Step five: Perform model verification on the current project file. Step six: Create an empty target project file. Step seven: Extract data from the current project file to create resource objects and model data for the target project file. Step eight: Verify and optimize the target project and model. Step nine: Record the conversion log and proceed to step four until the file conversion is complete.
[0028] This configuration method provides a way to convert heterogeneous model files based on UML specifications. The main technical problem this method addresses is achieving interoperability and standardized transfer of data and models between different modeling tools, thereby improving the efficiency and quality of the entire design process. This method enables intelligent mapping between metamodels, automated conversion processes, automatic handling of referenced projects, compatibility and error handling. The converted target model undergoes model verification and testing, and the security of the source project is ensured. Furthermore, third-party developers can configure and extend it to provide greater flexibility. Therefore, compared with existing technologies, the method for converting heterogeneous model files based on UML specifications provided by this invention solves the incompatibility problem of project files created by various vendors' modeling tools. By automating the conversion of project files generated by heterogeneous modeling tools, it supports model reuse, improves the implementation efficiency and quality of modeling engineers, enhances software compatibility, promotes team collaboration and knowledge sharing, reduces conversion costs and technical barriers, and supports rapid iteration and agile development.
[0029] The present invention aims to solve the problem of converting project files created by different modeling tools based on UML specifications (such as SysML, BPMN, TOGAF, UAF, etc.) into project files supported by another vendor's modeling tool.
[0030] The overall architecture of the technical solution conversion tool expressed in this invention is as follows: Figure 1As shown, the final conversion tool of this invention can be a standalone application or script, or a functional plugin based on the target modeling tool. The final implementation of this invention may not require both a source modeling tool application and a target modeling tool, but it can leverage (source or target) modeling tools or their provided APIs to reduce the workload of developing the invention.
[0031] The process of converting a source file created by a modeling tool based on the UML standard into a target file supported by a modeling tool from another vendor that also uses the UML standard is as follows: Figure 2 As shown, it includes, but is not limited to, the following main steps:
[0032] Step one involves parsing the current project file and marking it as being converted. Specifically, parsing the current project file includes: reading its contents, accessing the file system, and loading the file content; identifying the file type and encoding, determining the file format (e.g., if it's a compressed file, decompressing it and reading the information of each file within the package, then calling the appropriate tools / plugins to read its contents; if it's a specific format, then writing specific code to read its contents); selecting a suitable parser to parse the file; and converting the file content into a data structure object.
[0033] As a specific embodiment of the present invention, taking the source project file as the current project file as an example, the process of parsing the source project file specifically includes:
[0034] (1.1) Read the contents of the source project file, access the file system, and load the file contents.
[0035] (1.2) Identify the file type and encoding, determine the file format. If it is a compressed package, decompress it and read the information of each file in the package. If it is an xml, xmi or other format, call the corresponding tool plugin to read its content. If it is a specific special format, you can write specific special code to read its content.
[0036] (1.3) Select a suitable parser. Depending on the file type, use a parser such as dom or sax to parse the XML file.
[0037] (1.4) Converting to a data structure: Generally, various project files can be abstracted into a Project object. This Project object should contain information such as the project name, file path, and the name and type of the file resources it contains (either unzipped or directly). The file content is then converted into a suitable data structure, such as a tree or graph data structure object. Below the project level, there is generally a concept of resources, mainly including semantic model resources, diagram model resources, referenced project model resources, and other resources. Data below the resource level can be abstracted into model objects that follow the meta-model concept. Specifically, for example, the xxx.mdzip or xxx.sds file in MagicDraw or Arch modeling tools is actually a compressed package containing multiple files. These files generally include xxx.project, xxx.model, xxx.notation, etc. (the suffixes of persistent files for the same type of resource obtained after decompressing project files from different modeling tools are generally different). These files are used for persistently saving resources. However, when various applications use these files, these files are "resources" for the applications. But modeling tools generally do not support the direct use of "heterogeneous files" not generated by the tool itself (although various modeling tools claim to follow certain specifications). In order to use these "heterogeneous files", they generally need to be converted into intermediate objects in the format of "specific data structure", and then the intermediate objects are converted into "resource objects" that the modeling tools can directly recognize.
[0038] Furthermore, after parsing the current project file, it can be analyzed. Specifically, in step two, analyzing the current project file includes: analyzing the referenced project information contained in the current project file, confirming the relationships between the referenced projects and whether there are circular references, so as to facilitate the confirmation of the conversion path during subsequent conversion; traversing the entire project file and distinguishing them according to their resource types; determining the correspondence between elements and other information objects in the current project file and the target project. If such a correspondence does not exist, it is recorded in the conversion system. Similarly, if the various necessary information required to create the target project does not exist in the source project or cannot be automatically supplemented, it is recorded in the conversion system; identifying and processing parts of the current project file that do not conform to the UML specification, and identifying and processing parts that do not conform to the business logic of the target project.
[0039] As a specific embodiment of the present invention, taking the source project file as the current project file as an example, the process of analyzing the source project file specifically includes:
[0040] (2.1) Analyze the information related to the referenced projects contained in the source project to confirm the relationships between the referenced projects and whether there are circular references, so as to facilitate the confirmation of the conversion path during subsequent conversion. For example, if two projects a.mdzip and b.mdzip are created using MagicDraw, and project a.mdzip references b.mdzip, we generally call b the referencing project, that is, b is a referencing project of a. In other words, b is referenced by a.
[0041] (2.2) Element Traversal and Classification: Traverse the entire project file and classify elements according to their resource types, such as semantic elements (including UML elements and various extended dynamic objects), graph elements (i.e., the graphical representation of UML / SysML elements on a graph), referenced project information, and other resource information. In this invention, semantic elements, graph elements, referenced project information, and other resource information can be understood as different resource types. A resource object can be understood as a container that manages element objects of the same type (or similar types), such as semantic elements, which are generally managed in a UMLResource object, and graph elements, which are generally managed in a NotationResource object. Other resource information generally varies depending on the development and implementation of the modeling tool (or different versions of the same tool), such as project configuration item resource information, project snapshot resource information, etc. These other resource information are generally not the necessary resource information specified by standard specifications (such as the OMG's UML / SysML specification), but are established by various development tools to facilitate development or project optimization.
[0042] (2.3) Relationship mapping: Determine the correspondence between elements and other information objects in the source project and those in the target project (“elements” generally refer to semantic and graphical elements; “other information objects” refer to other objects that need to be converted besides elements, such as project information objects, including project IDs, referenced project information, etc.). If such a correspondence does not exist, the missing information is recorded in the conversion system. Similarly, if the necessary information required to create the target project does not exist in the source project or cannot be automatically supplemented, the missing information is recorded in the conversion system. In this invention, it is necessary to determine the correspondence between all elements and information objects in the source project and those in the target project. For example, if a UML element type name in the source project is “StandardPort”, and the type name in the target project conforming to the OMG specification is “Port”, a mapping relationship is required between them. This mapping relationship is generally bound to the modeling tool and version of the source project file and the target modeling tool and version.
[0043] (2.4) Identify and handle parts of the source project file that do not conform to the UML specification, such as extended or custom elements that require special handling; identify and handle parts that do not conform to the business logic of the target project, such as a Stereotype's ancestor node not having a Profile. There are many situations that do not conform to the business logic of the target project, and they generally need to be handled according to the specific circumstances. For example: a) If the ancestor node of a Stereotype element does not have a Profile node, then the type of a Package node of the Stereotype can be changed to the Profile type, or a Profile ancestor node can be added to the Stereotype element. b) If the type of a Property element is set to a type that does not conform to the constraints of the target project element, then similar type elements can be replaced or the setting can be ignored. c) If an element is set under an extended attribute of a source project element, but this extended attribute does not conform to the OMG specification and does not exist under the target project element, then it can be set under other attributes that can be placed under this element or under appropriate attributes of other elements. If it cannot be placed but cannot be ignored, it can also be solved by meta-annotations or xmi:Extension extensions.
[0044] Furthermore, after analyzing the current project file, it can be determined whether there are any referenced projects that have not yet started conversion. If there are no referenced projects that have not yet started conversion, proceed to the next step; if there are referenced projects that have not yet started conversion, set an unresolved referenced project as the current project file, and repeat steps one and two until there are no referenced projects that have not yet started conversion.
[0045] Next, determine whether the current project has completed the conversion. If the current project has not completed the conversion, proceed to the next step. If the current project has completed the conversion, determine whether the current project is the main project. If so, end the file conversion. If the current project is not the main project, set the previously converted project of the current project as the current project and proceed to step three.
[0046] Next, model validation is performed on the current project file. Step five specifically includes: checking the consistency of the current project file to ensure there are no missing or incorrect element references, and to ensure there are no missing references to project files or system resources; verifying whether the UML model of the source project file conforms to the version and configuration file of the UML specification supported by the target tool; and confirming that all model elements and project information necessary for creating the target project exist and are valid.
[0047] Furthermore, after performing model validation on the current project file, an empty target project file can be created. Step six, creating an empty target project file, specifically includes: initializing an empty target project file, which may involve creating a new file or building an initial structure in memory; and setting the basic attributes of the target project file, such as name, author, and creation date.
[0048] After creating an empty target project file, data can be extracted from the current project file to create the target project file resource objects and model data. Step seven, specifically, involves: constructing the various resource objects (Resources) necessary for the target project file and setting their resource URIs; recursively parsing and synchronously creating the corresponding resources from the current project in the order of referenced project resources, semantic model resources, graphical model resources, and other resources, but without initially setting their basic attributes and reference attributes; instead, constructing this hierarchical structure according to their parent-child containment relationship (referring to whether the meta-attributes defined in the meta-model are true, i.e., the result of `EstructuralFeature.isContainment()` returning true); after constructing all the node elements corresponding to this resource hierarchy, recursively setting their basic attributes and reference attributes from the root node element. When a reference attribute is set on an element that has not yet been created, a waiting task can be generated. This task is executed after the element is created.
[0049] Furthermore, after extracting data from the current project file to create the target project file resource objects and model data, the target project and model can be verified and optimized. In step eight, verifying and optimizing the target project and model specifically includes: checking whether the converted target project file contains redundant or inconsistent model data; ensuring that all elements and relationships conforming to the OMG object management organization's UML specifications are correctly converted and logically consistent; ensuring that all graphical elements conforming to the OMG object management organization's DI specifications are correctly converted and logically consistent; and optimizing the model to improve readability and ease of subsequent maintenance. As a specific embodiment of the present invention, after converting from the Source project to the Target project, the semantic model may contain some Source-related models that are irrelevant to the actual business logic of the current model. These can be optimized and removed, including but not limited to removing referenced Source-specific Profiles, ModelLibraries, etc. These business logics require targeted optimization based on the source project type and the target project type.
[0050] After verifying and optimizing the target project and model, the conversion log can be recorded, and the process can proceed to step four until the file conversion is complete. In step nine, recording the conversion log specifically includes: recording key steps and decision points during the conversion process (key steps include...). Figure 2 The conversion process is illustrated by the rectangular blocks and steps involved in converting a target project. The decision points include... Figure 2 The process includes diamond selection decision points in the conversion process and decisions made by different systems based on context conditions when converting a target project; recording any errors or warnings and the solutions taken; and providing a summary report of the conversion process, including time taken, success rate, and any points requiring attention.
[0051] In summary, after completing the above steps, ensure that the target project file can be opened correctly in the target modeling tool, and that all model elements are displayed and function as expected.
[0052] According to another aspect of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for converting heterogeneous model files based on UML specifications as described above.
[0053] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the method for converting heterogeneous model files based on UML specifications as described above.
[0054] To gain a further understanding of the present invention, the following description is provided in conjunction with... Figures 1 to 6 The present invention provides a detailed description of the method for converting heterogeneous model files based on UML specifications.
[0055] Due to different project requirements or team preferences, it may be necessary to convert project files between modeling tools from different vendors. This raises an innovative solution requirement: how to convert a project file (source) created by a modeling tool based on UML specifications into a project file (target) supported by another modeling tool that is also based on UML specifications. The method provided by this invention includes: Step 1, parsing the current project file and marking it as being converted; Step 2, analyzing the current project file; Step 3, determining whether there are any referenced projects in the current project file that have not yet started conversion; if there are no referenced projects that have not yet started conversion, proceed to the next step; if there are referenced projects that have not yet started conversion, set an unresolved referenced project as the current project file, and repeat Step 1 and Step 2 until there are no referenced projects that have not yet started conversion; Step 4, determining whether the current project has completed conversion; if the current project has not completed conversion, proceed to the next step; if the current project has completed conversion, determining whether the current project is the main project; if so, ending the file conversion; if the current project is not the main project, setting the previously converted project of the current project as the current project, and proceeding to Step 3; Step 5, performing model verification on the current project file; Step 6, creating an empty target project file; Step 7, extracting data from the current project file to create resource objects and model data for the target project file; Step 8, verifying and optimizing the target project and model; Step 9, recording the conversion log, and proceeding to Step 4 until the file conversion is complete.
[0056] The innovative aspects of this invention include the following:
[0057] a) Automated Conversion Process: Develop an automated tool or script capable of reading the UML, SysML, BPMN, UAF, and TOGAF definitions of the source file and converting them into an intermediate format that the target tool can understand. This process involves in-depth analysis of the source file, including not only all details of elements, relationships, and attributes, but also information such as the various primitives in the diagram, their nesting relationships, coordinate positions, and sizes.
[0058] b) Intelligent mapping between meta-models: Innovatively realizes intelligent mapping between the meta-models of source and target project files. This means not only establishing a one-to-one correspondence between model elements, but also understanding and adapting to the different implementations of the same UML / SysML concept by different tools.
[0059] c) User-friendly interface: The conversion tool provides an intuitive user interface that allows users to easily specify conversion parameters, select the elements to be converted, and customize various options during the conversion process. This lowers the learning curve, enabling even non-professionals to perform efficient model conversion.
[0060] d) Automatic handling of referenced projects: The conversion tool can automatically process referenced project files containing complex nesting and referencing relationships, and through a certain algorithm, it can properly solve the problem of circular references between projects.
[0061] e) Compatibility and error handling: It can intelligently identify and handle incompatibility issues and potential conversion errors, such as providing prompts or automatically applying the best alternative when certain features in the source file do not have a direct corresponding representation in the target tool.
[0062] f) Scalability and plugin support: The conversion tool provides a scalable architecture that allows third-party developers to add new conversion rules or adapters, thereby supporting more source and target tool combinations and maintaining long-term adaptability and flexibility.
[0063] g) Model Validation and Testing: Provides model validation functionality to ensure that the converted model is not only syntactically correct and error-free, but also semantically faithful to the original model. It also integrates an automated testing mechanism to guarantee the quality of the conversion results.
[0064] h) Ensure the security of the conversion project and protect the user's source files from unauthorized access, disclosure, or modification.
[0065] Therefore, the innovation of converting project files created by a UML-based modeling tool into project files supported by another UML-based modeling tool lies in its ability to achieve intelligent mapping between meta-models, automated conversion process, automatic handling of referenced projects, user-friendly interface, compatibility and error handling. The converted target model has undergone model verification and testing, and the security of the source project has been ensured. Furthermore, third-party developers can make it more flexible through configuration and extension.
[0066] The following is based on Figure 2 The process of expression transformation Figures 3 to 6 Here's an example of converting the source project PA. PA represents the source project containing the referenced project; since it's the main project's entry point, the letter A is capitalized. Pb and Pc represent the referenced projects, and the parent project referencing them is located in... Figures 3 to 6 The situation varies in different scenarios; there may be multiple parent project nodes, or there may be circular references.
[0067] a) Figure 3 Project reference relationship representation A Example of conversion:
[0068] Figure 3 Engineering reference relationship expression A The main project is PA, which references two other projects, Pb and Pc. Pb and Pc do not have any mutual references, and neither Pb nor Pc is aware of being referenced by the main project PA. When a user performs a conversion on PA, the following steps are followed:
[0069] i. First, parse the project file PA and mark the status of PA as "converting" in the conversion tool;
[0070] ii. Analyze the project file PA;
[0071] iii. Determine if there are any referenced projects in the current project PA that have not yet started conversion, and conclude that they exist;
[0072] iv. Set the unresolved reference project Pb to the current project;
[0073] v. Resolve the referenced project Pb and mark Pb's status as "converting" in the conversion tool;
[0074] vi. Parse the project file Pb;
[0075] vii. Determine if there are any referenced projects in Pb that have not yet started conversion, and conclude that they do not exist; viiii. Determine if the current project file Pb has completed conversion, and conclude that it has not been completed;
[0076] ix. Perform model validation on the current project file Pb;
[0077] x. Create an empty target project file Pbs;
[0078] xi. Extract data from the source project file Pb and create the corresponding resource objects and model data in the target project file Pbs;
[0079] xii. Verify and optimize the model data in the target project file Pbs;
[0080] xiii. Record information such as anomalies, errors, key steps, and conversion decisions during the conversion process to form a conversion log and conversion report for the referenced project Pb;
[0081] xiv. Determine again whether the current project Pb has completed the conversion, and conclude that it has;
[0082] xv. Then determine whether the current project Pb is the main project, and conclude that it is not;
[0083] xvi. Sets the main project PA from the previous Pb conversion as the current project;
[0084] xvii. Determine if PA has any referenced projects that have not yet been converted, and conclude that there is an unconverted referenced project Pc;
[0085] xviii. Set the unresolved reference project Pc to the current project;
[0086] xix. Resolve the referenced project Pc and mark Pc's status as "converting" in the conversion tool;
[0087] xx. Analyze the project file Pc;
[0088] xxi. Determine if there are any referenced projects in the current project PC that have not yet started conversion, and conclude that they do not exist;
[0089] xxii. Determine whether the current project Pc has completed the conversion, and conclude that the conversion has not been completed;
[0090] xxiii. Perform model verification on the current project file Pc;
[0091] xxiv. Create an empty target project file Pcs;
[0092] xxv. Extract data from the source project file Pc and complete the creation of resource objects and model data in the target project Pcs;
[0093] xxvi. Validate and optimize the model data in the target project file Pcs;
[0094] xxvii. Records anomalies, errors, key steps, and conversion decisions during the conversion process to form a conversion log and conversion report for the referenced project PC;
[0095] xxviii. Determine again whether the current project Pc has completed the conversion, and conclude that it has;
[0096] xxix. Next, determine whether the current project PC is the main project, and conclude that it is not;
[0097] xxx. Set the main project PA from the previous conversion of the source project Pc as the current project;
[0098] xxxi. Determine if the current project PA has any referenced projects that have not yet started conversion, and conclude that it does not.
[0099] xxxii. Determine whether the current project PA has completed the conversion, and conclude that it is not;
[0100] xxxiii. Validate the PA model of the current project file;
[0101] xxxiv. Create empty target project files (PAs);
[0102] xxxv. Extracts data from the current project file PA to complete the creation of the target project file PAs resource objects and model data;
[0103] xxxvi. Verify and optimize target project files (PAs);
[0104] xxxvii. Records information such as exceptions, errors, key steps, and conversion decisions during the conversion process to form a conversion log and conversion report for the referenced project PAs;
[0105] xxxviii. Determine whether the current project PAs has completed the conversion, and conclude that it has;
[0106] xxxix. Determine whether the current project PAs is the main project, and conclude that it is.
[0107] xl. The conversion of the main project PA and its referenced projects Pb and Pc is complete. Conversion ends.
[0108] b) Figure 4 Example of B-type conversion for representing engineering reference relationships:
[0109] Figure 4 Engineering reference relationship expression B The main project is PA, which references two other projects, Pb and Pc. Pb, in turn, references Pc. Pb and Pc are unaware of the references made by the main project PA, and Pc is unaware of the references made by Pb. When a user performs a conversion on PA, the following steps are followed:
[0110] i. First, parse the project file PA and mark the status of PA as "converting" in the conversion tool;
[0111] ii. Analyze the project file PA;
[0112] iii. Determine if there are any referenced projects in the current project PA that have not yet started conversion, and conclude that they exist;
[0113] iv. Set the unresolved reference project Pb to the current project;
[0114] v. Resolve the referenced project Pb and mark Pb's status as "converting" in the conversion tool;
[0115] vi. Parse the project file Pb;
[0116] vii. Determine if Pb contains any referenced projects that have not yet been converted, and conclude that they exist;
[0117] viii. Set the unresolved reference project Pc to the current project;
[0118] ix. Resolve the referenced project Pc, and mark Pc's status as "converting" in the conversion tool;
[0119] x. Parse the project file Pc and mark the status of Pc as "converting" in the conversion tool;
[0120] xi. Analyze the current project Pc;
[0121] xii. Determine if the current project PC has any referenced projects that have not yet started conversion, and conclude that none exist;
[0122] xiii. Determine whether the current project file Pc has been converted, and conclude that it has not been completed;
[0123] xiv. Perform model validation on the current project file Pc;
[0124] xv. Creates an empty target project file Pcs;
[0125] xvi. Extract data from the source project file Pc and complete the creation of the corresponding resource objects and model data in the target project file Pcs;
[0126] xvii. Validate and optimize the model data in the target project file Pcs;
[0127] xviii. Record information such as exceptions, errors, key steps, and conversion decisions during the conversion process to form a conversion log and conversion report for the referenced project PC;
[0128] xix. Check again whether the current project Pc has completed the conversion, and conclude that it has;
[0129] xx. Then determine whether the current project Pc is the main project, and conclude that it is not;
[0130] xxi. Set the main project Pb from the previous conversion of Pc as the current project;
[0131] xxii. Determine if there are any referenced projects in Pb that have not yet started conversion, and conclude that they do not exist; xxiii. Determine if the current project Pb has completed conversion, and conclude that the conversion has not been completed;
[0132] xxiv. Perform model validation on the current project file Pb;
[0133] xxv. Create an empty target project file Pbs;
[0134] xxvi. Extract data from the source project file Pb and complete the creation of resource objects and model data in the target project Pbs;
[0135] xxvii. Verify and optimize the model data in the target project file PBS;
[0136] xxviii. Record information such as exceptions, errors, key steps, and conversion decisions during the conversion process to form a conversion log and conversion report for the referenced project Pb;
[0137] xxix. Check again whether the current project Pb has completed the conversion, and conclude that it has;
[0138] xxx. Then determine whether the current project Pb is the main project, and conclude that it is not;
[0139] xxxi. Set the main project PA from the previous conversion of the source project Pb as the current project;
[0140] xxxii. Determine if the current project PA has any referenced projects that have not yet started conversion, and conclude that no;
[0141] xxxiii. Determine whether the current project PA has completed the conversion, and conclude that it is not;
[0142] xxxiv. Validate the PA model of the current project file;
[0143] xxxv. Creates an empty target project file PAs;
[0144] xxxvi. Extract data from the current project file PA to complete the creation of the target project file PAs resource objects and model data;
[0145] xxxvii. Verify and optimize the target project files (PAs);
[0146] xxxviii. Record information such as exceptions, errors, key steps, and conversion decisions during the conversion process to form a conversion log and conversion report for the referenced project PAs;
[0147] xxxix. Determine whether the current project PAs has completed the conversion, and conclude that it has;
[0148] xl. Determine whether the current project PAs is the main project, and conclude that it is;
[0149] The conversion of the main project PA and its referenced projects Pb and Pc has been completed and is now finished.
[0150] c) Figure 5 Engineering reference relationships are represented by C Example of conversion:
[0151] Figure 5 Engineering reference relationship expression C The main project is PA, which references a project Pb, which in turn references Pc. Pb is unaware of being referenced by the main project PA, Pc is unaware of being referenced by Pb, and PA is unaware of being referenced by Pc. These three project files form a circular reference. When a user performs a conversion on PA, the specific steps are the same as... Figure 4 The examples of conversions in engineering reference relationships are consistent.
[0152] d) Figure 6 Engineering reference relationship representation D Example of conversion:
[0153] Figure 6 Engineering reference relationship expression DThe main project is PA, which references two other projects, Pb and Pc. Pb references Pc, and Pc references Pb. Pb and Pc are unaware of being referenced by the main project PA; Pc is unaware of being referenced by Pb, and Pb is unaware of being referenced by Pc. When a user performs a conversion on PA, the specific steps are the same. Figure 4 The examples of conversions in engineering reference relationships are consistent.
[0154] Converting a project file created using one UML-based modeling tool to one supported by another UML-based modeling tool offers several advantages, including: improved software compatibility, enhanced team collaboration and knowledge sharing, reduced conversion costs and technical barriers, and support for rapid iteration and agile development. Specifically:
[0155] a) Improve software compatibility
[0156] i. Improved interoperability: Conversion tools enable files created by different UML modeling tools to be compatible, thereby improving interoperability between different software.
[0157] ii. Elimination of technical barriers: Through format conversion, technical barriers caused by different tools are eliminated, enabling project members to work without barriers using the tools most suitable for them.
[0158] iii. Long-term archiving: Conversion tools also help preserve project files for the long term, maintaining readability and editability even if some tools are no longer supported in the future.
[0159] b) Promote teamwork and knowledge sharing
[0160] i. Cross-team collaboration: Transformational capabilities enable teams using different modeling tools to more easily share and understand each other's work.
[0161] ii. Improved project management efficiency: In project management, switching tools can help project managers better track the project design and implementation process, even across different tools and platforms.
[0162] iii. Knowledge Transfer: Transformation tools can also help transfer knowledge within the team, allowing new members to quickly get started and understand previous design decisions and logic.
[0163] c) Reduce conversion costs and technical barriers
[0164] i. Resource saving: Automating the conversion process can save the time and manpower required for manual conversion and avoid tedious repetitive work.
[0165] ii. Reduce the learning curve: New team members do not need to spend a lot of time learning how to use specific tools; they can quickly adapt to project requirements by switching tools.
[0166] iii. Avoid redundant work: In different stages or types of analysis, there is no need to repeatedly build models due to tool limitations, reducing unnecessary work.
[0167] d) Supports rapid iteration and agile development
[0168] i. Rapid prototyping: The conversion tool supports the rapid creation and modification of models from different modeling tools, which helps meet the requirements of rapid iteration and prototyping in agile development.
[0169] ii. Responding to Change: When requirements change, transformation tools can help teams adapt quickly to changes and use new modeling tools to work better.
[0170] In conclusion, this patent not only optimizes the workflow for individuals and teams using different UML-based modeling tools, but also has a positive impact on the entire modeling ecosystem. From improving productivity to promoting technological innovation, this patent has significant practical value and broad application prospects in the field of modeling.
[0171] For ease of description, spatial relative terms such as "above," "on top of," "on the upper surface of," "above," etc., are used herein to describe the spatial positional relationship of a device or feature as shown in the figures to other devices or features. It should be understood that spatial relative terms are intended to encompass different orientations in use or operation beyond the orientation of the device as described in the figures. For example, if the device in the figures were inverted, a device described as "above" or "on top of" other devices or structures would subsequently be positioned as "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below." The device may also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatial relative descriptions used herein will be interpreted accordingly.
[0172] Furthermore, it should be noted that the use of terms such as "first" and "second" to define components is merely for the purpose of distinguishing the corresponding components. Unless otherwise stated, the above terms have no special meaning and therefore should not be construed as limiting the scope of protection of this invention.
[0173] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for converting heterogeneous model files based on UML specifications, characterized in that, The method for converting heterogeneous model files based on UML specifications includes: Step 1: Parse the current project file and mark it as being converted; Step 2: Analyze the current project files; Step 3: Determine if there are any referenced projects in the current project file that have not yet started conversion. If there are no referenced projects that have not yet started conversion, proceed to the next step. If there are referenced projects that have not yet started conversion, set an unresolved referenced project as the current project file, and repeat Step 1 and Step 2 until there are no referenced projects that have not yet started conversion. Step 4: Determine if the current project has completed the conversion. If the current project has not completed the conversion, proceed to the next step. If the current project has completed the conversion, determine if the current project is the main project. If so, end the file conversion. If the current project is not the main project, set the previously converted project of the current project as the current project and proceed to Step 3. Step 5: Perform model verification on the current project file; Step 6: Create an empty target project file; Step 7: Extract data from the current project file to create resource objects and model data for the target project file; Step 8: Verify and optimize the target project and model; Step nine: Record the conversion log, then proceed to step four until the file conversion is complete.
2. The method for converting heterogeneous model files based on UML specifications according to claim 1, characterized in that, In step one, parsing the current project file specifically includes: Read the contents of the current project file, access the file system, and load the file content; Identify file type and encoding, determine file format. If it is a compressed package, decompress it and read the information of each file in the package, and call the corresponding tool plugin to read its content. If it is a specific special format, write specific special code to read its content. Choose a suitable parser to parse the file; Convert the file content into a data structure object.
3. The method for converting heterogeneous model files based on UML specifications according to claim 2, characterized in that, In step two, analyzing the current project file specifically includes: Analyze the referenced project information contained in the current project file to confirm the relationship between the referenced projects and whether there are circular references, so as to facilitate the confirmation of the conversion path when performing the conversion later; Traverse the entire project file and categorize it according to its resource type; Determine the correspondence between elements and other information objects in the current project file and the target project. If such a correspondence does not exist, record the deficiency in the conversion system. Similarly, if the various necessary information required to create the target project does not exist in the source project or cannot be automatically supplemented, record the deficiency in the conversion system. Identify and process parts of the current project files that do not conform to UML specifications, and identify and process parts that do not conform to the business logic of the target project.
4. The method for converting heterogeneous model files based on UML specifications according to claim 3, characterized in that, Step five, specifically the model verification of the current project file, includes: Check the consistency of the current project files to ensure that there are no missing or incorrect element references, and that no missing references to project files or system resources are found. Verify that the UML model in the source project file conforms to the version and configuration file of the UML specification supported by the target tool; Ensure that all model elements and project information necessary for creating the target project exist and are valid.
5. The method for converting heterogeneous model files based on UML specifications according to claim 4, characterized in that, In step six, creating an empty target project file specifically includes: Initialize an empty target project file; Set the basic properties of the target project file.
6. The method for converting heterogeneous model files based on UML specifications according to any one of claims 1 to 5, characterized in that, In step seven, extracting data from the current project file to create the target project file resource object and model data specifically includes: Construct the various resource objects necessary for the target project file and set their resource URIs; The process involves recursively parsing the corresponding resources from the current project in the order of referenced project resources, semantic model resources, graphical model resources, and other resources, and simultaneously creating them in the target resources. However, the basic attributes and reference attributes are not set at the beginning; instead, this hierarchical structure is built according to the parent-child structure inclusion relationship. After the nodes corresponding to this resource hierarchy are constructed, the basic and reference attributes are recursively set from the root node element. When a reference attribute is set on an element that has not yet been created, a waiting task is generated. This task is executed after the element is created.
7. The method for converting heterogeneous model files based on UML specifications according to claim 6, characterized in that, In step eight, verifying and optimizing the target project and model specifically includes: Check the converted target project file for redundant or inconsistent model data; Ensure that all elements and relationships conforming to the UML specifications of the OMG object management organization are correctly converted and logically consistent; Ensure that all graphical elements conforming to the OMG Object Management Organization's DI specifications are correctly converted and logically consistent; The model is optimized to improve readability and ease of subsequent maintenance.
8. The method for converting heterogeneous model files based on UML specifications according to claim 7, characterized in that, In step nine, recording the conversion log specifically includes: Record the key steps and decision points in the transformation process; Record any errors or warnings, along with the corrective actions taken; Provide a summary report of the conversion process.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method for converting heterogeneous model files based on UML specifications as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for converting heterogeneous model files based on UML specifications as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method and system for constructing SCA model engineering through XML file
CN117874393A
Shareable, bidirectional mechanism for conversion between object model and XML
US20080010629A1