Task processing method and device, equipment and storage medium

By reorganizing the delayed task timing queue of routing sub-tasks in the logistics system, forming a batch task queue, and using this as the scheduling unit of the task thread, the problem of overload operation of the routing sub-system when processing a large number of sub-orders is solved, and the concurrent processing capability and stability of the system are improved.

CN120066691APending Publication Date: 2025-05-30BEIJING JINGDONG YUANSHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311606897.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-28
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In existing logistics systems, when logistics orders are split into multiple sub-orders, the routing sub-system may run overload, affecting its operating stability.

Method used

By obtaining the current delay task timing queue composed of each subtask, and reorganizing the queue elements according to the total route task to which each subtask belongs, a reorganization queue composed of each batch task is formed. Batch tasks are used as the scheduling unit of the task thread. Based on the order of batch tasks, each batch task is processed separately in the task thread.

Benefits of technology

It improves the concurrent processing capability of the routing subsystem, avoids overload operation of the routing subsystem, thereby ensuring the operation stability of the routing subsystem.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066691A_ABST
    Figure CN120066691A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a task processing method and device, equipment and a storage medium, and relates to the technical field of computers.The method can comprise the steps that current delay task time sequence queues composed of subtasks are obtained; performing queue element recombination on the current delay task time sequence queue according to the routing general task to which each routing sub-task belongs to obtain a current recombination queue composed of each batch task; wherein for each batch task, the current batch task comprises at least one routing subtask in the same routing general task; and taking the batch tasks as a scheduling unit of a task thread, and processing the batch tasks in the task thread based on the sequence of the batch tasks in the current recombination queue. By adopting the technical scheme of the embodiment of the invention, the concurrent processing capability of the routing subsystem in the logistics system in the supply chain field can be improved, so that the overload operation of the routing subsystem is avoided, and the operation stability of the routing subsystem can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular, to a task processing method, apparatus, device, and storage medium. Background Art

[0002] Currently, a logistics system in the supply chain field may include multiple business subsystems such as a pick-up subsystem, a sorting subsystem, a transportation subsystem, and a routing subsystem. Among them, the routing subsystem can be used to determine a detailed distribution plan for a logistics order when the logistics system receives the logistics order, and can execute the routing task for the logistics order to store the actual routing data for the logistics order received from other business subsystems (for example, the actual pick-up data received from the pick-up subsystem).

[0003] However, in the process of implementing the present invention, it is found that there are at least the following problems in the prior art: in the existing logistics system, when a certain logistics order meets the split order condition, the logistics order will be split into multiple sub-orders (one sub-order corresponds to one package), and the routing task corresponding to the logistics order will also be correspondingly split into multiple routing subtasks. Then, when the number of sub-orders into which the logistics order is split exceeds the number of threads of the routing subsystem, the routing subsystem may operate overloaded, affecting the stability of the operation of the routing subsystem. Summary of the Invention

[0004] The embodiments of the present invention provide a task processing method, apparatus, device, and storage medium, which can improve the concurrent processing ability of the routing subsystem in the logistics system in the supply chain field, thereby avoiding the overloading operation of the routing subsystem, and further ensuring the stability of the operation of the routing subsystem.

[0005] In a first aspect, the embodiments of the present invention provide a task processing method, which may include: obtaining a current delayed task time sequence queue composed of each routing subtask; reorganizing the queue elements of the current delayed task time sequence queue according to the routing total tasks to which each routing subtask belongs respectively, to obtain a current reorganization queue composed of each batch task; wherein, for each batch task, the current batch task includes at least one routing subtask in the same routing total task; using the batch task as the scheduling unit of the task thread, and based on the sequence of each batch task in the current reorganization queue, processing each batch task respectively in the task thread.

[0006] In a second aspect, the embodiments of the present invention further provide a task processing apparatus, which may include: an obtaining module, a reorganizing module, and a processing module;

[0007] Specifically, an acquisition module is configured to acquire a current delayed task time sequence queue composed of each routing subtask; a recombination module is configured to recombine queue elements of the current delayed task time sequence queue according to the routing master tasks to which each routing subtask belongs respectively, so as to obtain a current recombined queue composed of each batch task; wherein, for each batch task, the current batch task includes at least one routing subtask in the same routing master task; a processing module is configured to use the batch task as a scheduling unit of a task thread, and process each batch task respectively in the task thread based on the sequence of each batch task in the current recombined queue.

[0008] In a third aspect, an embodiment of the present invention provides a task processing device, and the task processing device includes:

[0009] One or more processors;

[0010] A memory for storing one or more programs;

[0011] When the one or more programs are executed by the one or more processors, the one or more processors implement the task processing method provided in any embodiment of the present invention.

[0012] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the task processing method provided in any embodiment of the present invention is implemented.

[0013] The above embodiments in the present invention have the following advantages or beneficial effects:

[0014] In the technical solution provided by the embodiment of the present invention, a delayed task time sequence queue can be created in advance for abnormal logistics orders (for example, logistics orders that can be split into multiple sub-orders), which is used to store the routing sub-tasks of abnormal logistics orders. Since all routing sub-tasks in the same routing total task have task relevance (the access paths are the same when processing the actual routing data corresponding to these routing sub-tasks), therefore, in the embodiment of the present invention, when it is necessary to execute a routing sub-task, the current delayed task time sequence queue composed of each routing sub-task can be obtained first, and then multiple routing sub-tasks belonging to the same routing total task in the current delayed task time sequence queue can be batch processed (it can be in one batch or multiple batches). However, in actual applications, the routing subsystem may receive multiple logistics orders at the same time. Therefore, in the current delayed task time sequence queue, all routing sub-tasks in the same routing total task may not be arranged continuously. Therefore, before batch processing multiple routing sub-tasks of the same routing total task, the embodiment of the present invention also needs to reorganize the queue elements of the current delayed task time sequence queue according to the routing total tasks to which each routing sub-task belongs respectively, so as to obtain the current reorganization queue composed of each batch task; wherein, for each batch task, the current batch task includes at least one routing sub-task in the same routing total task. After that, the batch task can be used as the scheduling unit of the task thread, and based on the sequence of each batch task in the current reorganization queue, each batch task can be processed respectively in the task thread. It can be seen that in the embodiment of the present invention, by reorganizing the current delayed task time sequence queue into the current reorganization queue composed of each batch task, and using the batch task as the scheduling unit of the task thread of the routing subsystem, batch processing of multiple routing sub-tasks can be realized. In this way, the concurrent processing ability of the routing subsystem can be improved, thereby avoiding the overloading operation of the routing subsystem, and further ensuring the stability of the operation of the routing subsystem. Description of the Drawings

