Search

CN-122019116-A - Method, device, equipment and storage medium for processing workflow

CN122019116ACN 122019116 ACN122019116 ACN 122019116ACN-122019116-A

Abstract

Embodiments of the present disclosure relate to a method, apparatus, electronic device, and storage medium for processing a workflow. The method includes receiving a request to merge a first workflow into a second workflow, the first workflow corresponding to a first node diagram and the second workflow corresponding to a second node diagram, determining a first node sequence in the first node diagram, the first node sequence indicating a process flow included in the first workflow, determining a second node sequence from the second node diagram that matches the first node sequence, and inserting at least one node into the second node sequence to update the second node diagram in response to the first node sequence including at least one node different from the second node sequence. According to the embodiment of the disclosure, the efficiency of the workflow to execute the task can be improved.

Inventors

  • XIE FEI
  • LU SHAOQI
  • Feng Tinglei
  • YANG FENGHAI

Assignees

  • 北京字跳网络技术有限公司

Dates

Publication Date
20260512
Application Date
20241112

Claims (13)

  1. 1. A method of processing a workflow, comprising: receiving a request to merge a first workflow to a second workflow, the first workflow corresponding to a first node diagram and the second workflow corresponding to a second node diagram; determining a first node sequence in the first node map, wherein the first node sequence indicates a processing flow included in the first workflow; determining a second node sequence matching the first node sequence from the second node map, and In response to the first node sequence including at least one node different from the second node sequence, the at least one node is inserted into the second node sequence to update the second node map.
  2. 2. The method of claim 1, wherein the determining, from the second node map, a second node sequence that matches the first node sequence comprises: Determining a plurality of candidate node sequences in the second node map; determining similarity between the plurality of candidate node sequences and the first node sequence, and And determining the second node sequence with the similarity meeting a preset condition from the plurality of candidate node sequences.
  3. 3. The method of claim 2, wherein the determining similarities between the plurality of candidate node sequences and the first node sequence comprises: determining a common subsequence of a candidate node sequence and the first node sequence, and The similarity of the candidate node sequence to the first node sequence is determined based on a first length of the common subsequence.
  4. 4. The method of claim 3, wherein the determining the similarity of the candidate node sequence to the first node sequence based on the first length of the common subsequence comprises: Determining a ratio of the first length of the common subsequence to a second length of the first node sequence, and Based on the ratio, the similarity of the candidate node sequence to the first node sequence is determined.
  5. 5. The method of claim 2, wherein the determining, from the plurality of candidate node sequences, the second node sequence for which the similarity satisfies a preset condition comprises: determining a set of candidate node sequences of which the similarity satisfies the preset condition from the plurality of candidate node sequences, and The second node sequence is determined from the set of candidate node sequences based on the number of nodes of the set of candidate node sequences in response to the number of sequences of the set of candidate node sequences being greater than one.
  6. 6. The method of claim 1, wherein the inserting the at least one node into the second sequence of nodes in response to the first sequence of nodes including at least one node different from the second sequence of nodes comprises: Determining a reference node associated with the at least one node from the second sequence of nodes, the reference node being a common node of the first and second sequences of nodes, and The at least one node is inserted into the second sequence of nodes based on the position of the reference node in the second sequence of nodes.
  7. 7. The method of claim 1, wherein the updating the second node map comprises: Determining a target node identification of the at least one node based on a plurality of node identifications of a plurality of nodes in the second node graph, and The target node identification is associated to the at least one node inserted into the second node map.
  8. 8. The method of claim 1, further comprising: receiving a processing request, determining a sub-node map matching the processing request from the updated second node map, and And processing the processing request based on the sub-node diagram.
  9. 9. The method of claim 8, wherein the processing request is associated with a target image, and determining a child node map from the updated second node map that matches the processing request comprises: determining a target workflow matching the type of the target image based on the type of the target image, and Determining the sub-node map corresponding to the target workflow from the updated second node map.
  10. 10. The method of claim 8, wherein the processing request based on the child node map comprises: Determining whether the second node map includes a target node associated with a sequence of nodes in the child node map, the target node not being included in the child node map, and In response to the second node map including the target node, skipping the target node during processing of the processing request.
  11. 11. An apparatus for processing a workflow, comprising: a receiving module configured to receive a request to merge a first workflow to a second workflow, the first workflow corresponding to a first node diagram, the second workflow corresponding to a second node diagram; A first determination module configured to determine a first node sequence in the first node map, the first node sequence indicating a process flow included in the first workflow; A second determination module configured to determine a second node sequence matching the first node sequence from the second node map, and An insertion module configured to insert at least one node into the second node sequence to update the second node map in response to the first node sequence including the at least one node different from the second node sequence.
  12. 12. An electronic device, comprising: at least one processing unit, and At least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, which when executed by the at least one processing unit, cause the electronic device to perform the method of any one of claims 1 to 10.
  13. 13. A computer readable storage medium having stored thereon a computer program executable by a processor to implement the method of any of claims 1 to 10.

