Task allocation method based on two-stage genetic algorithm

Through two-stage genetic algorithm decomposes and sorts complex tasks, and combines heuristics and local search algorithms to match users, the dependency constraint problem in complex task allocation is solved, and task allocation efficiency and platform processing capabilities are improved.

CN119273095AActive Publication Date: 2025-01-07NAT UNIV OF DEFENSE TECH

Patent Information

Application Number
CN202411523080.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-01-07
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

The prior art is difficult to effectively solve the task dependency constraint problem in complex task allocation, resulting in inefficient task allocation and scarcity of user skills, making it difficult to deal with complex tasks.

Method used

A two-stage genetic algorithm is used to decompose complex tasks to ensure that subtasks are sorted by dependencies, and match users through genetic algorithms and heuristic algorithms, and combine local search algorithms to prevent local optimization, forming an efficient task allocation plan.

Benefits of technology

It improves the efficiency of complex task allocation and the platform's processing capabilities, ensures that subtasks are completed in sequence, improves the effectiveness of user-subtask matching, and avoids task waiting and skill scarcity problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119273095A_ABST
    Figure CN119273095A_ABST
Patent Text Reader

Abstract

The invention relates to a task allocation method based on a two-stage genetic algorithm. The method comprises the steps of obtaining a constructed task allocation model; comprising tasks and users; each task is divided into a plurality of sub-tasks; in a preset maximum number of iterations, a genetic algorithm is adopted to carry out crossover and mutation on the currently iterated subtask execution sequence to obtain an optimized subtask execution sequence, and it is ensured that the subtasks must be executed after the front subtasks having the dependency relationship with the subtasks are completed; matching users for sub-tasks in the optimized sub-task execution sequence to construct a task allocation scheme, and obtaining an intermediate task allocation scheme by adopting a heuristic algorithm and a scoring function; and exploring a neighborhood solution of the intermediate task allocation scheme by adopting a local search algorithm, and selecting a current iterative optimization task allocation scheme from the neighborhood solution according to the scoring function. By adopting the method, an efficient task allocation scheme can be provided for a crowdsourcing platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of crowdsourcing technology, and in particular to a task allocation method based on a two-stage genetic algorithm. Background Art

[0002] For crowdsourcing systems, task allocation has a crucial impact on the overall performance of the system. Conventional task allocation primarily matches users with tasks based on constraints such as time windows, skills, and distance. However, this approach only addresses simple tasks, such as capturing a landmark image to update its status in mapping software. While research on complex task allocation has gained momentum in recent years, it still cannot address the allocation of complex, multi-stage tasks.

[0003] Tasks collected through crowdsourcing platforms can be simple and easy to complete. For example, Simoni proposed an order batching and allocation algorithm for food delivery, and Zhu Zhengqiu implemented swarm sensing intelligence for traffic monitoring through the organization and operation of decentralized autonomous vehicles. However, crowdsourcing tasks can sometimes be complex, such as repairing a house, organizing a sporting event, or preparing for a party. These tasks often consist of multiple stages and require the collaboration of multiple users with different skills, which poses additional challenges to task allocation.

[0004] To address the complex task allocation problem in spatial crowdsourcing, existing research typically considers constraints such as skills, time, distance, and budget. Cheng et al. proposed a gD&C algorithm to match complex tasks with a group of users that meet specified constraints. Liang et al. proposed a cost-based greedy approach that minimizes platform costs by matching a group of suitable workers to complete spatial tasks under worker and task constraints.

[0005] However, these studies often ignore the dependencies between tasks, resulting in inefficient task allocation. After arriving at a task, assigned users may have to wait for a long time until the previous task is completed. Furthermore, for complex tasks, it is difficult to find a group of users with all the required skills, as users are often scarce. This scarcity can make crowdsourcing platforms unable to handle certain complex tasks. Summary of the Invention