[0015] Figure 1 is a simplified flowchart of the operation method of the routing subsystem in the prior art;

[0016] Figure 2 is a flowchart of a task processing method provided by an embodiment of the present invention;

[0017] Figure 3 is an arrangement diagram of the current delayed task time sequence queue provided by an embodiment of the present invention;

[0018] Figure 4 is a flowchart of another task processing method provided by an embodiment of the present invention;

[0019] Figure 5 is a schematic diagram of a data structure provided by an embodiment of the present invention;

[0020] Figure 6 It is a simplified flowchart diagram of inserting a routing subtask into a linked list of array element indexes provided by an embodiment of the present invention;

[0021] Figure 7 It is a schematic structural diagram of a task processing device provided by an embodiment of the present invention;

[0022] Figure 8 It is a schematic structural diagram of a task processing device provided by an embodiment of the present invention. Specific Embodiments

[0023] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. In addition, it should be noted that for the sake of description, only parts related to the present invention are shown in the accompanying drawings rather than all the structures.

[0024] The term "and / or" in this document is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone.

[0025] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the embodiments of the present invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may alternatively include other unlisted steps or units, or may alternatively include other steps or units inherent to these processes, methods, products, or devices.

[0026] It should be noted that in the embodiments of the present invention, words such as "exemplary" or "such as" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "such as" in the embodiments of the present invention should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "such as" is intended to present relevant concepts in a specific manner.

[0027] In the description of the embodiments of the present invention, unless otherwise specified, the meaning of "a plurality" or "each" refers to two or more.

[0028] Before describing the embodiments of the present invention in detail, the domain nouns in the supply chain field will be explained, and the operation process of the routing subsystem in the prior art will be briefly introduced.

[0029] In the field of supply chain, a logistics waybill is a document or electronic record that records the information required during the entire transportation process of goods from the place of dispatch to the destination. It usually contains information such as the attributes of the goods, the shipper, the consignee, the transportation method, and the transportation cost. It is the core document for information exchange during the logistics transportation process. A package is the smallest unit in which goods are packed in boxes during the logistics transportation process. It can be a packed box, bag, envelope, or other container. During the logistics transportation process, the package goes through links such as scanning, weighing, and transportation, and is tracked and managed through the logistics waybill. The corresponding relationship between the logistics waybill and the package is that one logistics waybill can correspond to multiple packages, while one package is usually associated with a specific logistics waybill. Among them, one logistics waybill corresponds to one logistics order in the embodiments of the present invention, and one package corresponds to one sub-order in the embodiments of the present invention.

[0030] Refer to Figure 1 , which is a simplified process schematic diagram of the operation method of the routing subsystem in the prior art. As Figure 1 shown, after the actual routing data is generated by business subsystems such as the pickup subsystem, sorting subsystem, transportation subsystem, warehousing subsystem, and delivery subsystem in the logistics system, the actual routing data will flow into the first internal MQ middleware of the routing subsystem (corresponding to Figure 1 MQ1 in Figure 1 ) and the routing gateway through the external message (Message Queue, MQ) middleware. When the actual routing data flows into the routing subsystem, the routing subsystem will generate a routing subtask for the actual routing data. After that, the routing subsystem can process the routing subtask by consuming the actual routing data in the first internal MQ middleware.

[0031] Since the logistics system may receive abnormal logistics orders, and the actual routing data of multiple sub-orders of the same logistics order generally flows into the routing subsystem continuously, the routing subsystem may be overloaded due to processing a large number of routing subtasks at the same time, causing concurrent access conflicts and affecting the stability of the routing subsystem operation. Based on this, in the prior art, a routing task lock is added to the routing subsystem. Before the routing subsystem consumes a certain actual routing data to process the corresponding routing subtask, it needs to obtain the routing task lock first; if the acquisition is successful, it can normally consume the actual routing data and pass through the second internal MQ middleware (corresponding to Figure 1The MQ3) in it performs routing processing on the actual routing data; if the routing task lock has been occupied by other routing subtasks at this time and the routing subsystem fails to obtain the routing task lock, the routing subsystem can identify the logistics order corresponding to the actual routing data. If it is determined that the logistics order is an abnormal logistics order, the actual routing data can be added to the first delayed consumption queue; if it is determined that the logistics order is a normal logistics order, the actual routing data can be added to the second delayed consumption queue. The actual routing data in the first delayed consumption queue or the second delayed consumption queue will roll back to the first internal MQ middleware again. In this way, the routing subsystem can consume the actual routing data by repeatedly attempting to obtain the routing task lock. However, when the number of sub-orders into which a logistics order is split is particularly large, the routing subsystem will succeed only after consuming some actual routing data repeatedly many times. Therefore, after the existing routing subsystem delays the consumption of some actual routing data, some actual routing data cannot be processed in a timely manner within the time limit. Therefore, there is an urgent need to propose a new solution to solve the problem of concurrent access conflicts caused by the overloaded operation of the routing subsystem.

[0032] In view of the problems existing in the above-mentioned prior art, an embodiment of the present invention provides a task processing method. Figure 2 As shown in the flowchart of the task processing method provided by the embodiment of the present invention, this method can be applied to the application scenario where a logistics system in the supply chain field receives an abnormal logistics order (for example, a logistics order split into multiple sub-orders). This method can be executed by the task processing device provided by the embodiment of the present invention, and the device can be implemented in software and / or hardware and integrated in the task processing device.

[0033] The task processing method provided by the embodiment of the present invention can be applied to the routing subsystem in the logistics system. For example, the task processing device can be the server of the routing subsystem.

[0034] As Figure 2 shown, the task processing method provided by the embodiment of the present invention specifically includes the following steps:

[0035] S210. Obtain the current delayed task time sequence queue composed of each routing subtask.

[0036] Among them, the queue elements of the current delayed task time sequence queue are routing subtasks. Moreover, each routing subtask in the current delayed task time sequence queue is inserted into the current delayed task time sequence queue in sequence according to its arrival time at the routing subsystem.

