Task allocation method and device

By building a timeline model and using a binary search method, the task sets are divided into multiple subsets, which solves the short-sighted problem of existing task allocation methods in multi-task high-load scenarios, and achieves more balanced resource utilization and higher overall efficiency.

CN119621337APending Publication Date: 2025-03-14WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411766797.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The existing task allocation method has short-sightedness in the agile development process, and it is impossible to effectively manage multi-task high-load scenarios, resulting in idle resources or excessive loading.

Method used

By building a timeline model and using a binary search method, a reasonable candidate task quantity k is determined, and the task set is divided into multiple subsets to ensure that the number of concurrent processing tasks of each task node at any time does not exceed the threshold k, and the task duration in each subset is maximized.

Benefits of technology

It achieves a more balanced task allocation, makes full use of resources, avoid idle or excessive load of resources, improves overall efficiency, and identify potential resource inadequate resources and task conflicts in advance, and provides initial risk warnings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621337A_ABST
    Figure CN119621337A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a task allocation method and device, and is applied to the technical field of software system resource management optimization, and the method comprises the steps: determining a candidate task load k according to a task load N in a task set, the candidate task load k representing the maximum task concurrency number of any task node at the same time point; under the candidate task quantity k, obtaining L sub-task sets meeting a first constraint condition; the first constraint condition is that the number L of the sub-task sets is smaller than or equal to the number M of the task nodes, each task can only be added into one sub-task set, and the task duration required by any task node for completing each task in any sub-task set is longest; adjusting the candidate task quantity k until the candidate task quantity k meeting the first constraint condition and the second constraint condition is obtained; and taking the minimum task concurrency number as a second constraint condition. The task set can be quickly divided into a plurality of subsets through the time axis model and binary search of the minimum overlapping task number, and the task allocation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of software system resource management optimization, and in particular to a task allocation method and device. Background Art

[0002] With the rapid development of the software development industry, agile development methods are widely used in various software projects due to their flexibility and efficiency. Agile development frameworks such as Scrum and Kanban manage project progress in an iterative and incremental manner, while project management tools (such as JIRA, Trello, etc.) provide specific functional support for task allocation, progress tracking, and collaboration in these agile frameworks. However, existing task allocation methods and tools have some shortcomings in practical applications, especially in avoiding project risks.

[0003] In the agile development process, task allocation is one of the key links. The usual goal is to maximize the progress of the task. Common task allocation methods mainly rely on experience and simple scheduling algorithms. For example, tasks are allocated according to task priority, task duration, or task end time. These are essentially greedy and short-sighted ideas that cannot meet the needs of multi-task and high-load work scenarios. Summary of the invention

[0004] The embodiments of the present application provide a task allocation method and device for reasonably dividing tasks in a task set, optimizing resource utilization, and maximizing task completion progress.

[0005] In a first aspect, an embodiment of the present application provides a task allocation method, comprising:

[0006] Get a task set containing N tasks and M task nodes for executing the tasks;

[0007] Determine a candidate task quantity k according to the task quantity N in the task set, wherein the candidate task quantity k represents the maximum concurrent number of tasks of any task node at the same time point;

[0008] Determine, under the constraint of the candidate task amount k, to obtain L subtask sets that satisfy the first constraint condition; wherein the first constraint condition is: the number L of subtask sets is less than or equal to the number M of task nodes, and each task can only be added to one subtask set and make any task node have the longest task time required to complete each task in any subtask set;

[0009] Adjust the candidate task amount k until the candidate task amount k that satisfies the first constraint condition and the second constraint condition is obtained; wherein the second constraint condition is that the number of concurrent tasks is minimized;

[0010] The N tasks are allocated to the M task nodes according to the L subtask sets that satisfy the first constraint condition and the second constraint condition.

[0011] This application can quickly and effectively divide the task set into multiple subsets by modeling the timeline model and using the method of binary search for the minimum number of overlapping tasks, thereby simplifying the task allocation process and improving overall efficiency. And under the premise of ensuring that the number of tasks that can be processed concurrently by each task node at any time point does not exceed the threshold k, the task duration in each subset is maximized, so that the task allocation is more balanced, resources are fully utilized, and resources are avoided from being idle or overloaded.

[0012] Optionally, the determining, under the constraint of the candidate task amount k, to obtain a set of L subtasks satisfying the first constraint condition comprises:

[0013] A timeline model is constructed according to the start time and end time of the N tasks; the timeline model includes a time axis and a time path of each task; wherein the time axis is composed of a plurality of first directed edges in sequence from a start node, each intermediate node to a terminal node with a unit time as a node; the time path of any task is a second directed edge constructed from a node corresponding to the start time of the task to a node corresponding to the end time of the task;

[0014] The timeline model is traversed, the tasks of the directed path with the longest task duration are added to the i-th subtask set, and the timeline model is continued to be traversed until the candidate task quantity k is met, to obtain the i-th subtask set; the i-th subtask set is any one of the L subtask sets.

[0015] Optionally, the traversing of the timeline model, adding the tasks of the directed path with the longest task duration to the i-th subtask set, and continuing to traverse the timeline model until the candidate task quantity k is met, to obtain the i-th subtask set, includes:

[0016] For any subtask set, the initial weight of each first directed edge is set to the candidate task quantity k; the initial weight of the second directed edge corresponding to each task that does not belong to the subtask set is set to 1;

[0017] Determine whether the weight of the first directed edge corresponding to the starting node is 0; if it is not 0, traverse the timeline model to obtain the directed path with the longest task duration, and add the task of the directed path with the longest task duration to the subtask set;

[0018] The weights of the first directed edge and the second directed edge in the directed path with the longest task duration are reduced by the first set value, and the step of determining whether the weight of the first directed edge corresponding to the starting node is 0 is returned until the weight of the first directed edge corresponding to the starting node is 0.

[0019] Under the premise of ensuring that the number of tasks for each person at any time point does not exceed the threshold k, the task duration in each subset is maximized to make the task distribution more balanced, fully utilize resources, and avoid idle resources or excessive load.

[0020] Optionally, adjusting the candidate task amount k includes:

[0021] If the number L of subtask sets that satisfy the first constraint condition is less than or equal to the number M of task nodes, reduce the number k of candidate tasks;

[0022] If the number L of subtask sets that satisfy the first constraint condition is greater than the number M of task nodes, the number k of candidate tasks is increased.

[0023] Optionally, determining the candidate task amount k according to the task amount N in the task set includes:

[0024] Set the initial value of the left endpoint of the candidate task amount k range to 1, and the initial value of the right endpoint to N;

[0025] Use the dichotomy method to determine the initial candidate task quantity k;

[0026] The reducing the candidate task amount k comprises:

[0027] Set the candidate task volume k as the right endpoint, and determine the new candidate task volume k by bisection;

[0028] The step of increasing the candidate task amount k comprises:

[0029] The candidate task volume k is set as the left endpoint, and a new candidate task volume k is determined by bisection.

[0030] Under the premise of ensuring that the number of tasks of each task node at any time point does not exceed the threshold k, the task duration in each subset is maximized to make the task distribution more balanced, fully utilize resources, and avoid idle resources or excessive load.

[0031] Optionally, if there are no L subtask sets that satisfy the first constraint condition and the second constraint condition, an early warning is issued.

[0032] During the task allocation stage, this application can identify potential resource shortages and task conflicts in advance by determining the maximum task overlap number k within the divided subsets, provide early risk warnings, and avoid delays and quality problems caused by improper resource allocation in the later stages of the project.

[0033] In a second aspect, an embodiment of the present application provides a task allocation device, including:

[0034] An acquisition module, used to acquire a task set including N tasks and M task nodes for executing the tasks;

[0035] A processing module, configured to determine a candidate task quantity k according to a task quantity N in the task set, wherein the candidate task quantity k represents a maximum concurrent number of tasks of any task node at a same time point;

[0036] The processing module is further used to determine, under the constraint of the candidate task amount k, to obtain L subtask sets that meet the first constraint condition; wherein the first constraint condition is: the number L of subtask sets is less than or equal to the number M of task nodes, and each task can only be added to one subtask set and make any task node have the longest task time required to complete each task in any subtask set;

[0037] The processing module is further used to adjust the candidate task amount k until the candidate task amount k that satisfies the first constraint condition and the second constraint condition is obtained; wherein the second constraint condition is that the number of concurrent tasks is minimized;

[0038] The processing module is further configured to allocate the N tasks to the M task nodes according to the L subtask sets that satisfy the first constraint condition and the second constraint condition.

[0039] This application can quickly and effectively divide the task set into multiple subsets by modeling the timeline model and using the method of binary search for the minimum number of overlapping tasks, thereby simplifying the task allocation process and improving overall efficiency. And under the premise of ensuring that the number of tasks that can be processed concurrently by each task node at any time point does not exceed the threshold k, the task duration in each subset is maximized, so that the task allocation is more balanced, resources are fully utilized, and resources are avoided from being idle or overloaded.

[0040] Optionally, the processing module is specifically used for:

[0041] A timeline model is constructed according to the start time and end time of the N tasks; the timeline model includes a time axis and a time path of each task; wherein the time axis is composed of a plurality of first directed edges in sequence from a start node, each intermediate node to a terminal node with a unit time as a node; the time path of any task is a second directed edge constructed from a node corresponding to the start time of the task to a node corresponding to the end time of the task;

[0042] The timeline model is traversed, the tasks of the directed path with the longest task duration are added to the i-th subtask set, and the timeline model is continued to be traversed until the candidate task quantity k is met, to obtain the i-th subtask set; the i-th subtask set is any one of the L subtask sets.

[0043] Optionally, the processing module is specifically used for:

[0044] The timeline model is traversed, the tasks of the directed path with the longest task duration are added to the i-th subtask set, and the timeline model is traversed until the candidate task quantity k is met, to obtain the i-th subtask set, including:

[0045] For any subtask set, the initial weight of each first directed edge is set to the candidate task quantity k; the initial weight of the second directed edge corresponding to each task that does not belong to the subtask set is set to 1;