[0006] Based on this, it is necessary to provide a task allocation method based on a two-stage genetic algorithm to address the above technical problems, so as to provide an efficient task allocation solution for complex tasks for crowdsourcing platforms.

[0007] A task allocation method based on a two-stage genetic algorithm, the method comprising:

[0008] Obtain the constructed task allocation model; the task allocation model includes tasks and users; each task is divided into multiple subtasks;

[0009] Within the preset maximum number of iterations, the task allocation scheme is optimized according to the two-stage genetic algorithm; the details are as follows:

[0010] A genetic algorithm is used to perform crossover and mutation operations on the subtask execution sequence of the current iteration to obtain the optimized subtask execution sequence of the current iteration, ensuring that the subtasks in the sequence must be executed only after the predecessor subtasks with which they have dependencies are completed. The subtask execution sequence of the current iteration consists of two parts: the subtask execution sequence obtained by reinitialization of the current iteration, and the optimized subtask execution sequence of the previous iteration.

[0011] To optimize the matching of subtasks to users in the subtask execution sequence and thus construct a task allocation scheme, a heuristic algorithm and a scoring function are used to obtain the intermediate task allocation scheme for the current iteration; the scoring function is constructed based on the objective function of the task allocation model;

[0012] A local search algorithm is used to explore the neighborhood solutions of the intermediate task allocation scheme, and the optimized task allocation scheme for the current iteration is selected from the neighborhood solutions based on the scoring function.

[0013] A task allocation device based on a two-stage genetic algorithm, the device comprising:

[0014] A task allocation model construction module is used to obtain a constructed task allocation model; the task allocation model includes tasks and users; each task is divided into multiple subtasks;

[0015] The two-stage genetic algorithm execution module is used to optimize the task allocation scheme according to the two-stage genetic algorithm within a preset maximum number of iterations; the details are as follows:

[0016] A genetic algorithm is used to perform crossover and mutation operations on the subtask execution sequence of the current iteration to obtain the optimized subtask execution sequence of the current iteration, ensuring that the subtasks in the sequence must be executed only after the predecessor subtasks with which they have dependencies are completed. The subtask execution sequence of the current iteration consists of two parts: the subtask execution sequence obtained by reinitialization of the current iteration, and the optimized subtask execution sequence of the previous iteration.

[0017] To optimize the matching of subtasks to users in the subtask execution sequence and thus construct a task allocation scheme, a heuristic algorithm and a scoring function are used to obtain the intermediate task allocation scheme for the current iteration; the scoring function is constructed based on the objective function of the task allocation model;

[0018] A local search algorithm is used to explore the neighborhood solutions of the intermediate task allocation scheme, and the optimized task allocation scheme for the current iteration is selected from the neighborhood solutions based on the scoring function.

[0019] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0020] Obtain the constructed task allocation model; the task allocation model includes tasks and users; each task is divided into multiple subtasks;

[0021] Within the preset maximum number of iterations, the task allocation scheme is optimized according to the two-stage genetic algorithm; the details are as follows:

[0022] A genetic algorithm is used to perform crossover and mutation operations on the subtask execution sequence of the current iteration to obtain the optimized subtask execution sequence of the current iteration, ensuring that the subtasks in the sequence must be executed only after the predecessor subtasks with which they have dependencies are completed. The subtask execution sequence of the current iteration consists of two parts: the subtask execution sequence obtained by reinitialization of the current iteration, and the optimized subtask execution sequence of the previous iteration.

[0023] To optimize the matching of subtasks to users in the subtask execution sequence and thus construct a task allocation scheme, a heuristic algorithm and a scoring function are used to obtain the intermediate task allocation scheme for the current iteration; the scoring function is constructed based on the objective function of the task allocation model;

[0024] A local search algorithm is used to explore the neighborhood solutions of the intermediate task allocation scheme, and the optimized task allocation scheme for the current iteration is selected from the neighborhood solutions based on the scoring function.

