A method and system for automatic layout of architecture diagram

The LMM large model is used to determine the architecture keywords and hierarchical relationships, format the node relationships and calculate the global area, and combine the back propagation process to perform size constraint checks, which solves the problem that the static layout of the architecture diagram in the existing technology cannot meet the flexible changes of software development. solve the problem, realize the automatic construction and adaptive layout of the architecture diagram, and improve the readability and maintainability of the architecture diagram.

CN118363572BActive Publication Date: 2024-08-23INFORMATION SCI RES INST OF CETC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410795104.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-08-23
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

In the existing technology, the static layout of the architecture diagram cannot meet the flexible changing needs of software development and lacks automated layout capabilities, resulting in the generated architecture diagram lacking intuitiveness and maintainability.

Method used

The automatic layout method of the architecture diagram based on the LMM large model is used to determine the architecture keywords and hierarchical relationships, format and save the node relationships, and perform global area calculation and area division through a recursive process to build the initial architecture diagram, combined with back propagation. The process performs size constraint checking and border consistency checking to realize automatic construction and adaptive layout of architecture diagrams.

Benefits of technology

It realizes the automatic construction and adaptive layout of the architecture diagram, improves the readability and maintainability of the architecture diagram, and can automatically update the layout according to changes in keywords.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118363572B
    Figure CN118363572B
Patent Text Reader

Abstract

The present invention belongs to the field of image processing technology, and provides an automatic layout method, method and system for an architecture diagram. The method: based on the LMM large model, the architecture keywords and hierarchical association relationships of the framework diagram to be constructed are determined from the specified document; according to the determined architecture keywords and hierarchical association relationships, the node relationships are formatted and saved; based on the recursive process, global area calculation and recursive area division are performed to construct an initial architecture diagram, and the global area calculation includes calculating the maximum area of ​​the architecture diagram, determining the size and position of the node borders of nodes at all levels and the area occupied; judging each node according to the constraint conditions to determine whether to update; and adjusting the initial architecture diagram according to the updated architecture keywords. The present invention realizes the adaptive layout and update of the architecture diagram that can change with the keywords.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic layout processing of architecture diagrams, and in particular to an automatic layout method and system for architecture diagrams. Background Art

[0002] Most existing architecture diagrams are drawn manually based on the knowledge and experience of software developers. Tree diagrams similar to architecture diagrams require a certain architectural hierarchy, and the generated diagrams are still somewhat different from the prescribed standard architecture diagrams, lacking in intuitiveness. Template-based architecture diagram generation methods generate relatively fixed architectures, and are unable to automatically adjust the size and direction of the architecture diagram border according to the word count and hierarchical information of keywords.

[0003] In the early stages of software development, requirements will continue to evolve as functions are discussed, and static architecture diagrams cannot meet the flexible needs of software development. In addition, there is still much room for improvement in many aspects, such as how to achieve automatic layout of architecture diagrams.

[0004] Therefore, it is necessary to provide an automatic layout method for an architecture diagram to solve the above problems. Summary of the invention

[0005] The present invention intends to provide a method and system for automatic layout of architecture diagrams to solve the technical problem that static architecture diagrams in the prior art cannot meet the flexible and changing needs of software development and how to achieve automatic layout of architecture diagrams. The technical problem to be solved by the present invention is achieved through the following technical solutions.

[0006] The first aspect of the present invention proposes an automatic layout method for an architecture diagram, comprising: determining the architecture keywords and hierarchical association relationships of a framework diagram to be constructed from a specified document based on an LMM large model; formatting and saving node relationships according to the determined architecture keywords and hierarchical association relationships; performing global area calculation and recursive area division based on a recursive process to construct an initial architecture diagram, wherein the global area calculation includes calculating the maximum area of ​​the architecture diagram, determining the size and position of the node borders of nodes at all levels and the area occupied; judging each node according to constraint conditions to determine whether to update (specifically including performing size constraint checks from the smallest node to the largest node and consistency checks on the borders of nodes at the same level based on a back propagation process to complete the reverse update of the initial architecture diagram); adjusting the initial architecture diagram according to the updated architecture keywords to complete the construction of the architecture diagram to be constructed.

[0007] The second aspect of the present invention proposes an automatic layout system for architecture diagrams, which adopts the automatic layout method for architecture diagrams described in the first aspect of the present invention, including: a first determination module, which determines the architecture keywords and hierarchical association relationships of the framework diagram to be constructed from a specified document based on the LMM large model; a storage processing module, which formats and saves the node relationships according to the determined architecture keywords and hierarchical association relationships; a first construction module, which performs global area calculation and recursive area division based on a recursive process to construct an initial architecture diagram, wherein the global area calculation includes calculating the maximum area of ​​the architecture diagram, determining the size and position of the node borders of nodes at all levels and the area occupied; a second determination module, which monitors the changes in architecture keywords under application scenarios, and judges each node according to constraints to determine whether to update; a second construction module, which adjusts the initial architecture diagram according to the updated architecture keywords to complete the construction of the architecture diagram to be constructed.