[0037] In an embodiment of the present invention, a delay task time sequence queue can be created in advance for abnormal logistics orders to store routing subtasks of abnormal logistics orders. In a possible implementation, after the routing subsystem receives a routing subtask sent by another business subsystem, it can identify the routing subtask. If it is determined that there are still other routing subtasks in the total routing task to which the routing subtask belongs, that is, the logistics order corresponding to the routing subtask is split into multiple sub-orders, the routing subtask can be added to the delay task time sequence queue. Or, in another possible implementation, after the routing subsystem receives a routing subtask sent by another business subsystem, it can identify the routing subtask. If it is determined that there are still other routing subtasks in the total routing task to which the routing subtask belongs, and the number of routing subtasks in the total routing task exceeds a pre-determined number, the routing subtask can be added to the delay task time sequence queue.

[0038] In a possible implementation, the delay task time sequence queue can include multiple sub-queues. After the routing subsystem receives a routing subtask, it can perform a hash operation on the routing identifier of the total routing task to which the routing subtask belongs based on a pre-determined hash algorithm to obtain a target hash value. Then, according to the mapping relationship table between the hash value and the sub-queue, the target sub-queue corresponding to the target hash value can be determined from the multiple sub-queues, and then the routing subtask can be inserted into the target sub-queue. In this way, it can be ensured that the routing subtasks in the same total routing task are stored in the same sub-queue, which is convenient for batch processing of the routing subtasks belonging to the same total routing task in the same sub-queue. Exemplarily, the routing identifier of the total routing task can be the waybill number of the logistics order corresponding to the total routing task.

[0039] Optionally, obtaining the current delay task time sequence queue composed of each routing subtask includes: when receiving a target routing subtask, obtaining a routing task lock; when it is determined that the routing task lock is not successfully obtained, determining whether the target routing subtask is an abnormal routing task based on the number of routing subtasks in the total routing task to which the target routing subtask belongs; when it is determined that the target routing subtask is an abnormal routing task, inserting the target routing subtask into the previous delay task time sequence queue to obtain the current delay task time sequence queue.

[0040] Wherein, the previous delay task time sequence queue is also the latest delay task time sequence queue obtained after the routing subsystem inserts the previous received routing subtask into the delay task time sequence queue.

