Task control methods, task control devices, computer equipment, and storage media

By calculating task complexity parameters and estimated completion time, task allocation is optimized, which solves the problem of resource waste in task scheduling, improves task execution efficiency, and ensures that tasks with high complexity are executed on servers with sufficient resources.

CN117762591BActive Publication Date: 2024-09-03GRG BANKING IT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311787834.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-22
Publication Date
2024-09-03
Estimated Expiration
2043-12-22

AI Technical Summary

Technical Problem

During task scheduling, it is difficult for the existing technology to fully utilize server resources, resulting in low task execution efficiency. In particular, tasks at the same level are highly correlated, causing simple tasks to be assigned to servers with more available resources for execution, resulting in a waste of resources.

Method used

By calculating the complexity parameters of the task, the task is assigned to the appropriate server based on the task's scale and difficulty information, and the execution order is determined based on the estimated completion time of the task to ensure that tasks with high complexity are assigned to the server with the most available resources for execution.

Benefits of technology

Make full use of server resources, improve task execution efficiency, reduce waiting time, ensure that complex tasks are executed on servers with sufficient resources, and improve overall task execution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117762591B
    Figure CN117762591B
Patent Text Reader

Abstract

The present application discloses a task control method, a task control device, a computer device and a non-volatile computer-readable storage medium. The method includes: calculating the complexity parameters of multiple tasks at the target functional level, the complexity parameters of each task are determined according to at least one of the scale information and difficulty information of each task, and the target functional level is any level among the preset multiple functional levels; according to the complexity parameters and the available resources of each server, each task is assigned to the corresponding server; according to the scale information of each task, the estimated completion time of each task is calculated, and according to the estimated completion time of each task, the execution order of the assigned tasks in each server is determined. By sequentially assigning the most complex tasks to the server with the most available resources, the server resources are fully utilized and the execution efficiency of each task is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of task scheduling, and more specifically, to a task control method, a task control apparatus, a computer device, and a non-volatile computer-readable storage medium. Background Art

[0002] At present, when the system performs task scheduling, it is generally divided into multiple preset functional levels. Due to the strong correlation between tasks at the same level (such as the same database level), when performing task scheduling, multiple tasks at the same level are generally scheduled centrally, so as to realize the scheduling and execution of tasks at each level. Therefore, how to improve the efficiency of task execution at each level is an urgent problem to be solved. Summary of the invention

[0003] The embodiments of the present application provide a task control method, a task control apparatus, a computer device and a non-volatile computer-readable storage medium, which can improve the task execution efficiency.

[0004] The task control method of the implementation mode of the present application includes calculating complexity parameters of multiple tasks of a target functional level, the complexity parameters of each task are determined according to at least one of the scale information and difficulty information of each task, and the target functional level is any level among the preset multiple functional levels; according to the complexity parameters and the available resources of each server, each task is allocated to the corresponding server; according to the scale information of each task, the estimated completion time of each task is calculated, and according to the estimated completion time of each task, the execution order of the tasks allocated to each server is determined.

[0005] The task control device of the implementation mode of the present application includes a calculation module and a cyclic allocation module. The calculation module is used to calculate the complexity parameters of multiple tasks of the target functional level, and the complexity parameters of each task are determined according to at least one of the scale information and difficulty information of each task, and the target functional level is any level among the preset multiple functional levels; the cyclic allocation module is used to form multiple tasks into the task pool, and the target task with the largest complexity parameter is allocated to the target server with the most available resources, the target task is any one of the multiple tasks, and the target server is any one of the servers; after the target task allocation is completed, the target task is removed from the task pool, and the step of forming multiple tasks into the task pool and allocating the target task with the largest complexity parameter to the target server with the most available resources is entered again.

[0006] The computer device of the embodiment of the present application includes a processor, a memory and a computer program, wherein the computer program is stored in the memory and executed by the processor, and the computer program includes instructions for executing the task control method described in the above embodiment.

[0007] The non-volatile computer-readable storage medium of the embodiment of the present application includes a computer program. When the computer program is executed by a processor, the processor executes the task control method described in the above embodiment.

[0008] In the task control method, task control device, computer equipment and computer-readable storage medium of the implementation mode of the present application, by accurately calculating the complexity parameters (related to the scale of the task and the difficulty of the operations involved in the task) of each task in the target functional level (i.e., any level in the preset functional levels), each task is assigned to a suitable server according to the complexity of the task and the available resources of the server. For example, the tasks with the highest complexity are assigned to the server with the most available resources in turn, thereby making full use of server resources and improving the execution efficiency of each task.

[0009] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0011] Figure 1 is a flowchart of a task control method of certain implementation modes of the present application;

[0012] Figure 2 is a flowchart of a task control method of certain implementation modes of the present application;

[0013] Figure 3 is a flowchart of a task control method of certain implementation modes of the present application;

[0014] Figure 4 is a flowchart of a task control method of certain implementation modes of the present application;

[0015] Figure 5 is a flowchart of a task control method of certain implementation modes of the present application;

[0016] Figure 6 is a flowchart of a task control method of certain implementation modes of the present application;

[0017] Figure 7is a schematic diagram of the principle of a task control method of certain embodiments of the present application;

