A method and device for processing batch tasks
By batch creating and initializing the pending task queue on the task center side, the problem of directly processing batch tasks cannot be controlled and asynchronously handled interrupts in the middle is solved, and asynchronous processing of tasks and parameter control is realized, improving user experience and task execution efficiency.
Patent Information
- Application Number
- CN202111520888.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2041-12-13
AI Technical Summary
In the prior art, it is uncontrollable to directly process batch tasks after starting, and asynchronous processing of batch tasks interrupts midway, resulting in a task failure and the task process cannot be controlled.
By batch creating pending tasks based on the creation request initiated by the task creation user on the task center end, the task processing user obtains the startup request sent by the task processing user, and starts the pending task based on the startup request; determines the corresponding task parameters based on the pending task, initializes the pending task according to the task parameters, and obtains a pending task queue, so that the task processing user listens to the pending task queue and processes the corresponding pending task based on the pending task queue.
While processing batch tasks asynchronously, the task start-stop, release speed, concurrency mechanism and retry mechanism are controlled through task parameters, which improves the user experience. The task execution status and progress preview can be completed without waiting for the task to be completed, improving efficiency and ensuring the execution of tasks.
Smart Images

Figure CN114327816B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method and device for processing batch tasks. Background Art
[0002] In the prior art, batch task processing usually uses two methods: direct batch task processing or asynchronous batch task processing. Direct batch task processing requires waiting for the task result, and once the task starts, the task progress cannot be controlled; when processing batch tasks asynchronously, if the task is interrupted midway, the task fails. Similarly, once the task starts, the task progress cannot be controlled. Summary of the invention
[0003] One purpose of the present application is to provide a method and device for processing batch tasks, so as to solve the problems in the prior art of being unable to control the direct processing of batch tasks after they start and of asynchronously processing batch tasks being interrupted midway, i.e., task failure.
[0004] According to one aspect of the present application, a method for processing batch tasks is provided, which is applied to a task center, and the method includes:
[0005] Batch create pending tasks based on the creation request initiated by the task creation user, obtain the start request sent by the task processing user, and start the pending tasks based on the start request;
[0006] Determine corresponding task parameters according to the pending tasks, initialize the pending tasks according to the task parameters, and obtain a pending task queue, so that a task processing user monitors the pending task queue and processes corresponding pending tasks based on the pending task queue;
[0007] Obtain the task confirmation queue reported by the task processing user based on the pending task queue, mark the current task according to the execution result corresponding to each current task in the task confirmation queue, and process the corresponding current task accordingly according to the mark.
[0008] Optionally, the task parameters include a task execution mode and a task interaction data volume, wherein the task execution mode includes parallel or serial execution.
[0009] Initializing the tasks to be processed according to the task parameters to obtain a queue of tasks to be processed, including:
[0010] When the task execution mode is parallel, the task to be processed is split according to the amount of task interaction data to obtain a corresponding plurality of subtasks, and a queue of tasks to be processed is determined according to the task to be processed and the corresponding plurality of subtasks;
[0011] When the task execution mode is serial, the to-be-processed task is directly added to the to-be-processed task queue.
[0012] Optionally, splitting the to-be-processed task according to the amount of task interaction data to obtain a corresponding plurality of subtasks, and determining a to-be-processed task queue according to the to-be-processed task and the corresponding plurality of subtasks includes:
[0013] The number of subtasks obtained by splitting the task to be processed is determined according to the ratio of the amount of data contained in the task and the amount of task interaction data, and the subtasks obtained by splitting and the subtask data are written into a task table in a preset format, so that the tasks to be processed and the task data to be processed correspond to the subtasks and the subtask data one by one, wherein the multiple subtasks are all independent tasks.
[0014] Optionally, the execution result includes execution success or execution failure, and marking the current task according to the execution result corresponding to each current task in the task confirmation queue includes:
[0015] When the execution result is successful, the successfully executed current task is marked as successfully executed;
[0016] When the execution result is failure, the current task that failed to execute is marked as execution failure.
[0017] Optionally, the current task includes a single subtask, and the corresponding processing of the current task according to the mark includes:
[0018] The subtask is removed from the task confirmation queue according to the mark of successful execution, and the pending tasks associated with the subtask are continuously monitored by the task processing user;
[0019] The subtask is removed from the task confirmation queue according to the mark of execution failure, and the pending tasks associated with the subtask are not monitored by the task processing user.
[0020] Optionally, the task parameters also include a task timeout period. After obtaining the task confirmation queue uploaded by the task processing user, the process further includes:
[0021] If any current task in the task confirmation queue does not obtain feedback data from the task processing user within a time value greater than or equal to the task timeout time, the reporting information of the current task will not be received, and the timed-out current task will be moved from the task confirmation queue to the pending task queue.
[0022] Optionally, the method further comprises:
[0023] When all tasks are completed, the task data reported by all task processing users are summarized and written into a task table in a preset format, and task notification processing is completed according to the task parameters corresponding to all tasks.
[0024] According to another aspect of the present application, a method for processing batch tasks is also provided, which is applied to a task processing user end, and the method includes:
[0025] Acquire task parameters in the task center, wherein the task parameters are task parameters corresponding to the pending task initiated by the task center according to a start request initiated by the task creation user for the created pending task;
[0026] According to the task parameters, the pending task queue in the task center is monitored, the pending task is added to the task confirmation queue, and the current task in the task confirmation queue is executed to obtain the execution result;
[0027] Report the task confirmation queue and the execution result corresponding to the current task to the task center, so that the task center marks the current task according to the execution result corresponding to each current task in the task confirmation queue, and processes the corresponding current task accordingly according to the mark.
[0028] Optionally, the task parameters include a task type and a concurrent task quantity, and monitoring a queue of pending tasks in a task center according to the task parameters includes:
[0029] The pending task queue is monitored according to the concurrent number of tasks, and the pending tasks with processing authority in the pending task queue are screened out according to the task type.
[0030] Optionally, the monitored task to be processed includes a single subtask, and adding the monitored task to be processed to a task confirmation queue includes:
[0031] The monitored single subtask is added to the task confirmation queue, and the task table and task data corresponding to the single subtask are obtained.
[0032] Optionally, reporting the task confirmation queue and the execution result corresponding to the current task to the task center includes:
[0033] Writing the execution result and task data corresponding to a single subtask into the corresponding position of the task table of pending tasks associated with the subtask to obtain an updated task table of pending tasks;
[0034] The task confirmation queue and the updated task list of pending tasks are reported to the task center.
[0035] According to another aspect of the present application, a device for processing batch tasks is also provided, the device comprising:
[0036] According to yet another aspect of the present application, a computer-readable medium is provided, on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement any of the methods described above.
[0037] According to another aspect of the present application, a device for processing batch tasks is also provided, the device comprising:
[0038] one or more processors; and
[0039] A memory storing computer readable instructions, which, when executed, cause the processor to perform the operations of any of the methods described above.
[0040] Compared with the prior art, the present application batch creates pending tasks based on the creation request initiated by the task creation user at the task center end, obtains the start request sent by the task processing user, and starts the pending tasks based on the start request; determines the corresponding task parameters according to the pending tasks, initializes the pending tasks according to the task parameters, and obtains the pending task queue, so that the task processing user listens to the pending task queue and processes the corresponding pending tasks based on the pending task queue; obtains the task confirmation queue reported by the task processing user based on the pending task queue, marks the current task according to the execution result corresponding to each current task in the task confirmation queue, and processes the corresponding current task accordingly according to the mark. Thus, while asynchronously processing batch tasks, the start and stop, release speed, concurrency mechanism and retry mechanism of the tasks are controlled by the task parameters, which improves the user experience, and the execution status and progress preview of the tasks can be completed without waiting for the task to be completed, which improves efficiency and ensures the execution of the tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0042] Figure 1 A schematic flow chart of a method for processing batch tasks provided according to one aspect of the present application is shown;
[0043] Figure 2 A schematic diagram of filling out a table for splitting tasks in an optional embodiment of the present application is shown;
[0044] Figure 3 A schematic flow chart of a method for processing batch tasks applied to a task processing user terminal according to another aspect of the present application is shown;
[0045] Figure 4 A schematic flow chart of a method for processing batch tasks in an optional embodiment of the present application is shown;
[0046] Figure 5 A schematic flow chart of a method for processing batch tasks in an optional embodiment of the present application is shown.
[0047] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0048] The present application is described in further detail below in conjunction with the accompanying drawings.
[0049] In a typical configuration of the present application, the terminal, the device of the service network and the trusted party all include one or more processors (CPU), input / output interfaces, network interfaces and memories.
[0050] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0051] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0052] Figure 1A flow chart of a method for processing batch tasks provided according to one aspect of the present application is shown, the method comprising: S100-S300, wherein, in S100, batches of pending tasks are created based on a creation request initiated by a task creation user, a start request sent by a task processing user is obtained, and the pending tasks are started based on the start request; in S200, the corresponding task parameters are determined according to the pending tasks, and the pending tasks are initialized according to the task parameters to obtain a pending task queue, so that the task processing user listens to the pending task queue and processes the corresponding pending tasks based on the pending task queue; in S300, the task confirmation queue reported by the task processing user based on the pending task queue is obtained, the current task is marked according to the execution result corresponding to each current task in the task confirmation queue, and the corresponding current task is processed accordingly according to the mark. Thus, while asynchronously processing batch tasks, the start and stop, release speed, concurrency mechanism and retry mechanism of the tasks are controlled by the task parameters, which improves the user experience, and the execution status and progress preview of the tasks can be completed without waiting for the task to be completed, which improves the efficiency and ensures the execution of the tasks.
[0053] Specifically, in S100, pending tasks are created in batches based on the creation request initiated by the task creation user, the start request sent by the task processing user is obtained, and the pending tasks are started based on the start request. Here, the task center obtains the creation request initiated by the task creation user to create a batch of pending tasks, wherein the creation request includes task parameters, and the pending tasks corresponding to the task parameters are created based on the creation request. Optionally, the task center sends a notification to the task creation user whether the creation is successful based on the pending tasks. Next, the start request sent by the task processing user is obtained, and the pending tasks are started based on the start request. Here, the start request includes the amount of data to be processed, the parameters for processing the data, and the person to be notified after the task is completed. The parameters for processing the data may be order status, etc. For example, if 10,000 pieces of data are exported in batches based on the order status being paid or completed, then the order status is the parameter for processing the data.
[0054] In S200, the corresponding task parameters are determined according to the pending task, and the pending task is initialized according to the task parameters to obtain a pending task queue, so that the task processing user listens to the pending task queue and processes the corresponding pending task based on the pending task queue. Here, after the start request is obtained to start the processing task, the pending task is initialized according to the task parameters corresponding to the pending task, for example, whether to perform data splitting processing on the pending task is determined according to the task type and task execution method of the pending task. The initialized pending tasks will be sequentially arranged in the pending task queue, so that the task processing user can listen to the pending task queue. Here, the pending tasks can be described in a task table in a preset format, and each task in the pending task queue corresponds to a task table in a preset format to simplify the operation of the task processing user.
[0055] In S300, the task confirmation queue reported by the task processing user based on the pending task queue is obtained, the current task is marked according to the execution result corresponding to each current task in the task confirmation queue, and the corresponding current task is processed accordingly according to the mark. Here, the task confirmation queue is a task queue formed by the pending tasks that can be processed and monitored by the task processing user. Each current task in the task confirmation queue has a processing result reported by the task processing user. Optionally, each current task in the task confirmation queue corresponds to a current task table in a preset format, which includes the current task name and the task data of the current task. After the current task data is arranged, it is marked according to the execution result. For example, when the task is executed successfully, the current task data can be marked as executed successfully, and then the current task is removed from the task confirmation queue and re-added to the pending task queue to complete the task cycle release processing.
[0056] In an optional embodiment of the present application, in S200, the task parameters include the task execution mode and the task interaction data volume, wherein the task execution mode includes parallel or serial, when the task execution mode is parallel, the task to be processed is split according to the task interaction data volume to obtain corresponding multiple subtasks, and the task to be processed queue is determined according to the task to be processed and the corresponding multiple subtasks; when the task execution mode is serial, the task to be processed is directly added to the task to be processed queue. Here, the task parameters include the task execution mode and the task interaction data volume, wherein the task execution mode can be serial or parallel, when the task execution mode is serial, the task to be processed is regarded as a whole and directly added to the task to be processed queue; when the task execution mode is parallel, the task to be processed is based on the ratio of the amount of data to be processed in the start request to the amount of task interaction data to obtain the number of subtasks to be split, and the subtasks obtained by splitting are all independent tasks, which can be monitored and processed by different task processing users, and each subtask does not intersect with each other, that is, the data of the task to be processed is split into different subtasks. In an optional embodiment of the present application, the task to be processed is a parallel task, and the task content is to batch export 10,000 data. This task is divided into 10 small tasks, each with 1,000 data. These 10 small tasks can be executed separately by 10 task processing users at the same time.
[0057] In an optional embodiment of the present application, in S200, the task to be processed is split according to the amount of task interaction data to obtain a corresponding plurality of subtasks, the number of subtasks obtained by splitting the task to be processed is determined according to the ratio of the amount of data contained in the task and the amount of task interaction data, and the subtasks obtained by splitting and the subtask data are written into a task table of a preset format, so that the task to be processed and the task to be processed data correspond one-to-one with the subtasks and the subtask data, wherein the plurality of subtasks are independent tasks. Here, after the task to be processed is split according to the amount of task interaction data to obtain a plurality of subtasks, the table of the original tasks to be processed is correspondingly split into entries corresponding to a plurality of subtasks corresponding to one task to be processed, and all subtask names and subtask data under a single task to be processed are displayed in the task table to be processed, so as to facilitate calling and distinguishing the tasks to be processed associated with each subtask. Figure 2 A schematic diagram of filling out a table for splitting tasks in an optional embodiment of the present application is shown. Here, the task is a parallel task. After splitting, the names of multiple subtasks and corresponding subtask data are filled in the table of the task to form a one-to-one correspondence.
[0058] In an optional embodiment of the present application, in S300, the execution result includes execution success or execution failure. When the execution result is success, the current task that is successfully executed is marked as execution success; when the execution result is failure, the current task that is failed is marked as execution failure. Here, the current task that is successfully executed is marked as execution success, and the current task that is failed is marked as execution failure, so as to facilitate subsequent corresponding processing of the task.
[0059] In an optional embodiment of the present application, in S300, the current task includes a single subtask, and the subtask is removed from the task confirmation queue according to a mark of successful execution, and the pending tasks associated with the subtask are continuously monitored by the task processing user; the subtask is removed from the task confirmation queue according to a mark of failed execution, and the pending tasks associated with the subtask are not monitored by the task processing user. Here, when the current task is a subtask, it contains multiple subtasks under the associated pending tasks. When the subtask is successfully executed, the subtask is removed from the task confirmation queue according to the mark of successful execution, and the pending tasks associated with the subtask can be continuously monitored by the task processing user, which facilitates the task processing user to perform monitoring and acquisition processing of the associated tasks. When the subtask fails to execute, the subtask is removed from the task confirmation queue according to the mark of failed execution, and the pending tasks associated with the subtask are not monitored by the task processing user.
[0060] In an optional embodiment of the present application, the task parameters also include a task timeout. After obtaining the task confirmation queue uploaded by the task processing user, if any current task in the task confirmation queue does not obtain the feedback data of the task processing user within a time value greater than or equal to the task timeout, the reporting information of the current task will not be received, and the timed-out current task will be moved from the task confirmation queue to the queue of pending tasks. Here, after obtaining the task confirmation queue uploaded by the task processing user, if the current task does not have any feedback data within the task timeout, the task center will not receive the reporting information of the current task, and will move the current task from the task confirmation queue to the queue of pending tasks as a timed-out current task, waiting to be monitored by the task processing user next time. Optionally, if the task handler does not monitor the subtask, the monitoring will continue in the future.
[0061] In an optional embodiment of the present application, when all tasks are completed, the task data reported by all task processing users are summarized and written into a task table of a preset format, and the task notification processing is completed according to the task parameters corresponding to all tasks. Here, when all tasks are completed, the task data reported by all task processing users are summarized and written into a task table of a preset format, such as a task table with a one-to-one correspondence between task names and task data; then the task notification processing is completed according to the task parameters corresponding to all tasks. Among them, the task parameters include but are not limited to: task name, task description, task type, task execution method, task interaction data volume, task data format, number of concurrent tasks, task timeout, task result data format and task result notification method.
[0062] Figure 3 A flow chart of a method for processing batch tasks applied to a task processing user end provided according to another aspect of the present application is shown, the method comprising: S400-S600, wherein, in S400, task parameters in the task center are obtained, wherein the task parameters are task parameters corresponding to the pending task initiated by the task center according to the start request for the created pending task initiated by the task creation user; in S500, the pending task queue in the task center is monitored according to the task parameters, the monitored pending task is added to the task confirmation queue, and the current task in the task confirmation queue is executed to obtain the execution result; in S600, the task confirmation queue and the execution result corresponding to the current task are reported to the task center, so that the task center marks the current task according to the execution result corresponding to each current task in the task confirmation queue, and processes the corresponding current task accordingly according to the mark. Thus, while asynchronously processing batch tasks, the start and stop, release speed, concurrency mechanism and retry mechanism of the task are controlled by the task parameters, which improves the user experience, and the execution status and progress preview of the task can be completed without waiting for the task to be completed, which improves the efficiency and ensures the execution of the task.
[0063] Specifically, in S400, the task parameters in the task center are obtained, wherein the task parameters are the task parameters corresponding to the pending task started by the task center according to the start request initiated by the task creation user for the created pending task. Here, the task parameters of the relevant tasks in the task center are obtained, wherein the task parameters are the task parameters corresponding to the pending task started by the task center according to the start request initiated by the task creation user for the created pending task.
[0064] In S500, the queue of pending tasks in the task center is monitored according to the task parameters, the pending tasks monitored are added to the task confirmation queue, and the current task in the task confirmation queue is executed to obtain the execution result. Here, the queue of pending tasks in the task center is monitored according to the task parameters, wherein the task parameters may be task types, and matching tasks may be monitored according to whether the task types are consistent with the rights of the task processing user, and then the pending tasks monitored are added from the pending task queue to the task confirmation queue to wait for the task processing user to execute and process them.
[0065] In S600, the task confirmation queue and the execution result corresponding to the current task are reported to the task center, so that the task center marks the current task according to the execution result corresponding to each current task in the task confirmation queue, and processes the corresponding current task accordingly according to the mark. Here, after the task processing user processes the current task, the execution result is obtained, and the task confirmation queue and the execution result corresponding to the current task are reported to the task center, so that the task center marks the current task according to the execution result corresponding to each current task in the task confirmation queue, and processes the corresponding current task accordingly according to the mark. Optionally, when the current task is a subtask, the remaining subtasks under the pending task associated with the subtask can be processed simultaneously by multiple task handlers. Optionally, the task center controls the frequency of subtasks being monitored by task handlers according to the concurrent number of tasks in the task parameters, and controls the start and stop, release speed, concurrency mechanism and retry mechanism of the task through the task parameters, thereby improving the user experience.
[0066] In an optional embodiment of the present application, in S500, the task parameters include the task type and the number of concurrent tasks, the pending task queue is monitored according to the number of concurrent tasks, and the pending tasks with processing authority in the pending task queue are screened out according to the task type. Here, it is possible to confirm whether the pending tasks in the pending task queue can be monitored according to the number of concurrent tasks, screen out the pending tasks with processing authority in the pending task queue according to the task type, add the pending tasks with processing authority to the task confirmation queue as the current tasks, and wait for the task processing user to perform subsequent execution processing to obtain the execution result, and control the start and stop of the task, the release speed, the concurrency mechanism and the retry mechanism through the task parameters, thereby improving the user experience.
[0067] In an optional embodiment of the present application, in S500, the monitored pending task includes a single subtask, the monitored single subtask is added to the task confirmation queue, and the task table and task data corresponding to the single subtask are obtained. Here, the monitored pending task includes a single subtask. When the monitored pending task is a subtask, the subtask is added to the task confirmation queue, and the task name and task data in the task table corresponding to the subtask are obtained, thereby simplifying the task processing process of the task processing user.
[0068] In an optional embodiment of the present application, in S600, the execution result and task data corresponding to a single subtask are written into the corresponding position of the task table of the pending task associated with the subtask, and the task table of the updated pending task is obtained; the task confirmation queue and the task table of the updated pending task are reported to the task center. Here, the pending task is the parent task of the subtask, and has multiple associated subtasks that are sequentially monitored by multiple task processing users in the task table for execution and processing. The execution result and task data corresponding to the single subtask are written into the corresponding position of the task table of the pending task associated with the subtask, and the task table of the pending task is updated. The task confirmation queue and the task table of the updated pending task are reported to the task center, and the execution status and progress preview of the task can be completed without waiting for the task to be completed, which improves efficiency and ensures the execution of the task.
[0069] Figure 4 A flow chart of a method for processing batch tasks in an optional embodiment of the present application is shown, wherein the pending task is identified as a task, the subtasks are identified as small task 1 and small task 2, and the task processing user is identified as a task handler. When small task 1 in the pending task queue is monitored by the task handler, the task name and data of small task 1 are deleted from the pending task queue and added to the task confirmation queue. If small task 1 times out, small task 1 is moved from the task confirmation queue to the pending task queue again. When small task 1 is completed, small task 1 is deleted from the task confirmation queue.
[0070] Figure 5A flow chart of a method for processing batch tasks in an optional embodiment of the present application is shown, wherein the task creation user identifier is the task creator, and the task processing user identifier is the task processor. It should be noted that the task creator and the task processor are not limited to people, but can be services or devices, etc. The task creator creates and starts the task, obtains task creation data and task startup data, and uses the task creation data and task startup data to initialize the task. When the task is a parallel task, the task is split into multiple small tasks, and a task table written by multiple small tasks corresponding to the task is obtained. Based on the task table and the generated small task status, it is controlled whether the small task can be monitored by the task processor, thereby controlling the start and stop of the task. The task execution speed is controlled by creating the task interaction data volume, the number of concurrent tasks and the task timeout time in the task request. Then the task processor monitors the task to join the task confirmation queue, and reports the task execution result. According to the execution result, different tasks are removed or deleted from the task confirmation queue, and finally the task notification processing is completed according to the summarized task execution result. When the task center determines that all small task execution results have been reported by the task handler, it will summarize the results of all small tasks into the data format of the task result data in the creation step. When the result processing step is completed, the task center will notify the notified person of the result through the task result notification method in the creation task request combined with the task completion notifier in the start task request. The notified person can obtain the result of the task execution processing in the result processing through the notification result.
[0071] The embodiment of the present application also provides a computer-readable medium on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement the aforementioned method for processing batch tasks.
[0072] Corresponding to the method described above, the present application also provides a terminal, which includes a terminal capable of executing the above Figure 1 or Figure 2 or Figure 3 or Figure 4 or Figure 5 The modules or units of the method steps described in each embodiment may be implemented by hardware, software, or a combination of hardware and software, which is not limited in this application. For example, in one embodiment of this application, a device for processing batch tasks is also provided, wherein the device includes:
[0073] one or more processors; and
[0074] A memory storing computer-readable instructions, wherein when the computer-readable instructions are executed, the processor executes the operations of the aforementioned method for processing batch tasks.
[0075] For example, the computer readable instructions, when executed, cause the one or more processors to:
[0076] Create batches of pending tasks based on the creation requests initiated by the task creation user, obtain the start request sent by the task processing user, and start the pending tasks based on the start request; determine the corresponding task parameters according to the pending tasks, initialize the pending tasks according to the task parameters, and obtain a pending task queue, so that the task processing user listens to the pending task queue and processes the corresponding pending tasks based on the pending task queue; obtain the task confirmation queue reported by the task processing user based on the pending task queue, mark the current task according to the execution result corresponding to each current task in the task confirmation queue, and process the corresponding current task accordingly according to the mark.
[0077] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
[0078] It should be noted that the present application can be implemented in software and / or a combination of software and hardware, for example, can be implemented using an application specific integrated circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented using hardware, for example, as a circuit that cooperates with a processor to perform each step or function.
[0079] In addition, a part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. The program instruction for calling the method of the present application may be stored in a fixed or removable recording medium, and / or transmitted through a data stream in a broadcast or other signal-bearing medium, and / or stored in a working memory of a computer device that runs according to the program instruction. Here, according to an embodiment of the present application, a device is included, the device including a memory for storing computer program instructions and a processor for executing program instructions, wherein, when the computer program instruction is executed by the processor, the device is triggered to run the method and / or technical solution based on the aforementioned multiple embodiments according to the present application.
[0080] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A method for processing batch tasks, applied to a task center, wherein: The method comprises: Batch create pending tasks based on the creation request initiated by the task creation user, obtain the start request sent by the task processing user, and start the pending tasks based on the start request; Determine corresponding task parameters according to the task to be processed, wherein the task parameters include task type and concurrent task quantity; Initialize the pending tasks according to the task parameters to obtain a pending task queue, so that the task processing user monitors the pending task queue according to the concurrent number of tasks, filters out pending tasks with processing authority in the pending task queue according to the task type, and processes the corresponding pending tasks based on the pending task queue; Obtaining a task confirmation queue reported by a task processing user based on the pending task queue, marking the current task according to the execution result corresponding to each current task in the task confirmation queue, and performing corresponding processing on the corresponding current task according to the mark; The task parameters include the task execution mode and the task interaction data volume, wherein the task execution mode includes parallel or serial, Initializing the tasks to be processed according to the task parameters to obtain a queue of tasks to be processed, including: When the task execution mode is parallel, the task to be processed is split according to the amount of task interaction data to obtain a corresponding plurality of subtasks, and a queue of tasks to be processed is determined according to the task to be processed and the corresponding plurality of subtasks; When the task execution mode is serial, the to-be-processed task is directly added to the to-be-processed task queue.
2. The method according to claim 1, wherein: The step of splitting the to-be-processed task into a plurality of corresponding subtasks according to the amount of task interaction data, and determining a to-be-processed task queue according to the to-be-processed task and the plurality of corresponding subtasks, comprises: The number of subtasks obtained by splitting the task to be processed is determined according to the ratio of the amount of data contained in the task and the amount of task interaction data, and the subtasks obtained by splitting and the subtask data are written into a task table in a preset format, so that the tasks to be processed and the task data to be processed correspond to the subtasks and the subtask data one by one, wherein the multiple subtasks are all independent tasks.
3. The method according to claim 1, wherein: The execution result includes execution success or execution failure, and the current task is marked according to the execution result corresponding to each current task in the task confirmation queue, including: When the execution result is successful, the successfully executed current task is marked as successfully executed; When the execution result is failure, the current task that failed to execute is marked as execution failure.
4. The method according to claim 1, wherein: The current task includes a single subtask, and the corresponding processing of the current task according to the mark includes: The subtask is removed from the task confirmation queue according to the mark of successful execution, and the pending tasks associated with the subtask are continuously monitored by the task processing user; The subtask is removed from the task confirmation queue according to the mark of execution failure, and the pending tasks associated with the subtask are not monitored by the task processing user.
5. The method according to claim 1, wherein: The task parameters also include the task timeout period. After obtaining the task confirmation queue uploaded by the task processing user, the following is also included: If any current task in the task confirmation queue does not obtain feedback data from the task processing user within a time value greater than or equal to the task timeout time, the reporting information of the current task will not be received, and the timed-out current task will be moved from the task confirmation queue to the pending task queue.
6. The method according to claim 1, wherein: The method further comprises: When all tasks are completed, the task data reported by all task processing users are summarized and written into a task table in a preset format, and task notification processing is completed according to the task parameters corresponding to all tasks.
7. A method for processing batch tasks, applied to a task processing user end, wherein: The method comprises: Obtaining task parameters in the task center, wherein the task parameters are task parameters corresponding to the pending task initiated by the task center according to a start request initiated by the task creation user for the created pending task, wherein the task parameters include a task execution mode and a task interaction data volume, and the task execution mode includes parallel or serial; Monitor the pending task queue in the task center according to the task parameters, add the monitored pending task to the task confirmation queue, and execute the current task in the task confirmation queue to obtain the execution result, wherein the pending task queue is obtained by the task center initializing the pending task according to the task parameters, when the task execution mode is parallel, the pending task is split according to the task interaction data volume to obtain the corresponding multiple subtasks, and the pending task queue is determined according to the pending task and the corresponding multiple subtasks, and when the task execution mode is serial, the pending task is directly added to the pending task queue; Reporting the task confirmation queue and the execution result corresponding to the current task to the task center, so that the task center marks the current task according to the execution result corresponding to each current task in the task confirmation queue, and processes the corresponding current task accordingly according to the mark; The task parameters include the task type and the number of concurrent tasks, and monitoring the pending task queue in the task center according to the task parameters includes: The pending task queue is monitored according to the concurrent number of tasks, and the pending tasks with processing authority in the pending task queue are screened out according to the task type.
8. The method according to claim 7, wherein: The monitored pending task includes a single subtask, and adding the monitored pending task to a task confirmation queue includes: The monitored single subtask is added to the task confirmation queue, and the task table and task data corresponding to the single subtask are obtained.
9. The method according to claim 7, wherein: Report the task confirmation queue and the execution result corresponding to the current task to the task center, including: Writing the execution result and task data corresponding to a single subtask into the corresponding position of the task table of pending tasks associated with the subtask to obtain an updated task table of pending tasks; The task confirmation queue and the updated task list of pending tasks are reported to the task center.
10. A computer-readable medium having computer-readable instructions stored thereon, wherein the computer-readable instructions can be executed by a processor to implement the method according to any one of claims 1 to 9.
11. A device for processing batch tasks, wherein: The device comprises: one or more processors; and A memory storing computer readable instructions which, when executed, cause the processor to perform the operations of the method as claimed in any one of claims 1 to 9.
Citation Information
Patent Citations
Asynchronous batch task processing method and system
CN105389209A