A task allocation method, device and equipment

By judging the processing capability of nodes based on the number of task queues to be processed and processing time in a distributed system, the problem of efficiency reduction caused by the node's processing tasks exceeding their capabilities is solved, and more efficient task allocation and processing is achieved.

CN112114971BActive Publication Date: 2025-03-18CHINA CONSTRUCTION BANK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011044681.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2025-03-18
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

In a distributed system, due to the differences in resources and processing capabilities occupied by each node to process tasks, some nodes cannot process tasks in a timely manner when there are a large number of tasks, which reduces the task processing efficiency.

Method used

When receiving the task processing request sent by the central node device, the number and information of the pending task queue are obtained, and whether it is equal to the queue limit length, and whether the task processing time is less than the task processing time. If the conditions are met, the task acceptance information is feedback to the central node to obtain the task allocation.

Benefits of technology

This method can determine whether to assign tasks based on the actual processing conditions of each node, make full use of the processing capabilities of the nodes, and improve task processing efficiency and equipment utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112114971B_ABST
    Figure CN112114971B_ABST
Patent Text Reader

Abstract

This specification provides a task allocation method, apparatus, and device. The method includes: upon receiving a task processing request from a central node device, obtaining the number of tasks to be processed and task information corresponding to a task queue; determining whether the number of tasks to be processed is equal to the queue's limited length; the queue's limited length is used to determine the upper limit of the number of tasks to be processed; if not equal, determining whether the task processing time corresponding to the task information is less than the task processing time limit; if the task processing time is less than the task processing time limit, sending task acceptance information back to the central node device to obtain the task allocated by the central node device. This method determines whether to allocate tasks to distributed node devices based on their actual task processing status, fully utilizing the processing capabilities of each distributed node device, improving device utilization, and accelerating task processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of computer technology, and more particularly to a task allocation method, device and equipment. Background Art

[0002] Distributed technology is based on communication networks. After a large computing task is divided into multiple subtasks, they are assigned to various processing nodes in the distributed system for execution. Since each subtask is executed simultaneously on each processing node, the processing efficiency of the task is greatly improved. Based on the above characteristics, distributed technology has been rapidly developed and widely used in recent years.

[0003] In practical applications, in order to ensure that each processing node can be fully utilized, the central node in the distributed system generally assigns tasks to each processing node in turn. Each processing node generally receives tasks in the form of a queue and then processes the tasks in the queue in sequence in a serial processing manner. However, due to the differences in the resources occupied by each node to process tasks and the processing capabilities of the nodes themselves, when the number of assigned tasks is large, some processing nodes may receive more tasks than their processing capabilities, and thus fail to process tasks in a timely manner, thereby reducing the processing efficiency of tasks. Therefore, there is an urgent need for a technical solution based on a distributed system with high task processing efficiency. Summary of the invention

[0004] The purpose of the embodiments of this specification is to provide a task allocation method, apparatus and device to solve the problem of how to improve task processing efficiency based on distributed node devices.

[0005] In order to solve the above technical problems, the present specification provides a task allocation method, including:

[0006] When receiving a task processing request sent by the central node device, obtaining the number of pending tasks and pending task information corresponding to the pending task queue;

[0007] Determine whether the number of tasks to be processed is equal to the queue limit length; the queue limit length is used to determine the upper limit of the number of tasks to be processed;

[0008] If not, determining whether the task processing time corresponding to the to-be-processed task information is less than the task processing time limit;

[0009] In the case that the task processing time is less than the task processing time limit, task acceptance information is fed back to the central node device to obtain the task assigned by the central node device.

[0010] The embodiment of this specification also provides a task allocation device, including:

[0011] The task information acquisition module is used to obtain the number of pending tasks and pending task information corresponding to the pending task queue when receiving a task processing request sent by the central node device;

[0012] A task quantity determination module is used to determine whether the number of tasks to be processed is equal to the queue limit length; the queue limit length is used to determine the upper limit of the number of tasks to be processed;

[0013] A task processing time determination module, used to determine whether the task processing time corresponding to the task information to be processed is greater than the task processing time limit when the number of tasks to be processed is not equal to the queue limit length;

[0014] The task acceptance information feedback module is used to feed back task acceptance information to the central node device to obtain the task assigned by the central node device when the task processing time is not greater than the task processing time limit.

[0015] The embodiments of this specification also propose a distributed node device, including a memory and a processor; the memory is used to store computer program instructions; the processor is used to execute the computer program instructions to implement the following steps: upon receiving a task processing request sent by a central node device, obtaining the number of pending tasks and pending task information corresponding to the pending task queue; judging whether the number of pending tasks is equal to the queue limit length; the queue limit length is used to determine the upper limit of the number of pending tasks; if not equal, determining whether the task processing time corresponding to the pending task information is greater than the task processing time limit; if not greater than, feeding back task acceptance information to the central node device to obtain the task assigned by the central node device.

[0016] In order to solve the above technical problems, the embodiment of this specification also proposes a task allocation method, including:

[0017] Select distributed node devices based on the task allocation order;

[0018] Sending a task processing request to the distributed node device, so that the distributed node device obtains the number of pending tasks and pending task information corresponding to the pending task queue, determines whether the number of pending tasks is equal to the queue limit length, and when the number of pending tasks is not equal to the queue limit length, determines whether the task processing time corresponding to the pending task information is greater than the task processing time limit; the queue limit length is used to determine the upper limit of the number of pending tasks;

[0019] When the task processing time corresponding to the to-be-processed task information of the distributed node device is not greater than the task processing time limit, receiving task acceptance information fed back by the distributed node device;

[0020] Allocate tasks to the distributed node devices.

