CN115905549A - Data flow graph generation method and device, storage medium and terminal - Google Patents

Data flow graph generation method and device, storage medium and terminal Download PDF

Info

Publication number
CN115905549A
CN115905549A CN202110979518.4A CN202110979518A CN115905549A CN 115905549 A CN115905549 A CN 115905549A CN 202110979518 A CN202110979518 A CN 202110979518A CN 115905549 A CN115905549 A CN 115905549A
Authority
CN
China
Prior art keywords
node
manager
information
data flow
flow graph
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110979518.4A
Other languages
Chinese (zh)
Inventor
王达昇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shizhen Information Technology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shizhen Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shizhen Information Technology Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN202110979518.4A priority Critical patent/CN115905549A/en
Publication of CN115905549A publication Critical patent/CN115905549A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a data flow graph generation method and device, a storage medium and electronic equipment, and relates to the technical field of computers. Wherein, the method comprises the following steps: receiving a first trigger event for a first node through a canvas, and displaying a selection box associated with the first node; monitoring and identifying a second trigger event through a selection box; creating a node according to a second trigger event through an engine manager to obtain a second node, and determining relationship information of the first node and the second node; performing association processing on the characteristic information of the first node and the characteristic information of the second node according to the relationship information through an association manager; obtaining a tree relation structure about the first node and the second node according to the association processing; and rendering the tree relation structure through a rendering manager to obtain the data flow graph. The technical scheme can provide the data flow graph with clear data flow direction, and the data flow graph has higher expansibility, so that the practicability of the data flow graph is effectively improved.

Description

