A task processing method, apparatus, device, and storage medium

By constructing a tree structure and monitoring the status of task nodes, and utilizing the RxJava reactive programming framework, efficient and precise progress control for batch processing of tasks was achieved, solving the problem of difficulty in statistically analyzing task completion status in a multi-threaded environment.

CN114237849BActive Publication Date: 2026-01-02SHENZHEN KEMANDA INTELLIGENT MANAGEMENT SCI &TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111538685.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2026-01-02
Estimated Expiration
2041-12-15

AI Technical Summary

Technical Problem

In a multi-threaded environment, the logic of batch processing of tasks is not strong, resulting in low conversion efficiency and difficulty in accurately measuring the task completion status.

Method used

A tree structure is used to construct task nodes. The task execution progress is determined by monitoring the status of the task nodes. The RxJava reactive programming framework is used to implement multi-threaded processing of batched subtasks and progress statistics.

Benefits of technology

It improves the efficiency of batch processing of tasks, accurately controls the progress of task execution, and solves the problem of difficulty in statistically analyzing the task completion status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114237849B_ABST
    Figure CN114237849B_ABST
Patent Text Reader

Abstract

The application discloses a task processing method and device, equipment and a storage medium, comprising: obtaining a target task, constructing a tree structure to construct a task node for processing the target task based on batch requirements to obtain a tree task structure representing a batch processing process of the target task; the root node of the tree task structure corresponds to the target task, and the child node of the tree task structure corresponds to the subtask of the target task; monitoring the task state of each task node in the tree structure, and determining the execution progress of the target task according to the task state of each task node. The application realizes batch logic by batching the target task according to the tree structure according to the target requirement, and determines the execution progress of the target task according to the task state of each task node to realize progress statistical logic, which can accurately control the task execution progress on the basis of improving the task batch processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and in particular to a task processing method and device, equipment and storage medium. BACKGROUND

[0002] With the development of information technology, the data processed by computers is of larger and larger magnitude, and large-scale data needs to be processed in batches in a multi-threaded environment. For example, for data conversion services, the conversion service plays a role of converting data formats between different systems, and the data may be processed and converted multiple times. In this process, on the one hand, the conversion performance is low due to the weak logicality of batch processing of tasks. On the other hand, it is difficult to count the completion status of the entire task after multiple sub-task operations under the original business logic code, because in a multi-threaded environment, the completion status of each thread needs to be counted, and the entire task is completed only when all sub-tasks are completed.

[0003] Therefore, how to perform batch processing of tasks under the premise of ensuring simplicity and strong usability is a technical problem to be solved by those skilled in the art. SUMMARY

[0004] Therefore, the purpose of the present application is to provide a task processing method, device, equipment and storage medium, which can accurately control the execution progress of tasks on the basis of improving the efficiency of batch processing of tasks. The specific scheme is as follows:

[0005] The first aspect of the present application provides a task processing method, comprising:

[0006] obtaining a target task, and constructing a task node for processing the target task by constructing a tree structure based on batch requirements to obtain a tree task structure representing a batch processing process of the target task; wherein the root node of the tree task structure corresponds to the target task, and the child node of the tree task structure corresponds to the sub-task of the target task;

[0007] monitoring the task state of each task node in the tree structure to determine the execution progress of the target task according to the task state of each task node.

[0008] Optionally, the task node for processing the target task is constructed by constructing a tree structure based on batch requirements, comprising:

[0009] creating the task node and obtaining the sub-tasks of the target task;

[0010] batch processing the obtained sub-tasks according to batch requirements to obtain batch sub-tasks corresponding to different batches of batch sub-tasks;

[0011] constructing a new task node in a tree structure and distributing the batch subtasks to the new task node.

[0012] Optionally, the task state of each task node in the tree structure is monitored to determine the execution progress of the target task according to the task state of each task node, including:

[0013] the completion identifier of the task in each task node in the tree structure, the batch quantity, and the child node state of the task node are monitored; wherein the completion identifier is used to determine whether the last batch of task batches corresponding to the task node is completed, the batch quantity is used to determine whether there is an uncompleted batch quantity in the task node, and the child node state of the task node is used to determine whether the batch subtasks of each child node are completed.