[0041] In practical applications of the embodiments of the present invention, it can also be combined with the technical solution of adding a routing task lock in the prior art. Specifically, when the routing subsystem receives a target routing subtask for consuming target actual routing data (that is Figure 1After the MQ2 in it receives the target actual routing data, it can try to acquire the routing task lock; if the acquisition is successful, it can normally process the target routing subtask; if the acquisition fails, it can identify the logistics order corresponding to the target routing subtask. When it is determined that it is a normal logistics order, the target routing subtask can be inserted into the second delayed consumption queue; when it is determined that it is an abnormal logistics order, the target routing subtask can be inserted into the first delayed consumption queue, and the first delayed consumption queue can be the current delayed task timing queue in the embodiment of the present invention. By combining the technical solution provided by the embodiment of the present invention with the technical solution of adding a routing task lock in the prior art, the concurrent processing ability of the routing subsystem can be further improved, and the stability of the operation of the routing subsystem can be improved.

[0042] S220. According to the routing total tasks to which the respective routing subtasks belong, perform queue element recombination on the current delayed task timing queue to obtain a current recombination queue composed of respective batch tasks.

[0043] Among them, for each batch task, the current batch task includes at least one routing subtask in the same routing total task. That is to say, for any batch task, all the routing subtasks included therein belong to the same routing total task.

[0044] In the embodiment of the present invention, it is necessary to batch process multiple routing subtasks in the current delayed task timing queue that belong to the same routing total task to improve the concurrent processing ability of the routing subsystem. However, in actual applications, the routing subsystem may receive multiple logistics orders simultaneously. Therefore, in the current delayed task timing queue, all the routing subtasks in the same routing total task may not be arranged continuously. Refer to Figure 3 , which is a schematic diagram of the arrangement of a current delayed task timing queue provided by the embodiment of the present invention. As Figure 3 shown, the current delayed task timing queue includes multiple sub-queues (for example, Figure 3 queue 0, queue 1, queue 2, and queue 3 in Figure 3The routing subtasks of order A, order B, and order C) in []. Since these three logistics orders arrive at the logistics system simultaneously, the routing subtasks of these three logistics orders are interleaved in the current delayed task time sequence queue. For example, routing subtask 0, routing subtask 4, routing subtask 7, and routing subtask 9 correspond to order C, routing subtask 1, routing subtask 5, and routing subtask 6 correspond to order A, and routing subtask 2, routing subtask 3, and routing subtask 8 correspond to order B. Based on this, after the present invention embodiment obtains the current delayed task time sequence queue, it is also necessary to reorganize the queue elements of the current delayed task time sequence queue according to the routing master tasks to which each routing subtask belongs respectively, so as to obtain the current reorganization queue composed of each batch task.

[0045] After the routing subsystem obtains the current delayed task time sequence queue, for any two routing subtasks among the routing subtasks, it is possible to determine whether these two routing subtasks belong to the same routing master task by determining the waybill numbers of the logistics orders associated with these two routing subtasks. If they belong to the same routing master task, these two routing subtasks can be reorganized into a batch task. After that, when there are other routing subtasks that belong to the same routing master task as these two routing subtasks, these other routing subtasks can also be added to the batch task. Exemplarily, taking Figure 3 as an example, routing subtask 0, routing subtask 4, routing subtask 7, and routing subtask 9 can be reorganized into a batch task, routing subtask 1, routing subtask 5, and routing subtask 6 can be reorganized into a batch task, and routing subtask 2, routing subtask 3, and routing subtask 8 can be reorganized into a batch task.

[0046] S230: Using the batch task as the scheduling unit of the task thread, and based on the sequence of each batch task in the current reorganization queue, process each batch task separately in the task thread.

[0047] Exemplarily, take the current reorganization queue including three batch tasks, and the sequential sorting of these three batch tasks in the current reorganization queue is batch task A, batch task B, and batch task C as an example. In one possible implementation, if the task thread of the routing subsystem is a single thread, the routing subsystem can first process batch task A in this single thread (that is, simultaneously process the actual routing data corresponding to multiple routing subtasks in batch task A); after processing batch task A, batch task B and batch task C can be processed in sequence. In another possible implementation, if the task thread of the routing subsystem is a multi-thread, the routing subsystem can first determine an idle thread from the multi-threads, and then process batch task A in this idle thread; after adding batch task A to this idle thread, the routing subsystem can then determine another idle thread from the multi-threads, and then process batch task B in another idle thread. If all the multi-threads are occupied at this time, waiting is required until an idle thread appears and then batch task B is added to the idle thread; similarly, batch task C can be processed.

[0048] In the task processing method provided by the embodiments of the present invention, a delayed task time sequence queue can be pre-created for an abnormal logistics order (i.e., a logistics order split into multiple sub-orders) to store the routing sub-tasks of the abnormal logistics order. Since all routing sub-tasks in the same routing total task have task correlation (the access paths when processing the actual routing data corresponding to these routing sub-tasks are the same), in the embodiments of the present invention, when it is necessary to execute a routing sub-task, the current delayed task time sequence queue composed of each routing sub-task can be obtained first, and then multiple routing sub-tasks belonging to the same routing total task in the current delayed task time sequence queue can be processed in batches (it can be divided into one batch or multiple batches). However, in practical applications, the routing subsystem may receive multiple logistics orders simultaneously. Therefore, in the current delayed task time sequence queue, all routing sub-tasks in the same routing total task may not be arranged continuously. Therefore, before processing multiple routing sub-tasks of the same routing total task in batches, the embodiments of the present invention also need to reorganize the queue elements of the current delayed task time sequence queue according to the routing total tasks to which each routing sub-task belongs respectively, to obtain the current reorganized queue composed of each batch task; wherein, for each batch task, the current batch task includes at least one routing sub-task in the same routing total task. After that, the batch task can be used as the scheduling unit of the task thread, and based on the sequence of each batch task in the current reorganized queue, each batch task can be processed respectively in the task thread. It can be seen that the embodiments of the present invention can realize batch processing of multiple routing sub-tasks by reorganizing the current delayed task time sequence queue into the current reorganized queue composed of each batch task and using the batch task as the scheduling unit of the task thread of the routing subsystem. In this way, the concurrent processing ability of the routing subsystem can be improved, thereby avoiding the overloading operation of the routing subsystem, and further ensuring the stability of the routing subsystem operation.

[0049] Refer to Figure 4 , which is a schematic flowchart of another task processing method provided by the embodiments of the present invention. The method in this embodiment can be combined with each optional solution in the task processing method provided by the foregoing embodiments to further optimize the task processing method provided by the foregoing embodiments. As Figure 4 shown, it specifically includes the following steps:

[0050] S410. Obtain the current delayed task time sequence queue composed of each routing sub-task.

[0051] S420. For each routing sub-task, based on the routing total task to which the current routing sub-task belongs, determine the target array element from each array element of the pre-created routing array.

[0052] S430. Insert the current routing sub-task into the target linked list at the index of the target array element.

[0053] Among them, the routing array is a pre-created array, and each array element in this array is used to point to different linked lists. Specifically, each array element is respectively used to store the addresses of different linked lists, and the linked list corresponding to the array element index can be found through the linked list address of the array element. Exemplarily, the linked list address stored in the array element can be the address of the first linked list element of the linked list.

[0054] In the embodiments of the present invention, in order to reorganize the current delayed task time sequence queue into a current reorganization queue composed of each batch task, a data structure combining an array and a linked list is proposed. Refer to Figure 5 , which is a schematic diagram of a data structure provided by an embodiment of the present invention. As Figure 5 shown, this data structure consists of a routing array ( Figure 5 the multiple vertically arranged array elements in are a routing array) and multiple linked lists. Among them, each array element in the routing array corresponds to a different linked list. Taking the array element M as an example, the array element M can store the address of the first linked list element of the linked list A, so the array element M can index to the linked list A.

[0055] In order to insert multiple routing subtasks in the same routing total task into the same linked list, in the embodiments of the present invention, each routing total task can be associated with different array elements respectively. In this way, multiple routing subtasks in the same routing total task can be inserted into the linked list indexed by the array element associated with this routing total task, so that multiple routing subtasks inserted into the same linked list can be reorganized into a batch task, which is convenient for batch processing of the batch task.

[0056] Taking the current delayed task time sequence queue as Figure 3Taking queue 0 in [[]] as an example, if routing subtask 0 is the first queue element in queue 0, routing subtask 0 can be inserted into the linked list at the index of the first array element of the routing array first. After that, it can be determined whether routing subtask 1, the second queue element in queue 0, belongs to the same routing total task as routing subtask 0. Since the routing total task to which routing subtask 1 belongs corresponds to logistics order A, and the routing total task to which routing subtask 0 belongs corresponds to logistics order C, it can be determined that routing subtask 1 and routing subtask 0 do not belong to the same routing total task, so routing subtask 1 can be inserted into the linked list at the index of the second array element of the routing array. Then, it can be determined whether routing subtask 2, the third queue element in queue 0, belongs to the same routing total task as routing subtask 0 or routing subtask 1. Since the routing total task to which routing subtask 2 belongs corresponds to logistics order B, it can be determined that routing subtask 2 does not belong to the same routing total task as routing subtask 0 and routing subtask 1, so routing subtask 2 can be inserted into the linked list at the index of the third array element of the routing array. After that, it can be determined whether routing subtask 3, the fourth queue element in queue 0, belongs to the same routing total task as routing subtask 0, routing subtask 1, or routing subtask 2. Since the routing total task to which routing subtask 3 belongs corresponds to logistics order B, it can be determined that routing subtask 3 belongs to the same routing total task as routing subtask 2, so routing subtask 3 can be inserted into the same linked list as the insertion position of routing subtask 2, that is, the linked list at the index of the third array element of the routing array. Similarly, the queue elements after the fourth queue element in queue 0 can be processed in sequence.

[0057] Optionally, based on the routing total task to which the current routing subtask belongs, a target array element is determined from each array element of the pre-created routing array, including: determining a first hash value for a first routing identifier based on a first preset hash algorithm; wherein, the first routing identifier is the routing identifier of the routing total task to which the current routing subtask belongs; and determining the target array element corresponding to the first hash value from each array element based on the mapping relationship table between the hash value and the array element.

[0058] The first preset hash algorithm can be a pre-determined hash algorithm used to perform a hash operation on the routing identifier to obtain the first hash value. Exemplarily, the routing identifier of the routing total task can be the waybill number of the logistics order corresponding to the routing total task.

[0059] In the embodiments of the present invention, a mapping relationship table between the hash value and the array element can be determined in advance, and the mapping relationship table includes the corresponding relationship between different hash values and the subscripts of different array elements.

[0060] Taking the current delayed task timing queue as Figure 3 queue 0 in [[]] as an example, in combination with Figure 5For the data structure shown, an embodiment of the present invention provides a method for inserting a routing subtask into a linked list of array element indexes. Refer to Figure 6 , which is a simplified flowchart diagram of a method for inserting a routing subtask into a linked list of array element indexes provided by an embodiment of the present invention. Taking the routing subtask 0 in queue 0 as an example, a hash operation can be performed on the waybill number of the logistics order corresponding to the total routing task to which the routing subtask 0 belongs based on a first preset hash algorithm to obtain a first hash value. By looking up the mapping relationship table between the hash value and the array element, the subscript of the array element M corresponding to the first hash value can be determined, and then the routing subtask 0 can be inserted into the linked list A indexed by the array element M. Similarly, the routing subtask 4, the routing subtask 7, and the routing subtask 9 can be inserted into the linked list A indexed by the array element M, the routing subtask 1, the routing subtask 5, and the routing subtask 6 can be inserted into the linked list B indexed by the array element R, and the routing subtask 2, the routing subtask 3, and the routing subtask 8 can be inserted into the linked list C indexed by the array element N. In addition, in order to ensure that the first hash values of the waybill numbers of different logistics orders are different, in the embodiment of the present invention, methods such as quadratic probing can be used to solve hash conflicts.

[0061] It can be seen that compared with the insertion method of determining the insertion position of the current routing subtask by comparing the current routing subtask with the inserted routing subtasks respectively, the insertion method provided by the embodiment of the present invention for determining the insertion position through a hash algorithm can insert the routing subtask into the linked list of array element indexes more quickly, so as to realize the rapid reorganization of the current delayed task timing queue.

[0062] S440. When it is determined that the target linked list meets the preset cut-off condition, the routing subtasks corresponding to the respective linked list elements of the target linked list are reorganized into batch tasks.

[0063] Among them, the preset cut-off condition may be a condition for reorganizing the routing subtasks corresponding to the respective linked list elements of the target linked list determined in advance.

[0064] Optionally, after inserting the current routing subtask into the target linked list indexed by the target array element, the task processing method provided by the embodiment of the present invention further includes: determining whether the number of the respective linked list elements of the target linked list reaches a preset number; when it is determined that the number of the respective linked list elements of the target linked list reaches the preset number, determining that the target linked list meets the preset cut-off condition.

[0065] Among them, the preset number may be a number determined in advance. Exemplarily, the preset number may be 200.

[0066] Since the linked list is pre-created and the length of the linked list needs to be set when pre-creating the linked list, the number of routable subtasks that can be inserted into the linked list is limited. Then, when the number of sub-orders obtained by splitting a certain logistics order exceeds the length of the linked list, all the routable subtasks in the routable total task corresponding to the logistics order cannot be inserted into the same linked list. At this time, all the routable subtasks need to be regrouped into multiple batch tasks in batches. Based on this, in the implementation of the present invention, after inserting the current routable subtask into the target linked list at the target array element index, the number of each linked list element of the target linked list can be compared with a preset number. If the number of each linked list element of the target linked list reaches the preset number, it can be determined that the target linked list meets the preset cut-off condition. Then, the routable subtasks corresponding to each linked list element of the target linked list at this time are regrouped into a batch task and inserted into the regrouping queue.

[0067] Since there may be a situation where all the routable subtasks in the same routable total task are regrouped into multiple batch tasks in batches, optionally, in the task processing method provided by the embodiment of the present invention, after regrouping the routable subtasks corresponding to each linked list element of the target linked list into batch tasks, an initialization operation can be performed on the target linked list. In this way, the target linked list can be reused in a loop, thereby reducing the number of target linked lists created.

[0068] Optionally, the initialization operation on the target linked list includes: clearing each linked list element of the target linked list and resetting the timer of the target linked list to zero; after inserting the current routable subtask into the target linked list at the target array element index, the task processing method provided by the embodiment of the present invention further includes: determining that the target linked list meets the preset cut-off condition when it is determined that the timing duration of the timer of the target linked list reaches the preset duration.

[0069] Among them, the preset duration can be a pre-determined duration. For example, the average cumulative duration for inserting multiple routable subtasks in the same routable total task into the linked list can be determined according to historical data, and this average cumulative duration can be determined as the preset duration.

[0070] Since it is impossible to determine the time when the last routable subtask in the same routable total task arrives at the routing system, it is also impossible to determine the time when the last routable subtask in the same routable total task is inserted into the linked list. In this way, when the number of sub-orders obtained by splitting a logistics order is less than the length of the linked list, it is impossible to determine the timing for regrouping the routable subtasks corresponding to each linked list element in the linked list into batch tasks. Based on this, as Figure 5As shown in the figure, in the embodiments of the present invention, a timer can be configured for each linked list in advance, which is used to record the duration from the moment when the first linked list element is inserted into the linked list to the current moment. In this way, the routing subtasks corresponding to each linked list element in the linked list can be batch-task reorganized in a timely manner according to the timing duration of the timer, so as to ensure the timeliness of processing batch tasks.

[0071] S450. Insert the reorganized batch tasks into the pre-created reorganization queue in sequence to obtain the current reorganization queue.

[0072] S460. Use the batch task as the scheduling unit of the task thread, and process each batch task separately in the task thread based on the sequence of each batch task in the current reorganization queue.

[0073] Optionally, using the batch task as the scheduling unit of the task thread and processing each batch task separately in the task thread based on the sequence of each batch task in the current reorganization queue includes: determining the current target batch task based on the sequence of each batch task in the current reorganization queue; determining the target storage partition from each candidate storage partition based on the routing identifier of the routing total task corresponding to the target batch task and the number of routing subtasks in the routing total task corresponding to the target batch task; using the batch task as the scheduling unit of the task thread and processing the target batch task in the task thread; wherein, the task content of the target batch task is to store the routing data corresponding to at least one routing subtask in the target batch task into the target storage partition.

[0074] For abnormal logistics orders, the routing subtasks in the corresponding routing total tasks not only have time continuity (the actual routing data of multiple sub-orders of the same logistics order will continuously arrive at the routing subsystem), but also have space continuity (the storage paths of the actual routing data of multiple sub-orders of the same logistics order are the same and need to be saved to the same storage partition for subsequent business queries). Due to the existence of abnormal logistics orders, this space continuity will cause data storage skew. For example, when a large amount of actual routing data of routing subtasks corresponding to abnormal logistics orders is stored in a certain storage partition, the occupancy rate of the storage resources of this storage partition will be much greater than that of other storage partitions. In addition, this space continuity will also cause data access skew. For example, when a large amount of actual routing data of routing subtasks corresponding to abnormal logistics orders is stored in a certain storage partition, the reading and writing of the actual routing data will exhaust the reading and writing capabilities of this storage partition, resulting in a single shard failure, and the repair of the failure requires a certain amount of time, which will cause delays in other data processing.

[0075] Regarding the problems of data storage skew and data access skew caused by spatial continuity, in the embodiments of the present invention, when storing the actual routing data corresponding to all routing subtasks in a batch task, the storage partition corresponding to the batch task can be determined by combining the routing identifier of the routing total task corresponding to the batch task and the number of routing subtasks in the routing total task corresponding to the batch task. In this way, it is possible to evenly store the actual routing data corresponding to the routing subtasks in routing total tasks of different magnitudes in each storage partition, thereby effectively avoiding data storage skew and data access skew.

[0076] Optionally, determining the target storage partition from each candidate storage partition based on the routing identifier of the routing total task corresponding to the target batch task and the number of routing subtasks in the routing total task corresponding to the target batch task includes: determining a second hash value based on a second preset hash algorithm, the routing identifier of the routing total task corresponding to the target batch task, and the number of routing subtasks in the routing total task corresponding to the target batch task; and determining the target storage partition corresponding to the second hash value from each candidate storage partition based on the mapping relationship table between the hash value and the storage partition.

[0077] Among them, the second preset hash algorithm can be a preset hash algorithm, which is used to perform hash operations on the routing identifier and the number of routing subtasks in the routing total task respectively to obtain two hash values, and combining these two hash values can determine the storage partition corresponding to the target batch task.

[0078] In the embodiments of the present invention, the mapping relationship table between the hash value and the storage partition can be determined in advance, and the mapping relationship table includes the corresponding relationship between different hash values and the partition identifiers of different storage partitions.

[0079] In a possible implementation manner, embodiments of the present invention may pre-divide the total routing task into multiple task levels. For example, the total routing task with the number of routing subtasks between 1 and 10 is divided into the first level, the total routing task with the number of routing subtasks between 11 and 100 is divided into the second level, the total routing task with the number of routing subtasks between 101 and 1000 is divided into the third level, the total routing task with the number of routing subtasks between 1001 and 3000 is divided into the fourth level, the total routing task with the number of routing subtasks between 3001 and 10000 is divided into the fifth level, and the total routing task with the number of routing subtasks above 10000 is divided into the sixth level. For the target batch task, the number of routing subtasks in the total routing task corresponding to the target batch task can be hashed by a second preset hash algorithm to obtain a hash value B. Then, the task level corresponding to the target batch task can be determined according to the mapping relationship table between the hash value B and the task levels of the total routing task. Similarly, each batch task can be divided into different task levels. Then, when the number of batch tasks divided in the task level corresponding to the target batch task reaches a certain amount, within the task level corresponding to the target batch task, the routing identifier of the total routing task corresponding to the target batch task can be hashed by a second preset hash algorithm to obtain a hash value A, and according to the mapping relationship table between the hash value A and the storage partitions, the target storage partition corresponding to the hash value A can be determined from each candidate storage partition. Since the storage partitions corresponding to each batch task are determined within each task level, the actual routing data corresponding to each batch task within each task level will be evenly stored in each candidate storage partition. And the magnitudes of the total routing tasks corresponding to the batch tasks within each task level are roughly the same. Therefore, it can be ensured that all the actual routing data is evenly stored in each storage partition, so as to effectively avoid data storage skew and data access skew.

[0080] In an embodiment of the present invention, based on the foregoing embodiment, a data structure combining an array and a linked list is proposed. Specifically, a routing array can be pre-created, and each array element of the routing array is used to point to a different linked list, and one array element indexes one linked list, and the linked list can be used to store routing subtasks. For each routing subtask in the current delayed task time sequence queue, each routing subtask can be inserted into the linked list in turn in the following manner: based on the routing total task to which the current routing subtask belongs, determine the target array element from each array element of the pre-created routing array; insert the current routing subtask into the target linked list indexed by the target array element. In this way, it can be ensured that multiple routing subtasks in the same routing total task are inserted into the same linked list. Then, when a certain linked list meets the preset cut-off condition, the routing subtasks corresponding to the respective linked list elements of the linked list can be reorganized into a batch task. It can be seen that in the embodiment of the present invention, through the data structure combining an array and a linked list, the current delayed task time sequence queue can be reorganized into a current reorganization queue composed of each batch task, so that batch processing of multiple routing subtasks in each batch task can be realized, and further, the concurrent processing ability of the routing subsystem can be improved, and the stability of the operation of the routing subsystem can be ensured.

[0081] It should be noted that the task processing method proposed in the embodiment of the present invention and the foregoing embodiment belong to the same inventive concept. Technical details not described in detail in this embodiment can be referred to the foregoing embodiment, and the beneficial effects of the foregoing embodiment are also applicable in this embodiment.

[0082] Figure 7 It is a schematic structural diagram of a task processing device provided in an embodiment of the present invention. The device includes: an acquisition module 710, a reorganization module 720, and a processing module 730.

[0083] Exemplarily, the acquisition module 710 can execute S210 in the above method embodiment, the reorganization module 720 can execute S220 in the above method embodiment, and the processing module 730 can execute S230 in the above method embodiment.

[0084] Specifically, the acquisition module 710 is used to acquire a current delayed task time sequence queue composed of each routing subtask; the reorganization module 720 is used to perform queue element reorganization on the current delayed task time sequence queue according to the routing total tasks to which the respective routing subtasks belong, so as to obtain a current reorganization queue composed of each batch task; wherein, for each batch task, the current batch task includes at least one routing subtask in the same routing total task; the processing module 730 is used to use the batch task as a scheduling unit of the task thread, and based on the sequence of each batch task in the current reorganization queue, process each batch task separately in the task thread.

[0085] Optionally, in a possible implementation, the recombination module 720 is specifically configured to: for each routing subtask, determine a target array element from each array element of a pre-created routing array based on the routing total task to which the current routing subtask belongs; insert the current routing subtask into a target linked list at the index of the target array element; when it is determined that the target linked list meets a preset deadline condition, recombine the routing subtasks corresponding to the respective linked list elements of the target linked list into a batch task; and sequentially insert the recombined batch tasks into a pre-created recombination queue to obtain the current recombination queue.

[0086] Optionally, in another possible implementation, the recombination module 720 is further specifically configured to: determine whether the number of the respective linked list elements of the target linked list reaches a preset number; when it is determined that the number of the respective linked list elements of the target linked list reaches the preset number, determine that the target linked list meets the preset deadline condition.

[0087] Optionally, in another possible implementation, the task processing device provided in the embodiments of the present invention further includes an initialization module; the initialization module is configured to perform an initialization operation on the target linked list after the recombination module 720 recombines the routing subtasks corresponding to the respective linked list elements of the target linked list into a batch task.

[0088] Optionally, in another possible implementation, the initialization module is specifically configured to: clear each linked list element of the target linked list and set the timer of the target linked list to zero; the processing module 730 is further configured to: after the recombination module 720 inserts the current routing subtask into the target linked list at the index of the target array element, when it is determined that the timing duration of the timer of the target linked list reaches a preset duration, determine that the target linked list meets the preset deadline condition.

[0089] Optionally, in another possible implementation, the recombination module 720 is further specifically configured to: determine a first hash value for a first routing identifier based on a first preset hash algorithm; where the first routing identifier is the routing identifier of the routing total task to which the current routing subtask belongs; and determine the target array element corresponding to the first hash value from each array element based on a mapping relationship table between the hash value and the array element.

[0090] Optionally, in another possible implementation, the processing module 730 is specifically configured to:

[0091] Determine the current target batch task based on the sequence of each batch task in the current reorganization queue; determine the target storage partition from each candidate storage partition based on the routing identifier of the routing total task corresponding to the target batch task and the number of routing subtasks in the routing total task corresponding to the target batch task; use the batch task as the scheduling unit of the task thread, and process the target batch task in the task thread; wherein, the task content of the target batch task is to store the routing data corresponding to at least one routing subtask in the target batch task into the target storage partition.

[0092] Optionally, in another possible implementation manner, the processing module 730 is further specifically configured to: determine a second hash value based on the second preset hash algorithm, the routing identifier of the routing total task corresponding to the target batch task, and the number of routing subtasks in the routing total task corresponding to the target batch task; determine the target storage partition corresponding to the second hash value from each candidate storage partition based on the mapping relationship table of the hash value and the storage partition.

[0093] Optionally, in another possible implementation manner, the obtaining module 710 is specifically configured to: obtain a routing task lock when receiving a target routing subtask; determine whether the target routing subtask is an abnormal routing task based on the number of routing subtasks in the routing total task to which the target routing subtask belongs when it is determined that the routing task lock has not been successfully obtained; and insert the target routing subtask into the previous delayed task time sequence queue to obtain the current delayed task time sequence queue when it is determined that the target routing subtask is an abnormal routing task.

[0094] The task processing device provided by the embodiments of the present invention belongs to the same inventive concept as the task processing methods provided by the foregoing embodiments. Details not described in detail in the embodiments of the task processing device may refer to the relevant content of the foregoing method embodiments, and the corresponding beneficial effects may also refer to the beneficial effect analysis of the foregoing method embodiments.

[0095] Figure 8 It is a schematic structural diagram of a task processing device provided by an embodiment of the present invention. Figure 8 The block diagram of an exemplary task processing device 12 suitable for implementing the embodiments of the present invention is shown. Figure 8 The shown task processing device 12 is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention.

[0096] Such as Figure 8As shown, the task processing device 12 is embodied in the form of a general computing device. The components of the task processing device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples the different system components (including the system memory 28 and the processing unit 16).

[0097] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. By way of example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0098] The task processing device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the task processing device 12, including volatile and nonvolatile media, removable and non-removable media.