[0018] Figure 8 is a schematic diagram of the principle of a task control method of certain embodiments of the present application;

[0019] Fig. 9 is a schematic diagram of a module of a model generation device in certain embodiments of the present application;

[0020] Fig.10 is a schematic diagram of the structure of a computer device of certain embodiments of the present application;

[0021] Fig.11 It is a schematic diagram of the connection status of a non-volatile computer-readable storage medium and a processor in certain embodiments of the present application. DETAILED DESCRIPTION

[0022] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the embodiments of the present application.

[0023] An embodiment of the present application provides a task control method.

[0024] The task control method of this application will be described in detail below:

[0025] See also Figure 1 , the embodiment of the present application provides a task control method, the task control method comprising:

[0026] Step 011: Calculate the complexity parameters of multiple tasks of the target functional level, the complexity parameters of each task are determined according to at least one of the scale information and the difficulty information of each task, and the target functional level is any level of the preset multiple functional levels;

[0027] The target functional level is any one of a plurality of preset functional levels, and different preset functional levels can be used to perform different types of tasks.

[0028] Functional hierarchy division can be based on database hierarchy. For example, the functional hierarchy is divided into: ODS (Operational Data Store, data introduction layer) -> DWD (Data Warehouse Detail, data detail layer) -> DWS (Data Warehouse Service, data service layer) -> ADS (Application Data Service, data application layer) and other levels. In this case, the target functional hierarchy is any level among ODS, DWD, DWS and ADS. For another example, the functional hierarchy is divided into data source -> source layer -> standard layer -> basic layer -> theme layer -> service layer -> application layer). In this case, the target functional hierarchy is any level among data source, source layer, standard layer, basic layer, theme layer, service layer and application layer.

[0029] Specifically, when performing task scheduling, the complexity parameters of each task at the target functional level to be scheduled are first calculated.

[0030] Among them, the complexity parameter of the task can be determined based on at least one of the scale information and difficulty information of the task. For example, the larger the scale of the task (such as the number of tables in the task), the higher the complexity; the more complex the operations involved in the task (such as database operations, the number of edge connection operations, etc.), that is, the higher the difficulty of the task, the higher the complexity.

[0031] The complexity parameter may be positively correlated with the complexity of the task, that is, the higher the complexity of the task, the larger the complexity parameter.

[0032] Step 012: Multiple tasks are formed into a task pool, and the target task with the largest complexity parameter is assigned to the target server with the most available resources. The target task is any one of the multiple tasks, and the target server is any one of the servers.

[0033] Step 013: After the target task is assigned, the target task is removed from the task pool, and the process proceeds to step 011 again: multiple tasks are formed into a task pool, and the target task with the largest complexity parameter is assigned to the target server with the most available resources.

[0034] Specifically, after determining the complexity parameters of each task at the target functional level, each task may be allocated cyclically until all tasks are allocated and completed.

[0035] During cyclic allocation, the target task with the largest complexity parameter in the task pool formed by multiple tasks can be allocated to the target server with the most available resources.

[0036] When determining the target task, the task with the largest complexity parameter can be found according to the complexity parameters of each task in the task pool as the target task. Then, when determining the target server, the available resources of each server can be obtained, and then the server with the largest available resources can be found as the target server.

[0037] The available resources of each server may be calculated based on the available memory, available hard disk, preset communication distance and network bandwidth of each server.

[0038] For example, the weights of available memory, available hard disk, preset communication distance and network bandwidth are k1, k2, k3 and k4 respectively. In one embodiment, the available resources of the server = (k1*available memory+k2*available hard disk)*(k3*communication distance+k4*network bandwidth).

[0039] After the target task is assigned, the assigned target task is removed from the task pool, and then the target task with the largest complexity parameter is re-determined in the updated task pool, and the available resources of each server are re-acquired to re-determine the target server with the largest available resources, and then the re-determined target task is again assigned to the target server, and this cycle is repeated until the task pool is empty.

[0040] At present, due to the strong correlation between tasks at the same level (such as the same database level), when scheduling tasks, multiple tasks at the same level are generally scheduled centrally, so as to realize the scheduling and execution of tasks at each level.

[0041] However, when scheduling multiple tasks at the same level, they are generally scheduled based on server resources, and the tasks are scheduled to the server with the most available resources without considering the complexity of the tasks themselves. As a result, simple tasks are also assigned to servers with more available resources for execution, resulting in a waste of limited server resources. It is difficult to fully utilize the available resources of each server, resulting in low execution efficiency of each task.

[0042] In this implementation, when performing task allocation, the complexity of the tasks is fully taken into consideration, and the tasks with the greatest complexity are cyclically allocated to the server with the largest available resources, thereby making full use of server resources. Tasks with high complexity are executed on servers with more available resources, and server resources are fully utilized to improve the execution efficiency of tasks with high complexity, thereby achieving improved execution efficiency of each task.

[0043] See also Figure 2 In some embodiments, step 011: calculating the complexity parameters of multiple tasks at the target functional level, including:

[0044] Step 0111: Determine the current scale parameter of each task according to the number of tables and the number of data rows used by each task;

