Task scheduling method and device, electronic equipment and medium
By obtaining task and resource information, determining priorities and using scheduling algorithms to automatically arrange tasks, the problem of low efficiency in manual scheduling is solved and real-time and efficient scheduling of tasks is achieved.
Patent Information
- Application Number
- CN202210122167.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-09
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2042-02-09
AI Technical Summary
In existing technologies, task scheduling often relies on manual processes, which cannot comprehensively consider global information, resulting in low task execution efficiency and long overall waiting time.
A task scheduling method is provided, which determines task priority by obtaining task and resource information, and automatically arranges tasks to resources using a preset scheduling algorithm to achieve real-time scheduling.
It improves task execution efficiency, reduces total waiting time, and enables real-time automated task scheduling.
Smart Images

Figure CN114399228B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, in particular, to the technical field of intelligent logistics, and more particularly to a task scheduling method and device, an electronic device, a computer readable storage medium and a computer program product. BACKGROUND
[0002] Task scheduling refers to scheduling a task to be executed to a resource for executing the task. Generally, the number of tasks to be executed is large, while the resources for executing the tasks are limited, so it is necessary to reasonably arrange a plurality of tasks to be executed to the limited resources to optimize the execution efficiency of the tasks.
[0003] The methods described in this section can not be the methods that have been previously conceived or adopted. Unless otherwise indicated, it should not be assumed that any of the methods described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, issues identified with respect to one or more methods should not be assumed to have been raised with respect to any prior art. SUMMARY
[0004] The present disclosure provides a task scheduling method and device, an electronic device, a computer readable storage medium and a computer program product.
[0005] According to an aspect of the present disclosure, a task scheduling method is provided, comprising: obtaining task information of each of a plurality of target tasks to be scheduled and available resource information of each of a plurality of target resources available, each target resource being configured to execute one or more target tasks; determining a priority of each target task based on the corresponding task information to obtain a plurality of target tasks each corresponding to a priority; and for each priority corresponding to a plurality of target tasks, determining a corresponding target resource and execution time of each target task in the plurality of target tasks from the plurality of target resources based on the task information of the plurality of target tasks and the available resource information of each of the plurality of target resources using a preset scheduling algorithm.
[0006] According to an aspect of the present disclosure, a task scheduling apparatus is provided, comprising: an obtaining module configured to obtain task information of each of a plurality of target tasks to be scheduled and available resource information of each of a plurality of target resources available, each target resource being configured to execute one or more target tasks; a determining module configured to determine a priority of each target task based on the corresponding task information, to obtain a plurality of target tasks corresponding to each priority; and a scheduling module configured to, for each plurality of target tasks corresponding to each priority, determine a corresponding target resource and execution time of each target task in the plurality of target tasks from the plurality of target resources based on the task information of the plurality of target tasks and the available resource information of each of the plurality of target resources, by using a preset scheduling algorithm.
[0007] According to an aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above method.
[0008] According to an aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is provided, the computer instructions being used to cause a computer to perform the above method.
[0009] According to an aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the above method.
[0010] According to one or more embodiments of the present disclosure, real-time automatic scheduling of tasks can be achieved, execution efficiency of tasks can be improved, and total waiting time can be reduced.
[0011] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS
[0012] The accompanying drawings, which are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification, illustrate exemplary embodiments and together with the description serve to explain exemplary implementations of the embodiments. The illustrated embodiments are merely examples and do not limit the scope of the claims. In all the drawings, like reference numerals refer to like elements, but not necessarily on the same scale.
[0013] Figure 1 A flowchart of a task scheduling method according to an embodiment of the present disclosure is shown;
[0014] Figure 2A flow chart of a transportation task scheduling process according to an embodiment of the present disclosure is shown;
[0015] Figure 3 A flow chart of an artificial bee colony algorithm according to an embodiment of the present disclosure is shown;
[0016] Figure 4 An iteration effect diagram of the artificial bee colony algorithm according to an embodiment of the present disclosure is shown;
[0017] Figure 5 A schematic diagram of a transportation task scheduling result according to an embodiment of the present disclosure is shown;
[0018] Figure 6 A structural block diagram of a task scheduling apparatus according to an embodiment of the present disclosure is shown; and
[0019] Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0020] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to help understanding, and should be considered as merely exemplary. Thus, those skilled in the art should recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, for the sake of brevity and clarity, descriptions of well-known functions and constructions are omitted from the following description.
[0021] In the present disclosure, the terms "first", "second", and the like are used to describe various elements only and do not intend to limit the positional relationship, the time sequence relationship, or the importance relationship of the elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element can refer to the same instance of the element, and in some cases, based on the context of the description, they can also refer to different instances.
[0022] The terms used in the description of various described examples in the present disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the number of elements is specifically limited, the element can be one or more than one, if the number of elements is not specifically limited. In addition, the term "and / or" used in the present disclosure encompasses any one of the listed items and all possible combinations thereof.
[0023] Task scheduling refers to scheduling tasks to be executed to resources for executing the tasks. Generally, the number of tasks to be executed is large, and the resources for executing the tasks are limited, so it is necessary to reasonably arrange a plurality of tasks to be executed to limited resources to optimize the execution efficiency of the tasks.
[0024] For example, the task to be scheduled can be a cargo transportation task, and the resource for executing the cargo transportation task can be a transportation site. Each transportation task needs to be arranged to be executed at a suitable time period of a suitable transportation site. That is, a transportation tool currently carrying the cargo transportation task is arranged to be at a certain time period of a certain transportation site to complete the loading (or unloading) of the cargo.
[0025] In the related art, task scheduling is often completed manually, that is, a worker arranges a plurality of tasks to be executed. Since the worker has limited energy, the worker can only focus on local information when performing task scheduling, and cannot comprehensively consider global information, resulting in poor overall scheduling, low execution efficiency of the tasks, and long overall waiting time.
[0026] To solve the above problems, the present disclosure provides a task scheduling method, which can comprehensively consider a plurality of target tasks to be currently scheduled and a plurality of target resources available at present, realize real-time automatic scheduling of the tasks, improve the execution efficiency of the tasks, and reduce the overall waiting time.
[0027] Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0028] Figure 1 A flowchart of a task scheduling method 100 according to an embodiment of the present disclosure is shown. The method 100 is performed by an electronic device (for example, the electronic device 700 below). As shown in the figure, Figure 1 The method 100 includes the following steps.
[0029] In step S110, task information of each of a plurality of target tasks to be currently scheduled and available resource information of each of a plurality of target resources available at present are obtained, each target resource being configured to execute one or more target tasks.
[0030] In step S120, a priority of each target task is determined based on the corresponding task information, to obtain a plurality of target tasks each corresponding to a priority.
[0031] In step S130, for each priority corresponding to a plurality of target tasks, a target resource and an execution time corresponding to each target task in the plurality of target tasks are determined from the plurality of target resources based on the task information of the plurality of target tasks and the available resource information of each of the plurality of target resources, by using a preset scheduling algorithm.
[0032] According to an embodiment of the present disclosure, the priority of each target task to be currently scheduled is determined, and for each priority, a plurality of target tasks of the priority are arranged to a corresponding target resource and time (i.e., execution time) by using a preset scheduling algorithm, which realizes real-time automatic scheduling of the tasks, improves the execution efficiency of the tasks, and reduces the overall waiting time.
[0033] The following detailed description is made to each step of the method 100.
[0034] In step S110, task information of each of a plurality of target tasks to be scheduled and available resource information of each of a plurality of target resources available at present are acquired, each target resource being configured to execute one or more target tasks.
[0035] It should be noted that, in the embodiments of the present disclosure, "plurality" means at least two.
[0036] The task scheduling method of the present disclosure can be applied to any application scenario, and accordingly, the target task can be a task to be scheduled in any application scenario, and the target resource can be a resource for executing the target task in any application scenario. For example, in a logistics scenario, the target task can be a cargo transportation task, and the target resource can be a transportation site (such as a port, a freight station, a logistics transfer station, etc.) for performing cargo transportation (transshipment). For another example, in a service scenario, a user can need to go to a service place to handle a certain business (such as medical service, mobile communication service, etc.), and accordingly, the target task can be a business to be handled by the user, and the target resource can be a service window in the service place for handling the business.
[0037] Each target task has corresponding task information. The task information is attribute information of the target task, including but not limited to a planned starting execution time of the target task (which can be a time reserved by a user, or a time estimated by an electronic device according to a certain algorithm, etc.), a planned execution duration, a planned latest execution end time, a task type, etc.
[0038] Each target resource has corresponding available resource information. The available resource information is attribute information of the target resource, including but not limited to available time of the target resource, a resource type, etc. The resource type may, for example, be a type of target task that can be handled by the target resource.
[0039] In step S120, based on the corresponding task information, a priority of each target task is determined to obtain a plurality of target tasks each corresponding to a priority.
[0040] According to some embodiments, in the case where the target task is a transportation task, the task information can include actual arrival time and planned arrival time of each of a plurality of transportation tools (such as vehicles, ships, etc.) for executing the transportation task. Accordingly, the priority of the target task can be determined based on a time difference between the actual arrival time and the planned arrival time of the transportation tool. In this way, the overall scheduling can be orderly.
[0041] The priority of the target task can be determined in various ways.
[0042] According to some embodiments, the priority of a transportation task in which the transportation tool arrives early (i.e., the actual arrival time is earlier than the scheduled arrival time) can be set higher than the priority of a transportation task in which the transportation tool arrives late (i.e., the actual arrival time is later than the scheduled arrival time) (way one). According to yet some embodiments, the closer the actual arrival time of the transportation tool is to the scheduled arrival time, i.e., the smaller the absolute value of the time difference between the two, the higher the priority of the corresponding transportation task can be set (way two).
[0043] Based on the above way one and way two, exemplary priorities from high to low can be:
[0044] Priority 1 (highest priority): a transportation task in which the transportation tool arrives on time (i.e., the absolute value of the time difference between the actual arrival time and the scheduled arrival time is within 15 minutes);
[0045] Priority 2: a transportation task in which the transportation tool arrives early within 30 minutes (i.e., the time difference between the scheduled arrival time and the actual arrival time is between 15 and 30 minutes);
[0046] Priority 3: a transportation task in which the transportation tool arrives late within 30 minutes (i.e., the time difference between the actual arrival time and the scheduled arrival time is between 15 and 30 minutes);
[0047] Priority 4: a transportation task in which the transportation tool arrives early more than 30 minutes (i.e., the time difference between the scheduled arrival time and the actual arrival time is more than 30 minutes);
[0048] Priority 5 (lowest priority): a transportation task in which the transportation tool arrives late more than 30 minutes (i.e., the time difference between the actual arrival time and the scheduled arrival time is more than 30 minutes).
[0049] According to some embodiments, on the basis of the above priority determination ways, the priority of the target task can be determined as the highest priority in response to determining that the task information satisfies a preset first rule, and the priority of the target task can be determined as the lowest priority in response to determining that the task information satisfies a preset second rule (way three). The first rule can be, for example, that the time difference between the scheduled latest execution end time and the current time is less than a first threshold (e.g., 30 minutes), and the second rule can be, for example, that the time difference between the scheduled latest execution end time and the current time is greater than a second threshold (e.g., 2 hours). In this way, the highest and lowest priorities can be set according to the specified rules (i.e., the first rule and the second rule) based on the current task execution situation, thereby improving the flexibility of task scheduling. In some embodiments, the highest priority and / or the lowest priority can be manually specified.
[0050] Based on the above way one to way three, exemplary priorities from high to low can be:
[0051] Priority 1 (highest priority): a transport task whose task information meets the first rule;
[0052] Priority 2: a transport task in which a transport tool arrives on time (i.e., an absolute value of a time difference between an actual arrival time and a planned arrival time is within 15 minutes);
[0053] Priority 3: a transport task in which a transport tool arrives within 30 minutes early (i.e., a time difference between a planned arrival time and an actual arrival time is between 15 and 30 minutes);
[0054] Priority 4: a transport task in which a transport tool arrives within 30 minutes late (i.e., a time difference between an actual arrival time and a planned arrival time is between 15 and 30 minutes);
[0055] Priority 5: a transport task in which a transport tool arrives more than 30 minutes early (i.e., a time difference between a planned arrival time and an actual arrival time is more than 30 minutes);
[0056] Priority 6: a transport task in which a transport tool arrives more than 30 minutes late (i.e., a time difference between an actual arrival time and a planned arrival time is more than 30 minutes);
[0057] Priority 7 (lowest priority): a transport task whose task information meets the second rule.
[0058] After the priorities of the target tasks are determined, a plurality of target tasks corresponding to each priority can be obtained accordingly.
[0059] In step S130, for the plurality of target tasks corresponding to each priority, based on the task information of the plurality of target tasks and the available resource information of the plurality of target resources, a preset scheduling algorithm is used to determine a target resource and an execution time corresponding to each target task in the plurality of target tasks from the plurality of target resources.
[0060] In an embodiment of the present disclosure, the execution time of a target task can be a time point at which the target task starts to be executed (i.e., a start execution time), or can be a time period in which the target task is executed.
[0061] According to some embodiments, in step S130, the plurality of target tasks corresponding to each priority can be scheduled in order of priority from high to low, i.e., for the plurality of target tasks corresponding to each priority, based on the task information of the plurality of target tasks and the available resource information of the plurality of target resources, a preset scheduling algorithm is used to determine a target resource and an execution time corresponding to each target task in the plurality of target tasks from the plurality of target resources in order of priority from high to low. Thus, the target tasks with higher priority can be scheduled and executed preferentially, so that the current limited target resources are optimally utilized to meet the business demand.
[0062] According to some embodiments, the task information includes the earliest executable time (i.e., the earliest time at which the corresponding target task can be executed), the execution duration, and the task type. The available resource information includes the available time and resource type. Accordingly, the multiple target tasks corresponding to each priority level can be scheduled according to the following steps S132 to S136:
[0063] Step S132: Divide the multiple target tasks into at least one task set, where each task set corresponds to a task type;
[0064] Step S134: Determine a resource set corresponding to each task set, where the resource set includes at least one target resource, and the resource type of the at least one target resource matches the task type of the task set; and
[0065] Step S136: For each task set, based on the earliest executable time and execution duration of each target task in the task set and the available time of each target resource in the corresponding resource set, a scheduling algorithm is used to determine the corresponding target resource and execution time for each target task in the task set.
[0066] Based on the above steps S132 to S136 , the task set may be divided according to the task type, and the corresponding resource set may be determined. The task set and resource set may be scheduled to determine the target resource and execution time corresponding to each task.
[0067] According to some embodiments, with respect to step S132 and step S134, when the target task is a cargo transportation task and the target resource is a transportation site (e.g., a dock), the task type of the target task and the resource type of the target resource may both be cargo types, such as frozen cargo, dry cargo, wet cargo, etc. The earliest executable time may be the earliest available time of a transportation vehicle (e.g., a vehicle) used to transport the cargo, that is, the end time of the last scheduled task for the transportation vehicle.
[0068] For example, priority 3 corresponds to target tasks 1 to 10 (i.e., transportation tasks). All of these tasks are frozen goods, so they are grouped into the same task set A. All of these tasks are wet goods, so they are grouped into the same task set B. All of these tasks are dry goods, so they are grouped into the same task set C.
[0069] The currently available target resources are target resources 1 through 5 (i.e., transport stations). Target resources 1, 3, and 5 are of the frozen cargo type (i.e., they can be used to transport frozen cargo). Therefore, they are grouped into the same resource set A, corresponding to Task Set A, which also has the frozen cargo task type. Target resources 2 and 3 are of the dry cargo type (i.e., they can be used to transport dry cargo). Therefore, they are grouped into the same resource set B, corresponding to Task Set B, which also has the dry cargo task type. Target resources 2 through 4 are of the wet cargo type. Therefore, they are grouped into the same resource set C, corresponding to Task Set C, which also has the wet cargo task type.
[0070] According to some embodiments, for step S136, the objective function of the scheduling algorithm is the sum of the start execution times of the target tasks in the task set, which is expressed as shown in the following formula (1):
[0071]
[0072] Among them, F is the value of the objective function, N assign is the number of target tasks in the task set, T i dispatch is the start execution time of the i-th target task.
[0073] The optimization goal of the scheduling algorithm is to minimize the value of the above objective function, thereby improving task execution efficiency and reducing total waiting time.
[0074] The scheduling algorithm may be, for example, any optimization algorithm, including but not limited to an artificial bee colony algorithm, an ant colony algorithm, a genetic algorithm, and the like.
[0075] According to some embodiments, the execution time includes the execution start time, and step S136 further includes the following steps S1362 to S1366:
[0076] Step S1362: Initialize multiple resource sequences, where the resource sequences include target resources corresponding to each target task in the task set;
[0077] Step S1364: cyclically execute the following steps a to c until the number of cycles reaches a preset value:
[0078] Step a: For each resource sequence in the current plurality of resource sequences, based on the earliest executable time and execution duration of each target task in the task set and the available time of the corresponding target resource, determine the start execution time of each target task on the corresponding target resource, so as to obtain a start execution time sequence corresponding to each resource sequence, wherein the start execution time sequence includes the start execution time corresponding to each target task in the task set;
[0079] Step b, calculating fitness values of each resource sequence based on the corresponding sequence of starting execution time, the fitness value being used to indicate the matching degree of the resource sequence and the optimization target; and
[0080] Step c, adjusting the current multiple resource sequences based on the fitness values to generate adjusted multiple resource sequences;
[0081] Step S1366, determining the corresponding target resource and starting execution time of each target task in the task set based on the resource sequence with the largest fitness value in the current multiple resource sequences and the corresponding sequence of starting execution time.
[0082] Based on the above steps S1362-S1366, multiple feasible solutions (i.e. resource sequences) of the task scheduling can be initialized, the fitness value of each feasible solution is calculated, the feasible solution is constantly adjusted based on the fitness value, and until the preset number of cycles is reached, the current optimal solution (the feasible solution with the largest fitness value) is taken as the solution of the optimization problem, and based on the optimal solution, the corresponding target resource and starting execution time of each target task can be obtained.
[0083] According to some embodiments, for step a, the available time of the target resource includes at least one time period, each time period including a starting time and an ending time, and accordingly, the starting execution time of each target task in the task set on the corresponding target resource can be determined by the following steps:
[0084] For each target task in the task set, the earliest time period in the corresponding target resource, in which the ending time is greater than or equal to the sum of the earliest executable time and the execution duration, and the difference between the ending time and the starting time is greater than or equal to the execution duration, is taken as the target time period; and the larger one between the starting time of the target time period and the earliest executable time is taken as the starting execution time of the target task on the corresponding target resource.
[0085] For example, the target resource corresponding to the target task i is D i , the earliest executable time of the target task i is , the execution duration is , and the available time period of the target resource is wherein, (j = 1, 2, …, Ndi) represent the starting time and the ending time of the jth time period respectively. According to the order from front to back, the above time periods are traversed to find the first time period such that and The time period is the target time period. Further, the starting time of the target time period is taken as the starting execution time of the target task. the larger one in the target resource D i the starting execution time of the target function i.e.
[0086] For step b, the fitness value is used to indicate the matching degree of the resource sequence and the optimization target. The larger the fitness value of the resource sequence, the greater the matching degree of the resource sequence and the optimization target, i.e. the closer to the optimization target. Specifically, the fitness value can be calculated according to the following formula (2):
[0087]
[0088] In formula (2), fitness i represents the fitness value of the ith resource sequence, e is the natural base, β is a preset fitness coefficient (a constant), and F i is the target function value of the ith resource sequence.
[0089] According to some embodiments, for step c, in the case that the scheduling algorithm is an artificial bee colony algorithm, the artificial bee colony algorithm can include a plurality of employed bee modules, a plurality of onlooker bee modules and a plurality of scout bee modules, each employed bee module corresponding to a resource sequence. The employed bee module, the onlooker bee module and the scout bee module are all code modules for performing certain calculation tasks. Accordingly, step c can further include:
[0090] The employed bee module adjusts the corresponding resource sequence to a resource sequence with a larger fitness value in the neighborhood according to a first probability (P1), transforms into an onlooker bee module according to a second probability (P2), and transforms into a scout bee module according to a third probability (P3);
[0091] The onlooker bee module transforms into an employed bee module of any one of the current plurality of resource sequences according to a fourth probability (P4) based on the fitness values of the current plurality of resource sequences, and continues to be an onlooker bee module according to a fifth probability (P5);
[0092] The scout bee module randomly generates a candidate resource sequence, and transforms into an employed bee module of the candidate resource sequence in response to the fitness value of the randomly generated candidate resource sequence being greater than the maximum value of the fitness values of the current plurality of resource sequences; otherwise, transforms into an onlooker bee module according to a sixth probability (P6) and continues to be a scout bee module according to a seventh probability (P7).
[0093] Based on the above embodiments, the employed bee module, the onlooker bee module and the scout bee module can be mutually transformed according to certain probabilities (P1-P7), thereby increasing the randomness of the solution (resource sequence), facilitating the search for a global optimal solution and avoiding falling into a local optimum.
[0094] Specifically, according to some embodiments, the employed bee module searches the resource sequence in its neighborhood range according to a first probability (P1), and once a new resource sequence with a greater fitness value is found, the employed bee module will discard the original resource sequence and transform into the employed bee module of the new resource sequence.
[0095] For example, a certain employed bee module currently corresponds to a resource sequence Nec1, a resource sequence Nec2 is randomly generated, and a random number N is randomly taken in 1~N assign (N assign is the length of the resource sequence, i.e., the number of target tasks in the task set) and N ra The generated new resource sequence Nec new follows Nnec1, and the following codes follow Nnec2. ra
[0096] According to some embodiments, the onlooker bee module obtains the following probability of each current resource sequence by roulette, and based on the following probability of each resource sequence, the employed bee module of a certain resource sequence is transformed. The following probability of the i-th resource sequence is For example, it can be calculated according to the following formula (3):
[0097]
[0098] Wherein, fitness i represents the fitness value of the i-th resource sequence, N nec is the number of current resource sequences, is the sum of the fitness values of all current resource sequences.
[0099] Based on the following probability of each resource sequence, a probability interval is allocated to each resource sequence A random number between 0 and 1 is generated, and if the random number falls into the probability interval corresponding to the resource sequence i, the onlooker bee module is transformed into the employed bee module of the resource sequence i.
[0100] According to some embodiments, the first probability P1~the seventh probability P7 satisfy the following conditions: P1+P2+P3=1, P4+P5=1, P6+P7=1. The present disclosure does not limit the specific values of P1~P7.
[0101] According to some embodiments, the task scheduling method 100 can be executed according to a preset frequency (for example, once per minute). Based on this embodiment, the method 100 is executed cyclically according to the preset frequency, so that the real-time dynamic scheduling of tasks can be realized.
[0102] The following uses a logistics and transportation scenario as an example to illustrate the task scheduling process of an embodiment of the present disclosure. In this example, the target task is a cargo transport task, the target resource is a terminal, and the means of transport for the cargo is a vehicle. Both task types and terminal types include frozen cargo, dry cargo, and wet cargo. Each vehicle can transport one or more types of cargo, that is, each vehicle can perform one or more transport tasks. The scheduling algorithm used is the artificial bee colony algorithm.
[0103] Figure 2 A flow chart of a transportation task scheduling process 200 according to an embodiment of the present disclosure is shown.
[0104] like Figure 2 As shown, in step S201, scheduling data is acquired. Scheduling data includes vehicle information, task information, and terminal information. Vehicle information, for example, includes the actual arrival time and planned arrival time of each vehicle. Task information, for example, includes the execution duration and task type (frozen cargo / dry cargo / wet cargo). Terminal information, for example, includes the terminal's availability (including at least one time period) and terminal type (frozen cargo / dry cargo / wet cargo).
[0105] In step S202, the vehicles are prioritized, for example, according to the priority determination methods 1 to 3 described above, and the vehicles are classified into priority 1 to priority 7.
[0106] In step S203, task scheduling is performed on all vehicles within each priority level.
[0107] In step S204 , for all vehicles within the current priority level, tasks of the same type for these vehicles are extracted to form a task set.
[0108] In step S205 , docks of the same type as the task set are selected as feasible docks to form a dock set.
[0109] In step S206, the feasible time period of each terminal in the terminal set is obtained.
[0110] In step S207, an artificial bee colony algorithm is used to perform scheduling optimization to determine the execution terminal and execution start time corresponding to each transportation task in the task set.
[0111] In step S208, it is determined whether all task types of the current priority have been traversed. If not, step S204 is executed to continue to obtain the task set of the next task type of the current priority and perform scheduling optimization; if yes, step S209 is executed.
[0112] In step S209, it is judged whether all priorities are traversed. If not, step S203 is executed to schedule tasks for all vehicles of the next priority; if yes, the current task scheduling is completed, and step S210 is executed to output the scheduling result.
[0113] In step S211, it is judged whether the scheduling is completed, i.e., whether the next scheduling is needed. For example, the task scheduling is set to be performed once per minute. If step S211 judges no, i.e., the scheduling is not completed, step S212 is executed to acquire the task execution status of the site, and when the next minute comes, step S201 is executed to perform the next task scheduling. If step S211 judges yes, the task scheduling process is ended, and the next minute does not perform the task scheduling.
[0114] Figure 3 A flow chart of the artificial bee colony algorithm 300 according to an embodiment of the present disclosure is shown.
[0115] As shown in Figure 3 , in step S301, relevant data is acquired, including the earliest executable time and execution time length of each transportation task, and the available time of each terminal.
[0116] In step S302, the number of each bee colony (employed bee, onlooker bee, scout bee) is initialized, and each initial honey source, i.e., initial solution (initial multiple terminal sequences) is determined.
[0117] For example, the number of tasks currently entering the artificial bee colony algorithm for scheduling is N assign , and the number of feasible terminals is N dock . Then the length of a single honey source code is N assign , and the range of each code is 1-N dock , which represents the sequence number of the terminal to which each task is arranged. Among them, each task will be arranged to a specific time of the terminal according to the rules.
[0118] Further, the terminal sequence number of task i is D i , and the last task end time (i.e., the earliest executable time of task i) of the vehicle performing task i is assumed to be The execution time of task i is The available time period of terminal D i is From front to back, the first interval is found, which makes and The time of arranging the task to the terminal is
[0119] The calculation formula of the objective function is formula (1) above.
[0120] In step S303, the employed bees are dispatched. A part of the employed bees search for the neighboring food sources, and greedily select a new food source. Another part randomly becomes an onlooker bee or a scout bee.
[0121] For example, the employed bees search for the neighboring food sources with a probability of P1, and once a better food source is found, they become the employed bees of the new food source. They become onlooker bees with a probability of P2, and become scout bees with a probability of P3. (P1+P2+P3=1)
[0122] For example, in the neighborhood search, it is assumed that the present food source is Nec1, a food source is randomly generated as Nec2, and a number N is randomly taken from 1 to N assign . The first N ra codes of the new food source Nec new follow Nec1, and the remaining codes follow Nec2 ra .
[0123] In step S304, the onlooker bees are dispatched. The onlooker bees calculate the fitness values of the food sources, and obtain the following probabilities of the food sources based on the fitness values. A part of the onlooker bees become the employed bees according to the following probabilities, and another part remains as the onlooker bees.
[0124] For example, the fitness values of all the food sources are calculated, and the following probabilities of each food source are obtained by the roulette method based on the fitness values. A random judgment is made for all the onlooker bees, and they become the employed bees of a specific food source with a probability of P4, and remain as the onlooker bees with a probability of P5. (P4+P5=1)
[0125] Further, the fitness value of the food source i is calculated by the above formula (2). Based on the fitness value, the following probability of the food source i is calculated by the above formula (3). Based on the following probabilities of the food sources, a probability interval is allocated to each food source A number between 0 and 1 is randomly generated, and if it falls into the probability interval of the food source i, the onlooker bee becomes the employed bee of the food source.
[0126] In step S305, the scout bees are dispatched. The scout bees randomly search for a new food source, and if a better food source than the present optimum is found, they become the employed bees of the food source, and otherwise they become onlooker bees with a certain probability or remain as the scout bees.
[0127] For example, the scout bees randomly search for a food source N find in the entire solution space, and if a better food source than the present optimum food source Nec best is found, they become the employed bees of the new food source. Otherwise, a random judgment is made, and they become onlooker bees with a probability of P6 or remain as the scout bees with a probability of P7. (P6+P7=1)
[0128] A specific example of the embodiment of the present disclosure is described below.
[0129] A logistics company needs to reasonably plan the vehicle transportation tasks at the wharf. A total of 51 vehicles need to be planned, and a total of 123 tasks need to be planned. The priority of each task is determined according to the actual arrival time and the planned arrival time of the corresponding vehicle. The tasks are divided into frozen goods, dry goods, and wet goods three types. There are 18 wharfs in total, which are responsible for handling different task types, and some wharfs can handle different task types at the same time. In order to improve the overall logistics efficiency, it is necessary to reasonably arrange the tasks so that the sum of the start execution time of all tasks is minimized, that is, the waiting time is minimized.
[0130] All algorithm codes are written in JAVA language of IDEA2020 (JDK8). The parameter settings of the artificial bee colony algorithm are as follows: the number of iterations is set to 400, the number of hired bees and the number of initial honey sources are both 60, the number of observation bees is 60, and the number of scout bees is 80. P1=0.3, P2=0.4, P3=0.3, P4=0.3, P5=0.7, P6=0.4, P7=0.6. Take the iteration result of one of the artificial bee colony algorithms, as shown in Figure 4 In this example, the artificial bee colony algorithm can basically converge before 200 times, so it can guarantee the demand for fast solving under the premise of small solving time, and realize real-time dynamic task scheduling.
[0131] After all the task scheduling is completed, the task scheduling arrangement is drawn into a Gantt chart, as shown in Figure 5 Due to the small amount of dry goods tasks, the arrangement pressure is small. The amount of frozen goods and wet goods tasks is large, and the wharf is under pressure. It can be observed that through reasonable planning in this example, the idle time of the wharf can be fully utilized, the overall waiting time is reduced, and the logistics transportation efficiency is improved.
[0132] According to another aspect of the present disclosure, a task scheduling device is also provided. Figure 6 A structural block diagram of the task scheduling device 600 according to the embodiment of the present disclosure is shown. As shown in Figure 6 The device 600 includes:
[0133] The acquisition module 610 is configured to acquire task information of each of a plurality of target tasks to be scheduled and available resource information of each of a plurality of target resources available at present, each target resource being configured to execute one or more target tasks;
[0134] The determination module 620 is configured to determine the priority of each target task based on the corresponding task information, to obtain a plurality of target tasks each corresponding to a priority; and
[0135] The scheduling module 630 is configured to, for each priority corresponding to a plurality of target tasks, determine, based on task information of the plurality of target tasks and available resource information of the plurality of target resources respectively, a target resource and an execution time corresponding to each target task in the plurality of target tasks from the plurality of target resources by using a preset scheduling algorithm.
[0136] According to an embodiment of the present disclosure, priorities of each target task to be scheduled currently are determined, and for each priority, a plurality of target tasks of the priority are arranged on a corresponding target resource and time (i.e., execution time) by using a preset scheduling algorithm, so that real-time automatic scheduling of tasks is realized, and execution efficiency of the tasks can be improved and total waiting time can be reduced.
[0137] According to some embodiments, the task information includes an earliest executable time, an execution duration, and a task type, the earliest executable time is an earliest time at which a corresponding target task can be executed, the available resource information includes available time and a resource type, and the scheduling module includes:
[0138] A division unit is configured to divide the plurality of target tasks into at least one task set, each task set corresponding to a task type;
[0139] A determination unit is configured to determine a resource set corresponding to each task set, the resource set including at least one target resource, and a resource type of the at least one target resource matching a task type of the task set; and
[0140] A first scheduling unit is configured to, for each task set, determine, based on an earliest executable time and an execution duration of each target task in the task set and available time of each target resource in a corresponding resource set, a target resource and an execution time corresponding to each target task in the task set by using the scheduling algorithm.
[0141] According to some embodiments, a target function of the scheduling algorithm is a sum of start execution times of each target task in the task set, and an optimization target of the scheduling algorithm is to minimize a value of the target function.
[0142] According to some embodiments, the execution time includes a start execution time, and the first scheduling unit includes:
[0143] An initialization unit is configured to initialize a plurality of resource sequences, the resource sequence including a target resource corresponding to each target task in the task set.
[0144] The scheduling algorithm solving unit is configured to cyclically execute the following steps until the number of cycles reaches a preset value: for each resource sequence in the current plurality of resource sequences, determining a starting execution time of each target task in the corresponding target resource based on the earliest executable time, the execution duration of each target task in the task set, and the available time of the corresponding target resource, to obtain a starting execution time sequence corresponding to each resource sequence, the starting execution time sequence including the starting execution time corresponding to each target task in the task set; based on the corresponding starting execution time sequence, calculating a fitness value of each resource sequence, the fitness value being used to indicate the matching degree of the resource sequence and the optimization target; and based on the fitness value, adjusting the current plurality of resource sequences to generate an adjusted plurality of resource sequences; and
[0145] The second scheduling unit is configured to determine the corresponding target resource and starting execution time of each target task in the task set based on the resource sequence with the maximum fitness value in the current plurality of resource sequences and the starting execution time sequence corresponding thereto.
[0146] According to some embodiments, the available time includes at least one time period, each time period including a starting time and an ending time, and the scheduling algorithm solving unit is further configured to: for each target task in the task set, taking the earliest time period in the corresponding target resource as a target time period, the ending time of which is greater than or equal to the sum of the earliest executable time and the execution duration of the target task, and the difference between the ending time and the starting time of which is greater than or equal to the execution duration; and taking the greater one of the starting time of the target time period and the earliest executable time as the starting execution time of the target task in the corresponding target resource.
[0147] According to some embodiments, the scheduling algorithm is an artificial bee colony algorithm, and the scheduling algorithm solving unit includes a plurality of employed bee modules, a plurality of onlooker bee modules, and a plurality of scout bee modules, each employed bee module corresponding to a resource sequence,
[0148] The employed bee module is configured to: adjust the corresponding resource sequence to a resource sequence with a greater fitness value in the neighborhood according to a first probability, transform into an onlooker bee module according to a second probability, and transform into a scout bee module according to a third probability;
[0149] The onlooker bee module is configured to: based on the fitness values of the current plurality of resource sequences, transform into an employed bee module of any resource sequence in the plurality of resource sequences according to a fourth probability, and continue to be an onlooker bee module according to a fifth probability; and
[0150] The scout bee module is configured to: randomly generate a candidate resource sequence, and in response to the fitness value of the randomly generated candidate resource sequence being greater than the maximum fitness value of the current multiple resource sequences, convert it into an employed bee module of the candidate resource sequence; otherwise, convert it into an observer bee module according to a sixth probability, and continue to serve as a scout bee module according to a seventh probability.
[0151] It should be understood that Figure 6 The modules or units of the apparatus 600 shown in FIG. 6 can be used in conjunction with the reference Figure 1 The steps in the method 100 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 100 are also applicable to the apparatus 600 and the modules and units included therein. For the sake of brevity, some operations, features and advantages are not repeated here.
[0152] Although specific functions are discussed above with reference to specific modules, it should be noted that the functions of the various modules discussed herein may be separated into multiple modules, and / or at least some functions of multiple modules may be combined into a single module. For example, the acquisition module 610 and the determination module 620 described above may be combined into a single module in some embodiments.
[0153] It should also be understood that various techniques may be described herein in the general context of software hardware elements or program modules. Figure 6 The various modules described can be implemented in hardware or in hardware in combination with software and / or firmware. For example, these modules can be implemented as computer program code / instructions that are configured to be executed in one or more processors and stored in a computer-readable storage medium. Alternatively, these modules can be implemented as hardware logic / circuits. For example, in some embodiments, one or more of modules 610-630 can be implemented together in a system on chip (SoC). The SoC may include an integrated circuit chip (which includes a processor (e.g., a central processing unit (CPU), a microcontroller, a microprocessor, a digital signal processor (DSP), etc.), a memory, one or more communication interfaces, and / or one or more components in other circuits), and may optionally execute the received program code and / or include embedded firmware to perform functions.
[0154] According to another aspect of the present disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the task scheduling method described above.
[0155] According to another aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to cause a computer to perform the task scheduling method described above.
[0156] According to another aspect of the present disclosure, a computer program product is also provided, comprising a computer program, wherein the computer program, when executed by a processor, implements the task scheduling method described above.
[0157] Referring to Figure 7 , a structural block diagram of an electronic device 700 that can be used as an example of a hardware device that can be applied to aspects of the present disclosure will now be described. The electronic device can be different types of computer devices, such as a laptop computer, a desktop computer, a workstation, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as a personal digital processing, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections, and relationships, and their functions, are meant only to be examples, and are not meant to limit implementations of the present disclosure described and / or claimed in this document.
[0158] Figure 7 A block diagram of an electronic device according to embodiments of the present disclosure is shown. As shown in Figure 7 , the electronic device 700 can include at least one processor 701, a working memory 702, I / O devices 704, a display device 705, a storage device 706, and a communication interface 707 that can communicate with each other through a system bus 703.
[0159] The processor 701 can be a single processing unit or a plurality of processing units, all of which can include single or multiple computing units or multiple cores. The processor 701 can be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuitries, and / or any devices that manipulate signals based on operational instructions. The processor 701 can be configured to retrieve and execute programming instructions stored in the working memory 702, the storage device 706, or other computer-readable media, such as program code of an operating system 702a, program code of an application 702b, and the like.
[0160] The working memory 702 and the storage 706 are examples of computer-readable storage media for storing instructions that are executed by the processor 701 to carry out the various functions described above. The working memory 702 can include both volatile memory and non-volatile memory (e.g., RAM, ROM, etc.). In addition, the storage 706 can include hard drives, solid-state drives, removable media, including external and removable drives, memory cards, flash memory, floppy disks, optical disks (e.g., CD, DVD), storage arrays, network-attached storage, storage area networks, etc. The working memory 702 and the storage 706 can be collectively referred to herein as memory or computer-readable storage media, and can be non-transitory media capable of storing computer-readable, processor-executable program instructions as computer program code that can be executed by the processor 701 as a particular machine configured to carry out the operations and functions described in the examples herein.
[0161] The I / O devices 704 can include input devices and / or output devices, which can be any type of devices capable of inputting information to the electronic device 700, and can include, but are not limited to, a mouse, a keyboard, a touchscreen, a trackpad, a trackball, a joystick, a microphone, and / or a remote control. The output devices can be any type of devices capable of presenting information, and can include, but are not limited to, including video / audio output terminals, a vibrator, and / or a printer.
[0162] The communication interface 707 allows the electronic device 700 to exchange information / data with other devices over computer networks, such as the Internet, and / or various telecommunication networks, and can include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver and / or chipset, such as a Bluetooth TM device, an 802.11 device, a Wi-Fi device, a WiMAX device, a cellular communication device, and / or the like.
[0163] The application 702b in the working memory 702 can be loaded to execute the various methods and processes described above, such as steps S110-S130 in Figure 1 In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 700 via the storage 706 and / or the communication interface 707. When the computer program is loaded and executed by the processor 701, one or more steps of the task scheduling method described above can be performed.
[0164] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0165] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable task-scheduling apparatus to cause a function / operation specified in the flow diagrams and / or block diagrams to be implemented when the program code is executed by the processor or controller. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as part of a standalone software package, or entirely on a remote machine or server.
[0166] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0167] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0168] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0169] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
[0170] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the spirit of the present disclosure. For example, the steps recited in the present disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technology disclosed in the present disclosure are achieved, which is not limited herein.
[0171] While embodiments or examples of this disclosure have been described with reference to the figures, it will be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the application is not limited to these embodiments or examples. Various elements of the embodiments or examples can be omitted or substituted by equivalents thereof. Furthermore, the steps can be performed in a different order than described in the disclosure. Further, various elements of the embodiments or examples can be combined in various ways. It is important that as technology evolves, many of the elements described herein can be substituted by equivalents which serve the same function.
Claims
1. A task scheduling method, characterized by, The method comprises: obtaining task information of each of a plurality of target tasks to be scheduled and available resource information of each of a plurality of target resources available at present, each target resource being configured to execute one or more target tasks, the task information comprising an earliest executable time, an execution duration and a task type, the earliest executable time being the earliest time at which the corresponding target task can be executed, the available resource information comprising available time and a resource type; determining a priority of each target task based on the corresponding task information, to obtain a plurality of target tasks each corresponding to a priority; dividing, for each plurality of target tasks corresponding to a priority, the plurality of target tasks into at least one task set, each task set corresponding to a task type; determining a resource set corresponding to each task set, the resource set comprising at least one target resource, the resource type of the at least one target resource matching the task type of the task set; and for each task set, determining a target resource and an execution time corresponding to each target task in the task set based on the earliest executable time and the execution duration of each target task in the task set and the available time of each target resource in the corresponding resource set, using a preset scheduling algorithm, wherein the optimization target of the scheduling algorithm is to minimize the sum of the start execution times of each target task in the task set. The target task is a transportation task, the task information comprises actual arrival time and planned arrival time of each of a plurality of transportation tools used to execute the transportation task, and determining a priority of each target task based on the corresponding task information comprises:
2. The method of claim 1, wherein, determining the priority of the target task based on the time difference between the actual arrival time and the planned arrival time. Determining a priority of each target task based on the corresponding task information further comprises:
3. The method of claim 2, wherein, in response to determining that the task information satisfies a preset first rule, determining the priority of the target task as the highest priority; and in response to determining that the task information satisfies a preset second rule, determining the priority of the target task as the lowest priority. For each plurality of target tasks corresponding to a priority, determining a target resource and an execution time corresponding to each target task in the plurality of target tasks from the plurality of target resources based on the task information of the plurality of target tasks and the available resource information of each of the plurality of target resources, using a preset scheduling algorithm comprises:
4. The method of claim 1, wherein, in order of priority from high to low, for each plurality of target tasks corresponding to a priority, determining a target resource and an execution time corresponding to each target task in the plurality of target tasks from the plurality of target resources based on the task information of the plurality of target tasks and the available resource information of each of the plurality of target resources, using a preset scheduling algorithm. The execution time comprises a start execution time, and determining a target resource and an execution time corresponding to each target task in the task set based on the earliest executable time and the execution duration of each target task in the task set and the available time of each target resource in the corresponding resource set, using a preset scheduling algorithm comprises:
5. The method of claim 1, wherein, initializing a plurality of resource sequences, each of the resource sequences corresponding to each target task in the task set; repeating the following steps until a preset number of iterations is reached: for each resource sequence in the plurality of resource sequences, determining a start execution time of each target task on the corresponding target resource based on an earliest executable time, an execution duration of each target task in the task set and an available time of the corresponding target resource, to obtain a start execution time sequence corresponding to each resource sequence, the start execution time sequence including a start execution time of each target task in the task set; calculating a fitness value of each resource sequence based on the corresponding start execution time sequence, the fitness value indicating a matching degree of the resource sequence and the optimization target; and adjusting the plurality of resource sequences based on the fitness value to generate an adjusted plurality of resource sequences; and determining a target resource and a start execution time of each target task in the task set based on a resource sequence with the largest fitness value in the plurality of resource sequences and a start execution time sequence corresponding to the resource sequence. the available time includes at least one time period, each time period including a start time and an end time, 6. The method of claim 5, wherein, and the determining of the start execution time of each target task on the corresponding target resource based on the earliest executable time, the execution duration of each target task in the task set and the available time of the corresponding target resource includes: for each target task in the task set, taking an earliest time period in the corresponding target resource as a target time period, the target time period having an end time greater than or equal to a sum of the earliest executable time and the execution duration and a difference between the end time and the start time greater than or equal to the execution duration; and taking a larger one of the start time of the target time period and the earliest executable time as the start execution time of the target task on the corresponding target resource. the scheduling algorithm is an artificial bee colony algorithm, the artificial bee colony algorithm including a plurality of employed bee modules, a plurality of onlooker bee modules and a plurality of scout bee modules, each employed bee module corresponding to a resource sequence, 7. The method according to claim 5 or 6, characterized in that, and the adjusting of the plurality of resource sequences based on the fitness value to generate the adjusted plurality of resource sequences includes: the employed bee module adjusts the corresponding resource sequence to a resource sequence with a larger fitness value in a neighborhood according to a first probability, transforms into an onlooker bee module according to a second probability and transforms into a scout bee module according to a third probability; the onlooker bee module transforms into an employed bee module of any resource sequence in the plurality of resource sequences according to a fourth probability based on the fitness values of the plurality of resource sequences, continues to be an onlooker bee module according to a fifth probability; and the scout bee module randomly generates a candidate resource sequence, and in response to a fitness value of the randomly generated candidate resource sequence being greater than a maximum value of the fitness values of the plurality of resource sequences, transforms into an employed bee module of the candidate resource sequence; otherwise, transforms into an onlooker bee module according to a sixth probability and continues to be a scout bee module according to a seventh probability. 8. The method according to any one of claims 1-6, characterized in that, The target resources include transportation stations, and the target tasks include transportation tasks.
9. The method according to any one of claims 1-6, characterized in that, The task scheduling method is performed at a preset frequency.
10. A task scheduling apparatus characterized by comprising: Comprise: An acquisition module configured to acquire task information of a plurality of target tasks to be scheduled currently and available resource information of a plurality of target resources available currently, each target resource being configured to execute one or more target tasks, the task information comprising an earliest executable time, an execution duration and a task type, the earliest executable time being the earliest time at which the corresponding target task can be executed, and the available resource information comprising available time and a resource type; A determination module configured to determine a priority of each target task based on the corresponding task information, to obtain a plurality of target tasks each corresponding to a priority; And A scheduling module comprising: A division unit configured to divide, for a plurality of target tasks corresponding to each priority, the plurality of target tasks into at least one task set, each task set corresponding to a task type; A determination unit configured to determine a resource set corresponding to each task set, the resource set comprising at least one target resource, the resource type of the at least one target resource matching the task type of the task set; and A first scheduling unit configured to, for each task set, determine, based on the earliest executable time and the execution duration of each target task in the task set and the available time of each target resource in the corresponding resource set, a target resource and an execution time corresponding to each target task in the task set by using a preset scheduling algorithm, Wherein, the optimization target of the scheduling algorithm is to minimize the sum of the start execution times of the target tasks in the task set.
11. The apparatus of claim 10, wherein, The execution time comprises a start execution time, and the first scheduling unit comprises: An initialization unit configured to initialize a plurality of resource sequences, each resource sequence comprising a target resource corresponding to each target task in the task set; A scheduling algorithm solving unit configured to perform the following steps in a loop until the number of loops reaches a preset value: For each resource sequence in the current plurality of resource sequences, determine the start execution time of each target task in the corresponding target resource based on the earliest executable time, the execution duration of each target task in the task set and the available time of the corresponding target resource, to obtain a start execution time sequence corresponding to each resource sequence, the start execution time sequence comprising a start execution time corresponding to each target task in the task set; Based on the corresponding start execution time sequence, calculate the fitness value of each resource sequence, the fitness value being used to indicate the matching degree of the resource sequence and the optimization target; and Based on the fitness value, adjust the current plurality of resource sequences to generate adjusted plurality of resource sequences; and A second scheduling unit configured to determine, based on the resource sequence with the largest fitness value in the current plurality of resource sequences and the start execution time sequence corresponding thereto, a target resource and a start execution time corresponding to each target task in the task set. 12. The apparatus of claim 11, wherein, The available time comprises at least one time period, each time period comprising a start time and an end time, the scheduling algorithm solving unit is further configured to: for each target task in the task set, taking the earliest time period in which an end time in the corresponding target resource is greater than or equal to the sum of the earliest executable time and the execution duration, and the difference between the end time and the start time is greater than or equal to the execution duration, as a target time period; and taking the greater one of the start time of the target time period and the earliest executable time as the start execution time of the target task on the corresponding target resource.
13. The apparatus of claim 11 or 12, wherein, The scheduling algorithm is an artificial bee colony algorithm, and the scheduling algorithm solving unit comprises a plurality of employed bee modules, a plurality of onlooker bee modules and a plurality of scout bee modules, each employed bee module corresponds to a resource sequence, The employed bee module is configured to adjust the corresponding resource sequence to a resource sequence with a greater fitness value in the neighborhood according to a first probability, transform into an onlooker bee module according to a second probability, and transform into a scout bee module according to a third probability; The onlooker bee module is configured to transform into an employed bee module of any resource sequence in the plurality of current resource sequences according to a fourth probability based on the fitness values of the plurality of current resource sequences, and continue to be an onlooker bee module according to a fifth probability; And The scout bee module is configured to randomly generate a candidate resource sequence, and transform into an employed bee module of the candidate resource sequence in response to the fitness value of the randomly generated candidate resource sequence being greater than the maximum value of the fitness values of the plurality of current resource sequences; otherwise, transform into an onlooker bee module according to a sixth probability, and continue to be a scout bee module according to a seventh probability.
14. An electronic device, comprising: comprise: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-9.
15. A non-transitory computer-readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method according to any one of claims 1-9.
16. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the method according to any one of claims 1-9. The computer program, when executed by the processor, implements the method according to any one of claims 1-9.
Citation Information
Patent Citations
Resource scheduling method and system, electronic equipment and readable storage medium
CN110097226A
Vehicle scheduling method and device, terminal equipment and storage medium
CN113256960A