[0021] The embodiment of this specification also provides a task allocation device, including:

[0022] A distributed node device selection module is used to select distributed node devices based on the task allocation order;

[0023] A task processing request sending module, used to send a task processing request to the distributed node device, so that the distributed node device obtains the number of pending tasks and pending task information corresponding to the pending task queue, determines whether the number of pending tasks is equal to the queue limit length, and when the number of pending tasks is not equal to the queue limit length, determines whether the task processing time corresponding to the pending task information is greater than the task processing time limit; the queue limit length is used to determine the upper limit of the number of pending tasks;

[0024] A task acceptance information receiving module, used to receive the task acceptance information fed back by the distributed node device when the task processing time corresponding to the task information to be processed of the distributed node device is not greater than the task processing time limit;

[0025] The task allocation module is used to allocate tasks to the distributed node devices.

[0026] The embodiment of this specification also proposes a task allocation device, including a memory and a processor; the memory is used to store computer program instructions; the processor is used to execute the computer program instructions to implement the following steps: selecting a distributed node device based on the task allocation order; sending a task processing request to the distributed node device, so that the distributed node device obtains the number of pending tasks and pending task information corresponding to the pending task queue, determines whether the number of pending tasks is equal to the queue limit length, and when the number of pending tasks is not equal to the queue limit length, determines whether the task processing time corresponding to the pending task information is greater than the task processing time limit; the queue limit length is used to determine the upper limit of the number of pending tasks; when the task processing time corresponding to the pending task information of the distributed node device is not greater than the task processing time limit, receives the task acceptance information fed back by the distributed node device; and allocates tasks to the distributed node device.

[0027] It can be seen from the technical solutions provided by the above embodiments of this specification that when allocating tasks to distributed node devices, if the number of pending tasks of the distributed node devices is equal to the queue limit length of the pending task queue, the pending task information of the distributed node devices can still be used to determine whether the distributed node devices can continue to process tasks, and if they can continue to process tasks, the corresponding tasks can be allocated to the distributed node devices. Therefore, the above method determines whether to allocate tasks to distributed node devices based on the actual processing situation of tasks by each distributed node device, fully utilizes the processing capacity of each distributed node device, improves the utilization rate of the equipment, and speeds up the processing progress of tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1 This is a structural diagram of a task allocation system according to an embodiment of this specification;

[0030] Figure 2 This is a flowchart of a task allocation method according to an embodiment of this specification;

[0031] Figure 3 This is a flowchart of a task allocation method according to an embodiment of this specification;

[0032] Figure 4 This is a flowchart of a task allocation method according to an embodiment of this specification;

[0033] Figure 5 This is a flowchart of a task allocation method according to an embodiment of this specification;

[0034] Figure 6 This is a module diagram of a task allocation device according to an embodiment of this specification;

[0035] Figure 7 This is a module diagram of a task allocation device according to an embodiment of this specification;

[0036] Figure 8 This is a structural diagram of a distributed node device according to an embodiment of this specification;

[0037] Fig. 9 This is a structural diagram of a central node device according to an embodiment of this specification. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0039] In order to better understand the inventive concept of this application, a task allocation system according to an embodiment of this specification is first introduced. Figure 1 As shown, the task allocation system 100 includes a central node device 110 and multiple distributed node devices.

[0040] The central node device 110 can communicate with each distributed node device and allocate tasks to be processed to the distributed node devices.

[0041] The tasks assigned by the central node device 110 to each distributed node device may be tasks generated by the central node device 110, or tasks sent by other servers or user terminals received by the central node device 110. Accordingly, the central node device 110 may also establish a communication protocol with multiple external devices. In the case where the central node device 110 and each distributed node device together constitute a distributed system, each device in the distributed system may also have the ability to communicate with external devices and obtain tasks, and then uniformly allocate the received tasks through the central node device 110. In actual applications, the method for obtaining tasks to be processed is not limited to the above examples and will not be repeated here.

[0042] The central node device 110 can be connected to multiple distributed node devices. Figure 1 The example in FIG. 1 includes five distributed node devices, namely, distributed node device 121, distributed node device 122, distributed node device 123, distributed node device 124, and distributed node device 125. In practical applications, there is no limit on the number of the distributed node devices, and the number may be any number greater than or equal to two.

[0043] The distributed node device has the ability to process tasks. The tasks processed may be, for example, completing certain computing tasks, or obtaining processing results corresponding to the tasks to be processed based on internally set program logic. The specific way of processing tasks can be adjusted according to actual applications, and is not limited to the above examples, and will not be repeated here.

[0044] The distributed node device may process tasks in a single process, that is, process one task before processing the next task. The distributed node device may also process tasks in a concurrent manner, that is, process multiple tasks simultaneously within a period of time. In practical applications, there is no restriction on the manner in which the distributed node device processes tasks, and is not limited to the above examples, and will not be described in detail here.

[0045] Since the speed at which the distributed node device processes tasks may be lower than the speed at which tasks are assigned, the distributed node device may be provided with a corresponding queue of pending tasks. The queue of pending tasks may be used to store identifiers corresponding to pending tasks. The queue of pending tasks has the attribute of a queue, namely "first in, first out". The task identifier first stored in the queue of pending tasks is taken out first. When the corresponding task identifier is taken out, the distributed node device starts to process the pending task corresponding to the task identifier. Accordingly, after the pending task is assigned to the distributed node device, the distributed node device stores the identifier corresponding to the pending task at the end of the queue of pending tasks. The distributed node device processes the pending tasks in the queue of pending tasks in sequence.

[0046] Based on the above task allocation system, a task allocation method according to an embodiment of this specification is introduced. The execution subject of the task allocation method is the task allocation system. Figure 2 As shown, the task allocation method may include the following specific implementation steps.

