Interactive flow chart intelligent connection layout system
Through the interactive flowchart intelligent connection layout system, the automatic obstacle avoidance, force-oriented graph algorithm, interactive adjustment and intelligent recommendation module are used to solve the problem of confusion and overlapping connections in traditional flowchart drawing tools, achieving efficient and beautiful appearance flowchart design and optimization.
Patent Information
- Application Number
- CN202411646147.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-02-18
AI Technical Summary
Traditional flowchart drawing tools lack intelligent functions, resulting in confusion of connections and overlapping nodes, affecting the readability and aesthetics of flowcharts, and it is difficult to optimize and adjust the layout of the flowcharts that have been drawn.
Develop an interactive flowchart intelligent connection layout system, including automatic obstacle avoidance connection module, process layout optimization module, interactive adjustment module and intelligent recommendation module. Through the combination of these modules, intelligent generation, optimization and adjustment flowchart connection can be achieved. Line layout.
The production efficiency of flowcharts and user interaction experience are improved, and the generated flowcharts are clearer and more coordinated. Users can easily modify and optimize the flowcharts to meet diverse needs.
Smart Images

Figure CN119475943A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software design, and in particular to an interactive flow chart intelligent connection layout system. Background Art
[0002] In modern software development and system design, flowcharts are a commonly used visualization tool for describing business processes, algorithm logic, or system architecture. However, as flowcharts become more complex, manually drawing and optimizing them becomes increasingly difficult.
[0003] Traditional flowchart drawing tools often lack intelligent functions and cannot intelligently generate, optimize and adjust the connection layout of flowcharts. For example, problems such as confusing connections and overlapping nodes often affect the readability and aesthetics of flowcharts. In addition, designers usually use automatic connection tools to draw connecting lines between the starting node and the target node, but the generated connection curves often intersect with existing connection curves, or the generated connection curves bypass the node layer, forming unnecessary bends or broken lines, affecting the readability and aesthetics of the connection curves. Designers have to use the most basic straight line tool to draw multiple straight line segments and splice them to generate connection curves. Not only is it difficult to accurately connect the individual straight line segments, it is also difficult to adjust the style of the spliced connection curves (such as setting different fillets, etc.). In addition, it is difficult to optimize and adjust the layout of the already drawn flowchart. For example, it is difficult to automatically adjust the position of the nodes and the connection lines (for example, the connection lines do not support passing through the node layer or only support passing through the entire node layer, which is difficult to meet design needs) to clearly display the connection path between the nodes and make the entire flowchart layout more reasonable and beautiful.
[0004] To solve the above problems, the present invention develops an interactive flowchart intelligent connection layout system to intelligently generate, optimize and adjust the flowchart connection layout, thereby improving the flowchart production efficiency and user interaction experience. Summary of the Invention
[0005] In view of the above problems, an interactive flowchart intelligent connection layout system is proposed to facilitate the intelligent generation, optimization and adjustment of flowchart connection layout, thereby improving the flowchart production efficiency and user interaction experience.
[0006] The present invention provides an interactive flow chart intelligent connection layout system, comprising:
[0007] An automatic obstacle avoidance connection module is used to plan paths for each node layer and treat each node layer as an obstacle to obtain a process connection line; wherein the node layer also includes a preset starting layer within it, and the process connection line is a connecting curve or Bezier curve composed of multiple straight line segments;
[0008] The process layout optimization module is used to optimize the layout of each node layer and the corresponding process connection lines based on the force-directed graph algorithm; and to adjust the cross-connections and overlapping connections between each node layer based on the genetic algorithm;
[0009] An interactive adjustment module is used to generate corresponding Bezier connection curves according to the movement path drawn by the user; and to adjust the corresponding process connection lines according to the movement position of each node layer;
[0010] The intelligent recommendation module is used to recommend flowchart connection lines with personalized layout styles based on the user's multiple historical process connection lines and corresponding operation records.
[0011] In an optional manner, performing path planning on each node layer and treating each node layer as an obstacle to obtain a process connection line further includes:
[0012] Set the start node and target node, where the start node and target node are the boundary center points or specified points of the node layer or the preset start layer;
[0013] Node layers with internal preset start layers are considered as penetrable areas, and node layers without internal preset start node layers are considered as obstacles;
[0014] Map each node layer and the preset starting layer to the search space, and search for the optimal path from the starting node to the target node in the search space; wherein the optimal path does not intersect or completely overlap with other connection curves;
[0015] Generate a connection line connecting the start node and the target node according to the optimal path.
[0016] In an optional manner, the optimizing the layout of each node layer and the corresponding process connection line according to the force-directed graph algorithm further includes:
[0017] Treat each node layer as a simulated particle and calculate the stance between any two node layers based on the distance and degree between them. The stance includes the repulsive force between the node layers and the attractive force between the interconnected node layers.
[0018] The offset of the node layer position is calculated according to the force field between the node layers, and the position of the node layer is updated according to the offset. After multiple iterations, the position of each node layer reaches a dynamic equilibrium state.
[0019] In an optional manner, the calculation formula for the repulsive force between the node layers is:
[0020]
[0021] Among them, k r is the repulsion coefficient, which is used to adjust the magnitude of the repulsion; d(i,j) is the distance between node layers i and j; α is the repulsion index, which is used to control the rate at which the repulsion changes with distance; degree(i) and degree(j) are the degrees of node layers i and j, respectively, that is, the number of node layers connected to node layers i and j;
[0022] The calculation formula of the gravitational force between the node layers is:
[0023]
[0024] Among them, k a is the gravity coefficient, which is used to adjust the magnitude of gravity; β is the gravity exponent, which is used to control the rate at which gravity changes with distance; edge_weight(i,j) is the weight of the connection line between node layers i and j;
[0025] The calculation formula of the offset is:
[0026]
[0027] Among them, pos j and pos i are the current position coordinates of node layers i and j respectively; ‖pos j -pos i ‖ is the modulus of the distance between node layers i and j; η is the oscillation coefficient, which is used to control the amplitude of position updates.
[0028] In an optional manner, adjusting the cross connections and overlapping connections between the node layers according to the genetic algorithm further includes:
[0029] Encode the starting points of the connection lines between each node layer and use a random set of connection lines as the initial population;
[0030] Set the fitness function based on the inverse of the number of crossing and overlapping links, the length of the links, and the angle;
[0031] Evaluate the fitness of each individual in the initial population according to the fitness function and select the best individuals as parents;
[0032] Perform mutation operations on the individuals of the parent generation to generate individuals of the child generation, and repeat the operation until a predetermined number of iterations or convergence conditions are reached; wherein the mutation operation is to randomly change the starting and ending coordinates of the connecting line, thereby changing the position and intersection state of the connecting line;
[0033] Among them, the fitness function is:
[0034]
[0035] Where λ is the weight coefficient, which is used to balance the weight between the number of crossing and overlapping links and the length and angle of the links; N cross N is the number of cross-connections in the flowchart layout. A cross-connection means two or more connections intersect in the layout. overlap is the number of completely overlapping lines in the flowchart layout; Represents the sum of the lengths of all lines, N lines is the total number of connections, L i is the length of the i-th line; is the sum of all connecting line angles, N angles is the angle quantity, θ j is the metric value of the j-th angle.
[0036] In an optional manner, generating a corresponding Bezier connection curve according to the movement path drawn by the user further includes:
[0037] Record the starting point, end point and coordinates of each control point of the moving path during the drawing process;
[0038] Calculate multiple nodes of the moving path according to the third-order Bezier curve formula;
[0039] Draws a connected Bezier curve based on multiple nodes.
[0040] In an optional manner, the method further includes:
[0041] Calculate each curvature mutation point of the Bezier connection curve, and draw a connection curve consisting of multiple straight line segments according to the starting point, each curvature mutation point and the end point of the Bezier connection curve;
[0042] The straight line segment is parallel or perpendicular to the boundary line of the adjacent node layer. The straight line segment changes direction at a 90-degree angle at a curvature mutation point and extends toward the next curvature mutation point.
[0043] In an optional manner, the calculating of each curvature mutation point of the Bezier connection curve further includes:
[0044] Calculate the curvature of each node along the Bezier curve;
[0045] The curvature of the current node is compared with the curvature of the previous node. If the change in curvature exceeds a preset threshold, the current node is determined to be a curvature mutation point.
[0046] In an optional manner, the recommending of flowchart connection lines with a personalized layout style based on the user's multiple historical flowchart connection lines and corresponding operation records further includes:
[0047] Extract the style layout and operation records of process connection lines from the user's historical flowcharts. The style layout includes the layer type, sublayer type, number, in-degree, and out-degree of the node layer, as well as the curve type, arrow type, fillet, color, and width of the connection line. The operation records include the adjustment frequency and adjustment path of the node layer and connection line.
[0048] According to the style layout and operation records of the process connection lines, the user's operation habits and visual preferences are analyzed to obtain a visual style list of the flow chart connection lines;
[0049] The connector line style of the current flowchart is previewed in the visual style list to help users select the connector line style that suits their preference.
[0050] In an optional manner, the process connection line is a connection curve composed of multiple straight line segments;
[0051] The searching for the optimal path from the starting node to the target node in the search space further includes:
[0052] Divide the search space into grid lines that are parallel or perpendicular to the boundaries of the start and goal nodes, and mark the grid lines that intersect with obstacles as impassable;
[0053] The shortest distance from the current node to the target node along the grid line is defined as the heuristic function;
[0054] Initialize the open list and the closed list, where the open list contains the nodes to be visited and the closed list contains the nodes that have been visited;
[0055] Take the grid node with the smallest heuristic function value from the open list as the current grid path. If the adjacent grid node is already in the open list, but the grid path through the current grid node to reach the adjacent grid node has a smaller heuristic function value than the current grid path, update the parent node and heuristic function value of the adjacent grid node.
[0056] Starting from the target node, trace back along the parent node to the start node to generate the optimal path from the start node to the target node;
[0057] Among them, the constraints of the optimal path include: the optimal path is composed of various straight line segments, each straight line segment is perpendicular or parallel to the node layer, the change angle of each straight line segment is 90 degrees, and each straight line segment does not pass through the node layer considered as an obstacle.
[0058] The solution provided by the above embodiment of the present invention includes an automatic obstacle avoidance connection module for performing path planning for each node layer and treating each node layer as an obstacle to obtain a process connection line; wherein the node layer also includes a preset starting layer within it, and the process connection line is a connection curve or Bezier curve composed of multiple straight line segments; a process layout optimization module for optimizing the layout of each node layer and the corresponding process connection line according to a force-directed graph algorithm; and adjusting the cross-connections and overlapping connections between each node layer according to a genetic algorithm; an interactive adjustment module for generating corresponding Bezier connection curves based on the movement path drawn by the user; and adjusting the corresponding process connection line according to the movement position of each node layer; and an intelligent recommendation module for recommending flowchart connection lines with a personalized layout style based on the user's multiple historical process connection lines and corresponding operation records. The present invention can intelligently plan paths for each node layer, treating the node layer as an obstacle, and generating collision-free process connection lines, which not only improves the efficiency of flowchart drawing but also makes the generated flowchart clearer. The force-directed graph algorithm is used to optimize the layout of the node layer and its connection lines, making the flowchart more coordinated and more readable. Automatically generate corresponding Bezier connection curves based on the user's drawn movement path, making it easy to modify and optimize flowcharts. By analyzing the user's historical process connection lines and operation records, it recommends flowchart connection lines that match the user's personalized layout style to meet the user's diverse needs.
[0059] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above description and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0061] Figure 1 A functional structure diagram of an interactive flow chart intelligent wiring layout system device according to an embodiment of the present invention is shown;
[0062] Figure 2 A schematic diagram showing a node layer and a preset starting layer therein according to an embodiment of the present invention is shown;
[0063] Figure 3 A schematic diagram of process connection lines in an embodiment of the present invention is shown;
[0064] Figure 4 A schematic diagram of adjusting the process connection line according to an embodiment of the present invention is shown;
[0065] Figure 5 A schematic diagram showing generation of a connection curve according to a moving path according to an embodiment of the present invention is shown;
[0066] Figure 6 A schematic diagram showing a Bezier curve according to an embodiment of the present invention is shown;
[0067] Figure 7 A schematic diagram of a force-directed diagram of process connection lines according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0068] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0069] Before implementing the embodiments of the present invention, the following technical terms or custom terms are uniformly explained here:
[0070] Layers: These are like images containing text or graphics, stacked one on top of another to create the final page. Layers can precisely position elements on a page. In this application, you can add text, shapes, images, and more to a layer, and you can also nest layers within layers.
[0071] Figure 1 The functional structure diagram of the interactive flow chart intelligent connection layout system according to an embodiment of the present invention is shown. Figure 1 As shown, it includes an automatic obstacle avoidance connection module 101, a process layout optimization module 102, an interactive adjustment module 103 and an intelligent recommendation module 104.
[0072] Among them, the automatic obstacle avoidance connection module 101 is used to plan the path for each node layer, and regard each node layer as an obstacle to obtain a process connection line; wherein, the node layer also includes a preset starting layer inside it, and the process connection line is a connecting curve or Bezier curve composed of multiple straight line segments.
[0073] In this embodiment, by treating the node layer as an obstacle, a collision-free process connection line can be generated, which improves the readability of the connection line. The process connection line not only supports connection curves composed of multiple straight line segments, but also supports Bezier curves, etc., meeting the user's diverse needs for flowcharts. Figure 2 、 Figure 3As shown, four node layers S1, S2, S3, and S4 are included (i.e., the layers are used as nodes of the flowchart). Each node layer may include layers such as text, shape, and picture. For example, the interior of node layer S1 includes the "cherry" layer V1, and the interior of node layer S2 includes the V2 layer (left arrow) and the V3 layer ("..." operation layer). The "cherry" layer in node layer S1 is used as the starting node, and node layer S2 is used as the target node to generate the connection line C2. For node layers with an internal preset starting layer (such as node layer S1 with an internal layer V1), the node layer is regarded as a penetrable area (the connection line C2 can pass horizontally through node layer S1). For node layers that do not have an internal preset starting layer (such as node layer S4), they are regarded as obstacles, and the connection line cannot pass through the node layer. The target node or starting node of the corresponding connection line (such as connection lines C4 and C6) is the boundary center point of the node layer (such as the upper boundary center point or the right boundary center point, etc.).
[0074] Map each node layer and the preset starting layer to the search space for path planning, define grid lines in the search space to simplify the path search process, and search for the optimal path from the starting node to the target node in the search space. Generate the following according to the optimal path found: Figure 3 The flowchart connecting the starting and target nodes is shown as a connecting line. The connecting line can be a connecting curve composed of multiple straight line segments, or a curve type such as a Bezier curve. Figure 2 As shown, the layer V1 in the node layer S1 is used as the starting node, the node layer S2 is used as the target node, the layer V2 in the node layer S2 is used as the starting node, the node layer S1 is used as the target node, and the settings are as follows Figure 2 After the start node and target node shown in the figure, you can generate the following Figure 3 The corresponding process connection curves are shown.
[0075] The process layout optimization module 102 is used to optimize the layout of each node layer and the corresponding process connection lines according to the force-directed graph algorithm; and to adjust the cross-connections and overlapping connections between each node layer according to the genetic algorithm.
[0076] The principle of the force-directed graph algorithm is: the relationship network is regarded as a virtual physical system, and each node is regarded as a discharged particle with energy. There is a repulsive force between particles, which makes each node repel each other. At the same time, the particles are connected by "edges" to generate a spring-like gravitational force to restrain the particles at both ends of the edge. Under the continuous action of the repulsive and attractive forces between particles, the particles are constantly displaced from the random and disordered initial state, and gradually tend to the balanced and ordered final state. After several iterations, there is no relative displacement between the particles, and the relationship network reaches a stable equilibrium state, that is, the energy tends to zero. In this embodiment, the attraction and repulsion between the nodes are calculated by the force-directed graph algorithm, and the position of the nodes can be automatically adjusted to clearly display the connection path between the nodes, making the entire flow chart layout more reasonable and beautiful, and improving the user's operating experience. Figure 7 As shown, when the generated process connection curves are as shown on the left (with node layer L1) and the left second (with node layer L2), you can click the layout optimization menu, or manually drag layer L1 or L2, and each node layer will be dynamically adjusted multiple times to generate a process curve diagram as shown on the left third (with node layer L3).
[0077] By using genetic algorithms to globally search for the optimal layout and continuously iteratively adjusting the cross-connections and overlapping connections between each node layer, the optimal or near-optimal layout solution can be found, thereby eliminating the cross-connections and completely overlapping connections between each node layer.
[0078] The interactive adjustment module 103 is configured to generate a corresponding Bezier connection curve according to the movement path drawn by the user; and to adjust the corresponding process connection line according to the movement position of each node layer.
[0079] In this embodiment, for process connection lines that do not meet user expectations, users can delete them and then redraw them. In the prior art, designers usually use automatic connection tools, and then use the mouse to drag the inspiration node and the target node to generate a connection curve between the two. However, the generated connection curve often intersects with the existing connection curve, or the generated connection curve bypasses the node layer, forming unnecessary bends or broken lines, which affects the readability and aesthetics of the connection curve. Designers have to use the most basic straight line tool to draw multiple straight line segments for splicing to generate connection curves. Not only are the straight line segments not easy to accurately connect, but it is also difficult to adjust the style of the spliced connection curve (such as setting different fillets, etc.). Figure 5As shown, the designer can use the free curve tool to draw a moving path including a starting point and an end point (as shown by the dotted line), and then generate a corresponding connecting curve with rounded corners composed of multiple straight line segments according to the moving path drawn by the user, or it can be a Bezier connecting curve. It can be seen that the interactive curve drawing method provided by this embodiment combines the respective advantages of the automatic connection tool and the free curve tool, and automatically generates a corresponding connecting curve according to the moving path drawn by the user, which can be a combination of straight line segments with rounded corners or a smooth Bezier connecting curve. The generated connecting curve serves as an independent design layer or component, and its design style such as rounded corners, color, line width, etc. can be adjusted more conveniently. And, as Figure 4 As shown in the figure, adjusting the position of the node layer (node state 1 to node state 2) and then adjusting the corresponding process connection line (curve state 1 to curve state 2) not only improves the design efficiency, but also ensures the consistency and aesthetics of the connection curve layout.
[0080] The intelligent recommendation module 104 is used to recommend flowchart connection lines with a personalized layout style based on the user's multiple historical process connection lines and corresponding operation records.
[0081] In this embodiment, based on the user's multiple historical process connection lines and operation records, the user's preferences and style are learned, and flowchart connection lines that meet the user's personalized needs are recommended. For example, by collecting the user's historical process connection line data and finding that the user frequently selects blue, rounded, and thicker connection lines, the existing flowchart connection line library is searched for connection lines that match the user's preferences and a recommended list is generated. The user can preview the style of each connection line one by one in the recommended list, select the connection line that meets their needs, and apply it to the current flowchart.
[0082] In an optional manner, performing path planning on each node layer and treating each node layer as an obstacle to obtain a process connection line further includes:
[0083] Set the start node and target node, where the start node and target node are the boundary center points or specified points of the node layer or the preset start layer;
[0084] Node layers with internal preset start layers are considered as penetrable areas, and node layers without internal preset start node layers are considered as obstacles;
[0085] Map each node layer and the preset starting layer to the search space, and search for the optimal path from the starting node to the target node in the search space; wherein the optimal path does not intersect or completely overlap with other connection curves;
[0086] Generate a connection line connecting the start node and the target node according to the optimal path.
[0087] In this embodiment, Figure 3 As shown, users can customize the starting node and target node, such as defining layer V1 as the starting node in node layer S1 and node layer S2 as the target node to generate connection line C2, or defining layer V2 as the starting node and node layer S1 as the target node in node layer S2 to generate connection line C1. That is, not only can you specify a node layer (the default is the center point of the boundary) as the starting node or target node, you can also set the internal layer of the node layer as the starting node or target node (such as connection line C1, which penetrates node layer S2 from the starting node V2 to the center point of the upper boundary of node layer S1). It can adapt to different layer configurations, enhance the flexibility of path planning, and can meet more complex path planning requirements. When looking for the optimal path in the search space, the optimal path does not intersect or completely overlap with other connection curves, and the generated flowchart connection lines are clearer.
[0088] Specifically, node layers and preset starting layers are defined, and node layers with internal preset starting layers are marked as penetrable areas, and the rest are obstacles. All node layers and preset starting layers are mapped into a two-dimensional search space. In the search space, an algorithm such as the A* path search algorithm is used to find the optimal path from the starting node to the target node. Constraints include the length of the path, obstacles (i.e., impenetrable node layers), and avoiding intersections or complete overlaps with other connecting curves. Based on the optimal path searched, a connecting line connecting the starting node and the target node is generated. The connecting line can be optimized by smoothing, avoiding sharp turns, and other optimization processes to improve the aesthetics of the connecting path.
[0089] In an optional manner, the optimizing the layout of each node layer and the corresponding process connection line according to the force-directed graph algorithm further includes:
[0090] Treat each node layer as a simulated particle and calculate the stance between any two node layers based on the distance and degree between them. The stance includes the repulsive force between the node layers and the attractive force between the interconnected node layers.
[0091] The offset of the node layer position is calculated according to the force field between the node layers, and the position of the node layer is updated according to the offset. After multiple iterations, the position of each node layer reaches a dynamic equilibrium state.
[0092] In this embodiment, by simulating the force field between particles, after multiple iterations, the position of the node layer reaches a dynamic equilibrium state, the layout of the node layer is more intuitive, and the overlap and confusion of the node layer are avoided. Specifically, each node layer is regarded as a simulated particle, and the repulsive and attractive forces between any two node layers are calculated based on the distance and degree between the node layers. The repulsive force is adjusted according to the principle that the degree of the two node layers is proportional, so that the node layer with loose connection is closer to the node layer with tight connection. The attractive force is calculated based on the connection relationship between the node layers to ensure that the node layers connected to each other maintain an appropriate distance. The offset of each node layer position is calculated according to the force field, and the position of the node layer is updated according to the offset to ensure that the node layer moves to a more reasonable layout after each iteration until the position of each node layer reaches a dynamic equilibrium state. The condition for judging the equilibrium state can be that the offset of the node layer position is less than a preset threshold, or the number of iterations reaches a preset maximum value.
[0093] In this embodiment, the calculation formula for the repulsive force between node layers is:
[0094]
[0095] Among them, k r is the repulsion coefficient, which is used to adjust the magnitude of the repulsion; d(i,j) is the distance between node layers i and j; α is the repulsion index, which is used to control the rate at which the repulsion changes with distance; degree(i) and degree(j) are the degrees of node layers i and j, respectively, that is, the number of node layers connected to node layers i and j;
[0096] The formula for calculating the gravitational force between node layers is:
[0097]
[0098] Among them, k a is the gravity coefficient, which is used to adjust the magnitude of gravity; β is the gravity exponent, which is used to control the rate at which gravity changes with distance; edge_weight(i,j) is the weight of the connection line between node layers i and j;
[0099] The offset is calculated as:
[0100]
[0101] Among them, pos j and pos i are the current position coordinates of node layers i and j respectively; ‖pos j -pos i ‖ is the modulus of the distance between node layers i and j; η is the oscillation coefficient, which is used to control the amplitude of position updates.
[0102] In an optional manner, adjusting the cross connections and overlapping connections between the node layers according to the genetic algorithm further includes:
[0103] Encode the starting points of the connection lines between each node layer and use a random set of connection lines as the initial population;
[0104] Set the fitness function based on the inverse of the number of crossing and overlapping links, the length of the links, and the angle;
[0105] Evaluate the fitness of each individual in the initial population according to the fitness function and select the best individuals as parents;
[0106] Perform mutation operations on the individuals of the parent generation to generate individuals of the child generation, and repeat the operation until a predetermined number of iterations or convergence conditions are reached; wherein the mutation operation is to randomly change the starting and ending coordinates of the connecting line, thereby changing the position and intersection state of the connecting line;
[0107] Among them, the fitness function is:
[0108]
[0109] Where λ is the weight coefficient, which is used to balance the weight between the number of crossing and overlapping links and the length and angle of the links; N cross N is the number of cross-connections in the flowchart layout. A cross-connection means two or more connections intersect in the layout. overlap is the number of completely overlapping lines in the flowchart layout; Represents the sum of the lengths of all lines, N lines is the total number of connections, L i is the length of the i-th line; is the sum of all connecting line angles, N angles is the angle number, θ j is the metric value of the j-th angle.
[0110] In this embodiment, the cross-connections and overlapping connections between each node layer are adjusted according to the genetic algorithm. Since the genetic algorithm is insensitive to the initial population and parameter settings and has strong robustness, even if the initial population is not properly selected or the parameter settings are unreasonable, the genetic algorithm can gradually approach the optimal solution through iterative evolution.
[0111] Specifically, the starting points of the connection lines between each node layer are encoded according to the number of node layers and the complexity of the connection lines, and encoding methods such as binary, real numbers or symbols can be used.
[0112] A set of connecting lines is randomly generated as the initial population, and a fitness function is set based on factors such as the inverse of the number of crossing and overlapping lines, the length of the lines, and the angle of the lines. The fitness function can reflect the quality of the connecting line layout and guide the search direction of the genetic algorithm. In this embodiment, the fitness function is:
[0113]
[0114] Where λ is a weight coefficient that balances the number of cross-links and overlapping links with the length and angle of the links. The value of λ ranges from 0 to 1. When λ is close to 1, the fitness function focuses more on reducing the number of cross-links and overlapping links; when λ is close to 0, the fitness function focuses more on optimizing the length and angle of the links. cross The number of cross-connections in the flowchart layout. A cross-connection means two or more connections intersect in the layout. N overlap is the number of completely overlapping lines in the flowchart layout. Represents the sum of the lengths of all lines, N lines is the total number of connections, L i is the length of the i-th line. The shorter the line length, the more compact the layout, which may cause the lines to be too dense, increasing the risk of crossing and overlapping. is the sum of all connecting angles. N angles is the angle quantity, θ j is the metric value of the j-th angle, which is used to evaluate the smoothness of the layout.
[0115] The fitness of each individual in the initial population is evaluated, and the best individuals are selected as parents. Roulette wheel selection, tournament selection, and other methods can be used to ensure the diversity and quality of the parent individuals. This article does not specify the specific selection method.
[0116] Crossover operations, such as one-point crossover, two-point crossover, and uniform crossover, are performed on the parent individuals to generate offspring individuals. Mutation operations are then performed on the offspring individuals, randomly changing the starting and ending coordinates of the connecting lines, thereby changing the position and crossover state of the connecting lines. The crossover, mutation, and fitness evaluation operations are repeated until a predetermined number of iterations is reached or convergence conditions are met. The convergence condition is that the change in the fitness function value reaches a preset threshold.
[0117] In an optional manner, generating a corresponding Bezier connection curve according to the movement path drawn by the user further includes:
[0118] Record the starting point, end point and coordinates of each control point of the moving path during the drawing process;
[0119] Calculate multiple nodes of the moving path according to the third-order Bezier curve formula;
[0120] Draws a connected Bezier curve based on multiple nodes.
[0121] Although the shape of the curve can be well controlled through the control points of the Bezier curve, designers can freely adjust the curve's curvature, direction, length and other properties. However, the Bezier curve requires a learning process, and many novice users find it difficult to get started. In this embodiment, the corresponding Bezier connection curve is generated according to the moving path drawn by the user. The automatically generated Bezier connection curve can fit the moving path drawn by the user very well, maintaining the smoothness and beauty of the curve. The user does not need to manually set the control points of the Bezier curve. Only a simple drawing of the moving path is required to automatically complete the generation of the Bezier curve, which greatly reduces the difficulty of operation. Novice users can also get started easily. The automatic generation of the Bezier connection curve reduces the time of manually setting the control points. Designers can devote more energy to creative ideas and detail optimization without having to spend energy learning the control point adjustment techniques of the Bezier curve. They can also enjoy the convenience brought by the Bezier curve, thereby improving the overall user experience. Optionally, the user directly draws the connection curve using the Bezier curve tool.
[0122] Specifically, if Figure 5 、 Figure 6 As shown in the figure, when the user draws the moving path, the coordinates of the starting point, end point and each control point of the path are recorded in real time. The control points can be specified by the user by clicking, dragging, etc.
[0123] Based on the recorded control point coordinates, the third-order Bezier curve formula is used to calculate the multiple nodes of the movement path. A third-order Bezier curve requires four control points (the starting point, two intermediate control points, and the end point), and any node on the curve is calculated using these four points. The node coordinates of the Bezier curve can be solved using a recursive algorithm or numerical methods (such as interpolation). The Bezier connection curve is then drawn based on the calculated node coordinates.
[0124] In an optional manner, the method further includes:
[0125] Calculate each curvature mutation point of the Bezier connection curve, and draw a connection curve consisting of multiple straight line segments according to the starting point, each curvature mutation point and the end point of the Bezier connection curve;
[0126] The straight line segment is parallel or perpendicular to the boundary line of the adjacent node layer. The straight line segment changes direction at a 90-degree angle at a curvature mutation point and extends toward the next curvature mutation point.
[0127] In this embodiment, Figure 5As shown in the figure, simplifying the complex Bezier connecting curve into a connecting curve composed of multiple straight line segments can not only retain the starting point, various curvature mutation points and end point of the Bezier connecting curve, but also ensure that the connecting curve retains the key features of the original curve (such as the direction of the curve and the main inflection points), thereby making up for the shortcomings of the Bezier curve and reducing the difficulty of curve processing.
[0128] In an optional manner, the calculating of each curvature mutation point of the Bezier connection curve further includes:
[0129] Calculate the curvature of each node along the Bezier curve;
[0130] The curvature of the current node is compared with the curvature of the previous node. If the change in curvature exceeds a preset threshold, the current node is determined to be a curvature mutation point.
[0131] In this embodiment, by presetting the curvature change threshold, the curvature mutation points of different types of Bezier connection curves can be quickly screened.
[0132] Specifically, the curvature of each node is calculated by derivation of the curve equation along the Bezier connection curve. For Bezier curves of third order or higher order, the curvature of the node is approximately calculated using the difference method.
[0133] The curvature of the current node is compared with the curvature of the previous node. If the change in curvature exceeds a preset threshold, the current node is considered to be a curvature mutation point.
[0134] According to the comparison result of the curvature change, all the curvature mutation points on the Bezier connection curve are determined.
[0135] In an optional manner, the recommending of flowchart connection lines with a personalized layout style based on the user's multiple historical flowchart connection lines and corresponding operation records further includes:
[0136] Extract the style layout and operation records of process connection lines from the user's historical flowcharts. The style layout includes the layer type, sublayer type, number, in-degree, and out-degree of the node layer, as well as the curve type, arrow type, fillet, color, and width of the connection line. The operation records include the adjustment frequency and adjustment path of the node layer and connection line.
[0137] According to the style layout and operation records of the process connection lines, the user's operation habits and visual preferences are analyzed to obtain a visual style list of the flow chart connection lines;
[0138] The connector line style of the current flowchart is previewed in the visual style list to help users select the connector line style that suits their preference.
[0139] In this embodiment, by analyzing the user's historical operation records and visual preferences, flowchart connection line styles that meet the user's personalized needs are recommended and the connection line style effects are previewed through the preview function, so the user does not need to design the flowchart connection line style from scratch.
[0140] In an optional manner, the process connection line is a connection curve composed of multiple straight line segments;
[0141] The searching for the optimal path from the starting node to the target node in the search space further includes:
[0142] Divide the search space into grid lines that are parallel or perpendicular to the boundaries of the start and goal nodes, and mark the grid lines that intersect with obstacles as impassable;
[0143] The shortest distance from the current node to the target node along the grid line is defined as the heuristic function;
[0144] Initialize the open list and the closed list, where the open list contains the nodes to be visited and the closed list contains the nodes that have been visited;
[0145] Take the grid node with the smallest heuristic function value from the open list as the current grid path. If the adjacent grid node is already in the open list, but the grid path through the current grid node to reach the adjacent grid node has a smaller heuristic function value than the current grid path, update the parent node and heuristic function value of the adjacent grid node.
[0146] Starting from the target node, trace back along the parent node to the start node to generate the optimal path from the start node to the target node;
[0147] Among them, the constraints of the optimal path include: the optimal path is composed of various straight line segments, each straight line segment is perpendicular or parallel to the node layer, the change angle of each straight line segment is 90 degrees, and each straight line segment does not pass through the node layer considered as an obstacle.
[0148] In this embodiment, Figure 3 As shown, there are countless paths from the starting node to the target node (such as connecting line C1). A heuristic algorithm is used to select the optimal connection path (which is also the most aesthetically pleasing and concise connection path). The constraints of the optimal path include: the optimal path is composed of individual straight line segments, each straight line segment is perpendicular or parallel to the node layer, the change angle of each straight line segment is 90 degrees, and each straight line segment does not pass through the node layer considered an obstacle. Optionally, the constraint also includes that the change angle position of each straight line segment is midway between the starting node and the target node or at the golden section point to improve the aesthetics of the connection path.
[0149] The solution provided by the above embodiment of the present invention includes an automatic obstacle avoidance connection module for performing path planning for each node layer and treating each node layer as an obstacle to obtain a process connection line; wherein the node layer also includes a preset starting layer within it, and the process connection line is a connection curve or Bezier curve composed of multiple straight line segments; a process layout optimization module for optimizing the layout of each node layer and the corresponding process connection line according to a force-directed graph algorithm; and adjusting the cross-connections and overlapping connections between each node layer according to a genetic algorithm; an interactive adjustment module for generating corresponding Bezier connection curves based on the movement path drawn by the user; and adjusting the corresponding process connection line according to the movement position of each node layer; and an intelligent recommendation module for recommending flowchart connection lines with a personalized layout style based on the user's multiple historical process connection lines and corresponding operation records. The present invention can intelligently plan paths for each node layer, treating the node layer as an obstacle, and generating collision-free process connection lines, which not only improves the efficiency of flowchart drawing but also makes the generated flowchart clearer. The force-directed graph algorithm is used to optimize the layout of the node layer and its connection lines, making the flowchart more coordinated and more readable. Automatically generate corresponding Bezier connection curves based on the user's drawn movement path, making it easy to modify and optimize flowcharts. By analyzing the user's historical process connection lines and operation records, it recommends flowchart connection lines that match the user's personalized layout style to meet the user's diverse needs.
[0150] The algorithm or demonstration provided herein are not inherently relevant to any particular computer, virtual system or other equipment. Various general-purpose systems may also be used together with the teachings based on this. According to the above description, it is apparent that the structure required for constructing this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the above description of specific languages is for the purpose of disclosing the best mode of the present invention.
[0151] In the description provided herein, numerous specific details are described. However, it is understood that embodiments of the present invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.
[0152] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Accordingly, the claims that follow the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of the invention.
[0153] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition may be divided into multiple submodules or subunits or subcomponents. All features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed herein may be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0154] Furthermore, those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, combinations of features from different embodiments are intended to be within the scope of the present invention and to form different embodiments. For example, in the claims below, any of the claimed embodiments may be used in any combination.
[0155] The various component embodiments of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components according to an embodiment of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing a part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0156] It should be noted that the above embodiments illustrate rather than limit the invention, and that alternative embodiments may be devised by a person skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between brackets should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising several different elements and by means of appropriately programmed computers. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments should not be understood as limiting the order of execution unless otherwise specified.
Claims
1. An interactive flowchart intelligent wiring layout system, characterized in that: include: The automatic obstacle avoidance connection module is used to plan the path for each node layer and regard each node layer as an obstacle to obtain a flow connection line; wherein the node layer also includes a preset starting layer inside it, and the flow connection line is a connection curve or Bezier curve composed of multiple straight line segments; A process layout optimization module is used to optimize the layout of each node layer and the corresponding process connection line according to the force-directed graph algorithm; and to adjust the cross connection lines and overlapping connection lines between each node layer according to the genetic algorithm; An interactive adjustment module, used to generate a corresponding Bezier connection curve according to the moving path drawn by the user; and to adjust the corresponding process connection line according to the moving position of each node layer; The intelligent recommendation module is used to recommend flowchart connection lines with personalized layout styles based on the user's multiple historical process connection lines and corresponding operation records.
2. The interactive flowchart intelligent wiring layout system according to claim 1, characterized in that: The path planning for each node layer and treating each node layer as an obstacle to obtain a process connection line further includes: Set the start node and the target node, where the start node and the target node are the boundary center points or specified points of the node layer or the preset start layer; Node layers with an internal preset start layer are considered as penetrable areas, and node layers without an internal preset start node layer are considered as obstacles; Map each node layer and the preset starting layer to the search space, and search for the optimal path from the starting node to the target node in the search space; wherein the optimal path does not intersect or completely overlap with other connection curves; Generate a connection line connecting the start node and the target node according to the optimal path.
3. The interactive flowchart intelligent wiring layout system according to claim 1, characterized in that: The optimization of the layout of each node layer and the corresponding process connection line according to the force-directed graph algorithm further includes: Treat each node layer as a simulated particle, and calculate the position between any two node layers according to the distance between the node layers and the degree of the node layers, where the position includes the repulsive force between the node layers and the attractive force between the interconnected node layers; The offset of the node layer position is calculated according to the force field between the node layers, and the position of the node layer is updated according to the offset. After multiple iterations, the position of each node layer reaches a dynamic equilibrium state.
4. The interactive flowchart intelligent wiring layout system according to claim 3, characterized in that: The calculation formula of the repulsive force between the node layers is: Among them, k r is the repulsion coefficient, which is used to adjust the magnitude of the repulsion; d(i,j) is the distance between node layers i and j; α is the repulsion index, which is used to control the rate at which the repulsion changes with distance; degree(i) and degree(j) are the degrees of node layers i and j, respectively, that is, the number of node layers connected to node layers i and j; The calculation formula of the gravitational force between the node layers is: Among them, k a is the gravity coefficient, which is used to adjust the magnitude of gravity; β is the gravity exponent, which is used to control the rate at which gravity changes with distance; edge_weight(i,j) is the weight of the connection line between node layers i and j; The calculation formula of the offset is: Among them, pos j and pos i are the current position coordinates of node layers i and j respectively; ‖pos j -pos i ‖ is the modulus of the distance between node layers i and j; η is the oscillation coefficient, which is used to control the amplitude of position update.
5. The interactive flowchart intelligent wiring layout system according to claim 1, characterized in that: The step of adjusting the cross-connections and overlapping connections between the node layers according to the genetic algorithm further includes: Encode the starting points of the connection lines between each node layer, and use a random set of connection lines as the initial population; The fitness function is set according to the inverse of the number of crossed and overlapping links, the length of the links, and the angle; Evaluate the fitness of each individual in the initial population according to the fitness function and select excellent individuals as parents; Perform mutation operation on the individuals of the parent generation to generate individuals of the child generation, and repeat the operation until a predetermined number of iterations or convergence conditions are reached; wherein the mutation operation is to randomly change the coordinates of the starting point and the end point of the connecting line, thereby changing the position and intersection state of the connecting line; Among them, the fitness function is: Where λ is the weight coefficient, which is used to balance the weight between the number of cross-links and overlapping links and the length and angle of the links; N cross N is the number of cross-connections in the flowchart layout. A cross-connection means that two or more connections intersect in the layout. overlap is the number of completely overlapping connections in the flowchart layout; Represents the sum of the lengths of all lines, N lines is the total number of connections, L i is the length of the i-th line; is the sum of all connecting line angles, N angles is the angle quantity, θ j is the measure of the jth angle.
6. The interactive flowchart intelligent wiring layout system according to claim 1, characterized in that: The step of generating a corresponding Bezier connection curve according to the moving path drawn by the user further includes: Record the starting point, end point and coordinates of each control point of the moving path during the drawing process; Calculate multiple nodes of the moving path according to the third-order Bezier curve formula; Draws a connected Bezier curve based on multiple nodes.
7. The interactive flow chart intelligent wiring layout system according to claim 6, characterized in that: The method further comprises: Calculate each curvature mutation point of the Bezier connection curve, and draw a connection curve consisting of multiple straight line segments according to the starting point, each curvature mutation point and the end point of the Bezier connection curve; The straight line segment is parallel or perpendicular to the boundary line of the adjacent node layer, and the straight line segment changes direction at a curvature mutation point at an angle of 90 degrees and extends toward the next curvature mutation point.
8. The interactive flow chart intelligent wiring layout system according to claim 7, characterized in that: The step of calculating each curvature mutation point of the Bezier connection curve further comprises: Calculate the curvature of each node along the Bezier curve; The curvature of the current node is compared with the curvature of the previous node. If the change in curvature exceeds a preset threshold, the current node is determined to be a curvature mutation point.
9. The interactive flowchart intelligent wiring layout system according to claim 1, characterized in that: The recommending of a personalized layout style of flowchart connection lines according to the user's multiple historical flow connection lines and corresponding operation records further includes: Extract the style layout and operation records of the process connection lines from the user's historical flowcharts, where the style layout includes the layer type, sublayer type, quantity, in-degree, out-degree of the node layer, and the curve type, arrow type, fillet, color, and width of the connection line; the operation record includes the adjustment frequency and adjustment path of the node layer and the connection line; According to the style layout and operation records of the process connection lines, the user's operation habits and visual preferences are analyzed to obtain a visual style list of the flow chart connection lines; The connector style of the current flowchart is previewed in the visual style list to help users select the connector style that suits their preferences.
10. The interactive flowchart intelligent wiring layout system according to claim 2, characterized in that: The process connection line is a connection curve composed of multiple straight line segments; The step of searching for an optimal path from a starting node to a target node in the search space further comprises: Divide the search space into grid lines that are parallel or perpendicular to the boundaries of the start and target nodes, and mark the grid lines that intersect obstacles as inaccessible; The shortest distance from the current node to the target node along the grid line is defined as a heuristic function; Initialize the open list and the closed list, where the open list contains the nodes to be visited and the closed list contains the visited nodes; Take the grid node with the smallest heuristic function value from the open list as the current grid path. If the adjacent grid node is already in the open list, but the grid path through the current grid node to reach the adjacent grid node is smaller than the heuristic function value of the current grid path, update the parent node and heuristic function value of the adjacent grid node. Starting from the target node, trace back along the parent node to the start node to generate the optimal path from the start node to the target node; Among them, the constraints of the optimal path include: the optimal path is composed of various straight line segments, each straight line segment is perpendicular or parallel to the node layer, the change angle of each straight line segment is 90 degrees, and each straight line segment does not pass through the node layer regarded as an obstacle.
Citation Information
Cited By
Automobile system schematic diagram connecting line layout method
CN120911388A
Visual process automatic layout method based on dependency graph optimization
CN120953441A