[0046] Determine whether the weight of the first directed edge corresponding to the starting node is 0; if it is not 0, traverse the timeline model to obtain the directed path with the longest task duration, and add the task of the directed path with the longest task duration to the subtask set;

[0047] The weights of the first directed edge and the second directed edge in the directed path with the longest task duration are both reduced by 1, and the step of determining whether the weight of the first directed edge corresponding to the starting node is 0 is returned until the weight of the first directed edge corresponding to the starting node is 0.

[0048] Optionally, the processing module is specifically used for:

[0049] If the number L of subtask sets that satisfy the first constraint condition is less than or equal to the number M of task nodes, reduce the number k of candidate tasks;

[0050] If the number L of subtask sets that satisfy the first constraint condition is greater than the number M of task nodes, the number k of candidate tasks is increased.

[0051] Optionally, the processing module is specifically used for:

[0052] Set the initial value of the left endpoint of the candidate task amount k range to 1, and the initial value of the right endpoint to N;

[0053] Use the dichotomy method to determine the initial candidate task quantity k;

[0054] The reducing the candidate task amount k comprises:

[0055] Set the candidate task volume k as the right endpoint, and determine the new candidate task volume k by bisection;

[0056] The step of increasing the candidate task amount k comprises:

[0057] The candidate task volume k is set as the left endpoint, and a new candidate task volume k is determined by bisection.

[0058] Optionally, the processing module is specifically used for:

[0059] If there are no L subtask sets that satisfy the first constraint condition and the second constraint condition, an early warning is issued.

[0060] In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes any of the task allocation methods described in the first aspect above.

[0061] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program executable by a computer device, wherein when the program runs on the computer device, the computer device executes any of the task allocation methods described in the first aspect above.

[0062] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program / instruction, and when the computer program / instruction is executed by a processor, it implements any task allocation method described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0064] Figure 1 A flowchart of a task allocation method provided in an embodiment of the present application;

[0065] Figure 2 A schematic diagram of a k value range provided in an embodiment of the present application;

[0066] Figure 3 A schematic diagram of a binary solution flow chart provided in an embodiment of the present application;

[0067] Figure 4 A schematic diagram of a task time model provided in an embodiment of the present application;

[0068] Figure 5 A schematic diagram of a timeline model provided in an embodiment of the present application;

[0069] Figure 6 A schematic diagram of a timeline model provided in an embodiment of the present application;

[0070] Figure 7 A schematic diagram of a timeline model provided in an embodiment of the present application;

[0071] Figure 8A schematic diagram of a timeline model provided in an embodiment of the present application;

[0072] Fig. 9 A schematic diagram of a timeline model provided in an embodiment of the present application;

[0073] Fig.10 A schematic diagram of a timeline model provided in an embodiment of the present application;

[0074] Fig.11 A schematic diagram of a timeline model provided in an embodiment of the present application;

[0075] Fig.12 A schematic diagram of an updated timeline model provided in an embodiment of the present application;

[0076] Fig.13 A schematic diagram of a process for finding the minimum candidate task amount k provided in an embodiment of the present application;

[0077] Fig.14 A schematic diagram of a task allocation device provided in an embodiment of the present application;

[0078] Fig.15 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0079] In order to make the purpose, technical solution and beneficial effects of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0080] like Figure 1 FIG. 1 is a flow chart of a task allocation method provided by the present application, which specifically includes the following steps:

[0081] Step S101, obtaining a task set including N tasks and M task nodes for executing the tasks.

[0082] Specifically, let the task set be S. There are N tasks in the task set, which can be development tasks, operation and maintenance tasks, and testing tasks, etc. Each task has its own execution start time and deadline. N tasks are assigned to M task nodes for processing. Usually, N≥M.

[0083] Step S102, determining a candidate task quantity k according to the task quantity N in the task set, where the candidate task quantity k represents the maximum concurrent number of tasks of any task node at the same time point.

[0084] Specifically, an ideal division is to divide N tasks into M subsets so that the number of subsets is the same as the number of task nodes. This division will inevitably result in a number of overlapping tasks in a subset, and the number of overlapping tasks represents the maximum workload that each task node can handle at the same time. The larger the number of overlapping tasks, the heavier the burden on each task node. When the number of overlapping tasks exceeds a certain threshold, it is judged that the task node resources are insufficient. It is necessary to ensure that the number of overlapping tasks is minimized while dividing N tasks into M subsets. Therefore, a method for determining the number of overlapping tasks is needed. A candidate task amount k can be determined based on the task amount N in the task set S. The candidate task amount k represents the maximum concurrent number of tasks of any task node at the same time point, and the divided subsets are verified through steps S103 and S104 under the constraint of the candidate task amount k.

[0085] Step S103, determine, under the constraint of the candidate task quantity k, to obtain L subtask sets that satisfy the first constraint condition; wherein, the first constraint condition is: the number of subtask sets L is less than or equal to the number of task nodes M, and each task can only be added to one subtask set and make any task node take the longest task time to complete each task in any subtask set.