[0025] The above-mentioned task allocation method, device and computer equipment based on the two-stage genetic algorithm first decompose the complex task into multiple subtasks with different skill requirements, and establish a spatial crowdsourcing complex task allocation model with dependency relationships; then, a two-stage genetic algorithm is proposed to solve the task allocation problem, and finally a spatial crowdsourcing task allocation method based on the two-stage genetic algorithm with dependency relationships is formed. For the allocation of complex tasks, the process can be divided into two stages: determining the order of completing subtasks and matching these subtasks with users. In the subtask sequence optimization stage, various sorting schemes for subtasks are encoded and then optimized using a genetic algorithm. In the user-subtask matching optimization stage, a sequential subtask-user matching method is used, and a fusion local search algorithm is used to explore neighborhood solutions to prevent falling into local optimality. In summary, the present invention can provide an effective task allocation solution for crowdsourcing platforms in complex task allocation. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 1 is a flow chart of a task allocation method based on a two-stage genetic algorithm in one embodiment;

[0027] Figure 2Schematic diagram of encoding and decoding for task assignment problems;

[0028] Figure 3 It is a schematic diagram of a single point crossover;

[0029] Figure 4 This is a schematic diagram of task crossing;

[0030] Figure 5 Schematic diagram of task variation;

[0031] Figure 6 Design a flow chart for the two-stage genetic algorithm algorithm;

[0032] Figure 7 Schematic diagram of the method for constructing neighborhood solutions

[0033] Figure 8 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to 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.

[0035] In one embodiment, Figure 1 As shown, a task allocation method based on a two-stage genetic algorithm is provided, comprising the following steps:

[0036] Step 102: Obtain the constructed task allocation model.

[0037] The crowdsourcing platform regularly publishes a set of complex tasks T = {t1, t2, ..., t n} and assign it to a group of users, denoted as U = {u1,u2,...,u p For each complex task t, its basic attributes include location l t , time window [τs t ,τe t ], where τs t is the release time of the task, τe t is the deadline of the task. When the task is completed, the crowdsourcing platform can obtain the corresponding income b t .

[0038] For complex crowd sensing tasks, i , which can usually be divided into several stages, namely Where s represents the number of stages, which divides complex tasks into multiple subtasks with different skill requirements and assigns these subtasks to appropriate users. This method can effectively enhance the platform's ability to handle complex tasks. Each stage of a complex task can be regarded as a subtask, and there may be dependencies between subtasks. If there is a predecessor subtask It can only be used in subtasks Execute after completion. All subtasks need to be completed by users with specific skills. Its skill requirements can be expressed as Subtasks must be completed within their time windows.

[0039] In this method, each subtask The time window and the task t to which it belongs i Keep it consistent. For task t i , the benefit of the entire task is shared by several subtasks, namely in Indicates that a subtask is completed of income.

[0040] Users on the platform have different starting positions u , time window [τs u ,τe u ]. Users can use different speeds ρ u Mobile, each user may correspond to a different unit mobile cost c u In addition, considering that these users may have heterogeneous skills, the skill set mastered by user u can be recorded as Sk u Within the time window specified by the user, the platform can guide the user to the designated task location to complete the task.

[0041] Step 104: Optimize the task allocation scheme according to the two-stage genetic algorithm within a preset maximum number of iterations.

[0042] The details are as follows:

[0043] 1) A genetic algorithm is used to perform crossover and mutation operations on the subtask execution sequence of the current iteration to obtain the optimized subtask execution sequence of the current iteration, and to ensure that the subtasks must be executed after the predecessor subtasks with which they have dependencies are completed.

[0044] The subtask execution sequence of the current iteration consists of two parts: the subtask execution sequence obtained by reinitialization of the current iteration, and the optimized subtask execution sequence of the previous iteration.

[0045] 2) In order to optimize the matching of subtasks with users in the subtask execution sequence, a task allocation scheme is constructed and the intermediate task allocation scheme of the current iteration is obtained using a heuristic algorithm and a scoring function.

[0046] The scoring function is constructed based on the objective function of the task assignment model. For example, if the objective function is to maximize the platform's total profit, and total profit can be calculated by the user's mobility cost of performing the task and the reward the platform receives after the user completes the task, then the scoring function can be constructed based on the user's mobility cost of performing the task and the reward the platform receives after the user completes the task in the corresponding task assignment scheme. The objective function can also be to maximize the task completion rate or minimize the mobility cost.

[0047] 3) A local search algorithm is used to explore the neighborhood solutions of the intermediate task allocation scheme, and the optimized task allocation scheme for the current iteration is selected from the neighborhood solutions based on the scoring function.

[0048] Genetic algorithms greedily assign the highest-rated user to each subtask. This greedy search can lead to local optimization. Therefore, to improve the effectiveness of the user-subtask matching phase, local search algorithms, such as tabu search or simulated annealing, are further incorporated. Local search algorithms iteratively explore the neighborhood of the current solution, ultimately converging on the optimal solution.

[0049] In this two-stage genetic algorithm-based task allocation method, a complex task is first decomposed into multiple subtasks with different skill requirements, establishing a spatial crowdsourcing complex task allocation model with dependencies. A two-stage genetic algorithm is then proposed to solve the task allocation problem, ultimately resulting in a two-stage genetic algorithm-based spatial crowdsourcing task allocation method that considers dependencies. The complex task allocation process can be divided into two stages: determining the order in which to complete subtasks and matching these subtasks with users. In the subtask sequence optimization stage, various subtask ordering schemes are encoded and then optimized using a genetic algorithm. In the user-subtask matching optimization stage, a sequential subtask-user matching method is used to decode the task allocation scheme based on the ordered subtasks.

[0050] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0051] In one embodiment, the objective function of the task allocation model is constructed as follows:

[0052] Based on the time each user takes to move along their task path, the total execution time of all subtasks on their task path, and the unit movement cost, the movement cost of each user in the process of executing the assigned subtask is calculated:

[0053] C(P u )=c u ·(Tt(P u )+Pt(P u ));

[0054] Among them, C(P u ) represents the user's mobility cost in the process of performing the assigned subtask, P u represents the user's task path, Tt(P u ) represents the time it takes for the user to move along the task path. The time it takes to move can be calculated by the total distance P of the path. u The distance between different locations is calculated based on the Euclidean distance. u ) represents the total execution time of all subtasks on the task path, c u It is understood that the result of task allocation is the moving path P of each user. u , which is represented by a sequence consisting of several subtasks assigned to the user.

[0055] Calculate the rewards that each user receives from the platform after completing the assigned subtasks:

[0056]

[0057] Among them, R(P u ) represents the reward the platform receives after the user completes the assigned subtask. represents the mth subtask in the i-th task, It represents the reward that the user receives from the platform after completing the mth subtask in the i-th task.

[0058] At each timestamp, since a user can complete at most one subtask, and each subtask requires at most one user to complete, the task assignment problem is actually a user-task matching problem. The objective function is constructed based on the user's mobility cost during the execution of the assigned subtask, the platform reward after the user completes the assigned subtask, and the constraints:

[0059] maxΣ u∈U [R(P u )-C(P u )];

[0060]

[0061] Where U represents the user set, formula (a) indicates that the user needs to complete the assigned subtask within its execution time window, [τs u ,τe u ] represents the user's execution time window, and formula (b) indicates that the assigned subtask needs to be completed within its task time window. Indicates the start time of the mth subtask in the i-th task, represents the execution time of the mth subtask in the i-th task, [τs t ,τe t ] represents the task time window, formula (c) means that the task can only be executed when all the predecessor subtasks of the mth subtask in the ith task are completed, formula (d) means that the user needs to have the required skills to complete the assigned subtasks, and formula (e) means that each subtask can only be completed once.

