Method and system for converting heterogeneous model file based on UML specification
Through a UML specification-based transformation method, model interoperability between different modeling tools is achieved, poor interoperability in the prior art is solved, design efficiency and quality is improved, and model multiplexing and rapid iteration are supported.
Patent Information
- Application Number
- CN202411799202.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-09
AI Technical Summary
In the prior art, the interoperability and standardization transmission of data and models are poor among different modeling tools, which affects the efficiency and quality of the entire design process.
Provide a method to convert heterogeneous model files based on UML specifications. Through steps such as parsing, analysis, model verification, target project file creation, verification and optimization, intelligent mapping between metamodels and automated conversion processes are realized.
It solves the problem of poor data and model interoperability between different modeling tools, improves the efficiency and quality of the design process, supports model reuse, and reduces conversion costs and technical thresholds.
Smart Images

Figure CN119937985A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of application and development of model-based systems engineering (MBSE), system modeling language (SysML) and unified modeling language (UML), and in particular to a method and system for converting heterogeneous model files based on UML specifications. Background Art
[0002] MBSE is a method that uses digital models to support the entire life cycle of a system, from conceptual design to verification and confirmation work until the end. Compared with traditional text-based manual processes, MBSE uses digital modeling and simulation to design systems to improve efficiency and accuracy. When dealing with complex systems, such as aerospace, automotive, defense, and telecommunications, MBSE can clearly represent the complex relationships between systems and continuously optimize their performance through simulation and other means.
[0003] SysML, as one of the three pillars of MBSE (language, tools, methodology), is a graphical modeling language that extends UML to be used specifically for systems engineering. SysML provides at least nine Figure 1 SysML not only supports the graphical representation of system requirements, but also helps maintain the relationship between requirements, design, analysis and verification.
[0004] In the field of software engineering and related fields such as system engineering, Unified Modeling Language (UML), System Modeling Language (SysML), Process Modeling Language (BPMN), Architecture Modeling Language (UAF), The Open Group Architecture Framework Language (TOGAF), etc. are widely used in various fields of design and analysis standardized 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 engineering files between modeling tools of different manufacturers. The existing interoperability and standardized transfer of data and models between different modeling tools are poor, affecting the efficiency and quality of the entire design process. Summary of the invention
[0005] The present invention provides a method and system for converting heterogeneous model files based on UML specifications, which can solve the technical problem in the prior art that different modeling tools have poor interoperability and standardized transmission of data and models, 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 for converting heterogeneous model files based on UML specifications includes: step 1, parsing the current project file and marking the current project file as being converted; step 2, analyzing the current project file; step 3, judging whether the current project file has a reference project that has not started conversion, if there is no reference project that has not started conversion, then going to the next step; if there is a reference project that has not started conversion, then setting an unparsed reference project as the current project file, repeating steps 1 and 2 until there is no reference project that has not started conversion; step 4, judging when Check whether the previous project has completed the conversion. If the current project has not completed the conversion, go 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 previous converted project of the current project as the current project, and go 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 the target project file resource object and model data; step eight, verify and optimize the target project and model; step nine, record the conversion log, and go to step four until the file conversion is completed.
[0007] Furthermore, in step one, parsing the current project file specifically includes: reading the content of the current project file, accessing the file system, and loading the file content; identifying the file type and encoding, determining the file format, if it is a compressed package, then decompressing it and reading the information of each file in the package, calling the corresponding tool plug-in to read its content, if it is a specific dedicated format, then writing a specific dedicated code to read its content; selecting a suitable parser to parse the file; converting the file content into a data structure object.
[0008] Furthermore, in step 2, analyzing the current project file specifically includes: analyzing the referenced project related information contained in the current project file, confirming the relationship between the referenced projects and whether there is a circular reference, so as to facilitate the confirmation of the conversion path when the conversion is subsequently performed; traversing the entire project file and distinguishing them according to their resource types; determining the correspondence between the elements and other information objects in the current project file and the target project. If such a correspondence does not exist, the missing 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 is recorded in the conversion system; identifying and processing the parts of the current project file that do not conform to the UML specification, and identifying and processing the 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 ensuring that there are no lost referenced project files or system resources; verifying whether the UML model of the source project file complies with the version and configuration file of the UML specification supported by the target tool; and determining that the model elements and project information required to create 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 basic properties of the target project file.
[0011] Furthermore, in step seven, extracting data from the current project file to create the target project file resource object and model data specifically includes: constructing various resource objects required for the target project file and setting their resource URIs; recursively parsing the corresponding resources of the current project in the order of referencing project resources, semantic model resources, graphic model resources and other resources and synchronously creating them in the target resources, but not setting their basic properties and reference properties first, but only constructing this hierarchical structure according to the parent-child structure inclusion relationship; after the construction of each node element corresponding to this resource hierarchy, recursively setting its basic properties and reference properties from the root node element, when a reference property sets an element Element that has not been created, a waiting task can be generated, and the execution time of this task is after the creation of this Element element.
[0012] Furthermore, in step eight, verifying and optimizing the target project and model specifically includes: checking whether the converted target project file has redundant or inconsistent model data; ensuring that all elements and relationships that comply with the UML specification of the OMG Object Management Group are correctly converted and logically consistent; ensuring that all graphic elements that comply with the DI specification of the OMG Object Management Group are correctly converted and logically consistent; optimizing the model to improve readability and convenience of subsequent maintenance.
[0013] Furthermore, in step nine, recording the conversion log specifically includes: recording the key steps and decision points in the conversion process; recording any error or warning information, and 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, comprising 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. When the computer program is executed by a processor, the steps of the method for converting heterogeneous model files based on UML specifications are implemented as described above.
[0016] The technical solution of the present invention is applied to provide a method for converting heterogeneous model files based on UML specifications. The technical problem to be solved by the method is mainly to realize the interoperability and standardized transmission of data and models between different modeling tools, so as to improve the efficiency and quality of the whole design process. The method can realize intelligent mapping between metamodels, automatic conversion process, automatic processing of reference engineering, compatibility and error handling, and the converted target model is model verified and tested, and the security of the source engineering is ensured, and third-party developers can make it more flexible through configuration and expansion. Therefore, compared with the prior art, the method for converting heterogeneous model files based on UML specifications provided by the present invention solves the problem of incompatibility of engineering files created by modeling tools of existing manufacturers, supports the reuse of models by automatically converting engineering files generated by heterogeneous modeling tools, improves the implementation efficiency and quality of modeling engineers, improves the compatibility of software, promotes team collaboration and knowledge sharing, reduces conversion costs and technical barriers, and supports rapid iteration and agile development. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The included drawings are used to provide a further understanding of the embodiments of the present invention, which constitute a part of the specification, are used to illustrate the embodiments of the present invention, and together with the text description, explain the principles of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 A schematic diagram of the overall architecture of a conversion tool provided according to a specific embodiment of the present invention is shown;
[0019] Figure 2 A schematic diagram of a 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 an engineering reference relationship representation B provided according to a specific embodiment of the present invention is shown;
[0022] Figure 5 A schematic diagram C showing an engineering reference relationship provided in accordance with a specific embodiment of the present invention is shown;
[0023] Figure 6 A schematic diagram D showing an engineering reference relationship provided according to a specific embodiment of the present invention is shown. DETAILED DESCRIPTION
[0024] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments in 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.
[0025] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0026] Unless otherwise specifically stated, the relative arrangement of the parts and steps described in these embodiments, numerical expressions and numerical values do not limit the scope of the present invention. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the accompanying drawings are not drawn according to the actual proportional relationship. The technology, method and equipment known to ordinary technicians in the relevant field may not be discussed in detail, but in appropriate cases, the technology, method and equipment should be regarded as a part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once a certain item is defined in an accompanying drawing, it does not need to be further discussed in subsequent drawings.
[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. The method for converting heterogeneous model files based on UML specifications includes: step 1, parsing the current project file and marking the current project file as being converted; step 2, analyzing the current project file; step 3, judging whether there is a reference project in the current project file that has not started conversion, if there is no reference project that has not started conversion, then going to the next step; if there is a reference project that has not started conversion, then setting an unparsed reference project as the current project file, repeating steps 1 and 2 until there is no reference project that has not started conversion; step 4, Determine whether the current project has completed the conversion. If the current project has not completed the conversion, go 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 previous converted project of the current project as the current project, and go 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 the target project file resource object and model data; step eight, verify and optimize the target project and model; step nine, record the conversion log, and go to step four until the file conversion is completed.
[0028] By applying this configuration mode, a method for converting heterogeneous model files based on UML specifications is provided. The technical problem to be solved by the method is mainly to realize the interoperability and standardized transmission of data and models between different modeling tools, thereby improving the efficiency and quality of the entire design process. The method can realize intelligent mapping between metamodels, automated conversion process, automatic processing of reference engineering, compatibility and error handling, and the converted target model undergoes model verification and testing, and ensures the security of the source engineering, and third-party developers can make it more flexible through configuration and expansion. Therefore, compared with the prior art, the method for converting heterogeneous model files based on UML specifications provided by the present invention solves the problem of incompatibility of engineering files created by existing modeling tools of various manufacturers, supports the reuse of models by automating the conversion of engineering files generated by heterogeneous modeling tools, improves the implementation efficiency and quality of modeling engineers, improves the compatibility of software, promotes team collaboration and knowledge sharing, reduces conversion costs and technical thresholds, and supports rapid iteration and agile development.
[0029] The present invention aims to solve the problem of converting an engineering file based on UML specifications (or SysML, BPMN, TOGAF, UAF, etc.) created by different modeling tools into an engineering file supported by a modeling tool of another manufacturer.
[0030] The overall architecture of the technical solution conversion tool expressed in the present invention is as follows Figure 1As shown, the conversion tool finally implemented by the present invention can be an independent application or script, or a functional plug-in based on the target modeling tool. The final implementation of the present invention may not require the source modeling tool application and the target modeling tool, but can use the (source or target) modeling tool or the API provided by it to reduce the workload of the implementation development of the present invention.
[0031] The process of converting a project file source created by a modeling tool based on the UML standard specification into a project file target supported by another manufacturer's modeling tool also based on the UML standard specification is as follows: Figure 2 As shown, it includes but is not limited to the following main steps:
[0032] Step 1: Parse the current project file and mark it as being converted. In step 1, parsing the current project file specifically includes: reading the content of the current project file, accessing the file system, and loading the file content; identifying the file type and encoding, determining the file format, if it is a compressed package, then decompress it and read the information of each file in the package, calling the corresponding tool plug-in to read its content, if it is a specific dedicated format, then you can write a specific dedicated code to read its content; select a suitable parser to parse the file; convert 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, and 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 in the format of xml, xmi, etc., call the corresponding tool plug-in to read its content. If it is a specific dedicated format, you can write a specific dedicated code to read its content.
[0036] (1.3) Choose a suitable parser, such as DOM or SAX parser, to parse the XML file according to the file type.
[0037] (1.4) Convert to data structure. Generally, all kinds of project files can be abstracted into a Project object. This Project object should contain the project name, file path, the name and type of the file resources that are decompressed or directly contained. Convert the file content into a data structure suitable for processing, such as tree, graph and other data structure objects. Below the project level, there is generally a concept of resources, mainly including semantic model resources, chart model resources, referenced project model resources, and other resources. Data below the concept of resources can be abstracted into model objects that follow the concept of metamodel. Specifically, for example, the xxx.mdzip or xxx.sds file of MagicDraw or Arch modeling tools is actually a compressed package with multiple files. These files generally include xxx.project files, xxx.model, xxx.notation files, etc. (the suffixes of the persistent files of the same type of resources obtained after decompression of project files of different modeling tools are generally different). These files are used to persist 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" that are not generated by the tools themselves (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 structures", and then the intermediate objects are converted into "resource objects" that can be directly recognized by the modeling tools.
[0038] Further, after parsing the current project file, the current project file can be analyzed. Specifically, in step 2, analyzing the current project file specifically includes: analyzing the referenced project related information contained in the current project file, confirming the relationship between the referenced projects and whether there is a circular reference, so as to facilitate the confirmation of the conversion path when the conversion is performed later; traversing the entire project file and distinguishing them according to their resource types; determining the corresponding relationship between the elements and other information objects in the current project file and the target project, if such a corresponding relationship does not exist, then record such missing in the conversion system, and similarly, if the various necessary information required to create the target project does not exist in the source project, or cannot be automatically supplemented, then record such missing in the conversion system; identifying and processing the parts of the current project file that do not conform to the UML specification, and identifying and processing the 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 referenced project information contained in the source project, confirm the relationship between the referenced projects and whether there is a circular reference, so as to facilitate the confirmation of the conversion path when performing the conversion later. For example, MagicDraw is used to create two projects a.mdzip and b.mdzip. We reference b.mdzip in project a.mdzip. Generally, we call b a referenced project, that is, b is a referenced project of a. That is, b is referenced by a.
[0041] (2.2) Element traversal and classification, traverse the entire project file, and distinguish according to its resource type, such as semantic elements (including UML elements and various extended dynamic objects, etc.), diagram elements (i.e., graphical expressions of UML\SysML and other elements on the diagram), referenced project information, and other resource information. In the present invention, semantic elements, diagram elements, referenced project information, and other resource information can be understood as different resource types. The resource (Resource) object can be understood as a container, and element objects of the same type (or similar type), such as semantic elements, are managed in the UMLResource resource object, and diagram elements are generally managed in the NotationResource resource object. Other resource information generally varies according to the development 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 necessary resource information specified by standard specifications (such as OMG's UML / SysML specifications), but are established by various development tools to facilitate development or optimization of projects.
[0042] (2.3) Relationship mapping, determine the corresponding relationship between the elements and other information objects in the source project and the target project ("elements" generally refer to semantic elements and graphic elements, and "other information objects" refer to other objects that need to be converted except elements, such as project information objects, including project IDs, referenced project information, etc.). If such a corresponding relationship does not exist, then the missing 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, then the missing is recorded in the conversion system. In the present invention, it is necessary to determine the corresponding relationship between all elements and information objects in the source project and the target project. For example, a UML element type name in the source project is "StandardPort", and the type name in the target project that complies with the OMG specification is "Port". A mapping relationship is required between them, and 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 extensions or custom elements that require special processing; identify and handle parts that do not conform to the business logic of the target project, such as a Stereotype ancestor node that does not have a Profile. There are many situations that do not conform to the business logic of the target project, and generally need to be treated accordingly. 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 a Profile type or a Profile ancestor node can be added to the Stereotype element. b) The type of a Property element is set to a type that does not conform to the constraints of the target project element. You can replace elements of similar types or choose to ignore the setting. c) 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. In this case, you can set it under other attributes that can be placed on this element or under appropriate attributes of other elements according to the specific attribute. If it cannot be placed but cannot be ignored, it can also be solved through meta-annotations or xmi:Extension extensions.
[0044] Further, after analyzing the current project file, it can be determined whether there is a reference project in the current project file that has not started conversion. If there is no reference project that has not started conversion, go to the next step; if there is a reference project that has not started conversion, set an unresolved reference project as the current project file, and repeat the steps 1 and 2 until there is no reference project that has not started conversion.
[0045] Next, determine whether the current project has completed the conversion. If the current project has not completed the conversion, go 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 go to step three.
[0046] Then, the model verification of the current project file is performed. In step five, the model verification of the current project file specifically includes: checking the consistency of the current project file, ensuring that there are no missing or incorrect element references, and ensuring that there are no lost referenced 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 required to create the target project exist and are valid.
[0047] Furthermore, after the model verification is performed on the current project file, an empty target project file can be created. In 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; setting basic properties of the target project file, such as name, author, creation date and other information.
[0048] After creating an empty target project file, data can be extracted from the current project file to create the target project file resource object and model data. In step seven, extracting data from the current project file to create the target project file resource object and model data specifically includes: constructing various resource objects (Resource) required for the target project file and setting its resource URI; recursively parsing the corresponding resources of the current project in the order of reference project resources, semantic model resources, graphic model resources and other resources and synchronously creating them in the target resources, but not setting their basic attributes and reference attributes first, but only constructing this hierarchical structure according to its parent-child structure inclusion relationship (you can refer to whether the meta-attribute defined by its meta-model is true, that is, the result of isContainment() of EstructuralFeature is returned as true); after the construction of each node element corresponding to this resource hierarchy, recursively set its basic attributes and reference attributes from the root node element. When a reference attribute sets an element Element that has not been created, a waiting task can be generated. The execution time of this task is after the creation of this Element element.
[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 has redundant or inconsistent model data; ensuring that all elements and relationships that comply with the UML specification of the OMG Object Management Organization are correctly converted and logically consistent; ensuring that all graphic elements that comply with the DI specification of the OMG Object Management Organization are correctly converted and logically consistent; optimizing the model to improve readability and convenience for subsequent maintenance. As a specific embodiment of the present invention, after converting from a Source project to a Target project, there may be some Source-related models in the semantic model that are irrelevant to the actual business of the current model, which can be optimized and removed, including but not limited to removing references to several Source-specific Profiles, ModelLibraries, etc. These businesses require targeted optimization processing based on the different types of source projects and target projects.
[0050] After completing the verification and optimization of the target project and model, you can record the conversion log and go to step 4 until the file conversion is completed. In step 9, recording the conversion log specifically includes: recording the key steps and decision points in the conversion process (key steps include Figure 2 The rectangular steps of the conversion process and the steps to convert a target project. The decision points include Figure 2 The diamond selection decision points in the conversion process and the decisions made by different systems based on contextual conditions when converting a target project); record any error or warning messages and the solutions taken; provide a summary report of the conversion process, including time consumption, success rate and any matters that need attention.
[0051] In summary, after completing the above steps, you should ensure that the target project file can be opened correctly in the target modeling tool and that all model elements display and function normally as expected.
[0052] According to another aspect of the present invention, a computer device is provided, comprising 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. When the computer program is executed by a processor, the steps of the method for converting heterogeneous model files based on UML specifications are implemented as described above.
[0054] In order to further understand the present invention, the following Figures 1 to 6 The method for converting UML-based heterogeneous model files provided by the present invention is described in detail.
[0055] Due to different project requirements or team preferences, it may be necessary to convert engineering files between modeling tools from different vendors. This raises the need for an innovative solution: how to convert an engineering file (source) created by a modeling tool based on the UML specification into an engineering file (target) supported by another modeling tool also based on the UML specification. The method provided by the present invention comprises: step 1, parsing the current project file, and marking the current project file as being converted; step 2, analyzing the current project file; step 3, judging whether there is a reference project that has not started conversion in the current project file, and if there is no reference project that has not started conversion, going to the next step; if there is a reference project that has not started conversion, setting an unparsed reference project as the current project file, repeating steps 1 and 2 until there is no reference project that has not started conversion; step 4, judging whether the current project has completed conversion, and if the current project has not completed conversion, going to the next step; if the current project has completed conversion, judging whether the current project is a main project, and if so, ending file conversion; if the current project is not a main project, setting the previous project being converted of the current project as the current project, and going 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 a target project file resource object and model data; step 8, verifying and optimizing the target project and model; step 9, recording a conversion log, and going to step 4 until the file conversion is completed.
[0056] The innovative features of the present invention include the following aspects:
[0057] a) Automated conversion process: Develop an automated tool or script that can read the UML, SysML, BPMN, UAF, TOGAF definitions of the source file and convert 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 the details of elements, relationships and attributes, but also various primitives in the diagram and their nested relationships, coordinate positions and sizes.
[0058] b) Intelligent mapping between meta-models: Innovatively implement intelligent mapping between the meta-models of the source and target engineering files. This means not only establishing a one-to-one correspondence between model elements, but also understanding the different implementations of the same UML / SysML concept in different tools and being able to adapt to these differences.
[0059] c) User-friendly interface: The conversion tool provides an intuitive user interface that allows users to easily specify conversion parameters, select elements to be converted, and customize various options during the conversion process. This reduces the user's learning curve and enables even non-professionals to perform efficient model conversion.
[0060] d) Automatic processing of referenced projects: The conversion tool can automatically process referenced project files containing complex nesting and reference relationships, and through certain algorithms, it can properly solve the problem of circular references between projects.
[0061] e) Compatibility and error handling: Ability to intelligently identify and handle incompatibility issues and potential conversion errors, such as giving prompts or automatically applying the best alternative when certain features in the source file have no direct corresponding representation in the target tool.
[0062] f) Extensibility and plug-in support: The conversion tool provides an extensible 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 verification and testing: Provides model verification function to ensure that the converted model is not only grammatically correct but also semantically faithful to the original model. At the same time, an automated testing mechanism is integrated to ensure 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 a project file created by a modeling tool based on the UML specification into a project file supported by another modeling tool based on the UML specification lies in its ability to achieve intelligent mapping between meta-models, automated conversion process, automatic processing of referenced projects, user-friendly interface, compatibility and error handling. The converted target model undergoes model verification and testing, and ensures the security of the source project. Third-party developers can configure and extend it to have more flexibility.
[0066] The following is based on Figure 2 The conversion process of expression Figures 3 to 6 Here is an example of converting the source project PA expressed in the expression. PA represents the source project that contains the referenced project. Because it is the main project entrance, the letter A is capitalized. Pb and Pc represent the referenced project. The parent project that references it is in Figures 3 to 6 It varies in different scenarios. There may be multiple parent project nodes, or there may be circular references.
[0067] a) Figure 3 Project reference relationship indicates A Conversion example:
[0068] Figure 3 Project reference relationship expression A The main project is PA, which references two reference projects Pb and Pc. There is no mutual reference relationship between Pb and Pc, and Pb and Pc are insensitive to being referenced by the main project PA. When the user converts PA, follow the steps below:
[0069] i. First, parse the project file PA and mark the status of PA as being converted in the conversion tool;
[0070] ii. Analyze engineering documents PA;
[0071] iii. Determine whether the current project PA has any referenced projects that have not started conversion, and conclude that they do exist;
[0072] iv. Set the unresolved reference project Pb as the current project;
[0073] v. Parse the referenced project Pb and mark the status of Pb as being converted in the conversion tool;
[0074] vi. Analyze the project file Pb;
[0075] vii. Determine whether Pb has a referenced project that has not started conversion, and conclude that it does not exist; viii. Determine whether the current project file Pb has completed conversion, and conclude that it has not been completed;
[0076] ix. Perform model verification 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 the exceptions, errors, key steps, conversion decisions and other information during the conversion process to form a conversion log and conversion report for the reference 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. Set the main project PA in the previous conversion of Pb as the current project;
[0084] xvii. Determine whether PA has a reference project that has not started conversion, and conclude that there is an unconverted reference project Pc;
[0085] xviii. Set the unresolved reference project Pc as the current project;
[0086] xix. Parse the referenced project Pc and mark the status of Pc as being converted in the conversion tool;
[0087] xx. Analyze engineering files Pc;
[0088] xxi. Determine whether the current project Pc has a referenced project that has not started conversion, and conclude that it does not exist;
[0089] xxii. Determine whether the current project Pc has completed the conversion and obtain the conclusion that the conversion is not 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. Verify and optimize the model data in the target project file Pcs;
[0094] xxvii. Record the abnormalities, errors, key steps, conversion decisions and other information during the conversion process to form the conversion log and conversion report of the reference project PC;
[0095] xxviii. Determine again whether the current project Pc has completed the conversion and conclude that it has;
[0096] xxix. Then determine whether the current project Pc is the main project and conclude that it is not;
[0097] xxx. Set the main project PA in the previous conversion of the source project Pc as the current project;
[0098] xxxi. Determine whether the current project PA has a referenced project that has not started conversion, and conclude that it is not;
[0099] xxxii. Determine whether the current project PA has completed the conversion and conclude that it has not;
[0100] xxxiii. Verify the PA model of the current project file;
[0101] xxxiv. Create an empty target project file PAs;
[0102] xxxv. Extract 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 engineering files PAs;
[0104] xxxvii. Record the exceptions, errors, key steps, conversion decisions and other information during the conversion process to form a conversion log and conversion report for the reference engineering PAs;
[0105] xxxviii. Determine whether the current project PAs has completed the conversion and conclude that it is;
[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 completed and the conversion is finished.
[0108] b) Figure 4 Example of project reference relationship B conversion:
[0109] Figure 4 Project reference relationship expression B The main project is PA, which references two reference projects Pb and Pc. Pb references Pc, and Pb and Pc are insensitive to the reference of the main project PA, and Pc is insensitive to the reference of Pb. When the user converts PA, follow the steps below:
[0110] i. First, parse the project file PA and mark the status of PA as being converted in the conversion tool;
[0111] ii. Analyze engineering documents PA;
[0112] iii. Determine whether the current project PA has any referenced projects that have not started conversion, and conclude that they do exist;
[0113] iv. Set the unresolved reference project Pb as the current project;
[0114] v. Parse the referenced project Pb and mark the status of Pb as being converted in the conversion tool;
[0115] vi. Analyze the project file Pb;
[0116] vii. Determine whether Pb has any referenced projects that have not started conversion, and conclude that they do exist;
[0117] viii. Set the unresolved reference project Pc as the current project;
[0118] ix. Parse the referenced project Pc and mark the status of Pc as being converted in the conversion tool;
[0119] x. Parse the project file Pc and mark the status of Pc as being converted in the conversion tool;
[0120] xi. Analyze the current project Pc;
[0121] xii. Determine whether the current project Pc has a referenced project that has not started conversion, and conclude that it does not exist;
[0122] xiii. Determine whether the current project file Pc has completed conversion and conclude that it is not completed;
[0123] xiv. Perform model verification on the current project file Pc;
[0124] xv. Create an empty target project file Pcs;
[0125] xvi. Extract data from the source project file Pc and create the corresponding resource objects and model data in the target project file Pcs;
[0126] xvii. Verify and optimize the model data in the target project file Pcs;
[0127] xviii. Record the abnormalities, errors, key steps, conversion decisions and other information during the conversion process to form a conversion log and conversion report for the reference project PC;
[0128] xix. Determine 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 in the previous conversion of Pc as the current project;
[0131] xxii. Determine whether Pb has a referenced project that has not started conversion, and conclude that it does not exist; xxiii. Determine whether the current project Pb has completed conversion, and conclude that the conversion has not been completed;
[0132] xxiv. Perform model verification 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 to 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 the exceptions, errors, key steps, conversion decisions and other information during the conversion process to form a conversion log and conversion report for the reference project Pb;
[0137] xxix. Determine 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 in the previous conversion of the source project Pb as the current project;
[0140] xxxii. Determine whether the current project PA has any referenced projects that have not started conversion, and conclude that no;
[0141] xxxiii. Determine whether the current project PA has completed the conversion and conclude that it has not;
[0142] xxxiv. Verify the PA model of the current project file;
[0143] xxxv. Create 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 target engineering files PAs;
[0146] xxxviii. Record the exceptions, errors, key steps, conversion decisions and other information during the conversion process to form a conversion log and conversion report for the reference engineering PAs;
[0147] xxxix. Determine whether the current project PAs has completed the conversion and conclude that it is;
[0148] xl. Determine whether the current project PAs is the main project and conclude that it is;
[0149] xli. The conversion of the main project PA and its referenced projects Pb and Pc is completed and the conversion is ended.
[0150] c) Figure 5 Project reference relationship representation C Conversion example:
[0151] Figure 5 Project reference relationship expression C The main project is PA, which references a reference project Pb, which in turn references Pc. Pb is unaware of the reference of the main project PA, Pc is unaware of the reference of Pb, and PA is unaware of the reference of Pc. The three project files form a circular reference. When the user converts PA, the specific steps are the same as Figure 4 The conversion examples for project reference relationships are consistent.
[0152] d) Figure 6 Project reference relationship representation D Conversion example:
[0153] Figure 6 Engineering reference relationship expression DThe main project is PA, which references two reference projects Pb and Pc. Pb references Pc, and Pc references Pb. Pb and Pc are insensitive to the reference of the main project PA, Pc is insensitive to the reference of Pb, and Pb is insensitive to the reference of Pc. When the user converts PA, the specific steps are the same as Figure 4 The conversion examples for project reference relationships are consistent.
[0154] Converting an engineering file created by a modeling tool based on the UML specification to an engineering file supported by another modeling tool based on the UML specification has the following beneficial effects: improving software compatibility, promoting team collaboration and knowledge sharing, reducing conversion costs and technical barriers, and supporting rapid iteration and agile development, as follows:
[0155] a) Improve software compatibility
[0156] i. Improved interoperability: Conversion tools can make files created by different UML modeling tools compatible, thereby improving the interoperability between different software.
[0157] ii. Elimination of technical barriers: Through format conversion, technical barriers caused by different tools are eliminated, allowing project members to work without obstacles using the tools that best suit them.
[0158] iii. Long-term archiving: Conversion tools also help preserve project files for a long time. Even if some tools are no longer supported in the future, the files can be kept readable and editable through conversion.
[0159] b) Promote team collaboration and knowledge sharing
[0160] i. Cross-team collaboration: Conversion capabilities make it easier for teams using different modeling tools to share and understand each other's work.
[0161] ii. Improved project management efficiency: In project management, conversion tools can help project managers better track project design and implementation progress, even across different tools and platforms.
[0162] iii. Knowledge transfer: Conversion tools can also help with knowledge transfer within the team, so that new members can quickly get started and understand previous design decisions and logic.
[0163] c) Reduce switching costs and technical barriers
[0164] i. Save resources: Automating the conversion process can save the time and human resources required for manual conversion and avoid complicated and repetitive work.
[0165] ii. Reduce the learning curve: For new team members, they do not need to spend a lot of time learning the operation of specific tools, and can quickly adapt to project requirements by switching tools.
[0166] iii. Avoid duplication of work: In different stages or different types of analysis, there is no need to repeatedly build models due to tool limitations, thus reducing unnecessary work.
[0167] d) Support rapid iteration and agile development
[0168] i. Rapid prototyping: Conversion tools support the conversion work of quickly creating and modifying models from different modeling tools, which helps the requirements of rapid iteration and prototyping in agile development.
[0169] ii. Respond to changes: When requirements change, conversion tools can help teams quickly adapt to changes and use new modeling tools to work better.
[0170] In summary, this patent not only optimizes the workflow of individuals and teams when using different UML-based modeling tools, but also brings positive impact to the entire modeling ecosystem. From improving production efficiency to promoting technological innovation, this patent has important practical value and broad application prospects in the field of modeling.
[0171] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used here to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" can include both "above" and "below". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.
[0172] In addition, it should be noted that the use of terms such as "first" and "second" to limit components is only for the convenience of distinguishing the corresponding components. If not otherwise stated, the above terms have no special meaning and therefore cannot be understood as limiting the scope of protection of the present invention.
[0173] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for converting heterogeneous model files based on UML specifications, characterized in that: The method for converting a heterogeneous model file based on the UML specification includes: Step 1: parse the current project file and mark the current project file as being converted; Step 2: Analyze the current project file; Step 3, determining whether there is a referenced project that has not started conversion in the current project file, if there is no referenced project that has not started conversion, go to the next step; if there is a referenced project that has not started conversion, set an unresolved referenced project as the current project file, repeat the steps 1 and 2 until there is no referenced project that has not started conversion; Step 4: determine whether the current project has completed the conversion. If the current project has not completed the conversion, go 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 previous converted project of the current project as the current project, and go to step 3; Step 5: Perform model verification on the current project file; Step 6: Create an empty target project file; Step 7, extracting data from the current project file to create a target project file resource object and model data; Step 8: Verify and optimize the target project and model; Step nine, record the conversion log, and go to step four until the file conversion is completed.
2. The method for converting heterogeneous model files based on UML specifications according to claim 1, characterized in that: In the step 1, parsing the current project file specifically includes: Read the contents of the current project file, access the file system, and load the file contents; Identify the file type and encoding, determine the file format, if it is a compressed package, read the information of each file in the package after decompression, call the corresponding tool plug-in to read its content, if it is a specific dedicated format, you can write a specific dedicated code to read its content; Select a suitable parser to parse the file; Convert the file contents into a data structure object.
3. The method for converting heterogeneous model files based on UML specifications according to claim 2 is characterized in that: In the step 2, analyzing the current project file specifically includes: Analyze the referenced project information contained in the current project file, confirm the relationship between the referenced projects and whether there is a circular reference, so as to facilitate the confirmation of the conversion path when performing the conversion later; Traverse the entire project file and distinguish them according to their resource types; Determine the correspondence between the elements and other information objects in the current project file and the target project. If such a correspondence does not exist, record the lack 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 lack in the conversion system. Identify and process the parts of the current project file that do not conform to the UML specification, and identify and process the 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 is characterized in that: In step 5, the model verification of the current project file specifically includes: Check the consistency of the current project files to ensure that there are no missing or incorrect element references, and that there are no missing referenced project files or system resources; Verify whether the UML model of the source project file conforms to the version and profile of the UML specification supported by the target tool; Make sure that the model elements and project information required to create the target project exist and are valid.
5. The method for converting heterogeneous model files based on UML specifications according to claim 4 is characterized in that: In step 6, 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 a target project file resource object and model data specifically includes: Construct various resource objects required for the target project file and set their resource URIs; Recursively parse the corresponding resources of the current project in the order of referencing project resources, semantic model resources, graphic model resources, and other resources, and create them synchronously in the target resources. However, do not set their basic properties and reference properties first, but only build this hierarchical structure according to the parent-child structure inclusion relationship. After the node elements corresponding to the resource hierarchy are constructed, the basic properties and reference properties are recursively set from the root node element. When a reference property is set to an element that has not been created, a waiting task can be generated. The execution time of this task is 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 whether the converted target project file has redundant or inconsistent model data; Ensure that all elements and relationships that comply with the OMG Object Management Group's UML specifications are converted correctly and logically consistent; Ensure that all graphic elements that comply with the OMG Object Management Group's DI specification are converted correctly 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: Document key steps and decision points during the transformation process; Record any error or warning messages and 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 the UML specification according to 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, the steps of the method for converting heterogeneous model files based on the UML specification as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Method for converting xUML4MC model into MSVL program, and computer program
CN108037913A
Micro-service design method and system based on business process model
CN113204331A
Method for converting target model into UML demand model
CN113655998A
Model conversion method for avionics system architecture analysis
CN115293111A
Method and device for converting MLIR file into PyTorch file, equipment and medium
CN117708075A
Cited By
UML (Unified Modeling Language) model fragment multiplexing method
CN121433655A