[0047] S210: The central node device selects a distributed node device based on the task allocation order.

[0048] The task allocation sequence may be the sequence in which the central node device allocates tasks in sequence. The task allocation sequence may be a cycle, that is, after allocating tasks according to the task allocation sequence, tasks may be allocated again according to the task allocation sequence.

[0049] Accordingly, when tasks are allocated according to the task allocation sequence, the same number of tasks may be allocated to each distributed node device in each allocation process to ensure uniform distribution of tasks.

[0050] The task allocation sequence may be a fixed task allocation sequence pre-set by the central node device. Figure 1 In the task allocation system, the task allocation order may be distributed node device 124, distributed node device 122, distributed node device 121, distributed node device 123, and distributed node device 125. In actual applications, the task allocation order may be set according to specific circumstances, which will not be described in detail here.

[0051] The central node device may select a distributed node device based on the task allocation sequence by combining the distributed node device selected last time with the next-ranked distributed node device in the current task allocation sequence as the distributed node device selected this time.

[0052] S220: The central node device sends a task processing request to the distributed node devices.

[0053] After the central node device determines the distributed node device, if there is currently an unassigned task, a task processing request may be sent to the distributed node device.

[0054] The task processing request is used to request the distributed node device to process the unassigned task. Since it is uncertain whether the distributed node device has the ability to process the task, the task processing request can be sent to the distributed node device first, so that the distributed node can determine that it can process the task before allocating the task to the device.

[0055] The task processing request is a request for the distributed node device to process a task. After receiving the request, the distributed node device can determine whether it can continue to accept the task to be processed, thereby determining whether the central node device still needs to assign tasks to the distributed node device.

[0056] S230: The distributed node device obtains the number of pending tasks and pending task information corresponding to the pending task queue.

[0057] After obtaining the task processing request, the distributed node device may first obtain the number of pending tasks and pending task information in the corresponding pending task queue.

[0058] The number of pending tasks may be the number of pending task identifiers currently existing in the pending task queue, that is, the number of tasks allocated to the distributed node device but not yet processed by the distributed node device.

[0059] The pending task information may be information corresponding to the pending tasks, for example, the number of tasks processed by the distributed node device per unit time determined based on historical processing results, that is, the ability of the distributed node device to process tasks. The pending task information may also include the processing time limit of the pending tasks in the pending task queue, that is, the latest time when the corresponding pending tasks need to be processed. The task processing time limit can be used to determine whether the distributed node device can continue to receive and process tasks, thereby determining whether it can still receive tasks assigned by the central node device.

[0060] In actual applications, the pending task information may also include other information that can be used to determine the processing capability of the distributed node device or determine whether the distributed node device can still be used to receive tasks. The information is not limited to the above examples and will not be elaborated here.

[0061] S240: The distributed node device determines whether the number of tasks to be processed is equal to the queue limit length.

[0062] After obtaining the number of tasks to be processed, the distributed node device may first determine whether the number of tasks to be processed is equal to the queue limit length.

[0063] The queue limit length is the upper limit of the number of pending tasks corresponding to the distributed processing device. Generally, when the number of pending tasks in the pending task queue is equal to the queue limit length, no new pending task identifiers can be added to the pending task queue, that is, no new pending tasks are allocated to the distributed node device.

[0064] By directly comparing the number of tasks to be processed with the limited length of the queue, it is possible to conveniently and quickly determine whether the distributed node device still has the ability to process the tasks to be processed.

[0065] It should be noted that, in some implementations, the queue limit lengths of different distributed node devices can often be set to the same length initially according to requirements. The queue limit length in the initial state is often determined by the requirements for processing tasks in actual applications. Accordingly, the queue limit length can be adjusted accordingly in the subsequent application process according to the processing capabilities of different distributed node devices to adapt to the actual processing capabilities of different distributed node devices.

[0066] S250: If they are equal, the distributed node device determines whether the task processing time corresponding to the task information to be processed is less than the task processing time limit.

[0067] If the number of pending tasks is equal to the queue limit length, new tasks cannot be added to the pending task queue. However, in actual applications, the queue limit length may not accurately describe the processing capacity of the distributed node device. If only the queue limit length is used to determine whether to continue to assign tasks to the distributed node device, there may be a certain gap with the actual processing capacity. Therefore, even if it is determined that the number of pending tasks is equal to the queue limit length, it is still possible to determine whether the task processing time corresponding to the pending task information is less than the task processing time limit.

[0068] It should be noted that, since it is necessary to compare the number of pending tasks and the number of queue limit length when adding new pending tasks to the pending task queue, when the number of pending tasks is equal to the queue limit length, no new pending tasks will be added to the pending task queue, that is, the number of pending tasks in the pending task queue will not be greater than the queue limit length. Therefore, when the number of pending tasks is not equal to the queue limit length, the number of pending tasks is less than the queue limit length.

[0069] The task processing time limit may be the processing time of the pending tasks in the pending task queue corresponding to the distributed node. The task processing time may be the time required for the distributed node device to complete processing the pending tasks in the pending task queue.

[0070] In some embodiments, the task processing time may be determined by determining the task processing capability of the distributed node device based on the task processing information, and then determining the task processing time based on the task processing capability and the number of tasks to be processed. The task processing capability may be the maximum number of tasks that the distributed node device can process per unit time. The task processing capability may be determined based on the historical processing records of the distributed node device, thereby determining the time consumed by the distributed node device to process all tasks in the queue of tasks to be processed.