[0086] Step S104, adjusting the candidate task amount k until a candidate task amount k satisfying the first constraint condition and the second constraint condition is obtained; wherein the second constraint condition is to minimize the number of concurrent tasks;

[0087] Specifically, the present application should ensure that each task node bears the least number of tasks at the same time while maximizing the progress of task completion. Therefore, two constraints are set. The first constraint is: the number of subtask sets L is less than or equal to the number of task nodes M, and each task can only be added to one subtask set and make the task time required for any task node to complete each task in any subtask set the longest. The second constraint is to minimize the number of concurrent tasks, that is, the maximum workload that each task node can handle at the same time is minimized.

[0088] Step S105: distribute the N tasks to the M task nodes according to the L subtask sets that satisfy the first constraint condition and the second constraint condition. The M task nodes process the N tasks according to the L subtask sets.

[0089] This application can quickly and effectively divide the task set into multiple subsets by modeling the timeline model and using the method of binary search for the minimum number of overlapping tasks, thereby simplifying the task allocation process and improving overall efficiency. And under the premise of ensuring that the number of tasks that can be processed concurrently by each task node at any time point does not exceed the threshold k, the task duration in each subset is maximized, so that the task allocation is more balanced, resources are fully utilized, and resources are avoided from being idle or overloaded.

[0090] The following is a detailed description of the process of determining the candidate task volume k. It is known that there is a set S containing N tasks and M task nodes, which will be divided into M sub-sets, where N ≥ M. The candidate task volume k has many values. There are two cases for adjusting the candidate task volume k: 1. If the number of sub-task sets L that meet the first constraint condition is less than or equal to the number of task nodes M, reduce the candidate task volume k; 2. If the number of sub-task sets L that meet the first constraint condition is greater than the number of task nodes M, increase the candidate task volume k.

[0091] Specifically, when k=1, it means that each task node can handle at most one task at the same time, then the set S can be divided into at most N sets, because N≥M, so under the constraint condition of k=1, the set S cannot be divided into M subsets. When k=N, it means that each task node can handle at most N tasks at the same time, then the N tasks in the set S can all be assigned to 1 task node, and the remaining M-1 task nodes are vacant. Under the constraint condition of k=N, the set S can be divided into M subsets, one of which contains N tasks, and the remaining M-1 sets are empty sets. From the above examples, it can be seen that when k increases from small to large, it means that the number of tasks that a task node can do at the same time increases, so the number of divided subsets will inevitably tend to decrease. Because a task node has to do more things at the same time, it means that fewer task nodes are needed to complete the tasks, so the number of divided subsets will become smaller. As k changes, it presents the following Figure 2 The range of k values ​​shown in the figure shows that k min is a "just right" value. If it is smaller than it, it is infeasible, and if it is larger than it, it is feasible. min , the number of subsets divided out will be greater than M. If the value is greater than it, the number of subsets divided out will not exceed M, and it is the smallest value in the feasible domain.

[0092] Considering that the value of k is increasing and monotonic, we can use the idea of ​​binary search to solve it. The binary search flow chart is as follows: Figure 3 As shown, it specifically includes the following steps:

[0093] Step S301, setting the initial value of the left endpoint of the candidate task amount k value range to 1, and the initial value of the right endpoint to N;

[0094] Specifically, left = 1, right = N

[0095] Step S302, using a binary search method to determine an initial candidate task quantity k;

[0096] Specifically, let the candidate task amount k=mid=(left+right / 2).

[0097] Step S303, judging whether the set S can be divided into no more than M sets under the constraint of the current candidate task quantity k; if yes, proceed to step S304, otherwise proceed to step S306;

[0098] Step S304: if the current candidate task quantity k is too large, then step S305 is performed to reduce the candidate task quantity k and further narrow the value range of k;

[0099] Step S305, setting the candidate task amount k as the right endpoint, and determining a new candidate task amount k by dichotomy;

[0100] Specifically, let the right endpoint right=mid.

[0101] Step S306: if the current candidate task amount k is too small, then step S307 is performed to increase the candidate task amount k and further expand the value range of k;

[0102] Step S307, setting the candidate task amount k as the left endpoint, and determining a new candidate task amount k by binary search;

[0103] Specifically, let the left endpoint left=mid+1.

[0104] Step S308, determine whether the left endpoint is equal to the right endpoint; if so, proceed to step S309 and end; if not, return to continue executing step S303.

[0105] Step S309, end.

[0106] During the task allocation stage, this application can identify potential resource shortages and task conflicts in advance by determining the maximum number of task overlaps within the divided subsets, provide early risk warnings, and avoid delays and quality issues caused by improper resource allocation in the later stages of the project.

[0107] The binary search used in this application is usually to find a suitable candidate task quantity k, which needs to meet the following requirements: under the constraint of the current candidate task quantity k, can the set S be divided into no more than M sets to find the smallest k. To determine whether the threshold k meets the requirements, that is, to see whether the number of divided subtask sets L is less than the total number of task nodes M under the constraint that the number of overlapping tasks in each subtask set is at most k. The core is that the task duration in each subtask set is as long as possible.

