CN116860222B - Algorithm flow editing method and related device - Google Patents

Algorithm flow editing method and related device Download PDF

Info

Publication number
CN116860222B
CN116860222B CN202311055250.0A CN202311055250A CN116860222B CN 116860222 B CN116860222 B CN 116860222B CN 202311055250 A CN202311055250 A CN 202311055250A CN 116860222 B CN116860222 B CN 116860222B
Authority
CN
China
Prior art keywords
added
connection point
node
algorithm
flow
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.)
Active
Application number
CN202311055250.0A
Other languages
Chinese (zh)
Other versions
CN116860222A (en
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.)
Beijing Simou Intelligent Technology Co ltd
Shenzhen Smartmore Technology Co Ltd
Original Assignee
Beijing Simou Intelligent Technology Co ltd
Shenzhen Smartmore 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 Beijing Simou Intelligent Technology Co ltd, Shenzhen Smartmore Technology Co Ltd filed Critical Beijing Simou Intelligent Technology Co ltd
Priority to CN202311055250.0A priority Critical patent/CN116860222B/en
Publication of CN116860222A publication Critical patent/CN116860222A/en
Application granted granted Critical
Publication of CN116860222B publication Critical patent/CN116860222B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses an algorithm flow editing method and a related device, wherein the method comprises the following steps: detecting the position of a node to be added in response to a drag operation for the node to be added, wherein the node to be added at least comprises an input connection point to be added; when a node to be added is dragged to a flow editing area, responding to the position change of the node to be added in the flow editing area, acquiring the real-time position relation between an input connection point to be added and output connection points of all flow nodes in the flow editing area, wherein the connection relation exists among all flow nodes in the flow editing area; determining a target output connection point of which the real-time position relationship accords with the association condition; the target output connection point has a first connection relation with at least an input connection point of one flow node in the flow editing area; and while keeping the first connection relation, adding a second connection relation between the target output connection point and the input connection point to be added, and outputting an algorithm corresponding to the target output connection point as an algorithm input of the algorithm to be added.

Description