[0062] In one embodiment, a genetic algorithm is used to perform crossover and mutation operations on the subtask sequence of the current iteration to obtain an optimized subtask execution sequence of the current iteration, including:

[0063] 1) Encode the subtasks in each task separately, and connect all the encoded subtasks in a certain order to form multiple subtask sequences, which serve as the initialization subtask sequence of the genetic algorithm in the current iteration.

[0064] For example, the oth subtask in the jth task can be encoded as a gene (j, o), so a subtask sequence can be regarded as a chromosome. The dependency between subtasks is implicitly represented by their connection order, that is, a subtask on a chromosome must be connected after all its related subtasks are connected. During the chromosome decoding process, subtasks are matched with suitable users in turn to form a task allocation scheme (j, o, m). If there is no suitable user to be assigned to subtask (j, o), the corresponding assigned user m is set to -1. Figure 2 As shown, due to the time window limitation, no user can be assigned to the subtask Therefore, according to the dependency relationship, the subtask Cannot be assigned to any user because it depends on a subtask

[0065] The subtask execution sequence of the current iteration is composed of the initialization subtask execution sequence in the current iteration and the optimization subtask execution sequence of the previous iteration.

[0066] 2) Perform crossover and mutation operations on the current subtask execution sequence. If there are subtasks in the intermediate subtask sequence obtained after the mutation operation that do not satisfy the dependency relationship, then swap the order of the subtasks that do not satisfy the dependency relationship in the intermediate subtask execution sequence to obtain an optimized subtask execution sequence.

[0067] In one embodiment, the crossover operation is a single-point crossover or a task crossover; wherein:

[0068] 1) Single-point crossover is specifically as follows: select a subtask as the intersection point in the first parent-generation subtask execution sequence, then copy all subtasks to the left of the intersection point to the corresponding positions on the child subtask execution sequence, and copy the subtasks to the right of the intersection point to the vacant positions on the child subtask execution sequence in the order in which they appear in the second parent-generation subtask execution sequence.

[0069] like Figure 3 A schematic diagram of a single-point crossover is provided as shown in Figure 1. The steps are as follows: First, a subtask is selected on chromosome A as the intersection point. Then, all subtasks located to the left of the intersection point of subtask A are copied to the corresponding positions on the daughter chromosome. The remaining subtasks are copied sequentially in the order they appear on chromosome B, following the crossover point on the daughter chromosome.

[0070] 2) Task crossing is specifically as follows: all subtasks of several tasks are randomly selected from the first parent-generation subtask execution sequence, and copied to the same position on the child-generation subtask execution sequence according to their appearance in the first parent-generation subtask execution sequence; then the remaining subtasks in the first parent-generation subtask execution sequence are copied to the vacant positions on the child-generation subtask execution sequence in the order in which they appear in the second parent-generation subtask execution sequence.

[0071] like Figure 4 Figure 1 provides a schematic diagram of task crossover. The steps are as follows: First, several subtasks are randomly selected from the task and copied to the corresponding positions on the daughter chromosome according to their appearance in chromosome A. Second, the remaining subtasks are copied to the vacant positions on the daughter chromosome in the order they appear in chromosome B.

[0072] In one embodiment, the mutation operation is a task mutation or a subtask mutation; wherein:

[0073] 1) Task mutation is as follows: randomly select all subtasks of two tasks from the parent subtask execution sequence, and swap the positions of subtasks with the same subtask number in order. Figure 5 As shown, a schematic diagram of task variation is provided.

[0074] If the number of subtasks of two tasks is not equal, they are swapped based on the smaller number of subtasks of the two tasks, that is, only the first n subtasks are swapped, where n is the minimum number of subtasks.

[0075] 2) Subtask mutation is as follows: randomly select two subtasks from the parent subtask execution sequence and swap the positions of the two subtasks;