[0071] In some implementations, the task processing time may also be determined based on the minimum time for the distributed node device to process tasks. For example, the minimum time consumed by the distributed node device to process each task is obtained from the historical processing record of the distributed node device, and the time is used as the time benchmark for the distributed node device to process tasks, and then the task processing time is determined based on the time and the number of tasks to be processed.

[0072] In actual applications, the method for determining the task processing time can be set according to actual conditions and is not limited to the above examples, which will not be repeated here.

[0073] In some embodiments, if the number of pending tasks is equal to the queue limit length, it can be directly determined that new pending tasks cannot be assigned to the distributed node device at present, and task rejection information can be directly fed back to the central node device to enable the central node device to cancel the task allocation.

[0074] After receiving the task rejection information, the central node device will no longer assign new tasks to be processed to the distributed node devices. Accordingly, when the distributed node devices cannot receive new tasks to be processed, the central node can obtain the next distributed node device based on the task allocation sequence and send a task processing request to the distributed node device, thereby completing the assignment of tasks in sequence through the task allocation system.

[0075] S260: If it is less than, the distributed node device feeds back the task acceptance information to the central node device.

[0076] If the task processing time is less than the task processing time limit, it means that the distributed node device is fully capable of completing the tasks in the current pending task queue within the predetermined time limit, that is, the distributed node device is fully capable of receiving new tasks. Therefore, the task acceptance information can be fed back to the central node device.

[0077] The task acceptance information is used to indicate that the distributed node device can still accept corresponding tasks. After receiving the task acceptance information, the central node device can assign the task to be assigned to the distributed node device.

[0078] In some implementations, since the number of tasks to be processed defined by the queue limit length does not match the actual task processing time, that is, the queue limit length cannot accurately represent the processing capacity of the distributed node device, the queue limit length may be increased. Specifically, the queue limit length may be increased by one. In actual applications, the queue limit length may also be increased by other amounts according to application requirements, and there is no limitation on this.

[0079] S270: The central node device assigns tasks to the distributed node devices.

[0080] After receiving the task acceptance information, the central node device can assign the corresponding task to the distributed node device. The specific task content can be set based on the needs of the actual application. For example, the business to be processed can be sent directly to the distributed node device so that the distributed node device processes the business and obtains the processing result and then feeds the processing result back to the central node device or the user terminal device. The specific process of assigning tasks and processing tasks can be set according to the actual application situation, and is not limited to the above examples, so it will not be repeated here.

[0081] In actual applications, in addition to the situation in the above embodiment where the number of pending tasks is not equal to the queue limit length and the task processing time is less than the task processing time limit, there may also be situations where the number of pending tasks is equal to the queue limit length or the task processing time is not less than the task processing time limit. Therefore, in order to provide a more comprehensive and specific description of the above situation, another task allocation method of the embodiment of this specification is introduced below, and the execution subject of the method is the distributed node device. Figure 3 As shown, the task allocation method may include the following specific implementation steps.

[0082] S310: When receiving a task processing request sent by the central node device, obtain the number of pending tasks and pending task information corresponding to the pending task queue.

[0083] For the description of this step, please refer to the introduction in steps S210, S220, and S230, which will not be repeated here.

[0084] S320: Determine whether the number of tasks to be processed is equal to the queue limit length.

[0085] For the specific description of this step, please refer to the specific introduction in step S240, which will not be repeated here.

[0086] After executing the above judgment process, if the judgment result is that the number of tasks to be processed is equal to the queue limit length, step S330 can be executed; if the number of tasks to be processed is not equal to the queue limit length, step S360 can be executed.

[0087] S330: Determine whether the task processing time corresponding to the task information to be processed is less than the task processing time limit.

[0088] For the specific description of this step, please refer to the introduction of step S250, which will not be repeated here.

[0089] After executing the above judgment process, if the judgment result is that the task processing time is less than the task processing time limit, step S340 can be executed; if the judgment result is that the task processing time is not less than the task processing time limit, step S350 can be executed.

[0090] S340: Feedback task acceptance information to the central node device to obtain the task assigned by the central node device.

[0091] For the description of this step, please refer to the introduction in step S260, which will not be repeated here.

[0092] S350: Feedback task rejection information to the central node device so that the central node device cancels the allocation of the task.

[0093] For the description of this step, please refer to the introduction in step S250, which will not be repeated here.

[0094] S360: Determine whether the task processing time corresponding to the task information to be processed is less than the task processing time limit.

[0095] If after the above judgment process, it is shown that the number of pending tasks is not equal to the queue limit length, then the ability to add new pending tasks to the pending task queue is still available. In this case, since the number of pending tasks is less than the queue limit length, it indicates that the distributed node device still has the ability to process tasks. In some embodiments, task acceptance information can be directly fed back to enable the central node device to assign corresponding tasks to the distributed node devices.

[0096] However, correspondingly, the queue limit length may not be able to accurately evaluate the actual processing capacity of the distributed node device, that is, when the number of pending tasks in the pending task queue is less than the queue limit length, it can be further determined whether corresponding tasks can still be assigned to the distributed node device.

[0097] Specifically, after determining that the number of pending tasks is not equal to the queue limit length, it is still possible to determine again whether the task processing time corresponding to the pending task information is less than the task processing time limit, thereby determining whether the current queue limit length exceeds the processing capacity of the distributed node device.

[0098] After executing the above judgment process, if the judgment result is that the task processing time is less than the task processing time limit, step S370 can be executed; if the judgment result is that the task processing time is not less than the task processing time limit, step S380 can be executed.

[0099] S370: Feedback task acceptance information to the central node device to obtain the task assigned by the central node device.