[0014] Optionally, the execution progress of the target task is determined according to the task state of each task node, including:

[0015] If the completion identifier of the task in the task node indicates that the last batch of task batches has been completed, the batch quantity indicates that there is no uncompleted batch quantity in the task node, and each child node state of the task node indicates that the batch subtasks have been completed, it is determined that the target task is executed and completed.

[0016] Optionally, the new task node is constructed in a tree structure and the batch subtasks are distributed to the new task node, including:

[0017] When a batch of batch subtasks is split, the batch subtasks are sent to a new task node constructed in a tree structure;

[0018] It is determined whether the batch subtasks are the last batch of completed batches, and if so, the completion identifier of the task node is set to a state indicating that the last batch of task batches of the subtask has been completed.

[0019] Optionally, after the batch subtasks are sent to the new task node constructed in a tree structure, the method further includes:

[0020] The batch quantity of the task node is increased by one quantity unit;

[0021] When the task node receives the instruction returned by the child node that the batch subtask execution is completed, the batch quantity of the task node is reduced by one quantity unit.

[0022] Optionally, the task nodes for processing the target task are constructed in a tree structure based on the batch requirement to obtain a tree task structure representing a batch processing procedure of the target task, including:

[0023] The task nodes for processing the target task are constructed in a binary tree based on the batch requirement to obtain the tree task structure representing the batch processing procedure of the target task by using an rxjava reactive programming framework.

[0024] The second aspect of the present application provides a task processing apparatus, including:

[0025] A task batching module is configured to acquire a target task, and construct task nodes for processing the target task in a tree structure based on a batch requirement to obtain a tree task structure representing a batch processing procedure of the target task; wherein a root node of the tree task structure corresponds to the target task, and a child node of the tree task structure corresponds to a subtask of the target task.

[0026] A state statistics module is configured to monitor task states of each task node in the tree structure to determine an execution progress of the target task according to the task states of each task node.

[0027] The third aspect of the present application provides an electronic device including a processor and a memory; wherein the memory is configured to store a computer program, the computer program is loaded and executed by the processor to implement the foregoing task processing method.

[0028] The fourth aspect of the present application provides a computer readable storage medium, the computer readable storage medium stores computer executable instructions, the computer executable instructions are loaded and executed by a processor to implement the foregoing task processing method.

[0029] Implementing the embodiments of the present application will have the following beneficial effects:

[0030] After the above task processing method is adopted, a target task is acquired first, and a task node for processing the target task is constructed in a tree structure based on batch requirements to obtain a tree task structure representing a batch processing process of the target task; wherein a root node of the tree task structure corresponds to the target task, and a child node of the tree task structure corresponds to a subtask of the target task; then, task states of each task node in the tree structure are monitored to determine an execution progress of the target task according to the task states of each task node. It can be seen that the present application realizes batch logic by batching the target task according to a tree structure based on target requirements, and realizes progress statistical logic by determining the execution progress of the target task according to the task states of each task node, so as to accurately control the execution progress of the task on the basis of improving the task batching processing efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0032] Wherein:

[0033] Figure 1 A task processing method flowchart provided by the present application;

[0034] Figure 2 A tree task structure schematic diagram provided by the present application;

[0035] Figure 3 A task node task state determination flowchart provided by the present application;

[0036] Figure 4 A task processing device structure schematic diagram provided by the present application;

[0037] Figure 5 A task processing electronic equipment structure diagram provided by the present application. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0039] In the data conversion service process, on the one hand, the conversion performance efficiency is low due to the weak logicality of batch processing of tasks. On the other hand, it is difficult to count the completion state of the entire task after multiple subtask operations under the original business logic code, because in a multi-threaded environment, the completion state of each thread needs to be counted, and the entire task is completed only when all subtasks are completed. In view of the above technical defects, the present application provides a task processing scheme, which realizes batch processing logic by batching the target task according to a tree structure according to the target requirement, and realizes progress counting logic by judging the execution progress of the target task according to the task state of each task node, which can accurately control the task execution progress on the basis of improving the efficiency of batch processing of tasks.