[0108] In the existing conventional practice, the greedy idea is generally used to select the task with the longest task duration from the remaining tasks each time. Assume that when the task node M = 2, the task set S has 4 tasks {A, B, C, D}, the set size N = |S| = 4, the start and end times are [(1,7), (2,6), (3,5), (5,8)], and the task durations are [6,4,2,3], which can be constructed as follows Figure 4 The task time model shown. If k = 2 at this time, the task with longer duration will be given priority. Then {A, B} will be selected as the first subtask set, and the total task duration is (7-1) + (6-2) = 10. However, under the constraint of k = 2, tasks C or D cannot be selected to be added to the first subtask set. In fact, choosing {A, C, D} as the first subtask set will have a better solution, and the total task duration is (7-1) + (5-3) + (8-5) = 11. Therefore, the greedy algorithm that chooses {A, B} as the first subtask set will bring short-sightedness problems.

[0109] In order to solve the short-sightedness caused by greed, we cannot judge each task independently. Whether it should be selected to be added to the current subset should be judged from a global perspective so that the duration of the tasks in the subset is the largest. Therefore, the following timeline model is used to divide the task set.

[0110] According to the start and end time of N tasks, a preliminary establishment is made. Figure 5 The timeline model shown in the figure includes a time long axis, which is composed of a plurality of first directed edges in sequence from the starting node, each intermediate node to the ending node, taking the unit time as a node. Assume that p j is the number of line segments covering the jth position on the number axis, x i Is the i-th interval selected or not, z i,j Indicates whether the i-th interval covers the j-th point.

[0111] Then you can get

[0112] p1=∑x i × i,1 ≤k

[0113] p2=∑x i × i,2 ≤k

[0114] …

[0115] p N =∑x i × i,N ≤k

[0116] By converting the inequality into an equation, we can get the following formula:

[0117] p1=(∑x i × i,1 )+y1=k,0≤y1≤k

[0118] p2=(∑x i × i,2 )+y2=k,0≤y2≤k

[0119] …

[0120] p N =(∑x i × i,N )+y N =k,0≤y N ≤k

[0121] The number of occurrences of each variable in the entire equation for different z is inconsistent. By taking the difference between the upper and lower terms, we can get the following formula:

[0122] p1-p0=(∑x i × i,1 )+y1=k

[0123] p2-p1=(∑x i ×(z i,2 -z i,1 ))+y2-y1=0

[0124] …

[0125] p N+1 -p N =(∑x i ×(-z i,N ))-y N =-k

[0126] In the above linear programming, we can see that p1-p0=k,p n+1 -p n =-k, p ip1 represents the number of times the i-th point on the timeline is covered, p1 represents the number of tasks covered at the first time point, and p0 can be regarded as the starting point, at which the number of tasks covered is 0. Then p1-p0=k means that at the time point numbered 1, at most k tasks can be assigned simultaneously. n+1 represents the coverage number after the last time point, and the coverage number here should be zero. Therefore, p n+1 -p n =-k means at the last time point p n At most k tasks are completed, so that the system reaches equilibrium, such as Figure 6 In the timeline model shown, the advantage of using k as the edge weight is that it is used to represent the maximum number of times this edge can be selected.

[0127] y i is introduced as an intermediate variable, which helps to convert inequalities into equalities. Specifically, y i is the edge between time nodes i and i+1, and serves as a balancing factor to ensure that the number of tasks passing the current time point is k. It means that in the time interval [i, i+1], the maximum number of concurrent tasks is k. Through this edge, it is ensured that at each time point, the number of tasks does not exceed the threshold k. Therefore, the graph can be further improved to obtain Figure 7 The timeline model shown.

[0128] In addition, the timeline model also includes the time path of each task; the time route of any task is a second directed edge constructed from the node corresponding to the start time of the task to the node corresponding to the end time of the task. The starting point and end point of each task are connected by a second directed edge to represent their association relationship.

[0129] For example, the number of existing task nodes M = 2, the task set S = {A, B, C, D}, the start and end times of each task are [(1,7), (2,6), (3,5), (5,8)], and if the current number of candidate tasks k = 2, according to Figure 4 The start time and end time of each task in is composed as follows Figure 8 The timeline model shown in Figure 8 After the timeline model is shown, this graph represents the entire situation of the current task. Combined with the algorithm on the graph, the short-sightedness problem of the greedy algorithm can be effectively avoided.

[0130] For any subtask set, set the initial weight of each first directed edge to the candidate task quantity k; the initial weight of the second directed edge corresponding to each task that does not belong to the subtask set is 1; determine whether the weight of the first directed edge corresponding to the starting node is 0; when it is not 0, traverse the timeline model to obtain the directed path with the longest task duration, and add the tasks on the directed path with the longest task duration to the subtask set; reduce the weights of the first directed edge and the second directed edge in the directed path with the longest task duration by 1, and return to the step of determining whether the weight of the first directed edge corresponding to the starting node is 0, until the weight of the first directed edge corresponding to the starting node is 0.