[0100] If the task processing time is less than the task processing time limit, it means that the distributed node device is currently fully capable of continuing to process the corresponding tasks, and there is no situation where the current queue limit length exceeds the processing capacity of the distributed node device. The task acceptance information can be fed back to the central node device to obtain the task assigned by the central node device.

[0101] The specific process of feeding back the task acceptance information to obtain the task assigned by the central node device can refer to the introduction in steps S260 and S270, which will not be repeated here.

[0102] S380: Feedback task rejection information to the central node device and reduce the queue limit length.

[0103] If the task processing time is not less than the task processing time limit, even if the number of tasks in the pending task queue is less than the queue limit length, the distributed node device has fully utilized the performance of the device to process these pending tasks, and the currently set queue limit length has exceeded the processing capacity of the distributed node device. Therefore, task rejection information can be fed back to the central node device so that the central node device cancels the allocation of tasks. For specific instructions on task rejection information and cancellation of task allocation, please refer to the introduction in step S250, which will not be repeated here.

[0104] Correspondingly, when the queue limit length has exceeded the processing capacity of the distributed node device, the queue limit length can also be reduced. Specifically, the queue limit length can be set to the number of current pending tasks so that the pending task queue meets the actual processing capacity of the distributed node device. In actual applications, the setting of the queue limit length can be adjusted based on the needs of actual applications, and is not limited to the above examples, which will not be repeated here.

[0105] Through the introduction of the embodiment of the above-mentioned task allocation method, it can be seen that when the method allocates tasks to distributed node devices, if the number of pending tasks of the distributed node device is equal to the queue limit length of the pending task queue, it can still be judged whether the distributed node device can continue to process tasks through the pending task information of the distributed node device, and the corresponding tasks can be allocated to the distributed node device if it can continue to process tasks. Therefore, the above-mentioned method determines whether to allocate tasks to distributed node devices according to the actual processing situation of each distributed node device for tasks, fully utilizes the processing capacity of each distributed node device, improves the utilization rate of the equipment, and speeds up the processing progress of tasks.

[0106] based on Figure 2 The corresponding task allocation method introduces another task allocation method in the embodiment of this specification. The execution subject of the task allocation method is the distributed node device. Figure 4 As shown, the task allocation method may include the following specific implementation steps.

[0107] S410: When receiving a task processing request sent by the central node device, obtain the number of pending tasks and pending task information corresponding to the pending task queue.

[0108] For the specific description of this step, please refer to the instructions in steps S210, S220, and S230, which will not be repeated here.

[0109] S420: Determine whether the number of tasks to be processed is equal to the queue limit length; the queue limit length is used to determine the upper limit of the number of tasks to be processed.

[0110] For the specific description of this step, please refer to the description in step S240, which will not be repeated here.

[0111] S430: If not equal, determine whether the task processing time corresponding to the to-be-processed task information is less than the task processing time limit.

[0112] For the specific description of this step, please refer to the description in step S250, which will not be repeated here.

[0113] S440: When the task processing time is less than the task processing time limit, feeding back task acceptance information to the central node device to obtain the task assigned by the central node device.

[0114] For the specific description of this step, please refer to the instructions in steps S260 and S270, which will not be repeated here.

[0115] based on Figure 2 The corresponding task allocation method introduces another task allocation method of the embodiment of this specification. The execution subject of the task allocation method is the central node device. Figure 5 As shown, the task allocation method may include the following specific implementation steps.

[0116] S510: Selecting a distributed node device based on the task allocation order.

[0117] For the specific description of this step, please refer to the description in step S210, which will not be repeated here.

[0118] S520: Send a task processing request to the distributed node device so that the distributed node device obtains the number of pending tasks and pending task information corresponding to the pending task queue, determines whether the number of pending tasks is equal to the queue limit length, and when the number of pending tasks is not equal to the queue limit length, determines whether the task processing time corresponding to the pending task information is greater than the task processing time limit; the queue limit length is used to determine the upper limit of the number of pending tasks.

[0119] For the specific description of this step, please refer to the instructions in steps S220, S230, S240, and S250, which will not be repeated here.

[0120] S530: When the task processing time corresponding to the to-be-processed task information of the distributed node device is not greater than the task processing time limit, receiving task acceptance information fed back by the distributed node device.

[0121] For the specific description of this step, please refer to the description in step S260, which will not be repeated here.

[0122] S540: Allocate tasks to the distributed node devices.

[0123] For the specific description of this step, please refer to the description in step S270, which will not be repeated here.

[0124] based on Figure 4 The corresponding task allocation method introduces a task allocation device in the embodiment of this specification. The task allocation device is set in the distributed node device. Figure 6 As shown, the task allocation device includes the following modules.

[0125] The task information acquisition module 610 is used to acquire the number of pending tasks and pending task information corresponding to the pending task queue when receiving a task processing request sent by the central node device;

[0126] The task quantity determination module 620 is used to determine whether the number of tasks to be processed is equal to the queue limit length; the queue limit length is used to determine the upper limit of the number of tasks to be processed;

[0127] The task processing time determination module 630 is used to determine whether the task processing time corresponding to the task information to be processed is greater than the task processing time limit when the number of tasks to be processed is not equal to the queue limit length;

[0128] The task acceptance information feedback module 640 is used to feed back task acceptance information to the central node device to obtain the task assigned by the central node device when the task processing time is not greater than the task processing time limit.

[0129] based on Figure 5 The corresponding task allocation method introduces a task allocation device in the embodiment of this specification. The task allocation device is set in the central node device. Figure 7 As shown, the task allocation device includes the following modules.

[0130] A distributed node device selection module 710 is used to select a distributed node device based on the task allocation order;