[0040] Figure 1 A task processing method flowchart is provided for the embodiments of the present application. Referring to FIG. Figure 1 The task processing method comprises:

[0041] S11: Obtain a target task, and construct a task node for processing the target task by constructing a tree structure to obtain a tree task structure representing the batch processing process of the target task based on batch requirements; wherein the root node of the tree task structure corresponds to the target task, and the child node of the tree task structure corresponds to the subtask of the target task.

[0042] In this embodiment, the target task is first obtained, and then the task node for processing the target task is constructed by constructing a tree structure to obtain a tree task structure representing the batch processing process of the target task based on batch requirements. As shown in FIG. Figure 2 The tree structure data structure is a collection of data elements that have one or more specific relationships with each other, and the binary tree is a typical tree structure. It is not difficult to understand that the batch subtask is similar to the hierarchical vertical expansion of the binary tree, and each node corresponds to a batch subtask, and the subtask can continue to be batched downward. Specifically, the task node is first created, and the subtasks of the target task are obtained, then the obtained subtasks are batched according to the batch requirements to obtain batch subtasks corresponding to the batch subtasks in different batches, and finally the new task node is constructed by constructing a tree structure, and the batch subtasks are distributed to the new task node.

[0043] The step is the implementation of the batch logic, in order to adapt to the existing business logic framework code, to achieve the original logic code in multiple batch subtasks multithreading processing with simple code, can be based on batch demand by constructing binary tree way using rxjava reactive programming framework to process the target task task node to get the tree-shaped task structure representing the batch processing process of the target task. That is, the batch logic is mainly based on rxjava reactive programming to achieve, using its observer mode and its cache paging transmission function to achieve batch subscription logic, and using thread pool in subscription processing logic to achieve asynchronous processing. Based on rxjava reactive programming, the original logic code can be batched and multi-threaded, and the batch subtask completion progress can be calculated based on the binary tree.

[0044] The embodiment further implements progress statistics logic based on the implementation of the batch logic. The progress statistics logic is mainly implemented by the task state of each task node. Since the number of batches that each task node needs to be processed is unknown, the number of batches needs to be confirmed according to the actual situation. The embodiment implements by recording the number of batches of each node, the identification of the completion of the last batch, and how many batch subnodes are hung under the node. That is, the task state includes the completion identification, the batch number, and the child node state of the task node for monitoring.

[0045] On this basis, the subtask is split and then transmitted, that is, when a batch of batch subtasks is obtained by splitting, the batch subtasks are sent to the new task node constructed by constructing a tree structure. At the same time, it is judged whether the batch subtask is the last batch of batch completion. If so, the completion identification of the task node is set to a state representing that the subtask has completed the last batch of task batch. For example, after the last batch is transmitted, the last batch completion identification reachFinalBatch is set to true. At the same time, after the task is transmitted, the batch number of the task node needs to be increased by one unit. When the task node child node returns the batch subtask execution completion instruction, the batch number of the task node is reduced by one unit. For example, before processing each batch, the remaining unfinished batch number leftBatch is increased by 1, and after processing a batch, the unfinished batch number leftBatch is reduced by 1.

[0046] It is to be noted that the construction and processing of the task node is a process of cyclic execution. If the batch sub-task processing continues in the process of processing the task, a new sub-task node is created and added to the child node list of the parent task node, and the above steps are re-executed until all tasks are finally processed. The code implementation of the batch logic in this embodiment is as follows:

[0047]

[0048]

[0049] S12: Monitor the task state of each task node in the tree structure to determine the execution progress of the target task according to the task state of each task node.

[0050] In this embodiment, after the batch logic is implemented, the task state of each task node in the tree structure is monitored to determine the execution progress of the target task according to the task state of each task node. Specifically, the completion identifier of the task in each task node in the tree structure, the batch quantity, and the child node state of the task node are monitored. The completion identifier is used to determine whether the last batch of tasks is completed by the task node corresponding to the sub-task, the batch quantity is used to determine whether there is an uncompleted batch quantity in the task node, and the child node state of the task node is used to determine whether the batch sub-task of each child node is completed.