Data flow graph generation method and device, storage medium and terminal
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a data flow graph, a computer-readable storage medium, and a terminal.
Background
Under the application scenes of learning, working, project meetings and the like, the data flow graph can help people to arrange ideas and diverge thinking. Drawing a data flow graph in a browser is more convenient than downloading a drawing tool, but a concise and clear data flow method is lacked in the data flow graph generation method in the related art.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a method for generating a data flow graph, which overcomes, at least to some extent, the problem of lack of clear data flow direction in the related art.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, a method for generating a data flow graph is provided, which includes: receiving a first trigger event for a first node through a canvas, and displaying a selection box associated with the first node; monitoring and identifying a second trigger event through the selection frame; the engine manager creates a node according to the second trigger event to obtain a second node, and determines the relationship information of the first node and the second node; performing association processing on the first node and the second node according to the relationship information through an association manager to obtain a tree-like relationship structure of the first node and the second node; and rendering the tree relation structure through a rendering manager to obtain the data flow graph.
In an embodiment of the present disclosure, the displaying a selection box associated with the first node includes: acquiring, by the engine manager, position information of the first node and shape information of the first node, and determining a target area associated with the first node according to the position information of the first node and the shape information; if the first trigger event is determined to act on the target area, displaying a selection frame associated with the first node; and if the first trigger event is determined not to act on the target area, not displaying the selection frame.
In an embodiment of the present disclosure, the determining relationship information between the first node and the second node includes: and determining the identifier of the first node as the parent node identifier of the second node, and determining the relationship information of the first node and the second node.
In an embodiment of the present disclosure, a data manager stores node characteristic information of the first node, where the node characteristic information includes: position information, shape information, and parent node identification; the method further comprises the following steps: and adding the node characteristic information of the second node to the node characteristic information of the first node through the data manager, and then maintaining the node characteristic information in a one-dimensional array form.
In an embodiment of the present disclosure, associating the first node and the second node according to the relationship information to obtain a tree relationship structure about the first node and the second node includes: determining nodes with brother relationships and determining nodes with parent-child relationships according to the relationship information; calculating the longitudinal distance between the nodes with the brother relationship and the transverse distance between the nodes with the father-son relationship, and updating the characteristic information of the first node and the characteristic information of the second node according to the longitudinal distance and the transverse distance; and determining a tree structure of the first node and the second node according to the updated node characteristic information.
In an embodiment of the present disclosure, the method further includes: replacing the characteristic information of the first node in the data manager with the updated node characteristic information of the first node; and replacing the characteristic information of the second node in the data manager with the updated node characteristic information of the second node.
In an embodiment of the present disclosure, after rendering the tree relationship structure by the rendering manager, the method further includes: determining a node to be deleted according to the second trigger event through the engine manager; deleting the node characteristic information of the node to be deleted in the data manager so as to update the data manager; updating the tree relation structure based on the updated data manager through the association manager; and rendering the updated tree relationship structure through the rendering manager.
According to a second aspect of the present disclosure, there is provided a data flow chart generation apparatus, including: the canvas is used for receiving a first trigger event of a first node and displaying a selection frame associated with the first node; the selection frame is used for monitoring and identifying a second trigger event; the engine manager is used for creating a node according to the second trigger event to obtain a second node and determining the relationship information of the first node and the second node; the association manager is used for performing association processing on the first node and the second node according to the relationship information to obtain a tree-shaped relationship structure of the first node and the second node; and the rendering manager is used for rendering the tree-like relation structure to obtain a data flow graph.
According to a third aspect of the present disclosure, there is provided a terminal comprising: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for generating the data flow graph according to the first aspect when executing the computer program.
According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method for generating a data flow graph according to the first aspect described above.
The method and the device for generating the data flow graph, the computer-readable storage medium and the terminal provided by the embodiment of the disclosure have the following technical effects:
in the data flow graph generating process provided by the embodiment of the disclosure, a trigger event for a first node is received through a canvas, a selection box is displayed under the condition that the first node is determined to be selected, and an event created by an identification node is monitored through the selection box. Further, a child node of the first node is created through the engine manager, and at least one second node is obtained. And performing association processing on the first node and the second node through an association manager according to the relationship information between the first node and the second node to obtain a tree relationship structure reflecting the node relationship. Further, the tree-like relation structure is rendered through the rendering manager, and finally the data flow graph about the first node and the second node is obtained. The technical scheme is based on event triggering, association processing of node information, determination of reflecting the tree-shaped relation structure between nodes and rendering of the tree-shaped relation structure, a data flow graph with clear data flow direction can be provided, and the data flow graph has high expansibility, so that the data flow graph can be expanded into a collaborative data flow graph, an infinite data flow graph and the like, and the practicability of the data flow graph is effectively improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
Fig. 1 schematically illustrates an architecture diagram of a data flow graph generation method provided by an embodiment of the present disclosure;
fig. 2 schematically illustrates a flowchart of a data flow graph generation method provided by an embodiment of the present disclosure;
FIG. 3 illustrates a schematic diagram of an initial root element on a canvas provided by an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart showing a selection box associated with a first node provided by an embodiment of the present disclosure;
FIG. 5 is a diagram illustrating a state of a root element after being selected according to an embodiment of the disclosure;
FIG. 6 is a schematic diagram illustrating relationships between nodes provided by embodiments of the present disclosure;
FIG. 7 is a diagram illustrating a rendered tree relationship structure provided by an embodiment of the present disclosure;
FIG. 8 is a schematic diagram illustrating the case of adding elements to a one-dimensional array provided by an embodiment of the present disclosure;
fig. 9 schematically illustrates a flowchart for obtaining a tree relationship structure about a first node and a second node according to an association process provided by the embodiment of the present disclosure;
FIG. 10 illustrates a schematic diagram of a rendered root element provided by an embodiment of the present disclosure;
fig. 11 schematically illustrates a flowchart of deleting a node provided by an embodiment of the present disclosure;
FIG. 12 schematically illustrates an overall workflow provided by an embodiment of the present disclosure;
fig. 13 is a block diagram schematically illustrating a data flow graph generating apparatus according to an embodiment of the present disclosure;
fig. 14 is a block diagram schematically illustrating a data flow graph generating apparatus according to another embodiment of the present disclosure;
fig. 15 schematically shows a block diagram of a terminal suitable for use to implement the above-described dataflow graph generation method.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure more clear, embodiments of the present disclosure will be described in further detail below with reference to the accompanying drawings.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In the description of the present disclosure, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present disclosure can be understood in a specific case to those of ordinary skill in the art. Further, in the description of the present disclosure, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated object, indicating that there may be three relationships, for example, a and/or B, which may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
A Data Flow graph (DFD) is also called a "mind map", which means that from the perspective of Data transmission and processing, the logical function of a system, the logical Flow direction of Data inside the system, and the logical transformation process are expressed in a graphical manner, and is a main expression tool of a structured system analysis method and a graphical representation method for representing a software model. Specifically, the data flow graph comprises a plurality of nodes, and different nodes comprise parent-child relationships and sibling relationships according to the data flow direction.
Before the embodiment of the method for generating a data flow diagram provided by the technical scheme is introduced, the composition and the function of a system for generating the data flow diagram are introduced. Specific implementation of functions corresponding to the respective components will be specifically described in the section of the method embodiment.
Fig. 1 schematically shows an architecture diagram of a data flow diagram generation system according to an exemplary embodiment of the present disclosure. In particular, fig. 1 shows a process of creating a second node with a first node as a parent node, which involves in particular: a canvas 111 displayed at the terminal 110, an engine manager 120, a data manager 130, an association manager 140, and a rendering manager 150. The engine manager 120, the association manager 140, and the rendering manager 150 may be separate servers, may be disposed in the same server, or may be disposed in a terminal processor. The data manager 130 may be various forms of databases. Information transmission between the various components of the system may be accomplished via a network (not shown).
Referring to fig. 1, a display screen of a terminal 110 is shown with a canvas 111, and a dataflow graph during creation is shown in the canvas 111. Specifically, the process of newly establishing the second node B by using the first node a as the parent node is as follows:
(1) For the canvas 111, a first trigger event of the first node a by the user is received, coordinate information corresponding to the first trigger event acting on the canvas 111 is determined, and the coordinate information is sent to the engine manager 120.
Accordingly, the engine sensor 120 determines whether the first node a is selected according to the coordinate information based on the node characteristic information about the first node a stored in the data manager 130.
(2) In case that it is determined that the first node a is selected by the coordinate information, the engine manager 120 transmits an instruction to present the selection box 112 to the terminal 110. Thus, the user may view the selection box 112 associated with the first node A in the canvas.
(3) A second trigger event is monitored and identified by the selection box 112, and in case the second trigger event is a newly added node, a second node B is newly added through the engine manager 120. Illustratively, a plurality of second nodes B as shown in the figure may be obtained by performing the second triggering event a plurality of times to newly create a plurality of child nodes of the first node A.
(4) The node characteristic information of the newly added second node B is stored in the data manager 130. It should be noted that the data manager 130 stores node characteristic information of each node in the dataflow graph, including position information and shape information of the node and a parent node identifier of the node. For example, the relationship information may determine that the parent node of the second node B is the first node a according to the parent node identifier in the node characteristic information of the second node B.
(5) The association manager 140 associates the node information stored in the data manager 130 with the relationship information between the nodes, and obtains a tree relationship structure for the nodes.
(6) And rendering the tree relationship structure through the rendering manager 150 to obtain the data flow graph.
Specific implementations of the respective components in the generation system regarding the data flow diagram described above will also be specifically described in the method embodiment.
Hereinafter, each step of the method for generating a data flow diagram in the present exemplary embodiment will be described in more detail with reference to the drawings and examples.
Fig. 2 schematically shows a flowchart of a method for generating a data flow diagram according to an exemplary embodiment of the present application. Referring to fig. 2, the method includes the steps of:
s201, receiving a first trigger event for a first node through a canvas, and displaying a selection box associated with the first node;
s202, monitoring and identifying a second trigger event through a selection box;
s203, creating a node according to a second trigger event through the engine manager to obtain a second node, and determining the relationship information of the first node and the second node;
s204, performing association processing on the first node and the second node according to the relationship information through an association manager to obtain a tree-shaped relationship structure of the first node and the second node; and the number of the first and second groups,
and S205, rendering the tree relation structure through the rendering manager to obtain a data flow graph.
In the dataflow graph generation process provided by the embodiment shown in fig. 2, a trigger event for a first node is received through the canvas 111, and the selection box 112 is displayed in a case where it is determined that the first node is selected. At least one second node is obtained by engine manager 120 creating a child of the first node by listening to the event identifying the creation of the node through decision block 112. The association manager 140 associates the first node with the second node according to the relationship information between the first node and the second node, so as to obtain a tree relationship structure reflecting the relationship between the nodes. Further, the tree-like relationship structure is rendered by the rendering manager 150, and finally a dataflow graph with respect to the first node and the second node is obtained. The technical scheme is based on event triggering, association processing of node information, determination of reflecting the tree-shaped relation structure between nodes and rendering of the tree-shaped relation structure, a data flow graph with clear data flow direction can be provided, and the data flow graph has high expansibility, so that the data flow graph can be expanded into a collaborative data flow graph, an infinite data flow graph and the like, and the practicability of the data flow graph is effectively improved.
The following detailed description of the various steps involved in the embodiment shown in fig. 2:
in S201, a first trigger event for a first node is received through the canvas, and a selection box associated with the first node is displayed.
In an exemplary embodiment, the first node may be any node in the dataflow graph. As shown in fig. 3, a canvas 111 shows a root node 301 in the data flow graph, which may be the "first node" in this embodiment. And further, a root node is used as a father node to establish a new node.
The canvas is an Application Programming Interface (API) provided by the browser. Js gesture library (JavaScript library for detecting touch gestures) is used in this embodiment to process a trigger event acting on the canvas, such as the first trigger event in this embodiment.
The first trigger event may be implemented by an external device (e.g., a mouse, a keyboard, etc.). Illustratively, hitting a node may be represented by a single click operation of a mouse, double clicking represents editing the node, and the like. Illustratively, referring to fig. 2, the selection of the root node may be accomplished by mouse clicking on the root node 301 in the canvas 111. Editing of the root node, such as inputting the text content corresponding to the node 301, may also be implemented by double-clicking the root node 301 in the canvas 111 with a mouse.
In the exemplary embodiment, it is a specific implementation of "displaying a selection box associated with the first node" in S201. Fig. 4 schematically illustrates a flowchart for displaying a selection box associated with a first node provided by an embodiment of the present disclosure. Referring to FIG. 4, the embodiment shown in this figure includes S401-S404.
In S401, the engine manager acquires the position information of the first node and the shape information of the first node, and determines a target area associated with the first node according to the position information and the shape information of the first node.
In an exemplary embodiment, the position information of each node in the data flow graph may be represented as coordinate information in the same coordinate system, and the shape information may be represented by height and width. Each node in the data flow graph may be denoted as (x, y, width, height). Referring to fig. 1, in the present embodiment, (x, y, width, height) corresponding to each node is stored by the data manager 140.
In this embodiment, the engine manager 130 may obtain (x) corresponding to the root node 301 from the data manager 140 0 ,y 0 ,width 0 ,height 0 ). Obviously, a rectangular range can be formed from the position information and the shape information of the root node 301, so as to obtain the target area associated with the root node.
In S402, it is determined whether the first trigger event acts on the target area.
Illustratively, it is determined by the engine manager 130 whether the first trigger event acts inside the target area. Specifically, the coordinate information of the first trigger event acting on the canvas may be acquired, and further, whether the coordinate information is within the rectangular range may be determined.
For example, if the first trigger event acts in the target area, which indicates that the first trigger event hits the root node 301, S403 is executed: displaying a selection box associated with the first node. Specifically, the target area associated with the root node 301 is shown as a selection box for easy viewing by the user, indicating that the first trigger event has hit the root node 301. For example, referring to FIG. 5, on the basis of FIG. 3, in addition to displaying root node 301, a target area associated with root node 301 is also shown in canvas 111 as selection box 501. As another example, in FIG. 1, upon selection of a first node A, a selection box 112 associated with the first node A is displayed in canvas 111.
Illustratively, the selection box is implemented by using a DOM (Document Object Model) tag, for example, the selection box may be displayed as a blue border with a recognition degree, so that a user can quickly confirm whether the determined parent node is correct.
If the target area is not acted on, executing S404: the selection box is not displayed. If the first trigger event does not hit the root node 301, the selection box associated with the first node is not displayed. Thereby avoiding a user creating a child node without successfully selecting a parent node.
It can be seen that the embodiment shown in fig. 4 is beneficial to improving the drawing accuracy of the dataflow graph.
With continued reference to fig. 2, in S202, a second trigger event is listened for and identified through the checkbox.
Js is used by the selection box to mount the DOM tag corresponding to the selection box in the gesture library so as to monitor and identify the second trigger event. Illustratively, the second trigger event includes addition and deletion, which is implemented by an external device, such as a keyboard key. For example, a new node is realized by a Tab key in a keyboard, that is, the root node 301 selected in the above embodiment is used as a parent node and a child node is newly added, and the root node 301 selected in the above embodiment is deleted by Delete in the keyboard.
In S203, the engine manager creates a node according to the second trigger event to obtain a second node, and determines relationship information between the first node and the second node.
In an exemplary embodiment, referring to fig. 6, when the second trigger event is a new node, the engine manager 130 uses the root node 301 as a new node to obtain a second node 601, a second node 602, and a second node 603. That is, each of the newly added second nodes is a child node of the selected root node 301.
In this embodiment, in order to determine the relationship information between the root node 301 and the second nodes 601 to 603, the identifier of the root node 301 may be determined as the parent node identifier of each second node.
Wherein, the father node ID can be identified as parentId, if the ID of the root node is ID 0 Then the parent node id of the second node can be expressed as parentId 0 . Through the father node identification, the nodes can be conveniently establishedThe association relationship between them.
Referring to fig. 7, in another exemplary embodiment, a node 601 may be further selected in a manner corresponding to the embodiment in S201, nodes 701 to 703 are created by using the node 601 as a parent node in the embodiments provided in S102 to S103, and further, node characteristic information of the created nodes 701 to 703 is stored in the data manager 140. Taking node 701 as an example, the node characteristic information stored in the data manager 140 includes the position information, shape information, and parent node identification (i.e., identification of node 601) of node 701.
That is, the data manager stores node characteristic information of each node, including: location information, shape information, and its parent node identification.
Further, as shown in fig. 8, after the node characteristic information 82 of the second node is added to the node characteristic information 81 of the first node by the data manager 140, information of each node is maintained in the form of a one-dimensional array. The data structure of the one-dimensional array is beneficial to reducing the complexity of traversing the data manager in the subsequent embodiment to perform the association processing process between the nodes, and further improving the association processing efficiency between the nodes.
In an exemplary embodiment, referring to FIG. 7, suppose the identity of root node 301 is ID 0 If the root node 201 is used as a new node of the parent node to obtain the child nodes 601 to 603, the parent node identifiers in the node characteristic information of the nodes 601 to 603 are parentID 0 . Further, suppose the identity of node 601 is an ID 1 If the node 601 is used as a new node added to the parent node to obtain the child nodes 701 to 703, the parent node identifiers in the node characteristic information of the nodes 701 to 703 are parentIDs 1 . By analogy, the father node identification of each node in the infinitely-extended data flow graph can be obtained, and the association relationship between the nodes can be further determined according to the father node identification.
Continuing to refer to fig. 2, in S204, the association manager associates the first node and the second node according to the relationship information, so as to obtain a tree relationship structure about the first node and the second node.
As a specific implementation manner of step S204, fig. 9 schematically illustrates a flowchart for obtaining a tree relationship structure about a first node and a second node according to association processing provided by the embodiment of the present disclosure. Referring to FIG. 9, the method shown in this figure includes S901-S903:
in S901, the nodes having the sibling relationship and the nodes having the parent-child relationship are determined according to the relationship information.
As described above, the relationship information is determined according to the parent node identifier in the node feature information. Illustratively, there is sibling information (e.g., nodes 601-603 in fig. 6) for nodes with the same parent node identification, and there is a parent-child relationship between the nodes and the nodes corresponding to the parent node identification in the node characteristic information.
In S902, a vertical distance between nodes having a sibling relationship and a horizontal distance between nodes having a parent-child relationship are calculated, and the position information of the first node and the position information of the second node are updated according to the vertical distance and the horizontal distance.
In an exemplary embodiment, as described above, a first node may have multiple children nodes at the same time, that is, there are multiple second nodes (refer to nodes 701-703 in fig. 7), so in the process of building a data flow graph composed of nodes, the distance between the nodes having sibling relationships (referred to as "vertical distance") needs to be determined. Meanwhile, nodes in the data flow graph contain multiple parent-child relationships, so that the distance (referred to as "transverse distance") between nodes with parent-child relationships needs to be determined. Illustratively, the vertical distance may be determined by using height information height of a node having a sibling relationship, and the horizontal distance may be determined by width information width of a node having a parent-child relationship.
The height information height and the width information width in the node information may be initial default values, and may also be adaptively changed according to a range occupied by the user input text.
Illustratively, the pitch calculation provided in the present embodiment employs a recursive algorithm: determining the longitudinal distance by taking the child node of the lowest level as a start; the lateral spacing between the lowest level and the previous level is then determined. And the analogy is carried out until the transverse distance between the root node and the root node is calculated. Referring to FIG. 7, the longitudinal spacing between nodes 701-703 is calculated first, and then the lateral spacing between node 701/node 702/node 703 and parent node 602 is calculated; next, the longitudinal spacing between nodes 601-603 is calculated, and then the lateral spacing between node 601/node 602/node 603 and node 301 is calculated. Thereby determining the lateral spacing as well as the vertical spacing between nodes in the dataflow graph shown in the canvas of fig. 7.
Further, after the distance information is determined, the position information (x, y) of each node is also changed, so that the position information of the node needs to be recalculated to update the position information of the first node and the position information of the second node.
It should be noted that the original stored information in the data manager 140 is replaced by the updated node information, that is, the location information of the first node in the data manager is replaced by the updated node characteristic information of the first node, and the location information of the second node in the data manager is replaced by the updated node characteristic information of the second node.
Therefore, real-time updating of the data maintained in the data manager is guaranteed, and the latest data is provided for creation of the data flow graph. When the engine manager 130 performs related data processing (e.g., determining whether the first node is hit in the S201 embodiment, performing association processing in the S205 embodiment) according to the latest version data in the data manager 140, it is beneficial to improve the creation accuracy of the data flow.
In S903, a tree relationship structure with respect to the first node and the second node is determined according to the updated node characteristic information.
In an exemplary embodiment, a data flow direction is determined according to a parent-child relationship and a sibling relationship between nodes, and a specific position of each node is determined according to updated node characteristic information, so as to form a tree relationship structure as shown in fig. 7.
Illustratively, the data in the one-dimensional array maintained in the data manager 140 is converted into the tree relationship structure by the engine manager 130 in a manner that: traversing and searching are carried out according to the father node identification, the association relation among the nodes is established in the memory, and the distances among all the levels and among brother nodes of the same level are recursively calculated from the nodes 701, 702 and 703 of the lowest level of the tree-shaped relation structure step by step upwards according to the recursive algorithm related to the distance, so that the tree-shaped relation structure is determined.
Further, after the information updating is completed, the tree structure is converted into the one-dimensional array again, and the node information in the data manager is updated again, so that the next traversal process is facilitated.
With continued reference to fig. 2, in S205, the tree relationship structure is rendered by the rendering manager, resulting in a dataflow graph.
In an exemplary embodiment, the tree relationship structure is illustrated by taking the rendered tree relationship structure shown in fig. 10 as an example. In particular, the data for each node within the canvas 111 is rendered into canvas elements by the rendering manager 150 using canvas techniques.
In an exemplary embodiment, in the case that the first trigger event is "double mouse click", the user may input text at the selected node to obtain the dataflow graph.
In an exemplary embodiment, fig. 11 schematically illustrates a flow chart of a method in a case of deleting a node according to an exemplary embodiment of the present application. Referring to FIG. 11, the method includes steps S1101-S1104:
in S1101, the node to be deleted is determined by the engine manager according to the second trigger event.
Illustratively, a node (which will be a node to be deleted in this embodiment) is selected according to the embodiment provided at S201 and a selection box associated with the selected node is displayed (as shown in fig. 5). Further, according to the embodiment provided by S202, the second trigger event is monitored and identified as a deleted node through the checkbox.
In this embodiment, when the selection box identifies that the second trigger event is a deletion event, the engine manager 130 determines a node to be deleted.
In an exemplary embodiment, if the hit node is not the node of the lowest hierarchy in the dataflow graph, both the selected node and the node having the selected node as a parent node are determined as nodes to be deleted.
In S1102, the node characteristic information of the node to be deleted is deleted in the data manager to update the data manager.
In an exemplary embodiment, when a node is deleted, if there is no child node associated with the node, only the information of the node is deleted, and if there is a child node associated with the node, the information of the node and all the child nodes thereof is deleted.
Since the association manager 140 will determine the tree relationship structure after the deletion operation from the data in the data manager 130, the node characteristic information of the node to be deleted in the data manager 130 is deleted.
In S1103, the tree relationship structure is updated by the association manager based on the updated data manager. And, in S1104, rendering the updated tree relationship structure by the rendering manager.
The specific implementation of S1103 is the same as the specific implementation of S204, and the specific implementation of S1104 is the same as the specific implementation of S205, which are not repeated herein.
In an exemplary embodiment, the second trigger event may also be dragging the selection box 112 to move the node, and changing the size of the selection box 112 to change the size of the rectangular range of the node, i.e. changing the shape information of the node, etc.
In an exemplary embodiment, the size of the node rectangle range may vary depending on the number or size of the text entered.
In an exemplary embodiment, fig. 12 schematically illustrates an overall workflow provided by an embodiment of the present disclosure. Referring to fig. 12:
the canvas 111 receives a trigger event, i.e., an action (click), and data generated by the trigger event is passed into the engine manager 120. The engine manager 120 retrieves the raw data from the data manager 130, performs a traversal calculation, and if the element is hit, the selection box 112 shows the effect of the selection. When the selection box 112 appears, the original action in the second trigger event is applied to the selection box 112, and the selection box 112 performs action recognition and directly transmits the action to the engine manager 120. In the final action, if the trigger event is a new node, the new data will be updated to the data manager 130. After the data manager 130 adds new data, all the data is transmitted to the association manager 140, the data is associated, a tree relationship is established, and the data in the data manager 130 is updated. The association manager 140 directly transmits the tree relationship structure to the rendering manager 150, performs rendering of the tree relationship structure, and finally presents the rendering result on the canvas 111.
The data flow direction of the whole data flow graph is realized, and basic functions of the data flow graph such as addition, deletion, content modification, child node contraction and the like are realized. The technical scheme is based on event triggering, association processing of node information, determination of reflecting the tree-shaped relation structure between nodes and rendering of the tree-shaped relation structure, a data flow graph with clear data flow direction can be provided, and the data flow graph has high expansibility, so that the data flow graph can be expanded into a collaborative data flow graph, an infinite data flow graph and the like, and the practicability of the data flow graph is effectively improved.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods. For details not disclosed in the embodiments of the apparatus of the present disclosure, refer to the embodiments of the method of the present disclosure.
Fig. 13 is a block diagram of a data flow diagram generation apparatus according to an exemplary embodiment of the present disclosure. Referring to fig. 13, the apparatus for generating the data flow diagram shown in the figure may be implemented as all or part of the terminal through software, hardware or a combination of both, or may be integrated on the server as a separate module.
The apparatus 1300 for generating a data flow diagram in the embodiment of the present disclosure includes: canvas 111, selection box 112, engine manager 120, association manager 140, and rendering manager 150, wherein:
the canvas 111 is configured to receive a first trigger event for a first node, and display a selection box associated with the first node; the aforementioned selection block 112 is configured to listen and identify a second trigger event; the engine manager 120 is configured to create a node according to the second trigger event to obtain a second node, and determine relationship information between the first node and the second node; the association manager 140 is configured to perform association processing on the first node and the second node according to the relationship information to obtain a tree-like relationship structure about the first node and the second node; and a rendering manager 150, configured to render the tree relationship structure to obtain a dataflow graph.
In an exemplary embodiment, fig. 14 schematically shows a block diagram of a data flow diagram generating apparatus according to another exemplary embodiment of the present disclosure. Please refer to fig. 14:
in an exemplary embodiment, the canvas 111 is specifically configured to: acquiring, by the engine manager, position information of the first node and shape information of the first node, and determining a target area associated with the first node according to the position information of the first node and the shape information; if the first trigger event is determined to act on the target area, displaying a selection frame associated with the first node; and if the first trigger event is determined not to act on the target area, not displaying the selection frame.
In an exemplary embodiment, the engine manager 120 is specifically configured to: and determining the identifier of the first node as the parent node identifier of the second node, and determining the relationship information of the first node and the second node.
In an exemplary embodiment, the system 1300 for generating the data flow graph further includes: a data manager 130.
The data manager 130 stores node characteristic information of the first node, where the node characteristic information includes: and the position information, the shape information and the father node identification are maintained in a form of one-dimensional array after the node characteristic information of the second node is added to the node characteristic information of the first node through the data manager.
In an exemplary embodiment, the association manager 140 is specifically configured to: determining nodes with brother relationships and determining nodes with parent-child relationships according to the relationship information; calculating the longitudinal distance between the nodes with the brother relation and the transverse distance between the nodes with the father-son relation, and updating the position information of the first node and the position information of the second node according to the longitudinal distance and the transverse distance; and determining a tree relationship structure about the first node and the second node according to the updated node characteristic information.
In an exemplary embodiment, the system 1300 for generating the data flow graph further includes: data replacement module 1401.
The upper data replacing module 1401 is configured to: replacing the location information of the first node in the data manager with the updated node characteristic information of the first node; and replacing the location information of the second node in the data manager with the updated node characteristic information of the second node.
In an exemplary embodiment, the system 1300 for generating the data flow graph further includes: a node management module 1402.
The upper node management module 1402 is configured to: after the tree-like relation structure is rendered through the rendering manager, determining nodes to be deleted according to the second trigger event through the engine manager; deleting the node characteristic information of the node to be deleted in the data manager so as to update the data manager; updating the tree relation structure based on the updated data manager through the association manager; and rendering the updated tree relationship structure by the rendering manager.
It should be noted that, when the data synchronization apparatus provided in the foregoing embodiment executes the method for generating the data flow graph, the division of each functional module is merely used as an example, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for generating a dataflow graph provided in the foregoing embodiment and the method for generating a dataflow graph belong to the same concept, and for details that are not disclosed in the embodiment of the apparatus for generating a dataflow graph of the present disclosure, please refer to the embodiment of the method for generating a dataflow graph of the present disclosure, and details are not described here again.
The above-mentioned serial numbers of the embodiments of the present disclosure are merely for description and do not represent the merits of the embodiments.
The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method of any of the preceding embodiments. The computer-readable storage medium may include, but is not limited to, any type of disk including floppy disks, optical disks, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
The embodiment of the present disclosure further provides a terminal, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the program, the steps of any of the above-mentioned embodiments of the method are implemented.
Fig. 15 schematically shows a block diagram of a terminal in an exemplary embodiment according to the present disclosure. Referring to fig. 15, a terminal 1500 includes: a processor 1501 and a memory 1502.
In the embodiment of the present disclosure, the processor 1501 is a control center of a computer system, and may be a processor of an entity machine or a processor of a virtual machine. Processor 1501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like. The processor 1501 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). Processor 1501 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also referred to as a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state.
In this disclosed embodiment, the processor 1501 is specifically configured to:
a method for generating a data flow chart is provided, which comprises the following steps: receiving a first trigger event for a first node through a canvas, and displaying a selection box associated with the first node; monitoring and identifying a second trigger event through the selection frame; creating a node according to the second trigger event through an engine manager to obtain a second node, and determining the relationship information of the first node and the second node; the association manager is used for performing association processing on the first node and the second node according to the relationship information to obtain a tree-shaped relationship structure of the first node and the second node; and rendering the tree-shaped relation structure through a rendering manager to obtain a data flow graph.
Further, in an embodiment of the present disclosure, the displaying a selection box associated with the first node includes: acquiring, by the engine manager, position information of the first node and shape information of the first node, and determining a target area associated with the first node according to the position information of the first node and the shape information; if the first trigger event is determined to act on the target area, displaying a selection frame associated with the first node; and if the first trigger event is determined not to act on the target area, not displaying the selection frame.
Optionally, the determining the relationship information between the first node and the second node includes: and determining the identifier of the first node as the parent node identifier of the second node, and determining the relationship information of the first node and the second node.
Optionally, the data manager stores node characteristic information of the first node, where the node characteristic information includes: position information, shape information and a father node identifier; the method further comprises the following steps: and adding the node characteristic information of the second node to the node characteristic information of the first node through the data manager, and then maintaining the node characteristic information in a one-dimensional array form.
Optionally, performing association processing on the first node and the second node according to the relationship information to obtain a tree relationship structure about the first node and the second node, including: determining nodes with brother relationships and determining nodes with parent-child relationships according to the relationship information; calculating a vertical distance between nodes having the brother relationship and a horizontal distance between nodes having the father-child relationship, and updating the position information of the first node and the position information of the second node according to the vertical distance and the horizontal distance; and determining a tree structure of the first node and the second node according to the updated node characteristic information.
Optionally, the method further includes: replacing the location information of the first node in the data manager with the updated node characteristic information of the first node; and replacing the location information of the second node in the data manager with the updated node characteristic information of the second node.
Optionally, after the rendering the tree relationship structure by the rendering manager, the method further includes: determining a node to be deleted according to the second trigger event through the engine manager; deleting the node characteristic information of the node to be deleted in the data manager so as to update the data manager; updating the tree relation structure based on the updated data manager through the association manager; and rendering the updated tree relationship structure through the rendering manager.
The memory 1502 may include one or more computer-readable storage media, which may be non-transitory. The memory 1502 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments of the present disclosure, a non-transitory computer readable storage medium in the memory 1502 is used to store at least one instruction for execution by the processor 1501 to implement a method in embodiments of the present disclosure.
In some embodiments, the terminal 1500 further comprises: a peripheral device interface 1503 and at least one peripheral device. The processor 1501, memory 1502, and peripheral interface 1503 may be connected by buses or signal lines. Various peripheral devices may be connected to peripheral interface 1503 via buses, signal lines, or circuit boards. Specifically, the peripheral device includes: at least one of a display 1504, a camera 1505, and an audio circuit 1506.
The peripheral interface 1503 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 1501 and the memory 1502. In some embodiments of the present disclosure, the processor 1501, memory 1502 and peripheral interface 1503 are integrated on the same chip or circuit board; in some other embodiments of the present disclosure, any one or both of the processor 1501, the memory 1502, and the peripheral interface 1503 may be implemented on separate chips or circuit boards. The embodiments of the present disclosure are not particularly limited in this regard.
The display 1504 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 1504 is a touch display screen, the display screen 1504 also has the ability to capture touch signals on or above the surface of the display screen 1504. The touch signal may be input to the processor 1501 as a control signal for processing. At this point, the display 1504 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments of the present disclosure, the display 1504 may be one, providing the front panel of the terminal 1500; in other embodiments of the present disclosure, the display 1504 may be at least two, respectively disposed on different surfaces of the terminal 1500 or in a folded design; in still other embodiments of the present disclosure, the display 1504 may be a flexible display disposed on a curved surface or a folded surface of the terminal 1500. Even further, the display 1504 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The Display 1504 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera 1505 is used to capture images or video. Optionally, the cameras 1505 include front and rear cameras. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, the main camera and the wide-angle camera are fused to realize panoramic shooting and a VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments of the present disclosure, the camera 1505 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp and can be used for light compensation under different color temperatures.
The audio circuitry 1506 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 1501 for processing. For stereo capture or noise reduction purposes, multiple microphones may be provided, each at a different location of the terminal 1500. The microphone may also be an array microphone or an omni-directional pick-up microphone.
Power supply 1507 is used to power the various components in terminal 1500. The power supply 1507 may be alternating current, direct current, disposable batteries, or rechargeable batteries. When the power supply 1507 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
The block diagram of the terminal structure shown in the embodiments of the present disclosure does not constitute a limitation on the terminal 1500, and the terminal 1500 may include more or less components than those shown, or combine some components, or adopt a different arrangement of components.
In the present disclosure, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or order; the term "plurality" means two or more unless expressly limited otherwise. The terms "mounted," "connected," "fixed," and the like are to be construed broadly, and for example, "connected" may be a fixed connection, a removable connection, or an integral connection; "coupled" may be direct or indirect through an intermediary. The specific meaning of the above terms in the present disclosure can be understood by those of ordinary skill in the art as appropriate.
In the description of the present disclosure, it is to be understood that the terms "upper", "lower", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience in describing the present disclosure and simplifying the description, but do not indicate or imply that the referred device or unit must have a specific direction, be configured and operated in a specific orientation, and thus, should not be construed as limiting the present disclosure.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present disclosure, and all the changes or substitutions should be covered within the scope of the present disclosure. Accordingly, equivalents may be resorted to as falling within the scope of the disclosure as claimed.

