Image generation method, device, equipment and storage medium

By dividing the flowchart nodes into hierarchies and blocks, and determining the node locations based on the dependency relationship, the problems of low efficiency of flowchart generation and unclear direction in the prior art are solved, and a clear flowchart generation is achieved quickly.

CN115423898BActive Publication Date: 2025-05-16BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211080456.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-05
Publication Date
2025-05-16
Estimated Expiration
2042-09-05

AI Technical Summary

Technical Problem

In the prior art, the flowchart node layout method has high flexibility in manual layout but long time, and the flowchart generated when the dependencies are complex has many intersections and unclear directions.

Method used

By obtaining process nodes and dependencies, the nodes are divided into multiple levels and blocks, and the node position information is determined based on the block size information, and the nodes are drawn and connected to generate a target flow chart.

Benefits of technology

It improves the efficiency and clarity of the flow chart generation direction, and can quickly generate clear flow charts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115423898B_ABST
    Figure CN115423898B_ABST
Patent Text Reader

Abstract

This disclosure provides an image generation method, apparatus, device, and storage medium. The method involves: acquiring process nodes and their dependencies; dividing the process nodes into multiple levels based on the dependencies; wherein each level contains at least one process node; dividing the process nodes in each level into at least one block based on the dependencies, and determining the size information of the block; determining the position information of the process nodes in the block based on the block size information; drawing the process nodes onto a canvas based on the position information and node size information, and connecting the process nodes according to the dependencies to obtain a target flowchart; wherein the node size information includes node height and node width. The image generation method provided by this disclosure can quickly generate flowcharts, improving both the efficiency and clarity of flowchart flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of graphics processing technology, and in particular to an image generation method, apparatus, device and storage medium. Background Art

[0002] In related technologies, flowchart node layout methods are divided into manual layout and automatic layout:

[0003] Manual layout is highly flexible, and users can adjust the node position by dragging and dropping. However, due to its excessive flexibility, it is difficult to build a flowchart, which takes a lot of time, and the results vary from person to person.

[0004] Automatic layout can clearly present the components of the flowchart and the direction of each part when the dependency relationship is simple. However, when the dependency relationship is complex, the generated flowchart has many intersections and unclear directions. Summary of the invention

[0005] The embodiments of the present disclosure provide an image generation method, apparatus, device and storage medium, which can quickly generate a flowchart, which can not only improve the efficiency of flowchart generation, but also improve the clarity of the flowchart direction.

[0006] In a first aspect, an embodiment of the present disclosure provides an image generation method, comprising:

[0007] Get process nodes and dependencies between process nodes;

[0008] Dividing the process nodes into multiple levels according to the dependency relationship; wherein each level contains at least one process node;

[0009] Dividing the process nodes in each level into at least one block according to the dependency relationship, and determining size information of the block;

[0010] Determine location information of a process node in the block based on size information of the block;

[0011] The process nodes are drawn into a canvas based on the position information and the node size information, and the process nodes are connected according to the dependency relationship to obtain a target flow chart; wherein the node size information represents the size of the process nodes.

[0012] In a second aspect, the present disclosure also provides an image generating device, including:

[0013] The process node acquisition module is used to obtain the process nodes and the dependencies between the process nodes;

[0014] A hierarchical division module, used to divide the process nodes into multiple hierarchies according to the dependency relationship; wherein each hierarchy contains at least one process node;

[0015] A block division module, used to divide the process nodes in each level into at least one block according to the dependency relationship, and determine the size information of the block;

[0016] A position information determination module, used to determine the position information of the process node in the block based on the size information of the block;

[0017] A target flowchart generation module is used to draw the process nodes into a canvas based on the position information and the node size information, and connect the process nodes according to the dependency relationship to obtain a target flowchart; wherein the node size information represents the size of the process node.

[0018] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0019] one or more processors;

[0020] a storage device for storing one or more programs,

[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the image generating method as described in the embodiment of the present disclosure.

[0022] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the image generation method as described in the embodiments of the present disclosure.

[0023] The disclosed embodiment discloses an image generation method, device, equipment and storage medium, which obtains process nodes and dependencies between process nodes; divides the process nodes into multiple levels according to the dependencies; wherein each level contains at least one process node; divides the process nodes in each level into at least one block according to the dependencies, and determines the size information of the block; determines the position information of the process nodes in the block based on the size information of the block; draws the process nodes into a canvas based on the position information and the node size information, and connects the process nodes according to the dependencies to obtain a target flow chart; wherein the node size information includes the node height and the node width. The image generation method provided by the disclosed embodiment divides the process nodes in each level into at least one block according to the dependencies, and determines the position information of each process node based on the blocks, thereby drawing the process nodes into the canvas, which can quickly generate a flow chart, which can not only improve the generation efficiency of the flow chart, but also improve the clarity of the flow chart trend. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0025] Figure 1 A schematic diagram of a flow chart of an image generation method provided by an embodiment of the present disclosure;

[0026] Figure 2 It is an example diagram provided by an embodiment of the present disclosure that divides process nodes into multiple levels according to dependency relationships;

[0027] Figure 3 It is a schematic diagram of dividing a process node in each level into at least one block provided by an embodiment of the present disclosure;

[0028] Figure 4 is a structural schematic diagram of an image generating device provided by an embodiment of the present disclosure;

[0029] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0031] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0032] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0033] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0034] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0035] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0036] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0037] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0038] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0039] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0040] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0041] Figure 1A flowchart of an image generating method provided in an embodiment of the present disclosure is provided. The embodiment of the present disclosure is applicable to the situation of generating a flowchart. The method can be executed by an image generating device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, a PC or a server, etc.

