CN114399228A - Task scheduling method and device, electronic equipment and medium - Google Patents

Task scheduling method and device, electronic equipment and medium Download PDF

Info

Publication number
CN114399228A
CN114399228A CN202210122167.XA CN202210122167A CN114399228A CN 114399228 A CN114399228 A CN 114399228A CN 202210122167 A CN202210122167 A CN 202210122167A CN 114399228 A CN114399228 A CN 114399228A
Authority
CN
China
Prior art keywords
target
resource
task
time
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210122167.XA
Other languages
Chinese (zh)
Inventor
李娜
于捷
袁云滔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shengdoushi Shanghai Science and Technology Development Co Ltd
Original Assignee
Shengdoushi Shanghai Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shengdoushi Shanghai Technology Development Co Ltd filed Critical Shengdoushi Shanghai Technology Development Co Ltd
Priority to CN202210122167.XA priority Critical patent/CN114399228A/en
Publication of CN114399228A publication Critical patent/CN114399228A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06312Adjustment or analysis of established resource schedule, e.g. resource or task levelling, or dynamic rescheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06313Resource planning in a project environment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/083Shipping

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The disclosure provides a task scheduling method and device, electronic equipment and a medium, and relates to the technical field of computers, in particular to the technical field of intelligent logistics. The implementation scheme is as follows: acquiring task information of a plurality of target tasks to be scheduled currently and available resource information of a plurality of target resources available currently, wherein each target resource is configured to execute one or more target tasks; determining the priority of each target task based on corresponding task information to obtain a plurality of target tasks corresponding to the plurality of priorities respectively; and aiming at a plurality of target tasks corresponding to each 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 by adopting a preset scheduling algorithm based on the task information of the plurality of target tasks and the respective available resource information of the plurality of target resources.

Description

Task scheduling method and device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for task scheduling, an electronic device, a computer-readable storage medium, and a computer program product.
Background
Task scheduling refers to scheduling tasks to be executed to resource execution for executing the tasks. Generally, the number of tasks to be executed is large, and the resources for executing the tasks are limited, so that the plurality of tasks to be executed need to be reasonably arranged on the limited resources to optimize the execution efficiency of the tasks.
The approaches described in this section are not necessarily approaches that have been previously conceived or pursued. Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, unless otherwise indicated, the problems mentioned in this section should not be considered as having been acknowledged in any prior art.
Disclosure of Invention
The disclosure provides a task scheduling method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
According to an aspect of the present disclosure, there is provided a task scheduling method, including: acquiring task information of a plurality of target tasks to be scheduled currently and available resource information of a plurality of target resources available currently, wherein each target resource is configured to execute one or more target tasks; determining the priority of each target task based on corresponding task information to obtain a plurality of target tasks corresponding to the plurality of priorities respectively; and aiming at a plurality of target tasks corresponding to each 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 by adopting a preset scheduling algorithm based on the task information of the plurality of target tasks and the respective available resource information of the plurality of target resources.
According to an aspect of the present disclosure, there is provided a task scheduling apparatus including: an obtaining module configured to obtain 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 that are currently available, each target resource being configured to execute one or more target tasks; the determining module is configured to determine the priority of each target task based on corresponding task information so as to obtain a plurality of target tasks corresponding to the plurality of priorities respectively; and the scheduling module is configured to determine, for a plurality of target tasks corresponding to each priority, 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 based on task information of the plurality of target tasks and available resource information of each of the plurality of target resources.
According to an aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described method.
According to an aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the above-described method.
According to an aspect of the disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the above-described method.
According to one or more embodiments of the present disclosure, real-time automatic scheduling of tasks can be achieved, the execution efficiency of tasks is improved, and the total waiting time is reduced.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the embodiments and, together with the description, serve to explain the exemplary implementations of the embodiments. The illustrated embodiments are for purposes of illustration only and do not limit the scope of the claims. Throughout the drawings, identical reference numbers designate similar, but not necessarily identical, elements.
FIG. 1 shows a flow diagram of a task scheduling method according to an embodiment of the present disclosure;
FIG. 2 illustrates a flow diagram of a transportation task scheduling process in accordance with an embodiment of the present disclosure;
FIG. 3 illustrates a flow diagram of an artificial bee colony algorithm according to an embodiment of the present disclosure;
FIG. 4 illustrates an iterative effect diagram of an artificial bee colony algorithm according to an embodiment of the present disclosure;
FIG. 5 shows a schematic diagram of a transportation task scheduling result according to an embodiment of the present disclosure;
FIG. 6 is a block diagram of a task scheduling apparatus according to an embodiment of the present disclosure; and
fig. 7 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, the timing relationship, or the importance relationship of the elements, and such terms are used only to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, based on the context, they may also refer to different instances.
The terminology used in the description of the various described examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the elements may be one or more. Furthermore, the term "and/or" as used in this disclosure is intended to encompass any and all possible combinations of the listed items.
Task scheduling refers to scheduling tasks to be executed to resource execution for executing the tasks. Generally, the number of tasks to be executed is large, and the resources for executing the tasks are limited, so that the plurality of tasks to be executed need to be reasonably arranged on the limited resources to optimize the execution efficiency of the tasks.
For example, the task to be scheduled may be a freight transportation task, and the resource for performing the freight transportation task may be a transportation site, and each transportation task needs to be scheduled to a suitable transportation site for a suitable period of time for execution. That is, the transport vehicle currently carrying the task of transporting the cargo is scheduled for a certain period of time to a certain transport site where loading (or unloading) of the cargo is completed.
In the related art, task scheduling is often performed manually, that is, by a worker arranging a plurality of tasks to be performed. Due to the fact that the efforts of workers are limited, only local information can be usually looked at when task scheduling is carried out, and global information cannot be comprehensively considered, so that the overall scheduling condition is poor, the task execution efficiency is low, and the overall waiting time is long.
In order to solve the above problems, the present disclosure provides a task scheduling method, which can integrally consider a plurality of target tasks to be currently scheduled and a plurality of currently available target resources, implement real-time automatic scheduling of tasks, improve the execution efficiency of tasks, and reduce the total waiting time.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
FIG. 1 shows a flow diagram of a task scheduling method 100 according to an embodiment of the present disclosure. Method 100 is performed by an electronic device (e.g., electronic device 700, below). As shown in fig. 1, the method 100 includes:
step S110, acquiring task information of a plurality of target tasks to be scheduled currently and available resource information of a plurality of target resources available currently, wherein each target resource is configured to execute one or more target tasks;
step S120, determining the priority of each target task based on corresponding task information to obtain a plurality of target tasks corresponding to a plurality of priorities respectively; and
step S130, for a plurality of target tasks corresponding to each priority, based on task information of the plurality of target tasks and available resource information of each of the plurality of target resources, determining a target resource and an execution time corresponding to each of the plurality of target tasks from the plurality of target resources by using a preset scheduling algorithm.
According to the embodiment of the disclosure, the priority of each target task to be scheduled is determined, and for each priority, a preset scheduling algorithm is adopted to schedule a plurality of target tasks of the priority to corresponding target resources and time (namely execution time), so that the real-time automatic scheduling of the tasks is realized, the execution efficiency of the tasks can be improved, and the total waiting time is reduced.
The various steps of method 100 are described in detail below.
In step S110, task information of a plurality of target tasks to be currently scheduled and available resource information of a plurality of target resources that are currently available are obtained, and each target resource is configured to execute one or more target tasks.
It should be noted that, in the embodiments of the present disclosure, "a plurality" means at least two.
The task scheduling method can be applied to any application scene, correspondingly, the target task can be a task to be scheduled in any application scene, and the target resource can be a resource for executing the target task in any application scene. For example, in a logistics scenario, the target task may be a cargo transportation task, and the target resource may be a transportation site (e.g., a dock, a freight station, a logistics transfer station, etc.) for performing cargo transportation (diversion). For another example, in a service scenario, a user may need to go to a service location to transact a certain business (e.g., medical service, mobile communication service, etc.), and accordingly, the target task may be the business of the user to be transacted, and the target resource may be a service window in the service location for transacting the business.
Each target task has corresponding task information. The task information is attribute information of the target task, and includes, but is not limited to, a scheduled start execution time of the target task (which may be a time reserved by a user or a time estimated by the electronic device according to some algorithm, etc.), a scheduled execution time, a scheduled latest execution end time, a task type, and the like.
Each target resource has corresponding available resource information. The available resource information is attribute information of the target resource, including but not limited to an available time of the target resource, a resource type, and the like. The resource type may be, for example, a type of a target task that the target resource can handle.
In step S120, a priority of each target task is determined based on the corresponding task information, so as to obtain a plurality of target tasks corresponding to the plurality of priorities respectively.
According to some embodiments, where the target task is a transportation task, the task information may include an actual arrival time and a planned arrival time of each of a plurality of transportation vehicles (e.g., vehicles, ships, etc.) for performing the transportation task. Accordingly, the priority of the target task may be determined based on a time difference between an actual arrival time of the transport and a planned arrival time. Thus, the overall scheduling can be well-ordered.
The priority of the target task may be determined in a number of ways.
According to some embodiments, the priority of a transportation task that arrives earlier (i.e., actual arrival time is earlier than planned arrival time) by the vehicle may be set higher than the priority of a transportation task that arrives later (i.e., actual arrival time is later than planned arrival time) by the vehicle (manner one). According to further embodiments, the closer the actual arrival time of the transport is to the planned arrival time, i.e. the smaller the absolute value of the time difference between the two, the higher the priority of the corresponding transport task may be set (mode two).
Based on the above first and second ways, an exemplary plurality of priorities from high to low may be:
priority 1 (highest priority): a transportation task that the transportation tool arrives on time (namely, the absolute value of the time difference between the actual arrival time and the planned arrival time is within 15 minutes);
priority 2: the transportation task of the transportation tool is within 30 minutes (namely the time difference between the planned arrival time and the actual arrival time is 15-30 minutes);
priority 3: the transportation task of the transportation tool is delayed to be within 30 minutes (namely the time difference between the actual arrival time and the planned arrival time is 15-30 minutes);
priority 4: transportation tasks that are as early as 30 minutes or more for the vehicle (i.e., the time difference between the planned arrival time and the actual arrival time is 30 minutes or more);
priority 5 (lowest priority): the vehicle is delayed to a transportation task of more than 30 minutes (i.e. the time difference between the actual arrival time and the planned arrival time is more than 30 minutes).
According to some embodiments, on the basis of the priority determination manner, in further response to determining that the task information satisfies a preset first rule, determining the priority of the target task as the highest priority; and determining the priority of the target task as the lowest priority in response to determining that the task information satisfies a preset second rule (manner three). The first rule may be, for example, that the time difference between the scheduled latest execution end time and the current time is smaller than a first threshold (e.g., 30 minutes), and the second rule may be, for example, that the time difference between the scheduled latest execution end time and the current time is larger than a second threshold (e.g., 2 hours). Therefore, the highest priority and the lowest priority can be set according to the specified rules (namely the first rule and the second rule) based on the current task execution condition, and the flexibility of task scheduling is improved. In some embodiments, the highest priority and/or the lowest priority may be manually specified.
Based on the above-mentioned modes one to three, exemplary priorities from high to low may be:
priority 1 (highest priority): the task information meets the transportation task of a first rule;
priority 2: a transportation task that the transportation tool arrives on time (namely, the absolute value of the time difference between the actual arrival time and the planned arrival time is within 15 minutes);
priority 3: the transportation task of the transportation tool is within 30 minutes (namely the time difference between the planned arrival time and the actual arrival time is 15-30 minutes);
priority 4: the transportation task of the transportation tool is delayed to be within 30 minutes (namely the time difference between the actual arrival time and the planned arrival time is 15-30 minutes);
priority 5: transportation tasks that are as early as 30 minutes or more for the vehicle (i.e., the time difference between the planned arrival time and the actual arrival time is 30 minutes or more);
priority 6: the transportation vehicle is late to a transportation task of more than 30 minutes (namely, the time difference between the actual arrival time and the planned arrival time is more than 30 minutes);
priority 7 (lowest priority): the task information satisfies a transportation task of the second rule.
After the priorities of the target tasks are determined, a plurality of target tasks corresponding to each priority can be obtained correspondingly.
In step S130, for a plurality of target tasks corresponding to each priority, 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 based on task information of the plurality of target tasks and available resource information of each of the plurality of target resources.
In the embodiment of the present disclosure, the execution time of the target task may be a time point (i.e., an execution start time) at which the target task starts to be executed, or may be a time period during which the target task is executed.
According to some embodiments, in step S130, the target tasks corresponding to each priority may be scheduled in order of priority from high to low, that is: and according to the sequence of the priorities from high to low, aiming at a plurality of target tasks corresponding to each priority, and based on the task information of the target tasks and the respective available resource information of the target resources, determining the corresponding target resource and execution time of each target task in the target tasks by adopting a preset scheduling algorithm. Therefore, the target tasks with higher priority can be scheduled and executed preferentially, so that the current limited target resources are optimally utilized, and the service requirements are met.
According to some embodiments, the task information includes an earliest executable time (i.e. the earliest time at which the corresponding target task can be executed), an execution time and a task type, and the available resource information includes an available time and a resource type, and accordingly, the target tasks corresponding to each priority may be scheduled according to the following steps S132 to S136:
step S132, dividing a plurality of target tasks into at least one task set, wherein each task set corresponds to one task type;
step S134, determining a resource set corresponding to each task set, wherein the resource set comprises at least one target resource, and the resource type of the at least one target resource is matched with the task type of the task set; and
and S136, for each task set, determining the corresponding target resource and the corresponding execution time of each target task in the task set by adopting a scheduling algorithm 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.
Based on the above steps S132 to S136, the task sets may be divided according to task types, corresponding resource sets may be determined, the task sets and the resource sets may be scheduled, and a target resource and an execution time corresponding to each task may be determined.
According to some embodiments, for steps S132 and S134, in the case that the target task is a transportation task of goods 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 types of goods, such as frozen goods, dry goods, wet goods, and the like. The earliest executable time may be the earliest time of availability of a vehicle (e.g., a vehicle) for transporting goods, i.e., the end time of the last task that the vehicle has scheduled.
For example, the priority 3 corresponds to the target tasks 1 to 10 (i.e., the transportation tasks), wherein the task types of the target tasks 1 to 3 are all frozen goods, and thus the three are divided into the same task set a. The task types of the target task 4 to the target task 6 are wet goods, so that the three tasks are divided into the same task set B. The task types of the target tasks 7 to 10 are all dry goods, so the four tasks are divided into the same task set C.
The currently available target resources are target resources 1 to 5 (i.e., transportation sites), wherein the resource types of the target resources 1, 3, and 5 are frozen goods (i.e., the target resources 1, 3, and 5 can be used to transport frozen goods), and therefore the three resources are divided into the same resource set a, which corresponds to the task set a whose task type is frozen goods. The resource type of the target resources 2, 3 is dry goods (i.e. the target resources 2, 3 can be used for transporting dry goods), so that they are divided into the same resource set B, corresponding to the task set B whose task type is dry goods. The resource types of the target resources 2 to 4 are wet goods, so that the three are divided into the same resource set C corresponding to the task set C with the task type being wet goods.
According to some embodiments, for step S136, the objective function of the scheduling algorithm is the sum of the starting execution time of each target task in the task set, and the expression is shown in the following formula (1):
Figure BDA0003498794730000081
where F is the value of the objective function, NassignFor the number of target tasks in the task set, Ti dispatchIs the starting execution time of the ith target task.
The optimization goal of the scheduling algorithm is to minimize the value of the objective function, thereby improving the task execution efficiency and reducing the total waiting time.
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.
According to some embodiments, the execution time includes a start execution time, and the step S136 further includes the following steps S1362 to S1366:
step S1362, initializing a plurality of resource sequences, wherein the resource sequences comprise target resources corresponding to each target task in the task set;
step S1364, circularly executing the following steps a to c until the circulation times reach a preset value:
step a, for each resource sequence in the current multiple resource sequences, determining the execution starting time of each target task in the corresponding target resource based on the earliest executable time, the execution duration and the available time of the corresponding target resource in the task set so as to obtain the execution starting time sequence corresponding to each resource sequence, wherein the execution starting time sequence comprises the execution starting time corresponding to each target task in the task set;
b, calculating the fitness value of each resource sequence based on the corresponding execution starting time sequence, wherein the fitness value is used for indicating the matching degree of the resource sequence and the optimization target; and
c, adjusting the current multiple resource sequences based on the fitness value to generate a plurality of adjusted resource sequences;
step S1366, determining a target resource and an execution starting time corresponding to each target task in the task set based on the resource sequence with the largest fitness value among the current multiple resource sequences and the corresponding execution starting time sequence.
Based on the above steps S1362 to S1366, a plurality of feasible solutions (i.e., resource sequences) for task scheduling may be initialized, a fitness value of each feasible solution is calculated, the feasible solutions are continuously adjusted based on the fitness values until a preset number of cycles is reached, a current optimal solution (the feasible solution with the largest fitness value) is used as a solution for the optimization problem, and based on the optimal solution, a target resource and an execution start time corresponding to each target task may be obtained.
According to some embodiments, for step a, the available time of the target resource includes at least one time period, each time period includes a start time and an end time, and accordingly, each target task in the task set at the start execution time of the corresponding target resource may be determined by:
regarding each target task in the task set, taking an earliest time period, in which the end time of the corresponding target resource is greater than or equal to the sum of the earliest executable time and the execution time length and the difference between the end time and the start time is greater than or equal to the execution time length, as a target time period; and taking the larger of the starting time and the earliest executable time of the target time period as the starting execution time of the target task on the corresponding target resource.
For example, the target resource corresponding to the target task i is DiThe earliest executable time of the target task i is
Figure BDA0003498794730000091
Duration of execution is
Figure BDA0003498794730000092
The time period for which the target resource is available is
Figure BDA0003498794730000093
Figure BDA0003498794730000094
Wherein the content of the first and second substances,
Figure BDA0003498794730000095
(j ═ 1, 2, …, Ndi) indicates the start time and end time of the jth time period, respectively. Traversing the time periods according to the sequence from front to back to find the first time period
Figure BDA0003498794730000096
So that
Figure BDA0003498794730000097
And is
Figure BDA0003498794730000098
Then the time period
Figure BDA0003498794730000099
I.e. the target time period. Further, the starting time of the target time period is set
Figure BDA00034987947300000910
Earliest executable time of target task
Figure BDA00034987947300000911
The larger of the two is used as a target task i in a target resource DiAt the time of starting execution of
Figure BDA00034987947300000912
That is to say that the first and second electrodes,
Figure BDA00034987947300000913
for step b, the fitness value is used to indicate the matching degree of the resource sequence with the optimization goal. The greater the fitness value of the resource sequence, the greater the matching degree of the resource sequence with the optimization goal, i.e. the closer to the optimization goal. Specifically, the fitness value may be calculated according to the following equation (2):
Figure BDA0003498794730000101
in the formula (2), fitnessiExpressing the fitness value of the ith resource sequence, e is a natural base number, beta is a preset fitness coefficient (which is a constant), and FiIs the objective function value of the ith resource sequence.
According to some embodiments, for step c, in case the scheduling algorithm is an artificial bee colony algorithm, the artificial bee colony algorithm may comprise a plurality of employed bee modules, a plurality of observation bee modules and a plurality of scout bee modules, each employed bee module corresponding to one resource sequence. The hiring bee module, the observation bee module and the reconnaissance bee module are all code modules for executing certain calculation tasks. Accordingly, step c may further comprise:
the hiring bee module adjusts the corresponding resource sequence into a resource sequence with larger fitness value in the neighborhood according to a first probability (P1), converts the resource sequence into an observation bee module according to a second probability (P2), and converts into a reconnaissance bee module according to a third probability (P3);
the observation bee module converts the fitness value of the current plurality of resource sequences into a hiring bee module of any one of the current plurality of resource sequences according to a fourth probability (P4) and continues to be used as an observation bee module according to a fifth probability (P5);
the scout bee module randomly generates a candidate resource sequence and converts the candidate resource sequence into an employment bee module of the candidate resource sequence in response to the adaptability value of the randomly generated candidate resource sequence being larger than the maximum value of the adaptability values of the plurality of current resource sequences; otherwise, the bee module is converted into an observation bee module according to a sixth probability (P6), and the bee module is continued to be used as a reconnaissance bee module according to a seventh probability (P7).
Based on the embodiment, the employed bee module, the observation bee module and the reconnaissance bee module can be mutually converted according to a certain probability (P1-P7), so that the randomness of the solution (resource sequence) is increased, the global optimal solution is conveniently found, and the situation that the solution falls into the local optimal solution is avoided.
Specifically, according to some embodiments, the hiring bee module searches the resource sequences in the neighborhood according to a first probability (P1), and once a new resource sequence with a larger fitness value is searched, the hiring bee module discards the original resource sequence and converts the original resource sequence into a new resource sequence.
For example, a resource sequence currently corresponding to a certain hiring bee module is Nec1Randomly generating a resource sequence Nec2In the range of 1 to Nassign(NassignIs the length of the resource sequence, i.e. the number of target tasks in the task set) to obtain NraNew resource sequence Nec is generatednewFront N ofraEach code follows Nnec1The latter coding follows Nnec2
According to some embodiments, the observation bee module obtains the following probability of each current resource sequence by means of roulette, and converts the resource sequences based on the following probabilities of the resource sequencesA bee module is hired for a certain sequence of resources therein. Follow probability of ith resource sequence
Figure BDA0003498794730000111
For example, it can be calculated according to the following formula (3):
Figure BDA0003498794730000112
wherein, fitnessiDenotes the fitness value, N, of the ith resource sequencenecFor the number of the current resource sequences,
Figure BDA0003498794730000113
is the sum of the fitness values of all current resource sequences.
Allocating a probability interval to each resource sequence based on the following probability of each resource sequence
Figure BDA0003498794730000114
And generating a random number between 0 and 1, and if the random number falls into a probability interval corresponding to the resource sequence i, converting the observation bee module into a bee hiring module of the resource sequence i.
According to some embodiments, the first to seventh probabilities P1-P7 satisfy the following condition: p1+ P2+ P3 is 1, P4+ P5 is 1, and P6+ P7 is 1. The present disclosure does not limit the specific values of P1-P7.
According to some embodiments, the task scheduling method 100 may be performed at a preset frequency (e.g., once per minute). Based on this embodiment, the method 100 is executed cyclically at a preset frequency, so that real-time dynamic scheduling of tasks can be achieved.
The task scheduling process of the embodiment of the disclosure is described below by taking a logistics transportation scenario as an example. In this example, the target task is a cargo transportation task, the target resource is a dock, and the transportation vehicle of the cargo is a vehicle. The task type and the dock type comprise frozen goods, dry goods and wet goods. Each vehicle may transport one or more types of cargo, i.e., each vehicle may perform one or more transport tasks. The adopted scheduling algorithm is an artificial bee colony algorithm.
FIG. 2 shows a flow diagram of a transportation task scheduling process 200 according to an embodiment of the present disclosure.
As shown in fig. 2, in step S201, scheduling data is acquired. The scheduling data includes vehicle information, mission information, and terminal information. The vehicle information includes, for example, an actual arrival time and a planned arrival time of each vehicle. The task information includes, for example, the execution time length and the type of task (frozen/dry/wet). The dock information includes, for example, the available time of the dock (including at least one time period) and the dock type (frozen/dry/wet).
In step S202, the vehicles are prioritized. For example, the vehicles are classified into the priority 1 to the priority 7 in accordance with the priority determination methods one to three described above.
In step S203, task scheduling is performed for all vehicles within each priority.
In step S204, the same type of tasks for all vehicles within the current priority are extracted to form a task set.
In step S205, a dock with the same type as the task set is selected as a feasible dock, and a dock set is formed.
In step S206, a feasible time period for each dock in the set of docks is acquired.
In step S207, a manual swarm algorithm is used for scheduling optimization, and an execution dock and an execution start time corresponding to each transportation task in the task set are determined.
In step S208, it is determined whether all task types of the current priority are completed through traversal. If not, executing the step S204, continuously acquiring a task set of the next task type of the current priority, and performing scheduling optimization; if yes, go to step S209.
In step S209, it is determined whether all the priorities are traversed to completion. If not, executing step S203, and performing task scheduling on all vehicles with the next priority; if yes, the task scheduling is finished, step S210 is executed, and the scheduling result is output.
In step S211, it is determined whether the scheduling is finished, i.e., whether the next scheduling is required. For example, the task scheduling is set to be performed at a frequency of once per minute. If the determination in step S211 is no, that is, the scheduling is not completed, step S212 is executed to obtain the task execution situation on site, and when the next minute comes, step S201 is executed to perform the next task scheduling. If the determination in step S211 is yes, the task scheduling process is ended, and the task scheduling is not performed for the next minute.
FIG. 3 illustrates a flow diagram of an artificial bee colony algorithm 300 according to an embodiment of the disclosure.
As shown in fig. 3, in step S301, relevant data including the earliest executable time and the execution duration of each transportation task, and the available time of each dock is acquired.
In step S302, the number of each swarm (hiring bees, observing bees, reconnaissance bees) is initialized, and each initial honey source, i.e., initial solution (initial multiple wharf sequence), is determined.
For example, the number of tasks currently entering the artificial bee colony algorithm for scheduling is NassignThe number of feasible docks is Ndock. The single honey source code length is NassignEach code range is 1-NdockAnd indicates the sequence number of the dock to which each task is scheduled. Wherein each task is scheduled to a specific time at the dock according to rules.
Further, the wharf serial number of task i is DiAssume that the last task ending time (i.e., the earliest executable time of task i) that the vehicle executing task i has scheduled is the last task ending time
Figure BDA0003498794730000121
The execution time of task i is
Figure BDA0003498794730000122
Wharf DiHas a feasible time period of
Figure BDA0003498794730000123
Sequentially traversing from front to back to find the firstOne interval
Figure BDA0003498794730000131
So that
Figure BDA0003498794730000132
And is
Figure BDA0003498794730000133
Figure BDA0003498794730000134
The task is scheduled to the dock at a time of
Figure BDA0003498794730000135
The calculation formula of the objective function is the above formula (1).
In step S303, the bee is hired to move. Some of the hiring bees search neighborhood honey sources, greedily selecting new honey sources. Another part randomly becomes an observation bee or a reconnaissance bee.
For example, a hiring bee may have a P1 probability of searching neighboring honey sources, and once better honey sources are searched, they may become hiring bees for new honey sources. The probability of P2 becomes the observation bee and the probability of P3 becomes the scout bee. (P1+ P2+ P3 ═ 1)
For example, in a neighborhood search, assume that the source of the local honey is Nec1Randomly generating a honey source as Nec2Then 1 to NassignMiddle random access number NraNew honey source NecnewFront N ofraThe codes follow Nec1The latter coding follows Nec2
In step S304, the bee is observed to move. And calculating the fitness value of each honey source by the observation bees, and obtaining the following probability of each honey source based on the fitness value. One part of the observers becomes the employed bees according to the following probability, and the other part keeps observing the bees.
For example, fitness values of all the honey sources are calculated, and the following probability of each honey source is obtained through a roulette mode according to the fitness values. All the observation bees are randomly judged, the probability of P4 becomes the employment bee of a specific honey source according to the following probability, and the probability of P5 keeps the state of the observation bee. (P4+ P5 ═ 1)
Further, the fitness value of the honey source i is calculated by the above formula (2). Based on the fitness value, the following probability of the honey source i is calculated by adopting the formula (3). Based on following probability of each honey source, a section of probability interval is distributed to each honey source
Figure BDA0003498794730000136
Figure BDA0003498794730000137
Randomly generating a number between 0 and 1, and if the probability interval of the honey source i is fallen, observing the bee to be converted into the employed bee of the honey source.
In step S305, the bee is detected to move. The scout bees randomly search for a new honey source, if a honey source better than the current optimum is found, the scout bees become hired bees of the honey source, otherwise the scout bees become observation bees or keep scout bees with a certain probability.
For example, a scout bee may randomly search the whole solution space for honey source NfindIf more than the current optimal honey source Nec is foundbestThe better honey source becomes the hiring bee of the new honey source. Otherwise, random judgment is carried out, the probability of P6 is changed into observation bees, and the probability of P7 is kept in the state of reconnaissance bees. (P6+ P7 ═ 1)
One specific example of an embodiment of the present disclosure is described below.
A certain logistics company needs to reasonably plan the transportation tasks of the wharf vehicles, the number of the vehicles needing to be planned is 51, the total number of the tasks is 123, and 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 three types of frozen goods, dry goods and wet goods. The wharves are 18 in number and are responsible for processing different task types, and some wharves can simultaneously process different task types. In order to improve the overall logistics efficiency, the tasks need to be reasonably arranged, so that the sum of the starting execution moments of all the tasks is minimum, namely the waiting time is minimum.
All algorithm codes are written in JAVA language of IDEA2020 (JDK8), where parameters of artificial bee colony algorithm are set as follows: the number of iterations was set to 400, the number of employed bees and the number of initial honey sources were both 60, the number of observation bees was 60, and the number of scout bees was 80. P1-0.3, P2-0.4, P3-0.3, P4-0.3, P5-0.7, P6-0.4, and P7-0.6. And taking an iteration result calculated by one artificial bee colony algorithm, as shown in fig. 4. In the embodiment, the artificial bee colony algorithm can be basically converged before 200 times, so that the requirement of quick solution can be met on the premise of short solution time, and real-time and dynamic task scheduling is realized.
After all tasks are scheduled, the task scheduling situation is drawn into a Gantt chart, and as shown in fig. 5, the scheduling pressure is small because the task amount of the dry goods wharf is small. The tasks of frozen goods and wet goods are large, and the wharf is tense. It can be observed that the idle time of the wharf can be fully utilized through reasonable planning, so that the whole waiting time is reduced, and the logistics transportation efficiency is improved.
According to another aspect of the present disclosure, a task scheduling apparatus is also provided. Fig. 6 shows a block diagram of a task scheduling device 600 according to an embodiment of the present disclosure. As shown in fig. 6, the apparatus 600 includes:
an obtaining module 610 configured to obtain 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 that are currently available, each target resource being configured to execute one or more target tasks;
a determining module 620 configured to determine a priority of each target task based on the corresponding task information to obtain a plurality of target tasks corresponding to the plurality of priorities respectively; and
the scheduling module 630 is configured to, for a plurality of target tasks corresponding to each priority, determine, based on task information of the plurality of target tasks and available resource information of each of the plurality of target resources, a target resource and an execution time corresponding to each of the plurality of target tasks from the plurality of target resources by using a preset scheduling algorithm.
According to the embodiment of the disclosure, the priority of each target task to be scheduled is determined, and for each priority, a preset scheduling algorithm is adopted to schedule a plurality of target tasks of the priority to corresponding target resources and time (namely execution time), so that the real-time automatic scheduling of the tasks is realized, the execution efficiency of the tasks can be improved, and the total waiting time is reduced.
According to some embodiments, the task information includes an earliest executable time, an execution time 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 an available time and a resource type, and the scheduling module includes:
a dividing unit configured to divide the plurality of target tasks into at least one task set, each task set corresponding to a task type;
a determining unit, configured to determine a resource set corresponding to each task set, where the resource set includes at least one target resource, and a resource type of the at least one target resource matches a task type of the task set; and
and the first scheduling unit is configured to determine, for each task set, a corresponding target resource and an execution time of each target task in the task set by using the scheduling algorithm 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.
According to some embodiments, the objective function of the scheduling algorithm is the sum of the starting execution time of each objective task in the task set, and the optimization goal of the scheduling algorithm is to minimize the value of the objective function.
According to some embodiments, the execution time includes a start execution time, and the first scheduling unit includes:
an initialization unit configured to initialize a plurality of resource sequences, wherein each resource sequence includes a target resource corresponding to each target task in the task set;
the scheduling algorithm solving unit is configured to execute the following steps in a circulating mode until the circulating times reach a preset value: for each resource sequence in the current multiple resource sequences, determining the execution starting time of each target task in the corresponding target resource based on the earliest executable time, the execution duration and the available time of the corresponding target resource in the task set to obtain an execution starting time sequence corresponding to each resource sequence, wherein the execution starting time sequence comprises the execution starting time corresponding to each target task in the task set; calculating a fitness value of each resource sequence based on the corresponding starting execution time sequence, wherein the fitness value is used for indicating the matching degree of the resource sequence and the optimization target; adjusting the current multiple resource sequences based on the fitness value to generate adjusted multiple resource sequences; and
and the second scheduling unit is configured to determine a target resource and an execution starting time corresponding to 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 corresponding execution starting time sequence.
According to some embodiments, 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 the ending time of the corresponding target resource is greater than or equal to the sum of the earliest executable time and the execution time length and the difference between the ending time and the starting time is greater than or equal to the execution time length, as a target time period; and taking the larger of the starting time of the target time period and the earliest executable time as the starting execution time of the target task on the corresponding target resource.
According to some embodiments, the scheduling algorithm is an artificial bee colony algorithm, the scheduling algorithm solving unit comprises a plurality of employed bee modules, a plurality of observation bee modules and a plurality of scout bee modules, each employed bee module corresponding to a resource sequence,
the hiring bee module is configured to: adjusting the corresponding resource sequence to a resource sequence with a larger fitness value in the neighborhood according to the first probability, converting the resource sequence into an observation bee module according to the second probability, and converting the resource sequence into a reconnaissance bee module according to the third probability;
the observation bee module is configured to: the employing bee module is converted into any resource sequence in the plurality of resource sequences according to a fourth probability on the basis of the fitness values of the plurality of current resource sequences, and continues to serve as an observing bee module according to a fifth probability; and
the scout bee module is configured to: a hiring bee module that randomly generates a candidate resource sequence and translates into the candidate resource sequence in response to a fitness value of the randomly generated candidate resource sequence being greater than a maximum of the fitness values of the current plurality of resource sequences; otherwise, the observation bee module is converted into the reconnaissance bee module according to the sixth probability, and the reconnaissance bee module is continuously used as the reconnaissance bee module according to the seventh probability.
It should be understood that the various modules or units of the apparatus 600 shown in fig. 6 may correspond to the various steps in the method 100 described with reference to fig. 1. Thus, the operations, features and advantages described above with respect to the method 100 are equally applicable to the apparatus 600 and the modules and units comprised thereby. Certain operations, features and advantages may not be described in detail herein for the sake of brevity.
Although specific functionality is discussed above with reference to particular modules, it should be noted that the functionality of the various modules discussed herein may be divided into multiple modules and/or at least some of the functionality 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.
It should also be appreciated that various techniques may be described herein in the general context of software, hardware elements, or program modules. The various modules described above with respect to fig. 6 may be implemented in hardware or in hardware in combination with software and/or firmware. For example, the modules may be implemented as computer program code/instructions configured to be executed in one or more processors and stored in a computer-readable storage medium. Alternatively, the modules may be implemented as hardware logic/circuitry. For example, in some embodiments, one or more of the modules 610-630 may be implemented together in a System on Chip (SoC). The SoC may include an integrated circuit chip (which includes one or more components of a Processor (e.g., a Central Processing Unit (CPU), microcontroller, microprocessor, Digital Signal Processor (DSP), etc.), memory, one or more communication interfaces, and/or other circuitry), and may optionally execute received program code and/or include embedded firmware to perform functions.
According to another aspect of the present disclosure, there is also provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the task scheduling method described above.
According to another aspect of the present disclosure, there is also provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the above-mentioned task scheduling method.
According to another aspect of the present disclosure, there is also provided a computer program product comprising a computer program, wherein the computer program when executed by a processor implements the task scheduling method described above.
Referring to fig. 7, a block diagram of a structure of an electronic device 700, which may be the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. The electronic devices may be different types of computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
FIG. 7 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure. As shown in fig. 7, the electronic device 700 may include at least one processor 701, a working memory 702, I/O devices 704, a display device 705, a storage 706, and a communication interface 707, which may communicate with each other through a system bus 703.
Processor 701 may be a single processing unit or multiple processing units, all of which may include single or multiple computing units or multiple cores. The processor 701 may be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuitry, and/or any devices that manipulate signals based on operational instructions. The processor 701 may be configured to retrieve and execute computer readable instructions, such as program code for an operating system 702a, program code for an application 702b, and the like, stored in the working memory 702, the storage device 706, or other computer readable medium.
Working memory 702 and storage 706 are examples of computer-readable storage media for storing instructions that are executed by processor 701 to perform the various functions described above. The working memory 702 may include both volatile and non-volatile memory (e.g., RAM, ROM, etc.). Further, storage 706 may include a hard disk drive, solid state drive, removable media, including external and removable drives, memory cards, flash memory, floppy disks, optical disks (e.g., CDs, DVDs), storage arrays, network attached storage, storage area networks, and so forth. Both the working memory 702 and the storage 706 may be collectively referred to herein as memory or computer-readable storage medium, and may be non-transitory media capable of storing computer-readable, processor-executable program instructions as computer program code, which may be executed by the processor 701 as a particular machine configured to implement the operations and functions described in the examples herein.
The I/O devices 704 may include input devices and/or output devices, and the input devices may be any type of device capable of inputting information to the electronic device 700, which may include, but are not limited to, a mouse, keyboard, touch screen, track pad, track ball, joystick, microphone, and/or remote control. Output devices may be any type of device capable of presenting information and may include, but are not limited to including, video/audio output terminals, vibrators, and/or printers.
Communication interface 707 allows electronic device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and/or a chipset, such as bluetoothTMDevices, 802.11 devices, Wi-Fi devices, WiMAX devices, cellular communication devices, and/or the like.
The application 702b in the working register 702 may be loaded to perform the various methods and processes described above, such as steps S110-S130 in fig. 1. In some embodiments, some or all of the computer program may be loaded and/or installed onto electronic device 700 via storage 706 and/or communication interface 707. When loaded and executed by the processor 701, may perform one or more of the steps of the task scheduling method described above.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable task scheduling apparatus, such that the program codes, when executed by the processor or controller, cause the functions/acts specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may 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 a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; 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 may be received in any form, including acoustic, speech, or tactile input.
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: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computing system may 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.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be performed in parallel, sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the above-described methods, systems and apparatus are merely exemplary embodiments or examples and that the scope of the present invention is not limited by these embodiments or examples, but only by the claims as issued and their equivalents. Various elements in the embodiments or examples may be omitted or may be replaced with equivalents thereof. Further, the steps may be performed in an order different from that described in the present disclosure. Further, various elements in the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced with equivalent elements that appear after the present disclosure.

Claims (20)

1. A method for task scheduling, comprising:
acquiring task information of a plurality of target tasks to be scheduled currently and available resource information of a plurality of target resources available currently, wherein each target resource is configured to execute one or more target tasks;
determining the priority of each target task based on corresponding task information to obtain a plurality of target tasks corresponding to the plurality of priorities respectively; and
and aiming at a plurality of target tasks corresponding to each 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 by adopting a preset scheduling algorithm based on the task information of the plurality of target tasks and the respective available resource information of the plurality of target resources.
2. The method of claim 1, wherein the target tasks are transportation tasks, the task information includes respective actual arrival times and planned arrival times of a plurality of vehicles for performing the transportation tasks, and wherein determining the priority of each target task based on the respective task information comprises:
determining a priority of the target task based on a time difference between the actual arrival time and the planned arrival time.
3. The method of claim 2, wherein determining the priority of each target task based on the corresponding task information further comprises:
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 a lowest priority.
4. The method of claim 1, wherein for a plurality of target tasks corresponding to each priority, determining, based on task information of the target tasks and available resource information of the target resources, a corresponding target resource and execution time of each target task in the target tasks from the target resources by using a preset scheduling algorithm comprises:
according to the sequence of the priorities from high to low, aiming at a plurality of target tasks corresponding to each priority, based on task information of the target tasks and available resource information of the target resources, a preset scheduling algorithm is adopted to determine a target resource and an execution time corresponding to each target task in the target tasks from the target resources.
5. The method of any one of claims 1-4, wherein the task information includes an earliest executable time, an execution duration, and a task type, the earliest executable time being an earliest time at which a corresponding target task can be executed, the available resource information including an available time and a resource type,
and determining, based on the task information of the target tasks and the available resource information of each of the target resources, a target resource and an execution time corresponding to each of the target tasks from the target resources by using a preset scheduling algorithm includes:
dividing the target tasks into at least one task set, wherein each task set corresponds to one task type;
determining a resource set corresponding to each task set, wherein the resource set comprises at least one target resource, and the resource type of the at least one target resource is matched with the task type of the task set; and
and for each 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, determining the corresponding target resource and the execution time of each target task in the task set by adopting the scheduling algorithm.
6. The method of claim 5, wherein an objective function of the scheduling algorithm is a sum of starting execution times of respective objective tasks in the task set, and wherein an optimization goal of the scheduling algorithm is to minimize a value of the objective function.
7. The method of claim 6, wherein the execution time comprises a start execution time, and wherein determining the corresponding target resource and execution time for each target task in the set of tasks using the scheduling algorithm based on an earliest executable time and an execution duration for each target task in the set of tasks and an available time for each target resource in the corresponding set of resources comprises:
initializing a plurality of resource sequences, wherein the resource sequences comprise target resources corresponding to each target task in the task set;
circularly executing the following steps until the circulation times reach a preset value:
for each resource sequence in the current multiple resource sequences, determining the execution starting time of each target task in the corresponding target resource based on the earliest executable time, the execution duration and the available time of the corresponding target resource in the task set to obtain an execution starting time sequence corresponding to each resource sequence, wherein the execution starting time sequence comprises the execution starting time corresponding to each target task in the task set;
calculating a fitness value of each resource sequence based on the corresponding starting execution time sequence, wherein the fitness value is used for indicating the matching degree of the resource sequence and the optimization target; and
based on the fitness value, adjusting the current multiple resource sequences to generate adjusted multiple resource sequences;
and
and determining a corresponding target resource and a corresponding execution starting time of each target task in the task set based on the resource sequence with the maximum fitness value in the current multiple resource sequences and the corresponding execution starting time sequence.
8. The method of claim 7, wherein the available time comprises at least one time period, each time period comprising a start time and an end time,
and, determining the starting execution time of each target task in the corresponding target resource based on the earliest executable time, the execution duration and the available time of the corresponding target resource of each target task in the task set comprises:
for each target task in the task set, taking the earliest time period, in which the ending time of the corresponding target resource is greater than or equal to the sum of the earliest executable time and the execution time length and the difference between the ending time and the starting time is greater than or equal to the execution time length, as a target time period; and
and taking the larger of the starting time of the target time period and the earliest executable time as the starting execution time of the target task on the corresponding target resource.
9. The method of claim 7 or 8, wherein the scheduling algorithm is a manual swarm algorithm comprising a plurality of employed bee modules, a plurality of observation bee modules, and a plurality of scout bee modules, each employed bee module corresponding to a sequence of resources,
and adjusting the current plurality of resource sequences based on the fitness value to generate adjusted plurality of resource sequences comprises:
the hiring bee module adjusts the corresponding resource sequence into a resource sequence with a larger fitness value in the neighborhood according to the first probability, converts the resource sequence into an observation bee module according to the second probability, and converts the resource sequence into a reconnaissance bee module according to the third probability;
the observation bee module is converted into a hiring 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 current resource sequences, and continues to serve as the observation bee module according to a fifth probability; and
the scout bee module randomly generates a candidate resource sequence and converts the candidate resource sequence 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, the observation bee module is converted into the reconnaissance bee module according to the sixth probability, and the reconnaissance bee module is continuously used as the reconnaissance bee module according to the seventh probability.
10. The method of any of claims 1-4, 6-8, wherein the target resource comprises a transportation site and the target task comprises a transportation task.
11. The method according to any of claims 1-4, 6-8, wherein the task scheduling method is performed at a preset frequency.
12. A task scheduling apparatus, comprising:
an obtaining module configured to obtain 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 that are currently available, each target resource being configured to execute one or more target tasks;
the determining module is configured to determine the priority of each target task based on corresponding task information so as to obtain a plurality of target tasks corresponding to the plurality of priorities respectively; and
and the scheduling module is configured to determine, for a plurality of target tasks corresponding to each priority, 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 based on the task information of the plurality of target tasks and the available resource information of each target resource.
13. The apparatus of claim 12, wherein the task information comprises an earliest executable time, an execution duration and a task type, the earliest executable time being an earliest time at which a corresponding target task can be executed, and the available resource information comprises an available time and a resource type, and wherein the scheduling module comprises:
a dividing unit configured to divide the plurality of target tasks into at least one task set, each task set corresponding to a task type;
a determining unit, configured to determine a resource set corresponding to each task set, where the resource set includes at least one target resource, and a resource type of the at least one target resource matches a task type of the task set; and
and the first scheduling unit is configured to determine, for each task set, a corresponding target resource and an execution time of each target task in the task set by using the scheduling algorithm 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.
14. The apparatus of claim 13, wherein an objective function of the scheduling algorithm is a sum of starting execution times of respective objective tasks in the task set, and wherein an optimization goal of the scheduling algorithm is to minimize a value of the objective function.
15. The apparatus of claim 14, wherein the execution time comprises a start execution time, and wherein the first scheduling unit comprises:
an initialization unit configured to initialize a plurality of resource sequences, wherein each resource sequence includes a target resource corresponding to each target task in the task set;
the scheduling algorithm solving unit is configured to execute the following steps in a circulating mode until the circulating times reach a preset value:
for each resource sequence in the current multiple resource sequences, determining the execution starting time of each target task in the corresponding target resource based on the earliest executable time, the execution duration and the available time of the corresponding target resource in the task set to obtain an execution starting time sequence corresponding to each resource sequence, wherein the execution starting time sequence comprises the execution starting time corresponding to each target task in the task set;
calculating a fitness value of each resource sequence based on the corresponding starting execution time sequence, wherein the fitness value is used for indicating the matching degree of the resource sequence and the optimization target; and
based on the fitness value, adjusting the current multiple resource sequences to generate adjusted multiple resource sequences;
and
and the second scheduling unit is configured to determine a target resource and an execution starting time corresponding to 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 corresponding execution starting time sequence.
16. The apparatus of claim 15, wherein the available time comprises at least one time period, each time period comprising a start time and an end time, and wherein the scheduling algorithm solving unit is further configured to:
for each target task in the task set, taking the earliest time period, in which the ending time of the corresponding target resource is greater than or equal to the sum of the earliest executable time and the execution time length and the difference between the ending time and the starting time is greater than or equal to the execution time length, as a target time period; and
and taking the larger of the starting time of the target time period and the earliest executable time as the starting execution time of the target task on the corresponding target resource.
17. The apparatus of claim 15 or 16, wherein the scheduling algorithm is an artificial bee colony algorithm, wherein the scheduling algorithm solving unit comprises a plurality of employed bee modules, a plurality of observation bee modules, and a plurality of scout bee modules, wherein each employed bee module corresponds to a resource sequence,
the hiring bee module is configured to: adjusting the corresponding resource sequence to a resource sequence with a larger fitness value in the neighborhood according to the first probability, converting the resource sequence into an observation bee module according to the second probability, and converting the resource sequence into a reconnaissance bee module according to the third probability;
the observation bee module is configured to: the employing bee module is converted into any resource sequence in the plurality of resource sequences according to a fourth probability on the basis of the fitness values of the plurality of current resource sequences, and continues to serve as an observing bee module according to a fifth probability; and
the scout bee module is configured to: a hiring bee module that randomly generates a candidate resource sequence and translates into the candidate resource sequence in response to a fitness value of the randomly generated candidate resource sequence being greater than a maximum of the fitness values of the current plurality of resource sequences; otherwise, the observation bee module is converted into the reconnaissance bee module according to the sixth probability, and the reconnaissance bee module is continuously used as the reconnaissance bee module according to the seventh probability.
18. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-11.
19. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1-11.
20. A computer program product comprising a computer program, characterized in that the computer program realizes the method according to any of claims 1-11 when executed by a processor.
CN202210122167.XA 2022-02-09 2022-02-09 Task scheduling method and device, electronic equipment and medium Pending CN114399228A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210122167.XA CN114399228A (en) 2022-02-09 2022-02-09 Task scheduling method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210122167.XA CN114399228A (en) 2022-02-09 2022-02-09 Task scheduling method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN114399228A true CN114399228A (en) 2022-04-26