[0099] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory (i.e., Figure 8 the cache in). The task processing device 12 may further include other removable / non-removable, volatile / nonvolatile computer system storage media. By way of example only, a storage system 34 may be used for reading and writing on non-removable, nonvolatile magnetic media ( Figure 8 not shown, typically referred to as a "hard disk drive"). Although Figure 8 not shown in, a disk drive for reading and writing on removable nonvolatile disks (such as a "floppy disk") and an optical disk drive for reading and writing on removable nonvolatile optical disks (such as a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data media interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the embodiments of the present invention.

[0100] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods described in the embodiments of the present invention.

[0101] The task processing device 12 can also communicate with one or more external devices 14 (such as keyboards, pointing devices, displays 24, etc.), and can also communicate with one or more devices that enable users to interact with the task processing device 12, and / or communicate with any device that enables the task processing device 12 to communicate with one or more other computing devices (such as network cards, modems, etc.). This communication can be carried out through the input / output (I / O) interface 22. Moreover, the task processing device 12 can also communicate with one or more networks (such as local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through the network adapter 20. As Figure 8 shown, the network adapter 20 communicates with other modules of the task processing device 12 through the bus 18. It should be understood that although Figure 8 not shown in the figure, other hardware and / or software modules can be used in combination with the task processing device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0102] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing the steps of the task processing method provided by the embodiments of the present invention. The method includes: obtaining a current delayed task time sequence queue composed of each routing subtask; according to the routing master tasks to which each routing subtask belongs respectively, reorganizing the queue elements of the current delayed task time sequence queue to obtain a current reorganized queue composed of each batch task; wherein, for each batch task, the current batch task includes at least one routing subtask in the same routing master task; using the batch task as the scheduling unit of the task thread, and based on the sequence of each batch task in the current reorganized queue, processing each batch task separately in the task thread.

[0103] Of course, those skilled in the art can understand that the processor can also implement the technical solutions of the task processing methods provided by any embodiment of the present invention.

[0104] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the steps of a task processing method provided in the foregoing embodiments of the present invention. The method includes: obtaining a current delayed task time sequence queue composed of each routing subtask; reorganizing the queue elements of the current delayed task time sequence queue according to the routing total tasks to which each routing subtask belongs respectively, to obtain a current reorganization queue composed of each batch task; wherein, for each batch task, the current batch task includes at least one routing subtask in the same routing total task; using the batch task as the scheduling unit of the task thread, and based on the sequence of each batch task in the current reorganization queue, processing each batch task respectively in the task thread.

[0105] The computer storage medium of the embodiments of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, apparatus, or device.

[0106] The computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or combined with an instruction execution system, apparatus, or device.

[0107] The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.

[0108] Computer program code for performing the operations of the present invention may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or task processing device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0109] Those of ordinary skill in the art should understand that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Optionally, they can be implemented using program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them can be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0110] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A task processing method, characterized in that, the method includes: Obtaining a current delayed task time sequence queue composed of each routing subtask; According to the routing master tasks to which the respective routing subtasks belong, reorganizing the queue elements of the current delayed task time sequence queue to obtain a current reorganization queue composed of each batch task; wherein, for each batch task, the current batch task includes at least one routing subtask in the same routing master task; Taking the batch task as the scheduling unit of the task thread, and based on the sequence of the respective batch tasks in the current reorganization queue, processing the respective batch tasks in the task thread.