[0045] Step 0112: Calculate the scale information of each task according to the current scale information of each task and the preset initial scale parameters;

[0046] Step 0113: Determine the difficulty information of each task according to the database operation, table connection operation and aggregation operation of each task;

[0047] Step 0114: Determine the complexity parameters of each task based on the scale information and difficulty information involved in each task.

[0048] Specifically, when determining the scale information of each task, first obtain the quantity and number of tables used by each task, then obtain the number of rows of data that each task needs to read, and then calculate the current scale parameter of each task based on the quantity and number of data rows. The quantity and number of data rows are both proportional to the current scale parameter. That is to say, the larger the quantity and number of data rows, the larger the current scale parameter, that is, the larger the scale.

[0049] Optionally, the current scale parameter can be calculated based on the weighted sum of the quantity sum and the number of data rows. For example, if the weight of the quantity sum is k1 and the weight of the number of data rows is k2, the current scale parameter = k1*the quantity sum+k2*the number of data rows.

[0050] Among them, k1 and k2 are empirical values ​​and can be determined according to actual needs. It is only necessary to ensure that k1+k2 is equal to 1.

[0051] In addition, there may be errors in the calculation of the current scale parameters. When determining the scale information of each task, the initial scale parameters of each task also need to be considered. Each task has a preset initial scale parameter, which can be determined based on the actual scale parameters of the task during historical execution (such as the average of the actual scale parameters of multiple executions of the task in history).

[0052] By combining the current scale parameters and initial scale parameters of each task, the scale information of each task can be calculated. For example, the average of the current scale parameters and initial scale parameters of each task is determined to be the scale information of each task.

[0053] After determining the scale information of each task, it is also necessary to obtain the difficulty information of each task. It can be understood that the more complex the operations involved in the task, the more difficult it is to execute the task.

[0054] Therefore, the difficulty information of each task can be determined according to the database operation, table connection operation and aggregation operation of each task.

[0055] Among them, different types of database operations have different task difficulties. Therefore, the first difficulty parameter can be determined according to the type of data operation. For example, the first difficulty parameter corresponding to the database query language (such as select) is n1; the first difficulty parameter corresponding to the database operation language (such as insert, delete, update) is n2; the first difficulty parameter corresponding to the database definition language (such as create, drop, alter, etc.) is n3. n1, n2 and n3 are all empirical values ​​and can be set according to actual conditions to accurately calculate the task difficulty. .

[0056] The more times table join operations (such as inner inner join, left outer join, right outer join, full outer join, cross join, etc.) are performed, the greater the task difficulty. In other words, the number of table join operations is proportional to the task difficulty, and the corresponding second difficulty parameter can be determined according to the number of table join operations of each type.

[0057] The more times the aggregation operation is performed, the greater the difficulty of the task. In other words, the number of aggregation operations is proportional to the difficulty of the task, and the corresponding third difficulty parameter can be determined according to the number of aggregation operations.

[0058] Among them, the mapping relationship between the second difficulty parameter and the number of table connections of each type, and the mapping relationship between the third difficulty parameter and the number of aggregation operations are both preset and can be set according to actual conditions to accurately calculate the task difficulty.

[0059] After determining the first difficulty parameter, the second difficulty parameter and the third difficulty parameter, the difficulty information of each task can be calculated according to the first difficulty parameter, the second difficulty parameter and the third difficulty parameter. For example, the first difficulty parameter, the second difficulty parameter and the third difficulty parameter of each task are weighted and summed to obtain the difficulty information of each task; or, the value of the difficulty information = first difficulty parameter * second difficulty parameter + third difficulty parameter.

[0060] Finally, according to the scale information and difficulty information of each task, the complexity parameters of each task are determined respectively, such as complexity parameter = scale information * difficulty information.

[0061] In this way, the scale of each task can be accurately determined through the number of labels, the number of data rows, and the initial scale parameters, and the difficulty of each task can be accurately determined through database operations, table connection operations, and aggregation operations. Therefore, the complexity of each task can be accurately determined based on the scale and difficulty of each task.

[0062] See also Figure 3 In some embodiments, the method further comprises:

[0063] Step 014: Calculate the estimated completion time of each task according to the scale information of each task, and determine the execution order of the tasks assigned to each server according to the estimated completion time of each task.

[0064] Specifically, after allocating each task to the server (such as after all tasks are allocated, or after some tasks are allocated), it is necessary to determine the execution order of each task allocated in the server, so as to further improve the task execution efficiency.

[0065] Therefore, the estimated completion time of each task can be calculated according to the scale information of each task assigned to each server.

[0066] Optionally, the larger the size of the task, the longer the estimated completion time.

[0067] Optionally, the first parameter is calculated according to the initial scale parameter; the second parameter is calculated according to the current scale parameter and the initial scale parameter respectively; the third parameter is determined according to the current network fluctuation value; and the estimated completion time of each task is calculated according to the first parameter, second parameter and third parameter corresponding to each task respectively.

[0068] Specifically, there is a preset mapping relationship between the initial scale parameter and the first parameter. For example, the larger the initial scale parameter, the larger the first parameter. The second parameter can be determined according to the ratio of the current scale parameter to the initial scale parameter. If the ratio is larger, the second parameter is larger. For example, if the ratio of the current scale parameter to the initial scale parameter is S, the second parameter = S. N , N is the number of fields (such as 2, 3, etc.). The third parameter may be proportional to the network fluctuation value, such as the third parameter = network fluctuation value.

[0069] It can be understood that the larger the scale of the task and the greater the network fluctuation value, the longer the time required to complete the task. Therefore, the estimated completion time may be proportional to the first parameter, the second parameter and the third parameter, such as estimated completion time = first parameter + second parameter + third parameter.

[0070] When calculating the estimated completion time, the initial scale parameters of the task, the current scale parameters of the task, and the current network fluctuation value are taken into account at the same time to accurately calculate the estimated completion time of each task.

[0071] Among them, network fluctuations are fluctuations caused by network link reasons (such as fiber optic connector failure, congestion or delay, etc.), usually due to network transmission delays, port rate settings, queue backlogs of data packets, configuration of firewalls and other devices, etc., resulting in low transmission efficiency and high latency. The network fluctuation value can be used to represent transmission efficiency and latency.

[0072] When the preset completion time of each task is determined, the execution order of the tasks assigned to each server can be determined based on the estimated completion time of each task. If the estimated completion time is shorter, the execution order is higher, that is, the task with the shorter estimated completion time is executed first.

[0073] Compared with executing the task with a longer estimated completion time first, which causes other unexecuted tasks to wait for a longer time, the waiting time of each task can be reduced, and multiple tasks can be completed quickly in a shorter time.

[0074] See also Figure 4 In some implementations, step 014: determining the execution order of the tasks assigned to each server according to the estimated completion time of each task, includes:

[0075] Step 0141: among the tasks allocated to each server, each task with a dependency relationship is regarded as a task node, and each task without a dependency relationship is regarded as a task node;

[0076] Step 0142: Determine the execution order of the task nodes in each server according to the estimated completion time corresponding to each task node;

[0077] The method also includes:

[0078] Step 015: Execute each task node of each server according to the execution order of the task nodes of each server.

[0079] Specifically, taking into account the mutual influence of tasks with dependencies, among the tasks allocated to each server, each task with dependencies is regarded as a task node, and tasks without dependencies are regarded as a task node. The tasks can be divided into multiple task nodes that do not interfere with each other for scheduling.

[0080] Then, the estimated completion time of each task node is determined based on the sum of the estimated completion time of the tasks contained in each task node, and finally, the execution order of the task nodes in each server is determined based on the estimated completion time corresponding to each task node. After determining the execution order of each task node of each server, each task node can be scheduled to be executed according to the execution order to complete each task.

[0081] In this way, by dividing the tasks into multiple non-interfering task nodes for scheduling, the mutual influence between dependent tasks is avoided, which would cause the problem that tasks with an earlier execution order would be difficult to proceed smoothly because of their dependent tasks with a later execution order. This ensures the accuracy of task scheduling while improving the efficiency of task execution.

[0082] See also Figure 5In some embodiments, the method further comprises:

[0083] Step 016: Determine the first functional level corresponding to each task according to the database involved in each task;

[0084] Step 017: Determine the second functional level corresponding to each task according to the historical task operation information;

[0085] Step 018: Determine the target functional level corresponding to each task based on the first functional level and the second functional level.

[0086] Specifically, the research hotspots of assisting in the automatic configuration of DAG (Directed acyclic graph) connections involve multiple fields, including optimization algorithms, machine learning, and big data processing:

[0087] Optimization algorithms: Researchers focus on how to use traditional optimization algorithms such as evolutionary algorithms, genetic algorithms, simulated annealing algorithms, and emerging algorithms such as deep reinforcement learning to achieve automatic configuration and optimization of DAG connections.

[0088] Machine learning and deep learning: Using machine learning and deep learning technologies, we study how to automatically identify and construct DAG structures suitable for specific tasks by learning large-scale data sets, thereby realizing intelligent configuration of DAG connections.

[0089] Big data processing: As the demand for big data processing continues to grow, researchers are committed to seeking more efficient and intelligent DAG connection configuration methods to meet the needs of large-scale data processing tasks, including data cleaning, data analysis, machine learning training, etc.

[0090] Automated operation and maintenance: Researchers focus on how to use automated operation and maintenance technology to achieve real-time monitoring, fault handling, and dynamic adjustment of DAG connections, thereby improving the stability and reliability of the system.

[0091] Distributed computing: With the widespread application of distributed computing frameworks, researchers are committed to studying how to automatically configure DAG connections in a distributed environment to optimize the utilization of computing resources and the efficiency of task execution.

[0092] At present, when conducting DAG, some auxiliary algorithms (such as graph theory algorithms, constraint solving algorithms, artificial intelligence algorithms, etc.) are generally used to help developers build, optimize and manage complex DAG graphs. However, it still takes a lot of manpower to manually connect tasks, and the probability of human error is high, resulting in low accuracy of DAG graphs.

[0093] Therefore, for a large number of tasks, how to realize automatic configuration connection through DAG and reduce the frequency of manual operations, thereby improving the accuracy of DAG graph construction, and thus completing the construction of DAG graph efficiently and accurately to improve task execution efficiency, is an urgent problem to be solved.

[0094] When performing DAG, each task needs to be divided into functional levels first. The accuracy of the division of the functional levels corresponding to the tasks will affect the connection effect of DAG. Accurately dividing the functional levels corresponding to the tasks will help improve the connection accuracy of tasks in each functional level.

[0095] When dividing each task into functional levels, this embodiment first divides each task into a first functional level according to the database involved in each task.

[0096] For example, the preset multiple functional levels include ODS, DWD, DWS and ADS, and each functional level is configured with a corresponding independent server or server cluster, in which specific database tables are stored. Therefore, according to the library name of the database involved in the task, the server corresponding to the database can be determined, thereby determining the first functional level of the task pair.

[0097] Then, based on the historical task running information, the second functional level corresponding to each task is divided. For example, the second functional level corresponding to each task can be determined according to the functional level of each task in the historical running task information.

[0098] Optionally, the second functional level corresponding to each task is determined based on historical task operation information, including: counting the distribution of each task at each functional level in multiple historical task operation information to determine the probability of each task at each functional level, and determining that the functional level with the highest probability corresponding to each task is the second functional level of each task.

[0099] Specifically, when determining the second functional level corresponding to each task based on historical task operation information, you can first obtain multiple historical task operation information. Each historical task operation information includes information about the functional level of each task. By counting the distribution of each task at each functional level in multiple historical task operation information, the probability of each task at each functional level can be determined.

[0100] For example, if there are 5 historical task running information, and the preset multiple functional levels include ODS, DWD, DWS and ADS, and statistics show that task A belongs to ODS 4 times, DWD 1 time, DWS 0 times, and ADS 0 times, then it can be determined that the probability of task A belonging to the ODS level is 4 / 5=0.8, the probability of belonging to the DWD level is 1 / 5=0.2, the probability of belonging to the DWS level is 0, and the probability of belonging to the ADS level is 0.

[0101] After determining the probability of each task at each functional level, the functional level with the greatest probability can be used as the second functional level corresponding to the task, thereby determining the functional level corresponding to the task based on historical task operation information.

[0102] It can be understood that the greater the probability that a task belongs to the corresponding second functional level, the more accurate the second functional level is. Therefore, when the first functional level and the second functional level are comprehensively considered and the target functional level corresponding to each task is accurately determined, it can be determined whether the probability that the target task (which can be any task) belongs to the corresponding second functional level is greater than the preset probability; if so, the second functional level of the target task can be used as the target functional level of the target task; if not, it means that the second functional level determined by the historical task operation information is not accurate enough, and the first functional level corresponding to the target task is used as the target functional level of the target task.

[0103] In this way, by comprehensively considering the database involved in the task and the historical operation information of the task, the accuracy of the division of the target functional level corresponding to the task can be improved.

[0104] After accurately completing the division of the target functional level of the task, the tasks of each target functional level can be DAG-connected or scheduled, which can improve the accuracy of DAG connection and the efficiency of task execution.

[0105] See also Figure 6 In some embodiments, each task includes at least one of a common task, a conditional task, a judgment task, and a special task, and the method further includes:

[0106] Step 019: In the target function level, a common task is regarded as a task node, a conditional task and its associated task are regarded as a task node, and a judgment task and its associated task are regarded as a task node;

[0107] Step 020: Read the target task node at the head of the task queue formed by each task node;

[0108] Step 021: If the target task node does not have a predecessor task node, create a node queue and put the target task node into the node queue;

[0109] Step 022: If the target task node has a predecessor task node and each predecessor task node is in the node queue, the target task node is placed in the node queue where the corresponding predecessor task node is located, and the target task node is removed from the task queue;

[0110] Step 023: If the target task node has a predecessor task node and at least one predecessor task node is not in the node queue, the target task node is placed at the end of the task queue;

[0111] Step 024: Determine whether the task queue is empty or whether the number of cycles reaches a preset number threshold;

[0112] Step 025: If yes, put the special task into at least one of the head and tail of each node queue;

[0113] If not, the process proceeds again to the step of reading the target task node at the head of the task queue formed by each task node.

[0114] Specifically, the types of tasks include common tasks, conditional tasks, judgment tasks and special tasks.

[0115] Among them, there is no restriction on the connection order of ordinary tasks, which can be at the first, middle or end. The conditional task will select the target downstream task to execute from multiple downstream tasks according to the running status of the upstream task; the judgment task will select the branch task to be executed according to the value of the global variable and the preset judgment rules. Special nodes mainly include data aggregation nodes and data synchronization nodes. The data aggregation node is a node that aggregates or integrates data from different data sources. It is located at the first or last place in the functional hierarchy to which it belongs, while the data synchronization node is a node that ensures that the data between different data sources remain synchronized and consistent. It is also located at the first or last place in the functional hierarchy to which it belongs.

[0116] In order to realize the connection of any target functional level, the type of each task can be determined first, such as by reading the task information of the task (the task information includes the type of the task). When connecting, it is necessary to consider the mutual influence between the conditional task and the associated tasks of the conditional task, and the mutual influence between the judgment task and the associated tasks of the judgment task.

[0117] Therefore, to ensure the accuracy of the connection, ordinary tasks can be regarded as a task node, conditional tasks and their associated tasks can be regarded as a task node, and judgment tasks and their associated tasks can be regarded as a task node, thereby dividing each task into multiple independent task nodes.

[0118] Since special tasks are at the first or last place in their respective levels, you do not need to consider the connection of special tasks first. Instead, you can connect ordinary tasks, conditional tasks, and judgment tasks first, and then connect special tasks to the first or last place to complete the connection of the target functional level.

[0119] Multiple task nodes are randomly sorted to form a task queue. The target task node at the head of the task queue can be read, and then the node queue is assigned to the target task node. If the target task node does not have a predecessor task node, a new node queue is created and the target task node is placed at the head of the node queue. Multiple node queues can form a node queue set.

[0120] If the target task node has a predecessor task node and each predecessor task node is in the node queue, that is, all predecessor task nodes can be found in the node queue set, then the target task node is placed in each node queue where the corresponding predecessor task node is located. At this time, the target task node traversal is completed and the target task node can be removed from the task queue;

[0121] If the target task node has a predecessor task node and at least one predecessor task node is not in the node queue, that is, at least one predecessor task node of the target task node cannot be found in the node queue set, it is necessary to wait until the predecessor task nodes of the target task node are traversed before traversing the target task node. At this time, the target task node can be put at the end of the task queue again.

[0122] Each task node in the task queue is traversed in a loop until the task queue is empty, so that all task nodes in the task queue can be determined to be traversed. Or, due to unexpected failures that may occur during the traversal process, some task nodes cannot be traversed all the time, making the traversal fall into an endless loop, and continuing to traverse at this time, it is also impossible to make the task queue empty, therefore, when the number of cycles of traversal reaches the preset number of times threshold value (which is an empirical value, and under normal circumstances, the cycle input is less than the preset number of times threshold value), it is also tacitly assumed that the traversal is completed, and then subsequent connection operations are performed. And these task nodes that cannot be traversed are used as faulty task nodes, and the faulty task nodes are processed by humans, such as artificially connected.

[0123] After the task queue traversal is completed, the special tasks of the target functional level can be placed at the first or last place of each node queue, such as placing the data aggregation node at the first place and the data synchronization node at the last place.

[0124] In the node queue set corresponding to the target functional level obtained after the traversal is completed, each node queue in the node queue set is an ordered queue. According to each node queue in the node queue set, the sequential connection of each task node can be achieved.

[0125] Among them, the task nodes in the same node queue can be connected in sequence, and if the same task nodes exist in different node queues, the same multiple task nodes will serve as the same connection node, and the connection node will simultaneously connect the task nodes before and after the connection node in the corresponding multiple node queues.

[0126] For example, see Figure 7 , node queue 1 is {s, a1, a2, a3, a4, e}, and node queue 2 is {s, b1, a2, b2, b3, e}. See Figure 8 , the task node a3 in node queue 1 and node queue 2 is used as the same connection node, the data aggregation node s in node queue 1 and node queue 2 is used as the same connection node, and the data synchronization node e in node queue 1 and node queue 2 is used as the same connection node, connecting node queue 1 and node queue 2 together.

[0127] In this way, the connection of task nodes at each target functional level can be completed in sequence, thereby completing the automatic configuration of task nodes and generating the final DAG graph. This can reduce the frequency of manual connection operations on task nodes, which is beneficial to improving the DAG connection accuracy of task nodes, and obtaining the optimal execution order of task nodes at each target functional level, which can improve the accuracy and efficiency of task execution.

[0128] See also Fig. 9 In order to facilitate better implementation of the task control method of the embodiment of the present application, the embodiment of the present application also provides a task control device 10. The task control device 10 may include a calculation module 11 and a cyclic allocation module 12. The calculation module 11 is used to calculate the complexity parameters of multiple tasks of the target functional level, and the complexity parameters of each task are determined according to at least one of the scale information and difficulty information of each task, and the target functional level is any level of the preset multiple functional levels; the cyclic allocation module 12 is used to form a task pool with multiple tasks, and the target task with the largest complexity parameter is allocated to the target server with the most available resources. The target task is any one of the multiple tasks, and the target server is any one of the servers; after the target task is allocated, the target task is removed from the task pool, and the step of allocating the target task with the largest complexity parameter in the task pool with multiple tasks to the target server with the most available resources is entered again.

[0129] In some embodiments, the calculation module 11 is specifically used to determine the current scale parameters of each task based on the number of tables and the number of data rows used by each task; calculate the scale information of each task based on the current scale information of each task and the preset initial scale parameters; determine the difficulty information of each task based on the database operations, table connection operations and aggregation operations of each task; determine the complexity parameters of each task based on the scale information of each task and the difficulty information involved.

[0130] In some implementations, the calculation module 11 is further configured to calculate the available resources of each server according to the available memory, available hard disk, preset communication distance and network bandwidth of each server.

[0131] In some embodiments, the task control device 10 further includes a sorting module 13. The sorting module 13 is used to calculate the estimated completion time of each task according to the scale information of each task, and determine the execution order of the tasks assigned to each server according to the estimated completion time of each task.