[0131] The task processing request sending module 720 is used to send a task processing request to the distributed node device, so that the distributed node device obtains the number of pending tasks and pending task information corresponding to the pending task queue, determines whether the number of pending tasks is equal to the queue limit length, and when the number of pending tasks is not equal to the queue limit length, determines whether the task processing time corresponding to the pending task information is greater than the task processing time limit; the queue limit length is used to determine the upper limit of the number of pending tasks;

[0132] The task acceptance information receiving module 730 is used to receive the task acceptance information fed back by the distributed node device when the task processing time corresponding to the task information to be processed of the distributed node device is not greater than the task processing time limit;

[0133] The task allocation module 740 is used to allocate tasks to the distributed node devices.

[0134] based on Figure 4 Corresponding to the task allocation method, this specification embodiment provides a distributed node device. Figure 8 As shown, the distributed node device may include a memory and a processor.

[0135] In this embodiment, the memory may be implemented in any appropriate manner. For example, the memory may be a read-only memory, a mechanical hard disk, a solid-state hard disk, or a USB flash drive, etc. The memory may be used to store computer program instructions.

[0136] In this embodiment, the processor can be implemented in any appropriate manner. For example, the processor can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. The processor can execute the computer program instructions to implement the following steps: in the case of receiving a task processing request sent by a central node device, obtain the number of pending tasks and pending task information corresponding to the pending task queue; determine whether the number of pending tasks is equal to the queue limit length; the queue limit length is used to determine the upper limit of the number of pending tasks; if not equal, determine whether the task processing time corresponding to the pending task information is greater than the task processing time limit; if not greater than, feedback task acceptance information to the central node device to obtain the task assigned by the central node device.

[0137] based on Figure 5 Corresponding to the task allocation method, this specification embodiment provides a central node device. Fig. 9 As shown, the distributed node device may include a memory and a processor.

[0138] In this embodiment, the memory may be implemented in any appropriate manner. For example, the memory may be a read-only memory, a mechanical hard disk, a solid-state hard disk, or a USB flash drive, etc. The memory may be used to store computer program instructions.

[0139] In this embodiment, the processor can be implemented in any appropriate manner. For example, the processor can take the form of a computer-readable medium such as a microprocessor or processor and a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. The processor can execute the computer program instructions to implement the following steps: select a distributed node device based on the task allocation order; send a task processing request to the distributed node device so that the distributed node device obtains the number of pending tasks and pending task information corresponding to the pending task queue, determines whether the number of pending tasks is equal to the queue limit length, and when the number of pending tasks is not equal to the queue limit length, determines whether the task processing time corresponding to the pending task information is greater than the task processing time limit; the queue limit length is used to determine the upper limit of the number of pending tasks; when the task processing time corresponding to the pending task information of the distributed node device is not greater than the task processing time limit, receives the task acceptance information fed back by the distributed node device; and assigns tasks to the distributed node device.

[0140] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0141] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0142] It can be known from the above description of the implementation mode that the technicians in this field can clearly understand that the present specification can be implemented by means of software plus the necessary first hardware platform. Based on such an understanding, the technical solution of the present specification can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present specification or some parts of the embodiments.

[0143] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0144] This specification can be used in many first or special computer system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.

[0145] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0146] Although the present specification is described through embodiments, those skilled in the art will appreciate that there are many modifications and changes to the present specification without departing from the spirit of the present specification, and it is intended that the appended claims include these modifications and changes without departing from the spirit of the present specification.

Claims

1. A task allocation method, characterized in that: Applied to a distributed node device, the method comprises: When receiving a task processing request sent by the central node device, obtaining the number of pending tasks and pending task information corresponding to the pending task queue; the pending task information includes the processing time limit of the pending tasks in the pending task queue; Determine whether the number of tasks to be processed is equal to the queue limit length; the queue limit length is used to determine the upper limit of the number of tasks to be processed; the queue limit length is a rough estimate of the actual processing capacity of the distributed node device, and in the process of task allocation, the queue limit length can be adjusted accordingly according to the processing capacity of different distributed node devices to adapt to the actual processing capacity of different distributed node devices; If the number of pending tasks is equal to the queue limit length, determine whether the task processing time corresponding to the pending task information is less than the task processing time limit; the task processing time is determined based on the task processing capacity; the task processing capacity includes the maximum number of tasks that the distributed node device can process within a unit time; In the case where the task processing time is less than the task processing time limit, increasing the queue limit length, and feeding back task acceptance information to the central node device to obtain the task assigned by the central node device; If the number of tasks to be processed is less than the queue limit length, determine whether the task processing time corresponding to the task information to be processed is less than the task processing time limit; If the task processing time is not less than the task processing time limit, reduce the queue limit length so that the queue limit length is the number of current tasks to be processed; and feed back task rejection information to the central node device; When the central node device allocates tasks to each distributed node device, the distributed node device is selected based on the task allocation sequence, and the task allocation sequence is a cycle. After the task is allocated once according to the task allocation sequence, the task is allocated again according to the task allocation sequence; When performing a task allocation in accordance with the task allocation sequence, the same number of tasks is allocated to each distributed node device to ensure uniform distribution of tasks; Before the central node device assigns tasks to the distributed node devices, it first sends a task processing request to the selected distributed node devices to determine whether the selected distributed node can accept the task to be assigned.

2. The method according to claim 1, characterized in that After determining whether the number of tasks to be processed is equal to the queue limit length, the method further includes: If the number of tasks to be processed is less than the queue limit length, task acceptance information is fed back to the central node device to obtain the tasks assigned by the central node device.

3. The method according to claim 1, characterized in that The determining whether the task processing time corresponding to the to-be-processed task information is less than the task processing time limit includes: determining task processing capability based on the task processing information; Determine the task processing time according to the task processing capacity and the number of tasks to be processed; Determine whether the task processing time is less than the task processing time limit.