[0042] like Figure 1 As shown, the method includes:

[0043] S110, obtaining process nodes and dependencies between process nodes.

[0044] Among them, a process node can be a node corresponding to a task stage in a process task. A process task is composed of several process nodes to form the logic of the process task. In this embodiment, the process node can be represented by a unique identification code (Identity document, ID). The dependency relationship can characterize the sequential connection relationship of the process nodes, including the starting node and the ending node. Exemplarily, a dependency relationship is node 1→node 2, node 1 is the starting node, and node 2 is the ending node. In this embodiment, the user divides the process task into multiple task stages, each task stage corresponds to a process node, and determines the dependency relationship between the process nodes based on the execution logic of the process task.

[0045] S120, dividing the process nodes into multiple levels according to the dependency relationship.

[0046] Each level contains at least one process node.

[0047] In this embodiment, the method of dividing the process nodes into multiple levels according to the dependency relationship can be: determine the root node according to the dependency relationship; starting from the root node, traverse the process nodes in a set manner, and obtain at least one parent node of the traversed process node; determine the target level according to the level information of at least one parent node, and divide the traversed process node into the target level; continue to traverse the next process node until all process nodes are divided into corresponding levels.

[0048] The root node is at the highest level. In this embodiment, the level numbers can be set in a manner of increasing from the level where the root node is located, for example, the level number of the root node is set to 0 or 1. The setting method can be a depth-first algorithm.

[0049] Specifically, the process of determining the root node according to the dependency relationship may be: determining the parent node and child nodes of each process node according to the dependency relationship, and determining the process node without a parent node as the root node.

[0050] Specifically, the method for determining the target level based on the level information of at least one parent node can be: if there are process nodes that are not divided into levels in at least one parent node, skip the traversed process nodes; if at least one parent node is divided into levels, obtain the level corresponding to at least one parent node; determine the target level based on the level corresponding to at least one parent node.

[0051] In this embodiment, after skipping the traversed process node, continue to traverse the next process node according to the depth-first algorithm. If there is a process node that is not divided into levels in at least one parent node, it can be indicated that the traversed process node has different depths in different links, and the depth in other links is greater than the parent node that is also divided into levels. In the subsequent process of traversing the process nodes according to the depth-first algorithm, the process node will also be traversed. In this embodiment, if the parent nodes of the traversed process nodes have been divided into levels, the lowest level in the level corresponding to at least one parent node is obtained; the next level of the lowest level is determined as the target level, so that the traversed process node is divided into the target level. Exemplarily, assuming that the parent nodes of node 3 include node 0 and node 1, and node 0 is divided into level 0, and node 1 is divided into level 1, then node 3 is divided into level 2 (i.e., the next level of level 1). In this embodiment, the next level of the lowest level corresponding to the parent node is determined as the level of the traversed process node, and the process node can be divided into the lower level of the level where its parent node is located, that is, it is ensured that the process node in the lower level is the subsequent node of the process node in the higher level, thereby reducing the crossing of the connecting lines in the flowchart, thereby improving the clarity of the flowchart.

[0052] In this embodiment, starting from the root node, the depth-first algorithm is used to traverse each process node according to the dependency relationship between process nodes. When a process node is traversed, at least one parent node of the traversed process node is obtained; if there is a process node that has not been divided into a level in at least one parent node, the traversed process node is skipped, and the next process node is traversed according to the depth-first algorithm; if at least one parent node has been divided into levels, the level corresponding to at least one parent node is obtained; and the lowest level in the level corresponding to at least one parent node is obtained, and the next level of the lowest level is used as the level corresponding to the traversed process node; the next process node is traversed until all process nodes are divided into corresponding levels. Exemplary, Figure 2 This is an example diagram of dividing the process nodes into multiple levels according to the dependency relationship in this embodiment, such as Figure 2As shown, the process nodes include node 0, node 1, node 3, node 4, node 5, node 6, node 7, node 8, node 9, node 10, node 11 and node 12, wherein node 0 is divided into level 0, node 1 and node 2 are divided into level 1, node 3, node 4 and node 8 are divided into level 2, node 5, node 6, node 7, node 9 are divided into level 3, and node 10, node 11 and node 12 are divided into level 4. In this embodiment, a depth-first algorithm is used to traverse the process nodes, and process nodes with a smaller depth are traversed first, so that process nodes with a smaller depth are divided into higher levels first, and process nodes with a larger depth are divided into lower levels, which can not only improve the efficiency of dividing the levels, but also improve the accuracy of dividing the levels.

[0053] S130, dividing the process nodes in each level into at least one block according to the dependency relationship, and determining the size information of the block.

[0054] The information of the block includes the starting process node and the child nodes of the starting process node, wherein the starting process node can be understood as the process node located at the current level. In this embodiment, dividing the process nodes in each level into at least one block according to the dependency relationship can be understood as: for each level, dividing the process nodes contained in the level into blocks according to the dependency relationship.

[0055] Specifically, the method of dividing the process nodes in each level into at least one block according to the dependency relationship can be: traversing each level in order from low to high; for the process nodes in the traversed level, obtaining the child node information of the process node; and dividing the process nodes in the traversed level into at least one block according to the child node information.

[0056] Among them, traversing each level in order from low to high can be understood as assuming that the level where the root node is located is the first level, then starting from the last level and traversing the levels forward in sequence.