[0131] Specifically, because the first constraint is that the number of subtask sets L is less than or equal to the number of task nodes M, and each task can only be added to one subtask set and make any task node take the longest time to complete each task in any subtask set, and because a task can only be selected once by a subtask set, that is, executed once, the weight of the second directed edge is defined as 1. Because we need to find a path with the longest task duration from point S to point T, we use the symbol s to represent the edge between two points, that is, the task duration that can be obtained, which is referred to as the benefit of the edge passing through these two points. Figure 8 The timeline model shown in the figure is traversed, and the tasks of the directed path with the longest task duration are added to the i-th subtask set, and the timeline model is traversed until the candidate task quantity k is met, and the i-th subtask set is obtained; the i-th subtask set is any one of the L subtask sets. For example, according to Figure 8 As obtained Fig. 9 In the timeline model represented by (a), the benefit from the path S-1-7-8-T is s=0+6+0+0=6. The benefits of (S,1), (7,8), and (8,T) are s=0, because these edges do not pass through the complete task, but only represent the connection with the end point. Fig. 9 It can be seen that the benefit of the path shown in (a) is s = 6, the benefit of the path shown in (b) is s = 4, and the benefit of the path shown in (c) is s = 5. In order to maximize the task duration in the subset, we need to select the path with the largest benefit, that is, the path shown in (a), which covers the task A with a time span of 1->7. A is added to the first subset to obtain the first subset {A}.

[0132] Next, we need to update the edge weights of the path S-1-7-8-T. Since the span 1→7 task has been selected, the weights of the edges on this path must be reduced by 1, such as Fig.10 The timeline model shown in Figure 1. Find the path with the highest benefit again. Since the capacity of the edge 1→7 is reduced by 1 and becomes 0, it means that this task cannot be selected again. Fig.11In the timeline model shown, the benefit of the path (a) is s = 4, and the benefit of the path (b) is s = 5. The path shown in (b) covers tasks C and D with time spans 3→5 and 5→8. The two are added to the first subset to obtain the first subset {A, C, D}.

[0133] Next, we need to update the path S→1→2→3→5→8→T. Since the task 3→5,5→8 has been selected, the weights of the edges on this path must be reduced by 1. Note that the capacity of the edge 3→5,5→8 becomes 0 after being reduced by 1, indicating that the task cannot be selected again. The weight of the starting edge S→1 is k-2=0, indicating that the process of dividing the subset has ended. The weight of the starting edge is 0, and no more tasks can be assigned. Fig.12 The updated timeline model is shown. At this point, the partition of this set is terminated, and the sub-sets are {A, C, D}. The remaining task B is a separate set {B}. Finally, under the constraint of k = 2, two sets {A, C, D} and {B} are obtained.

[0134] like Fig.13 The flowchart shown is a flowchart of a method provided by the present application for determining whether a set S can be divided into no more than M sets under the constraint of the current candidate task amount k to find the minimum candidate task amount k. The specific determination includes the following steps:

[0135] Step S1301, start.

[0136] Step S1302, obtaining the current candidate task quantity k;

[0137] Specifically, the current candidate task quantity k represents the number of tasks that can be done at the same time point.

[0138] Step S1303, initializing the timeline model, with the starting point S and the end point T, and establishing a directed edge between adjacent points;

[0139] Step S1304, set the weight of each edge to k and the benefit to 0;

[0140] Step S1305, traverse the task set S, and represent the start time and end time of each task on the timeline model;

[0141] Step S1306, for each task, connect a directed edge between the start time and the end time, with a weight of 1 and a benefit of (end time - start time);

[0142] Step S1307, select a path with the maximum benefit from the starting point S to the end point T, and the weight of the directed edge on the path cannot be 0;

[0143] Step S1308, putting the tasks on the path into the i-th subtask set;

[0144] Step S1309, deleting the tasks on the path from the task set S;

[0145] Step S1310, updating the weights of all directed edges on the path, reducing the weights of the directed edges by 1;

[0146] Step S1311, determine whether the weight of the directed edge from S to 1 is 0; if yes, proceed to step S1312; otherwise, return to step S1307;

[0147] Step S1312, determine whether the task set S is empty, if yes, execute step S1313; otherwise, execute step S1305;

[0148] Step S1313, end.

[0149] In a possible embodiment, if there are no L subtask sets that satisfy the first constraint condition and the second constraint condition, an early warning is issued.

[0150] First, the set S containing N tasks is divided into M subsets through the task set partitioning algorithm. In the partitioning process, a partitioning scheme is found that minimizes the number of overlapping tasks k. This means that at any point in time, each task node has the least number of tasks to bear at the same time, thereby maximizing the progress of task completion.

[0151] From the perspective of task nodes, there is an upper limit to the number of tasks that each task node can undertake simultaneously. If the minimum number of overlapping tasks k_min still exceeds this upper limit, an early warning needs to be issued and the allocation plan needs to be adjusted in time, and the tasks need to be split or postponed.

[0152] During the task allocation stage, by determining the maximum number of task overlaps within the divided subsets, potential resource shortages and task conflicts can be identified in advance, providing early risk warnings and avoiding delays and quality issues in the later stages of the project due to improper resource allocation.

[0153] like Fig.14 As shown, a task allocation device 1400 is provided for an embodiment of the present application, including:

[0154] An acquisition module 1401 is used to acquire a task set including N tasks and M task nodes for executing the tasks;

[0155] Processing module 1402, used to determine a candidate task quantity k according to the task quantity N in the task set, wherein the candidate task quantity k represents the maximum concurrent number of tasks of any task node at the same time point;

[0156] The processing module 1402 is further used to determine, under the constraint of the candidate task amount k, to obtain L subtask sets that meet the first constraint condition; wherein the first constraint condition is: the number L of subtask sets is less than or equal to the number M of task nodes, and each task can only be added to one subtask set and make any task node have the longest task time required to complete each task in any subtask set;

[0157] The processing module 1402 is further used to adjust the candidate task amount k until the candidate task amount k that satisfies the first constraint condition and the second constraint condition is obtained; wherein the minimum number of concurrent tasks is the second constraint condition;

[0158] The processing module 1402 is further configured to allocate the N tasks to the M task nodes according to the L subtask sets that satisfy the first constraint condition and the second constraint condition.

[0159] This application can quickly and effectively divide the task set into multiple subsets by modeling the timeline model and using the method of binary search for the minimum number of overlapping tasks, thereby simplifying the task allocation process and improving overall efficiency. And under the premise of ensuring that the number of tasks that can be processed concurrently by each task node at any time point does not exceed the threshold k, the task duration in each subset is maximized, so that the task allocation is more balanced, resources are fully utilized, and resources are avoided from being idle or overloaded.

[0160] Optionally, the processing module 1402 is specifically configured to:

[0161] A timeline model is constructed according to the start time and end time of the N tasks; the timeline model includes a time axis and a time path of each task; wherein the time axis is composed of a plurality of first directed edges in sequence from a start node, each intermediate node to a terminal node with a unit time as a node; the time path of any task is a second directed edge constructed from a node corresponding to the start time of the task to a node corresponding to the end time of the task;

[0162] The timeline model is traversed, the tasks of the directed path with the longest task duration are added to the i-th subtask set, and the timeline model is continued to be traversed until the candidate task quantity k is met, to obtain the i-th subtask set; the i-th subtask set is any one of the L subtask sets.

[0163] Optionally, the processing module 1402 is specifically configured to:

[0164] The timeline model is traversed, the tasks of the directed path with the longest task duration are added to the i-th subtask set, and the timeline model is traversed until the candidate task quantity k is met, to obtain the i-th subtask set, including:

[0165] For any subtask set, the initial weight of each first directed edge is set to the candidate task quantity k; the initial weight of the second directed edge corresponding to each task that does not belong to the subtask set is set to 1;

[0166] Determine whether the weight of the first directed edge corresponding to the starting node is 0; if it is not 0, traverse the timeline model to obtain the directed path with the longest task duration, and add the task of the directed path with the longest task duration to the subtask set;

[0167] The weights of the first directed edge and the second directed edge in the directed path with the longest task duration are both reduced by 1, and the step of determining whether the weight of the first directed edge corresponding to the starting node is 0 is returned until the weight of the first directed edge corresponding to the starting node is 0.

[0168] Optionally, the processing module 1402 is specifically configured to:

[0169] If the number L of subtask sets that satisfy the first constraint condition is less than or equal to the number M of task nodes, reduce the number k of candidate tasks;

[0170] If the number L of subtask sets that satisfy the first constraint condition is greater than the number M of task nodes, the number k of candidate tasks is increased.

[0171] Optionally, the processing module 1402 is specifically configured to:

[0172] Set the initial value of the left endpoint of the candidate task amount k range to 1, and the initial value of the right endpoint to N;

[0173] Use the dichotomy method to determine the initial candidate task quantity k;

[0174] The reducing the candidate task amount k comprises:

[0175] Set the candidate task volume k as the right endpoint, and determine the new candidate task volume k by bisection;

[0176] The step of increasing the candidate task amount k comprises:

[0177] The candidate task volume k is set as the left endpoint, and a new candidate task volume k is determined by bisection.

[0178] Optionally, the processing module 1402 is specifically configured to:

[0179] If there are no L subtask sets that satisfy the first constraint condition and the second constraint condition, an early warning is issued.

[0180] Based on the same technical concept, the embodiment of the present application provides a computer device, which can be Fig.15The terminal device 1501 and / or the server 1502 shown in FIG. Fig.15 As shown, it includes at least one processor 1501 and a memory 1502 connected to the at least one processor. The specific connection medium between the processor 1501 and the memory 1502 is not limited in the embodiment of the present application. Fig.15 For example, the processor 1501 and the memory 1502 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.

[0181] In the embodiment of the present application, the memory 1502 stores instructions that can be executed by at least one processor 1501, and the at least one processor 1501 can perform the steps of the above-mentioned task allocation method by executing the instructions stored in the memory 1502.