2. The task processing method according to claim 1, characterized in that, the step of reorganizing the queue elements of the current delayed task time sequence queue according to the routing master tasks to which the respective routing subtasks belong to obtain a current reorganization queue composed of each batch task includes: For each routing subtask, based on the routing master task to which the current routing subtask belongs, determining a target array element from each array element of a pre-created routing array; Inserting the current routing subtask into the target linked list indexed by the target array element; When it is determined that the target linked list meets a preset cut-off condition, reorganizing the routing subtasks corresponding to the respective linked list elements of the target linked list into batch tasks; Inserting the batch tasks obtained by reorganization into a pre-created reorganization queue in sequence to obtain the current reorganization queue.

3. The task processing method according to claim 2, characterized in that, after inserting the current routing subtask into the target linked list indexed by the target array element, the method further includes: Determining whether the number of the respective linked list elements of the target linked list reaches a preset number; When it is determined that the number of the respective linked list elements of the target linked list reaches the preset number, determining that the target linked list meets the preset cut-off condition.

4. The task processing method according to claim 2, characterized in that, after reorganizing the routing subtasks corresponding to the respective linked list elements of the target linked list into batch tasks, the method further includes: Performing an initialization operation on the target linked list.

5. The task processing method according to claim 4, characterized in that, the performing an initialization operation on the target linked list includes: performing a clearing operation on the respective linked list elements of the target linked list and performing a zeroing operation on the timer of the target linked list; after inserting the current routing subtask into the target linked list indexed by the target array element, the method further includes: when it is determined that the timing duration of the timer of the target linked list reaches a preset duration, determining that the target linked list meets the preset cut-off condition.