[0057] Among them, the subnode information may include any of the following: no child nodes, belonging to the same block as the child nodes of other process nodes in the hierarchy, and not belonging to the same block as the child nodes of other process nodes in the hierarchy. If the process node has no child nodes, it means that the process node is a leaf node. If the process node has child nodes, the process node is an intermediate node or a root node. Among them, belonging to the same block as the child nodes of other process nodes in the hierarchy can be understood as the child nodes of the process node and the child nodes of other process nodes in the hierarchy being divided into the same block or the same child nodes in the next level.

[0058] Specifically, the method of dividing the process nodes in the traversed level into at least one block according to the child node information can be: dividing the process nodes without child nodes into one block respectively; dividing at least two process nodes whose child nodes belong to the same block into one block; dividing the process nodes whose child nodes do not belong to the same block into one block respectively.

[0059] Among them, the block where the child node is located is the child block of the block where the current process node is located. In this embodiment, dividing the process nodes without child nodes into a block can be understood as dividing the leaf nodes into a block, that is, one leaf node corresponds to one block. For the process nodes with child nodes in the current level, if the child nodes of two or more process nodes are divided into the same block in the next level, the two or more process nodes in the current level are divided into the same block. If the child nodes of a process node in the current level and the child nodes of other process nodes are not divided into the same block in the next level, the process node is divided into a block separately. In this embodiment, the process nodes without child nodes are divided into a block respectively, at least two process nodes whose child nodes belong to the same block are divided into a block, and the process nodes whose child nodes do not belong to the same block are divided into a block respectively, so that the divided blocks correspond to the dependency relationship between the process nodes, thereby improving the accuracy of block division, which is conducive to the drawing of subsequent flow charts.

[0060] Specifically, first traverse the process nodes of the last level. Since the process nodes of the last level are all leaf nodes, the process nodes of the last level are divided into a block. Then traverse the second-to-last level, which contains intermediate nodes and may also include leaf nodes. For leaf nodes, directly divide the leaf nodes into a block respectively; for intermediate nodes, obtain their child nodes. If two or more intermediate nodes have the same child nodes in the next level (i.e., the last level), divide the two or more intermediate nodes into the same block; if an intermediate node and other intermediate nodes do not have the same child nodes in the next level, divide the intermediate node into a block separately. Continue to traverse the third to last level, which contains intermediate nodes and may also include leaf nodes. For leaf nodes, directly divide the leaf nodes into a block respectively; for intermediate nodes, obtain their child nodes, if two or more intermediate nodes are divided into the same block in the leaf nodes of the next level (i.e., the second to last level), then divide the two or more intermediate nodes into the same block; if an intermediate node and other intermediate nodes are not divided into the same block in the leaf nodes of the next level, then divide the intermediate node into a block separately. Continue to traverse until the level where the root node is located is traversed. In this embodiment, the process nodes of each level are divided into at least one block according to the dependency relationship, so that the divided blocks correspond to the dependency relationship between the process nodes, thereby improving the accuracy of block division and facilitating the layout of subsequent process nodes.

[0061] For example, Figure 3 is a schematic diagram of dividing the process nodes in each level into at least one block in this embodiment, such as Figure 3 As shown, first traverse the last level, including node 9 and node 10. Node 9 and node 10 are both leaf nodes, so node 9 is divided into block 1, and node 10 is divided into block 2. Continue to traverse the second-to-last level. In the second-to-last level, the child nodes of node 5 and node 6 are both node 9, so node 5 and node 6 are divided into block 3; the child nodes of node 7 and node 8 are both node 10, so node 7 and node 8 are divided into block 4. Continue to traverse the third-to-last level. Node 1 and node 2 have the same child node 6, node 2 and node 3 have the same child node 7, and node 3 and node 4 have the same child node 8. Therefore, node 1, node 2, node 3, and node 4 are divided into block 5. Finally, traverse the level where the root node is located and divide the root node into block 6. From Figure 3 It can be seen that the sub-block of block 6 is block 5, the sub-blocks of block 5 are blocks 3 and block 4, the sub-block of block 3 is block 1, and the sub-block of block 4 is block 2.

[0062] Specifically, the method for determining the size information of a block may be: obtaining the starting process node contained in the block; accumulating the node size information of the starting process node to obtain the first size information of the block; accumulating the size information of the sub-blocks included in the block to obtain the second size information of the block; and taking the maximum value of the first size information and the second size information as the size information of the block.

[0063] The starting process node can be understood as a process node at the level when the blocks are divided. For example, Figure 3 As shown, the starting process nodes of block 3 are node 5 and node 6.

[0064] In this embodiment, the process of accumulating the node size information of the starting process node can be: if the node size information of the starting process node is the same, then sum the node size information and the set spacing, and then multiply the sum result by the number of starting process nodes to obtain the first size information of the block; if the node size information of the starting process nodes is different, firstly accumulate the node size information of each starting process node, then multiply the set spacing by the number of starting process nodes, and finally add the accumulated result and the multiplied result to obtain the first size information of the block. Then, the size information of the sub-blocks contained in the block is accumulated to obtain the second size information of the block. Finally, the maximum value of the first size information and the second size information is used as the size information of the block. In this embodiment, the maximum value of the first size information determined by the starting process node and the second size information determined by the sub-block is determined as the size information of the current block, which can ensure that the current block can completely surround the process node and its sub-nodes contained therein, which is conducive to the calculation of the subsequent process node position information.