[0076] like Figure 6 As shown, a two-stage genetic algorithm algorithm design flow chart is provided.

[0077] In one embodiment, a local search algorithm is used to explore neighborhood solutions for the intermediate task allocation scheme, including:

[0078] Randomly select two subtasks from the intermediate task allocation plan as mutation points;

[0079] For the subtasks before the first mutation point, users are assigned according to the intermediate task allocation scheme;

[0080] For the subtasks at two mutation points, a user is selected from the candidate users to mutate the subtask; the candidate user is the user who meets the skill constraint of the subtask. The present invention also adds -1, which means that the subtask cannot be assigned, so as to increase the range of neighborhood solutions.

[0081] The remaining subtasks are reallocated to users according to heuristic rules.

[0082] like Figure 7 As shown, a schematic diagram of the method for constructing a neighborhood solution is provided.

[0083] In summary, the present invention first models the complex task allocation in spatial crowdsourcing, decomposing the complexity into multiple stages, which are each subtask, and the subtasks have dependencies. An objective function is established based on the goals of the crowdsourcing platform, such as maximizing profits. Relevant constraints are established based on the characteristics of the scenario, such as time window constraints, dependency constraints, skill constraints, etc. Then, a genetic algorithm is used to optimize the subtask sorting to obtain different subtask sorting schemes. These sorting schemes are matched between each subtask and the user using a sequential decision method to obtain the corresponding task allocation scheme. Since the sequential decision method is based on heuristic rules, the results obtained often fall into local optimal solutions. Therefore, in the second stage, a variant algorithm is formed by integrating local search algorithms such as taboo search or simulated annealing. By exploring neighborhood solutions, it avoids falling into local optimal solutions. In combination with the above steps, the problem is solved using a two-stage genetic algorithm. Combined with the scenario characteristics, it can be used to solve problems in various subsequent scenarios and obtain effective task allocation schemes according to the requirements of the objective function.

[0084] In one embodiment, a task allocation device based on a two-stage genetic algorithm is provided, comprising a task allocation model construction module and a two-stage genetic algorithm execution module, wherein:

[0085] A task allocation model construction module is used to obtain a constructed task allocation model; the task allocation model includes tasks and users; each task is divided into multiple subtasks;

[0086] The two-stage genetic algorithm execution module is used to optimize the task allocation scheme according to the two-stage genetic algorithm within a preset maximum number of iterations; the details are as follows:

[0087] A genetic algorithm is used to perform crossover and mutation operations on the subtask execution sequence of the current iteration to obtain the optimized subtask execution sequence of the current iteration, ensuring that the subtasks in the sequence must be executed only after the predecessor subtasks with which they have dependencies are completed. The subtask execution sequence of the current iteration consists of two parts: the subtask execution sequence obtained by reinitialization of the current iteration, and the optimized subtask execution sequence of the previous iteration.

[0088] To optimize the matching of subtasks to users in the subtask execution sequence and thus construct a task allocation scheme, a heuristic algorithm and a scoring function are used to obtain the intermediate task allocation scheme for the current iteration; the scoring function is constructed based on the objective function of the task allocation model;

[0089] A local search algorithm is used to explore the neighborhood solutions of the intermediate task allocation scheme, and the optimized task allocation scheme for the current iteration is selected from the neighborhood solutions based on the scoring function.

[0090] The specific definition of the task allocation X device based on a two-stage genetic algorithm can be found in the definition of the task allocation method based on a two-stage genetic algorithm described above and will not be repeated here. Each module in the above-described task allocation device based on a two-stage genetic algorithm can be implemented in whole or in part via software, hardware, or a combination thereof. Each of the above-described modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.

[0091] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store task data published by the crowdsourcing platform and user-related information. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a task allocation method based on a two-stage genetic algorithm is implemented.

[0092] Those skilled in the art will understand that Figure 8 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0093] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.

[0094] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the above embodiment are implemented.

