Data flow graph processing methods, apparatus, equipment and storage media
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-25
- Publication Date
- 2026-08-14
AI Technical Summary
[0005]本申请提供一种数据流图处理方法、装置、设备及存储介质,用于解决现有技术中采用一种布局算法进行数据流图处理无法将信息的层次进行展示导致信息无法被接收或者缺失的技术问题
[0020]本申请提供一种数据流图处理方法、装置、设备及存储介质。本申请提供的数据流图处理方法,首先根据待处理数据流图节点类型对待处理数据流图进行子图划分,得到第一子图和多组第二子图,其中,待处理数据流图包括各原始节点以及用于连接各原始节点的边。然后对第一子图和每组第二子图分别利用不同的预设布局算法进行布局处理,以得到对应的第一结果图和多组第二结果图。最后对第一结果图和多组第二结果图进行聚合处理得到聚合结果图,并剔除聚合结果图的重叠区域,得到目标数据流图。通过本申请数据流图处理得到的目标数据流图可以展示各原始节点所承载信息的层次,减少了数据再加工环节,提高了数据的直接利用率,提升了整图信息传递效果,有利于根据目标数据流图进行后续的数据统计分析决策。
Smart Images

Figure CN113326404B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology (Fintech), and in particular to a data flow graph processing method, apparatus, device, and storage medium. Background Technology
[0002] With the rapid development of computer and internet technologies, Fintech, as a product of the deep integration of finance and technology, is currently becoming a hot topic for innovation and development in the financial industry. At the same time, with the business development of the financial industry, the need to improve and expand data, and to comprehensively and systematically understand the logical flow and transformation processes of data within industry systems, has become an indispensable and crucial aspect of data analysis and processing. Data flow diagram processing is the best way to obtain this information.
[0003] In data flow graph processing, each node carries information, and different types of nodes can carry different information. However, currently, for data processing needs, all nodes are typically processed using the same layout algorithm. This results in a final graph that fails to reflect the differences between nodes in its layout. It may be impossible to display the hierarchical structure of the information carried by each node, leading to the inability to receive or the omission of this information at the business level. To use this information at the business level, further data processing is required, which not only increases data processing costs but also increases the difficulty of information reception and the amount of information that can be received, thus reducing the effectiveness of the information conveyed by the graph obtained through data flow graph processing.
[0004] It is evident that a data flow graph processing method is urgently needed to overcome the aforementioned shortcomings of existing technologies. Summary of the Invention
[0005] This application provides a data flow graph processing method, apparatus, device, and storage medium to solve the technical problem in the prior art where a layout algorithm for data flow graph processing cannot display the hierarchy of information, resulting in information not being received or being missing.
[0006] Firstly, this application provides a data flow graph processing method, including:
[0007] The data flow graph to be processed is divided into subgraphs according to the node type of the data flow graph to be processed, resulting in a first subgraph and multiple sets of second subgraphs. The data flow graph to be processed includes each original node and edges used to connect each original node.
[0008] The first subgraph and each group of second subgraphs are processed using different preset layout algorithms to obtain the corresponding first result graph and multiple groups of second result graphs.
[0009] The first result image and the multiple sets of second result images are aggregated to obtain an aggregated result image, and the overlapping areas of the aggregated result images are removed to obtain the target data flow graph.
[0010] Secondly, this application provides a data flow graph processing apparatus, comprising:
[0011] The subgraph partitioning module is used to partition the data flow graph to be processed into subgraphs according to the node type of the data flow graph to be processed, to obtain a first subgraph and multiple sets of second subgraphs. The data flow graph to be processed includes each original node and edges for connecting each original node.
[0012] The layout processing module is used to perform layout processing on the first subgraph and each group of second subgraphs using different preset layout algorithms to obtain the corresponding first result graph and multiple groups of second result graphs.
[0013] The aggregation processing module is used to aggregate the first result image and the multiple sets of second result images to obtain an aggregated result image, and remove the overlapping areas of the aggregated result images to obtain the target data flow graph.
[0014] Thirdly, this application provides an electronic device, comprising:
[0015] Processor; and,
[0016] Memory for storing the computer program of the processor;
[0017] The processor is configured to execute any of the possible data flow graph processing methods provided in the first aspect by executing the computer program.
[0018] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any of the possible data flow graph processing methods provided in the first aspect.
[0019] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the possible data flow graph processing methods provided in the first aspect.
[0020] This application provides a data flow graph processing method, apparatus, device, and storage medium. The data flow graph processing method provided by this application first divides the data flow graph to be processed into subgraphs according to the node types, obtaining a first subgraph and multiple sets of second subgraphs. The data flow graph to be processed includes each original node and edges connecting the original nodes. Then, different preset layout algorithms are used to process the first subgraph and each set of second subgraphs to obtain corresponding first result graphs and multiple sets of second result graphs. Finally, the first result graph and multiple sets of second result graphs are aggregated to obtain an aggregated result graph, and overlapping areas are removed to obtain the target data flow graph. The target data flow graph obtained through the data flow graph processing of this application can display the hierarchy of information carried by each original node, reducing data reprocessing steps, improving the direct utilization rate of data, enhancing the overall information transmission effect of the graph, and facilitating subsequent data statistical analysis and decision-making based on the target data flow graph. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0023] Figure 2 A schematic diagram of a data flow graph processing method provided in an embodiment of this application;
[0024] Figure 3 A schematic flowchart of another data flow graph processing method provided in an embodiment of this application;
[0025] Figure 4 This is a schematic diagram of a layout effect provided in an embodiment of this application;
[0026] Figure 5 This is a schematic diagram illustrating another layout effect provided in an embodiment of this application;
[0027] Figure 6 A schematic flowchart illustrating another data flow graph processing method provided in an embodiment of this application;
[0028] Figure 7 A schematic flowchart illustrating another data flow graph processing method provided in this application embodiment;
[0029] Figure 8This is a schematic diagram illustrating the effect of a target data flow graph provided in an embodiment of this application.
[0030] Figure 9 A schematic flowchart illustrating another data flow graph processing method provided in this application embodiment;
[0031] Figure 10 A schematic flowchart illustrating another data flow graph processing method provided in this application embodiment;
[0032] Figure 11 A schematic diagram of a data flow graph processing device provided in an embodiment of this application;
[0033] Figure 12 A schematic diagram of another data flow graph processing apparatus provided in an embodiment of this application;
[0034] Figure 13 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation
[0035] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of methods and apparatus consistent with some aspects of this application as detailed in the appended claims.
[0036] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0037] Current data flow graph processing methods typically use the same layout algorithm for all nodes, resulting in a final graph that fails to reflect the differences between nodes. This may prevent the display of the hierarchical information carried by each node, leading to the inability to receive or the omission of this information at the business level. Furthermore, to utilize this information at the business level, further data processing is required, increasing not only data processing costs but also the difficulty and amount of information that can be received, ultimately reducing the effectiveness of the information conveyed by the graph obtained through data flow graph processing.
[0038] To address the aforementioned problems in existing technologies, this application provides a data flow graph processing method, apparatus, device, and storage medium. The inventive concept of the data flow graph processing method provided in this application is as follows: Since different nodes can carry different information, the data flow graph to be processed is divided into subgraphs according to the node type of each original node, resulting in different subgraphs. Different preset layout algorithms are used for layout processing of different subgraphs to obtain the optimal layout algorithm for each subgraph. Finally, the result graphs obtained through layout processing using different preset layout algorithms are aggregated to obtain an aggregated result graph. Then, overlapping areas in the aggregated result graph are extracted to obtain the final target data flow graph with distinct node hierarchies. Compared with existing technologies, this reduces data reprocessing steps, improves the direct utilization rate of data, enhances the overall information transmission effect of the graph, and facilitates subsequent data statistical analysis and decision-making based on the target data flow graph.
[0039] The following describes exemplary application scenarios of the embodiments of this application.
[0040] Figure 1 This is a schematic diagram of an application scenario provided in an embodiment of this application, such as... Figure 1 As shown, a corresponding computer program can run on the terminal device 11 to provide business services to the user. The target data flow graph can graphically present the logical flow and / or logical transformation process of the data involved in the business service. The processor in the electronic device 12 is configured to execute the data flow graph processing method provided in this application embodiment to obtain the target data flow graph based on the data flow graph to be processed using the data flow graph processing method provided in this application embodiment, and then provide it to the terminal device 11 to provide corresponding business services to the user.
[0041] The terminal device 11 can be any terminal capable of providing business services to users, such as a computer, laptop, tablet, smartphone, or smartwatch, that supports corresponding computer programs. This embodiment does not limit the type of terminal device. Figure 1 The terminal device 11 is illustrated using a computer as an example. The electronic device 12 can be a server, server cluster, or computer, etc.; this embodiment does not limit its scope. Figure 1Electronic device 12 is shown as an example of a computer.
[0042] Furthermore, this application embodiment does not limit the specific business service types and content represented by the target data flow graph.
[0043] It should be noted that the above application scenarios are merely illustrative, and the data flow graph processing methods, apparatus, devices, and storage media provided in the embodiments of this application include, but are not limited to, the above application scenarios.
[0044] Figure 2 This is a schematic diagram of a data flow graph processing method provided in an embodiment of this application. Figure 2 As shown, this embodiment includes:
[0045] S101: Based on the node type of the data flow graph to be processed, the data flow graph to be processed is divided into subgraphs to obtain the first subgraph and multiple sets of second subgraphs.
[0046] The data flow graph to be processed includes each original node and the edges used to connect each original node.
[0047] The data flow graph to be processed, as a whole, is formed by each original node and the edges connecting them. For example, the data flow graph to be processed can be represented by the following expression (1):
[0048] G = (V, E) (1)
[0049] Where G represents the data flow graph to be processed, V represents the set formed by the original nodes, and E represents the edge connecting the original nodes.
[0050] It is understandable that only when the information carried by the original nodes has a logical relationship can these original nodes be connected to form an edge. The specific content of the logical relationship is determined by the business service that the data flow graph to be processed is to display, and this embodiment does not limit it.
[0051] Each original node can carry different information. For example, the original node that carries more important or source information is usually the root node, while the nodes connected to the root node can be leaf nodes. Therefore, there are two different types of original nodes that carry different information: root nodes or leaf nodes.
[0052] Optionally, the information that each original node can carry can be any one of the following: database information, business characteristic information, business process information, system information, business product information, and business department information. The specific content of the information carried is determined by the business service that the data flow diagram to be processed is to display.
[0053] Therefore, the data flow graph to be processed can be divided into subgraphs according to the node type of the data flow graph to be processed, resulting in a first subgraph and multiple sets of second subgraphs.
[0054] In one possible design, step S101 could be implemented as follows: Figure 3 As shown. Figure 3 This is a schematic flowchart of another data flow graph processing method provided in an embodiment of this application. Figure 3 As shown, this embodiment includes:
[0055] S1011: Loop through the data flow graph to be processed to obtain the node type of each original node.
[0056] Iterate through the data flow graph to be processed to obtain the node type of each original node, and divide the data flow graph to be processed into subgraphs according to the node type.
[0057] S1012: Determine the first subgraph as the subgraph formed by all first-type nodes in each original node and the edges connecting all first-type nodes.
[0058] S1013: Determine each group of second subgraphs as the subgraph formed by each first type node and all second type nodes connected to each first type node.
[0059] The data flow graph to be processed is divided into subgraphs based on the node type of each original node. Specifically, the subgraph formed by all first-type nodes in each original node and the edges connecting all first-type nodes is defined as the first subgraph. For example, the first subgraph (G) α It can be represented by the following expression (2):
[0060] G α =(V n ,E′)(2)
[0061] Among them, V n Let represent the set of all first-type nodes, n represents each first-type node in the set, and its maximum value is the number of first-type nodes. E′ represents the edge connecting the first-type nodes.
[0062] Accordingly, the subgraph formed by each first-type node in the original nodes and all second-type nodes connected to each first-type node can be determined as each corresponding group of second subgraphs, thus obtaining each group of second subgraphs. For example, each group of second subgraphs (G β It can be represented by the following expression (3):
[0063] G β =(V f ,E″) (3)
[0064] Among them, V f Let f represent the set of all second-type nodes, f represent each second-type node in the set, and its maximum value is the number of second-type nodes. E″ represents the edge connecting the second-type nodes.
[0065] Furthermore, node types can include a first preset type and a second preset type. Assuming the original node of type first preset type is the root node, then the original node of type second preset type is the leaf node, where the root node is connected to leaf nodes. Therefore, among the original nodes, each node of type first is of type first preset type, each node of type second is of type second preset type, the first preset type is the node type of the root node, and the second preset type is the node type of the leaf nodes.
[0066] Therefore, in one possible design, before step S1011, the following may also be included:
[0067] The node types of each original node are labeled according to the business attributes represented by the data flow graph to be processed, so as to distinguish each original node and obtain each first type node and each second type node. The business attributes represented by the data flow graph to be processed refer to the logical relationships expressed through the information carried by each original node. In actual operation, the node types of each original node can be labeled according to the specific logical relationships; this embodiment does not limit this.
[0068] S102: The first subgraph and each group of second subgraphs are processed using different preset layout algorithms to obtain the corresponding first result graph and multiple groups of second result graphs.
[0069] After obtaining the first subgraph and multiple sets of second subgraphs, different preset layout algorithms are used to perform corresponding layout processing on the first subgraph and each set of second subgraphs to obtain their respective first result graphs and sets of second result graphs. The different preset layout algorithms may include the aforementioned preset directed graph layout algorithm and preset circular layout algorithm.
[0070] For example, since the first subgraph contains all nodes of type 1, and the nodes of type 1 are the root nodes, a pre-defined directed graph layout algorithm can be used to layout the first subgraph. The resulting layout is the first result graph. A pre-defined directed layout algorithm could be, for example, the Dagre layout algorithm. Figure 4 This is a schematic diagram illustrating a layout effect provided in an embodiment of this application. Figure 4 An example is shown of a layout processing result obtained by using the Dagre layout algorithm.
[0071] Since each group of second subgraphs contains every first-type node and all second-type nodes connected to each first-type node, with the second-type nodes being leaf nodes of the root node, a pre-defined circular layout algorithm can be used to layout each group of second subgraphs. The resulting layout is the corresponding second subgraph. The pre-defined circular layout algorithm can be, for example, the Circle layout algorithm. Figure 5 This is a schematic diagram illustrating another layout effect provided in an embodiment of this application. Figure 5 An example is shown of a layout processing result obtained by using the Circle layout algorithm.
[0072] The Circle layout algorithm divides each group of second subgraphs into multiple clusters. The nodes of each cluster are located on the outer perimeter of the embedded circle, so that each group of second result graphs is displayed in the form of concentric circles. The embedded circle is formed by the first type of nodes that have been layout processed, and the second type of nodes that have been layout processed are distributed on the outer perimeter of the embedded circle.
[0073] S103: Aggregate the first result map and multiple sets of second result maps to obtain an aggregated result map, and remove the overlapping areas of the aggregated result map to obtain the target data flow map.
[0074] Different preset layout algorithms are used to process the layout of the first sub-image and each group of second sub-images respectively. After obtaining the first result image and multiple groups of second result images, the first result image and multiple groups of second result images need to be aggregated to obtain the aggregated result image.
[0075] Since both the first and second subgraphs contain nodes of the first type, there will be overlapping areas in the aggregated result graph. Therefore, it is necessary to further remove the overlapping areas in the aggregated result graph to finally obtain a hierarchical target data flow graph.
[0076] In one possible design, the aggregation process of the first result image and multiple sets of second result images in step S103 to obtain the aggregated result image could be implemented as follows: Figure 6 As shown. Figure 6 This is a schematic flowchart illustrating another data flow graph processing method provided in an embodiment of this application. Figure 6 As shown, this embodiment includes:
[0077] S201: Traverse each group of second result images according to the preset direction, obtain the center position of the concentric circle corresponding to each group of second result images, and determine the second target node at each center position as each center node.
[0078] For example, by traversing each group of second result images in a preset direction from left to right, since each group of second result images is displayed in a concentric circle manner, the center position of each concentric circle can be obtained, that is, the position of the aforementioned embedded circle. The node at each center position obtained, that is, the second target node, is determined as the center node of the current group of second result images, thereby obtaining each center node.
[0079] S202: Determine the first target node in the first result graph that is consistent with each central node as a feature node, so as to update the position of each central node to the position of the corresponding feature node.
[0080] For each central node, a first target node that matches each central node is found from the first result graph. The found first target node is determined as a feature node, and the position of each central node is updated to the position of the first target node that matches that central node. For example, assuming the central node is node A, then node B that matches node A is found, and the position of node A is updated to node B.
[0081] S203: Obtain the outer perimeter position of the concentric circle corresponding to each group of second result images, so as to update the position of the second target node at the outer perimeter position to the outer perimeter of the corresponding feature node.
[0082] As described above, the position of the center node is the position of the embedded circle. When the position of the center node is updated to the position of the corresponding feature node, the nodes distributed on the outer perimeter of the embedded circle need to be added synchronously to the feature node.
[0083] Specifically, firstly, the outer perimeter position of the concentric circle corresponding to each group of second result images is obtained. This outer perimeter position is also the outer perimeter of the embedded circle. Then, the positions of the nodes distributed on the outer perimeter position, which are also the node positions of the second target nodes, are updated to the outer perimeter of the corresponding feature nodes.
[0084] By completing the aggregation process of all the second result images and the first result images through the above steps S201 to S203, the aggregated result image is obtained.
[0085] Furthermore, one possible implementation of removing overlapping areas from the aggregated result graph in step S103 to obtain the target data flow graph is as follows: Figure 7 As shown. Figure 7 This is a schematic flowchart illustrating another data flow graph processing method provided in an embodiment of this application. Figure 7 As shown, this embodiment includes:
[0086] S301: Determine each dynamic adjustment region based on the maximum radius of each concentric circle.
[0087] First, determine each dynamic adjustment region based on the maximum radius of each concentric circle shown in the second result image, so as to dynamically adjust the position of the center node of each group of second result images in the aggregated result image.
[0088] For example, assuming the maximum radius of the current concentric circles is r, the coordinate range of the corresponding dynamic adjustment region R can be obtained according to the following relationships (4) to (7). In other words, assuming the coordinate range of R is [x,y,w,h], the relationship between each parameter in this coordinate range and r is as shown in the following relationships (4) to (7):
[0089] X=(x-(r+σ)) (4)
[0090] Y=(y-(r+σ)) (5)
[0091] w = 2r (6)
[0092] h = 2r (7)
[0093] Where x is the horizontal coordinate of the center node; y is the vertical coordinate of the center node; σ is a variable parameter, the specific value of which is set according to the actual working conditions; x, y, w, and h are the parameters that characterize the coordinate range of R, the value of x is the horizontal coordinate of the center of the concentric circle, the value of y is the vertical coordinate of the center of the concentric circle, w is the width of the concentric circle, and h is the height of the concentric circle.
[0094] The dynamic adjustment region of each concentric circle can be determined by, for example, relations (4) to (7).
[0095] S302: For the aggregation result diagram, determine the overlapping area of the dynamic adjustment area of adjacent concentric circles at the same level along the preset axis.
[0096] Assuming the first result image in the aggregated result diagram is laid out from left to right, concentric circles at the same level can be obtained from the aggregated result image. Then, by comparing the dynamically adjusted areas of adjacent concentric circles at the same level, the overlapping area along a preset axis can be determined. Wherein, when the first result image is laid out from left to right, the preset axis is the vertical axis.
[0097] For example, the overlapping area of the dynamic adjustment areas of adjacent concentric circles at the current level along a preset axis can be determined by the following relation (8). Specifically, when relation (8) is satisfied, the overlapping area is determined according to this relation.
[0098] ΔY=(Y i +r i )-(Y j +r j )>0 (8)
[0099] Here, ΔY is used to characterize the overlapping region, and i and j are used to distinguish adjacent current concentric circles, assuming that the value of i is less than the value of j.
[0100] S303: The concentric circles with smaller dynamic adjustment areas are shifted by a preset variable along a preset axis to eliminate overlapping areas.
[0101] When overlap is determined, the concentric circles with smaller dynamic adjustment areas are shifted by a preset variable along a preset axis to eliminate overlapping areas. For example, when relation (8) is satisfied, the concentric circle to which j belongs is shifted by a preset variable along the vertical axis. Specifically, the vertical coordinate of the second target node corresponding to the concentric circle is adjusted according to the preset variable.
[0102] Among them, the preset variable can be the sum of the overlapping area ΔY and the variable parameter σ, and the variable parameter σ is used to characterize the spacing value between concentric circles at the same level.
[0103] S304: Determine the aggregated result graph after removing overlapping regions as the target data flow graph.
[0104] By removing overlapping areas from the aggregation result graph through steps S301 to S303, the target data flow graph is obtained.
[0105] As described in the above embodiments, the data flow graph to be processed is divided into subgraphs, and different preset layout algorithms are used for layout processing of different subgraphs. The final target data flow graph presents the hierarchy of information carried by each original node, avoiding the inability of the business layer to receive or the absence of corresponding information that cannot be presented by a single layout algorithm in the existing technology. Figure 8 This is a schematic diagram illustrating the effect of a target data flow graph provided in an embodiment of this application, such as... Figure 8 As shown, the corresponding nodes distributed around nodes 1 to 8, as well as nodes 6 and 5 respectively. Figure 8 The circles in the diagram show clear hierarchical and logical relationships, greatly enhancing the visualization of the target data flow graph.
[0106] The data flow graph processing method provided in this application first divides the data flow graph to be processed into subgraphs according to the node types, obtaining a first subgraph and multiple sets of second subgraphs. The data flow graph to be processed includes each original node and edges connecting them. Then, different preset layout algorithms are used to process the first subgraph and each set of second subgraphs to obtain a corresponding first result graph and multiple sets of second result graphs. Finally, the first result graph and multiple sets of second result graphs are aggregated to obtain an aggregated result graph, and overlapping areas are removed to obtain the target data flow graph. The target data flow graph obtained through the data flow graph processing provided in this application can display the hierarchy of information carried by each original node, reducing data reprocessing steps, improving the direct utilization rate of data, enhancing the overall information transmission effect, and facilitating subsequent data statistical analysis and decision-making based on the target data flow graph.
[0107] In one possible design, the above embodiments may utilize a preset directed graph layout algorithm to perform layout processing on the first subgraph to obtain the first result graph, as follows: Figure 9 As shown. Figure 9 This is a schematic flowchart illustrating another data flow graph processing method provided in an embodiment of this application. Figure 9 As shown, this embodiment includes:
[0108] S401: Use a pre-defined directed graph JavaScript framework to obtain the first position information of each first target node for the first subgraph.
[0109] The Preset Directed Graph JavaScript Framework is a JavaScript framework based on a preset directed graph layout algorithm.
[0110] S402: Use each first target node and the edges connecting each first target node to form the first result graph.
[0111] For the first subgraph, a pre-defined directed graph JavaScript framework is used to calculate the first position information of the first target node, where the first target node is a node obtained after layout processing of the first type of nodes included in the first subgraph. Then, a first result graph is formed based on each first target node and the edges connecting them.
[0112] For JavaScript frameworks formed by a pre-defined directed graph layout algorithm, i.e., pre-defined directed graph JavaScript frameworks such as Dagre.js, the prerequisite is that the first subgraph (G) is... α The output result is the first result image (G). ατ The following relation (9) can be used to represent it:
[0113] G ατ=(V M ,K′) (9)
[0114] Among them, V M Let M represent the set of all first target nodes, M represent each first target node in the set, and its maximum value is the number of first target nodes. K′ represents the edge connecting the first target nodes.
[0115] Specifically, calculating the first position information of each first target node using a pre-defined directed graph JavaScript framework can include the following process:
[0116] Step 1: Go to the ring road.
[0117] Each node of type 1 begins a depth-first traversal of each of its outgoing edges. If the current node is not found in the traversal path of its outgoing edge (e1), it means that the current link does not have a cycle. If the current node is found in the traversal path of its outgoing edge (e1), it means that a cycle exists. When a cycle is determined to exist, the last edge of the cycle is removed to eliminate the cycle.
[0118] Step 2: Hierarchical allocation, obtaining the hierarchical information of each first target node in the first result graph.
[0119] Taking the connected first subgraph and the attribute information contained in its edges as input conditions, the output is the hierarchy information of each first target node in the first result graph. The attribute information contained in the edges includes the edge length and the edge weight.
[0120] The pre-defined directed graph JavaScript framework allocates levels by first calculating the initial level using the longest path, and then adjusting the length of the relaxed edges to complete the level allocation. Relaxation is relative to the edge length; an edge with a length greater than the actual required length is considered relaxed.
[0121] Step 3: Sort the nodes within the same level.
[0122] Get the order attribute of each first target node, which indicates its node order in the first result graph.
[0123] Step 4: Obtain the coordinate information of each first target node in the first result graph to perform node layout.
[0124] The coordinate information includes the horizontal axis coordinate and the vertical axis coordinate.
[0125] It is understandable that some of the steps described above only illustrate the principle of calculating the first position information of each first target node using a pre-defined directed graph JavaScript framework. In actual operation, the layout processing of the first subgraph can be achieved by running the program corresponding to the pre-defined directed graph JavaScript framework to obtain the first result graph. The layout processing includes, but is not limited to, the process described above.
[0126] The first location information includes the node order of each first target node in the first result diagram (represented by m), the original business information represented by each first target node (represented by o), the coordinate information of each first target node in the first result diagram (represented by x′ and y′ on the horizontal and vertical axes, respectively), and the hierarchical information of each first target node in the first result diagram (represented by rank).
[0127] Therefore, in relation (9), V M Each subset (V) m The following relation (10) can be used to express:
[0128] V m =*o,x′,y′,rank} (10)
[0129] In this embodiment, the original business information represented by each first target node is the business information of the corresponding first type node. The specific content of the business information is determined by the business attributes, which is not limited in this embodiment.
[0130] The data flow graph processing method provided in this application uses a preset directed graph JavaScript framework to obtain the first position information of each first target node for the first subgraph, and then uses each first target node to form a first result graph. The preset directed graph JavaScript framework is used for layout processing of the first type of nodes, so that the optimal layout processing method can be adopted for the characteristics of nodes in different subgraphs, which is beneficial for expressing the information carried by each original node in a rich and hierarchical manner.
[0131] In one possible design, the above embodiments utilize a preset circular layout algorithm to process the layout of each group of second sub-graphs to obtain each group of second result graphs. Possible implementations include: Figure 10 As shown. Figure 10 This is a schematic flowchart illustrating another data flow graph processing method provided in an embodiment of this application. Figure 10 As shown, this embodiment includes:
[0132] S501: For each group of second subgraphs, use a preset circular layout strategy to obtain the second position information of each second target node in parallel.
[0133] The preset ring layout algorithm includes a preset ring layout strategy.
[0134] S502: Use each second target node of each group and the edges connecting each second target node of each group to form the corresponding second result graph for each group.
[0135] Specifically, the preset circular layout strategy can be implemented by running the corresponding program for the preset circular layout algorithm, such as the program for the Circle layout. The prerequisite is that each group of second subgraphs (G...)... β Assuming the first type of node is a circle, the output result is the corresponding second result image (G) for each group. βτ The following relation (11) can be used to represent it:
[0136]
[0137] Among them, V Nτ ={o′,x″,y″,r},V Jτ = {o′, x″, y″}, where L′ represents the edge connecting the second target node.
[0138] Each group of second location information includes the original business information (denoted by o′) represented by each corresponding second target node, the coordinate information of each corresponding second target node (denoted by x″ and y″ representing the horizontal and vertical coordinates respectively), and the maximum radius of the concentric circle (denoted by r). Each second target node in each group of second result graphs forms a corresponding concentric circle.
[0139] The concentric circles are formed by the embedded circle and the outer perimeter of the embedded circle in the Circle layout, for example... Figure 8 Nodes 5 and 6 in the diagram form a concentric circle structure with the nodes represented by the circles distributed around them.
[0140] In addition, the second target node is the node obtained after the layout processing of the first type node and the second type node included in the second subgraph. The original business information represented by each second target node is the business information of the corresponding first type node and the second type node. The specific content of the business information is determined by the business attributes, which is not limited in this embodiment.
[0141] The data flow graph processing method provided in this application uses a preset circular layout strategy to obtain the second position information of each second target node in parallel for each group of second subgraphs, and then uses each second target node to form the second result graph of the corresponding group. The preset circular layout strategy is used for layout processing of the second subgraphs to ensure that the optimal layout processing method can be adopted for the characteristics of nodes in different subgraphs, which is beneficial for expressing the information carried by each original node in a rich and hierarchical manner.
[0142] Figure 11This is a schematic diagram of a data flow graph processing device provided in an embodiment of this application. Figure 11 As shown, the data flow graph processing device 600 provided in this embodiment includes:
[0143] The subgraph partitioning module 601 is used to partition the data flow graph to be processed into subgraphs according to the node type of the data flow graph to be processed, so as to obtain a first subgraph and multiple sets of second subgraphs.
[0144] The data flow graph to be processed includes each original node and the edges used to connect each original node.
[0145] The layout processing module 602 is used to perform layout processing on the first sub-image and each group of second sub-images using different preset layout algorithms to obtain the corresponding first result image and multiple groups of second result images.
[0146] The aggregation processing module 603 is used to aggregate the first result graph and multiple sets of second result graphs to obtain an aggregated result graph, and remove the overlapping areas of the aggregated result graphs to obtain the target data flow graph.
[0147] In one possible design, the subgraph partitioning module 601 is specifically used for:
[0148] Loop through the data flow graph to be processed to obtain the node type of each original node;
[0149] The subgraph formed by all first-type nodes in each original node and the edges connecting all first-type nodes is defined as the first subgraph;
[0150] Each subgraph formed by each first-type node and all second-type nodes connected to each first-type node is defined as a group of second subgraphs.
[0151] exist Figure 11 On this basis, Figure 12 This is a schematic diagram of another data flow graph processing apparatus provided in an embodiment of this application. Figure 12 As shown, the data flow graph processing device 600 provided in this embodiment further includes: a type labeling module 604. This type labeling module 604 is specifically used for:
[0152] Label the node type of each original node according to the business attributes represented by the data flow graph to be processed, so as to obtain each first type node and each second type node;
[0153] The node types include a first preset type and a second preset type. The node type of each first type node is the first preset type, and the node type of each second type node is the second preset type.
[0154] In one possible design, the layout processing module 602 includes:
[0155] The first layout processing submodule is used to perform layout processing on the first subgraph using a preset directed graph layout algorithm to obtain the first result graph;
[0156] The second layout processing submodule is used to process the layout of each group of second sub-graphs using a preset circular layout algorithm to obtain the corresponding second result graph for each group.
[0157] Among them, the different preset layout algorithms include the preset directed graph layout algorithm and the preset circular layout algorithm.
[0158] In one possible design, the first layout processing submodule is specifically used for:
[0159] For the first subgraph, a preset directed graph JavaScript framework is used to obtain the first position information of each first target node. The preset directed graph JavaScript framework is a JavaScript framework formed based on a preset directed graph layout algorithm.
[0160] The first result graph is formed using each first target node and the edges connecting each first target node;
[0161] The first location information includes the node order of each first target node in the first result diagram, the original business information represented by each first target node, the coordinate information of each first target node in the first result diagram, and the hierarchical information of each first target node in the first result diagram.
[0162] In one possible design, the second layout processing submodule is specifically used for:
[0163] For each group of second subgraphs, the second position information of each second target node is obtained in parallel using a preset ring layout strategy. The preset ring layout algorithm includes the preset ring layout strategy.
[0164] The second result graph for each group is formed by using each second target node in each group and the edges connecting each second target node in each group;
[0165] Each set of second location information includes the original business information represented by each corresponding second target node, the coordinate information of each corresponding second target node, and the maximum radius of the concentric circle. Each second target node in each set of second result diagrams forms a corresponding concentric circle.
[0166] In one possible design, the aggregation processing module 603 includes an aggregation processing submodule. This aggregation processing submodule is specifically used for:
[0167] Traverse each group of second result images in a preset direction, obtain the center position of the concentric circle corresponding to each group of second result images, and determine the second target node at each center position as each center node;
[0168] The first target node that is consistent with each central node in the first result graph is determined as the feature node, so that the position of each central node is updated to the position of the corresponding feature node;
[0169] Obtain the outer perimeter position of the concentric circle corresponding to each group of second result images, so as to update the position of the second target node at the outer perimeter position to the outer perimeter of the corresponding feature node;
[0170] By following the steps above, the aggregation process is completed, and the aggregation result image is obtained.
[0171] In one possible design, the aggregation processing module 603 includes an overlap rejection submodule. This overlap rejection submodule is specifically used for:
[0172] Each dynamic adjustment region is determined based on the maximum radius of each concentric circle;
[0173] For the aggregation result diagram, determine whether the dynamic adjustment areas of adjacent concentric circles at the same level overlap along the preset axis;
[0174] If so, the concentric circles with smaller dynamic adjustment areas will be shifted by a preset variable along the preset axis to eliminate overlapping areas;
[0175] The aggregated result graph after removing overlapping regions is determined as the target data flow graph.
[0176] In one possible design, each original node is used to carry any of the following types of business information:
[0177] Database information, business characteristic information, business process information, system information, business product information, and business department information.
[0178] It is worth noting that the above... Figure 11 and Figure 12 The optional embodiments provide a data flow graph processing apparatus that can be used to execute each step of the data flow graph processing method provided in any of the above embodiments. The specific implementation methods and technical effects are similar, and will not be described again here.
[0179] The device embodiments provided in this application are merely illustrative, and the module division is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system. The coupling between the modules can be achieved through some interfaces, which are usually electrical communication interfaces, but mechanical interfaces or other forms of interfaces are also possible. Therefore, the modules described as separate components may or may not be physically separated; they may be located in one place or distributed in different locations on the same or different devices.
[0180] Figure 13 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 13 As shown, the electronic device 700 may include at least one processor 701 and a memory 702. Figure 13 The example shown is an electronic device using a processor.
[0181] The memory 702 is used to store the computer program of the processor 701. Specifically, the program may include program code, which includes computer operation instructions.
[0182] The memory 702 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0183] The processor 701 is configured to execute computer programs stored in the memory 702 to implement the steps of the data flow graph processing methods in the above method embodiments.
[0184] The processor 701 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0185] Optionally, the memory 702 can be either standalone or integrated with the processor 701. When the memory 702 is a device independent of the processor 701, the electronic device 700 may further include:
[0186] Bus 703 is used to connect processor 701 and memory 702. The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not mean there is only one bus or one type of bus.
[0187] Optionally, in a specific implementation, if the memory 702 and the processor 701 are integrated on a single chip, the memory 702 and the processor 701 can communicate through an internal interface.
[0188] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores a computer program. When at least one processor of an electronic device executes the computer program, the electronic device performs each step of the data flow graph processing method provided in the above-described embodiments.
[0189] This application also provides a computer program product comprising a computer program stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the electronic device to perform the various steps of the data flow graph processing methods provided in the various embodiments described above.
[0190] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.
[0191] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A data flow graph processing method, characterized in that, include: The data flow graph to be processed is divided into subgraphs according to the node type, resulting in a first subgraph and multiple sets of second subgraphs. The data flow graph to be processed includes each original node and edges used to connect the original nodes. The first subgraph includes a subgraph composed of root nodes, and the second subgraph includes a subgraph composed of root nodes and leaf nodes. The first subgraph and each group of second subgraphs are processed using different preset layout algorithms to obtain the corresponding first result graph and multiple groups of second result graphs. The first result image and the multiple sets of second result images are aggregated to obtain an aggregated result image, and the overlapping areas of the aggregated result images are removed to obtain the target data flow graph; The process of dividing the data flow graph to be processed into subgraphs based on the node types of the data flow graph to be processed, resulting in a first subgraph and multiple sets of second subgraphs, includes: The data flow graph to be processed is traversed in a loop to obtain the node type of each original node; The subgraph formed by all the first type nodes in each of the original nodes and the edges connecting all the first type nodes is defined as the first subgraph; the first type node is the root node; Each subgraph formed by each first-type node and all second-type nodes connected to each first-type node is defined as the second subgraph group; the second-type nodes are leaf nodes; The aggregation process of the first result image and the multiple sets of second result images to obtain the aggregated result image includes: Traverse each group of second result images in a preset direction to obtain the center position of the concentric circle corresponding to each group of second result images, so as to determine the second target node at each center position as each center node; The first target node in the first result graph that is consistent with each of the central nodes is determined as a feature node, so that the position of each central node is updated to the position of the corresponding feature node; Obtain the outer perimeter position of the concentric circle corresponding to each group of second result images, so as to update the position of the second target node at the outer perimeter position to the outer perimeter of the corresponding feature node; The above steps complete the aggregation process, resulting in the aggregation result image. The step of removing overlapping regions from the aggregated result graph to obtain the target data flow graph includes: Each dynamic adjustment region is determined based on the maximum radius of each concentric circle; For the aggregation result diagram, determine the overlapping area of the dynamic adjustment area of the adjacent concentric circles at the same level along the preset axis; The concentric circles with smaller dynamic adjustment areas are shifted by a preset variable along the preset axis to eliminate the overlapping areas; The aggregated result graph after removing the overlapping regions is determined as the target data flow graph.
2. The data flow graph processing method according to claim 1, characterized in that, The step of performing layout processing on the first subgraph and each group of second subgraphs using different preset layout algorithms to obtain the corresponding first result graph and multiple groups of second result graphs includes: The first subgraph is processed using a preset directed graph layout algorithm to obtain the first result graph; The layout processing is performed on each group of second sub-graphs using a preset circular layout algorithm to obtain the corresponding group of second result graphs. The different preset layout algorithms include the preset directed graph layout algorithm and the preset circular layout algorithm.
3. The data flow graph processing method according to claim 2, characterized in that, The step of performing the layout processing on the first subgraph using a preset directed graph layout algorithm to obtain the first result graph includes: For the first subgraph, a preset directed graph JavaScript framework is used to obtain the first position information of each first target node. The preset directed graph JavaScript framework is a JavaScript framework formed based on the preset directed graph layout algorithm. The first result graph is formed using the first target nodes and the edges connecting the first target nodes; The first location information includes the node order of each first target node in the first result diagram, the original business information represented by each first target node, the coordinate information of each first target node in the first result diagram, and the hierarchical information of each first target node in the first result diagram.
4. The data flow graph processing method according to claim 2, characterized in that, The step of performing the layout processing on each group of second sub-graphs using a preset circular layout algorithm to obtain the corresponding group of second result graphs includes: For each group of second subgraphs, the second position information of each second target node is obtained in parallel using a preset ring layout strategy. The preset ring layout algorithm includes the preset ring layout strategy. The corresponding second result graph for each group is formed by using the second target nodes of each group and the edges connecting the second target nodes of each group; Each set of second location information includes the original business information represented by each second target node, the coordinate information of each second target node, and the maximum radius of the concentric circle. The second target nodes in each set of second result diagrams form the corresponding concentric circles.
5. A data flow graph processing apparatus, characterized in that, include: The subgraph partitioning module is used to partition the data flow graph to be processed into subgraphs according to the node type of the data flow graph to be processed, to obtain a first subgraph and multiple sets of second subgraphs. The data flow graph to be processed includes each original node and edges for connecting each original node. The first subgraph includes a subgraph composed of root nodes, and the second subgraph includes a subgraph composed of root nodes and leaf nodes. The layout processing module is used to perform layout processing on the first subgraph and each group of second subgraphs using different preset layout algorithms to obtain the corresponding first result graph and multiple groups of second result graphs. An aggregation processing module is used to aggregate the first result image and the multiple sets of second result images to obtain an aggregated result image, and to remove the overlapping areas of the aggregated result images to obtain a target data flow graph; The subgraph partitioning module is specifically used to: traverse the data flow graph to be processed in a loop to obtain the node type of each original node; The subgraph formed by all the first type nodes in each of the original nodes and the edges connecting all the first type nodes is defined as the first subgraph; the first type node is the root node; Each subgraph formed by each first-type node and all second-type nodes connected to each first-type node is defined as the second subgraph group; the second-type nodes are leaf nodes; The aggregation processing module is specifically used for: Traverse each group of second result images in a preset direction to obtain the center position of the concentric circle corresponding to each group of second result images, so as to determine the second target node at each center position as each center node; The first target node in the first result graph that is consistent with each of the central nodes is determined as a feature node, so that the position of each central node is updated to the position of the corresponding feature node; Obtain the outer perimeter position of the concentric circle corresponding to each group of second result images, so as to update the position of the second target node at the outer perimeter position to the outer perimeter of the corresponding feature node; The above steps complete the aggregation process, resulting in the aggregation result image. Each dynamic adjustment region is determined based on the maximum radius of each concentric circle; For the aggregation result diagram, determine the overlapping area of the dynamic adjustment area of the adjacent concentric circles at the same level along the preset axis; The concentric circles with smaller dynamic adjustment areas are shifted by a preset variable along the preset axis to eliminate the overlapping areas; The aggregated result graph after removing the overlapping regions is determined as the target data flow graph.
6. An electronic device, characterized in that, include: processor; as well as, Memory for storing the computer program of the processor; The processor is configured to execute the data flow graph processing method according to any one of claims 1 to 4 by executing the computer program.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the data flow graph processing method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Visualization layout method based on image multi-stage task system modular decomposition
CN103065028A
Network layout method and system based on segmentation drawing method and medium
CN110853120A