Method, apparatus and device for scheduling merging of nodes, and storage medium
By merging and generating a serial DAG and using end markers and virtual nodes to process multi-task DAGs, the code complexity problem caused by DAG nesting in the process engine scheduling is solved, improving the development efficiency of scheduling code and the execution efficiency of business processes.
Patent Information
- Application Number
- CN201911249012.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-06
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2039-12-06
AI Technical Summary
In existing technologies, the complexity of business processes leads to high complexity and low development efficiency in DAG scheduling code during process engine scheduling. This is especially true in the case of multi-level nested DAGs, which increases the complexity of the scheduling code and the risk of instantiation errors.
By obtaining the dependencies and node dependencies of each directed acyclic graph (DAG), a serial DAG is generated by merging them. It is determined whether the previous DAG of the target DAG has been scheduled and executed only after all nodes have been completed. The detection and merging of multi-task DAGs are simplified by using end markers and virtual nodes.
It simplifies the scheduling code logic, improves development efficiency, avoids nested DAGs, enhances the convenience and efficiency of business process scheduling, and reduces the probability of instantiation errors.
Smart Images

Figure CN111061551B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology (Fintech), and more particularly to a method, apparatus, device, and computer-readable storage medium for merging and scheduling nodes. Background Technology
[0002] With the development of computer technology, more and more technologies are being applied in the financial field. The traditional financial industry is gradually transforming into Fintech, and process engine scheduling technology is no exception. However, due to the security and real-time requirements of the financial industry, higher demands are being placed on process engine scheduling technology. Existing business processes are generally scheduled through a process engine, which abstracts each step of the business process into a process node. When the process engine schedules, the order and dependencies of all DAGs (Directed Acyclic Graphs) need to be configured in advance. For example, when scheduling a DAG, to improve efficiency, while scheduling the first node Dag1, all nodes in Dag1 (such as B1, B2, and B3) are also scheduled. After all nodes in Dag1 are scheduled, Dag2 and Dag3 are scheduled, and so on, until all three nodes of the DAG are scheduled. Currently, due to the complexity of business operations, DAG scheduling involves scheduling multiple DAGs simultaneously. In addition to scheduling each DAG, it is also necessary to schedule the nodes within the DAG, resulting in two or more layers of nested DAGs. This situation can easily increase the complexity of the scheduling code logic, reduce the development efficiency of the scheduling code, and consequently make the scheduling of subsequent business processes more complex and less efficient. Summary of the Invention
[0003] The main objective of this invention is to propose a node merging and scheduling method, apparatus, device, and computer-readable storage medium, aiming to solve the technical problems of high complexity of scheduling code logic and low development efficiency of scheduling code in existing business process nodes.
[0004] To achieve the above objectives, the present invention provides a node merging and scheduling method, which includes the following steps:
[0005] Obtain the DAG dependency relationships and node dependency relationships of each node in each directed acyclic graph (DAG). Based on the DAG dependency relationships and node dependency relationships, merge them to generate the corresponding serial DAG.
[0006] When executing the target DAG in the serial DAG, it is determined whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, based on the DAG dependency relationship and the node dependency relationship.
[0007] If all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, then the target DAG will be scheduled and executed, in order to schedule and execute all nodes of the DAG in the serial DAG.
[0008] Optionally, after the step of obtaining the DAG dependencies of each directed acyclic graph (DAG) and the node dependencies of each node in the DAG, and merging them to generate the corresponding serial DAG based on the DAG dependencies and node dependencies, the method further includes:
[0009] When a multi-task DAG with a parallel node as the end node is detected in the serial DAG, after the end node of the multi-task DAG is scheduled and executed, an end flag is set after the end node of the multi-task DAG to indicate that the scheduling and execution of all nodes of the multi-task DAG has been completed.
[0010] Optionally, the end identifier includes an end placeholder or a virtual node.
[0011] Optionally, the step of determining whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed completely based on the DAG dependency relationship and node dependency relationship when executing the target DAG specifically includes:
[0012] When executing the target DAG in the serial DAG, the previous DAG corresponding to the target DAG is determined according to the DAG dependency relationship and the node dependency relationship;
[0013] When the previous DAG corresponding to the target DAG is a multi-task DAG, determine whether the end identifier exists after the end node of the previous DAG corresponding to the target DAG, so as to determine whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed.
[0014] Optionally, the node merging and scheduling method further includes:
[0015] Determine whether there are two consecutive end markers in the serial DAG;
[0016] If there are two consecutive end identifiers in the serial DAG, then delete one of the two consecutive end placeholders.
[0017] Optionally, the node merging and scheduling method further includes:
[0018] Determine whether the parallel end node in the multi-task DAG corresponds to two or more end identifiers;
[0019] If the parallel termination node in the multi-task DAG corresponds to two or more termination identifiers, then the two or more termination identifiers corresponding to the parallel termination node are merged into one termination identifier.
[0020] Furthermore, to achieve the above objectives, the present invention also provides a node merging and scheduling device, the node merging and scheduling device comprising:
[0021] The DAG serial merging module is used to obtain the DAG dependency relationship of each directed acyclic graph (DAG) and the node dependency relationship of each node in the DAG, and merge them to generate the corresponding serial DAG based on the DAG dependency relationship and the node dependency relationship.
[0022] The DAG execution judgment module is used to determine, when executing the target DAG in the serial DAG, whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, based on the DAG dependency relationship and the node dependency relationship.
[0023] The DAG execution scheduling module is used to schedule the execution of the target DAG if all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, so as to schedule and execute all nodes of the DAG in the serial DAG.
[0024] Optionally, the node merging and scheduling device further includes an end identifier adding module, which is used for:
[0025] When a multi-task DAG with a parallel node as the end node is detected in the serial DAG, after the end node of the multi-task DAG is scheduled and executed, an end flag is set after the end node of the multi-task DAG to indicate that the scheduling and execution of all nodes of the multi-task DAG has been completed.
[0026] Optionally, the DAG execution judgment module specifically includes:
[0027] The upper DAG determination unit is used to determine the previous DAG corresponding to the target DAG based on the DAG dependency relationship and the node dependency relationship when executing the target DAG in the serial DAG;
[0028] The end identifier determination unit is used to determine whether the end identifier exists after the end node of the previous DAG corresponding to the target DAG when the previous DAG is a multi-task DAG, so as to determine whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed.
[0029] Optionally, the node merging and scheduling device further includes a connected placeholder deletion module, which is used to:
[0030] Determine whether there are two consecutive end markers in the serial DAG;
[0031] If there are two consecutive end identifiers in the serial DAG, then delete one of the two consecutive end placeholders.
[0032] Optionally, the node merging and scheduling device further includes a parallel placeholder merging module, which is used for:
[0033] Determine whether the parallel end node in the multi-task DAG corresponds to two or more end identifiers;
[0034] If the parallel termination node in the multi-task DAG corresponds to two or more termination identifiers, then the two or more termination identifiers corresponding to the parallel termination node are merged into one termination identifier.
[0035] In addition, to achieve the above objectives, the present invention also provides a node merging and scheduling device, the node merging and scheduling device comprising: a memory, a processor, and a node merging and scheduling program stored in the memory and executable on the processor, wherein when the node merging and scheduling program is executed by the processor, it implements the steps of the node merging and scheduling method described above.
[0036] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a node merging scheduler, which, when executed by a processor, implements the steps of the node merging scheduling method described above.
[0037] This invention provides a node merging and scheduling method. It obtains the DAG dependencies of each Directed Acyclic Graph (DAG) and the node dependencies of each node within the DAG. Based on these dependencies, a corresponding serial DAG is generated. When executing a target DAG within the serial DAG, it determines whether all nodes in the preceding DAG have been scheduled and executed, based on the DAG and node dependencies. If all nodes in the preceding DAG have been scheduled and executed, the target DAG is then scheduled and executed, thereby scheduling and executing all nodes in the serial DAG. Through this method, this invention merges multiple DAGs into a single serial DAG based on DAG and node dependencies, avoiding nested DAGs, simplifying scheduling code logic, improving scheduling code development efficiency, and solving the technical problems of high complexity and low development efficiency in existing business process node scheduling code logic. This improves the convenience and efficiency of subsequent business process scheduling. Attached Figure Description
[0038] Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention;
[0039] Figure 2 This is a flowchart illustrating the first embodiment of the node merging and scheduling method of the present invention;
[0040] Figure 3 This is a schematic diagram of the DAG dependency relationship in this invention;
[0041] Figure 4 This is a schematic diagram of the node dependency relationships corresponding to each node in the DAG of this invention;
[0042] Figure 5 This is a schematic diagram of the merged serial DAG in this invention;
[0043] Figure 6 A schematic diagram illustrating the setting of a virtual node for the end node in this invention;
[0044] Figure 7 This is a schematic diagram of the 3-node task in this invention;
[0045] Figure 8 This is a schematic diagram of the DAG after merging and serializing multiple task nodes in this invention.
[0046] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0047] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0048] like Figure 1 As shown, Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention.
[0049] In this embodiment of the invention, the node merging and scheduling device can be a PC or a server device running a Java Virtual Machine.
[0050] like Figure 1As shown, the merging and scheduling device of this node may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or stable non-volatile memory, such as disk storage. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0051] Those skilled in the art will understand that Figure 1 The device structure shown does not constitute a limitation on the device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0052] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a node merging scheduler.
[0053] exist Figure 1 In the device shown, the network interface 1004 is mainly used to connect to the backend server and communicate with the backend server; the user interface 1003 is mainly used to connect to the client (user terminal) and communicate with the client; and the processor 1001 can be used to call the node merging scheduler stored in the memory 1005 and execute the operations in the node merging scheduler method described below.
[0054] Based on the above hardware structure, an embodiment of the node merging and scheduling method of the present invention is proposed.
[0055] Reference Figure 2 , Figure 2 This is a flowchart illustrating a first embodiment of the node merging and scheduling method of the present invention. The node merging and scheduling method includes:
[0056] Step S10: Obtain the DAG dependency relationship corresponding to each directed acyclic graph (DAG) and the node dependency relationship corresponding to each node in the DAG. Based on the DAG dependency relationship and the node dependency relationship, merge to generate the corresponding serial DAG.
[0057] like Figure 3 As shown, the DAG contains four daags: Dag1, Dag2, Dag3, and Dag4. Figure 4 As shown, each Dag has start and end nodes. Dag1 contains nodes A, B1, B2, and B3, where A is the start node, and B1, B2, and B3 are the end nodes. Dag2 contains start nodes A1, A2, and A3, and end node B. The order and dependencies of all Dags are configured in advance. Currently, instantiation will begin first. Figure 3 The DAG, since the first node of the DAG is Dag1, will also... Figure 4 In the context of Dag1, after all nodes of Dag1 have been instantiated, the instantiation of Dag2 and Dag3 continues until... Figure 3 Once the Dag4 node is instantiated, the entire DAG instantiation process is complete. Since multiple Dags are instantiated simultaneously, in addition to managing the scheduling between Dags, it's also necessary to schedule the child nodes A, B, and C within each Dag, resulting in two levels of Dag nesting (multiple levels may occur in real-world scenarios). This increases the complexity of the scheduling code logic. Furthermore, most existing third-party workflow engines only support single-Dag scenarios; therefore, two or more levels of Dag nesting cannot be integrated with most third-party workflow engines, reducing the adaptability of node scheduling.
[0058] To address the aforementioned issues, this embodiment merges multiple DAGs into a single serial DAG based on DAG dependencies and node dependencies. This avoids nested DAGs, simplifies the scheduling code logic, and improves the development efficiency of the scheduling code. The specific instantiation process is illustrated through the following business scenario: A company conducts a disaster recovery drill involving M departments, each with dozens of participants. Due to the large number of participants, the initiator only knows the order of the M departments, not the specific participants or their order. Under existing solutions, since each department is an independent DAG, not all DAGs are instantiated at the start of the drill. If, halfway through the drill, a department's participant dependencies are misconfigured, the instantiation of that department's DAG might reveal an incorrect participant order. This could lead to premature termination of the drill, impacting the entire business process, rendering previous work ineffective, and reducing efficiency. Furthermore, in existing solutions, the initiator cannot directly ignore departments and configure the drill order by simply notifying the department heads; coordination with department heads is required, increasing the complexity of the configuration. Furthermore, during the configuration process by the initiator, there may be scenarios where multiple nodes depend on multiple nodes (multiple colleagues in the final step of department A work in parallel, and multiple colleagues in the beginning step of department B work in parallel. Since there is no department configuration, the configuration of the beginning step of department B depends on the ending colleagues of department A), which also increases the complexity of the instantiation logic.
[0059] According to the solution provided in this embodiment, firstly, based on the dependency relationships between each Dag and the node dependencies between each node in the Dag, the independent Dags corresponding to M departments are merged into a single serial Dag. This simplifies the scheduling logic of business process nodes, not only preventing configuration order errors during instantiation but also reducing the configuration difficulty for the initiator. It also facilitates early detection and adjustment of anomalies at the start of the exercise (instantiation), preventing problems from being discovered midway through the exercise and preventing it from being unable to continue.
[0060] Specifically, a directed acyclic graph is called a DAG (Directed Acyclic Graph). A DAG is a graph where every edge has a direction and there are no cycles. In this scheme, it refers to a process (parallel or serial). The process involves obtaining the DAG dependencies (e.g., Dag1-Dag2-Dag3-Dag4) and the node dependencies of each node in the DAG. Based on these dependencies, the dependencies of each node in the DAG can be determined. Then, based on the dependencies of each node in the DAG, the DAGs are merged to generate the corresponding serial DAG. For example, [the following is a separate, unrelated sentence:] Figure 3 After Dag1 and Dag2 in the DAG are decomposed, the final result is as follows: Figure 5 The DAG shown, after instantiation, does not require consideration of the scheduling of child nodes Dag1, Dag2, Dag3...; it is treated as a single DAG. For example, before merging, it looks like this: Figure 3 The Dag2 configuration shown depends on Dag1. When merging into a single Dag, the dependency points (Dag2-A1, Dag2-A2, Dag2-A3) of Dag2 need to be replaced with (Dag1-B1…B3) of Dag1. After the replacement, the process can be scheduled using the single Dag scheduling method.
[0061] Step S20: When executing the target DAG in the serial DAG, determine whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, based on the DAG dependency relationship and the node dependency relationship.
[0062] In this embodiment, each DAG in the serial DAG is executed sequentially, that is, each DAG in the serial DAG is used as the target DAG in turn. When executing the target DAG in the serial DAG, the previous DAG of the target DAG is determined according to the DAG dependency relationship. According to the node dependency relationship corresponding to each node in the DAG, the execution status of all nodes in the previous DAG is determined, that is, it is determined whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed.
[0063] Step S30: If all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, then the target DAG is scheduled and executed in order to schedule and execute all nodes of the DAG in the serial DAG.
[0064] Since all Dags are not instantiated at the beginning, there is a possibility that instantiation errors may occur during the instantiation of Dags later. Therefore, the existing scheme with two or more nested Dags is prone to instantiation errors due to dependencies, which can lead to interruptions in the scheduling process and require manual intervention. In this embodiment, the target DAG is scheduled and executed only after all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed. This ensures the individual execution of each DAG and completes the nodes of all DAGs in the serial DAG sequentially. If a node of the previous DAG corresponding to the target DAG has not been scheduled and executed, the process continues to wait until the incomplete nodes of the previous DAG corresponding to the target DAG have been executed before the target DAG is scheduled and executed.
[0065] This embodiment provides a node merging and scheduling method. It obtains the DAG dependencies of each directed acyclic graph (DAG) and the node dependencies of each node within the DAG. Based on these dependencies, a corresponding serial DAG is generated. When executing a target DAG within the serial DAG, it determines whether all nodes in the preceding DAG have been scheduled and executed, based on the DAG and node dependencies. If all nodes in the preceding DAG have been scheduled and executed, the target DAG is then scheduled and executed, thereby scheduling and executing all nodes in the serial DAG. Through this method, the present invention merges multiple DAGs into a single serial DAG based on DAG and node dependencies, avoiding nested DAGs, simplifying the scheduling code logic, improving the development efficiency of the scheduling code, and solving the technical problems of high complexity and low development efficiency in existing scheduling code logic.
[0066] Furthermore, based on the first embodiment of the node merging and scheduling method of the present invention, a second embodiment of the node merging and scheduling method of the present invention is proposed.
[0067] In this embodiment, after step S10, the method further includes:
[0068] When a multi-task DAG with a parallel node as its end node is detected in the serial DAG, after the end node of the multi-task DAG is scheduled and executed, an end identifier is set after the end node of the multi-task DAG to indicate that the scheduling and execution of all nodes of the multi-task DAG has been completed. The end identifier may include an end placeholder or a virtual node.
[0069] In Example 1, as Figure 5 As shown, when there are multiple ending nodes in Dag1, such as Dag1-B1, Dag1-B2, and Dag1-B3 being parallel nodes, Dag1 is a multi-task DAG. The first nodes of Dag2, Dag2-A1, Dag2-A2, and Dag2-A3, need to traverse and check the execution results of the last nodes of Dag1, Dag1-B1, Dag1-B2, and Dag1-B3, respectively. In this embodiment, to facilitate checking whether all nodes of the previous DAG have been executed, if the last step of a Dag is detected to be multi-task parallel, an end marker, such as an end placeholder or a virtual node, is added to the end of the ending node after the parallel execution is completed. The end placeholder (virtual node) does not process anything in the process node to facilitate the connection with subsequent Dags. If an end placeholder (virtual node) is found, the process automatically skips to execute the nodes in the next Dag. The specific explanations for two-layer and multi-layer Dags are as follows:
[0070] 1. For example Figure 6 As shown, a complex two-layer, multi-DAG scene is converted into a single DAG, and virtual nodes are added to specific DAGs, such as... Figure 3 The DAG shown is ultimately generated by splitting Dag1 and Dag2 as follows: Figure 6 The DAG shown does not require scheduling of child nodes such as Dag1, Dag2, Dag3, etc. after instantiation; it is treated as a single DAG.
[0071] 2. For example Figure 7 As shown, Dag1-B1 is a 3-node task. After merging them into a serial DAG, as follows: Figure 8 As shown, Dag1-B1 is replaced by the dashed line portion.
[0072] By adding virtual nodes after all the end nodes of Dag1 have completed execution, the above method facilitates the connection between Dags. Each Dag only needs one node to connect with the first node of the next Dag. For example, Dag2-A1, Dag2-A2, Dag2-A3, and Dag3 depend on virtual nodes, instead of depending on Dag1-B1, Dag1-B2, and Dag1-B3 respectively. Furthermore, merging multiple Dags into a single Dag facilitates integration with third-party workflow engines. Combining multiple Dags into a single Dag only requires one instantiation, allowing for early detection of configuration anomalies in certain Dags during instantiation.
[0073] Specifically, step S20 includes:
[0074] When executing the target DAG in the serial DAG, the previous DAG corresponding to the target DAG is determined according to the DAG dependency relationship and the node dependency relationship;
[0075] When the previous DAG corresponding to the target DAG is a multi-task DAG, determine whether the end identifier exists after the end node of the previous DAG corresponding to the target DAG, so as to determine whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed.
[0076] In this embodiment, by adding an end placeholder, the execution status of the node in the previous DAG can be determined by judging only one end placeholder, thus improving the query efficiency of the node execution status of the previous DAG. That is, when executing the target DAG in the serial DAG, the previous DAG corresponding to the target DAG is determined according to the DAG dependency relationship and the node dependency relationship. If the previous DAG is a single-task DAG, that is, the end node is a single node, the execution status of the single node can be checked to see if it has been completed. If the previous DAG is a multi-task DAG, the existence of the end marker after the end node of the previous DAG is checked. If the end marker exists, it means that all nodes of the previous DAG have been completed.
[0077] In this embodiment, since a single Dag is synthesized from multiple Dags, it only needs to be instantiated once. Any abnormal Dag configurations can be detected before instantiation. This embodiment does not interfere with the configuration and supports configuration in multi-Dag scenarios. Through flattening or dimensionality reduction methods, the user-configured multi-Dag configuration is transformed into a single Dag instance. In scenarios where multiple nodes depend on multiple nodes, this embodiment adds virtual nodes to ensure that multiple nodes depend on a single node, and a single node depends on multiple nodes (i.e., one-to-many), simplifying the dependency relationship and thus reducing the probability of instantiation errors.
[0078] Furthermore, the node merging and scheduling method also includes:
[0079] Determine whether there are two consecutive end markers in the serial DAG;
[0080] If there are two consecutive end identifiers in the serial DAG, then delete one of the two consecutive end placeholders.
[0081] In this embodiment, the end identifier after the end node is used to indicate that the DAG of that node has been fully executed. Therefore, a DAG only needs one end identifier. If two consecutive end identifiers are detected in the serial DAG, that is, one of the end identifiers is invalid, one of the two consecutive end placeholders is deleted.
[0082] Furthermore, the node merging and scheduling method also includes:
[0083] Determine whether the parallel end node in the multi-task DAG corresponds to two or more end identifiers;
[0084] If the parallel termination node in the multi-task DAG corresponds to two or more termination identifiers, then the two or more termination identifiers corresponding to the parallel termination node are merged into one termination identifier.
[0085] In this embodiment, the end marker after the end node is used to indicate that the DAG of that node has been fully executed. Therefore, the corresponding end marker can only be added after all the parallel end nodes in the multi-task DAG have been fully executed. Therefore, if it is detected that a parallel end node in the multi-task DAG corresponds to two or more end markers, the two or more end markers corresponding to the parallel end node are merged into one end marker, which is then used as the end marker for the multi-task DAG.
[0086] The present invention also provides a node merging and scheduling device, the node merging and scheduling device comprising:
[0087] The DAG serial merging module is used to obtain the DAG dependency relationship of each directed acyclic graph (DAG) and the node dependency relationship of each node in the DAG, and merge them to generate the corresponding serial DAG based on the DAG dependency relationship and the node dependency relationship.
[0088] The DAG execution judgment module is used to determine, when executing the target DAG in the serial DAG, whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, based on the DAG dependency relationship and the node dependency relationship.
[0089] The DAG execution scheduling module is used to schedule the execution of the target DAG if all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, so as to schedule and execute all nodes of the DAG in the serial DAG.
[0090] Furthermore, the node merging and scheduling device also includes an end identifier adding module, which is used for:
[0091] When a multi-task DAG with a parallel node as the end node is detected in the serial DAG, after the end node of the multi-task DAG is scheduled and executed, an end flag is set after the end node of the multi-task DAG to indicate that the scheduling and execution of all nodes of the multi-task DAG has been completed.
[0092] Furthermore, the end identifier includes an end placeholder or a virtual node.
[0093] Furthermore, the DAG execution judgment module specifically includes:
[0094] The upper DAG determination unit is used to determine the previous DAG corresponding to the target DAG based on the DAG dependency relationship and the node dependency relationship when executing the target DAG in the serial DAG;
[0095] The end identifier determination unit is used to determine whether the end identifier exists after the end node of the previous DAG corresponding to the target DAG when the previous DAG is a multi-task DAG, so as to determine whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed.
[0096] Furthermore, the node merging and scheduling device also includes a connected placeholder deletion module, which is used for:
[0097] Determine whether there are two consecutive end markers in the serial DAG;
[0098] If there are two consecutive end identifiers in the serial DAG, then delete one of the two consecutive end placeholders.
[0099] Furthermore, the node merging and scheduling device also includes a parallel placeholder merging module, which is used for:
[0100] Determine whether the parallel end node in the multi-task DAG corresponds to two or more end identifiers;
[0101] If the parallel termination node in the multi-task DAG corresponds to two or more termination identifiers, then the two or more termination identifiers corresponding to the parallel termination node are merged into one termination identifier.
[0102] The methods executed by the above-mentioned program modules can be referred to in the various embodiments of the node merging and scheduling method of the present invention, and will not be repeated here.
[0103] The present invention also provides a computer-readable storage medium.
[0104] The present invention provides a computer-readable storage medium storing a node merging scheduler, which, when executed by a processor, implements the steps of the node merging scheduler method described above.
[0105] The method implemented when the node merging scheduler running on the processor is executed can be referred to in various embodiments of the node merging scheduler method of the present invention, and will not be repeated here.
[0106] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0107] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0108] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0109] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A node merging and scheduling method, characterized in that, The node merging and scheduling method includes the following steps: Obtain the DAG dependencies and node dependencies of each node in each DAG, and merge them to generate a corresponding serial DAG based on the DAG dependencies and node dependencies; wherein, merging the DAGs to generate the corresponding serial DAG based on the DAG dependencies and node dependencies includes determining the dependencies of each node in the DAG based on the DAG dependencies and node dependencies, and merging the DAGs to generate the corresponding serial DAG based on the dependencies of each node in the DAG; When executing the target DAG in the serial DAG, it is determined whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, based on the DAG dependency relationship and the node dependency relationship. If all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, then the target DAG will be scheduled and executed, so as to schedule and execute all nodes of the DAG in the serial DAG; In the case where there are multiple nodes in the serial DAG that depend on multiple nodes, a virtual node is added after the multiple nodes to ensure that multiple nodes depend on a single node and a single node depends on multiple nodes.
2. The node merging and scheduling method as described in claim 1, characterized in that, After the step of obtaining the DAG dependencies and node dependencies of each DAG, and merging them to generate the corresponding serial DAG based on the DAG dependencies and node dependencies, the method further includes: When a multi-task DAG with a parallel node as the end node is detected in the serial DAG, after the end node of the multi-task DAG is scheduled and executed, an end flag is set after the end node of the multi-task DAG to indicate that the scheduling and execution of all nodes of the multi-task DAG has been completed.
3. The node merging and scheduling method as described in claim 2, characterized in that, The end identifier includes an end placeholder or a virtual node.
4. The node merging and scheduling method as described in claim 2, characterized in that, The step of determining whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed completely, based on the DAG dependency relationship and node dependency relationship, when executing the target DAG in the serial DAG, specifically includes: When executing the target DAG in the serial DAG, the previous DAG corresponding to the target DAG is determined according to the DAG dependency relationship and the node dependency relationship; When the previous DAG corresponding to the target DAG is a multi-task DAG, determine whether the end identifier exists after the end node of the previous DAG corresponding to the target DAG, so as to determine whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed.
5. The node merging and scheduling method as described in claim 2, characterized in that, The node merging and scheduling method further includes: Determine whether there are two consecutive end markers in the serial DAG; If there are two consecutive end identifiers in the serial DAG, then delete one of the two consecutive end placeholders.
6. The node merging and scheduling method according to any one of claims 2-5, characterized in that, The node merging and scheduling method further includes: Determine whether the parallel end node in the multi-task DAG corresponds to two or more end identifiers; If the parallel termination node in the multi-task DAG corresponds to two or more termination identifiers, then the two or more termination identifiers corresponding to the parallel termination node are merged into one termination identifier.
7. A node merging and scheduling device, characterized in that, The node merging and scheduling device includes: The DAG serial merging module is used to obtain the DAG dependencies and node dependencies of each node in each DAG, and to merge them into a corresponding serial DAG based on the DAG dependencies and node dependencies. Specifically, merging the DAGs into a serial DAG based on the DAG dependencies and node dependencies includes determining the dependencies of each node in the DAG based on the DAG dependencies and node dependencies, and merging the DAGs into a corresponding serial DAG based on the dependencies of each node in the DAG. The DAG execution judgment module is used to determine, when executing the target DAG in the serial DAG, whether all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, based on the DAG dependency relationship and the node dependency relationship. The DAG execution scheduling module is used to schedule the execution of the target DAG if all nodes of the previous DAG corresponding to the target DAG have been scheduled and executed, so as to schedule and execute all nodes of the DAG in the serial DAG. In the case where there are multiple nodes in the serial DAG that depend on multiple nodes, a virtual node is added after the multiple nodes to ensure that multiple nodes depend on a single node and a single node depends on multiple nodes.
8. The node merging and scheduling device as described in claim 7, characterized in that, The node merging and scheduling device further includes an end identifier adding module, which is used for: When a multi-task DAG with a parallel node as the end node is detected in the serial DAG, after the end node of the multi-task DAG is scheduled and executed, an end flag is set after the end node of the multi-task DAG to indicate that the scheduling and execution of all nodes of the multi-task DAG has been completed.
9. A node merging and scheduling device, characterized in that, The node merging and scheduling device includes: a memory, a processor, and a node merging and scheduling program stored in the memory and executable on the processor. When the node merging and scheduling program is executed by the processor, it implements the steps of the node merging and scheduling method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a node merging scheduler, which, when executed by a processor, implements the steps of the node merging scheduler method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
A method for scheduling an application task based on a big data behavior, server and storage medium
CN109901926A
Data parallel job scheduling method based on branch DAG dependency
CN110275765A