[0065] In this embodiment, if the target flowchart is arranged horizontally, the size information of the block is the block height; if the target flowchart is arranged vertically, the size information of the block is the block width. In this embodiment, the shape of the node can be rectangular, circular, or elliptical, etc. If it is a rectangle, the node size information includes the node height and node width of the process node; if it is a circle, the node size information includes the radius; if it is an ellipse, the node size information includes the major axis length and the minor axis length. Optionally, this embodiment selects a rectangle. In this embodiment, vertical flowcharts and horizontal flowcharts can be drawn to enrich the style of the flowchart.

[0066] Specifically, if the target flow chart is arranged horizontally, the method for determining the block height can be: if the node heights of the starting process nodes are the same, then the node heights and the set spacing are summed, and then the summation result is multiplied by the number of starting process nodes to obtain the first height of the block; if the node heights of the starting process nodes are different, first the node heights of each starting process node are accumulated, and then the set spacing is multiplied by the number of starting process nodes, and finally the accumulated result and the multiplied result are added to obtain the first height of the block. Then the heights of the sub-blocks contained in the block are accumulated to obtain the second height of the block. Finally, the maximum value of the first height and the second height is used as the height of the block.

[0067] Specifically, if the target flow chart is arranged vertically, the method for determining the block width can be: if the node widths of the starting process nodes are the same, then the node widths are summed with the set spacing, and then the summation result is multiplied by the number of starting process nodes to obtain the first width of the block; if the node widths of the starting process nodes are different, first the node widths of the starting process nodes are accumulated, and then the set spacing is multiplied by the number of starting process nodes, and finally the accumulated result and the multiplied result are added to obtain the first width of the block. Then the widths of the sub-blocks contained in the block are accumulated to obtain the second width of the block. Finally, the maximum value of the first width and the second width is used as the width of the block.

[0068] S140, determining the position information of the process node in the block based on the size information of the block.

[0069] The position information of the process node may be the position coordinates of the upper left corner or the center point of the process node frame, including the horizontal position and the vertical position. In this embodiment, for the convenience of calculation, the position coordinates of the upper left corner of the process node frame are used as the position information of the process node.

[0070] Specifically, if the target flowchart is arranged horizontally, the process of determining the position information of each process node based on the size information of the block can be: obtaining the hierarchical information corresponding to the process node; determining the horizontal position of the process node according to the hierarchical information; traversing the blocks in order from small to large and from top to bottom according to the hierarchical sequence number, for the process nodes in the traversed blocks, determining the first longitudinal offset of the traversed blocks relative to the edge of the canvas according to the block height, determining the center longitudinal offset of the traversed blocks relative to their parent blocks and the third longitudinal offset of the process nodes relative to the traversed blocks; determining the vertical position of the process nodes according to the first longitudinal offset, the center longitudinal offset and the third longitudinal offset.

[0071] Among them, the hierarchical information includes the hierarchical sequence number, the hierarchical width and the horizontal spacing between the hierarchical levels. The hierarchical width can be the maximum node width of the process nodes contained in the hierarchical level, and the horizontal spacing between the hierarchical levels can be understood as the horizontal spacing between the process nodes, which can be a set value. Specifically, the process of determining the horizontal position of the process node according to the hierarchical information can be: if the widths of each level are the same, first sum the hierarchical width and the horizontal spacing between the levels, then subtract the hierarchical sequence number from the hierarchical sequence number where the root node is located, and finally multiply the summed result and the subtracted result to obtain the horizontal position of the process node. If the widths of each level are different, first sum all the hierarchical widths between the current levels, then subtract the hierarchical sequence number from the hierarchical sequence number where the root node is located, and multiply the subtracted result by the horizontal spacing between the levels, and finally add the summed result and the multiplied result to obtain the horizontal position of the current process node.

[0072] Optionally, if the horizontal position of the root node is not 0, it is necessary to add the horizontal position obtained above to the horizontal position of the root node to obtain the horizontal position of the current process node.

[0073] Among them, traversing the blocks in order from small to large and from top to bottom according to the level numbers can be understood as: starting from the level where the root node is located, for each level, traversing the blocks in the level in order from top to bottom until the last level is traversed.

[0074] The method of determining the vertical position of the process node according to the first longitudinal offset, the center longitudinal offset and the third longitudinal offset may be: accumulating the first longitudinal offset, the center longitudinal offset and the third longitudinal offset to obtain the vertical position of the process node. In this embodiment, the vertical position of the process node is obtained by accumulating the offset of the block relative to the edge, the center offset of the block relative to its parent block and the offset of the process node relative to the block, which can improve the accuracy of determining the vertical position of the process node.

[0075] Specifically, the method for determining the first longitudinal offset of the traversed block relative to the edge of the canvas according to the block height can be: determining the first longitudinal sub-offset of the parent block of the traversed block relative to the edge of the canvas according to the block height; determining the second longitudinal sub-offset of the traversed block relative to the parent block according to the block height; and accumulating the first longitudinal sub-offset and the second longitudinal sub-offset to obtain the first longitudinal offset.

[0076] Wherein, the edge of the canvas may be an upper edge, and the first longitudinal sub-offset is determined by the distance between the parent block of the traversed block and the upper edge of the canvas. The method of determining the second longitudinal sub-offset of the traversed block relative to the parent block according to the block height may be: calculating the distance between the upper edge of the traversed block and the upper edge of its parent block, and determining the second longitudinal sub-offset according to the distance. Wherein, the method of calculating the distance between the upper edge of the traversed block and the upper edge of its parent block is: obtaining a block that meets the following conditions: being at the same level as the traversed block, being located above the traversed block, and being the same as the parent block of the traversed area, summing the heights of the blocks that meet the above conditions, and determining the sum of the heights as the distance between the upper edge of the traversed block and the upper edge of its parent block. In this embodiment, the sum of the first longitudinal sub-offset of the parent block of the traversed block relative to the canvas edge and the second longitudinal sub-offset of the traversed block relative to the parent block is used as the first longitudinal offset, which can improve the accuracy of the first longitudinal offset.