[0008] The third aspect of the present invention provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the automatic layout method of the architecture diagram described in the first aspect of the present invention.

[0009] A fourth aspect of the present invention provides a computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for automatically laying out an architecture diagram as described in the first aspect of the present invention is implemented.

[0010] The embodiments of the present invention include the following advantages:

[0011] Compared with the prior art, the present invention determines the architecture keywords and hierarchical association relationships of the framework diagram to be constructed from the specified document based on the LMM large model; formats and saves the node relationships according to the determined architecture keywords and hierarchical association relationships; performs global area calculation and recursive area division based on a recursive process to construct an initial architecture diagram, wherein the global area calculation includes calculating the maximum area of ​​the architecture diagram, determining the size and position of the node borders of nodes at all levels and the area occupied; based on the back propagation process, performs size constraint checks and consistency checks of the borders of nodes at the same level from the smallest node to the largest node, and completes the reverse update of the initial architecture diagram; adjusts the initial architecture diagram according to the updated architecture keywords, can effectively realize the automatic construction of the architecture diagram, and can realize the adaptive layout and update of the architecture diagram that can change with the keywords, so as to improve the readability and maintainability of the architecture diagram. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 is a flowchart of an example of the method for automatically laying out an architecture diagram of the present invention;

[0013] Figure 2is a schematic diagram of an application example of the automatic layout method of an architecture diagram of the present invention;

[0014] Figure 3 It is a flowchart of a specific implementation of the automatic layout method of the architecture diagram of the present invention;

[0015] Figure 4 It is a partial schematic diagram of an architecture diagram construction of an application example of the architecture diagram automatic layout method of the present invention;

[0016] Figure 5 It is another partial schematic diagram of the construction of an architecture diagram of an application example of the automatic layout method of the architecture diagram of the present invention;

[0017] Figure 6 is a structural block diagram of the automatic layout system of the architecture diagram of the present invention;

[0018] Figure 7 is a schematic structural diagram of an electronic device embodiment according to the present invention;

[0019] Figure 8 It is a schematic diagram of the structure of a computer-readable medium embodiment according to the present invention. DETAILED DESCRIPTION

[0020] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. In the present invention, the upper surface of the object in the drawings is the upper surface, the lower surface of the object in the drawings is the lower surface, the vertical direction in the drawings is the vertical direction, and the direction perpendicular to the vertical direction is the horizontal direction. The present invention will be described in detail below with reference to the drawings and in combination with the embodiments.

[0021] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0022] In view of the above problems, the present invention proposes an automatic layout method for an architecture diagram, which determines the architecture keywords and hierarchical association relationships of the framework diagram to be constructed from a specified document based on the LMM large model; formats and saves the node relationships according to the determined architecture keywords and hierarchical association relationships; based on a recursive process, performs global area calculation and recursive area division to construct an initial architecture diagram, wherein the global area calculation includes calculating the maximum area of ​​the architecture diagram, determining the size and position of the node borders of nodes at all levels and the area occupied; based on a back propagation process, performs size constraint checks and consistency checks on the borders of nodes at the same level from the smallest node to the largest node, and completes the reverse update of the initial architecture diagram; and adjusts the initial architecture diagram according to the updated architecture keywords.

[0023] Example 1

[0024] Refer to the following Figures 1 to 5, the contents of the present invention will be described in detail.

[0025] Figure 1 It is a flowchart of an example of the method for automatically laying out an architecture diagram of the present invention. Figure 2 It is a schematic diagram of an application example of the automatic layout method of the architecture diagram of the present invention.

[0026] First, in step S101, the architecture keywords and hierarchical association relationships of the framework diagram to be constructed are determined from the specified document based on the LMM large model.

[0027] Specifically, according to different application scenarios and requirements, the given demand analysis document (i.e., specified document) and architecture keyword related requirements are input into the LMM large model (Large Multimodal Models) to extract the architecture keywords of the framework diagram to be constructed. The application scenarios include software design and development scenarios such as information system architecture design, industrial control system development, and analysis database construction. The document that needs to be analyzed is a text content related to the above application scenario.

[0028] In a specific implementation, for example, the application scenario is information system architecture design, and the framework diagram to be constructed is a layered software architecture diagram. The software requirements of the information system architecture design and the requirements related to the architecture keywords (for example, the layered software architecture diagram is divided into five layers, the intelligent algorithm needs to be included, and the software and hardware parts need to be separated) are wait ) is input into the LMM model, and the following architecture keywords are output: basic support layer, resource element layer, network interconnection layer, service supply layer, capability generation layer (a total of five layers); other keywords: parallel intelligence, ethical application of artificial intelligence, human-machine hybrid interoperability standards, command private network, network interconnection and broadband communication, etc. For details, please refer to Figure 2 .

[0029] Figure 3 It is a flowchart of a specific implementation of the automatic layout method of the architecture diagram of the present invention.