6. The task processing method according to claim 2, characterized in that, the determining a target array element from each array element of a pre-created routing array based on the routing master task to which the current routing subtask belongs includes: Based on a first preset hash algorithm, determining a first hash value for a first routing identifier; wherein, the first routing identifier is the routing identifier of the routing master task to which the current routing subtask belongs; Based on the mapping relationship table for hash values and array elements, determine the target array element corresponding to the first hash value from each of the array elements.

7. The task processing method according to claim 1, wherein, using the batch task as the scheduling unit of the task thread, and based on the sequence of the batch tasks in the current reorganization queue, processing each of the batch tasks in the task thread, including: determining the current target batch task based on the sequence of the batch tasks in the current reorganization queue; determining the target storage partition from each candidate storage partition based on the routing identifier of the routing total task corresponding to the target batch task and the number of routing subtasks in the routing total task corresponding to the target batch task; using the batch task as the scheduling unit of the task thread, and processing the target batch task in the task thread; wherein, the task content of the target batch task is to store the routing data corresponding to at least one routing subtask in the target batch task into the target storage partition.

8. The task processing method according to claim 7, wherein, the determining the target storage partition from each candidate storage partition based on the routing identifier of the routing total task corresponding to the target batch task and the number of routing subtasks in the routing total task corresponding to the target batch task includes: determining a second hash value based on a second preset hash algorithm, the routing identifier of the routing total task corresponding to the target batch task, and the number of routing subtasks in the routing total task corresponding to the target batch task; determining the target storage partition corresponding to the second hash value from each of the candidate storage partitions based on the mapping relationship table for hash values and storage partitions.