[0077] Specifically, the method for determining the center longitudinal offset of the traversed block relative to its parent block can be: obtaining the sum of the parent block height of the traversed block and the child block heights included in the parent block; and determining the center longitudinal offset according to the sum of the parent block height and the child block height.

[0078] In this embodiment, the process of determining the center longitudinal offset according to the sum of the parent block height and the child block height can be: subtract the sum of the parent block height and the child block height, and then use the subtraction result to 2 to obtain the center longitudinal offset. In this embodiment, if the sum of the parent block height and the child block height is equal, the center longitudinal offset is 0; if the parent block height is greater than the sum of the child block heights, the center longitudinal offset is calculated based on the above method. In this embodiment, the center longitudinal offset is determined according to the sum of the parent block height and the child block height, so that the block can be offset to the central axis of the parent block, which can make the flow chart more beautiful.

[0079] Specifically, the method for determining the third vertical offset of the process node relative to the traversed block can be: obtaining the number of starting process nodes included in the traversed block; determining the vertical spacing of the nodes based on the traversed block height, the number of starting process nodes and the node height; obtaining the vertical sorting information of the current process node in the traversed block; and determining the third vertical offset of the current process node based on the vertical sorting information, the vertical spacing of the nodes and the node height.

[0080] Among them, the vertical sorting information can be understood as the sequence number of the current process node in the traversed block after being sorted from top to bottom. The method of determining the vertical spacing of the nodes according to the traversed block height, the number of starting process nodes and the node height can be: first multiply the number of starting process nodes and the node height, then subtract the block height from the multiplication result, and then sum the number of starting process nodes and 1, and finally put the subtraction result in the summation result to obtain the vertical spacing of the nodes. The method of determining the third vertical offset of the current process node based on the vertical sorting information, the vertical spacing of the nodes and the node height can be: multiply the vertical sorting information and the vertical spacing of the nodes to obtain the first multiplication result, subtract 1 from the vertical sorting information and multiply it with the node height to obtain the second multiplication result, add the first multiplication result and the second multiplication result to obtain the third vertical offset. In this embodiment, the vertical spacing of the nodes is determined according to the traversed block height, the number of starting process nodes and the node height, so as to determine the vertical position of the process node according to the vertical spacing, and the process nodes can be evenly arranged in the block, making the flow chart more beautiful.

[0081] Optionally, if the target flowchart is arranged vertically, the method for determining the position information of each process node based on the size information of the block can be: obtaining the hierarchical information corresponding to the process node; determining the vertical position of the process node according to the hierarchical information; traversing the blocks in order from small to large and from left to right, and for the process nodes in the traversed blocks, determining the first horizontal offset of the traversed block relative to the edge of the canvas according to the block width, determining the center horizontal offset of the traversed block relative to its parent block and the third horizontal offset of the process node relative to the traversed block; determining the horizontal position of the process node according to the first horizontal offset, the center horizontal offset and the third horizontal offset.

[0082] Among them, the hierarchical information includes the hierarchical sequence number, the hierarchical height and the vertical spacing between the hierarchical levels. The hierarchical height can be the maximum node height of the process nodes contained in the hierarchy, and the vertical spacing between the hierarchical levels can be understood as the vertical spacing between the process nodes, which can be a set value. Specifically, the process of determining the vertical position of the process node according to the hierarchical information can be: if the heights of each level are the same, first sum the hierarchical height and the vertical spacing of the levels, then subtract the hierarchical sequence number from the hierarchical sequence number where the root node is located, and finally multiply the summation result and the subtraction result to obtain the vertical position of the process node. If the heights of each level are different, first sum the heights of all levels between the current level, then subtract the hierarchical sequence number from the hierarchical sequence number where the root node is located, and multiply the subtraction result by the vertical spacing between the levels, and finally add the summation result and the multiplication result to obtain the vertical position of the current process node.

[0083] Optionally, if the vertical position of the root node is not 0, it is necessary to add the vertical position obtained above to the vertical position of the root node to obtain the vertical position of the current process node.

[0084] Among them, traversing the blocks in order from small to large and from left to right can be understood as: starting from the level where the root node is located, for each level, traversing the blocks in the level in order from left to right until the last level is traversed.

[0085] Specifically, the method of determining the horizontal position of the process node according to the first horizontal offset, the center horizontal offset and the third horizontal offset may be: accumulating the first horizontal offset, the center horizontal offset and the third horizontal offset to obtain the horizontal position of the process node.

[0086] Specifically, the method for determining the first horizontal offset of the traversed block relative to the edge of the canvas according to the block width can be: determining the first horizontal sub-offset of the parent block of the traversed block relative to the edge of the canvas according to the block width; determining the second horizontal sub-offset of the traversed block relative to the parent block according to the block width; and accumulating the first horizontal sub-offset and the second horizontal sub-offset to obtain the first horizontal offset.

[0087] The edge of the canvas may be the left edge of the canvas. The method of determining the first transverse offset is similar to the method of determining the first longitudinal offset in the above embodiment, and will not be described in detail here.

[0088] Specifically, the method for determining the center horizontal offset of the traversed block relative to its parent block can be: obtaining the sum of the parent block width of the traversed block and the child block widths included in the parent block; and determining the center horizontal offset according to the sum of the parent block width and the child block width.