[0030] exist Figure 3 In the example, the following processing is specifically performed on the specified document: determining the hierarchical relationship, formatting and saving, constructing the initial framework diagram, and updating in reverse. Further, it is judged whether the initial framework diagram meets expectations, specifically judging whether the distribution of the architecture keywords of each layer in the constructed architecture diagram is correct, whether the description of the architecture keywords is standardized, whether necessary keywords are missing, and whether the width-to-height ratio of the node border of each node meets the design requirements. Meeting expectations means that the distribution of the architecture keywords of each layer in the constructed architecture diagram is correct, the description of the architecture keywords is standardized, necessary keywords are not missing, and the width-to-height ratio of the node border of each node meets the design requirements.

[0031] If it does not meet expectations, the modified requirement analysis document or the keywords to be modified / supplemented can be re-entered into the LLM model to extract architectural keywords that better meet software development requirements.

[0032] Based on the extracted architecture keywords, the hierarchical structure is determined, specifically according to the standard software architecture hierarchy (such as the four-layer software architecture: user interface layer, business logic layer, data persistence layer, and data access layer) or other given architecture hierarchies, so as to classify and organize them into an orderly keyword system.

[0033] Classify and organize according to the level of the framework diagram to be constructed to form an orderly keyword system, which includes architecture keywords and hierarchical associations of architecture keywords.

[0034] Specifically, the hierarchical association relationship specifically includes the upper and lower hierarchical relationship of the determined architecture keywords and the left and right sequential relationship of the same level.

[0035] Furthermore, the hierarchical association relationship includes a four-layer structure with three levels, wherein the first-level architecture keywords are user interface layer, business logic layer, data persistence layer, and data access layer; the second-level architecture keywords are theoretical knowledge related to software development, resource management, confrontation application services, and capability composition; the third-level architecture keywords are parallel intelligence, drone collaboration, command network, satellite network, training and learning data, spatial geographic data, mobility, etc. For details, please refer to Figure 3 .

[0036] It should be noted that the above is only described as an optional example and should not be understood as a limitation to the present invention.

[0037] Next, in step S102, the node relationship is formatted and saved according to the determined architecture keywords and hierarchical association relationships.

[0038] According to the architecture keywords and hierarchical associations determined in step S101, the node relationships are formatted and saved. Each architecture keyword corresponds to a node.

[0039] Specifically, the data structure of the nodes in the Json string is defined, and the data structure of each node includes the keyword name (name), the order of the node level (order), and the list of child node names (children).

[0040] More specifically, the hierarchical structure is converted into a parent-child node relationship structure in a Json string, and the sequence structure is converted into an arrangement relationship of child nodes. The keyword name is identified by the name attribute, the hierarchical relationship of the upper and lower nodes is saved through the parent-children relationship of the Json string, and the order relationship of the same-level nodes is identified by order, in the final saved Json string style.

[0041] For example, the Json string style includes position information and size information, specifically:

[0042] "name": "Base support layer",

[0043] "order": 0,

[0044] "children": [

[0045] {"name":"Theoretical knowledge",

[0046] "order": 0,

[0047] "children": [

[0048] {

[0049] "name": "Parallel Intelligence",

[0050] "order": 0,

[0051] "children": []

[0052] },

[0053] {

[0054] "name": "Is there anyone collaborating?"

[0055] "order": 1,

[0056] "children": []

[0057] }

[0058] ],

[0059] } ]

[0061] It should be noted that the above is only described as an optional example and should not be understood as a limitation to the present invention.

[0062] Next, in step S103, based on a recursive process, global area calculation and recursive area division are performed to construct an initial architecture diagram, wherein the global area calculation includes calculating the maximum area of ​​the architecture diagram, determining the size and position of the node borders of nodes at each level and the area occupied.

[0063] The global region calculation and recursive region division are performed based on the recursive process, and specifically include the following steps:

[0064] Step S201: Calculate the maximum area of ​​the framework graph to be constructed.

[0065] Specifically, the following expression is used to calculate the maximum area of ​​the frame diagram to be constructed:

[0066] S=k*800+(2*j+1)*300+d*200

[0067] Among them, S represents the maximum area of ​​the framework diagram to be constructed, in pixels px; k represents the total number of characters in the framework diagram keywords; j represents the number of framework diagram keywords, that is, the total number of nodes in the architecture diagram; d represents the total hierarchical depth, specifically the cumulative depth from the lowest-level node to the highest-level node, for example, from child nodes to child nodes to parent nodes, a total of 3 layers are added, or from third-level nodes to first-level nodes, a total of 3 layers are added.

[0068] Step S202: determining the aspect ratio of the highest level border (ie, the border width-to-height ratio), and determining the initial size and position of the node borders of nodes at all levels.

[0069] The aspect ratio of the highest level border is determined according to the calculated maximum area and the aspect ratio of the set highest level border. Further, the initial size and position of the node borders of each level of nodes are determined according to the determined aspect ratio of the highest level border, and the node grouping of the framework diagram to be constructed is completed.

[0070] It should be noted that, in the present invention, the highest level frame specifically refers to the aspect ratio of the frame of the framework keyword corresponding to the highest level (e.g., first level) node, which is set, for example, according to parameters such as the number of levels and the number of nodes of different framework graphs to be constructed.

