Modeling method and system supporting UML visualization and readable storage medium
By obtaining the association of graphic libraries, charts and symbols, generating canvases and dragging and dropping symbols to form graphic information, the problem that existing UML modeling tools cannot effectively object storage of UML primitive objects is solved, and UML visual modeling and UML model generation that complies with UML2.X standard is realized.
Patent Information
- Application Number
- CN202411920322.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-05-27
AI Technical Summary
Existing UML modeling tools cannot effectively store UML primitive objects and cannot clearly express the relationship between various UML objects.
By obtaining the association of the graphics library, charts and symbols, generating canvases and dragging and dropping symbols to form graphics information, storing and parsing graphics information to generate a UML model.
UML visual modeling is implemented, the visual UML model is parsed, and the generation of UML models that comply with the UML2.X standard specifications is supported.
Smart Images

Figure CN120045167A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of UML visual modeling, and particularly relates to a modeling method, a system, and a readable storage medium that support UML visualization. Background Art
[0002] The standard modeling language UML (Unified Modeling Language) is an object-oriented modeling standard language approved by the Object Management Group (OMG). Currently, mainstream foreign UML modeling tools such as Visio, Enterprise Architect, and Rational Rose are defined and operated from the user's perspective based on chart types. Modeling tools generally start from the most basic symbols or even a simple graphic, and expand vertically and horizontally based on the defined basic symbols, continuously increasing the complexity of the symbols, and improving the expression ability of the symbols through the combination of different symbols. In the traditional method, mainstream graphical modeling tools store the entire chart in the form of data in Extensible Markup Language (XML) or JavaScript Object Notation (JSON) format, and cannot store UML primitive objects objectually, and cannot clearly express the relationships between various UML objects.
[0003] Therefore, how to build a graphical modeling tool from the definition of basic symbols, from the bottom layer, and achieve UML visual modeling has become an urgent technical problem to be solved. Summary of the Invention
[0004] Embodiments of the present invention provide a modeling method that supports UML visualization.
[0005] Embodiments of the present invention provide a modeling system that supports UML visualization.
[0006] Embodiments of the present invention provide another modeling system that supports UML visualization.
[0007] Embodiments of the present invention provide a readable storage medium.
[0008] In view of this, a first aspect of the present invention provides a modeling method supporting UML visualization, including obtaining a graphics library, where the graphics library includes at least one symbol; obtaining a chart, associating the chart with the symbol to configure the required symbol for the chart; obtaining the symbol associated with the chart and generating a canvas corresponding to the chart; dragging the symbol to the canvas for drawing to form graphic information and a graphic corresponding to the graphic information; storing the graphic information in a database, and parsing the graphic corresponding to the graphic information to form a UML model.
[0009] Further, the graphics library uses the mxGraph graphics library to complete the drawing of basic symbols.
[0010] Further, the graphics library includes symbol categories, and the modeling method supporting UML visualization further includes: adding a new symbol in the graphics library, specifically including: adding a new symbol under the symbol category; determining whether the new symbol is an existing graphic in the mxGraph graphics library, if the determination is no, then registering the graphic by drawing a vector graphic according to the new symbol to determine the shape of the symbol; determining the style of the symbol based on the shape of the symbol; determining the graphic style information of the symbol based on the style of the symbol; determining the basic information of the symbol based on the graphic style information of the symbol; adding the basic information of the symbol to the graphics library to add a new symbol in the graphics library.
[0011] Further, the modeling method supporting UML visualization further includes: obtaining a chart directory; the step of associating the chart with the symbol to configure the required symbol for the chart includes: classifying the charts based on the chart directory; screening all symbols under the chart directory based on the chart directory where the chart is located to configure the required symbol for the chart.
[0012] Further, the symbol includes points, lines and graphs. The line represents the connection relationship between points, and the graph is a set of points and lines; among them, the association between points records the parent-child relationship of the points, and the parent node can contain multiple child nodes; the association between points and lines records the source vertex and target vertex of the line; the association between the graph and the symbol records all symbols included in the graph.
[0013] According to a second aspect of the present invention, a modeling system supporting UML visualization is provided, including: a graphics library module for storing symbols; a chart configuration library module for configuring basic charts of UML diagrams, specifically including: obtaining a chart, associating the chart with the symbol to configure the required symbol for the chart; a graphic modeling tool module for completing UML visualization modeling, specifically including: obtaining the symbol associated with the chart and generating a canvas corresponding to the chart, dragging the symbol to the canvas for drawing to form graphic information and a graphic corresponding to the graphic information; a database module for storing graphic information; and a parsing module for parsing the graphic corresponding to the graphic information into a UML model.
[0014] Furthermore, the modeling system that supports UML visualization further includes: a symbol classification library module for defining symbols.
[0015] Furthermore, the symbols involved in the graphical modeling tool module include points, lines, and graphs. The line represents the connection relationship between points, and the graph is a collection of points and lines. Among them, the association between points records the parent-child relationship of the points, and the parent node can contain multiple child nodes; the association between a point and a line records the source vertex and target vertex of the line; the association between the graph and the symbol records all the symbols included in the graph.
[0016] According to the third aspect of the present invention, there is provided a modeling system that supports UML visualization, including a memory and a processor. The memory stores programs or instructions that can run on the processor. When the programs or instructions are executed by the processor, the steps of the modeling method that supports UML visualization in the first aspect or any possible implementation manner of the first aspect are realized.
[0017] According to the fourth aspect of the present invention, there is provided a readable storage medium, on which programs and / or instructions are stored. When the programs and / or instructions are executed by the processor, the steps of the modeling method that supports UML visualization in the first aspect or any possible implementation manner of the first aspect are realized.
[0018] The beneficial effects brought by the present invention are as follows: Starting from basic graphical elements such as symbol definition and chart configuration, the present invention constructs a graphical modeling tool to realize UML visualization modeling. The parsing of the visual UML model is completed, and it supports generating a UML model that conforms to the UML2.X standard specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is one of the flow schematic diagrams of the modeling method that supports UML visualization provided by the embodiment of the present invention;
[0020] Figure 2 It is another flow schematic diagram of the modeling method that supports UML visualization provided by the embodiment of the present invention;
[0021] Figure 3 It is the UML diagram symbol classification library interface provided by the embodiment of the present invention;
[0022] Figure 4 It is the UML chart configuration library interface provided by the embodiment of the present invention;
[0023] Figure 5 It is the graphical modeling tool interface provided by the embodiment of the present invention;
[0024] Figure 6 It is the graphical modeling tool interface provided by the embodiment of the present invention;
[0025] Figure 7 One of the block diagrams of the modeling system supporting UML visualization provided by an embodiment of the present invention;
[0026] Figure 8 Another block diagram of the modeling system supporting UML visualization provided by an embodiment of the present invention. Detailed implementation manners
[0027] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without any creative efforts shall fall within the protection scope of the present invention.
[0028] The present invention provides a modeling method supporting UML visualization. As Figure 1 shown, it includes:
[0029] S102: Obtain a graphics library, where the graphics library includes at least one symbol;
[0030] S104: Obtain a chart, establish an association between the chart and the symbol to configure the required symbol for the chart;
[0031] S106: Obtain the symbol associated with the chart and generate a canvas corresponding to the chart;
[0032] S108: Drag the symbol onto the canvas to draw a picture, forming graphic information and a graph corresponding to the graphic information;
[0033] S110: Store the graphic information in a database and parse the graph corresponding to the graphic information to form a UML model.
[0034] In this embodiment, first, a graphics library needs to be obtained to store symbols. There should be at least one symbol in the initially obtained graphics library. Then, a chart needs to be obtained. The chart is used to associate symbols. Through the setting of the chart, the symbols in the image library can be classified and sorted. The chart can be established according to the chart directory. Charts under the same chart directory have the same or partially the same symbols. At the same time, a canvas corresponding to the chart is established. Then, the symbol associated with the chart is obtained, and the symbol is placed on the canvas to form graphic information corresponding to the chart and an image corresponding to the graphic information. Then, the graphic information is stored in the database, and the corresponding image is parsed into a UML model, thereby realizing the modeling of the UML visualization model.
[0035] Further, the mxGraph graphics library is used for the basic symbol drawing in the graphics library.
[0036] Furthermore, the graphics library includes symbol categories. The modeling method supporting UML visualization further includes: adding new symbols to the graphics library, specifically including: adding new symbols under the symbol category; determining whether the new symbol is an existing graphic in the mxGraph graphics library. If the determination result is no, draw a vector graphic to register the graphic, and determine the shape of the symbol; determine the style of the symbol based on the shape of the symbol; determine the graphic style information of the symbol based on the style of the symbol; determine the basic information of the symbol based on the graphic style information of the symbol; add the basic information of the symbol to the graphics library to add new symbols to the graphics library.
[0037] In this embodiment, by defining symbols and classifying and managing the symbols, the symbol definition supports the registration of symbols and the configuration of style attributes, enabling the symbol classification library to have the ability to define and extend the domain model. The specific process of the symbol definition is as follows: add a new symbol under the symbol category; determine whether the newly added symbol graphic is an existing graphic in mxGraph. If so, directly use the graphic in mxGraph. Otherwise, draw a vector graphic to register the graphic and determine the shape of the symbol; define the symbol style and determine the graphic style information; determine the basic information such as the symbol name, width, height, and icon; drag the defined graphic symbol to the canvas for display.
[0038] Furthermore, the modeling method supporting UML visualization further includes: obtaining the chart directory; establishing an association between the chart and the symbol. The steps to configure the required symbols for the chart include: classifying the charts based on the chart directory; filtering all the symbols under the chart directory based on the chart directory where the chart is located to configure the required symbols for the chart.
[0039] In this embodiment, associate a new chart under the chart directory, manage the diagrams according to the structure of the chart directory and chart type, filter all the symbol components under the directory to which the chart belongs according to the directory where the chart is located, select the symbol components, and configure the required symbols for the newly added chart.
[0040] Furthermore, the symbols include points, lines, and diagrams. The line represents the connection relationship between points, and the diagram is a collection of points and lines. Among them, the association between points records the parent-child relationship of the points, and the parent node can contain multiple child nodes; the association between a point and a line records the source vertex and target vertex of the line; the association between the diagram and the symbol records all the symbols included in the diagram.
[0041] According to the second aspect of the present invention, as Figure 7As shown in the figure, a modeling system 700 that supports UML visualization is provided, including: a graphic library module 701 for storing symbols; a chart configuration library module 702 for configuring the basic charts of UML diagrams, specifically including: obtaining a chart, establishing an association between the chart and the symbols to achieve the configuration of the required symbols for the chart; a graphic modeling tool module 703 for completing UML visualization modeling, specifically including: obtaining the symbols associated with the chart, generating a canvas corresponding to the chart, dragging the symbols onto the canvas for drawing to form graphic information and the corresponding graphics of the graphic information; a database module 704 for storing the graphic information; and a parsing module 705 for parsing the graphics corresponding to the graphic information into a UML model.
[0042] In this embodiment, the symbol classification library is used to complete symbol definition, classify and manage the symbols, and determine the display style of the symbols on the canvas. The chart configuration library is used to define the chart type, establish an association between the chart and the symbols, and dynamically configure the symbol components required for the chart. Its functions mainly include two parts: defining the chart type and dynamically configuring the symbols. Defining the chart type is used to model the chart, associate a new chart under the chart directory, and manage the diagrams according to the structure of the chart directory and chart type. Dynamically configuring the symbols can filter all the symbol components under the directory to which the chart belongs, select the symbol components, and configure the required symbols for the newly added chart.
[0043] Furthermore, the modeling system that supports UML visualization further includes: a symbol classification library module 706 for defining symbols.
[0044] Furthermore, the symbols involved in the graphic modeling tool module include points, lines, and diagrams. The line represents the connection relationship between points, and the diagram is a set of points and lines. Among them, the association between points records the parent-child relationship of the points. The parent node can contain multiple child nodes; the association between points and lines records the source vertex and target vertex of the line; the association between the diagram and the symbols records all the symbols contained in the diagram.
[0045] Furthermore, the UML visualization modeling tool can be divided into a symbol classification library, a chart configuration library, and a graphical modeling tool, which respectively complete the functions of symbol definition, chart configuration and definition, and graphical modeling.
[0046] The UML visualization modeling tool is programmed and implemented using the JavaScript language, and the basic symbol drawing is completed through the mxGraph graphic library.
[0047] The symbol classification library is used to complete symbol definition, classify and manage the symbols, and determine the display style of the symbols on the canvas.
[0048] The symbol classification library supports classifying and managing the symbols according to the structure of the directory, symbol category, and symbol component.
[0049] Symbol definition supports the registration of symbols and the configuration of style attributes, enabling the symbol classification library to define and extend the domain model.
[0050] The specific process of symbol definition is as follows:
[0051] Step 1: Add a new symbol under the symbol category;
[0052] Step 2: Determine whether the newly added symbol graphic is an existing graphic in mxGraph. If so, directly use the graphic in mxGraph; otherwise, a vector graphic needs to be drawn and registered to determine the shape of the symbol.
[0053] Step 3: Define the symbol style and determine the graphic style information;
[0054] Step 4: Determine the basic information of the symbol, such as the symbol name, width, height, icon, etc.;
[0055] Step 5: Drag the defined graphic symbol to the canvas for display.
[0056] The chart configuration library is used to define chart types, establish associations between charts and symbols, and dynamically configure the symbol components required for charts. Its functions mainly include two parts: defining chart types and dynamically configuring symbols.
[0057] Defining chart types is used to model charts, associate new charts under the chart directory, and manage the diagrams according to the structure of the chart directory and chart types.
[0058] Dynamically configuring symbols can filter all symbol components in the directory according to the directory to which the chart belongs, select symbol components, and configure the required symbols for the newly added chart.
[0059] Combining the symbol classification library and the configuration library, the graphical modeling tool supports obtaining the symbol components associated with different types of charts when creating different types of charts, generating canvases in different environments, and dragging symbol components to draw diagrams.
[0060] The symbols involved in the graphical modeling tool include points, lines, and diagrams. Lines represent the connection relationships between points, and diagrams are collections of points and lines. Among them, the associations between points record the parent-child relationships of points. A parent node can contain multiple child nodes; the associations between points and lines record the source vertex and target vertex of the line; the associations between diagrams and symbols record all the symbols contained in the diagram.
[0061] The graphical modeling tool supports the save and parsing functions of diagrams. The save function does not use traditional XML format files for storage, but stores the graphics in the database for management, enabling real-time modification and adjustment of individual graphic elements. The parsing function is to convert the graphical element model into the corresponding business application model to achieve the semantic conversion function.
[0062] The specific operation steps of the graphical modeling tool are as follows:
[0063] Step 1: Select different types of charts for creation;
[0064] Step 2: The chart obtains its associated symbol components according to the data in the configuration library and generates the corresponding canvas environment;
[0065] Step 3: Drag the symbol components to the canvas for drawing, and different components are displayed according to the styles defined in the symbol classification library;
[0066] Step 4: Save the graphic information to the database;
[0067] Step 5: Analyze the graphic and convert the graphic information into a business model, such as a UML class diagram, etc.
[0068] First, establish the basic graphic elements such as UML things and relationships in the symbol classification library. Secondly, complete the basic chart configuration of the UML model diagram in the chart configuration library. Finally, drag the configured UML graphic symbols in the graphical modeling tool to the canvas, set class attributes, methods, association relationships, etc., complete the graphical modeling work of the UML model, and generate a UML model by parsing UML graphic elements.
[0069] The UML model established through the visual UML modeling tool complies with the UML2.X modeling standard.
[0070] The UML model established by the UML modeling tool supports importing into the UML standard modeling tool Rational Rose to verify the normativity of the UML model.
[0071] 1) Starting from basic graphic elements such as symbol definition and chart configuration, a graphical modeling tool is constructed to realize UML visual modeling.
[0072] 2) Complete the parsing of the visual UML model and support generating a UML model that complies with the UML2.X standard specification.
[0073] The UML visual modeling method used in this patent is as Figure 2 shown, including:
[0074] S202: The symbol classification library defines UML basic symbols;
[0075] S204: The chart configuration library configures the basic charts of the UML diagram;
[0076] S206: The image modeling tool completes UML visual modeling;
[0077] S208: Analyze the UML graphic and generate a UML model.
[0078] Starting from the underlying basic symbols of UML, UML things and relationships are established in the symbol classification library. Among them, UML things include Package, Class, ImportClass, Property, Function, Interface, UseCase, etc.; UML relationships include Association, Generalization, etc., as Figure 3 shown. The configuration of UML graphical chart elements is completed in the chart configuration library. For example, a class diagram includes packages, classes, import classes, interfaces, etc., and a use case diagram includes packages, use cases, actors, etc., as Figure 4 shown.
[0079] After the UML symbol definition and chart element configuration are respectively completed in the symbol classification library and the chart configuration library, a UML graphical model can be established in the graphical modeling tool. Specifically, click [New Drawing Type] to create a UML class diagram canvas. In the component library on the left side of the panel, drag the class graphic to the canvas on the right side. Right-click on the class graphic to add class attributes and class methods. Class attributes include characters, numerical values, booleans, dates, texts, binaries, reference attributes, etc. Arrows can be drawn above and laterally to connect to other classes, indicating the inheritance and association relationships between classes respectively. Click the [Save] button above to store the graphical UML model in the database, and click the [Parse] button to complete the parsing of the graphical UML model and generate a UML entity model, as Figure 5 shown.
[0080] Import the UML model established by the UML visual modeling tool into the standard UML modeling tool Rational Rose, as Figure 6 shown. The UML model established by the method of this patent is above, and the UML model imported by Rational Rose is below. It can be seen that the class attributes and the inheritance and association relationships between classes are restored, indicating that the model conforms to the UML2.X standard.
[0081] According to the third aspect of the present invention, as Figure 8 shown, a modeling system 800 supporting UML visualization is provided, including a memory 801 and a processor 802. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the modeling method supporting UML visualization in the first aspect or any possible implementation manner of the first aspect are implemented.
[0082] According to a fourth aspect of the present invention, there is provided a readable storage medium having a program and / or instructions stored thereon, and when the program and / or instructions are executed by a processor, the steps of the modeling method supporting UML visualization in the first aspect or any possible implementation manner of the first aspect are implemented.
[0083] The above are the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A modeling method supporting UML visualization, characterized in that: include Acquire a graphic library, wherein the graphic library includes at least one symbol; Acquire a chart, and associate the chart with the symbol to configure the required symbol for the chart; Obtaining the symbol associated with the chart, and generating a canvas corresponding to the chart; Drag the symbol to the canvas to draw a picture, thereby forming graphic information and a graphic corresponding to the graphic information; The graphic information is stored in a database, and the graphics corresponding to the graphic information are parsed to form a UML model.
2. The modeling method supporting UML visualization according to claim 1, characterized in that: The graphics library uses the mxGraph graphics library to complete basic symbol drawing.
3. The modeling method supporting UML visualization according to claim 2, characterized in that: The graphic library includes symbol categories, and the modeling method supporting UML visualization further includes: adding new symbols to the graphic library, specifically including: adding the new symbol under the symbol category; Determine whether the new symbol is an existing graphic in the mxGraph graphics library. If not, draw a vector graphics registration graphic based on the new symbol to determine the shape of the symbol. determining a style of the symbol based on a shape of the symbol; Determining graphic style information of the symbol based on the style of the symbol; Determining basic information of the symbol based on the graphic style information of the symbol; The basic information of the symbol is added to the graphic library to realize adding a new symbol in the graphic library.
4. The modeling method supporting UML visualization according to claim 1, characterized in that: Also includes: Get the table of contents; The step of associating the chart with the symbol to configure the required symbol for the chart includes: categorizing the charts based on the catalog of charts; Based on the chart directory where the chart is located, all symbols under the chart directory are filtered to configure required symbols for the chart.
5. The modeling method supporting UML visualization according to any one of claims 1 to 4, characterized in that: The symbols include points, lines and graphs, where a line represents a connection between points and a graph is a collection of points and lines; Among them, the association between points records the parent-child relationship of points, and the parent node can contain multiple child nodes; the association between points and lines records the source vertex and target vertex of the line; the association between graphs and symbols records all symbols contained in the graph.
6. A modeling system supporting UML visualization, characterized in that: include: Graphics library module, used to store symbols; The chart configuration library module is used to configure the basic chart of the UML diagram, specifically including: obtaining the chart, establishing an association between the chart and the symbol to configure the required symbol for the chart; The graphic modeling tool module is used to complete UML visual modeling, specifically including: obtaining the symbol associated with the chart, generating a canvas corresponding to the chart, dragging the symbol to the canvas for drawing, and forming graphic information and a graphic corresponding to the graphic information; Database module, used to store graphic information; The parsing module is used to parse the graphics corresponding to the graphic information into a UML model.
7. The modeling system supporting UML visualization according to claim 6, characterized in that: Also includes: Symbol classification library module, used to define symbols.
8. The modeling system supporting UML visualization according to claim 6 or 7, characterized in that: The symbols involved in the graphical modeling tool module include points, lines and graphs. Lines represent the connection between points, and graphs are a collection of points and lines. The association between points records the parent-child relationship of points, and a parent node can contain multiple child nodes; the association between points and lines records the source vertex and target vertex of the line; the association between graphs and symbols records all symbols contained in the graph.
9. A modeling system supporting UML visualization, characterized in that: The method comprises a memory and a processor, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the modeling method supporting UML visualization as claimed in any one of claims 1 to 5 are implemented.
10. A readable storage medium, characterized in that: Programs and / or instructions are stored thereon, and when the programs and / or the instructions are executed by a processor, the steps of the modeling method supporting UML visualization as described in any one of claims 1 to 5 are implemented.