[0089] The method for determining the centering lateral offset is similar to the method for determining the centering longitudinal offset in the above embodiment, and will not be described in detail here.

[0090] Specifically, the method for determining the third horizontal offset of the process node relative to the traversed block can be: obtaining the number of starting process nodes included in the traversed block; determining the horizontal spacing of the nodes based on the traversed block width, the number of starting process nodes and the node width; obtaining the horizontal sorting information of the current process node in the traversed block; and determining the third horizontal offset of the current process node based on the horizontal sorting information, the horizontal spacing of the nodes and the node width.

[0091] The method of determining the third lateral offset is similar to the method of determining the third longitudinal offset in the above embodiment, and will not be described in detail here. In this embodiment, the horizontal position and vertical position of the process node when the flowchart is arranged vertically are calculated, so that the flowchart is arranged vertically, thereby improving the diversity of the process.

[0092] S150, drawing the process nodes into the canvas based on the position information and the node size information, and connecting the process nodes according to the dependency relationship to obtain a target flow chart.

[0093] Among them, the node size information represents the size of the process node. After obtaining the horizontal position and vertical position of the process node, each process node can be drawn into the canvas based on the position information and the node size information, and finally the process nodes are connected according to the dependency relationship to obtain the target flowchart.

[0094] The technical solution of the disclosed embodiment obtains the process nodes and the dependencies between the process nodes; divides the process nodes into multiple levels according to the dependencies; wherein each level contains at least one process node; divides the process nodes in each level into at least one block according to the dependencies, and determines the size information of the block; determines the position information of the process nodes in the block based on the size information of the block; draws the process nodes into the canvas based on the position information and the node size information, and connects the process nodes according to the dependencies to obtain the target flow chart; wherein the node size information includes the node height and the node width. The image generation method provided by the disclosed embodiment divides the process nodes in each level into at least one block according to the dependencies, and determines the position information of each process node based on the blocks, thereby drawing the process nodes into the canvas, which can quickly generate a flow chart, which can not only improve the generation efficiency of the flow chart, but also improve the clarity of the flow chart trend.

[0095] Figure 4 A schematic diagram of the structure of an image generating device provided by an embodiment of the present disclosure is shown in FIG. Figure 4 As shown, the device comprises:

[0096] A process node acquisition module 410 is used to acquire process nodes and dependencies between process nodes;

[0097] A hierarchical division module 420 is used to divide the process nodes into multiple hierarchies according to the dependency relationship; wherein each hierarchy contains at least one process node;

[0098] The block division module 430 is used to divide the process nodes in each level into at least one block according to the dependency relationship and determine the size information of the block;

[0099] A position information determination module 440, configured to determine position information of a process node in a block based on size information of the block;

[0100] The target flowchart generation module 450 is used to draw the process nodes into the canvas based on the position information and the node size information, and connect the process nodes according to the dependency relationship to obtain the target flowchart; wherein the node size information includes the node height and the node width.

[0101] Optionally, the hierarchical division module 420 is further configured to:

[0102] Determine the root node according to the dependency relationship; wherein the level number of the root node is a set value, and the level numbers increase in sequence starting from the level where the root node is located;

[0103] Starting from the root node, traverse the process nodes according to the set method, and obtain at least one parent node of the traversed process node;

[0104] Determine a target level according to the level information of the at least one parent node, and classify the traversed process nodes into the target level; continue to traverse the next process node until all process nodes are classified into corresponding levels.

[0105] Optionally, the hierarchical division module 420 is further configured to:

[0106] If there is a process node that is not divided into levels in at least one parent node, the traversed process node is skipped;

[0107] If at least one parent node is divided into levels, obtain the level corresponding to at least one parent node;

[0108] The target level is determined according to the level corresponding to at least one parent node.

[0109] Optionally, the hierarchical division module 420 is further configured to:

[0110] Obtain the lowest level in the levels corresponding to the at least one parent node;

[0111] A level next to the lowest level is determined as a target level.

[0112] Optionally, the block division module 430 is further configured to:

[0113] Traverse each level in order from low to high level;

[0114] For the process nodes in the traversed level, obtain the child node information of the process node;

[0115] The process nodes in the traversed level are divided into at least one block according to the child node information.

[0116] Optionally, the child node information includes any of the following: no child node, belonging to the same block as the child nodes of other process nodes in the hierarchy, and not belonging to the same block as the child nodes of other process nodes in the hierarchy.

[0117] Optionally, the block division module 430 is further configured to:

[0118] Divide the process nodes without child nodes into a block respectively;

[0119] Divide at least two process nodes whose child nodes belong to the same block into one block;

[0120] The process nodes whose sub-nodes do not belong to the same block are respectively divided into a block; wherein the block where the sub-node is located is a sub-block of the block where the current process node is located.

[0121] Optionally, the block division module 430 is further configured to:

[0122] Get the starting process node contained in the block;

[0123] Accumulate the node size information of the starting process node to obtain the first size information of the block;

[0124] Accumulating size information of sub-blocks included in the block to obtain second size information of the block;

[0125] The maximum value of the first size information and the second size information is used as the size information of the block.

[0126] Optionally, if the target flowchart is arranged horizontally, the block size information is the block height; if the target flowchart is arranged vertically, the block size information is the block width; the node size information includes the node height and node width of the process node.

[0127] Optionally, the location information determining module 440 is further configured to:

[0128] Get the level information corresponding to the process node; the level information includes the level number, level width and horizontal spacing between levels;

[0129] Determine the horizontal position of the process node based on the hierarchical information;

