Workflow processing method, apparatus, device, and storage medium
By dividing the workflow model into functional node types and triggering the execution of the next node when each functional node outputs a result, the problems of complex configuration and waste of resources in multimedia processing are solved, achieving the effects of simplified configuration and improved execution efficiency.
Patent Information
- Application Number
- CN202310110009.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-08
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2043-02-08
AI Technical Summary
In existing technologies, multiple independent functional nodes need to be configured during multimedia processing, which leads to complicated configuration operations and wasted resources. In particular, when converting video resolution, the same video needs to be decoded multiple times, resulting in wasted processing resources.
By dividing the functional nodes in the workflow model into different types, including branch nodes and streaming nodes, the node type is determined by the number of callback information and the execution order. The execution of the next functional node is triggered as soon as the previous functional node outputs a result, avoiding waiting for all results to be output before starting the next node.
It simplifies workflow configuration, improves processing efficiency, and reduces resource consumption, especially significantly improving execution efficiency when multiple output results take different amounts of time.
Smart Images

Figure CN116346632B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet, and in particular to a workflow processing method, device, equipment and storage medium. BACKGROUND
[0002] Taking the field of multimedia processing as an example, in actual application, there may exist an application requirement of arranging various media processing functions to finally output a video meeting requirements by executing different functions in sequence, such as: performing conversion processing of a certain video in multiple resolutions, and then performing packaging processing respectively, and distributing each packaging result to different storage addresses for storage. The packaging processing refers to converting a video from a certain encapsulation format to another encapsulation format.
[0003] In the above example, the functions used include three functions of converting the resolution of a video, packaging the video and distributing the video. To meet the above application requirement, one implementation scheme is that a user can set multiple processing tasks, wherein each processing task includes, in sequence, a functional node for executing a certain resolution conversion task, a functional node for executing a certain packaging task and a functional node for executing a video distribution task. In this way, each processing task is executed independently and does not affect each other, and finally multiple output results of an input video can be obtained through multiple processing tasks.
[0004] However, in the above scheme, on the one hand, the user needs to perform configuration operations of each functional node in multiple processing tasks, and as the application scenario becomes more and more complex, the number of functional nodes to be configured will be more, and the configuration operations are complicated and inconvenient; on the other hand, for example, for multiple processing nodes for converting an input video in different resolutions, each functional node needs to perform decoding operations on each video frame of the input video, that is, the same input video needs to be decoded multiple times, which will cause waste of processing resources. SUMMARY
[0005] Embodiments of the present application provide a workflow processing method, device, equipment and storage medium to improve the execution efficiency of a workflow model and ensure the ease of use of the workflow model.
[0006] In a first aspect, embodiments of the present application provide a workflow processing method applied to a workflow control device, and the method comprises:
[0007] determining a node type of a first functional node according to a number of callback information configured in multiple functional nodes in a workflow model for executing a target task and an execution sequence of the multiple functional nodes; wherein the number of callback information indicates a type of output information of a functional node.
[0008] if the first function node belongs to the first node type or the second node type, the target first execution result of the previous second function node is sent to the first function node when the target first execution result is acquired, and the target second execution result corresponding to the target first execution result output by the first function node is sent to the next third function node when the target second execution result is acquired; wherein the target first execution result is one of at least one first execution result output by the second function node, and the target second execution result is one of a plurality of second execution results output by the first function node;
[0009] The node type corresponding to the first function node configured with the plurality of callback information is the first node type, and the function node after the function node of the first node type in the execution sequence belongs to the second node type.
[0010] In a second aspect, an embodiment of the present application provides a workflow processing device applied to a workflow control device, and the device comprises:
[0011] The determining module is configured to determine the node type of the first function node according to the number of callback information configured in a plurality of function nodes in a workflow model used for executing a target task and the execution sequence of the plurality of function nodes; wherein the number of callback information indicates the type of output information of the function node.
[0012] The processing module is configured to, if the first function node belongs to the first node type or the second node type, send the target first execution result of the previous second function node to the first function node when the target first execution result is acquired, and send the target second execution result corresponding to the target first execution result output by the first function node to the next third function node when the target second execution result is acquired; wherein the target first execution result is one of at least one first execution result output by the second function node, and the target second execution result is one of a plurality of second execution results output by the first function node; wherein the node type corresponding to the first function node configured with the plurality of callback information is the first node type, and the function node after the function node of the first node type in the execution sequence belongs to the second node type.
[0013] In a third aspect, an embodiment of the present application provides a workflow processing method applied to a workflow control device, and the method comprises:
[0014] The node type of the first function node is determined according to the number of callback information configured in a plurality of function nodes in a workflow model used for executing a video data processing task and the execution sequence of the plurality of function nodes; wherein the number of callback information indicates the type of output information of the function node.
[0015] if the first function node belongs to the first node type or the second node type, sending a target first execution result of a previous second function node to the first function node when the target first execution result is acquired, and sending a target second execution result corresponding to the target first execution result output by the first function node to a next third function node when the target second execution result is acquired, wherein the target first execution result is one of at least one first execution result output by the second function node, and the target second execution result is one of a plurality of second execution results output by the first function node;
[0016] wherein a node type corresponding to a first function node configured with a plurality of callback information is the first node type, and a function node following the function node of the first node type in the execution order belongs to the second node type;
[0017] wherein the function node of the first node type includes a function node for converting video data into different resolutions, and the function node of the second node type includes at least one of a function node for packing video data of different resolutions into different packaging formats, and a function node for distributing video data of different resolutions or video data of different packaging formats to different storage addresses.
[0018] In a fourth aspect, an embodiment of the present application provides a workflow processing method applied to a workflow control device, comprising:
[0019] determining an execution order of a plurality of function nodes in a workflow model for executing a target task;
[0020] displaying a callback information configuration interface corresponding to each of the plurality of function nodes respectively according to the execution order of the plurality of function nodes and a number of execution results to be output by the plurality of function nodes, wherein a number of callback information configured in the callback information configuration interface corresponding to different function nodes is different;
[0021] receiving callback information input in the callback information configuration interface corresponding to each of the plurality of function nodes, so that the node type of the plurality of function nodes is determined according to the number of callback information configured in the plurality of function nodes and the execution order of the plurality of function nodes when the workflow model is used.
[0022] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a communication interface, wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the workflow processing method according to the first aspect or the third aspect or the fourth aspect.
[0023] In a sixth aspect, an embodiment of the present application provides a non-transitory machine readable storage medium, which has stored thereon executable code that, when executed by a processor of an electronic device, causes the processor to perform the workflow processing method according to the first aspect or the third aspect or the fourth aspect.
[0024] The workflow processing method provided by the embodiment of the present application divides the plurality of function nodes contained in the workflow model into different node types, and the execution strategies corresponding to the function nodes of different types are different. Specifically, when the first function node is executed according to the node order, the node type of the first function node to be executed currently can be determined based on the number of callback information configured in the plurality of function nodes in the workflow model and the execution order of the plurality of function nodes. If the first function node is the first function node in the plurality of function nodes that is configured with the plurality of callback information, the node type corresponding to the first function node is the first node type (which can also be referred to as a fork node), and if the second function node executed before the first function node is a fork node, the first function node after the second function node in the execution order belongs to the second node type (which can also be referred to as a streaming node), and at this time, the function nodes after the first function node belong to the streaming node.
[0025] Although the node execution strategies corresponding to the first function node as a fork node or a streaming node are different, they have the following commonalities: the workflow control device sends the target first execution result to the first function node when obtaining the target first execution result of the previous second function node, and sends the target second execution result corresponding to the target first execution result output by the first function node to the next third function node when obtaining the target second execution result. The target second execution result is one of the plurality of different second execution results output by the first function node at different times.
[0026] As can be seen, when a function node has a plurality of output execution results, the execution of the next function node does not need to be started after all the plurality of output execution results are output, but each time the previous function node outputs an execution result, the execution of the next function node can be triggered, especially when the time consumption of obtaining the plurality of output execution results is different, the execution efficiency of the workflow model can be improved. Moreover, the user does not need to configure too many nodes in the workflow model, which not only simplifies the workflow configuration operation, but also saves resources. BRIEF DESCRIPTION OF DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.
[0028] Figure 1 A schematic diagram of a traditional workflow process;
[0029] Figure 2 A schematic diagram of another workflow process;
[0030] Figure 3 A schematic diagram of a workflow process provided by an embodiment of the present application;
[0031] Figure 4 A flow chart of a workflow processing method provided by an embodiment of the present application;
[0032] Figure 5 A schematic diagram of different node types provided by an embodiment of the present application;
[0033] Figure 6 A flow chart of a workflow processing method provided by an embodiment of the present application;
[0034] Figure 7 A flow chart of a workflow processing method provided by an embodiment of the present application;
[0035] Figure 8 A flow chart of a workflow model configuration process provided by an embodiment of the present application;
[0036] Figures 9a-9c A schematic diagram of a callback information configuration interface of different type function nodes provided by an embodiment of the present application;
[0037] Figure 10 A structural schematic diagram of a workflow processing apparatus provided by an embodiment of the present application;
[0038] Figure 11 A structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0040] In addition, the step timing in each of the following method embodiments is only an example, not a strict limitation.
[0041] Some concepts involved in the embodiments of the present application are explained and described first.
[0042] WorkFlow model: It is a computing model of a work flow, that is, the logic and rules of how the work in the work flow is organized together, which is represented in a computer with a proper model and implemented in the computer. Different participants can arrange and execute different work flows.
[0043] Process: A configuration of a work flow is called a process.
[0044] Work flow instance, also called process instance, a work flow instance is generated by one execution of a process. In simple terms, it is the execution result finally output by a work flow model based on an input information of the work flow model.
[0045] Functional node: also called activity node, a work flow model is composed of multiple functional nodes, each of which is configured to provide different functions.
[0046] Activity instance: an activity instance is generated by one execution of a functional node, and a work flow instance is composed of multiple activity instances.
[0047] Transcoding: converting a video file from one encoding format to another, such as H.262, H.264, HEVC, etc.
[0048] Packaging: In the field of media processing, it generally refers to converting a video from one packaging format to another, such as mp4, m3u8.
[0049] Resolution: refers to the width and height pixel number of a video, such as 1920*1080.
[0050] Work flow is a very important capability in the field of multimedia processing, etc. Users can arrange various media processing capabilities through work flow, so as to more conveniently build various scenes. For example, converting a video to multiple resolutions after passing the video audit. For another example, packaging and encrypting a video after transcoding.
[0051] A workflow model includes a plurality of functional nodes (or a plurality of activity nodes). Different functional nodes are configured to complete different functions. Based on the basic principle of a workflow, the nodes in a workflow model often have a front-rear dependent order, and only after the execution of a current node is completed, a rear node can begin to execute.
[0052] Figure 1 Fig. 1 schematically illustrates a conventional workflow processing process, in which Figure 1 In Fig. 1, a multimedia processing scenario is assumed: an input video needs to be processed by a certain video production process, and then converted into three resolutions, resolution 1, resolution 2 and resolution 3, respectively. Then, for each resolution video, it is packaged into a certain packaging format, and then the three packaged videos are one-to-one corresponding distributed to different storage addresses: storage address C1, storage address C2 and storage address C3.
[0053] To meet the needs of the above application scenarios, as shown in Fig. 2, the user can set up the following multi-path processes: Figure 1
[0054] Process 1: including the following functional nodes: video production, resolution 1 conversion, packaging, distribution;
[0055] Process 2: including the following functional nodes: video production, resolution 2 conversion, packaging, distribution;
[0056] Process 3: including the following functional nodes: video production, resolution 3 conversion, packaging, distribution.
[0057] Among them, the video production functional node is configured to provide the following functions: adding a certain set of head and tail segments to the input video, and adding a certain set of digital watermark to each frame of video image. The packaging functional node is configured to provide the conversion of the input video into a certain set of packaging format. The distribution nodes in the above three processes are used to one-to-one corresponding distribute the input video to the above three storage addresses.
[0058] In the above example workflow model configuration scheme, the user needs to perform the configuration operation of the plurality of functional nodes schematically illustrated in the figure, including the configuration of the name of the functional node, the execution order between different functional nodes, the specific function provided by each functional node and the related parameters (such as the above head, tail segment, digital watermark, storage address, resolution, etc. parameters), etc.
[0059] Based on the configuration result of the above workflow model, when a user inputs a video S1, the video S1 is sent to the video production functional node, the video production functional node adds a set of opening and closing segments to the video S1 and adds a set of digital watermarks to each frame of the video image to obtain a video S2, and then sends the video S2 to the three resolution conversion functional nodes respectively.
[0060] Since the time consumed for conversion to different resolutions can be different, as shown in Figure 1 the functional node for conversion to resolution 1 and the functional node for conversion to resolution 2 have been executed, but the functional node for conversion to resolution 3 is still in execution. Taking the functional node for conversion to resolution 1 as an example, the video S2 is converted to resolution 1 to obtain a video S31, the video S31 is sent to the packaging node for processing, and after the packaging node is executed, the video S31 is sent to the distribution node. Similarly, the functional node for conversion to resolution 2 converts the video S2 to resolution 2 to obtain a video S32, sends the video S32 to the packaging node for processing, and after the packaging node is executed, the video S32 is sent to the distribution node. The functional node for conversion to resolution 3 converts the video S2 to resolution 3 to obtain a video S33, sends the video S33 to the packaging node for processing, and after the packaging node is executed, the video S33 is sent to the distribution node. The execution status of each functional node in the execution process of different flows is shown in the figure: executed, in execution, and waiting for execution.
[0061] Based on the above illustration, although the configuration of the above multiple flows can ensure that the execution of each flow is independent of each other, the execution of the next functional node can be performed immediately after the execution of the previous functional node in each flow is completed, and there is no need to wait, but the user needs to configure numerous functional nodes, and the configuration operation is complicated and inconvenient. Moreover, for example, the multiple resolution conversion functional nodes all need to decode the same input video S2 before performing resolution conversion, and the same video is decoded multiple times, which consumes more resources.
[0062] In view of this, another configuration and execution scheme of a workflow model is provided, in which the configuration operation of the user can be simplified, but the execution efficiency of the workflow model is reduced, that is, the execution result of the final output of the workflow model is obtained more delayed. In combination Figure 2 with the above , the above
[0063] , the above Figure 1 , and the above Figure 2 , the above , the above
[0064] , the above Figure 1The configuration parameters of the function node of converting multiple resolutions include resolution 1, resolution 2 and resolution 3. Similarly, the configuration parameters of the function node of distributing include the above three storage addresses.
[0065] Figure 2 In the workflow model shown, nodes providing the same function are integrated into one, i.e. there is only one node providing the same function in the model, such as only one node providing the function of converting resolution. Moreover, the workflow model only includes one workflow, instead of Figure 1 multiple workflows in parallel.
[0066] In the workflow model shown, nodes providing the same function are integrated into one, i.e. there is only one node providing the same function in the model, such as only one node providing the function of converting resolution. Moreover, the workflow model only includes one workflow, instead of Figure 2 multiple workflows in parallel.
[0067] Afterwards, the video S2 is sent to the function node of converting multiple resolutions. Based on the function configuration information of the function node, the video S2 is converted into the above three resolutions respectively, and videos S31, S32 and S33 corresponding to the above three resolutions are obtained respectively. After the three resolutions of videos are obtained, the three resolutions of videos are input to the next function node for subsequent processing. It can be understood that at this time, the function node of converting multiple resolutions only performs a decoding operation on the input video S2, which can save resources.
[0068] As shown in the schematic in the workflow model, the time consumed for converting different resolutions may be different, and even if the conversion processing of a certain resolution has been completed, the next function node will not be triggered to start execution until the conversion processing of other resolutions is completed. For example, when the function node of converting multiple resolutions has not completed the conversion processing of three resolutions, i.e. the function node is in the state of execution in progress, the subsequent function nodes are in the state of waiting for execution. Figure 2 In summary, in the processing scheme of the workflow model shown, each function node is started to execute once, and the execution of the next function node is started only when all the execution results required to be output by the previous function node are obtained. Such a workflow execution process will become a bottleneck of execution efficiency.
[0069] Figure 2
[0070] To simplify user configuration and improve the execution efficiency of workflow models, this invention provides another workflow processing solution. In summary, in this solution, each time a previous functional node produces an output result, it can trigger the next functional node to start execution once. That is, when a functional node produces multiple execution results, it is not necessary to wait for all execution results to be obtained before starting the next functional node. This solution can significantly improve execution efficiency, especially when the execution times of the multiple output results of the functional node are inconsistent.
[0071] for example Figure 3 As illustrated, when the "Convert to Multiple Resolutions" function node produces an execution result (e.g., completing the conversion of resolution 1 to obtain video S31), the execution of the next function node is initiated. In other words, this packaged function node does not need to wait for the previous function node to complete before it is started; the subsequent function node can begin execution as soon as the previous function node outputs a result. This facilitates parallel processing of multiple tasks, allowing users to extract multiple execution results from the final output of the workflow model.
[0072] This method of executing preceding and subsequent nodes in parallel can be called streaming execution. Based on Figure 3 The workflow model execution process shown allows users to easily configure multiple functional nodes to form a workflow model, and intermediate results can be obtained more quickly during the workflow model execution, thereby improving execution efficiency. Here, intermediate results refer to the execution results output by each functional node before the last functional node in the workflow model.
[0073] The following explains how to implement it. Figure 3 The execution scheme of the workflow model shown is explained.
[0074] The workflow processing method provided in this embodiment of the invention can be executed by a workflow control device. In practical applications, the maintenance personnel of the workflow model can construct the workflow model in the workflow control device (which may be a terminal device, server, or other device). An application for constructing the workflow model can run in the control device. This application contains several functional nodes that provide different functions. Multiple functional nodes can be selected and connected sequentially according to actual application needs to form a workflow model, and the relevant parameters of each functional node can be configured.
[0075] In addition, it should be noted that the execution of the functional nodes in a workflow model is not necessarily performed on the side of the workflow control device. For example, different functional nodes can be executed on different remote devices. For example, a maintenance personnel constructs a workflow model on the workflow control device T, which includes functional node A, functional node B and functional node C. However, the function provided by functional node A is executed on device a, the function provided by functional node B is executed on device b, and the function provided by functional node C is executed on device c. Therefore, when different functional nodes need to be executed, the workflow control device T needs to interact with the devices where the corresponding functional nodes are located. In this document, for the sake of simplicity, the interaction between the workflow control device and the functional nodes is directly simplified as the interaction of information. It should be understood that the actual interaction is with the devices where the functional nodes are executed.
[0076] The workflow processing scheme provided by the embodiment of the present application can be applied to the processing of a workflow model having the following characteristics: if a workflow model includes a functional node having multiple branched outputs, the processing of the workflow model can adopt the scheme provided by the embodiment of the present application. The functional node having multiple branched outputs means that the functional node outputs multiple execution results based on one input data or multiple input data. The time consumption for generating the multiple execution results is usually different.
[0077] Figure 4 The flowchart of the workflow processing method provided by the embodiment of the present application is shown in FIG. 4, which includes the following steps: Figure 4
[0078] 401. Determine the node type of the first functional node according to the number of callback information configured in the multiple functional nodes in the workflow model for executing the target task and the execution order of the multiple functional nodes. The number of callback information indicates the types of output information of the functional nodes.
[0079] In the embodiment of the present application, the types of output information of the functional nodes include two types: one is the output result obtained after processing the input data, and the other is a notification message indicating the end of the execution of the functional node. Therefore, one functional node can be configured with one callback information or two or more callback information. When two or more callback information are configured, one of the callback information can correspond to the notification message, and the other callback information can correspond to the output result. For example, when a functional node can output multiple output results, the callback information corresponding to different output results can be configured.
[0080] 402、If the first function node belongs to the first node type or the second node type, the target first execution result is sent to the first function node when the previous second function node obtains the target first execution result, wherein the first function node corresponds to the first node type, and the second node type is the node type of the function node after the function node of the first node type in the execution sequence.
[0081] The target first execution result is one of the at least one first execution result output by the second function node. That is, when one of the first execution results output by the second function node is obtained, the first execution result can be transmitted to the next first function node without waiting for all output results.
[0082] The target second execution result is one of the multiple second execution results output by the first function node. That is, when one of the second execution results output by the first function node is obtained, the second execution result can be transmitted to the next third function node without waiting for all output results.
[0083] Regarding the target second execution result: if the first function node outputs multiple second execution results for the input target first execution result, the target second execution result is one of the multiple second execution results; if the first function node outputs one second execution result for the input target first execution result, the target second execution result is the second execution result.
[0084] 403、In the embodiment, when the first function node outputs the target second execution result corresponding to the target first execution result, the target second execution result is sent to the next third function node.
[0085] As described above, a workflow model including multiple function nodes can be built according to actual application requirements. In the embodiment, it is assumed that the built workflow model is used to execute a target task.
[0086] The target task may, for example, be the packaging of videos into multiple resolutions, packaging in a preset packaging format, and then distributing the packaging results of videos of different resolutions to different storage addresses. At this time, the workflow model includes the following function nodes shown in the above embodiment: video production, conversion into multiple resolutions, packaging, and distribution. Figure 3
[0087] For example, the target task is an application publishing task: after compiling and packaging an application to be published, uploading it to servers in different regions, and then deploying it online, online verification is performed. At this time, the corresponding workflow model can include multiple function nodes that are executed sequentially, such as compiling and packaging, uploading, online deployment, and online verification. In this example scenario, when the function node of "uploading" is executed, it may need to be uploaded to multiple regions configured in advance, and finally deployed in multiple regions. Depending on the uploading region, the time consumed for uploading is different. If online deployment is performed after waiting for uploading to be completed in multiple regions, unnecessary waiting time is increased in other regions. At this time, the stream execution processing scheme provided in this embodiment is used, and after uploading is completed in one region, the subsequent deployment and verification phases can be started respectively. The advantage of the stream execution scheme is that when a function node has multiple branches, the next function node does not need to be executed after all branches are executed, especially when the execution time of different branches is inconsistent, the stream execution scheme can significantly improve the execution efficiency.
[0088] Unlike the previous workflow model in which each function node is configured with only one callback information, in the embodiment of the application, the function nodes can be divided into multiple different types, and different types of function nodes have different execution strategies. The basis for distinguishing different types of function nodes mainly includes two aspects: the execution order of the function nodes and the number of callback information configured.
[0089] Among them, based on the callback information, information interaction between the workflow control device and the function node can be realized, and the information interaction mainly reflects that when the function node outputs the execution result, the execution result can be sent to the workflow control device based on the corresponding callback information, so that the workflow control device obtains the execution result.
[0090] In practical applications, generally, the callback information can include callback address, callback type, information content fed back by the function node to the workflow control device, and the like. Among them, the callback address indicates which storage address of the workflow control device side the information content fed back by the function node should be sent to, such as an address identified by a uniform resource identifier (URI).
[0091] Specifically, in the embodiment of the application, the function nodes can be divided into three node types: a first node type (hereinafter referred to as a branch node), a second node type (hereinafter referred to as a stream node), and a third node type (hereinafter referred to as a normal node).
[0092] The principle of determining the node type corresponding to the functional node can be that the functional node located before the streaming node is a branching node or a streaming node; the branching node and the ordinary node differ in execution order and the number of configured callback information. The number of callback information configured for the ordinary node is one, and the number of callback information configured for the branching node is at least two.
[0093] In summary, the difference between the functional nodes of different node types is that:
[0094] The ordinary node can only start execution once, and has only one output execution result for one execution, and can enter the next functional node after execution.
[0095] The branching node can only start execution once, and has multiple output execution results for one execution, and can output different execution results at different time points.
[0096] The streaming node can start multiple executions, has multiple output execution results, and can start the execution of the next functional node every time an execution result is output.
[0097] In summary, the determination of the node type can be simply summarized as:
[0098] 1. If the functional node to be executed has one input and multiple outputs (determined according to the configuration result of the callback information of the functional node), the functional node is a branching node.
[0099] 2. The subsequent nodes of the branching node are all streaming nodes (with multiple inputs and multiple outputs).
[0100] 3. The subsequent nodes of the streaming node are also all streaming nodes.
[0101] 4. Other functional nodes are ordinary nodes (only start execution once, and output only one execution result).
[0102] In summary, the execution strategy of different node types can be simply summarized as:
[0103] 1. The ordinary node execution process starts execution when the conditions are met, and the current functional node ends after execution.
[0104] 2. The branching node execution process starts execution when the conditions are met, and the execution result is transmitted to the next functional node to start execution every time an execution result is output. When all execution results are output, the current functional node execution ends.
[0105] 3. The flow node executes the flow, starts to execute as soon as there is an input, can be started multiple times, and as soon as there is an output of the execution result, it is transmitted to the next function node to start execution, and when all execution results are output and the previous function nodes are executed, the current function node is marked as execution end.
[0106] To more intuitively see the differences between different types of function nodes in terms of input and output, the following Figure 5 example is given.
[0107] In Figure 5 , in a workflow model composed of function node A1, function node A2 and function node A3, it is assumed that the three function nodes all have one input and one output, so the three function nodes all belong to normal nodes.
[0108] In a workflow model composed of function node B1, function node B2 and function node B3, function node B1 is a normal node, function node B2 is a branching node, and function node B3 is a streaming node.
[0109] In a workflow model composed of function node C1, function node C2 and function node C3, function node C1 is a branching node, and then function node C2 and function node C3 behind it are both streaming nodes.
[0110] In Figure 5 , the circles at both ends of each workflow model represent the input and output of the workflow model.
[0111] In summary, in the workflow processing scheme of the flow execution provided in the embodiments of the present application, the configuration and execution process of the function nodes are different from those of the traditional workflow processing scheme.
[0112] Among them, regarding the configuration of the function nodes, the callback information needs to be configured based on the number and types of input and output information of the function nodes, so that the workflow control device can automatically identify the type of the function node based on the configuration information when executing the workflow model, and then execute according to the execution strategy corresponding to the type of node.
[0113] Specifically, for the above normal node, one callback information can be configured; for the branching node, at least two callback information can be configured; for the streaming node, at least one callback information can be configured. The identification of the streaming node does not depend on the number of callback information. The meaning and use of callback information corresponding to different node types will be described below.
[0114] For a current execution of a workflow model, when an input data is given to the workflow model and the execution of the workflow model is started, a function node currently required to be executed is determined, referred to as a first function node, and a node type corresponding to the first function node currently required to be executed is determined based on an execution order of the plurality of function nodes and a number of callback information configured for the function node.
[0115] Specifically, if the first function node is a first function node in the workflow model, generally, the first function node is a normal node or a branch node, it is determined whether the first function node is a normal node or a branch node based on the number of callback information configured for the first function node. If the number of callback information configured is one, the first function node is a normal node, and if the number of callback information configured is more than one, the first function node is a branch node.
[0116] If the first function node is not the first function node in the workflow model, and a function node in front of the first function node is a second function node, the node type of the first function node can be determined in combination with the node type of the second function node.
[0117] If the second function node is a branch node or a flow node, the first function node is determined to be a flow node.
[0118] If the second function node is a normal node, the node type of the first function node is further determined in combination with the number of callback information configured for the first function node. Specifically, if the number of callback information configured for the first function node is one, the first function node is a normal node, and if the number of callback information configured for the first function node is more than one, the first function node is a branch node.
[0119] That is, if the first function node currently required to be executed is determined to be a first function node configured with a plurality of callback information based on the execution order of the plurality of function nodes in the workflow model and the number of callback information configured for the function node, the node type corresponding to the first function node is a first node type (i.e., a branch node). If the second function node in front of the first function node is a branch node or a flow node, the first function node is a flow node. If the number of callback information configured for the first function node is one, and there is no other function node in front of the first function node or the number of callback information configured for the function node in front of the first function node is also one, the first function node is a normal node. That is, the function node configured with a single callback information in front of the branch node is a normal node.
[0120] The execution strategy of the normal node is the same as the execution strategy of the function node in the conventional workflow model.
[0121] If the first function node is determined to be a fork node or a flow node, the execution strategies of these two types of function nodes are different, but also have commonalities. Specifically, the target first execution result of the previous second function node is sent to the first function node when the target first execution result is obtained, and the target second execution result corresponding to the target first execution result output by the first function node is sent to the next third function node when the target second execution result is obtained. The target second execution result is one of the multiple second execution results that the first function node needs to output.
[0122] That is, when the first function node is a fork node or a flow node, each time an execution result output by the first function node is obtained, the execution result is sent to the next third function node.
[0123] If the first function node is determined to be a fork node, the previous second function node is a normal node, and at this time, the second function node has only one output result, which is the target first execution result. If the first function node is determined to be a flow node, the second function node is a fork node or a flow node, and at this time, the second function node has multiple output results, and the target first execution result is one of the multiple first execution results output by the second function node.
[0124] As can be seen, when a function node has multiple output execution results, the execution of the next function node does not need to be started after all the multiple execution results are output, but each time an execution result is output by the previous function node, the execution of the next function node can be triggered, especially when the time consumption for obtaining the multiple output execution results is different, the execution efficiency of the workflow model can be improved. Moreover, only one node providing the same function needs to be configured in a workflow model, and the difference in callback information is configured for different types of function nodes, the complexity of the configuration operation is limited, which not only simplifies the workflow configuration operation, but also saves resources.
[0125] The execution process of the first function node corresponding to different node types that need to be executed will be described in detail below.
[0126] Figure 6 A flowchart of a workflow processing method provided by an embodiment of the present application is shown in FIG. 1. Figure 6 As shown in FIG. 1, the method comprises the following steps:
[0127] 601, according to the number of callback information configured in the multiple function nodes of the workflow model for executing the target task and the execution order of the multiple function nodes, the node type of the first function node to be executed is determined, wherein the number of callback information indicates the type of output information of the function node.
[0128] 602、If the first function node belongs to the second node type, determine whether a parent task record corresponding to the first function node has been created when obtaining the target first execution result of the previous second function node, if not, execute step 603, if yes, execute step 604.
[0129] In the embodiment, it is assumed that the first function node is a streaming node (the second node type is a streaming node), at this time, the previous second function node belongs to a fork node or a streaming node. The target first execution result is any one of the multiple first execution results output by the second function node, that is, whenever an execution result output by the second function node is obtained, it is sent to the first function node to trigger the first function node to execute once.
[0130] 603、Create a parent task record and a sub-task record corresponding to the target first execution result, and establish an association between the parent task record and the sub-task record.
[0131] 604、Create a sub-task record corresponding to the target first execution result, and establish an association between the parent task record and the sub-task record.
[0132] In the embodiment, the parent task record and the sub-task record can also be called a parent activity instance and a sub-activity instance. The parent task record is used to manage the sub-task record, which is embodied in, for example, recording the identification information of the created sub-task record in the parent task record to form an association between the sub-task record and the parent task record, and recording the relevant execution state information of the corresponding target first execution result after the input first function node is executed in the sub-task record. The execution state information can include, for example, the execution start and end time, the output target second execution result, and the like.
[0133] Since the first function node is a streaming node, the streaming node has multiple inputs and multiple outputs, and the multiple inputs are not input at the same time, and similarly, the multiple outputs are not output at the same time, therefore, the first function node is started to execute once whenever there is an input. By creating a parent task record, the execution process of the non-simultaneous triggering input data of the first function node can be facilitated. Each execution of the first function node produces a sub-activity instance, that is, the execution state information of the current task is recorded in the corresponding sub-task record, the current task is, for example, the processing of the input target first execution result by the function provided by the first function node to obtain the target second execution result.
[0134] Through the above parent task record and sub-task record, it is convenient to query how many times the first function node has executed in total, the relevant information of each execution process, and the execution state of the first function node: whether the execution is ended or not.
[0135] 605、send the target first execution result to the first function node, obtain a target second execution result output by the first function node based on the target callback information corresponding to the first function node based on the target first execution result, and record execution state information of the target first execution result in the subtask record.
[0136] 606、determine whether the second function node is executed to end and whether the plurality of first execution results output by the second function node are all executed by the first function node, if yes, execute step 607, otherwise execute step 608.
[0137] 607、send the target second execution result to a next third function node, and mark that the first function node is executed to end in the parent task record.
[0138] 608、send the target second execution result to a next third function node.
[0139] After obtaining the target first execution result currently required to be input into the first function node, the corresponding subtask record is created, and the target first execution result is sent to the first function node for execution.
[0140] The first function node processes the target first execution result based on the related function configuration provided by itself to obtain the corresponding target second execution result. For example, in the foregoing example, the target first execution result is a video converted to a certain resolution, the first function node is used to package the video into a certain set packaging format, and the target second execution result is the video converted by the packaging format.
[0141] The first function node feeds back the target second execution result to the workflow control device based on the configured target callback information, so that the workflow control device obtains the target second execution result to be sent to the next third function node.
[0142] For the first function node belonging to the streaming node, the target callback information configured for the first function node can include a callback address and an input processing function, and can also include a callback type.
[0143] The first function node outputs the target second execution result to the callback address, and the workflow control device determines the target second execution result from at least one second execution result stored in the callback address based on the input processing function. The at least one second execution result is respectively output by the first function node for different first execution results that have been received.
[0144] That is, assuming that the second function node inputs N different first execution results to the first function node, the input time of the N first execution results is different, and the first function node starts to execute once to obtain a corresponding second execution result each time a first execution result is received, so that each time a second execution result is generated, the target callback information can be called to send the second execution result obtained at this time to the callback address. Thus, each second execution result will be stored in the callback address one by one. For example, at T1 time, the second execution result Y1 is sent to the callback address; at T2 time, another second execution result Y2 is sent to the callback address. The workflow control device can obtain the second execution result Y1 from the callback address at T1 time, and send the second execution result Y1 to the next third function node; at T2 time, the second execution result Y1 and the second execution result Y2 can be obtained, and a deduplication process needs to be performed to determine the newly generated second execution result Y2 at the current T2 time, and send the second execution result Y2 to the third function node. Therefore, the deduplication process logic is described in the input processing function. In addition, the input processing function also describes the logic of processing the currently obtained second execution result to meet the input requirements of the next third function node, such as converting the second execution result Y1 and the second execution result Y2 into a certain data format required by the third function node.
[0145] In addition, in the embodiment, when the target second execution result processed and output by the current first function node for the input target first execution result based on the target callback information corresponding to the first function node is obtained, on the one hand, the corresponding execution state information is recorded in the subtask record corresponding to the target first execution result, such as including the execution start and end time, whether the execution is successful, and the output execution result (i.e., the target second execution result); on the other hand, whether the first function node is executed is determined.
[0146] Specifically, the determination of whether the first function node is executed includes two aspects: whether the last function node, i.e., the second function node, is executed, and whether the multiple first execution results output by the second function node are all executed by the first function node.
[0147] If the second function node is executed, it will be marked as an execution end state, so that the determination of whether the second function node is executed can be determined by querying the execution state of the second function node. If the second function node is a streaming node, the determination process of whether the second function node is executed is similar to the determination process of the first function node in the embodiment; if the second function node is a branching node, the determination process of whether the second function node is executed will be introduced in subsequent embodiments.
[0148] The execution end of the second function node means that it will no longer output the execution result that needs to be processed by the first function node, and at this time, the multiple first execution results that have been sent to the first function node are all the tasks that need to be processed by the first function node. Assuming that the target second execution result obtained from the callback address is the last second execution result, it is determined that the execution of the first function node ends, and the target second execution result is sent to the third function node. If the target second execution result obtained from the callback address is not the last second execution result, that is, there is still a first execution result being executed by the first function node, it is determined that the execution of the first function node has not ended, and the target second execution result is sent to the third function node. When the last first execution result input to the first function node is also executed, it is determined that the execution of the first function node ends.
[0149] When it is determined that the execution of the first function node ends, the execution end of the first function node is marked in the parent task record, such as recording the state of the execution end and the corresponding end time.
[0150] In summary, for the streaming node, the callback can be executed multiple times, that is, the configured callback information can be executed multiple times: once every time an output result is generated, so that the workflow control device can perceive each execution of the streaming node and trigger the execution of the next function node in time, without waiting for all output results to be generated before triggering the execution of the next function node.
[0151] In an optional embodiment, the callback configuration information corresponding to the streaming node can also include multiple callback addresses. The streaming node can send different execution results to different callback addresses every time an execution result is output. In addition, optionally, the streaming node can also send at least two execution results together to the callback address when the at least two execution results are generated at the same time, and is not limited to sending only one execution result each time. Even optionally, the streaming node can be configured to send all the execution results generated so far to the callback address every time an execution result is generated, so that the workflow control device determines the latest generated execution result based on the deduplication logic.
[0152] It should be noted that the above Figure 6In the embodiment shown, the execution order of steps 605-608 is only an example. In practice, the target second execution result output by the first function node based on the target first execution result can also be sent to the next third function node when it is obtained, and the execution state information of the target first execution result can be recorded in the subtask record. Then, it is determined whether the second function node ends and whether all the first execution results output by the second function node are executed by the first function node. If yes, the first function node is marked as ending in the parent task record. If no, the subsequent execution result output by the second function node is continuously received.
[0153] For ease of understanding, the execution process of the embodiment shown is exemplarily explained in combination with the scenario shown in Figure 5 Figure 6 the embodiment.
[0154] Suppose the workflow model is Figure 5 a workflow model composed of a function node B1, a function node B2, and a function node B3 in
[0155] When the first function node is the function node B3, the function node B3 is determined to be a flow node according to its execution order and the node type of the previous function node. At this time, the previous function node B2 is a branching node, which has multiple output execution results: a first execution result B21, a first execution result B22, and a first execution result B23. It is assumed that the three execution results are output in different times in sequence.
[0156] When the first execution result B21 output first by the function node B2 is obtained, it is determined that the parent task record corresponding to the function node B3 has not been created, so the parent task record is created, and the identifier corresponding to the record (supposed to be JL_B3) is generated. The subtask record corresponding to the first execution result B21 is created, and the identifier corresponding to the subtask record is supposed to be jl_B21. The identifier of the subtask record is added to the parent task record. The first execution result B21 is sent to the function node B3. When the second execution result B31 corresponding to the first execution result B21 output by the function node B3 is obtained based on the target callback information corresponding to the function node B3, the execution state information of the first execution result B21 is recorded in the subtask record jl_B21. It is determined whether the current function node B3 ends.
[0157] Suppose that the function node B2 has not been marked as ending at this time, so it is determined that the function node B3 has not ended. The second execution result B31 is sent to the next function node: Figure 5 The next function node of the function node B3 inis a special node: an output node indicating the end of the workflow model. That is, the second execution result B31 is one of the final output results of the workflow model.
[0158] Afterwards, assuming that the workflow control model receives the next execution result output by the function node B2: the first execution result B22, it is determined that the parent task record corresponding to the function node B3 has been created, and thus a subtask record corresponding to the first execution result B22 is created, assuming that the corresponding identifier is jl_B22, the identifier of the subtask record is added to the parent task record. The first execution result B22 is sent to the function node B3, and when the second execution result B32 corresponding to the first execution result B22 output by the function node B3 is obtained based on the target callback information corresponding to the function node B3, the execution state information of the first execution result B22 is recorded in the subtask record jl_B22. It is determined whether the current function node B3 is ended. In addition, assuming that the workflow control device has received the next execution result output by the function node B2: the first execution result B23 during the process of processing the first execution result B22 by the function node B3. At this time, the workflow control device determines whether the current function node B3 is ended, and assumes that it is determined that the function node B2 has been marked as execution ended at this time, and thus it is determined that the function node B3 still has a task to be executed: the first execution result B23 is still being processed. The workflow control device determines that the function node B3 is not executed and ends, and the second execution result B32 is passed back. After the function node B3 outputs the second execution result B33 corresponding to the first execution result B23, the workflow control device obtains the second execution result B33 corresponding to the first execution result B23 output by the function node B3 based on the target callback information corresponding to the function node B3, records the execution state information of the first execution result B23 in the subtask record jl_B23, and determines whether the current function node B3 is ended. Since the function node B2 has been marked as execution ended at this time, and all the first execution results received by the function node B3 have been executed, it is determined that the function node B3 is executed at this time, and the function node B3 is marked as execution ended in the parent task record.
[0159] Figure 7 A flowchart of a workflow processing method provided by an embodiment of the present application is shown in FIG. 7, which includes the following steps: Figure 7
[0160] 701、According to the callback information quantity configured in the workflow model for executing the target task and the execution order of the plurality of function nodes, the node type of the first function node to be executed is determined; wherein the callback information quantity indicates the type of output information of the function node.
[0161] 702、If the first function node belongs to the first node type, the target first execution result is sent to the first function node when the target first execution result of the previous second function node is acquired, and the target second execution result is sent to the next third function node when the target second execution result output by the first function node is acquired based on the first callback information corresponding to the first function node; wherein the target second execution result is any one of the multiple second execution results output by the first function node and corresponding to the target first execution result.
[0162] 703、When the notification message indicating the end of execution of the first function node is acquired based on the second callback information corresponding to the first function node, the end of execution of the first function node is marked; wherein the first function node determines whether to send the notification message based on the number of the multiple second execution results that need to be output.
[0163] In this embodiment, it is assumed that the first function node is a fork node (the first node type is a fork node), and the third function node located after the first function node is a streaming node, and the second function node located before the first function node is a normal node.
[0164] In this embodiment, for the fork node, two different callback information can be configured: the first callback information and the second callback information, wherein the first callback information is used to transmit the execution result output by the fork node, and the second callback information is used to transmit the execution end state information of the fork node.
[0165] In actual application, the first callback information can include the first callback type, the first callback address, and the input processing function, and the second callback information can include the second callback type and the second callback address. The input processing function, such as the input processing function contained in the callback information corresponding to the streaming node, can be used for de-duplication processing and processing of the execution result that needs to be sent to the next function node to meet the input requirements of the next function node. Details are not described here.
[0166] Since the fork node has one input and multiple outputs, that is, the fork node is only executed once to form an active instance, but multiple output results are generated in the active instance.
[0167] Specifically, since the previous second function node is a normal node, that is, it has one output result: the target first execution result, when the target first execution result output by the second function node is acquired, the target first execution result is sent to the first function node, and at this time, an active instance (i.e. a task record) corresponding to the target first execution result can also be created.
[0168] The first function node generates a plurality of second execution results corresponding to the target first execution result based on the input of the target first execution result and the function processing logic provided by the first function node. The target second execution result is one of the plurality of second execution results.
[0169] When a second execution result is generated, the first function node sends the second execution result to a corresponding first callback address based on the configured first callback information, so that the workflow control device sends the second execution result to the next third function node after obtaining the second execution result from the first callback address, thereby forming corresponding execution state information in the active instance. Meanwhile, the workflow control device can also determine whether the first function node ends. Specifically, if the workflow control device receives a notification message indicating that the first function node ends from the corresponding second callback address based on the second callback information at this time, it is determined that the first function node ends, otherwise it is determined that the first function node does not end. If it is determined that the first function node ends, the first function node execution end is marked in the active instance.
[0170] The configuration information of the first function node indicates how many execution results it needs to output, so the first function node determines that it ends when it has output the number of execution results. The notification message is sent based on the second callback information.
[0171] For ease of understanding, the execution process of the embodiment shown in Figure 5 is illustrated by way of example. Figure 7
[0172] Suppose the workflow model is a workflow model composed of function node B1, function node B2 and function node B3 in Figure 5 When the first function node is function node B2 in it, function node B2 is determined to be a branch node according to its execution order and the number of configured callback information. At this time, the previous function node B1 is a normal node and the next function node B3 is a streaming node.
[0173] When the target first execution result B11 output by function node B1 is obtained, the target first execution result B11 is sent to function node B2 to create an active instance (i.e. task record) corresponding to function node B2, which is assumed to be identified as JL_B2. Function node B2 processes the target first execution result B11 and outputs a plurality of second execution results in turn, such as second execution result b21, second execution result b22 and second execution result b23.
[0174]
[0175] When the second execution result b21 is generated at the functional node B2, the second execution result b21 is sent to the first callback address based on the configured first callback information, and the workflow control device obtains the second execution result b21 therefrom, forms the execution state information corresponding thereto in the activity instance, sends the second execution result b21 to the functional node B3, and determines that the functional node B2 has not finished execution since the notification message is not obtained from the second callback address based on the second callback information at this time.
[0176] After the second execution result b22 is generated at the functional node B2, the second execution result b22 is sent to the first callback address based on the configured first callback information, and the workflow control device obtains the second execution result b22 therefrom, forms the execution state information corresponding thereto in the activity instance, sends the second execution result b22 to the functional node B3, and determines that the functional node B2 has not finished execution since the notification message is not obtained from the second callback address based on the second callback information at this time.
[0177] After the second execution result b23 is generated at the functional node B2, the second execution result b23 is sent to the first callback address based on the configured first callback information, and the workflow control device obtains the second execution result b23 therefrom, forms the execution state information corresponding thereto in the activity instance, sends the second execution result b23 to the functional node B3, and determines that the functional node B2 has finished execution since the notification message is obtained from the second callback address based on the second callback information at this time, and marks the functional node B2 as having finished execution in the activity instance.
[0178] The execution process of the first functional node as a fork node and a flow node is introduced above, and the flow node and the fork node are both executed multiple times for callback, so that the workflow control device can timely perceive each output of the fork node and the flow node, so as to timely trigger the execution of the next node, and improve the execution efficiency of the workflow model.
[0179] The first functional node can be a common node in addition to the fork node and the flow node.
[0180] When it is determined that the first function node belongs to the third node type (the third node type is a common node), the target first execution result of the previous second function node is sent to the first function node when the target first execution result is acquired, and the target second execution result corresponding to the target first execution result output by the first function node is sent to the next third function node based on the target callback information corresponding to the first function node, and the execution of the first function node is marked as ended.
[0181] For the convenience of understanding, the case shown in the above Figure 5 will be taken as an example to illustrate.
[0182] Suppose the workflow model is Figure 5 a workflow model composed of a function node B1, a function node B2 and a function node B3 in the above.
[0183] When the first function node is the function node B1, it is determined that the function node B1 is a common node according to its execution order and the number of configured callback information, at this time, it is considered that the previous second function node is a specific node in the workflow model: an input node. At this time, the target first execution result of the second function node is sent to the function node B1 when the target first execution result is acquired, and the target second execution result corresponding to the target first execution result output by the function node B1 is sent to the next function node B2 based on the target callback information corresponding to the function node B1, and the execution of the function node B1 is marked as ended. In the example case, the above target first execution result is the data to be processed input through the input node, such as a video, an application program to be published.
[0184] After the target first execution result is sent to the function node B1, the function node B1 performs corresponding processing on the target first execution result based on the function provided by itself, and obtains an output result: the target second execution result. Then, the target second execution result is fed back to the workflow control device based on the target callback information configured on the function node B1, so that the workflow control device obtains the target second execution result.
[0185] The target callback information is the single callback information configured for the functional node B1, which includes callback address, callback type and other parameters. The functional node B1 adopts the corresponding callback type, and sends the target second execution result to the callback address according to the callback address, so that the workflow control device can obtain the target second execution result contained in the callback address. Since the functional node B1 is a normal node, the workflow control device determines that the execution of the functional node B1 is completed after obtaining a target second execution result in the callback address, thereby marking that the functional node B1 is in an execution completion state, and sending the target second execution result to the next functional node B2 to start the execution of the functional node B2.
[0186] As described above, the workflow model can be used in application scenarios such as multimedia data processing and software release. The following provides an optional workflow processing method for a video data processing process, which can include the following steps:
[0187] S1, determining the node type of a first functional node according to the number of callback information configured in a workflow model for executing a video data processing task and the execution order of the plurality of functional nodes; wherein the number of callback information indicates the types of output information of the functional nodes.
[0188] S2, if the first functional node belongs to the first node type or the second node type, sending a target first execution result to the first functional node when obtaining the target first execution result of a previous second functional node, and sending a target second execution result corresponding to the target first execution result output by the first functional node to a next third functional node when obtaining the target second execution result; wherein the target first execution result is one of at least one first execution result output by the second functional node, and the target second execution result is one of a plurality of second execution results output by the first functional node; wherein the node type corresponding to the first functional node configured with a plurality of callback information is the first node type, and the functional nodes after the functional nodes of the first node type in the execution order belong to the second node type.
[0189] The functional nodes of the first node type include functional nodes for converting video data into different resolutions, and the functional nodes of the second node type include at least one of the following: functional nodes for packaging video data of different resolutions into different packaging formats, and functional nodes for distributing video data of different resolutions or video data of different packaging formats to different storage addresses.
[0190] The above processing process can be understood in combination with the description in Figure 3 Figure 3 In the embodiment, the functional node of the first node type for converting video data into different resolutions is a "multi-resolution conversion" node, and the functional node of the second node type includes a "packing" node for packing video data of different resolutions into different packaging formats and a "distribution" node for distributing video data of different packaging formats to different storage addresses.
[0191] In fact, in addition to the first node type and the second node type, a third node type can be included, which refers to a node type corresponding to a functional node of the first node type that is configured with a single callback information in advance, such as Figure 3 a "video production" node as shown in the embodiment.
[0192] In the embodiment, the plurality of functional nodes included in the workflow model can have different node types, and the main difference between different node types is that the number of execution results output by the node types and the number of configured callback information are different. Therefore, in the embodiment, the configuration process of the workflow model is also different from the traditional configuration process of the workflow model.
[0193] Figure 8 A flowchart of a workflow model configuration process is provided in the embodiment, which can be executed by a workflow control device, such as Figure 8 as shown, which can include the following steps:
[0194] 801. Determine the execution order of the plurality of functional nodes in the workflow model for executing the target task.
[0195] 802. According to the execution order of the plurality of functional nodes and the number of execution results to be output by the plurality of functional nodes, respectively display the callback information configuration interfaces corresponding to the plurality of functional nodes, wherein the number of callback information configured in the callback information configuration interfaces corresponding to different functional nodes is different.
[0196] 803. Receive the callback information input in the callback information configuration interfaces corresponding to the plurality of functional nodes, so as to determine the node types of the plurality of functional nodes according to the number of callback information configured by the plurality of functional nodes and the execution order of the plurality of functional nodes when the workflow model is used.
[0197] In practical applications, the workflow control device is deployed with application software for building a workflow model. Optionally, the application software can provide a set of functional nodes for different tasks, so that when a user wants to build a workflow model for executing a target task (such as software release, video processing), the user can select the required functional nodes from the corresponding set of functional nodes. Of course, if the set of functional nodes does not have some functional nodes required by the user, the corresponding functional nodes can be newly created.
[0198] When the user constructs the workflow model for performing the target task, the user can first select a plurality of function nodes to be included in the workflow model and determine the execution order of the plurality of function nodes, and arrange the plurality of function nodes in the workflow model creation interface in sequence, so that the workflow control device can determine the plurality of function nodes included in the workflow model and the corresponding execution order.
[0199] Then, for each function node, the user can perform a function information configuration operation and a callback information configuration operation.
[0200] The function information configuration includes, for example, configuration of various output parameters. The configuration information can actually reflect the number of execution results required to be output by a function node. For example, for the function node "convert multiple resolutions" in the example above, the output parameters configured by the function node include a plurality of resolutions (assuming N resolutions), so that based on the configuration results of the N resolutions, the function node converts the input video data according to the N resolutions to output N video data after resolution conversion.
[0201] The callback information configuration includes, for example, configuration of several callback information, and configuration of specific contents such as callback address and callback type included in each callback information.
[0202] As described above, in the embodiment of the application, the types of function nodes can include three types of normal nodes, branching nodes and streaming nodes. In combination with the definitions of the above-mentioned node types, actually, the types of nodes included in a workflow model can include three types of normal nodes, branching nodes and streaming nodes in sequence, can include only two types of branching nodes and streaming nodes in sequence, or can include only two types of normal nodes and branching nodes in sequence.
[0203] As can be seen, assuming that the plurality of function nodes included in the above-mentioned workflow model are in sequence: node 1, node 2, node 3, node 1 can be a normal node or a branching node. From the perspective of the number of execution results output, a normal node outputs one execution result, and a branching node outputs a plurality of execution results.
[0204] If node 1 is a normal node, node 2 can be a normal node or a branching node.
[0205] Similarly, if node 2 is a normal node, node 3 can be a normal node or a branching node.
[0206] If node 2 is a fork node, and the function nodes after the fork node are all streaming nodes, then node 3 is a streaming node.
[0207] As can be seen, in the case that node 1 is a normal node, there are three situations as follows:
[0208] The first situation: node 1 is a normal node, node 2 is a normal node, and node 3 is a normal node.
[0209] The second situation: node 1 is a normal node, node 2 is a normal node, and node 3 is a fork node.
[0210] The third situation: node 1 is a normal node, node 2 is a fork node, and node 3 is a streaming node.
[0211] In the case that node 1 is a fork node, there is a fourth situation as follows:
[0212] The fourth situation: node 1 is a fork node, node 2 is a streaming node, and node 3 is a streaming node.
[0213] As can be seen from the above example, after the execution order of the multiple function nodes in the workflow model is determined, the user can be prompted to configure the function information for each function node in turn, and then the number of execution results that the function node needs to output can be determined according to the function information, and the callback information configuration interface corresponding to the function node can be determined in combination with the execution order of the function node. The callback information configuration interface prompts the user to configure one or multiple callback information for the function node.
[0214] Still taking the above example as an example. When the user configures the function information for node 1, according to the input function information, if it is determined that the number of execution results output by node 1 is one, at this time, node 1 is actually a normal node, then a callback information configuration interface 901 corresponding to a normal node can be displayed as shown in FIG. Figure 9a Alternatively, the callback information configuration interface 901 can include the following prompt information: node 1 is a normal node and needs to output one execution result, please configure one callback information. In addition, the callback information configuration interface 901 can include callback information configuration items, such as callback type, callback address, callback content processing logic, etc. shown in the figure. The user inputs the corresponding callback information in the callback information configuration interface 901, and in combination with the function information input by the user for node 1, the configuration of node 1 is completed.
[0215] Then, the user configures the function information for node 2, and assumes that according to the input function information, it is determined that the number of execution results output by node 2 is more than one, for example, three, at this time, node 2 is actually a fork node, then a callback information configuration interface 902 corresponding to a fork node can be displayed as shown in FIG. Figure 9bThe callback information configuration interface 902 corresponding to the bifurcated node is shown in FIG. 9B. Optionally, the callback information configuration interface 902 can include the following prompt information: node 2 belongs to a bifurcated node, and at least two kinds of callback information need to be configured: one is the callback information corresponding to the execution result, and the other is the callback information when the node ends.
[0216] As shown in FIG. 9B, optionally, the callback information configuration interface 902 can include two callback information configuration areas: a first callback information configuration area 9021 and a second callback information configuration area 9022. Figure 9b The first callback information configuration area 9021 is used to configure the callback information executed when the node ends, including the configuration items of callback type, callback address, callback content processing logic, etc.
[0217] The second callback information configuration area 9022 is used to configure the callback information corresponding to the execution result. Optionally, the second callback information configuration area 9022 can display the multiple output parameters configured by the user for node 2 (extracted from the function information configured by the user for node 2), which is not shown in the figure. Optionally, each output parameter corresponds to a corresponding callback information configuration item, so that the differentiated callback information configuration of different output parameters can be realized. Alternatively, multiple output parameters can share one callback information, that is, the callback information configuration results corresponding to multiple output parameters are the same.
[0218] After that, the user configures the function information of node 3. Since the previous node 2 is a bifurcated node, that is, the first function node configured with multiple callback information, it is directly determined that node 3 is a streaming node, and the callback information configuration interface 903 corresponding to the streaming node is displayed as shown in FIG. 9C.
[0219] Figure 9c Optionally, the callback information configuration interface 903 can include the following prompt information: node 3 belongs to a streaming node, multiple inputs thereof can not arrive at the same time, and multiple execution results of the output thereof also do not need to be transmitted to the next node at the same time. Please configure the callback information corresponding to the multiple execution results.
[0220] The callback information configuration interface 903 can include callback information configuration items, such as the callback type, callback address, input processing function, etc. shown in the figure.
[0221] After the function information and callback information of multiple function nodes are configured, the workflow model is completed. Then, the to-be-processed input data corresponding to the target task can be obtained, and the to-be-processed input data is input into the workflow model. Through the sequential execution of each function node in the workflow model, the processing result is finally output. The execution process of the workflow model is described in the foregoing embodiments, and will not be described here.
[0222] The workflow processing apparatus of one or more embodiments of the present application will be described in detail below. Those skilled in the art can understand that these apparatuses can be configured by using commercially available hardware components through the steps taught by the present solution.
[0223] Figure 10 A structural schematic diagram of a workflow processing apparatus provided for an embodiment of the present application is shown in FIG. 1, which includes an acquisition module 11, a determination module 12, a sending module 13, and a charging module 14. Figure 10
[0224] The determination module 11 is configured to determine a node type of a first function node according to a number of callback information configured in a plurality of function nodes in a workflow model for executing a target task and an execution order of the plurality of function nodes, wherein the number of callback information indicates a type of output information of the function node.
[0225] The processing module 12 is configured to, if the first function node belongs to a first node type or a second node type, send a target first execution result of a previous second function node to the first function node when the target first execution result is acquired, and send a target second execution result corresponding to the target first execution result output by the first function node to a next third function node when the target second execution result is acquired, wherein the target first execution result is one of at least one first execution result output by the second function node, and the target second execution result is one of a plurality of second execution results output by the first function node; wherein the first node type corresponds to a function node configured with a plurality of callback information, and the function node after the function node of the first node type belongs to the second node type.
[0226] Optionally, the first function node belongs to the second node type, and the second function node belongs to the first node type or the second node type. At this time, the processing module 12 is specifically configured to, when a target first execution result of the second function node is acquired, determine whether a parent task record corresponding to the first function node has been created, wherein the target first execution result is one of a plurality of first execution results output by the second function node; if not, create the parent task record, create a child task record corresponding to the target first execution result, establish an association relationship between the parent task record and the child task record; send the target first execution result to the first function node; acquire the target second execution result output by the first function node based on target callback information corresponding to the first function node, and send the target second execution result to the next third function node.
[0227] Optionally, the processing module 12 is further configured to: record execution state information of the target first execution result in the subtask record; determine whether the second function node has ended execution and whether the first function node has executed all the first execution results output by the second function node; and if it is determined that the second function node has ended execution and the first function node has executed all the first execution results output by the second function node, mark the first function node as having ended execution in the parent task record.
[0228] Optionally, the target callback information includes a callback address and an input processing function. In the process of obtaining the target second execution result output by the first function node based on the target callback information corresponding to the first function node, the processing module 12 is specifically configured to: in response to the first function node outputting the target second execution result to the callback address, determine the target second execution result from at least one second execution result stored in the callback address based on the input processing function, wherein the at least one second execution result is output by the first function node for different first execution results that have been received respectively. In addition, the processing module 12 is further configured to: process the target second execution result according to the input processing function to meet the input requirement of the third function node.
[0229] In another optional embodiment, the first function node belongs to a first node type, and the second function node belongs to a third node type, wherein the third node type refers to a node type corresponding to a function node of which a single callback information is configured in front of the function node of the first node type. At this time, the processing module 12 is specifically configured to: when obtaining the target second execution result output by the first function node based on the first callback information corresponding to the first function node, send the target second execution result to the third function node, wherein the target second execution result is any one of a plurality of second execution results corresponding to the target first execution result and output by the first function node; and when obtaining a notification message indicating that the first function node has ended execution and output by the first function node based on the second callback information corresponding to the first function node, mark the first function node as having ended execution, wherein the first function node determines whether to send the notification message based on the number of the second execution results to be output.
[0230] The first callback information includes a callback address and an input processing function, and the processing module 12 is specifically configured to: in response to the first function node outputting the target second execution result to the callback address, determining the target second execution result from at least one second execution result stored in the callback address based on the input processing function, wherein the at least one second execution result is respectively output by the first function node for different first execution results received; and performing processing on the target second execution result according to the input processing function to meet the input requirement of the third function node, so as to send the processed target second execution result to the third function node.
[0231] Optionally, the processing module 12 is further configured to: if the first function node belongs to a third node type, sending the target first execution result to the first function node when obtaining the target first execution result of the second function node, and sending the target second execution result corresponding to the target first execution result output by the first function node based on the target callback information corresponding to the first function node to the third function node and marking the first function node as execution ending, wherein the third node type refers to a node type corresponding to a function node of which a single callback information is configured in front of a function node of the first node type.
[0232] Figure 10 The apparatus can perform the steps performed by the workflow control device in the foregoing embodiments, and the detailed execution process and technical effects are described in the foregoing embodiments, which will not be described here.
[0233] Figure 11 A structural schematic diagram of an electronic device provided in the embodiment is shown in FIG. 1. Figure 11 The electronic device can include a processor 21, a memory 22, and a communication interface 23. The memory 22 stores executable code, and when the executable code is executed by the processor 21, the processor 21 can at least implement the workflow processing method performed by the workflow control device in the foregoing embodiments.
[0234] In addition, the embodiment of the present application provides a non-transitory machine readable storage medium, and the non-transitory machine readable storage medium stores executable code, and when the executable code is executed by the processor of the electronic device, the processor can at least implement the workflow processing method performed by the workflow control device in the foregoing embodiments.
[0235] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate. Part or all of the modules can be selected according to actual needs to achieve the purposes of the embodiments. Those skilled in the art can understand and implement without creative labor.
[0236] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of the necessary general hardware platform, and of course can also be realized by means of the combination of hardware and software. Based on such understanding, the above technical solutions can be embodied in the form of computer products, and the present application can be embodied in the form of computer program products implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.
[0237] Finally, it should be noted that: the above examples are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A workflow processing method, characterized by, The application is applied to a workflow control device, comprising: determining a node type of a first function node according to a number of callback information configured in a plurality of function nodes in a workflow model for executing a target task and an execution order of the plurality of function nodes; wherein the number of callback information indicates a kind of output information of the function node; if the first function node belongs to a first node type or a second node type, sending a target first execution result of a previous second function node to the first function node when the target first execution result is acquired, and sending a target second execution result corresponding to the target first execution result output by the first function node to a next third function node when the target second execution result is acquired; wherein the target first execution result is one of at least one first execution result output by the second function node, and the target second execution result is one of a plurality of second execution results output by the first function node; wherein the first node type is a branch node with at least two configured callback information numbers, which can only start to be executed once and has a plurality of output execution results after being executed once; and the second node type is a streaming node with at least one configured callback information, which can start to be executed multiple times and has a plurality of output execution results, and a next function node is started to be executed whenever one execution result is output.
2. The method of claim 1, wherein, if the first function node belongs to the second node type, the second function node belongs to the first node type or the second node type; the sending of the target first execution result of the previous second function node to the first function node when the target first execution result is acquired, and the sending of the target second execution result corresponding to the target first execution result output by the first function node to the next third function node when the target second execution result is acquired, comprises: determining whether a parent task record corresponding to the first function node has been created when the target first execution result of the second function node is acquired, wherein the target first execution result is one of a plurality of first execution results output by the second function node; if not, creating the parent task record and creating a child task record corresponding to the target first execution result, and establishing an association relationship between the parent task record and the child task record; sending the target first execution result to the first function node; acquiring the target second execution result output by the first function node based on target callback information corresponding to the first function node; sending the target second execution result to the next third function node.
3. The method of claim 2, wherein, the method further comprises: recording execution state information of the target first execution result in the child task record; and determining whether the second function node ends execution and whether the first execution results output by the second function node are all executed by the first function node; and if it is determined that the second function node ends execution and the first execution results output by the second function node are all executed by the first function node, marking the first function node as ending execution in the parent task record.
4. The method according to claim 2 or 3, characterized in that, The target callback information includes a callback address and an input processing function. The target second execution result output by the first function node is obtained based on the target callback information corresponding to the first function node, including: In response to the first function node outputting the target second execution result to the callback address, the target second execution result is determined from at least one second execution result stored in the callback address based on the input processing function; wherein the at least one second execution result is output by the first function node for different first execution results received respectively; The target second execution result is sent to a next third function node, including: According to the input processing function, the target second execution result is processed to meet the input requirements of the third function node, and the processed target second execution result is sent to the next third function node.
5. The method of claim 1, wherein, The first function node belongs to a first node type, and the second function node belongs to a third node type, the third node type being a normal node configured with a single callback information, which can only be executed once and has only one output execution result after being executed once; The target second execution result output by the first function node is obtained based on the first callback information corresponding to the first function node, including: When the target second execution result output by the first function node is obtained based on the first callback information corresponding to the first function node, the target second execution result is sent to the third function node; wherein the target second execution result is any one of a plurality of second execution results corresponding to the target first execution result and output by the first function node; When a notification message indicating that the first function node ends execution is obtained based on the second callback information corresponding to the first function node, it is marked that the first function node ends execution; wherein the first function node determines whether to send the notification message based on the number of second execution results to be output.
6. The method of claim 5, wherein, The first callback information includes a callback address and an input processing function. When the target second execution result output by the first function node is obtained based on the first callback information corresponding to the first function node, the target second execution result is sent to the third function node, including: in response to the first function node outputting the target second execution result to the callback address, determining the target second execution result from at least one second execution result stored in the callback address based on the input processing function, wherein the at least one second execution result is output by the first function node for different first execution results received respectively; processing the target second execution result according to the input processing function to meet the input requirement of the third function node, so as to send the processed target second execution result to the third function node.
7. The method of claim 1, wherein, The method further comprises: if the first function node belongs to a third node type, sending the target first execution result to the first function node when obtaining the target first execution result of the second function node, and sending the target second execution result to the third function node when obtaining the target second execution result corresponding to the target first execution result output by the first function node based on the target callback information corresponding to the first function node, and marking the end of execution of the first function node, wherein the third node type refers to a common node configured with a single callback information, which can only start execution once and has only one output execution result for one execution.
8. A workflow processing apparatus, characterized by comprising: The workflow control device comprises: a determination module configured to determine a node type of a first function node according to a number of callback information configured in a plurality of function nodes in a workflow model for executing a target task and an execution sequence of the plurality of function nodes, wherein the number of callback information indicates a type of output information of the function node; a processing module configured to, if the first function node belongs to a first node type or a second node type, send a target first execution result of a previous second function node to the first function node when obtaining the target first execution result, and send a target second execution result corresponding to the target first execution result output by the first function node to a next third function node when obtaining the target second execution result, wherein the target first execution result is one of at least one first execution result output by the second function node, and the target second execution result is one of a plurality of second execution results output by the first function node, wherein the first node type is a branch node configured with a number of callback information being at least two, which can only start execution once and has a plurality of output execution results for one execution, and the second node type is a streaming node configured with at least one callback information, which can start execution multiple times and has a plurality of output execution results, and each time an execution result is output, a next execution of a function node is started.
9. A workflow processing method characterized by, The workflow control device comprises: determine a node type of a first function node according to a number of callback information configured in a plurality of function nodes in a workflow model for executing a video data processing task and an execution sequence of the plurality of function nodes, wherein the number of callback information indicates a type of output information of the function node; If the first function node belongs to the first node type or the second node type, the target first execution result output by the second function node is sent to the first function node when the target first execution result of the previous second function node is acquired, and the target second execution result corresponding to the target first execution result output by the first function node is sent to the next third function node when the target second execution result is acquired; wherein the target first execution result is one of at least one first execution result output by the second function node, and the target second execution result is one of a plurality of second execution results output by the first function node; The first node type is a branch node which can only start to execute once and has a plurality of output execution results, and the second node type is a streaming node which can start to execute multiple times and has a plurality of output execution results, and each time an execution result is output, a next execution of a function node is started; The function node of the first node type includes a function node for converting video data into different resolutions, and the function node of the second node type includes at least one of a function node for packing video data of different resolutions into different packaging formats, and a function node for distributing video data of different resolutions or video data of different packaging formats to different storage addresses.
10. A workflow processing method, characterized by, Applied to a workflow control device, comprising: Determining an execution order of a plurality of function nodes in a workflow model for executing a target task; According to the execution order of the plurality of function nodes and the number of execution results to be output by the plurality of function nodes, respectively display the callback information configuration interfaces corresponding to the plurality of function nodes respectively, wherein the number of callback information configured in the callback information configuration interfaces corresponding to different function nodes is different; Receiving the callback information input in the callback information configuration interfaces corresponding to the plurality of function nodes respectively, so that when the workflow model is used, the node types of the plurality of function nodes are determined according to the number of callback information configured by the plurality of function nodes and the execution order of the plurality of function nodes respectively.
11. An electronic device, comprising: Comprising: A memory, a processor, and a communication interface; wherein the memory stores executable code, when the executable code is executed by the processor, the processor executes the workflow processing method according to any one of claims 1 to 7, or executes the workflow processing method according to claim 9 or 10.
12. A non-transitory machine-readable storage medium, comprising: The non-transitory machine-readable storage medium stores executable code, when the executable code is executed by the processor of the electronic device, the processor executes the workflow processing method according to any one of claims 1 to 7, or executes the workflow processing method according to claim 9 or 10.
Citation Information
Patent Citations
Workflow scheduling method and device, electronic equipment and storage medium
CN114881505A
Domain based workflows
US20020138577A1