[0095] Those skilled in the art will appreciate that all or part of the processes in the above-described embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described embodiments. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAM bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).

[0096] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0097] The above-described embodiments merely illustrate several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that a person skilled in the art would be able to make numerous modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.

Claims

1. A task allocation method based on a two-stage genetic algorithm, characterized in that: The method comprises: Acquire a constructed task allocation model; the task allocation model includes tasks and users; each task is divided into multiple subtasks; Within the preset maximum number of iterations, the task allocation scheme is optimized according to the two-stage genetic algorithm; the details are as follows: A genetic algorithm is used to perform crossover and mutation operations on the subtask execution sequence of the current iteration to obtain the optimized subtask execution sequence of the current iteration, and ensure that the subtasks in the sequence must be executed after the predecessor subtasks with which they have dependencies are completed; the subtask execution sequence of the current iteration consists of two parts: the subtask execution sequence obtained by reinitializing the current iteration, and the optimized subtask execution sequence of the previous iteration; In order to optimize the matching of subtasks to users in the subtask execution sequence, a task allocation scheme is constructed, and a heuristic algorithm and a scoring function are used to obtain the intermediate task allocation scheme of the current iteration; the scoring function is constructed according to the objective function of the task allocation model; A local search algorithm is used to explore the neighborhood solutions of the intermediate task allocation scheme, and the optimized task allocation scheme of the current iteration is selected from the neighborhood solutions again according to the scoring function.

2. The method according to claim 1, characterized in that The basic attributes of each task include: task location and task time window; the task time window is constructed by the task release time and task deadline; Each subtask is consistent with the time window of the task to which it belongs; The basic attributes of each user include: starting location, execution time window, and skill set.

3. The method according to claim 1, characterized in that The steps to construct the objective function of the task allocation model are as follows: Based on the time taken by each user to move along his task path, the total execution time of all subtasks on his task path, and the unit movement cost, the movement cost of each user in the process of executing the assigned subtask is calculated: C(P u )=c u ·(Tt(P u )+Pt(P u )); Among them, C(P u ) represents the movement cost of the user in the process of performing the assigned subtask, P u represents the user's task path, Tt(P u ) represents the time it takes for the user to move along the task path, Pt(P u ) represents the total execution time of all subtasks on the task path, c u represents the unit movement cost of the user; Calculate the rewards that each user receives from the platform after completing the assigned subtasks: Among them, R(P u ) represents the reward the platform receives after the user completes the assigned subtask. represents the mth subtask in the i-th task, It indicates the reward that the platform receives after the user completes the mth subtask in the i-th task; The objective function is constructed based on the movement cost of the user in the process of performing the assigned subtask, the reward obtained by the platform after the user completes the assigned subtask, and the constraints: maxΣ u∈U [R(P u )-C(P u )]; Where U represents the user set, formula (a) means that the user needs to complete the assigned subtask within its execution time window, [τs u ,τe u ] represents the user's execution time window, and formula (b) indicates that the assigned subtask needs to be completed within its task time window. represents the start time of the mth subtask in the ith task, represents the execution time of the mth subtask in the ith task, [τs t ,τe t ] represents the task time window, formula (c) means that the task can only be executed when all the predecessor subtasks of the mth subtask in the ith task are completed, formula (d) means that the user needs to have the required skills to complete the assigned subtasks, and formula (e) means that each subtask can only be completed once.

4. The method according to claim 1, characterized in that: The genetic algorithm is used to perform crossover and mutation operations on the subtask execution sequence of the current iteration to obtain the optimized subtask execution sequence of the current iteration, including: Encode the subtasks in each task separately, and connect all the encoded subtasks in a certain order to form multiple subtask execution sequences, which serve as the initialization subtask execution sequence of the genetic algorithm in the current iteration; the dependency between subtasks is implicitly represented by their connection order; The subtask execution sequence of the current iteration is composed of the initialization subtask execution sequence in the current iteration and the optimization subtask execution sequence of the previous iteration; Perform crossover and mutation operations on the current subtask execution sequence. If there are subtasks in the intermediate subtask sequence obtained after the mutation operation that do not satisfy the dependency relationship, then swap the order of the subtasks that do not satisfy the dependency relationship in the intermediate subtask execution sequence to obtain an optimized subtask execution sequence.