[0130] Traverse the blocks in order from high to low levels and from top to bottom. For the process nodes in the traversed blocks, determine the first vertical offset of the traversed blocks relative to the edge of the canvas according to the block height, determine the center vertical offset of the traversed blocks relative to their parent blocks, and the third vertical offset of the process nodes relative to the traversed blocks;

[0131] The vertical position of the process node is determined according to the first longitudinal offset, the center longitudinal offset, and the third longitudinal offset.

[0132] Optionally, the location information determining module 440 is further configured to:

[0133] Determine the first vertical child offset of the parent block of the traversed block relative to the edge of the canvas according to the block height;

[0134] Determine the second vertical child offset of the traversed block relative to the parent block according to the block height;

[0135] The first longitudinal sub-offset and the second longitudinal sub-offset are accumulated to obtain a first longitudinal offset.

[0136] Optionally, the location information determining module 440 is further configured to:

[0137] Get the height of the parent block of the traversed block and the sum of the heights of the child blocks included in the parent block;

[0138] The vertical offset of the center is determined by the sum of the parent block height and the child block height.

[0139] Optionally, the location information determining module 440 is further configured to:

[0140] Get the number of starting process nodes included in the traversed block;

[0141] Determine the vertical spacing of nodes based on the traversed block height, the number of starting process nodes, and the node height;

[0142] Get the vertical sorting information of the current process node in the traversed blocks;

[0143] A third vertical offset of the current process node is determined based on the vertical sorting information, the vertical spacing of the nodes, and the node height.

[0144] Optionally, if the target flowchart is arranged vertically, the position information determination module 440 is further used to:

[0145] Get the level information corresponding to the process node; the level information includes the level number, level height and vertical spacing between levels;

[0146] Determine the vertical position of the process node based on the hierarchical information;

[0147] Traverse the blocks in order from high to low levels and from left to right. For the process nodes in the traversed blocks, determine the first horizontal offset of the traversed blocks relative to the edge of the canvas according to the block width, determine the center horizontal offset of the traversed blocks relative to their parent blocks, and determine the third horizontal offset of the process nodes relative to the traversed blocks.

[0148] The horizontal position of the process node is determined according to the first lateral offset, the center lateral offset, and the third lateral offset.

[0149] The image generating device provided in the embodiments of the present disclosure can execute the image generating method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0150] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.

[0151] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 5 , which shows an electronic device (eg, Figure 5 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0152] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.

[0153] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0154] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0155] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0156] The electronic device provided in the embodiment of the present disclosure and the image generation method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0157] The embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the image generating method provided by the above embodiment is implemented.

[0158] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-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 computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0159] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0160] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0161] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0162] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device is enabled to: obtain process nodes and dependencies between process nodes; divide the process nodes into multiple levels according to the dependencies; wherein each level contains at least one process node; divide the process nodes in each level into at least one block according to the dependencies, and determine the size information of the block; determine the position information of the process node in the block based on the size information of the block; draw the process node into the canvas based on the position information and node size information, and connect the process nodes according to the dependencies to obtain the target flow chart; wherein the node size information includes node height and node width.

[0163] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0164] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0165] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0166] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0167] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 of the foregoing.

[0168] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0169] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0170] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. An image generation method, characterized in that: include: Get process nodes and dependencies between process nodes; Dividing the process nodes into multiple levels according to the dependency relationship; wherein each level contains at least one process node; Dividing the process nodes in each level into at least one block according to the dependency relationship, and determining size information of the block; Determine location information of a process node in the block based on size information of the block; Drawing the process nodes into a canvas based on the position information and the node size information, and connecting the process nodes according to the dependency relationship to obtain a target flow chart; wherein the node size information represents the size of the process nodes; The step of dividing the process nodes in each level into at least one block according to the dependency relationship includes: Traverse each level in order from low to high level; For a process node in the traversed level, obtain the child node information of the process node; Divide the process nodes without child nodes into a block respectively; Divide at least two process nodes whose child nodes belong to the same block into one block; Divide the process nodes whose sub-nodes do not belong to the same block into a block respectively; wherein the block where the sub-node is located is the sub-block of the block where the current process node is located; If the target flowchart is arranged horizontally, the size information of the block is the block height; if the target flowchart is arranged vertically, the size information of the block is the block width; the node size information includes the node height and node width of the process node; If the target flow chart is arranged horizontally, the position information of each flow node is determined based on the size information of the block, including: Get the level information corresponding to the process node; the level information includes the level number, level width and horizontal spacing between levels; Determining the horizontal position of the process node according to the hierarchical information; Traversing the blocks in order from high to low levels and from top to bottom, for the process nodes in the traversed blocks, determining the first vertical offset of the traversed blocks relative to the edge of the canvas according to the block height, determining the center vertical offset of the traversed blocks relative to their parent blocks, and the third vertical offset of the process nodes relative to the traversed blocks; Determining a vertical position of a process node according to the first longitudinal offset, the center longitudinal offset, and the third longitudinal offset; If the target flow chart is arranged vertically, the position information of each flow node is determined based on the size information of the block, including: Get the level information corresponding to the process node; the level information includes the level number, level height and vertical spacing between levels; Determining the vertical position of the process node according to the hierarchical information; Traverse the blocks in order from high to low levels and from left to right, and for the process nodes in the traversed blocks, determine the first horizontal offset of the traversed blocks relative to the edge of the canvas according to the block width, determine the center horizontal offset of the traversed blocks relative to their parent blocks, and determine the third horizontal offset of the process nodes relative to the traversed blocks; The horizontal position of the process node is determined according to the first lateral offset, the center lateral offset and the third lateral offset.