[0051] Further, if the completion identifier of the task in the task node indicates that the last batch of tasks is completed, the batch quantity indicates that there is no uncompleted batch quantity in the task node, and each child node state of the task node indicates that the batch sub-task is completed, it is determined that the target task is executed and completed. The progress statistics logic is mainly based on the principle of tree structure. Each batch node records the batch quantity, the last batch completion identifier, and the child node list of the node, etc. When statistics is performed, the state of each node is traversed from the root node to determine whether it is completed. The process uses a recursive algorithm. Specifically, as shown in the following code, first, it is determined whether the last batch completion identifier is true, then it is determined whether the uncompleted data quantity of the current node is 0, and finally it is detected whether each child node in the child node list is in a completed state. Figure 3

[0052] The code implementation of the progress statistics logic in this embodiment is as follows:

[0053]

[0054]

[0055] It can be seen that the embodiment of the application first acquires a target task, and constructs a task node for processing the target task based on a batching requirement by means of a tree structure to obtain a tree task structure representing a batching process of the target task; wherein a root node of the tree task structure corresponds to the target task, and a child node of the tree task structure corresponds to a subtask of the target task; then the task state of each task node in the tree structure is monitored to determine the execution progress of the target task according to the task state of each task node. The embodiment of the application realizes batching logic by batching the target task according to a tree structure according to a target requirement, and realizes progress statistical logic by determining the execution progress of the target task according to the task state of each task node, which can accurately control the execution progress of the task on the basis of improving the efficiency of task batching processing.

[0056] Referring to Figure 4 The embodiment of the application also discloses a task processing device, which comprises:

[0057] The task batching module 11 is configured to acquire a target task, and construct a task node for processing the target task based on a batching requirement by means of a tree structure to obtain a tree task structure representing a batching process of the target task; wherein a root node of the tree task structure corresponds to the target task, and a child node of the tree task structure corresponds to a subtask of the target task.

[0058] The state statistical module 12 is configured to monitor the task state of each task node in the tree structure to determine the execution progress of the target task according to the task state of each task node.

[0059] It can be seen that the embodiment of the application first acquires a target task, and constructs a task node for processing the target task based on a batching requirement by means of a tree structure to obtain a tree task structure representing a batching process of the target task; wherein a root node of the tree task structure corresponds to the target task, and a child node of the tree task structure corresponds to a subtask of the target task; then the task state of each task node in the tree structure is monitored to determine the execution progress of the target task according to the task state of each task node. The embodiment of the application realizes batching logic by batching the target task according to a tree structure according to a target requirement, and realizes progress statistical logic by determining the execution progress of the target task according to the task state of each task node, which can accurately control the execution progress of the task on the basis of improving the efficiency of task batching processing.

[0060] In some embodiments, the task batching module 11 specifically includes:

[0061] A creating unit configured to create the task node and obtain the subtasks of the target task;

[0062] A splitting unit configured to split the obtained subtasks according to the batching requirement to obtain different batches of the batched subtasks corresponding to the batched subtasks;

[0063] A transmitting unit configured to construct a new task node by constructing a tree structure and distribute the batched subtasks to the new task node.

[0064] In some embodiments, the task batching module 11 is specifically configured to obtain the tree-shaped task structure representing the batching process of the target task by constructing a binary tree using the rxjava reactive programming framework based on the batching requirement.

[0065] In some embodiments, the transmitting unit is specifically configured to, when a batch of batched subtasks is obtained, send the batched subtasks to a new task node constructed by constructing a tree structure, and determine whether the batched subtasks are the last batch of batched subtasks. If yes, set the completion identifier of the task node to a state representing that the subtasks have completed the last batch of task batching.

[0066] In some embodiments, the task processing apparatus further includes:

[0067] A batching number setting module configured to increase the batching number of the task node by one unit, and decrease the batching number of the task node by one unit when receiving an instruction returned by a child node of the task node that the execution of the batched subtasks is completed.

[0068] In some embodiments, the state statistics module 12 specifically includes:

[0069] A monitoring unit configured to monitor the completion identifier, the batching number, and the child node state of the task node in the tree structure. The completion identifier is used to determine whether the subtasks corresponding to the task node have completed the last batch of task batching. The batching number is used to determine whether the task node has an uncompleted batching number. The child node state of the task node is used to determine whether the batched subtasks of each child node are completed.

[0070] The determining unit is configured to determine that the target task execution is completed if the completion identification of the task in the task node represents that the last batch of tasks is completed, the batch quantity represents that there is no uncompleted batch quantity in the task node, and the state of each child node of the task node represents that the batch sub-task is completed.

[0071] Further, the embodiment of the present application further provides an electronic device. Figure 5 The electronic device 20 shown in the figure is a structural diagram according to an exemplary embodiment, and the content in the figure cannot be considered as any limitation on the use range of the present application.

[0072] Figure 5 The electronic device 20 provided by the embodiment of the present application is shown in a structural diagram. The electronic device 20 can specifically include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is configured to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the related steps in the task processing method disclosed in any of the preceding embodiments.

[0073] In the embodiment, the power supply 23 is configured to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not limited here; the input / output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited here.

[0074] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon can include an operating system 221, a computer program 222 and data 223, etc., and the storage mode can be temporary storage or permanent storage.

[0075] The operating system 221 is configured to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to realize the operation and processing of the processor 21 on the mass data 223 in the memory 22, and the operating system 221 can be Windows Server, Netware, Unix, Linux, etc. The computer program 222 can further include computer programs for completing other specific work in addition to the computer programs for completing the task processing method executed by the electronic device 20 disclosed in any of the preceding embodiments. The data 223 can include target tasks collected by the electronic device 20.

[0076] Further, the embodiment of the present application further discloses a storage medium, wherein the storage medium stores a computer program, and the computer program is loaded and executed by a processor to realize the task processing method steps disclosed by any of the foregoing embodiments.

[0077] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed by the embodiments, the description is relatively simple because it corresponds to the method disclosed by the embodiments. The relevant parts can be referred to the description of the method.

[0078] Finally, it should be noted that, in this document, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or equipment including the element.

[0079] The task processing method, device, equipment and storage medium provided by the present application are introduced in detail above, and the principle and implementation manner of the present application are described by applying specific examples. The above embodiment is only used to help understand the method and core idea of the present application; meanwhile, for the general technical personnel in the art, according to the idea of the present application, the specific implementation manner and application range can be changed. The above disclosure is only the preferred embodiment of the present application, and of course cannot limit the scope of the right of the present application. Therefore, the equivalent changes made according to the claims of the present application still belong to the scope covered by the present application.

Claims

1. A task processing method, characterized in that, include: A target task is obtained, and a tree-structured task structure representing the batch processing process of the target task is constructed based on batch requirements. The root node of the tree-structure corresponds to the target task, and the child nodes correspond to the subtasks of the target task. Each node represents a batch subtask, which can be further batched. The construction of the task nodes based on the batch requirements includes: creating the task nodes and obtaining the subtasks of the target task; batch processing the obtained subtasks according to the batch requirements to obtain different batches of batch subtasks corresponding to the batch subtasks; and constructing new task nodes using a tree structure and distributing the batch subtasks to the new task nodes. The task status of each task node in the tree structure is monitored to determine the execution progress of the target task based on the task status of each task node. The batching logic is implemented based on RxJava reactive programming. It utilizes the observer pattern and the cached pagination emission function to implement the batch subscription logic. In the subscription processing logic, a thread pool is used to implement asynchronous processing. Based on RxJava reactive programming, the batch subtasks are processed in a multi-threaded manner under the original logic code. At the same time, the progress calculation of the batch subtasks is implemented based on the tree task structure. The step of monitoring the task status of each task node in the tree structure to determine the execution progress of the target task based on the task status of each task node includes: The completion identifier, batch quantity, and child node status of each task node in the tree structure are monitored; wherein, the completion identifier is used to determine whether the subtask corresponding to the task node has completed the last batch of task batching, the batch quantity is used to determine whether there is an incomplete batch quantity of the task node, and the child node status of the task node is used to determine whether the batched subtasks of each child node have been completed. If the completion identifier of the task in the task node indicates that the last batch of tasks has been completed, the batch number indicates that there are no uncompleted batches in the task node, and the status of each child node of the task node indicates that the batch of sub-tasks has been completed, then the target task is determined to be completed. The step of constructing new task nodes by building a tree structure and distributing the batched subtasks to the new task nodes includes: When a batch of subtasks is obtained by splitting, the batch of subtasks is sent to a new task node constructed by building a tree structure; Determine whether the batched subtask is the last batch to be completed. If so, set the completion flag of the task node to indicate that the subtask has completed the last batch of task batches. After sending the batched subtasks to the new task nodes constructed by building a tree structure, the method further includes: Increase the batch size of the task node by one unit; When the task node receives an instruction from its child node indicating that the batch of subtasks has been completed, the batch size of the task node is reduced by one unit.