[0182] Among them, the processor 1501 is the control center of the computer device, and can use various interfaces and lines to connect various parts of the computer device. By running or executing instructions stored in the memory 1502 and calling data stored in the memory 1502, it can realize the reasonable division of tasks in the task set, optimize resource utilization, and maximize the progress of task completion. Optionally, the processor 1501 may include one or more processing units, and the processor 1501 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1501. In some embodiments, the processor 1501 and the memory 1502 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.

[0183] Processor 1501 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.

[0184] Memory 1502, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 1502 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, optical disk, etc. Memory 1502 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer device, but is not limited thereto. The memory 1502 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0185] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program executable by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned task allocation method.

[0186] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0187] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0188] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0189] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0190] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A task allocation method, characterized in that: include: Get a task set containing N tasks and M task nodes for executing the tasks; Determine a candidate task quantity k according to the task quantity N in the task set, wherein the candidate task quantity k represents the maximum concurrent number of tasks of any task node at the same time point; Determine, under the constraint of the candidate task amount k, to obtain L subtask sets that satisfy the first constraint condition; wherein the first constraint condition is: the number L of subtask sets is less than or equal to the number M of task nodes, and each task can only be added to one subtask set and make any task node have the longest task time required to complete each task in any subtask set; Adjust the candidate task amount k until the candidate task amount k that satisfies the first constraint condition and the second constraint condition is obtained; wherein the second constraint condition is that the number of concurrent tasks is minimized; The N tasks are allocated to the M task nodes according to the L subtask sets that satisfy the first constraint condition and the second constraint condition.

2. The method according to claim 1, characterized in that The determining, under the constraint of the candidate task amount k, to obtain a set of L subtasks satisfying the first constraint condition comprises: A timeline model is constructed according to the start time and end time of the N tasks; the timeline model includes a time axis and a time path of each task; wherein the time axis is composed of a plurality of first directed edges in sequence from a start node, each intermediate node to a terminal node with a unit time as a node; the time path of any task is a second directed edge constructed from a node corresponding to the start time of the task to a node corresponding to the end time of the task; The timeline model is traversed, the tasks of the directed path with the longest task duration are added to the i-th subtask set, and the timeline model is continued to be traversed until the candidate task quantity k is met, to obtain the i-th subtask set; the i-th subtask set is any one of the L subtask sets.

3. The method according to claim 2, characterized in that The timeline model is traversed, the tasks of the directed path with the longest task duration are added to the i-th subtask set, and the timeline model is traversed until the candidate task quantity k is met, to obtain the i-th subtask set, including: For any subtask set, the initial weight of each first directed edge is set to the candidate task quantity k; the initial weight of the second directed edge corresponding to each task that does not belong to the subtask set is set to 1; Determine whether the weight of the first directed edge corresponding to the starting node is 0; if it is not 0, traverse the timeline model to obtain the directed path with the longest task duration, and add the task of the directed path with the longest task duration to the subtask set; The weights of the first directed edge and the second directed edge in the directed path with the longest task duration are both reduced by 1, and the step of determining whether the weight of the first directed edge corresponding to the starting node is 0 is returned until the weight of the first directed edge corresponding to the starting node is 0.

4. The method according to any one of claims 1 to 3, characterized in that The step of adjusting the candidate task amount k comprises: If the number L of subtask sets that satisfy the first constraint condition is less than or equal to the number M of task nodes, reduce the number k of candidate tasks; If the number L of subtask sets that satisfy the first constraint condition is greater than the number M of task nodes, the number k of candidate tasks is increased.

5. The method according to claim 4, characterized in that The determining the candidate task amount k according to the task amount N in the task set includes: Set the initial value of the left endpoint of the candidate task amount k range to 1, and the initial value of the right endpoint to N; Use the dichotomy method to determine the initial candidate task quantity k; The reducing the candidate task amount k comprises: Set the candidate task volume k as the right endpoint, and determine the new candidate task volume k by bisection; The step of increasing the candidate task amount k comprises: The candidate task amount k is set as the left endpoint, and a new candidate task amount k is determined by bisection.

6. The method according to any one of claims 1 to 3, characterized in that: Also includes: If there are no L subtask sets that satisfy the first constraint condition and the second constraint condition, an early warning is issued.

7. A task allocation device, characterized in that: include: An acquisition module, used to acquire a task set including N tasks and M task nodes for executing the tasks; A processing module, configured to determine a candidate task quantity k according to a task quantity N in the task set, wherein the candidate task quantity k represents a maximum concurrent number of tasks of any task node at a same time point; The processing module is further used to determine, under the constraint of the candidate task amount k, to obtain L subtask sets that meet the first constraint condition; wherein the first constraint condition is: the number L of subtask sets is less than or equal to the number M of task nodes, and each task can only be added to one subtask set and make any task node have the longest task time required to complete each task in any subtask set; The processing module is further used to adjust the candidate task amount k until the candidate task amount k that satisfies the first constraint condition and the second constraint condition is obtained; wherein the second constraint condition is that the number of concurrent tasks is minimized; The processing module is further configured to allocate the N tasks to the M task nodes according to the L subtask sets that satisfy the first constraint condition and the second constraint condition.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of any one of the methods of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of any method described in claims 1 to 6.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of any method described in claims 1 to 6 are implemented.