2. The method according to claim 1, characterized in that The process nodes are divided into multiple levels according to the dependency relationships, including: Determine a root node according to the dependency relationship; wherein the root node is at the highest level; Starting from the root node, traverse the process nodes according to a set method, and obtain at least one parent node of the traversed process nodes; Determine a target level according to the level information of the at least one parent node, and classify the traversed process nodes into the target level; continue to traverse the next process node until all process nodes are classified into corresponding levels.

3. The method according to claim 2, characterized in that: Determining a target level according to the level information of the at least one parent node includes: If there is a process node that is not divided into levels in the at least one parent node, skip the traversed process node; If the at least one parent node is divided into levels, obtaining the level corresponding to the at least one parent node; The target level is determined according to the level corresponding to the at least one parent node.

4. The method according to claim 3, characterized in that Determining a target level according to a level corresponding to the at least one parent node includes: Obtain the lowest level in the levels corresponding to the at least one parent node; A level next to the lowest level is determined as a target level.

5. The method according to claim 1, characterized in that The child node information includes any of the following: no child node, belonging to the same block as the child nodes of other process nodes in the hierarchy, and not belonging to the same block as the child nodes of other process nodes in the hierarchy.

6. The method according to claim 1, characterized in that Determining the size information of the block includes: Obtaining the starting process node contained in the block; Accumulating the node size information of the starting process node to obtain the first size information of the block; Accumulating size information of sub-blocks included in the block to obtain second size information of the block; The maximum value of the first size information and the second size information is used as the size information of the block.

7. The method according to claim 1, characterized in that Determining the first longitudinal offset of the traversed block relative to the edge of the canvas according to the block height includes: Determine the first vertical child offset of the parent block of the traversed block relative to the edge of the canvas according to the block height; Determine the second vertical child offset of the traversed block relative to the parent block according to the block height; The first longitudinal sub-offset and the second longitudinal sub-offset are accumulated to obtain a first longitudinal offset.

8. The method according to claim 1, characterized in that Determine the vertical offset of the traversed block relative to its parent block, including: Get the height of the parent block of the traversed block and the sum of the heights of the child blocks included in the parent block; The centering longitudinal offset is determined according to the sum of the parent block height and the child block height.

9. The method according to claim 1, characterized in that: Determining a third longitudinal offset of the process node relative to the traversed block includes: Get the number of starting process nodes included in the traversed block; Determine the vertical spacing of nodes according to the traversed block height, the number of starting process nodes and the node height; Get the vertical sorting information of the current process node in the traversed blocks; A third vertical offset of the current process node is determined based on the vertical sorting information, the vertical node spacing, and the node height.

10. An image generating device, characterized in that: include: The process node acquisition module is used to obtain the process nodes and the dependencies between the process nodes; A hierarchical division module, used to divide the process nodes into multiple hierarchies according to the dependency relationship; wherein each hierarchy contains at least one process node; A block division module, used to divide the process nodes in each level into at least one block according to the dependency relationship, and determine the size information of the block; The block division module is specifically used to: traverse each level in order from low to high levels; for the process node in the traversed level, obtain the child node information of the process node; divide the process nodes without child nodes into a block; divide at least two process nodes whose child nodes belong to the same block into a block; divide the process nodes whose child nodes do not belong to the same block into a block; wherein the block where the child node is located is the child block of the block where the current process node is located; A position information determination module, used to determine the position information of the process node in the block based on the size information of the block; A target flow chart generation module, used for drawing the process nodes into a canvas based on the position information and the node size information, and connecting the process nodes according to the dependency relationship to obtain a target flow chart; wherein the node size information represents the size of the process nodes; If the target flowchart is arranged horizontally, the size information of the block is the block height; if the target flowchart is arranged vertically, the size information of the block is the block width; the node size information includes the node height and node width of the process node; If the target flow chart is arranged horizontally, the position information determination module is further used to: Get the level information corresponding to the process node; the level information includes the level number, level width and horizontal spacing between levels; Determining the horizontal position of the process node according to the hierarchical information; Traversing the blocks in order from high to low levels and from top to bottom, for the process nodes in the traversed blocks, determining the first vertical offset of the traversed blocks relative to the edge of the canvas according to the block height, determining the center vertical offset of the traversed blocks relative to their parent blocks, and the third vertical offset of the process nodes relative to the traversed blocks; Determining a vertical position of a process node according to the first longitudinal offset, the center longitudinal offset, and the third longitudinal offset; If the target flow chart is arranged vertically, the position information determination module is further used to: Get the level information corresponding to the process node; the level information includes the level number, level height and vertical spacing between levels; Determining the vertical position of the process node according to the hierarchical information; Traverse the blocks in order from high to low levels and from left to right, and for the process nodes in the traversed blocks, determine the first horizontal offset of the traversed blocks relative to the edge of the canvas according to the block width, determine the center horizontal offset of the traversed blocks relative to their parent blocks, and determine the third horizontal offset of the process nodes relative to the traversed blocks; The horizontal position of the process node is determined according to the first lateral offset, the center lateral offset and the third lateral offset.

11. An electronic device, characterized in that: The electronic device comprises: 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 image generating method according to any one of claims 1 to 9.

12. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the image generation method according to any one of claims 1 to 9 when executed by a computer processor.

Citation Information

Patent Citations

  • Knowledge tree generation method and device, equipment and storage medium

    CN108536837A

  • Node layout method and device, storage medium and electronic device

    CN110515690A

  • Page layout method and device, equipment and storage medium

    CN113190781A

  • Node layout method and device

    CN113315650A