5. The method according to claim 4, characterized in that The crossover operation is a single-point crossover or a task crossover; wherein: The specific method of single-point crossover is as follows: select a subtask as the intersection point in the first parent-generation subtask execution sequence, and then copy all subtasks on the left side of the intersection point to the corresponding positions on the child-generation subtask execution sequence, and copy the subtasks on the right side of the intersection point to the vacant positions on the child-generation subtask execution sequence in the order in which they appear in the second parent-generation subtask execution sequence; Task crossing is specifically as follows: all subtasks of several tasks are randomly selected from the first parent-generation subtask execution sequence, and copied to the same position on the child-generation subtask execution sequence according to their appearance in the first parent-generation subtask execution sequence; then the remaining subtasks in the first parent-generation subtask execution sequence are copied to the vacant positions on the child-generation subtask execution sequence in the order in which they appear in the second parent-generation subtask execution sequence.

6. The method according to claim 4, characterized in that The mutation operation is a task mutation or a subtask mutation; wherein: The specific task mutation is as follows: randomly select all subtasks of two tasks from the parent subtask execution sequence, and swap the positions of subtasks with the same subtask number in order; if the number of subtasks of two tasks is not equal, swap them according to the smaller number of subtasks of the two tasks; The subtask mutation is as follows: randomly select two subtasks from the parent subtask execution sequence and swap the positions of the two subtasks.

7. The method according to claim 1, characterized in that The local search algorithm is a taboo search algorithm or a simulated annealing algorithm.

8. The method according to claim 1, characterized in that A local search algorithm is used to explore the neighborhood solutions of the intermediate task allocation scheme, including: From the intermediate task allocation scheme, two subtasks are randomly selected as mutation points; For the subtasks before the first mutation point, users are assigned according to the intermediate task allocation scheme; For the subtasks at two mutation points, a user is selected from the candidate users to mutate the subtask; the candidate user refers to a user who meets the technical constraints of the subtask; The remaining subtasks are reallocated to users according to the heuristic rules.

9. A task allocation device based on a two-stage genetic algorithm, characterized in that: The device comprises: A task allocation model construction module is used to obtain a constructed task allocation model; the task allocation model includes tasks and users; each task is divided into multiple subtasks; The two-stage genetic algorithm execution module is used to optimize the task allocation scheme according to the two-stage genetic algorithm within a preset maximum number of iterations; the details are as follows: A genetic algorithm is used to perform crossover and mutation operations on the subtask execution sequence of the current iteration to obtain the optimized subtask execution sequence of the current iteration, and ensure that the subtasks in the sequence must be executed after the predecessor subtasks with which they have dependencies are completed; the subtask execution sequence of the current iteration consists of two parts: the subtask execution sequence obtained by reinitializing the current iteration, and the optimized subtask execution sequence of the previous iteration; In order to optimize the matching of subtasks to users in the subtask execution sequence, a task allocation scheme is constructed, and a heuristic algorithm and a scoring function are used to obtain the intermediate task allocation scheme of the current iteration; the scoring function is constructed according to the objective function of the task allocation model; A local search algorithm is used to explore the neighborhood solutions of the intermediate task allocation scheme, and the optimized task allocation scheme of the current iteration is selected from the neighborhood solutions again according to the scoring function.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Complex task online distribution method based on TDDS algorithm in MCS system

    CN117062155A

  • Task allocation optimization method and system based on genetic algorithm

    CN118821987A

Cited By

  • Task management method and project management system for scientific research platform

    CN119476899A