Algorithm flow editing method and related device
Technical Field
The present application relates to the field of data processing technologies, and in particular, to an algorithm flow editing method and a related device.
Background
In the field of industrial production, more and more inspection devices edit inspection algorithm flow by using drag-and-drop visual inspection software. By dragging the nodes in the dragging type visual detection software, the algorithm flow is edited, the use threshold of operators can be reduced, the working efficiency is improved, and great convenience is brought to algorithm flow editing.
In the related art, the drag type visual detection software tends to drag the nodes to the flow chart to automatically carry out input connection and output connection in a collision connection mode, however, the existing connection relation of each node in the flow chart is damaged by editing the algorithm flow in the collision connection mode, and the editing efficiency of the algorithm flow is low.
Disclosure of Invention
Accordingly, in order to solve the above-mentioned problems, it is necessary to provide an algorithm flow editing method and related device, which can improve the algorithm flow editing efficiency.
In a first aspect, the present application provides an algorithm flow editing method, including:
responding to a drag operation for a node to be added, and detecting the position of the node to be added; the node to be added corresponds to an algorithm to be added, and at least comprises an input connection point to be added;
When the node to be added is dragged to a flow editing area, responding to the position change of the node to be added in the flow editing area, and acquiring the real-time position relationship between the input connection point to be added and the output connection point of each flow node in the flow editing area; wherein, there is a connection relation among each flow node in the flow editing area, and there is a node connection algorithm generated according to the connection relation;
determining a target output connection point of which the real-time position relation accords with an association condition; wherein, the target output connection point has a first connection relation with at least an input connection point of a process node in the process editing area;
and on the basis of reserving the first connection relation, adding a second connection relation between the target output connection point and the input connection point to be added, and outputting an algorithm corresponding to the target output connection point as algorithm input of the algorithm to be added.
In a second aspect, the present application provides an algorithm flow editing apparatus, including:
the detection module is used for: responding to a drag operation for a node to be added, and detecting the position of the node to be added; the node to be added corresponds to an algorithm to be added, and at least comprises an input connection point to be added;
An acquisition module for: when the node to be added is dragged to a flow editing area, responding to the position change of the node to be added in the flow editing area, and acquiring the real-time position relationship between the input connection point to be added and the output connection point of each flow node in the flow editing area; wherein, there is a connection relation among each flow node in the flow editing area, and there is a node connection algorithm generated according to the connection relation;
a determining module for: determining a target output connection point of which the real-time position relation accords with an association condition; wherein, the target output connection point has a first connection relation with at least an input connection point of a process node in the process editing area;
a connection module for: and on the basis of reserving the first connection relation, adding a second connection relation between the target output connection point and the input connection point to be added, and outputting an algorithm corresponding to the target output connection point as algorithm input of the algorithm to be added.
In a third aspect, the present application provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps in the algorithm flow editing method described above when executing the computer program.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the algorithm flow editing method described above.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the algorithm flow editing method described above.
According to the algorithm flow editing method, the device, the computer equipment, the computer readable storage medium and the computer program product, the position of the node to be added is detected in response to the drag operation of the node to be added at least comprising the input connection point to be added, the node to be added is processed by using the drag operation, the algorithm flow is edited by using the algorithm to be added corresponding to the node to be added, the interactivity of the algorithm flow editing is improved, and the algorithm flow editing operation is simplified; when a node to be added is dragged to a flow editing area comprising flow nodes, a connection relation exists between the flow nodes in the flow editing area, a corresponding node connection algorithm is generated based on the connection relation, an original algorithm flow in the flow editing area can be directly executed through the node connection algorithm, a real-time position relation between an input connection point to be added and output connection points of all the flow nodes in the flow editing area is obtained according to the position change of the node to be added in the flow editing area, a target output connection point which accords with the association condition with the input connection point to be added can be determined according to the real-time position relation, algorithm input corresponding to the target output connection point is used as algorithm input of the input connection point to be added, algorithm input corresponding to the node to be added is focused in the algorithm flow editing process, and the industrial scene requirement is effectively met, wherein the target output connection point has a first connection relation with at least one input connection point of the flow nodes in the flow editing area; on the basis of keeping the first connection relation, a second connection relation between the target output connection point and an input connection point to be added in the nodes to be added is increased, so that when the nodes to be added are newly added into the flow editing area through drag operation, the connection relation between the original flow nodes in the flow editing area is not damaged, the connection relation in the flow editing area is not required to be restored, a new algorithm flow can be generated directly according to the original connection relation and the second connection relation, and the editing efficiency of the algorithm flow is improved.
Drawings
FIG. 1 is an application environment diagram of an algorithm flow editing method provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart of an algorithm flow editing method according to an embodiment of the present application;
FIG. 3 is a schematic flow diagram of an algorithm flow editing method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a drag process effect provided by an embodiment of the present application;
FIG. 5 is a block diagram of an algorithm flow editing device according to an embodiment of the present application;
FIG. 6 is a diagram illustrating an internal architecture of a computer device according to an embodiment of the present application;
FIG. 7 is an internal block diagram of another computer device according to an embodiment of the present application;
fig. 8 is an internal structural diagram of a computer-readable storage medium according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
When the drag-type visual inspection software is used to edit the inspection algorithm flow, the drag-type visual inspection software is used to edit the algorithm flow by dragging nodes, however, in the drag-type visual inspection software, the nodes are often required to be dragged to the flow chart to automatically carry out input-output connection in a collision connection mode, for example, when the node C is dragged to between the node A and the node B, the connection between the node A and the node B is disconnected, the input connection point of the node C is connected with the output connection point of the node A, the output connection point of the node C is connected with the input connection point of the node B, and the existing connection relation between the original node A and the node B is broken.
For algorithm flow editing in the industrial production field, automatic connection of an input connection point of a new node is usually more focused, automatic connection of an output connection point is not focused, meanwhile, automatic connection of the input connection point of the new node and the output connection point do not meet the requirement of algorithm flow editing, taking the node C as an example, after the output connection point of the node C is directly connected with the input connection point of the node B, if the connection mode is not consistent with the algorithm flow expected by a user, the step of deleting the connection relation between the node C and the node B is added in the subsequent algorithm flow editing process, and the algorithm flow editing efficiency is reduced.
Therefore, how to improve the editing efficiency of the algorithm flow is a technical problem to be solved.
Based on the above, the embodiment of the application provides an algorithm flow editing method, by responding to a drag operation for a node to be added including at least an input connection point to be added, matching a target output connection point with a first connection relation with other input connection points for the input connection point to be added, and adding a second connection relation between the target output connection point and the input connection point to be added in the node to be added on the basis of keeping the first connection relation, so that when the node to be added is newly added into a flow editing area through the drag operation, the connection relation between original flow nodes in the flow editing area is not damaged, the connection relation in the flow editing area is not required to be restored, a new algorithm flow can be generated directly according to the original connection relation and the second connection relation, and the editing efficiency of the algorithm flow is improved.
The algorithm flow editing method provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a communication network. The data storage system may store data to be processed by the server 104, for example, a position of a node to be added, a real-time position relationship between an input connection point to be added and an output connection point of each flow node in the flow editing area, and so on in the embodiment of the present application. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
As shown in fig. 2, an embodiment of the present application provides an algorithm flow editing method, which may be applied to a computer device, where the computer device may include at least one of a terminal and a server, and an example in which the method is applied to the terminal 102 in fig. 1 is described below. The method comprises the following steps:
S201, responding to a drag operation for the node to be added, and detecting the position of the node to be added.
In the embodiment of the application, the user can control the position change of the node to be added through the drag operation, and the node to be added is controlled based on the drag operation to edit the algorithm flow. When the node to be added is selected, the drag operation for the node to be added can be triggered, and as the drag operation for the node to be added is triggered, the node to be added also moves in a drag mode along with the drag operation in response to the position change caused by the drag operation, so that the interactivity in the algorithm flow editing process is improved.
In the embodiment of the present application, the drag operation may be triggered by adopting a plurality of triggering modes according to actual needs, for example, in the terminal device, the drag operation on the node to be added is triggered by long-pressing the node to be added selected or clicking the node to be added selected, which is not particularly limited in the embodiment of the present application.
The node to be added is an operation object of the drag operation. In the embodiment of the application, the node to be added corresponds to an algorithm to be added, and the node to be added at least comprises an input connection point to be added, wherein the input connection point to be added is used for connecting output connection points of other nodes, the input connection point to be added corresponds to algorithm input of the algorithm to be added, and when the input connection points of other nodes are connected, algorithm output corresponding to the output connection point is used as algorithm input of the algorithm to be added. In addition, the node to be added may further include an output connection point to be added, and when the output connection point to be added is connected to an input connection point of another flow node, an algorithm output in the algorithm to be added may be transmitted to the flow node.
S202, when a node to be added is dragged to a flow editing area, responding to the position change of the node to be added in the flow editing area, and acquiring the real-time position relation between an input connection point to be added and output connection points of all flow nodes in the flow editing area.
In the embodiment of the application, a flow editing area is set, and the flow editing area is an area for editing the algorithm flow according to the position relation among the flow nodes. The flow editing area is provided with a plurality of flow nodes, connection relations exist among the flow nodes, and a node connection algorithm generated according to the connection relations exists. When the process node is a node to be added, which is already present in the process editing area, the position of the process node in the process editing area is relatively fixed from the point of view of position change, and the position of the process node in the process editing area is relatively changed by the node to be added controlled by the current drag operation. Each flow node also has a corresponding flow node algorithm, and according to the connection relation between the flow nodes, the connection relation between the algorithm input and the algorithm output corresponding to the flow node algorithm can be determined, so that each flow node algorithm is combined to generate an algorithm flow, and meanwhile, the node flow algorithm for executing the algorithm flow is generated.
By detecting the position of the node to be added, whether the current node to be added is in the flow editing area or not can be determined; when the node to be added is dragged to the flow editing area, the position of the input connection point to be added in the flow editing area can be obtained according to the position of the node to be added in the flow editing area, and further the real-time position relation between the input connection point to be added and the output connection point of each flow node in the flow editing area is obtained. In the embodiment of the application, when the position of the node to be added is controlled based on the drag operation, the position of the input connection point to be added in the process editing area also changes along with the drag operation, so that in order to improve the accuracy of the acquired position relationship, the position relationship between the input connection point to be added and other output connection points needs to be determined in real time according to the position change of the input connection point to be added in the process editing area, and the real-time position relationship is determined based on the position of the current input connection point to be added in the process editing area.
S203, determining a target output connection point of which the real-time position relation accords with the association condition.
The association condition is a screening condition for determining a target output connection point from among output connection points of a plurality of flow nodes in the flow edit section. When the node to be added is placed between two process nodes in the process editing area through the drag operation, determining the process nodes meeting the association conditions to associate according to the position relationship between the node to be added and the two process nodes, namely determining the output connection point of the process nodes meeting the association conditions as a target output connection point corresponding to the input connection point to be added.
The method comprises the steps that a target output connection point is at least connected with an input connection point of a process node in a process editing area, algorithm output corresponding to the target output connection point is connected with algorithm input corresponding to the input connection point of the process node based on the first connection relation, and algorithm output corresponding to the target output connection point is used as algorithm input corresponding to the input connection point of the process node. For example, in a scenario where there are node a and node B in the flow editing area and the output connection point of node a is connected to the input connection point of node B, if the node C to be added is dragged to the flow editing area, when the target output connection point determined for the node C is the output connection point of node a, then the connection relationship between node a and node B in the flow editing area is the first connection relationship.
It should be noted that the first connection relationship may correspond to a connection relationship between the target output connection point and one input connection point, or may correspond to a connection relationship between the target output connection point and a plurality of input connection points, which is not particularly limited in the present application. When a first connection relationship exists between the target output connection point and a plurality of flow nodes in the flow editing area, algorithm output corresponding to the target output connection point corresponds to algorithm input of the plurality of flow nodes.
The association condition can be set according to actual needs, specifically, in the flow chart from top to bottom, the father node is located above the child node, and then the association condition can be an output connection point located above the input connection point to be added and closest to the input connection point to be added; likewise, in the left-to-right flowchart, the parent node is located at the left side of the child node, and then the association condition may be an output connection point located at the left side of the input connection point to be added and closest to the input connection point to be added.
Of course, the foregoing association conditions may be determined in other manners, which are not particularly limited in the embodiment of the present application.
S204, on the basis of keeping the first connection relation, adding a second connection relation between the target output connection point and the input connection point to be added, and outputting an algorithm corresponding to the target output connection point as algorithm input of the algorithm to be added.
In the embodiment of the application, after the target output connection point corresponding to the input connection point to be added is determined, in order not to destroy the existing connection relation between each process node in the process editing area, when the second connection relation between the target output connection point and the input connection point to be added is increased, the first connection relation between the target output connection point and other input connection points is reserved, so that for the algorithm flow in the process editing area, the corresponding node to be added is used as a new node, the algorithm flow is edited in an increasing rather than inserting mode, the corresponding relation between each algorithm input and algorithm output in the original algorithm flow is reserved, the algorithm output in the existing algorithm flow is used as the algorithm input of the algorithm to be added, the algorithm output of the algorithm to be added is not connected with the algorithm input in the existing algorithm flow, the requirement of focusing on automatic input connection in the industrial production field is met, meanwhile, the input and output connection of the corresponding algorithm is directly carried out based on the target output connection point corresponding to the input connection point to be added in the process editing area, the algorithm editing step is simplified, and the algorithm flow editing requirement of the industrial production field can be met.
Specifically, in some embodiments, when a second connection relationship between the target output connection point and the input connection point to be added is added on the basis of retaining the first connection relationship, according to the algorithm to be added and the second connection relationship, the algorithm output corresponding to the target output connection point is used as the algorithm input of the algorithm to be added, and the algorithm to be added is used for updating the node connection algorithm.
According to the second connection relation, the target output connection point is connected with the input connection point to be added, and the algorithm output corresponding to the target output connection point is used as the algorithm input of the algorithm to be added because the input connection point to be added corresponds to the algorithm input of the algorithm to be added, and the flow node corresponding to the target output connection point becomes the father node of the node to be added. Based on the input-output relation among the algorithms, in the original node connection algorithm in the flow editing area, an algorithm to be added is newly added, and the algorithm output corresponding to the target output connection point is set as the algorithm input of the algorithm to be added, so that the algorithm flow and the node connection algorithm in the flow editing area are updated.
Therefore, the input-output relation between the algorithm to be added and the flow node algorithm is directly determined according to the second connection relation, and the node connection algorithm is updated by using the algorithm to be added, so that the update of the algorithm flow in the flow editing area is realized, the algorithm flow editing step is simplified, the editing process of a specific algorithm is saved, and the editing efficiency of the algorithm flow is improved.
In some embodiments, if the node to be added is dragged outside the process editing area, deleting the second connection relation in response to the node to be added being released outside the process editing area, and deleting the algorithm to be added from the node connection algorithms according to the algorithm to be added and the second connection relation.
The drag operation performed on the node to be added may be triggered by selecting the node to be added, and then, when the node to be added is released, the drag operation is terminated, based on the release operation on the node to be added, a positional relationship between the node to be added and other flow nodes is determined, for example, when a left mouse button is pressed, the node to be added is selected, the drag on the node to be added may be implemented based on a mouse, and when the left mouse button is lifted, the node to be added is released. Of course, the selection and release of the node to be added may be implemented in other manners, for example, double click, long press, etc., which is not limited in detail in the embodiment of the present application.
When the node to be added is released in the flow editing area, a target output connection point can be determined according to the real-time position relation between the input connection point to be added and output connection points in other flow nodes, and a node connection algorithm is updated according to the connection relation between the target output connection point and the input connection point to be added; when the node to be added is dragged to the outside of the flow editing area to release, the adding content corresponding to the node to be added is withdrawn, a second connection relation between the input connection point to be added and the target output connection point is deleted from the flow editing area, the algorithm to be added corresponding to the node to be added is deleted in the node connection algorithm, and the algorithm flow and the node connection algorithm in the flow editing area are restored to be before the node to be added is added.
When the node to be added is dragged out of the flow editing area, deleting the second connection relation corresponding to the node to be added, and deleting the algorithm to be added corresponding to the node to be added from the node connection algorithms.
Therefore, in the embodiment of the application, the node to be added is processed by using the drag operation, and the algorithm flow is edited by using the algorithm to be added corresponding to the node to be added, so that the interactivity of the algorithm flow editing is improved, and the algorithm flow editing operation is simplified; when a node to be added is dragged to a flow editing area comprising flow nodes, a connection relation exists between the flow nodes in the flow editing area, a corresponding node connection algorithm is generated based on the connection relation, an original algorithm flow in the flow editing area can be directly executed through the node connection algorithm, a real-time position relation between an input connection point to be added and output connection points of all the flow nodes in the flow editing area is obtained according to the position change of the node to be added in the flow editing area, a target output connection point which accords with the association condition with the input connection point to be added can be determined according to the real-time position relation, algorithm input corresponding to the target output connection point is used as algorithm input of the input connection point to be added, algorithm input corresponding to the node to be added is focused in the algorithm flow editing process, and the industrial scene requirement is effectively met, wherein the target output connection point has a first connection relation with at least one input connection point of the flow nodes in the flow editing area; on the basis of keeping the first connection relation, a second connection relation between the target output connection point and an input connection point to be added in the nodes to be added is increased, so that when the nodes to be added are newly added into the flow editing area through drag operation, the connection relation between the original flow nodes in the flow editing area is not damaged, the connection relation in the flow editing area is not required to be restored, a new algorithm flow can be generated directly according to the original connection relation and the second connection relation, and the editing efficiency of the algorithm flow is improved.
In some embodiments, when no target output connection point meeting the association condition exists in the flow editing area, a connection relation is not established for the input connection point to be added, but when the input connection point to be added is selected, a corresponding target output connection point is determined for the input connection point to be added in response to the input connection point to be added being selected; then, when the target output connection point is selected, in response to the target output connection point being selected, a connection relationship between the input connection point to be added and the target output connection point is established, and the target output connection point is manually configured for the input connection point to be added.
If the target output connection point meeting the association condition does not exist in the flow editing area, the connection relation can not be established directly for the input connection point to be added after the drag operation is finished. When the drag operation is finished and the input connection point to be added is placed in the flow editing area, a target output connection point can be set for the input connection point to be added by responding to the selected operation for the input connection point to be added, and in the state that the input connection point to be added is selected, the connection relation between the input connection point to be added and the target output connection point is established by responding to the selected operation for the target output connection point.
It should be noted that, the selecting operation for the input connection point to be added may be implemented in various manners, and similarly, the selecting operation for the target output connection point may be implemented in various manners, and the selecting operations for the input connection point to be added and the selecting operation for the target output connection point may be the same or different. For example, in the terminal device, the input connection point to be added and the target output connection point can be selected through a clicking mode, the input connection point to be added can be selected through a dragging mode when the left mouse button is pressed, and the output connection point corresponding to the current release position is selected as the target output connection point when the left mouse button is released through dragging the mouse. Of course, the above is merely an example, and the embodiment of the present application does not specifically limit the selection operation for the input connection point to be added and the selection operation for the target output connection point.
Therefore, when the target output connection point meeting the association condition does not exist in the flow editing area, the flexibility of algorithm flow editing can be improved by establishing a connection relation with the target output connection point for the input connection point to be added by responding to the selection of the input connection point to be added and the target output connection point.
In some embodiments, when the node to be added is dragged, the node to be added may be drawn using the first shape according to the detected position of the current node to be added, and the display position of the node to be added may be modified as the position of the node to be added changes. For example, a user performs a drag operation through a mouse, manipulates the mouse to drag the node to be added, determines the position corresponding to the mouse cursor as the position of the current node to be added, and draws the node to be added by taking the position of the current node to be added as the center; when the position of the mouse cursor changes, the display position of the currently dragged node to be added also changes so as to reflect the following effect of the node to be added and the dragging operation.
It should be noted that, the drawing of the node to be added with the position of the node to be added as the center is merely an example, and in an actual scene, the node to be added may also be drawn according to the position of the node to be added, with the position as the upper left corner, the upper right corner, and the like of the icon.
In an actual scene, parameters such as a size, a line, a color and the like corresponding to the first shape may be set according to actual needs, which are not particularly limited in the embodiment of the present application.
By displaying the positions of the nodes to be added, the interaction effect of the drag operation and the positions of the nodes to be added is visualized, so that the process of editing the algorithm flow is more visual.
In some embodiments, when determining the target output connection point according to the real-time position relationship, whether the output connection point of each flow node in the flow editing area meets the association condition may be determined according to the real-time position relationship, if yes, the output connection point is determined to be the target output connection point, and the first line segment is used to connect the target output connection point and the input connection point to be added.
In the process of determining the corresponding target output connection point, the drag operation controls the position change of the node to be added, then the real-time position relation is changed, and the target output connection point determined according to the real-time position relation is also possibly changed, so that when the node to be added is dragged in the process editing area, the target output connection point corresponding to the current position can be determined in real time according to the current position of the node to be added, and the input connection point to be added and the target output connection point are connected through a first line segment; when the current position changes, if the target output connection point does not meet the association condition, the connection between the target output connection point and the target output connection point is disconnected, the target output connection point meeting the association condition is determined again for the input connection point to be added in the process editing area, and the input connection point to be added is connected with the latest target output connection point.
According to the method, the target output connection point which accords with the association condition with the input connection point to be added is determined in real time according to the real-time position change of the node to be added in the flow editing area, the connection relation between the input connection point to be added and the target output connection point is visually output, and the connection relation is fed back in real time, so that the algorithm flow editing process is more visual.
In some embodiments, after a second connection relationship between the target output connection point and the input connection point to be added is established, the drag operation for the node to be added is terminated, the node to be added is placed in the flow editing area, at this time, the first shape is deleted, the node to be added is drawn using the second shape, and the second connection relationship is drawn using the second line segment.
When the position of the node to be added in the flow editing area is determined, the drag operation is terminated, the node to be added is released, and because the node to be added is drawn by using a first shape at the position corresponding to the node to be added in the drag process, after the drag operation is finished, the first shape is deleted, and the node to be added is drawn by using a second shape at the same position; and simultaneously, replacing the first line segment with a second line segment, and drawing a second connection relation between the input connection point to be added and the target output connection point.
In the embodiment of the application, the first line segment and the second line segment are respectively used for drawing two states of the node to be added when being dragged and after being released, so that in order to distinguish the two states, the first line segment and the second line segment can be different line segments. For example, the first line segment is a virtual line segment, the second line segment is a real line segment, or the first line segment is a gray line segment, the second line segment is a black line segment, etc., which is not limited in detail in the embodiment of the present application.
In the embodiment of the application, the first shape and the second shape are respectively used for drawing two states of the node to be added when the node is dragged and after the dragging is released, so that in order to distinguish the two states, the first shape and the second shape can be distinguished. For example, a first shape may be drawn using a dotted line, a second shape may be drawn using a solid line, and lines of different color depths may be used to draw the first shape and the second shape to achieve differentiation of the first shape and the second shape.
Wherein two states corresponding to the node to be added: when dragged and after the drag is released, the first shape may also be drawn using the first line segment and the second shape may be drawn using the second line segment.
Specifically, referring to fig. 3 and fig. 4, fig. 3 is a flow diagram of an algorithm flow editing method provided by an embodiment of the present application, and fig. 4 is a schematic drawing of a drag process effect provided by an embodiment of the present application.
After clicking a node to be added by using a left mouse button, the node to be added is selected, the left mouse button is pressed to drag the node to be added to a flow editing area, the position of the node to be added is determined according to the current mouse position in the dragging process of the node to be added, the node to be added is drawn at the position, in a scene shown in fig. 4, a first shape is a rectangular text box drawn by using a dotted line, and in the shapes corresponding to the node to be added and each flow node, node names corresponding to each node are also written.
Further, the region corresponding to each node shape in fig. 4 may be set as a tool box region, where any node shape may be selected as a node to be added and dragged to a flow editing region for performing algorithm flow editing.
In the process of dragging the node to be added, if an output connection point with the position relationship between the input connection points to be added meeting the association condition exists in the process editing area, the output connection point can be determined to be a target output connection point corresponding to the current input connection point to be added, the input connection point to be added is connected with the target output connection point by using a first line segment, in the scene shown in fig. 4, an output connection point which is positioned above the input connection point to be added and is closest to the input connection point to be added is determined to be a target output connection point based on the association condition, the first line segment is a dotted line segment, when the position of the node to be added is controlled to change through the dragging operation, the target output connection point corresponding to the input connection point to be added is possibly changed, and the target output connection point corresponding to the current input connection point to be added is connected through the dotted line segment, so that the real-time connection relationship between the input connection point to be added and the current corresponding target output connection point to be visualized in the process of dragging the node to be added. The node to be added can be connected with an expected parent node by moving the node to be added, and the parent node is a flow node corresponding to the target output connection point.
After the drag operation is finished and the node to be added is released, deleting the node to be added drawn by using the first shape at the release position after the drag operation is finished because the release position corresponding to the node to be added in the flow editing area is the last position corresponding to the node to be added in the drag process, and drawing the node to be added again by using the second shape at the release position so as to embody the state that the node to be added is released; meanwhile, according to the real-time position relation in the process that the node to be added is dragged, a target output connection point corresponding to the releasing position of the node to be added can be determined, a second connection relation between the input connection point to be added and the target output connection point is drawn by using a second line segment, in fig. 4, the second shape is a rectangular text box drawn by using a solid line, and the second line segment is a solid line segment. After the second connection relation is determined, the node connection algorithm in the flow editing area can be updated based on the algorithm to be added corresponding to the node to be added, so that the updating of the algorithm flow in the flow editing area is realized.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides an algorithm flow editing device. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in one or more embodiments of the algorithm flow editing device provided below may refer to the limitation of the algorithm flow editing method hereinabove, and will not be described herein.
As shown in fig. 5, an embodiment of the present application provides an algorithm flow editing apparatus 500, including:
a detection module 501 for: responding to a drag operation for a node to be added, and detecting the position of the node to be added; the node to be added corresponds to an algorithm to be added, and at least comprises an input connection point to be added;
an obtaining module 502, configured to: when the node to be added is dragged to a flow editing area, responding to the position change of the node to be added in the flow editing area, and acquiring the real-time position relationship between the input connection point to be added and the output connection point of each flow node in the flow editing area; wherein, there is a connection relation among each flow node in the flow editing area, and there is a node connection algorithm generated according to the connection relation;
A determining module 503, configured to: determining a target output connection point of which the real-time position relation accords with an association condition; wherein, the target output connection point has a first connection relation with at least an input connection point of a process node in the process editing area;
a connection module 504 for: and on the basis of reserving the first connection relation, adding a second connection relation between the target output connection point and the input connection point to be added, and outputting an algorithm corresponding to the target output connection point as algorithm input of the algorithm to be added.
In some embodiments, the connection module 504 is specifically configured to:
on the basis of reserving the first connection relation, adding a second connection relation between the target output connection point and the input connection point to be added;
and according to the algorithm to be added and the second connection relation, taking the algorithm output corresponding to the target output connection point as the algorithm input of the algorithm to be added, and updating the node connection algorithm by using the algorithm to be added.
In some embodiments, the apparatus further comprises:
a deletion module for: and deleting the second connection relation in response to the node to be added being dragged to the outside of the flow editing area, and deleting the algorithm to be added from the node connection algorithms according to the algorithm to be added and the second connection relation.
In some embodiments, the apparatus further comprises a rendering module for:
drawing the node to be added by using a first shape according to the position of the node to be added;
and modifying the display position of the node to be added in response to the position change of the node to be added.
In some embodiments, the determining module 503 is further configured to:
and judging whether output connection points of all flow nodes in the flow editing area meet the association conditions according to the real-time position relation, if so, determining the output connection points as target output connection points, and connecting the target output connection points with the input connection points to be added by using a first line segment.
In some embodiments, the rendering module is further to:
deleting the first shape, drawing the node to be added by using the second shape, and drawing the second connection relation by using a second line segment.
In some embodiments, the connection module 504 is further to:
when no target output connection point meeting the association condition exists in the flow editing area, a connection relation is not established for the input connection point to be added;
determining a target output connection point for the input connection point to be added in response to the input connection point to be added being selected;
And establishing a connection relation between the input connection point to be added and the target output connection point in response to the target output connection point being selected.
The above-mentioned various modules in the algorithm flow editing device may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In some embodiments, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store the design drawings. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements the steps of the algorithm flow editing method described above.
In some embodiments, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input device. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. Which when executed by a processor, performs the steps of the XXXX method described above. The display unit of the computer device is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen; the input device of the computer equipment can be a touch layer covered on a display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structures shown in fig. 6 or 7 are merely block diagrams of portions of structures associated with aspects of the application and are not intended to limit the computer device to which aspects of the application may be applied, and that a particular computer device may include more or fewer components than those shown, or may combine certain components, or may have a different arrangement of components.
In some embodiments, a computer device is provided, comprising a memory storing a computer program and a processor implementing the steps of the method embodiments described above when the computer program is executed.
In some embodiments, an internal structural diagram of a computer-readable storage medium is provided as shown in fig. 8, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method embodiments described above.
In some embodiments, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described embodiment methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (9)