Description

Method, device, equipment and storage medium for processing workflow Technical Field Example embodiments of the present disclosure relate generally to the field of computers and, more particularly, relate to a method, apparatus, device, and computer-readable storage medium for processing a workflow. Background With the rapid development of artificial intelligence technology, workflows can be used to customize normalized process flows. For example, people can self-design workflow according to requirements by utilizing a visual platform so as to be suitable for different application scenes. However, in the case of parallel execution of tasks by multiple workflows, since each workflow needs to occupy a considerable portion of running memory, this may cause a decrease in response speed of the server when switching different workflows, thereby affecting the processing efficiency of the workflows. Disclosure of Invention In a first aspect of the present disclosure, a method of processing a workflow is provided. The method includes receiving a request to merge a first workflow into a second workflow, the first workflow corresponding to a first node graph and the second workflow corresponding to a second node graph, determining a first node sequence in the first node graph, the first node sequence indicating a process flow included in the first workflow, determining a second node sequence from the second node graph that matches the first node sequence, and inserting the at least one node into the second node sequence to update the second node graph in response to the first node sequence including at least one node different from the second node sequence. In a second aspect of the present disclosure, an apparatus for processing a workflow is provided. The device comprises a receiving module, a first determining module, a second determining module and an inserting module, wherein the receiving module is configured to receive a request for merging a first workflow to a second workflow, the first workflow corresponds to a first node diagram, the second workflow corresponds to a second node diagram, the first determining module is configured to determine a first node sequence in the first node diagram, the first node sequence indicates a processing flow included in the first workflow, the second determining module is configured to determine a second node sequence matched with the first node sequence from the second node diagram, and the inserting module is configured to insert the at least one node into the second node sequence to update the second node diagram in response to the first node sequence comprising at least one node different from the second node sequence. In a third aspect of the present disclosure, an electronic device is provided. The apparatus includes at least one processing unit, and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit. The instructions, when executed by at least one processing unit, cause the apparatus to perform the method of the first aspect. In a fourth aspect of the present disclosure, a computer-readable storage medium is provided. The computer readable storage medium has stored thereon a computer program executable by a processor to implement the method of the first aspect. It should be understood that what is described in this section of the disclosure is not intended to limit key features or essential features of the embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following description. Drawings The above and other features, advantages and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, wherein like or similar reference numerals denote like or similar elements, in which: FIG. 1 illustrates a schematic diagram of an example environment in which embodiments in accordance with the present disclosure may be implemented; FIG. 2 illustrates a flowchart of an example process of processing a workflow according to some embodiments of the present disclosure; FIG. 3A illustrates an example architectural diagram of a first workflow and a second workflow according to some embodiments of the present disclosure; FIG. 3B illustrates a node processing flow diagram of an example process of determining a candidate node sequence according to some embodiments of the present disclosure; FIG. 3C illustrates a node processing flow diagram of an example process of determining a second node sequence according to some embodiments of the present disclosure; FIG. 3D illustrates a node process flow diagram of an example process of updating a second node map, according to some embodiments of the present disclosure; FIG. 4 illustrates a flowchart of an example proc