4. A task allocation device, characterized in that: Set in a distributed node device, the device includes: The task information acquisition module is used to acquire the number of pending tasks and pending task information corresponding to the pending task queue when receiving a task processing request sent by the central node device; the pending task information includes the processing time limit of the pending tasks in the pending task queue; The task quantity determination module is used to determine whether the number of tasks to be processed is equal to the queue limit length; the queue limit length is used to determine the upper limit of the number of tasks to be processed; the queue limit length is a rough estimate of the actual processing capacity of the distributed node device, and in the process of task allocation, the queue limit length can be adjusted accordingly according to the processing capacity of different distributed node devices to adapt to the actual processing capacity of different distributed node devices; A task processing time determination module, used to determine whether the task processing time corresponding to the task information to be processed is greater than the task processing time limit when the number of tasks to be processed is equal to the queue limit length; the task processing time is determined based on the task processing capacity; the task processing capacity includes the maximum number of tasks that the distributed node device can process within a unit time; A task acceptance information feedback module is used to increase the queue limit length when the task processing time is not greater than the task processing time limit, and to feed back task acceptance information to the central node device to obtain the task assigned by the central node device; The device is also used for: If the number of tasks to be processed is less than the queue limit length, determine whether the task processing time corresponding to the task information to be processed is less than the task processing time limit; If the task processing time is not less than the task processing time limit, reduce the queue limit length so that the queue limit length is the number of current tasks to be processed; and feed back task rejection information to the central node device; When the central node device allocates tasks to each distributed node device, the distributed node device is selected based on the task allocation sequence, and the task allocation sequence is a cycle. After the task is allocated once according to the task allocation sequence, the task is allocated again according to the task allocation sequence; When performing a task allocation in accordance with the task allocation sequence, the same number of tasks is allocated to each distributed node device to ensure uniform distribution of tasks; Before the central node device assigns tasks to the distributed node devices, it first sends a task processing request to the selected distributed node devices to determine whether the selected distributed node can accept the task to be assigned.

5. A distributed node device comprising a memory and a processor; The memory is used to store computer program instructions; The processor is used to execute the computer program instructions to implement the following steps: upon receiving a task processing request sent by a central node device, obtaining the number of pending tasks and pending task information corresponding to the pending task queue; the pending task information includes the processing time limit of the pending tasks in the pending task queue; judging whether the number of pending tasks is equal to the queue limit length; the queue limit length is used to determine the upper limit of the number of pending tasks; the queue limit length is a rough estimate of the actual processing capacity of the distributed node device, and in the process of task allocation, the queue limit length can be adjusted accordingly according to the processing capacity of different distributed node devices to adapt to the actual processing capacity of different distributed node devices; If the number of tasks to be processed is equal to the queue limit length, determine whether the task processing time corresponding to the task information to be processed is greater than the task processing time limit; The task processing time is determined based on the task processing capability; the task processing capability includes the maximum number of tasks that the distributed node device can process within a unit time; In the case where the task processing time is less than the task processing time limit, increasing the queue limit length, and feeding back task acceptance information to the central node device to obtain the task assigned by the central node device; If the number of tasks to be processed is less than the queue limit length, determine whether the task processing time corresponding to the task information to be processed is less than the task processing time limit; If the task processing time is not less than the task processing time limit, reduce the queue limit length so that the queue limit length is the number of current tasks to be processed; and feed back task rejection information to the central node device; When the central node device allocates tasks to each distributed node device, the distributed node device is selected based on the task allocation sequence, and the task allocation sequence is a cycle. After the task is allocated once according to the task allocation sequence, the task is allocated again according to the task allocation sequence; When performing a task allocation in accordance with the task allocation sequence, the same number of tasks is allocated to each distributed node device to ensure uniform distribution of tasks; Before the central node device assigns tasks to the distributed node devices, it first sends a task processing request to the selected distributed node devices to determine whether the selected distributed node can accept the task to be assigned.

6. A task allocation method, characterized in that: Applied to a central node device, the method comprises: Select distributed node devices based on the task allocation order; Sending a task processing request to the distributed node device so that the distributed node device obtains the number of pending tasks and pending task information corresponding to the pending task queue, wherein the pending task information includes the processing time limit of the pending tasks in the pending task queue; judging whether the number of pending tasks is equal to the queue limit length, and when the number of pending tasks is equal to the queue limit length, determining whether the task processing time corresponding to the pending task information is not less than the task processing time limit; the queue limit length is used to determine the upper limit of the number of pending tasks; the queue limit length is a rough estimate of the actual processing capacity of the distributed node device, and in the process of task allocation, the queue limit length can be adjusted accordingly according to the processing capacity of different distributed node devices to adapt to different The actual processing capacity of the distributed node device; the task processing time is determined based on the task processing capacity; the task processing capacity includes the maximum number of tasks that the distributed node device can process within a unit time; if the number of tasks to be processed is equal to the queue limit length, and the task processing time corresponding to the task information to be processed is less than the task processing time limit, the queue limit length is increased, and task acceptance information is fed back to the central node device to obtain the task assigned by the central node device; if the number of tasks to be processed is less than the queue limit length, and the task processing time corresponding to the task information to be processed is not less than the task processing time limit, the queue limit length is reduced so that the queue limit length is the current number of tasks to be processed; and task rejection information is fed back to the central node device; When the task processing time corresponding to the to-be-processed task information of the distributed node device is not greater than the task processing time limit, receiving task acceptance information or task rejection information fed back by the distributed node device; When receiving the task acceptance information, assigning the task to the distributed node device; When the central node device allocates tasks to each distributed node device, the distributed node device is selected based on the task allocation sequence, and the task allocation sequence is a cycle. After the task is allocated once according to the task allocation sequence, the task is allocated again according to the task allocation sequence; When performing a task allocation in accordance with the task allocation sequence, the same number of tasks is allocated to each distributed node device to ensure uniform distribution of tasks; Before the central node device assigns tasks to the distributed node devices, it first sends a task processing request to the selected distributed node devices to determine whether the selected distributed node can accept the task to be assigned.