1. An algorithm flow editing method, characterized in that the method comprises:
responding to a drag operation for a node to be added, and detecting the position of the node to be added; the node to be added corresponds to an algorithm to be added, and at least comprises an input connection point to be added;
when the node to be added is dragged to a flow editing area, responding to the position change of the node to be added in the flow editing area, and acquiring the real-time position relationship between the input connection point to be added and the output connection point of each flow node in the flow editing area; wherein, there is a connection relation among each flow node in the flow editing area, and there is a node connection algorithm generated according to the connection relation;
Determining a target output connection point of which the real-time position relation accords with an association condition; in a state that the node to be added is dragged, a first line segment is used for connecting the target output connection point and the input connection point to be added; the first line segment is used for indicating that the node to be added is in a dragged state, and the target output connection point has a first connection relation with at least an input connection point of one flow node in the flow editing area; the flow chart formed according to the connection relation among the flow nodes in the flow editing area comprises a top-down flow chart and/or a left-to-right flow chart; when the flow chart is a top-down flow chart, the association condition is an output connection point which is positioned above the input connection point to be added and is closest to the input connection point to be added; when the flow chart is a left-to-right flow chart, the association condition is an output connection point which is positioned at the left side of the input connection point to be added and is closest to the input connection point to be added;
and on the basis of reserving the first connection relation, adding a second connection relation between the target output connection point and the input connection point to be added, and outputting an algorithm corresponding to the target output connection point as algorithm input of the algorithm to be added.
2. The method according to claim 1, wherein adding a second connection relationship between the target output connection point and the input connection point to be added on the basis of retaining the first connection relationship, and outputting an algorithm corresponding to the target output connection point as an algorithm input of the algorithm to be added includes:
on the basis of reserving the first connection relation, adding a second connection relation between the target output connection point and the input connection point to be added;
and according to the algorithm to be added and the second connection relation, taking the algorithm output corresponding to the target output connection point as the algorithm input of the algorithm to be added, and updating the node connection algorithm by using the algorithm to be added.
3. The method according to claim 2, wherein after the algorithm output corresponding to the target output connection point is used as an algorithm input of the algorithm to be added according to the algorithm to be added and the second connection relation, the method further comprises, after updating the node connection algorithm using the algorithm to be added:
and deleting the second connection relation in response to the node to be added being dragged to the outside of the flow editing area, and deleting the algorithm to be added from the node connection algorithms according to the algorithm to be added and the second connection relation.
4. The method of claim 1, wherein after detecting the position of the node to be added in response to a drag operation for the node to be added, the method further comprises:
drawing the node to be added by using a first shape according to the position of the node to be added;
and modifying the display position of the node to be added in response to the position change of the node to be added.
5. The method according to claim 4, wherein, on the basis of the first connection relation being reserved, adding a second connection relation between the target output connection point and the input connection point to be added, outputting an algorithm corresponding to the target output connection point as an algorithm input of the algorithm to be added, and further comprising:
deleting the first shape, drawing the node to be added by using the second shape, and drawing the second connection relation by using a second line segment.
6. The method according to claim 1, wherein after acquiring the real-time positional relationship between the input connection point to be added and the output connection point of each flow node in the flow editing area in response to the positional change of the node to be added in the flow editing area when the node to be added is dragged to the flow editing area, the method further comprises:
When no target output connection point meeting the association condition exists in the flow editing area, a connection relation is not established for the input connection point to be added;
determining a target output connection point for the input connection point to be added in response to the input connection point to be added being selected;
and establishing a connection relation between the input connection point to be added and the target output connection point in response to the target output connection point being selected.
7. An algorithm flow editing apparatus, comprising:
the detection module is used for: responding to a drag operation for a node to be added, and detecting the position of the node to be added; the node to be added corresponds to an algorithm to be added, and at least comprises an input connection point to be added;
an acquisition module for: when the node to be added is dragged to a flow editing area, responding to the position change of the node to be added in the flow editing area, and acquiring the real-time position relationship between the input connection point to be added and the output connection point of each flow node in the flow editing area; wherein, there is a connection relation among each flow node in the flow editing area, and there is a node connection algorithm generated according to the connection relation;
A determining module for: determining a target output connection point of which the real-time position relation accords with an association condition; in a state that the node to be added is dragged, a first line segment is used for connecting the target output connection point and the input connection point to be added; the first line segment is used for indicating that the node to be added is in a dragged state, and the target output connection point has a first connection relation with at least an input connection point of one flow node in the flow editing area; the flow chart formed according to the connection relation among the flow nodes in the flow editing area comprises a top-down flow chart and/or a left-to-right flow chart; when the flow chart is a top-down flow chart, the association condition is an output connection point which is positioned above the input connection point to be added and is closest to the input connection point to be added; when the flow chart is a left-to-right flow chart, the association condition is an output connection point which is positioned at the left side of the input connection point to be added and is closest to the input connection point to be added;
a connection module for: and on the basis of reserving the first connection relation, adding a second connection relation between the target output connection point and the input connection point to be added, and outputting an algorithm corresponding to the target output connection point as algorithm input of the algorithm to be added.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202311055250.0A 2023-08-21 2023-08-21 Algorithm flow editing method and related device Active CN116860222B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311055250.0A CN116860222B (en) 2023-08-21 2023-08-21 Algorithm flow editing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311055250.0A CN116860222B (en) 2023-08-21 2023-08-21 Algorithm flow editing method and related device