2. A task processing device, characterized in that, include: The task batching module is used to acquire a target task and, based on batching requirements, construct task nodes for processing the target task in a tree structure to obtain a tree-shaped task structure representing the batching process of the target task. The root node of the tree-shaped task structure corresponds to the target task, and the child nodes of the tree-shaped task structure correspond to the subtasks of the target task. Each node is equivalent to a batched subtask, and the subtasks can be further batched. Constructing task nodes for processing the target task based on batching requirements in a tree structure includes: creating the task node and acquiring the subtasks of the target task; batching the acquired subtasks according to the batching requirements to obtain different batches of batched subtasks corresponding to the batched subtasks; constructing new task nodes by building a tree structure and distributing the batched subtasks to the new task nodes. A status statistics module is used to monitor the task status of each task node in the tree structure to determine the execution progress of the target task based on the task status of each task node. Monitoring the task status of each task node in the tree structure to determine the execution progress of the target task includes: monitoring the completion identifier, batch quantity, and child node status of each task node in the tree structure; wherein the completion identifier is used to determine whether the subtask corresponding to the task node has completed the last batch of tasks; the batch quantity is used to determine whether the task node has any uncompleted batches; and the child node status is used to determine whether the batched subtasks of each child node have been completed. The batching logic is implemented based on RxJava reactive programming. It utilizes the observer pattern and the cached pagination emission function to implement the batch subscription logic. In the subscription processing logic, a thread pool is used to implement asynchronous processing. Based on RxJava reactive programming, the batch subtasks are processed in a multi-threaded manner under the original logic code. At the same time, the progress calculation of the batch subtasks is implemented based on the tree task structure. The step of monitoring the task status of each task node in the tree structure to determine the execution progress of the target task based on the task status of each task node includes: The completion identifier, batch quantity, and child node status of each task node in the tree structure are monitored; wherein, the completion identifier is used to determine whether the subtask corresponding to the task node has completed the last batch of task batching, the batch quantity is used to determine whether there is an incomplete batch quantity of the task node, and the child node status of the task node is used to determine whether the batched subtasks of each child node have been completed. If the completion identifier of the task in the task node indicates that the last batch of tasks has been completed, the batch number indicates that there are no uncompleted batches in the task node, and the status of each child node of the task node indicates that the batch of sub-tasks has been completed, then the target task is determined to be completed. The step of constructing new task nodes by building a tree structure and distributing the batched subtasks to the new task nodes includes: When a batch of subtasks is obtained by splitting, the batch of subtasks is sent to a new task node constructed by building a tree structure; Determine whether the batched subtask is the last batch to be completed. If so, set the completion flag of the task node to indicate that the subtask has completed the last batch of task batches. After sending the batched subtasks to the new task nodes constructed by building a tree structure, the method further includes: Increase the batch size of the task node by one unit; When the task node receives an instruction from its child node indicating that the batch of subtasks has been completed, the batch size of the task node is reduced by one unit.

3. An electronic device, characterized in that, The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, which is loaded and executed by the processor to implement the task processing method as described in claim 1.

4. A computer-readable storage medium, characterized in that, Used to store computer-executable instructions, which, when loaded and executed by a processor, implement the task processing method as described in claim 1.

Citation Information

Patent Citations

  • Techniques for determining transaction progress

    US8479204B1