Claims (10)

1. A method for generating a data flow graph is characterized by comprising the following steps:
receiving a first trigger event for a first node through a canvas, and displaying a selection box associated with the first node;
monitoring and identifying a second trigger event through the selection box;
creating a node according to the second trigger event through an engine manager to obtain a second node, and determining the relationship information of the first node and the second node;
performing association processing on the first node and the second node according to the relationship information through an association manager to obtain a tree-shaped relationship structure of the first node and the second node;
and rendering the tree relation structure through a rendering manager to obtain a data flow graph.
2. The method for generating a data flow graph according to claim 1, wherein the displaying a selection box associated with the first node comprises:
acquiring the position information of the first node and the shape information of the first node through the engine manager, and determining a target area associated with the first node according to the position information and the shape information of the first node;
if the first trigger event is determined to act on the target area, displaying a selection box associated with the first node;
and if the first trigger event is determined not to act on the target area, not displaying the selection box.
3. The method for generating a data flow graph according to claim 1, wherein the determining the relationship information between the first node and the second node comprises:
and determining the identifier of the first node as the parent node identifier of the second node, and determining the relationship information of the first node and the second node.
4. The method for generating a data flow graph according to claim 3, wherein a data manager stores node characteristic information of the first node, wherein the node characteristic information includes: position information, shape information, and parent node identification; the method further comprises the following steps:
and after the node characteristic information of the second node is added to the node characteristic information of the first node through the data manager, maintaining the node characteristic information in a one-dimensional array form.
5. The method for generating the data flow graph according to any one of claims 1 to 4, wherein performing association processing on the first node and the second node according to relationship information to obtain a tree relationship structure about the first node and the second node includes:
determining nodes with brother relationships and determining nodes with parent-child relationships according to the relationship information;
calculating the longitudinal distance between the nodes with the brother relation and the transverse distance between the nodes with the father-son relation, and updating the characteristic information of the first node and the characteristic information of the second node according to the longitudinal distance and the transverse distance;
and determining a tree-like relation structure of the first node and the second node according to the updated node characteristic information.
6. The method for generating a data flow graph according to claim 5, wherein the method further comprises:
replacing the feature information of the first node in the data manager with the updated node feature information of the first node;
replacing the characteristic information of the second node in the data manager with the updated node characteristic information of the second node.
7. The method for generating a data flow graph according to any one of claims 1 to 4, wherein after the rendering of the tree relationship structure by the rendering manager, the method further comprises:
determining, by the engine manager, a node to be deleted according to the second trigger event;
deleting the node characteristic information of the node to be deleted in the data manager so as to update the data manager;
updating, by the association manager, a tree relationship structure based on the updated data manager;
and rendering the updated tree relation structure through the rendering manager.
8. A system for generating a data flow graph, comprising:
the canvas is used for receiving a first trigger event for a first node and displaying a selection box associated with the first node;
the selection frame is used for monitoring and identifying a second trigger event;
the engine manager is used for creating a node according to the second trigger event to obtain a second node and determining the relationship information of the first node and the second node;
the association manager is used for performing association processing on the first node and the second node according to the relationship information to obtain a tree-shaped relationship structure of the first node and the second node;
and the rendering manager is used for rendering the tree-shaped relation structure to obtain a data flow graph.
9. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method of generating a dataflow graph according to one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of generating a data flow graph according to any one of claims 1 to 7.
CN202110979518.4A 2021-08-24 2021-08-24 Data flow graph generation method and device, storage medium and terminal Pending CN115905549A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110979518.4A CN115905549A (en) 2021-08-24 2021-08-24 Data flow graph generation method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110979518.4A CN115905549A (en) 2021-08-24 2021-08-24 Data flow graph generation method and device, storage medium and terminal