[0071] Specifically, the initial size and position of the borders of nodes at each level are allocated according to the node groups at different levels: according to the number of child nodes contained in the parent node (corresponding to the first-level node), the area where the parent node (corresponding to the first-level node) is located is divided into rectangles of the same width / height to be used as the initial area of ​​the child node (corresponding to the second-level node). The initial area of ​​the child node, that is, the height of the rectangle, is equal to the height of the parent node of the child node minus the outer margin. The outer margin refers to the size of the space occupied by the parent node name in the architecture diagram. After allocating the second-level nodes, continue to allocate the next-level nodes until the smallest first-level node is reached. In this example, the smallest first-level node is the third-level node.

[0072] In a specific implementation, all keywords are traversed in order from top to bottom and from left to right to complete the automatic layout of keyword layers, and the size and position of the node border corresponding to the keywords at each level are updated.

[0073] Specifically, according to the aspect ratio of the highest-level border determined above, the following expression is used to calculate the width and height (border width and border height) of the node border of the first-level node (ie, the parent node), and further calculate the area s of the region to be allocated.

[0074] ;

[0075] ;

[0076] S 父 =h 父 * w 父

[0077] Among them, h 父 Indicates the vertical length of the node border of the first-level node (i.e., the parent node); w 父 Indicates the horizontal length of the node border of the first-level node (i.e., the parent node); S 父 The area to be allocated to the first-level nodes.

[0078] Calculate the area of ​​the framework graph to be constructed occupied by all second-level nodes (i.e., child nodes) under each first-level node (i.e., parent node).

[0079] In a specific implementation, if the border width-to-height ratio of the first-level node (i.e., the parent node) is greater than 1, the node border of the first-level node is a horizontal rectangular box, and the space is allocated according to the following formula:

[0080] h 子 = h 父 −First spacing ∗ Number of second level nodes −Outer margin;

[0081] Among them, h 子It represents the length of the node border of the second-level node (i.e., child node) along the vertical direction; the first spacing represents the spacing between the node borders of the second-level nodes (i.e., child nodes); the outer margin refers to the height of the space occupied by the parent node name in the architecture diagram.

[0082] w 子 = w 父 − second spacing ∗2;

[0083] Among them, w 子 Indicates the horizontal length of the node border of the second-level node (i.e., child node); w 父 It indicates the horizontal length of the node border of the first-level node (i.e., the parent node); the second spacing indicates the spacing between the parent node border and the adjacent child node border. For details, see 4.

[0084] It should be noted that, in this example, the first interval and the second interval are equal. However, in other implementations, the first interval and the second interval may not be equal.

[0085] In another specific implementation, if the border width-to-height ratio of the first-level node (i.e., the parent node) is less than or equal to 1, the node border of the first-level node is a vertical rectangular box, and the space is allocated according to the following formula:

[0086] h 子 = h 父 −First spacing −Outer margin;

[0087] Among them, h 子 Represents the length of the node border of the second-level node (i.e., child node) along the vertical direction; the first spacing represents the spacing between the lower border of the parent node border and the lower border of the child node border; the outer margin refers to the space occupied by the parent node name in the architecture diagram.

[0088] w 子 = w 父 −Second distance ∗ (number of second-level nodes + 1);

[0089] Among them, w 子 Indicates the horizontal length of the node border of the second-level node (i.e., child node); w 父 Represents the horizontal length of the node border of the first-level node (i.e., the parent node); the second spacing represents the horizontal spacing between the border of the second-level node in the architecture diagram to be constructed and the border of its adjacent node. For details, see Figure 5 .

[0090] Specifically, the left-right order (vertical box) or top-bottom order (horizontal box) of each sub-node at different levels is determined according to the order of the order attribute identifier of the Json string, and then the area of ​​the area where all sub-nodes are located is calculated one by one. 子 and w 子 Multiply them together to get the area of ​​each second-level node.

[0091] Next, if the width-to-height ratio of the first-level node (i.e., parent node) where the second-level node (i.e., child node) is located is greater than 1, that is, a horizontal rectangular box, the space is allocated as follows:

[0092] ;

[0093] ;

[0094] Among them, h 子’ Indicates the length of the node border of the second-level node along the vertical direction; w 子’ Indicates the horizontal length of the node border of the second-level node.

[0095] Specifically, if the width-to-height ratio of the frame of the first-level node (i.e., the parent node) where the second-level node (i.e., the child node) is located is less than or equal to 1, that is, a vertical rectangular frame, the space is allocated as follows:

[0096] h 子’ =h 子 ;

[0097] ;

[0098] Among them, h 子’ Indicates the horizontal length of the node border of the second-level node; w 子’ Indicates the vertical length of the node border of the second-level node.

[0099] Regarding the position determination of the second-level node, the coordinates of the architecture diagram where the node border of the second-level node is located are specifically determined.

[0100] If the aspect ratio of the border of the first-level node where the second-level node is located is greater than 1, that is, a horizontal rectangular box, the coordinates are determined as follows:

[0101] x 子当 = second spacing + initial space;

[0102] y 子当 = The cumulative border height of all nodes before the current node at the same level + the initial space occupied;

[0103] Where x 子当Indicates the horizontal coordinate value of the point corresponding to the upper left corner of the border of the current node; y 子当 Indicates the vertical coordinate value of the point corresponding to the upper left corner of the border of the current node; the second spacing indicates the distance between the left edge of the node border where the current node is located and the current node (for example Figure 4 The node border of the first level node in the "resource element layer" (for example, Figure 4 The initial placeholder spacing indicates the spacing between the left border of the node where the "resource feature layer" is located; the initial placeholder spacing indicates the spacing between the left border of the node where the current node (for example Figure 4 The node border of the first level node in the "resource element layer" (for example, Figure 4 The spacing between the left border of the node border where the "resource feature layer" is located and the left border of the top-level border.

[0104] If the border width-to-height ratio of the first node (i.e., parent node) where the second-level node (i.e., child node) is located is less than or equal to 1, that is, a vertical rectangular box, the space is allocated as follows:

[0105] x 子当 = The accumulated border width of all nodes before the current node at the same level + the initial space occupied;

[0106] y 子当 = Margin + initial space;

[0107] Among them, x 子当 Indicates the horizontal coordinate value of the point corresponding to the upper left corner of the border of the current node; y 子当 Indicates the vertical coordinate value of the point corresponding to the upper left corner of the border of the current node; the initial placeholder spacing indicates the spacing between the left border of the node border of the previous node of the current node and the left border of the highest level border and the third spacing (i.e. Figure 4 The distance obtained by adding the distance between the left edge of the node border of the current node and the left edge of the node border where the previous node "Theoretical Knowledge" of the current node is located).

[0108] According to the above calculation process, continue to calculate the width, height and position of the next level node (i.e., sub-sub-node) until the smallest node is divided. Then, for the nodes at the same level, continue to traverse the next node until all nodes at the same level are traversed, so as to complete the division of the border area of ​​each node at the same level and determine the position. Traverse upward until all nodes are traversed and the initial architecture diagram is output.

[0109] For example, refer to Figure 3 and Figure 4, for the "theoretical knowledge" node, the first step is to confirm the regional allocation and location of the parallel intelligence nodes under the "theoretical knowledge" node. The "parallel intelligence" node is already the smallest node (i.e. the lowest level node), so continue to determine the nodes at the same level as "parallel intelligence": unmanned collaboration, ant colony, wolf colony, operations planning, and artificial intelligence ethical applications. After traversing the nodes at the same level, return to the previous level and continue to traverse the nodes at the same level of the "theoretical knowledge" node: standard specification framework, human-machine hybrid interoperability standards, XX capability standards, complex XX behavior norms, and guidance capabilities. Then return to the "basic support layer" node. Then, continue to traverse the next node layer, that is, the node layer corresponding to the "resource element layer", and traverse layer by layer to complete the construction of the initial architecture diagram.

[0110] The recursive region refers to the region division through the recursive process, not a specific recursive region. Specifically, it is the node border calculation process of the parent-child structure from the parent node to the child node, and then to the child node. However, it is not limited to the three-level structure. In other examples, the recursive process can be extended downward to form multiple recursive regions.

[0111] It should be noted that the above is only described as an optional example and should not be understood as a limitation to the present invention.

[0112] Next, in step S104, the generated initial architecture diagram is analyzed according to the constraint conditions, and each level of nodes is reversely updated from the smallest node upwards.

[0113] In an optional implementation, changes in architecture keywords of the information system architecture design system are monitored.

[0114] When a change in a certain schema keyword is detected, the schema keyword is updated.

[0115] According to the back propagation process, specifically in the back propagation process from the smallest node (i.e. the lowest level node) to the largest node (i.e. the highest level node), size constraint checks and border consistency checks of nodes at the same level are performed according to the constraints to complete the reverse update of the initial architecture diagram.

[0116] The size constraint check mainly refers to the size check. Specifically, on the one hand, it is the check of the size of the node border itself, taking into account the inner margin between the node borders and the architecture keywords (such as Figure 4The size of the node border is checked by size constraint to ensure that the height of the node border is at least larger than the font size of the architecture keyword contained in the node border (for example, 1.5 to 2 times the font size of the architecture keyword), and the node border must be able to store all the architecture keywords (that is, all characters) contained in the node border diagram; on the other hand, the consistency check of the node border size of each node under the same level of node (for example, the size consistency check of the child nodes under the same parent node), specifically including, for example, vertical borders to ensure that the height of each vertical border is consistent: for example, the borders of each child node under the "theoretical knowledge" node are kept highly consistent (see Figure 5 ); horizontal borders ensure that the width of each horizontal border is consistent: for example, the width of the borders of each sub-node under the "resource element layer" node is consistent (see Figure 4 ).

[0117] If the area to be allocated does not pass the size constraint check, the initial architecture graph is updated in reverse from the smallest node (i.e., the lowest level node) to the largest node (i.e., the highest level node), i.e., from bottom to top.

[0118] If the area to be allocated has passed the size constraint check, it indicates that the traversal of the sibling nodes corresponding to the current node has been completed, that is, there is no need to reversely update the initial architecture diagram.

[0119] If the area to be allocated has passed the size constraint check, and the traversal of the nodes at the same level corresponding to the current node has been completed, it means that the traversal of all nodes has been completed, and the initial structure diagram is output.

[0120] Regarding adjusting the area to be allocated, specifically, the size of the area to which the node belongs is expanded, and the size of the area of ​​the node at the same level is simultaneously expanded.

[0121] When the aspect ratio of the node border is greater than 1, that is, a horizontal rectangular frame, for example, the node border of "Spatial Geographic Data" under the "Resource Management Service" node, keep the width of the node border unchanged, then set the height of the node border to twice the font size of "Spatial Geographic Data", and synchronously update the vertical coordinates of the node border (i.e., the ordinate); next, continue to expand the size of the node border where the parent node (i.e., the "Resource Management Service" node) is located, and synchronously expand the size of the node borders of the same level of the "Resource Management Service" node; continue to repeat this process until the largest node (i.e., the highest level node) is reached, thereby completing the update of the node borders of all nodes.

[0122] When the aspect ratio of the node border is less than or equal to 1, that is, a vertical rectangular box, for example, the node border of the "Intelligent Diagnosis Service" under the "Counter Application Service" node also keeps the width unchanged, and then traverse the nodes at the same level of the "Intelligent Diagnosis Service" node, determine the minimum height that can accommodate all node characters based on the number of characters, and then set it as the border height of the level where the "Intelligent Diagnosis Service" node is located. Next, continue to expand the node border size of the parent node (that is, the "Counter Application Service" node, and simultaneously expand the node border size of the peer nodes of the "Counter Application Service" node; continue to repeat the above process until the largest node (that is, the highest level node) is reached, thereby completing the update of the node borders of all nodes.

[0123] It should be noted that the above is only described as an optional example and should not be understood as a limitation to the present invention.

[0124] Next, in step S105 , the initial architecture diagram is adjusted according to the updated architecture keywords.

[0125] For example, the software developer determines whether the architecture diagram meets expectations. If not, the requirement document can be changed or the keywords can be directly changed. Then, the system architecture diagram is adjusted according to the updated architecture keywords according to steps S102-S105. Finally, the final architecture diagram is obtained, for example Figure 2 The architecture diagram shown.

[0126] It should be noted that the above is only described as an optional example and should not be understood as a limitation to the present invention.

[0127] In addition, the drawings are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the drawings do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0128] Compared with the prior art, the present invention determines the architecture keywords and hierarchical association relationships of the framework diagram to be constructed from the specified document based on the LMM large model; formats and saves the node relationships according to the determined architecture keywords and hierarchical association relationships; performs global area calculation and recursive area division based on a recursive process to construct an initial architecture diagram, wherein the global area calculation includes calculating the maximum area of ​​the architecture diagram, determining the size and position of the node borders of nodes at all levels and the area occupied; based on the back propagation process, performs size constraint checks and consistency checks of the borders of nodes at the same level from the smallest node to the largest node, and completes the reverse update of the initial architecture diagram; adjusts the initial architecture diagram according to the updated architecture keywords, can effectively realize the automatic construction of the architecture diagram, and can realize the adaptive layout and update of the architecture diagram that can change with the keywords, so as to improve the readability and maintainability of the architecture diagram.

[0129] Example 2

[0130] The following is a system embodiment of the present invention, which can be used to implement the method embodiment of the present invention. For details not disclosed in the system embodiment of the present invention, please refer to the method embodiment of the present invention.

[0131] Figure 6 4 is a schematic diagram of the structure of an example of an automatic layout system of an architecture diagram according to the present invention.

[0132] Reference Figure 6 The second aspect of the present disclosure provides an architecture diagram automatic layout system 600, which adopts the architecture diagram automatic layout method described in the first aspect of the present disclosure. The architecture diagram automatic layout system 600 includes a first determination module 610, a storage processing module 620, a first construction module 630, a second determination module 640, and a second construction module 650.

[0133] Specifically, the first determination module 610 determines the architecture keywords and hierarchical associations of the framework diagram to be constructed from the specified document based on the LMM large model. The storage processing module 620 formats and saves the node relationship based on the determined architecture keywords and hierarchical associations. The first construction module 630 performs global area calculation and recursive area division based on a recursive process to construct an initial architecture diagram, wherein the global area calculation includes calculating the maximum area of ​​the architecture diagram, determining the size and position of the node borders of nodes at all levels and the area occupied. The second determination module 640 judges each node according to the constraint conditions to determine whether to update it. The second construction module 650 adjusts the initial architecture diagram according to the updated architecture keywords to complete the construction of the architecture diagram to be constructed.

[0134] According to an optional implementation, global region calculation and recursive region division are performed based on a recursive process, including: according to the level depth h, the number of framework graph keywords k, and the number of nodes j of the framework graph keywords, the maximum area of ​​the framework graph to be constructed is calculated using the following expression:

[0135] S=k*800+(2*j+1)*300+d*200

[0136] Among them, S represents the maximum area of ​​the framework diagram to be constructed, in pixels px; k represents the total number of characters in the framework diagram keywords; j represents the number of framework diagram keywords, that is, the total number of nodes j in the architecture diagram; d represents the total hierarchical depth, specifically the cumulative depth from the lowest-level node to the highest-level node.

[0137] According to an optional implementation manner, the method further includes: determining the height and width of the highest-level border according to the calculated maximum region area and the set aspect ratio of the highest-level border.

[0138] According to the height and width of the determined highest-level border, the initial size and position of the node borders of the nodes at each level are determined, and the node grouping of the framework graph to be constructed is completed.

[0139] According to an optional implementation, judging each node according to the constraint conditions to determine whether to update includes: according to the reverse propagation process, specifically in the reverse propagation process from the smallest node to the largest node, performing a size constraint check and a consistency check of the borders of nodes at the same level according to the constraint conditions to complete the reverse update of the initial architecture diagram.

[0140] If the area to be allocated has passed the size constraint check, it indicates that the traversal of the sibling nodes corresponding to the current node has been completed, that is, there is no need to reversely update the initial architecture diagram.

[0141] If the area to be allocated has passed the size constraint check and the traversal of the nodes at the same level corresponding to the current node has been completed, it means that the traversal of all nodes has been completed, and the initial structure graph is output.

[0142] Optionally, the height of the node border is at least 1.5 to 2 times greater than the font size of the architecture keyword contained in the node border.

[0143] According to an optional implementation, the node relationship formatting and saving includes: determining the level, direction and order of each node, and saving in a string style, wherein the string style includes a framework diagram keyword as the name, the order of the level of each node, and a list of names of the next level nodes of each node.

[0144] According to different application scenarios and requirements, given example templates and keyword templates are input into the LMM large model to extract the architecture keywords of the framework diagram to be constructed. The application scenarios include human-computer management scenarios and software development.

[0145] Classify and organize according to the level of the framework diagram to be constructed to form an orderly keyword system, which includes the upper and lower hierarchical relationship and left and right order of the architecture keywords.

[0146] Compared with the prior art, the present invention determines the architecture keywords and hierarchical association relationships of the framework diagram to be constructed from the specified document based on the LMM large model; formats and saves the node relationships according to the determined architecture keywords and hierarchical association relationships; performs global area calculation and recursive area division based on a recursive process to construct an initial architecture diagram, wherein the global area calculation includes calculating the maximum area of ​​the architecture diagram, determining the size and position of the node borders of nodes at all levels and the area occupied; based on the back propagation process, performs size constraint checks and consistency checks of the borders of nodes at the same level from the smallest node to the largest node, and completes the reverse update of the initial architecture diagram; adjusts the initial architecture diagram according to the updated architecture keywords, can effectively realize the automatic construction of the architecture diagram, and can realize the adaptive layout and update of the architecture diagram that can change with the keywords, so as to improve the readability and maintainability of the architecture diagram.

[0147] Figure 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.

[0148] like Figure 7 As shown, the electronic device is presented in the form of a general computing device. The processor may be one or more and work in coordination. The present invention does not exclude distributed processing, that is, the processor may be dispersed in different physical devices. The electronic device of the present invention is not limited to a single entity, but may also be the sum of multiple physical devices.

[0149] The memory stores a computer executable program, which is usually a machine-readable code. The computer-readable program can be executed by the processor to enable the electronic device to perform the method of the present invention, or at least part of the steps in the method.

[0150] The memory includes a volatile memory, such as a random access memory unit (RAM) and / or a cache memory unit, and may also be a non-volatile memory, such as a read-only memory unit (ROM).

[0151] Optionally, in this embodiment, the electronic device further includes an I / O interface, which is used for the electronic device to exchange data with an external device. The I / O interface can represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of a variety of bus structures.

[0152] It should be understood that Figure 7The electronic device shown is only an example of the present invention, and the electronic device of the present invention may also include elements or components not shown in the above examples. For example, some electronic devices also include display units such as display screens, and some electronic devices also include human-computer interaction elements such as buttons, keyboards, etc. As long as the electronic device can execute the computer-readable program in the memory to implement the method of the present invention or at least part of the steps of the method, it can be considered as an electronic device covered by the present invention.

[0153] Through the above description of the implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Figure 8 As shown, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of commands to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the embodiment of the present invention.

[0154] The software product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0155] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, device, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0156] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0157] The computer-readable medium carries one or more programs (eg, computer-executable programs). When the one or more programs are executed by a device, the computer-readable medium implements the method of the present disclosure.

[0158] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.

[0159] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the exemplary embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several commands to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present invention.

[0160] The exemplary embodiments of the present invention are specifically shown and described above. It should be understood that the present invention is not limited to the detailed structure, configuration or implementation method described herein; on the contrary, the present invention is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.

Claims

1. A method for automatic layout of architecture diagrams, It is characterized in that include: Based on the LMM model, determine the architecture keywords and hierarchical relationships of the framework diagram to be constructed from the specified document; According to the determined architecture keywords and hierarchical relationships, the node relationships are formatted and saved; Based on the recursive process, global area calculation and recursive area division are performed to construct the initial architecture diagram. The global area calculation includes calculating the maximum area of ​​the architecture diagram, determining the size and position of the node borders of nodes at all levels and the area occupied, including: according to the level depth h, the number of framework diagram keywords k, and the number of nodes j of the framework diagram keywords, the following expression is used to calculate the maximum area of ​​the framework diagram to be constructed: S=k*800+(2*j+1)*300+d*200 Among them, S represents the maximum area of ​​the framework diagram to be constructed, in pixels px; k represents the total number of characters of the framework diagram keywords; j represents the number of framework diagram keywords, that is, the total number of nodes j in the architecture diagram; d represents the total hierarchical depth, specifically the cumulative depth from the lowest node to the highest node; according to the calculated maximum area and the aspect ratio of the set highest-level border, the height and width of the highest-level border are determined; according to the determined height and width of the highest-level border, the initial size and position of the node borders of nodes at all levels are determined to complete the node grouping of the framework diagram to be constructed; Judging each node according to the constraint conditions to determine whether to update, including: according to the reverse propagation process, specifically in the reverse propagation process from the minimum node to the maximum node, performing size constraint checks and same-level node border consistency checks according to the constraint conditions, and completing the reverse update of the initial architecture diagram; if the area to be allocated has passed the size constraint check, it indicates that the traversal of the same-level nodes corresponding to the current node has been completed, that is, there is no need to reversely update the initial architecture diagram; if the area to be allocated has passed the size constraint check, and the traversal of the same-level nodes corresponding to the current node has been completed, it indicates that the traversal of all nodes has been completed, and then the initial structure diagram is output; Adjust the initial architecture diagram according to the updated architecture keywords.

2. The automatic layout method of architecture diagram according to claim 1, It is characterized in that The height of the node border is at least 1.5 to 2 times greater than the font size of the architecture keyword contained in the node border.

3. The automatic layout method of architecture diagram according to claim 1, It is characterized in that The step of formatting and saving the node relationship includes: Determine the level, direction and order of each node, and save them in a string format. The string format includes the framework diagram keyword as the name, the order of the level of each node, and the name list of the next level nodes of each node.

4. The automatic layout method of architecture diagram according to claim 1, It is characterized in that According to different application scenarios and requirements, given sample templates and keyword templates are input into the LMM large model to extract the architecture keywords of the framework diagram to be constructed. The application scenarios include human-computer management scenarios and software development. Classify and organize according to the level of the framework diagram to be constructed to form an orderly keyword system, which includes the upper and lower hierarchical relationship and left and right order of the architecture keywords.

5. An automatic layout system for an architecture diagram, using the automatic layout method for an architecture diagram according to any one of claims 1 to 4, It is characterized in that include: The first determination module determines the architecture keywords and hierarchical association relationships of the framework diagram to be constructed from the specified document based on the LMM model; The storage processing module formats and saves the node relationship according to the determined architecture keywords and hierarchical association relationships; The first construction module performs global area calculation and recursive area division based on a recursive process to construct an initial architecture diagram. The global area calculation includes calculating the maximum area of ​​the architecture diagram, determining the size and position of the node borders of nodes at all levels and the area occupied, including: according to the level depth h, the number of framework diagram keywords k, and the number of nodes j of the framework diagram keywords, the following expression is used to calculate the maximum area of ​​the framework diagram to be constructed: S=k*800+(2*j+1)*300+d*200 Among them, S represents the maximum area of ​​the framework diagram to be constructed, in pixels px; k represents the total number of characters of the framework diagram keywords; j represents the number of framework diagram keywords, that is, the total number of nodes j in the architecture diagram; d represents the total hierarchical depth, specifically the cumulative depth from the lowest node to the highest node; according to the calculated maximum area and the aspect ratio of the set highest-level border, the height and width of the highest-level border are determined; according to the determined height and width of the highest-level border, the initial size and position of the node borders of nodes at all levels are determined to complete the node grouping of the framework diagram to be constructed; The second determination module judges each node according to the constraint conditions to determine whether to update, including: according to the reverse propagation process, specifically in the reverse propagation process from the minimum node to the maximum node, the size constraint check and the consistency check of the border of the same-level node are performed according to the constraint conditions to complete the reverse update of the initial architecture diagram; if the area to be allocated has passed the size constraint check, it indicates that the traversal of the same-level nodes corresponding to the current node has been completed, that is, there is no need to reversely update the initial architecture diagram; if the area to be allocated has passed the size constraint check and the traversal of the same-level nodes corresponding to the current node has been completed, it indicates that the traversal of all nodes has been completed, and the initial structure diagram is output; The second construction module adjusts the initial architecture diagram according to the updated architecture keywords to complete the construction of the architecture diagram to be constructed.