[0132] In some embodiments, the scale information includes a current scale parameter and an initial scale parameter, and the sorting module 13 is specifically used to calculate a first parameter based on the initial scale parameter; calculate a second parameter based on the current scale parameter and the initial scale parameter respectively; determine a third parameter based on the current network fluctuation value; and calculate an estimated completion time for each task based on the first parameter, second parameter, and third parameter corresponding to each task.

[0133] In some embodiments, the sorting module 13 is specifically used to treat each task with a dependency relationship among the tasks assigned to each server as a task node, and to treat tasks without a dependency relationship as a task node; determine the execution order of the task nodes in each server according to the estimated completion time corresponding to each task node; the task control device 10 also includes an execution module 14, which is used to execute each task node of each server according to the execution order of the task nodes of each server.

[0134] In some embodiments, the task control device 10 also includes a hierarchical division module 15, which is used to determine the first functional level corresponding to each task based on the database involved in each task; determine the second functional level corresponding to each task based on historical task operation information; and determine the target functional level corresponding to each task based on the first functional level and the second functional level.

[0135] In some embodiments, the hierarchical division module 15 is specifically used to count the distribution of each task at each functional level in multiple historical task operation information to determine the probability of each task at each functional level, and determine that the functional level with the highest probability corresponding to each task is the second functional level of each task.

[0136] In certain embodiments, the hierarchical division module 15 is specifically used to determine the target functional level corresponding to each task based on the first functional level and the second functional level, including: when the second functional level and the first functional level of the target task are inconsistent, determining whether the probability of the second functional level is greater than a preset probability, and the target task is any one of the tasks; if so, determining the second functional level of the target task as the target functional level of the target task; if not, determining the first functional level of the target task as the target functional level of the target task.

[0137] In some embodiments, each task includes at least one of a common task, a conditional task, a judgment task, and a special task, and the task control device 10 also includes a node connection module 16 . The node connection module 16 is used to treat the ordinary task as a task node, the conditional task and the associated task of the conditional task as a task node, and the judgment task and the associated task of the judgment task as a task node in the target function level; read the target task node at the head of the task queue formed by each task node; if the target task node does not have a predecessor task node, create a node queue and put the target task node into the node queue; if the target task node has a predecessor task node and each predecessor task node is located in the node queue, put the target task node into the node queue where the corresponding predecessor task node is located, and remove the target task node from the task queue; if the target task node has a predecessor task node and at least one predecessor task node is not located in the node queue, put the target task node into the tail of the task queue; judge whether the task queue is empty or the number of loops reaches a preset number threshold; if so, put the special task into at least one of the head and tail of each node queue; if not, enter the step of reading the target task node at the head of the task queue formed by each task node again.

[0138] The task control device 10 is described above from the perspective of functional modules in conjunction with the accompanying drawings. The functional modules can be implemented in hardware form, can be implemented in software form, or can be implemented in combination with hardware and software modules. Specifically, the steps of the method embodiments in the embodiments of the present application can be completed by hardware integrated logic circuits in the processor and / or software form instructions. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware coding processor, or can be executed by a combination of hardware and software modules in the coding processor. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps in the above method embodiments in combination with its hardware.

[0139] The computer device of the embodiment of the present application includes a processor, a memory and a computer program, wherein the computer program is stored in the memory and executed by the processor, and the computer program includes instructions for executing the task control method of any of the above embodiments.

[0140] like Fig.10 As shown, the computer device is a terminal device 110; or, the computer device may be a server 120; or, the computer device may be a system composed of the terminal device 110 and the server 120.

[0141] In some possible implementations, Fig.10 The server 120 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. This embodiment of the application does not limit this.

[0142] Optionally, in the embodiment of the present application, the terminal device 110 may be a device that has a rich human-computer interaction mode, has the ability to access the Internet, is usually equipped with various operating systems, and has strong processing capabilities. The terminal device 110 may be a smart phone, smart glasses, a handheld terminal, a smart TV, a tablet computer, a car terminal, etc., but is not limited thereto.

[0143] In one achievable manner, the server 120 and the terminal device 110 may execute the task control method provided in the embodiment of the present application in an interactive manner, or the task control method provided in the embodiment of the present application may be executed by the terminal device 110 or the server 120.

[0144] See also Fig.11The embodiment of the present application also provides a computer-readable storage medium 600 on which a computer program 610 is stored. When the computer program 610 is executed by a processor 620, the steps of the task control method of any of the above-mentioned embodiments are implemented. For the sake of brevity, they are not repeated here.

[0145] In the description of this specification, the descriptions with reference to the terms "certain embodiments", "in an example", "exemplarily", etc., mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0146] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0147] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A task control method, characterized in that: include: Calculating complexity parameters of multiple tasks of a target functional level, wherein the complexity parameters of each task are determined according to at least one of scale information and difficulty information of each task, and the target functional level is any one of multiple preset functional levels; A plurality of tasks are formed into the task pool, and the target task with the largest complexity parameter is assigned to the target server with the most available resources, the target task is any one of the plurality of tasks, and the target server is any one of the servers; After the target task is assigned, the target task is removed from the task pool, and the step of forming the task pool with multiple tasks and assigning the target task with the largest complexity parameter to the target server with the most available resources is entered again; The method further comprises: determining a first functional level corresponding to each of the tasks according to a database involved in each of the tasks; Determine the second functional level corresponding to each of the tasks according to the historical task operation information; In the case where the second functional level of the target task is inconsistent with the first functional level, determining whether the probability of the second functional level is greater than a preset probability, the target task being any one of the tasks; If so, determining the second functional level of the target task as the target functional level of the target task; If not, determining the first functional level of the target task as the target functional level of the target task.