7. The method according to claim 6, characterized in that The task allocation sequence corresponds to at least two processing nodes; the at least two processing nodes have the same initial queue definition length.

8. The method according to claim 6, characterized in that After sending the task processing request to the distributed node device, the method further includes: When the task processing time corresponding to the to-be-processed task information of the distributed node device is not less than the task processing time limit, task rejection information fed back by the distributed node device is received.

9. The method according to claim 8, characterized in that After receiving the task rejection information fed back by the distributed node device, the method further includes: Other distributed node devices are selected based on the task allocation order to allocate tasks.

10. A task allocation device, characterized in that: Set in the central node equipment, the device includes: A distributed node device selection module is used to select distributed node devices based on the task allocation order; A task processing request sending module is used to send a task processing request to the distributed node device, so that the distributed node device obtains the number of pending tasks and pending task information corresponding to the pending task queue, the pending task information including the processing time limit of the pending tasks in the pending task queue; judges whether the number of pending tasks is equal to the queue limit length, and when the number of pending tasks is equal to the queue limit length, determines whether the task processing time corresponding to the pending task information is greater than the task processing time limit; the queue limit length is used to determine the upper limit of the number of pending tasks; the queue limit length is a rough estimate of the actual processing capacity of the distributed node device, and the queue limit length can be adjusted accordingly according to the processing capacity of different distributed node devices during the task allocation process to adapt to the actual processing capabilities of different distributed node devices; the task processing time is determined based on the task processing capability; the task processing capability includes the maximum number of tasks that the distributed node device can process within a unit time; if the number of tasks to be processed is equal to the queue limit length, and the task processing time corresponding to the task information to be processed is less than the task processing time limit, the queue limit length is increased, and task acceptance information is fed back to the central node device to obtain the task assigned by the central node device; if the number of tasks to be processed is less than the queue limit length, and the task processing time corresponding to the task information to be processed is not less than the task processing time limit, the queue limit length is reduced so that the queue limit length is the current number of tasks to be processed; and task rejection information is fed back to the central node device; A task acceptance information receiving module, used to receive task acceptance information or task rejection information fed back by the distributed node device when the task processing time corresponding to the task information to be processed of the distributed node device is not greater than the task processing time limit; A task allocation module, configured to allocate tasks to the distributed node devices upon receiving task acceptance information; When the central node device allocates tasks to each distributed node device, the distributed node device is selected based on the task allocation sequence, and the task allocation sequence is a cycle. After the task is allocated once according to the task allocation sequence, the task is allocated again according to the task allocation sequence; When performing a task allocation in accordance with the task allocation sequence, the same number of tasks is allocated to each distributed node device to ensure uniform distribution of tasks; Before the central node device assigns tasks to the distributed node devices, it first sends a task processing request to the selected distributed node devices to determine whether the selected distributed node can accept the task to be assigned.

11. A task allocation device, characterized in that: Applied to central node devices, including memory and processors; The memory is used to store computer program instructions; The processor is used to execute the computer program instructions to implement the following steps: selecting a distributed node device based on a task allocation order; sending a task processing request to the distributed node device, so that the distributed node device obtains the number of pending tasks and pending task information corresponding to the pending task queue, the pending task information including the processing time limit of the pending tasks in the pending task queue; judging whether the number of pending tasks is equal to the queue limit length, and when the number of pending tasks is equal to the queue limit length, determining whether the task processing time corresponding to the pending task information is greater than the task processing time limit; The queue limit length is used to determine the upper limit of the number of tasks to be processed; the queue limit length is a rough estimate of the actual processing capacity of the distributed node device. During the task allocation process, the queue limit length can be adjusted accordingly according to the processing capacity of different distributed node devices to adapt to the actual processing capacity of different distributed node devices; the task processing time is determined based on the task processing capacity; the task processing capacity includes the maximum number of tasks that the distributed node device can process within a unit time; If the number of tasks to be processed is equal to the queue limit length, and the task processing time corresponding to the task information to be processed is less than the task processing time limit, the queue limit length is increased, and task acceptance information is fed back to the central node device to obtain the task assigned by the central node device; if the number of tasks to be processed is less than the queue limit length, and the task processing time corresponding to the task information to be processed is not less than the task processing time limit, the queue limit length is reduced so that the queue limit length is the current number of tasks to be processed; and task rejection information is fed back to the central node device; if the task processing time corresponding to the task information to be processed of the distributed node device is not greater than the task processing time limit, the task acceptance information or task rejection information fed back by the distributed node device is received; When receiving the task acceptance information, assigning the task to the distributed node device; When the central node device allocates tasks to each distributed node device, the distributed node device is selected based on the task allocation sequence, and the task allocation sequence is a cycle. After the task is allocated once according to the task allocation sequence, the task is allocated again according to the task allocation sequence; When performing a task allocation in accordance with the task allocation sequence, the same number of tasks is allocated to each distributed node device to ensure uniform distribution of tasks; Before the central node device assigns tasks to the distributed node devices, it first sends a task processing request to the selected distributed node devices to determine whether the selected distributed node can accept the task to be assigned.

Citation Information

Patent Citations

  • Queuing tasks in a computer system

    US20160266930A1