Publications (2)

Publication Number Publication Date
CN116860222A CN116860222A (en) 2023-10-10
CN116860222B true CN116860222B (en) 2023-12-15

Family

ID=88221813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311055250.0A Active CN116860222B (en) 2023-08-21 2023-08-21 Algorithm flow editing method and related device

Country Status (1)

Country Link
CN (1) CN116860222B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650798A (en) * 2009-09-14 2010-02-17 中国科学院计算技术研究所 Flow modeling method
CN114706610A (en) * 2022-03-30 2022-07-05 苏州峰之鼎信息科技有限公司 Business flow chart generation method, device, equipment and storage medium
CN115113861A (en) * 2022-06-28 2022-09-27 北京字跳网络技术有限公司 Flow processing method, device and equipment
CN115393474A (en) * 2022-08-19 2022-11-25 金现代信息产业股份有限公司 Method and system for rapidly drawing flow chart

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2668807A1 (en) * 2009-06-12 2010-12-12 Ibm Canada Limited - Ibm Canada Limitee Resolving inter-page nodes and connectors in process diagrams
CN116266111A (en) * 2021-12-17 2023-06-20 北京字跳网络技术有限公司 Group node editing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650798A (en) * 2009-09-14 2010-02-17 中国科学院计算技术研究所 Flow modeling method
CN114706610A (en) * 2022-03-30 2022-07-05 苏州峰之鼎信息科技有限公司 Business flow chart generation method, device, equipment and storage medium
CN115113861A (en) * 2022-06-28 2022-09-27 北京字跳网络技术有限公司 Flow processing method, device and equipment
CN115393474A (en) * 2022-08-19 2022-11-25 金现代信息产业股份有限公司 Method and system for rapidly drawing flow chart

