High-concurrency task sorting optimization method under complex constraint
By constructing task value functions and time constraints, combining backtracking algorithms and genetic algorithms, the problem of high concurrent task sorting optimization under complex constraints is solved, and efficient task sorting and resource optimization is achieved to meet automation and real-time requirements.
Patent Information
- Application Number
- CN202411983980.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-30
AI Technical Summary
In the case of high concurrency, high dynamics but limited resources, the prior art is difficult to effectively deal with the sorting optimization of high concurrency tasks under complex constraints, especially when time constraints and inter-task coupling constraints are complex.
By constructing task value functions and time constraints, combining backtracking algorithms and genetic algorithms, the sorting priority function is constructed, and order priority sorting scheme selection is performed to automatically calculate priority and sort high-concurrency tasks.
This method simplifies the processing process, improves processing efficiency, can effectively deal with task sorting problems under complex constraints, meets automation and real-time requirements, and improves resource utilization efficiency and operational efficiency.
Smart Images

Figure CN120069371A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical fields of task priority modeling and constrained optimization, and particularly relates to a method for optimizing the sorting of high-concurrency tasks under complex constraints. Background Art
[0002] In a scenario of high concurrency, high dynamics but limited resources, it is particularly crucial to sort high-concurrency task orders with complex constraints. Automated sorting algorithms determine which tasks should be processed first based on the importance and time urgency of the tasks. The sorting results consider various constraints such as task coupling, which is crucial for optimizing resource allocation and improving operation efficiency. Task sorting involves multiple disciplines such as operations research, artificial intelligence, and engineering, and has a wide range of application fields, including taxi order sorting, production planning, flight scheduling, and satellite resource scheduling. Certain achievements have been made in the current research on task sorting considering time constraints.
[0003] In classical heuristic algorithms, for sorting and scheduling problems with complex constraints, the iterative conflict resolution method is one of the effective means to solve the planning and scheduling problems. In addition to the time iteration method, the greedy algorithm is simple and easy to implement, without complex control mechanisms and with a fast search speed. It is a mature domain search algorithm that can be applied in many aspects. However, as the problem scale increases and the complexity of the constraints increases, the greedy algorithm cannot handle complex problems and multiple constraints.
[0004] In contrast, genetic algorithms are more suitable for high-concurrency and complex problems, especially those that need to consider multiple constraints or have a large search space. For the sorting optimization of high-concurrency orders under complex constraints, genetic algorithms are superior to greedy algorithms, but genetic algorithms have a high computational complexity and require a large amount of computing resources and time. Summary of the Invention
[0005] Objective of the present invention: The present invention provides an optimization algorithm for sorting high-concurrency task orders under complex constraints such as time and task coupling. Regarding each task as an order, this algorithm aims to automatically calculate the priority function and sort high-concurrency orders according to conditions such as the importance, value, time urgency of the tasks, and the sequence relationship between tasks, overcome the problems of calculation scale and calculation efficiency of existing heuristic sorting optimization algorithms, meet the requirements of automation and real-time, and lay a foundation for improving resource utilization efficiency and enhancing efficiency.
[0006] This application provides a method for optimizing the sorting of high-concurrency tasks under complex constraints, and the method includes:
[0007] Construct a task value function;
[0008] Construct time constraints;
[0009] Construct a sorting priority function based on the task value function and the time constraint;
[0010] Construct a backtracking algorithm;
[0011] Construct a genetic algorithm;
[0012] Select an order priority sorting scheme based on the backtracking algorithm and the genetic algorithm.
[0013] Preferably, the constructing of the task value function includes:
[0014] Refine value-related factors according to task characteristics, perform normalization processing on each factor, and construct a task value function.
[0015] Preferably, the constructing of the time constraint includes:
[0016] For whether different orders need to be executed as soon as possible, start time constraint, and end time constraint, construct time urgency, no-earlier-than factor, and time margin respectively.
[0017] Preferably, the constructing of the sorting priority function based on the task value function and the time constraint includes:
[0018] Based on three time constraint indicators, use value as a weighting factor to construct a sorting priority function.
[0019] Preferably, the constructing of the backtracking algorithm includes:
[0020] For the sequential coupling constraint between tasks, ensure the satisfaction of the constraint through the backtracking algorithm to obtain a feasible solution.
[0021] Preferably, the constructing of the genetic algorithm includes:
[0022] Construct the task order sequence into a chromosome coding form, and search for the optimal solution within a large range through crossover and mutation operations.
[0023] Preferably, the task value function is:
[0024]
[0025] In the formula, V i is the value of the i-th task; R i is the value-related factor; k j is the weight corresponding to R i , j = 1, 2,..., r,
[0026] where r is the number of related factors.
[0027] Preferably, based on the three time constraint indicators, taking value as a weighting factor, constructing a sorting priority function, including:
[0028] For task order i, comprehensively considering the value function value V i and three time-related variables: urgency U i , no-earlier-than factor W i , time margin value Y i , constructing a sorting priority function VY i , and its definition is as follows:
[0029]
[0030] Advantageous technical effects of the present invention:
[0031] (1) Embedding time constraints into the priority function:
[0032] By placing time constraints in the priority function and taking value as a weighting factor, this scientific modeling method can handle time constraints in various different situations. This innovation avoids dealing with cumbersome time constraints through backtracking search and only needs to focus on processing the sequential coupling constraints between tasks, thus simplifying the processing process and effectively improving the processing efficiency.
[0033] (2) Combining the backtracking method with the genetic algorithm:
[0034] Traditional genetic algorithms for handling constraint conditions rely on penalty functions or repair operators and other schemes to punish violations of constraint conditions, but this may lead to the search process concentrating on some solutions that do not meet the constraints but have small penalty terms. The combination of the backtracking method can more directly correct the parts that violate the constraint conditions, maximize the satisfaction of business requirements, and improve the accuracy and compliance of the solutions. And the combination of the backtracking method is more flexible and can customize review and correction strategies according to the constraint conditions of different problems, and is more suitable for problems under various complex constraint conditions.
[0035] (3) Wide applicability and compatibility:
[0036] The present invention has wide applicability and high compatibility. It is not only applicable to different types of task orders and various time constraint conditions, but also can effectively handle the complex sequential coupling constraints between tasks. This multiple applicability greatly improves the practicality of the model and enables it to flexibly cope with diverse constraint conditions. Therefore, this innovation provides a general and efficient algorithm framework for solving task sorting problems in multiple fields, making it easier and more reliable to handle complex task sorting problems. Description of the Drawings
[0037] Figure 1 It is a schematic diagram of the backtracking process provided by the embodiment of the present application;
[0038] Figure 2 Flow chart of the backtracking method provided by the embodiment of the present application;
[0039] Figure 3 Optimization flowchart combining the backtracking method and the genetic algorithm provided by the embodiment of the present application. Specific implementation manners
[0040] It is particularly important for the present application to reduce the algorithm complexity through reasonable modeling and reduce the algorithm convergence time to meet the requirements of high dynamics and real-time performance.
[0041] The present invention combines the backtracking method and the genetic algorithm to select an order priority sorting scheme. The backtracking method ensures that various constraints are met, the genetic algorithm searches for the optimal solution, places the time constraint in the task order priority function, and uses the value as a weighting factor. This scientific modeling method avoids dealing with the time constraint in backtracking search and only needs to handle the constraints of sequential coupling between tasks, thus accelerating the processing speed. Moreover, this algorithm is compatible with different types of time constraints and tasks, improves the practicability of the model, and can provide a more general and efficient solution for the task sorting problems in multiple fields.
[0042] For the scenario of high concurrency, high dynamics but limited resources of task orders, the present invention constructs a priority function based on time constraints, order value, etc., and combines the backtracking method and the genetic algorithm to select an order priority sorting scheme.
[0043] The object of the present invention is achieved through the following technical solutions:
[0044] a) Task value modeling: Extract value-related factors according to task characteristics, perform normalization processing on each factor, and construct a task value function.
[0045] b) Time constraint modeling: For various constraint forms such as whether different orders need to be executed as soon as possible, start time constraint, end time constraint, etc., respectively construct indicators such as time urgency, no-earlier-than factor, time margin, etc.
[0046] c) Construct a priority function: Based on the three time constraint indicators, use the value as a weighting factor to construct an order priority function.
[0047] d) Construct a backtracking algorithm: For constraints such as sequential coupling between tasks, ensure the satisfaction of the constraints through the backtracking algorithm to obtain a feasible solution.
[0048] e) Construct a genetic algorithm: Construct the task order sequence into a chromosome coding form, and search for the optimal solution within a large range through operations such as crossover and mutation.
[0049] Please refer to Figure 1 - Figure 3, in the embodiments of the present application, the implementation process provided by the present application is as follows:
[0050] (1) Priority function modeling
[0051] First, construct the task value function
[0052]
[0053] In the formula, V i is the value of the i-th task; R j is the value-related factor, k j is the weight corresponding to R j , j = 1, 2,..., r, where r is the number of related factors. Each factor variable adopts linear normalization and is defined as
[0054] where max(x) is the upper bound defined by x, and min(x) is the lower bound defined by x.
[0055] Secondly, consider the time constraints for task i, including the following three categories:
[0056] 1) Whether to execute as soon as possible: If it is "yes", there are no the following two other types of time constraints; if it is "no", there may be the following two types of time constraints.
[0057] 2) Start time constraint: It is required that the execution time is not earlier than the given time;
[0058] 3) End time constraint: It is required that the task completion time is not later than the given time.
[0059] First, define the time urgency U i , which is divided into two cases: For the first type of order, if the option of "execute as soon as possible" is filled with "yes", the urgency is given a large dimensionless positive number u; for the second type of order, if the option of "execute as soon as possible" is filled with "no", the urgency is 1. The reason for taking the urgency as 1 instead of 0 is to consider the sorting among non-urgent orders. At this time, the time factors are the same, and the value function is used as the weight for comparison and then sorting.
[0060]
[0061] When "execute as soon as possible" is "no", the constraints of the start time and end time are divided into 4 cases:
[0062] a) The start time ST is given, and the end time ET is not given: It is required that the execution time is not earlier than the given time;
[0063] b) The start time ST is not given, and the end time ET is given: It is required that the task completion time is not later than the given time;
[0064] c) The start time ST is given and the end time ET is given: It is required to complete the task within the given time;
[0065] d) The start time ST is not given and the end time ET is not given: There is no task time requirement.
[0066] Definition Define the start execution time of the task as, and define dT i as the execution duration of task i, obtained from the order. The above constraints a), b), and c) correspond to the following inequality relations respectively:
[0067]
[0068] Consider cases a) and b) separately. Case c) can be considered as a combination of cases a) and b). Considering the current moment t of the sorting in the dispatching center, plus the empirical reserved time T for the dispatching center to complete sorting, allocate task execution resources, perform preparations, etc. w we get the earliest estimated execution time T of task i i ,
[0069] T i = t + T w ,
[0070] where, T w is related to the order type, etc., and is the empirical time required for this type of task order after expert consultation or statistics. The reason it is the earliest estimated time is that T i does not consider the waiting time in the sorting queue. For orders with time constraint a), if their earliest estimated execution time is before the required start time, they should be sorted later. Therefore, the no-earlier-than factor W of order i is introduced i ,
[0071]
[0072] where, w is a large dimensionless positive number. When ST > T i , the required start time of the task is after the earliest estimated execution time T i . Then, if such orders are dispatched, they will surely not meet the time constraint a), and the priority can be reduced by W and sorted later; when ST ≤ Th i when it is expected to meet this constraint, and when there is no constraint a), the no-earlier-than factor W t takes 1. The reason for taking 1 instead of 0 is to consider the sorting between orders with only time constraint a) or no time constraint. In this case, the time factors are the same, and the value function is used as the weight, and the order with a larger value is ranked earlier.
[0073] For time constraint case b), calculate the time margin value Y i , defined as
[0074]
[0075] where max{ST, T i} represents taking the larger value of the required start execution time and the earliest estimated execution time. Orders with smaller time margin values should be ranked earlier.
[0076] For task order i, considering the value function value V i and three time-related variables: urgency U i , no-earlier-than factor W i , and time margin value Y i , a sorting priority function VY i is constructed, and its definition is as follows:
[0077]
[0078] Among them, the three items in the parentheses are all time constraints. The more urgent the order and the smaller the time margin, the higher the priority. Orders that do not meet the no-earlier-than constraint have a lower priority. V i is the order value, and f(V i ) is obtained under the positive correlation function mapping as the weight of the time constraint. The greater the value, the higher the priority assigned to the order. k U , k W , k Y are the weights of the urgency U i , the no-earlier-than factor W i , and the time margin value Y i . There are several groups of weight values available for background adjustment; Y i is placed in the denominator to satisfy that the smaller the time margin value, the larger the priority function. Taking the square root is to slow down the growth rate of the priority function, and const is a stability normal constant to prevent the result from tending to infinity when the denominator is 0. The urgency U i and the no-earlier-than factor W i are both dimensionless numbers, so no further normalization is required. N() is a function that linearly normalizes the time margin value.
[0079] Combining the priority functions VY of all task orders i, construct a profitability index function. When there are a large number of task orders but limited equipment and resources, and not all orders can be executed, the maximum of the task priority function that is expected to be scheduled within the time period [T0, T1] is calculated according to the sliding window. In addition, there is a coupling relationship of precedence between some task orders. For example, in manufacturing, the processing process has a strict order. Therefore, the optimization problem also needs to consider the precedence constraint. The prior relationship of tasks is a logical relationship used to describe the relative time order of tasks, and activities influence and are related to each other. Therefore, the optimization problem with constraints is constructed as follows:
[0080] max F=∑ keI(T0,T1) VY k ,
[0081] s.t.s k1 >s k2 ,
[0082] S k3 >S k4 >S k5 ,
[0083] s k6 >s k7 ,
[0084] …
[0085] where k ∈ I(T0, T1) represents the orders scheduled within the time period (T0, T1); s kj represents the sorting sequence number of order kj. The larger the number, the later it is ranked, comprehensively considering various situations where some orders have no precedence constraints and some orders have precedence constraints with multiple other orders.
[0086] (2) Sorting optimization algorithm
[0087] For the maximization requirement of the task priority function of the above task orders and the precedence coupling constraint, the following optimization method combining the backtracking method and the genetic algorithm can be used to select the order priority sorting scheme, optimizing the task order sorting problem from the perspective of satisfying constraints such as time and coupling between tasks. The backtracking method ensures the satisfaction of constraints to obtain a feasible scheme, and the genetic algorithm controls the evolution process.
[0088] First, the backtracking method means that the scheme goes through conflict resolution and backtracks to a lower-profit scheme state. This is because in the optimization and evolution process, in order to resolve conflicts, the tasks with conflicts in the aborted scheme are terminated to meet the constraint conditions. See Appendix Figure 1 . Its processing flow is shown in Appendix Figure 2 , including:
[0089] 1) The iterative process starts, and the initial time t = t0 is set;
[0090] 2) Determine the status of each activity, and release the equipment and resources occupied by the activities that end at time t;
[0091] 3) Determine the status of each activity, and allocate the equipment and resources required for the activities that start at time t;
[0092] 4) Determine whether there are constraint conflicts at time t. If there are constraint conflicts, adopt corresponding conflict resolution strategies to resolve the constraint conflicts;
[0093] 5) If t < T end then return to 2), where T end is the end time of the iterative process;
[0094] 6) Finally, obtain a solution without constraint conflicts.
[0095] The genetic algorithm represents the structure of the problem by means of chromosome encoding. In solving the optimization problem of task order sorting, each task occupies a position on the chromosome, and each chromosome encoding represents a solution, that is, the arrangement order of the task orders. These encodings can be operated, crossed, and mutated to generate new solutions, and then evaluated and selected through the fitness function. In the sorting problem with constraints, the encoding may need to meet certain restrictive conditions, such as time constraints, coupling constraints between tasks, etc. Therefore, the design of the encoding needs to consider how to represent the task order and ensure that the generated solutions are legal and meet the constraint conditions. In the genetic algorithm, new encodings are generated by operating on the encodings (such as crossing and mutating) and according to fitness evaluation, and finally an optimized sorting result that meets the constraint conditions is obtained.
[0096] For the single-objective optimization process combining the backtracking method and the genetic algorithm, see Appendix Figure 3 , and the specific steps are as follows:
[0097] 1) Initialize the population, and set the population size and the number of generations of evolution;
[0098] 2) Select the i-th chromosome. One chromosome represents a solution, and operate on the i-th chromosome;
[0099] 3) If the solution represented by the chromosome meets the domain constraints, go to 5), otherwise go to 4);
[0100] 4) Resolve the conflict through the backtracking iteration repair method, and use the corresponding conflict resolution strategy to backtrack the conflict solution to a feasible solution;
[0101] 5) Calculate the objective function of the feasible solution, that is, the weighted sum of the task priorities in the feasible solution;
[0102] 6) If i < I, i = i + 1 and return to 2), otherwise go to 7);
[0103] 7) If the maximum number of generations of evolution has not been reached, i.e., g < G, go to 8); otherwise, go to 9).
[0104] 8) Perform selection, crossover, and mutation on the current population, then g = g + 1 and go to 2).
[0105] 9) End the optimization process and obtain an optimized feasible solution.
[0106] Among them, I is the population size, and i ∈ [1, I] is the individual number; G is the maximum number of generations of evolution, and g ∈ [1, G] is the generation number of evolution.
[0107] In other embodiments of the present application, to fully carry out technical verification, the present invention provides sorting result simulations for 5 different types of tasks, with 10,000 orders for each type.
[0108] Taking Task A as an example, the current processing time is set to "2024 / 8 / 1 6:00", and the order information is shown in Table 1, including order ID number, importance score, whether it is urgent, start time, end time, duration, etc., where nan means not specified by the user and the form data is empty.
[0109] Table 1 Simulated 10,000 task order information
[0110]
[0111]
[0112] By combining the optimization process of the backtracking method and the genetic algorithm, the sorting results of 10,000 orders are obtained as shown in Table 2. The results include order value, urgency, time margin priority, priority function value, etc. It can be seen that urgent orders are ranked at the front, non-urgent orders that do not violate the no-earlier-than constraint are sorted according to the time margin, orders that do not meet the no-earlier-than constraint are ranked at the end, and the value function value plays a weighting role in the time constraint. The sorting results meet the requirements of the time constraint, and this algorithm is feasible. The running time of the algorithm is: 10.426 s.
[0113] Table 2 Sorting simulation results
[0114]
[0115]
Claims
1. A high-concurrency task sorting optimization method under complex constraints, characterized in that: The method comprises: Construct task value function; Build time constraints; Constructing a sorting priority function based on the task value function and the time constraint; Constructing backtracking algorithms; Constructing genetic algorithms; An order priority sorting scheme is selected based on the backtracking algorithm and the genetic algorithm.
2. The method according to claim 1, characterized in that The constructing task value function includes: According to the characteristics of the task, the value-related factors are extracted, and each factor is normalized to construct the task value function.
3. The method according to claim 1, characterized in that The construction time constraints include: According to whether different orders need to be executed as soon as possible, the start time constraint, and the end time constraint, the time urgency, no earlier than factor, and time margin are constructed respectively.
4. The method according to claim 1, characterized in that: The constructing a sorting priority function based on the task value function and the time constraint includes: Based on the three time constraint indicators, the sorting priority function is constructed by taking value as a weighting factor.
5. The method according to claim 1, characterized in that The backtracking algorithm is constructed, comprising: For the sequential coupling constraints between tasks, a backtracking algorithm is used to ensure that the constraints are satisfied to obtain a feasible solution.
6. The method according to claim 1, characterized in that The genetic algorithm is constructed, comprising: The task order sequence is constructed into chromosome encoding form, and the optimal solution is searched in a large range through crossover and mutation operations.
7. The method according to claim 2, characterized in that The task value function is: Where V i is the value of the i-th task; R j is a value-related factor; k j For R j Corresponding weights, j = 1, 2, ..., r, Among them, r is the number of relevant factors.
8. The method according to claim 4, characterized in that Based on the three time constraint indicators, the value is used as a weighting factor to construct a sorting priority function, including: For task order i, comprehensively consider the value function value V i and three time-related variables: urgency U i , no earlier than factor W i , time margin value Y i , construct the sorting priority function VY i , which is defined as follows: