Task scheduling method and apparatus, electronic device, storage medium, and computer program product
By comparing equipment weights and selecting the equipment with the least resource consumption to perform the task, the conflict problem of equipment competing for tasks in logistics transportation is resolved, thereby improving transportation efficiency and resource utilization.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SF TECH CO LTD
- Filing Date
- 2025-07-10
- Publication Date
- 2026-05-07
AI Technical Summary
In logistics and transportation, when multiple handling devices compete for the same handling task at the same time, existing technologies are unable to resolve the conflict, resulting in rigid operating logic and low efficiency of the equipment.
By acquiring the device weight of the contested task, comparing the resource consumption of conflicting devices, selecting the device with the lowest resource consumption to execute the task, resolving the conflict between devices, and optimizing task allocation through iterative comparison and random selection.
While resolving conflicts over equipment tasks, it saved operational resources and improved the efficiency of logistics and transportation as well as equipment utilization.
Smart Images

Figure CN2025107843_07052026_PF_FP_ABST
Abstract
Description
Task scheduling methods and apparatuses, electronic devices, storage media and computer program products Technical Field
[0001] This application relates to the field of logistics and transportation technology, specifically to a task scheduling method and apparatus, electronic equipment, storage medium, and computer program product. Background Technology
[0002] In logistics and transportation, a crucial task is the handling of goods. For example, within a logistics station, this involves moving goods or containers carrying goods from the starting point to the destination.
[0003] With the increasing level of automation, a large number of material handling equipment have been used to perform material handling tasks. However, the equipment has low analytical capabilities, and without human intervention, it mainly determines the execution order of tasks based on the order of receipt. This makes it difficult to resolve conflicts when multiple devices compete for the same material handling task, and the operating logic is very rigid. Summary of the Invention
[0004] In view of this, this application aims to provide a task scheduling method and apparatus, electronic device, storage medium and computer program product to solve the problem of multiple handling devices competing for the same handling task in the handling work of logistics transportation, and to provide a more intelligent task scheduling logic.
[0005] In a first aspect, embodiments of this application provide a task scheduling method, including:
[0006] Acquire a contested task and at least two task-conflicting devices, each task-conflicting device having a task queue, the task queue being used to provide the execution order of the tasks to be executed by the task-conflicting devices, wherein the contested task is the task to be executed at the head of the task queue of the at least two task-conflicting devices;
[0007] Obtain the device weight of the contested task, whereby the device weight describes the resource consumption of a device executing a task to be executed;
[0008] The device weights corresponding to the at least two conflicting devices in the contested task are selected from the device weights of the contested task and compared to obtain the comparison results. The conflicting device corresponding to the smallest device weight in the comparison results is selected as the device to execute the contested task.
[0009] Secondly, embodiments of this application provide a task scheduling apparatus, including:
[0010] The first acquisition module is used to acquire the contested task and at least two task conflicting devices. The task conflicting devices have task queues, which are used to provide the execution order of the tasks to be executed by the task conflicting devices. The contested task is the task to be executed at the head of the task queue of the at least two task conflicting devices.
[0011] The second acquisition module is used to acquire the device weight of the contested task, wherein the device weight is used to describe the resource consumption of a device executing a task to be executed;
[0012] The determination module is used to select the device weights corresponding to the at least two conflicting devices from the device weights of the contested task, compare them to obtain a comparison result, and select the conflicting device corresponding to the smallest device weight in the comparison result as the device to execute the contested task.
[0013] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor;
[0014] The memory is connected to the processor and is used to store programs;
[0015] The processor is used to implement the task scheduling method as described in the first aspect by running a program in the memory.
[0016] Fourthly, embodiments of this application provide a storage medium storing a computer program, which, when executed by a processor, implements the task scheduling method described in the first aspect.
[0017] Fifthly, embodiments of this application provide a computer program product, including computer program instructions, which, when executed by a processor, cause the processor to perform the task scheduling method as described in the first aspect.
[0018] This application provides a task scheduling method. When at least two devices compete for the right to execute the same task, the resource consumption of each conflicting device is analyzed by comparing the device weights of the task and selecting the device with the lowest resource consumption as the device to execute the task. This method resolves the conflict problem of multiple devices competing for the same transportation task while saving as many operating resources as possible. Attached Figure Description
[0019] Figure 1 is a flowchart illustrating a task scheduling method provided in an embodiment of this application;
[0020] Figure 2 is a schematic diagram of the process of an execution device performing a task to be executed according to an embodiment of this application;
[0021] Figure 3 is a schematic diagram of the structure of a task scheduling device proposed in an embodiment of this application;
[0022] Figure 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0023] The first embodiment of this application provides a task scheduling method, as shown in FIG1, which may include the following steps:
[0024] Step 101: Obtain the contested task and at least two task-conflicting devices. The task-conflicting devices have task queues, which are used to provide the execution order for the task-conflicting devices to execute the tasks to be executed. The contested task is the task to be executed at the head of the task queue of at least two task-conflicting devices.
[0025] The method described in this embodiment is mainly applied to handling operations in logistics transportation. Specifically, the process of moving goods or containers carrying goods from the starting point to the ending point of a task is summarized as a task to be performed. An execution device with handling capabilities is used to perform these tasks to complete the handling work. For example, as shown in Figure 2, point A is the starting point of three tasks to be performed, namely Task 1, Task 2, and Task 3, while points B, C, and D are the ending points of these three tasks. The execution device needs to first travel to the starting point A, and then it can perform Task 1 to reach point B, or Task 2 to reach point C, or Task 3 to reach point D.
[0026] Each execution device has its own task queue, which includes tasks assigned to that execution device and waiting to be executed. The execution device will execute the task at the head of the queue. After the task at the head of the queue is completed, it is dequeued and the next task to be executed takes over as the task at the head of the queue.
[0027] However, allocating appropriate tasks to execution devices is a highly complex problem. One solution is to assign unique tasks to different execution devices from the outset, ensuring each task appears only once in each device's task queue. However, this method lacks flexibility and is difficult to adapt to changing circumstances in practical applications. For example, consider execution devices D1 and D2, and tasks A, B, C, D, and E. After allocation, tasks A, B, and C are placed in the task queue of execution device D1, and tasks D and E are placed in the task queue of execution device D2. Execution device D1 cannot monitor the execution status of tasks D and E, and similarly, execution device D2 cannot monitor the execution status of tasks A, B, and C. If execution device D2 is highly efficient, after completing tasks D and E and entering idle time, execution device D1 may not have finished completing task B. At this point, execution device D2 cannot be aware that task C has not been executed, resulting in a situation where "execution device D1 is overworked while execution device D2 is idle," reducing the efficiency of the material handling process.
[0028] Therefore, another approach is to allocate tasks to be executed in real time for each execution device, and to share these tasks among the devices. However, this introduces another problem—multiple execution devices may compete for the same task. For example, given execution devices D1 and D2 and tasks A, B, C, D, and E to be executed, execution device D1 has a task queue ABCDE, and execution device D2 has a task queue ADCEB. In this case, both execution devices will simultaneously compete for task A.
[0029] This embodiment proposes a method to resolve this conflict. When a task to be executed is simultaneously at the head of the task queues of at least two execution devices, the task to be executed is designated as the contested task, and the execution device in conflict is designated as the task conflict device.
[0030] Step 102: Obtain the device weight of the contested task. The device weight is used to describe the resource consumption of a device to execute a task.
[0031] After identifying the contested task and the conflicting devices, it's necessary to obtain the device weight of the contested task. The device weight describes the resource consumption of the executing device when performing the task. The device weight can be a specific parameter, such as the estimated power consumption of the executing device when performing a task. It can also be an abstract value, such as a weighted average of multiple quantified factors affecting execution efficiency. The abstract value itself is meaningless, but comparisons between multiple abstract values are meaningful. The device weight is used to determine the appropriate executing device among the conflicting devices.
[0032] Step 103: Select the device weights corresponding to at least two conflicting devices from the device weights of the contested task, compare them to obtain the comparison results, and select the conflicting device corresponding to the smallest device weight in the comparison results as the device to execute the contested task.
[0033] The device weight of the contested task describes the resource consumption of each executing device in performing the contested task. Specifically, the device weights corresponding to the devices conflicting with the task are selected and compared. The smaller the device weight, the less resource the conflicting device consumes in performing the contested task, and the more suitable it is for performing the contested task. Therefore, selecting the device with the smallest device weight in the comparison results as the device to perform the contested task resolves the conflict problem of multiple devices simultaneously vying for the same handling task while saving operating resources as much as possible.
[0034] The second embodiment of this application further specifies the task scheduling method in the first embodiment in a more detailed and specific way. Some or all of the technical features in the second embodiment can be combined with or replaced by the first embodiment, either individually or in combination, to obtain more feasible task scheduling methods.
[0035] The task scheduling method in the second embodiment of this application is described in detail below:
[0036] Optionally, the task scheduling method further includes: when the comparison result shows that the device weights are the same, the following steps S1, S2, S3 and S4 are executed cyclically: Step S1: For each conflicting device, perform the following operations: obtain the Xth task to be executed in the task queue of the conflicting device; obtain the device weight corresponding to the conflicting device from the device weight of the Xth task to be executed and add it to the weight comparison set, where X is a natural number and its initial value is 2; Step S2: Compare the device weights in the weight comparison set to obtain the cyclic comparison result; Step S3: When the cyclic comparison result obtained in this cycle shows that the device weights are different, select the conflicting device corresponding to the largest device weight in the cyclic comparison result as the device to execute the contested task and stop the cycle, or, when the cyclic comparison result obtained in this cycle shows that all device weights are the same, execute step S4; Step S4: Clear the weight comparison set and increment the value of X by 1.
[0037] This embodiment further supplements the task scheduling method described in the first embodiment, proposing a solution for the case where the comparison result shows that the device weights are the same. Specifically, when the device weights corresponding to the conflicting devices in the device weights of the contested tasks are all the same, the device weights of the 2nd, 3rd, 4th... tasks to be executed in the task queues of each conflicting device are compared cyclically until different comparison results appear in the loop.
[0038] For example, as shown in Table 1:
[0039] Table 1. Execution Equipment - Tasks to be Executed - Equipment Weight Table
[0040] There are three execution devices: D1 has task queues ABCDE, D2 has task queue ADCEB, and D3 has task queue ABEDC. Currently, D1, D2, and D3 are simultaneously vying for task A. First, comparing the device weights of the contested task A, we find that the device weights of D1, D2, and D3 are all 2. Therefore, we stop analyzing task A and instead focus on the second-ranked task in each of the task queues. We find that the second-ranked task in D1's task queue is B, with a device weight of 4; in D2's task queue, it is D, with a device weight of 3; and in D3's task queue, it is B, with a device weight of 5.
[0041] Therefore, different comparison results were obtained in the first loop. It should be noted that when comparing the device weights of the contested task A, in order to "minimize the resource consumption of executing task A," the device with the smallest device weight was selected as the executing device for task A. However, when comparing the tasks to be executed in the next column of the task queue, the objective changed to "since the resource consumption of executing task A is equal for all conflicting task devices, find the device with the largest resource consumption for executing the next pending task, and let that device execute task A." Therefore, the task conflicting device corresponding to the largest (not the smallest) device weight in the loop comparison results was selected as the device to execute the contested task. Continuing with the example above, the second pending task in D3's task queue is B, with a device weight of 5, the largest device weight. This means that D3 consumes the most resources to execute the next pending task B, and D3 is responsible for executing the contested task A. Meanwhile, D1, one of the other conflicting task devices, failed to win the right to execute the contested task A and instead executed the second pending task B in D1's task queue, completing task B with a task weight of 4. Therefore, task B, which originally required a task weight of 5 for D3 to complete, was completed by D1 with less resource consumption. Thus, the task scheduling method described in this embodiment reduces the overall resource consumption of task execution by continuously pursuing local optima.
[0042] Optionally, the maximum number of iterations of steps S1, S2, S3, and S4 is equal to the number of execution devices minus 1, where the execution devices are devices used to execute the task to be executed; the task scheduling method further includes: when the number of iterations of steps S1, S2, S3, and S4 is equal to the maximum number of iterations and the device to execute the contested task is still not determined, randomly selecting a device from the conflicting task devices as the device to execute the contested task.
[0043] When the total number of comparisons exceeds the number of devices, further comparisons become less meaningful. For example, with three execution devices, a maximum of three tasks can be executed simultaneously. Admittedly, when conflicts arise, comparisons can be made indefinitely—for example, 1000 tasks could be compared 1000 times. However, as tasks are executed, goods are constantly moved, and the warehouse environment changes. The accuracy of the device weights becomes questionable; after 1000 tasks have been executed, the device weights may have been updated multiple times, making excessive comparisons largely meaningless.
[0044] Therefore, this embodiment proposes that, since the first comparison has already been performed in the first embodiment, the maximum number of iterations for steps S1, S2, S3, and S4 is limited to the number of execution devices minus 1, so that the total number of comparisons equals the number of execution devices. When all comparison results are the same, a device is randomly selected from the conflicting devices to execute the contested task.
[0045] Once a task is completed, the environment can be considered to have changed to some extent. Therefore, the task scheduling method described in this embodiment limits the maximum number of loops to the number of execution devices minus 1, thus restricting the comparison to the "current" working environment. This means that each conflicting task device has not yet completed its currently executing task, and there is no situation where the completion of a task changes the environment. This reduces a large number of meaningless comparisons and saves task execution resources.
[0046] Optionally, the task scheduling method further includes: obtaining tasks to be executed, device weights of the tasks to be executed, at least one execution device, and a task queue of at least one execution device. The task queue is used to provide the execution order for at least one execution device to execute the tasks to be executed, and the queue length of the task queue is equal to the number of execution devices. According to the rule of selecting the task to be executed corresponding to the smallest device weight in ascending order, a queue length of tasks to be executed is selected from the tasks to be executed for each execution device and filled into the task queue of that execution device.
[0047] This embodiment proposes a method for obtaining the task queue of the task to be executed and the execution device, and limits the length of the task queue.
[0048] Specifically, by prioritizing the task to be executed corresponding to the device with the smallest weight in ascending order, a queue length of tasks to be executed is selected from the tasks to be executed for each execution device and filled into the task queue of that execution device. For example, when there are three execution devices, the task queue of each execution device can hold three tasks to be executed.
[0049] Similar to the reason for limiting the number of loops mentioned above, due to task conflicts and other factors, the tasks to be executed are constantly changing and being updated. Maintaining an excessively long task queue for the execution devices is not very meaningful, as the tasks at the end of the queue will consume a lot of resources unnecessarily during the continuous updating process. Therefore, it is sufficient to control the length of the task queue to be equal to the number of execution devices to meet the requirements of loop comparison.
[0050] For example, continuing with Table 1 above, there are three execution devices in Table 1. The task queue of execution device D1 should be adjusted to ABC, the task queue of execution device D2 should be adjusted to ADC, and the task queue of execution device D3 should be adjusted to ABE.
[0051] Optionally, the task scheduling method further includes: obtaining a total set of tasks and the task priorities of the tasks in the total set of tasks; grouping the tasks in the total set of tasks to obtain at least one task group, wherein all tasks with equal priority in the total set of tasks are located in the same task group; and selecting all tasks in the task group with the highest priority as tasks to be executed.
[0052] Considering that device weights only reflect the resource consumption of the device in executing the task to be executed, and do not reflect the urgency of the task itself, this embodiment solves this problem by introducing task priorities.
[0053] The obtained task set contains a large number of tasks, each with a priority level reflecting its urgency. Higher priority indicates a more urgent task. Tasks with the same priority are grouped together. For example, if the task set contains 100 tasks, with 20 tasks having a priority of 40, 50 tasks having a priority of 50, 25 tasks having a priority of 60, and 5 tasks having a priority of 70, the grouping results are shown in Table 2.
[0054] Table 2 Task Set Grouping Results
[0055] Prioritize tasks with higher priority as the tasks to be executed. For example, in Table 2, the group with a priority of 70 is selected as the task to be executed. Once tasks with equal priority are obtained, the task scheduling method described above is used to reorder the tasks according to device weights and add them to the task queue.
[0056] Optionally, the task scheduling method further includes: when no task in the task set is executed within a preset time, increasing the task priority and / or device weight of the task in the task set.
[0057] For tasks that have not been executed for an extended period, even those with low priority may encounter problems due to prolonged inactivity. Therefore, this embodiment proposes increasing the task priority and / or device weight of tasks in the overall task set when they are not executed.
[0058] For example, preset timeframes can be set for 10 minutes, 30 minutes, and 60 minutes. The specific rules are as follows: if a task fails to execute within 10 minutes, its priority increases by 1; if it fails to execute within 30 minutes, its priority is increased by one group; and if it fails to execute within 1 hour, its priority is increased to the highest level.
[0059] Taking a task scheduling environment without a priority promotion mechanism as an example, the specific information is shown in Table 3:
[0060] Table 3 Task Information Table
[0061] As shown in Table 3, if task F is not executed 10 minutes after it is issued, and there is a priority upgrade mechanism, the task should be upgraded to 61. If task AZ is not executed after one hour, it should be upgraded to the highest priority. The priority of task AZ can be increased to 100 or upgraded to 70, and the device weight can be upgraded to 1.
[0062] Optionally, the method for obtaining the device weight of the task to be executed includes: obtaining and quantifying the reasons affecting the resource consumption of the executing device in executing the task to be executed, obtaining numerical influence factors, the reasons affecting the resource consumption of the executing device in executing the task to be executed include the device type of the executing device, the content of the task to be executed, and the distance between the location of the executing device and the execution location of the task to be executed; and performing a weighted calculation based on the influence factors to obtain the device weight of the task to be executed.
[0063] This embodiment proposes a method for obtaining equipment weights. Specifically, the equipment type of the executing equipment, the content of the task to be executed, and the distance between the location of the executing equipment and the execution location of the task to be executed are used as factors affecting the resource consumption of the executing equipment in executing the task. Since these factors include some non-numerical elements, they need to be quantified according to certain rules. For example, when the equipment type of the executing equipment is a small handling equipment, considering that the small handling equipment may need to repeatedly handle a large number of goods, consuming more resources, the small handling equipment is assigned a value of 3, the medium handling equipment is assigned a value of 2, and the large handling equipment is assigned a value of 1.
[0064] After these reasons are converted into numerical impact factors, the impact factors are used for weighted calculations to obtain the equipment weights for the tasks to be executed.
[0065] The third embodiment of this application also proposes a task scheduling device, as shown in FIG3. The task scheduling device includes a first acquisition module 301, a second acquisition module 302, and a determination module 303.
[0066] The first acquisition module 301 is used to acquire the contested task and at least two task conflicting devices. The task conflicting devices have task queues, which are used to provide the execution order of the tasks to be executed by the task conflicting devices. The contested task is the task to be executed at the head of the task queue of the at least two task conflicting devices.
[0067] The second acquisition module 302 is used to acquire the device weight of the contested task, wherein the device weight is used to describe the resource consumption of a device executing a task to be executed.
[0068] The determining module 303 is used to select the device weights corresponding to the at least two conflicting devices from the device weights of the contested task, compare them to obtain a comparison result, and select the conflicting device corresponding to the smallest device weight in the comparison result as the device to execute the contested task.
[0069] The task scheduling device provided in this embodiment belongs to the same concept as the task scheduling method provided in the above embodiments of this application. It can execute the method provided in any embodiment of this application and has the corresponding functional modules and beneficial effects. Technical details not described in detail in this embodiment can be found in the specific processing content of the task scheduling method provided in the above embodiments of this application, and will not be repeated here.
[0070] The functions implemented by the first acquisition module 301, the second acquisition module 302, and the determination module 303 can be implemented by the same or different processors calling software, and this application embodiment does not limit this.
[0071] The fourth embodiment of this application also proposes an electronic device, as shown in FIG4, which includes:
[0072] Memory 400 and processor 410;
[0073] The memory 400 is connected to the processor 410 and is used to store programs;
[0074] The processor 410 is configured to implement the task scheduling method disclosed in any of the above embodiments by running the program stored in the memory 400.
[0075] Specifically, the aforementioned electronic device may also include: a bus, a communication interface 420, an input device 430, and an output device 440.
[0076] The processor 410, memory 400, communication interface 420, input device 430 and output device 440 are interconnected via a bus.
[0077] A bus can include a pathway for transmitting information between various components of a computer system.
[0078] The processor 410 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0079] Processor 410 may include a main processor, as well as a baseband chip, modem, etc.
[0080] The memory 400 stores a program for executing the technical solution of this application, and may also store an operating system and other critical business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 400 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0081] Input device 430 may include a device for receiving user input data and information, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0082] Output device 440 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0083] The communication interface 420 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0084] The processor 410 executes the program stored in the memory 400 and calls other devices, which can be used to implement the various steps of any of the task scheduling methods provided in the above embodiments of this application.
[0085] The fourth embodiment of this application also provides a storage medium on which a computer program is stored, the computer program being executed by a processor of the steps in the task scheduling method described in any of the above embodiments.
[0086] The fifth embodiment of this application provides a computer program product, which includes computer program instructions that, when executed by a processor, cause the processor to perform the steps in the task scheduling method described in any of the above embodiments.
[0087] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0088] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0089] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0090] The steps in the methods of the various embodiments of this application can be adjusted, merged, or deleted in order according to actual needs, and the technical features described in each embodiment can be replaced or combined.
[0091] The modules and sub-modules in the various embodiments of the present application's devices and terminals can be merged, divided, and deleted according to actual needs.
[0092] It should be understood that the disclosed terminals, devices, and methods can be implemented in other ways, given the several embodiments provided in this application. For example, the terminal embodiments described above are merely illustrative. For instance, the division of modules or sub-modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0093] The modules or submodules described as separate components may or may not be physically separate. The components that constitute a module or submodule may or may not be physical modules or submodules; that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules can be selected to achieve the purpose of this embodiment's solution, depending on actual needs.
[0094] Furthermore, the functional modules or sub-modules in the various embodiments of this application can be integrated into one processing module, or each module or sub-module can exist physically separately, or two or more modules or sub-modules can be integrated into one module. The integrated modules or sub-modules described above can be implemented in hardware or in the form of software functional modules or sub-modules.
[0095] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0096] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software unit executed by a processor, or a combination of both. The software unit can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0097] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A task scheduling method, characterized in that, include: Acquire a contested task and at least two task-conflicting devices, each task-conflicting device having a task queue, the task queue being used to provide the execution order of the tasks to be executed by the task-conflicting devices, wherein the contested task is the task to be executed at the head of the task queue of the at least two task-conflicting devices; Obtain the device weight of the contested task, whereby the device weight describes the resource consumption of a device executing a task to be executed; The device weights corresponding to the at least two conflicting devices in the contested task are selected from the device weights of the contested task and compared to obtain the comparison results. The conflicting device corresponding to the smallest device weight in the comparison results is selected as the device to execute the contested task.
2. The task scheduling method according to claim 1, characterized in that, The method further includes: When the comparison result shows that the device weights are the same, the following steps S1, S2, S3 and S4 are executed cyclically: Step S1: For each conflicting device, perform the following operations: obtain the Xth task to be executed in the task queue of the conflicting device; obtain the device weight corresponding to the conflicting device from the device weight of the Xth task to be executed and add it to the weight comparison set, where X is a natural number and its initial value is 2; Step S2: Compare the device weights in the weight comparison set to obtain the cyclic comparison result; Step S3: When the comparison result obtained in this loop is that the device weights are different, select the device with the largest device weight in the comparison result as the device to execute the contested task and stop the loop; or, when the comparison result obtained in this loop is that the device weights are all the same, execute step S4. Step S4: Clear the weight comparison set and increment the value of X by 1.
3. The task scheduling method according to claim 2, characterized in that, The maximum number of iterations for executing steps S1, S2, S3, and S4 is equal to the number of execution devices minus 1, where each execution device is a device used to execute the task to be executed. The method further includes: When the number of times steps S1, S2, S3, and S4 are executed is equal to the maximum number of iterations and the device to execute the contested task is still not determined, a device is randomly selected from the conflicting devices to execute the contested task.
4. The task scheduling method according to claim 3, characterized in that, The method further includes: The system obtains the task to be executed, the device weight of the task to be executed, at least one execution device, and the task queue of the at least one execution device. The task queue is used to provide the execution order of the at least one execution device for executing the task to be executed, and the queue length of the task queue is equal to the number of execution devices. Following the rule of prioritizing the task to be executed corresponding to the device with the smallest weight, from smallest to largest, select the queue length of tasks to be executed for each execution device and fill them into the task queue of the execution device.
5. The task scheduling method according to claim 4, characterized in that, The method further includes: Obtain the overall task set and the task priorities of the tasks in the overall task set; The tasks in the overall task set are grouped to obtain at least one task group, and all tasks with equal priority in the overall task set are located in the same task group; All tasks in the task group with the highest task priority are designated as the tasks to be executed.
6. The task scheduling method according to claim 5, characterized in that, The method further includes: If no task in the overall task set is executed within a preset time period, the task priority and / or device weight of the task in the overall task set shall be increased.
7. The task scheduling method according to any one of claims 4 to 6, characterized in that, The method for obtaining the device weight of the task to be executed includes: The reasons affecting the resource consumption of the execution device in executing the task to be executed are obtained and quantified to obtain numerical influencing factors. The reasons affecting the resource consumption of the execution device in executing the task to be executed include the device type of the execution device, the content of the task to be executed, and the distance between the location of the execution device and the execution location of the task to be executed. The device weights of the task to be executed are obtained by performing a weighted calculation based on the influencing factors.
8. A task scheduling device, characterized in that, include: The first acquisition module is used to acquire the contested task and at least two task conflicting devices. The task conflicting devices have task queues, which are used to provide the execution order of the tasks to be executed by the task conflicting devices. The contested task is the task to be executed at the head of the task queue of the at least two task conflicting devices. The second acquisition module is used to acquire the device weight of the contested task, wherein the device weight is used to describe the resource consumption of a device executing a task to be executed; The determination module is used to select the device weights corresponding to the at least two conflicting devices from the device weights of the contested task, compare them to obtain a comparison result, and select the conflicting device corresponding to the smallest device weight in the comparison result as the device to execute the contested task.
9. An electronic device, characterized in that, Including memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the task scheduling method as described in any one of claims 1 to 7 by running a program in the memory.
10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the task scheduling method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, It includes computer program instructions that, when executed by a processor, cause the processor to perform the task scheduling method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Task arrangement method and device and computer readable storage medium
CN114330887A
Robot task scheduling method, computer equipment and storage medium
CN114611896A
Multi-AGV collaborative carrying system task scheduling method based on priority
CN115146884A
Container carrying task allocation method and device
CN115345450A
Material carrying scheduling method, device and equipment and readable storage medium
CN115375249A