Also Published As

Publication number Publication date
CN116860222A (en) 2023-10-10

Similar Documents

Publication Publication Date Title
JP6364893B2 (en) Terminal device, electronic whiteboard system, electronic whiteboard input support method, and program
KR101794373B1 (en) Temporary formatting and charting of selected data
CN106681667A (en) Picture display method and device and mobile terminal
CN111596911B (en) Method, device, computer equipment and storage medium for generating control
US20150093029A1 (en) Image layers navigation
CN105335039A (en) Method and device for moving object among pages of editable document
US20160224215A1 (en) Method and device for selecting entity in drawing
CN112947923A (en) Object editing method and device and electronic equipment
WO2015184736A1 (en) Method and terminal for transforming background picture of touchscreen device
WO2023071861A1 (en) Data visualization display method and apparatus, computer device, and storage medium
CN111581208A (en) Data visualization display method and device
CN114546558B (en) Drawing processing method, device, computer equipment and storage medium
CN110709891A (en) Virtual reality scene model establishing method and device, electronic equipment and storage medium
CN114518822A (en) Application icon management method and device and electronic equipment
CN116860222B (en) Algorithm flow editing method and related device
CN112417212A (en) Method for searching and displaying difference of short video production version
CN114546219B (en) Picture list processing method and related device
CN113126866B (en) Object determination method, device, electronic equipment and storage medium
CN112116719B (en) Method and device for determining object in three-dimensional scene, storage medium and electronic equipment
WO2018194853A1 (en) Enhanced inking capabilities for content creation applications
CN110427153B (en) Writing content display method, device, equipment and medium
CN111552705B (en) Data processing method and device based on chart, electronic equipment and medium
CN114387402A (en) Virtual reality scene display method and device, electronic equipment and readable storage medium
CN112138397A (en) Trigger management method and device, computer equipment and storage medium
JP5949393B2 (en) System, terminal device, and image acquisition method

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
GR01 Patent grant
GR01 Patent grant