Family

ID=81232845

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210122167.XA Pending CN114399228A (en) 2022-02-09 2022-02-09 Task scheduling method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114399228A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116542413A (en) * 2023-04-28 2023-08-04 北京大数据先进技术研究院 Task processing method, device, equipment and storage medium based on time coordinates
CN116541165A (en) * 2023-04-23 2023-08-04 中国电子产品可靠性与环境试验研究所((工业和信息化部电子第五研究所)(中国赛宝实验室)) Real-time system task scheduling method, device, computer equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541165A (en) * 2023-04-23 2023-08-04 中国电子产品可靠性与环境试验研究所((工业和信息化部电子第五研究所)(中国赛宝实验室)) Real-time system task scheduling method, device, computer equipment and storage medium
CN116542413A (en) * 2023-04-28 2023-08-04 北京大数据先进技术研究院 Task processing method, device, equipment and storage medium based on time coordinates
CN116542413B (en) * 2023-04-28 2024-04-16 北京大数据先进技术研究院 Task processing method, device, equipment and storage medium based on time coordinates

Similar Documents

Publication Publication Date Title
US10474504B2 (en) Distributed node intra-group task scheduling method and system
US8924978B2 (en) Sequential cooperation between map and reduce phases to improve data locality
US9430285B2 (en) Dividing and parallel processing record sets using a plurality of sub-tasks executing across different computers
US9483319B2 (en) Job scheduling apparatus and method therefor
US8434085B2 (en) Scalable scheduling of tasks in heterogeneous systems
US8700752B2 (en) Optimized efficient LPAR capacity consolidation
CN110389816B (en) Method, apparatus and computer readable medium for resource scheduling
CN114399228A (en) Task scheduling method and device, electronic equipment and medium
US10255114B2 (en) Abnormality detection apparatus, control method, and program
CN112667376A (en) Task scheduling processing method and device, computer equipment and storage medium
CN113377520A (en) Resource scheduling method, device, equipment and storage medium
US8887165B2 (en) Real time system task configuration optimization system for multi-core processors, and method and program
US10261874B2 (en) Enabling a cloud controller to communicate with power systems
US20130290979A1 (en) Data transfer control method of parallel distributed processing system, parallel distributed processing system, and recording medium
CN113641457A (en) Container creation method, device, apparatus, medium, and program product
JP2020149675A (en) System and method for optimizing scheduling of non-preemptive task in multi-robotic environment
CN105824705A (en) Task distribution method and electronic equipment
CN108595251B (en) Dynamic graph updating method, device, storage engine interface and program medium
CN111144796B (en) Method and device for generating tally information
KR101595967B1 (en) System and Method for MapReduce Scheduling to Improve the Distributed Processing Performance of Deadline Constraint Jobs
CN113742075A (en) Task processing method, device and system based on cloud distributed system
CN110276508B (en) Method and device for distributing task information
CN116187660A (en) Order processing method, device, computing equipment and medium
CN110764886B (en) Batch job cooperative scheduling method and system supporting multi-partition processing
CN109559078B (en) Vehicle scheduling method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20220426

Assignee: Baisheng Consultation (Shanghai) Co.,Ltd.

Assignor: Shengdoushi (Shanghai) Technology Development Co.,Ltd.

Contract record no.: X2023310000138

Denomination of invention: Task scheduling methods and devices, electronic devices, and media

License type: Common License

Record date: 20230714

EE01 Entry into force of recordation of patent licensing contract