2. The task control method according to claim 1, characterized in that: The complexity parameters of multiple tasks at the target functional level are calculated, including: Determine the current scale parameter of each task according to the number of tables and the number of data rows used by each task; Calculating the scale information of each of the tasks according to the current scale information of each of the tasks and the preset initial scale parameters; Determining the difficulty information of each of the tasks respectively according to the database operation, table connection operation and aggregation operation of each of the tasks; The complexity parameter of each task is determined respectively according to the scale information and the difficulty information involved in each task.

3. The task control method according to claim 1, characterized in that: Also includes: The available resources of each server are calculated according to the available memory amount, available hard disk amount, preset communication distance and network bandwidth of each server.

4. The task control method according to claim 1, characterized in that: Also includes: The estimated completion time of each task is calculated according to the scale information of each task, and the execution order of the tasks assigned to each server is determined according to the estimated completion time of each task.

5. The task control method according to claim 4, characterized in that: The scale information includes a current scale parameter and an initial scale parameter, and the estimated completion time of each task is calculated according to the scale information of each task, including: Calculate a first parameter according to the initial scale parameter; Calculating a second parameter respectively according to the current scale parameter and the initial scale parameter; Determine the third parameter according to the current network fluctuation value; The estimated completion time of each task is calculated respectively according to the first parameter, the second parameter and the third parameter corresponding to each task.

6. The task control method according to claim 1, characterized in that: Determining the execution order of the tasks assigned to each of the servers according to the estimated completion time of each of the tasks includes: Among the tasks assigned to the servers, each of the tasks with dependencies is regarded as a task node, and the tasks without dependencies are regarded as a task node; Determining the execution order of the task nodes in each of the servers according to the estimated completion time corresponding to each of the task nodes; The method further comprises: The task nodes of each server are executed according to the execution order of the task nodes of each server.

7. The task control method according to claim 1, characterized in that: The determining, based on the historical task running information, the second functional level corresponding to each of the tasks includes: The distribution of each task at each functional level in the plurality of historical task running information is counted to determine the probability of each task at each functional level, and determine that the functional level with the greatest probability corresponding to each task is the second functional level of each task.

8. The task control method according to claim 1, characterized in that: Each of the tasks includes at least one of a common task, a conditional task, a judgment task and a special task, and the method further includes: In the target function level, the common task is regarded as a task node, the conditional task and the associated task of the conditional task are regarded as a task node, and the judgment task and the associated task of the judgment task are regarded as a task node; Read the target task node at the head of the task queue formed by each of the task nodes; If the target task node does not have a predecessor task node, create a node queue and put the target task node into the node queue; If the target task node has a predecessor task node and each predecessor task node is located in the node queue, the target task node is placed in the node queue where the corresponding predecessor task node is located, and the target task node is removed from the task queue; If the target task node has a predecessor task node and at least one predecessor task node is not located in the node queue, the target task node is placed at the end of the task queue; Determine whether the task queue is empty or whether the number of cycles reaches a preset number threshold; If yes, the special task is placed in at least one of the head and tail of each node queue; If not, the process proceeds again to the step of reading the target task node at the head of the task queue formed by each of the task nodes.

9. A task control device, characterized in that: include: An acquisition module, used for calculating complexity parameters of multiple tasks of a target functional level, wherein the complexity parameters of each task are determined according to at least one of scale information and difficulty information of each task, and the target functional level is any one of the preset multiple functional levels; A cyclic allocation module, used for allocating the target task with the largest complexity parameter to the target server with the most available resources among the multiple tasks in the task pool, wherein the target task is any one of the multiple tasks, and the target server is any one of the servers; and After the target task is assigned, the target task is removed from the task pool, and the step of forming the task pool with multiple tasks and assigning the target task with the largest complexity parameter to the target server with the most available resources is entered again; The task control device also includes a level division module, which is used to determine the first functional level corresponding to each task according to the database involved in each task; and determine the second functional level corresponding to each task according to the historical task operation information; When the second functional level and the first functional level of the target task are inconsistent, determine whether the probability of the second functional level is greater than the preset probability, and the target task is any one of the tasks; if so, determine the second functional level of the target task as the target functional level of the target task; if not, determine the first functional level of the target task as the target functional level of the target task.

10. A computer device, characterized in that: include: Processor, memory; and A computer program, wherein the computer program is stored in the memory and executed by the processor, and the computer program includes instructions for executing the task control method according to any one of claims 1 to 8.

11. A non-volatile computer-readable storage medium containing a computer program, wherein when the computer program is executed by a processor, the processor executes the task control method according to any one of claims 1 to 8.