9. The task processing method according to any one of claims 1-8, wherein, the obtaining the current delayed task time sequence queue composed of each routing subtask includes: obtaining a routing task lock when receiving a target routing subtask; when it is determined that the routing task lock is not successfully obtained, determining whether the target routing subtask is an abnormal routing task based on the number of routing subtasks in the routing total task to which the target routing subtask belongs; when it is determined that the target routing subtask is the abnormal routing task, inserting the target routing subtask into the previous delayed task time sequence queue to obtain the current delayed task time sequence queue.

10. A task processing device, wherein, comprising: an obtaining module, configured to obtain the current delayed task time sequence queue composed of each routing subtask; a reorganization module, configured to reorganize the queue elements of the current delayed task time sequence queue according to the routing total tasks to which the routing subtasks belong respectively, to obtain the current reorganization queue composed of each batch task; wherein, for each batch task, the current batch task includes at least one routing subtask in the same routing total task; A processing module, configured to use a batch task as a scheduling unit of a task thread, and process each of the batch tasks in the task thread respectively based on the sequence of the batch tasks in the current reorganization queue.

11. A task processing device, characterized in that the task processing device includes: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the task processing method according to any one of claims 1-9.

12. A computer-readable storage medium, on which a computer program is stored, characterized in that when the program is executed by a processor, the task processing method according to any one of claims 1-9 is implemented.