Publications (1)

Publication Number Publication Date
CN115905549A true CN115905549A (en) 2023-04-04

Family

ID=86486043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110979518.4A Pending CN115905549A (en) 2021-08-24 2021-08-24 Data flow graph generation method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN115905549A (en)

Similar Documents

Publication Publication Date Title
US11960512B2 (en) Identifying and graphically representing multiple parent nodes of a child node
CN108520552A (en) Image processing method, device, storage medium and electronic equipment
US9311756B2 (en) Image group processing and visualization
CN111931097B (en) Information display method and device, electronic equipment and storage medium
WO2017124795A1 (en) Contact group processing method, apparatus, and mobile terminal
US20230409612A1 (en) Graphically Representing Related Record Families Using a Phantom Parent Node
TW202009682A (en) Interactive method and device based on augmented reality
US11423650B2 (en) Visual positioning method and apparatus, and computer-readable storage medium
CN111695516B (en) Thermodynamic diagram generation method, device and equipment
CN115905549A (en) Data flow graph generation method and device, storage medium and terminal
CN112017304A (en) Method, apparatus, electronic device, and medium for presenting augmented reality data
CN113018865B (en) Climbing line generation method and device, computer equipment and storage medium
JP2005196298A (en) Information processor, image data display control method, program and recording medium
CN114522420A (en) Game data processing method and device, computer equipment and storage medium
US20200250261A1 (en) Information processing apparatus, information processing system, and non-transitory computer readable medium
CN112348955A (en) Object rendering method
CN111870954B (en) Altitude map generation method, device, equipment and storage medium
CN115049804B (en) Editing method, device, equipment and medium for virtual scene
CN116860222B (en) Algorithm flow editing method and related device
CN117807081A (en) Service realization method and device based on dynamic data set and electronic equipment
CN110070600B (en) Three-dimensional model generation method, device and hardware device
US10802675B2 (en) Information processing apparatus and non-transitory computer readable medium storing information processing program
CN115391278A (en) Resource processing method and device, electronic equipment and storage medium
CN116909787A (en) Fault injection method, device, storage medium and terminal
CN118055022A (en) Real-time stream analysis rule construction method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination