Asynchronous task execution method and device, electronic equipment and storage medium
By combining and defining parallel strategies to manage asynchronous tasks, the high concurrency problem between asynchronous tasks is solved, and resource utilization and system performance are improved.
Patent Information
- Application Number
- CN202510720208.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-12
AI Technical Summary
In complex business logic such as financial systems, sequential dependencies and resource conflicts between asynchronous tasks lead to high concurrency operations, increasing system resource consumption and affecting performance.
By combining multiple related sequential asynchronous tasks to form a task group, and defining a parallel strategy, adding them to the asynchronous task execution table in batches to avoid high concurrent execution.
It improves resource utilization, reduces system resource consumption, improves system performance and ensures stable operation.
Smart Images

Figure CN120631448A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an asynchronous task execution method, device, electronic device and storage medium. Background Art
[0002] Some computer-based business logic, such as financial system transaction logic, is complex and takes a long time to execute, making it suitable for implementation using asynchronous tasks. After initiating an asynchronous task, the main system program does not wait for the execution result to proceed to subsequent logic. Once all execution is complete, the asynchronous task execution result can be queried via callbacks. Alternatively, the asynchronous task execution result can be omitted and used by other programs. Therefore, using asynchronous tasks to implement business logic can reduce system performance pressure.
[0003] However, due to the possible sequence dependencies, resource conflicts, or data consistency requirements between different asynchronous tasks, there may be scenarios with data consistency requirements, such as some financial asynchronous tasks that need to modify the same key data. Therefore, when performing high-concurrency operations on the corresponding asynchronous tasks, they will cause each other to wait, which may increase system resource consumption, reduce resource utilization, and even affect system performance. Summary of the Invention
[0004] The embodiment of the present invention provides an asynchronous task execution method, which can improve resource utilization, reduce resource consumption and improve system performance.
[0005] In a first aspect, an embodiment of the present invention provides an asynchronous task execution method, comprising:
[0006] Combining the associated plurality of sequential asynchronous tasks to obtain a sequential asynchronous task group, and defining the sequential asynchronous task group in a sequential asynchronous task definition table based on a sequential asynchronous task definition item, wherein the sequential asynchronous task definition item includes a parallel strategy for the sequential asynchronous task group;
[0007] Adding the plurality of sequential asynchronous tasks to a sequential asynchronous task execution table based on a sequential asynchronous task execution item, wherein the sequential asynchronous task execution item includes a task sequence number of each sequential asynchronous task in a corresponding sequential asynchronous task group;
[0008] Based on the parallel strategy, the task sequence number, and the regular asynchronous task execution item, the plurality of sequential asynchronous tasks are added to the regular asynchronous task execution table in batches by adding one batch in each task execution period; and
[0009] Execute batches of sequential asynchronous tasks in corresponding task execution periods based on corresponding regular asynchronous task execution tables.
[0010] In a second aspect, an embodiment of the present invention provides an asynchronous task execution device, comprising:
[0011] a sequential asynchronous task group acquisition and definition module, configured to combine a plurality of associated sequential asynchronous tasks to obtain a sequential asynchronous task group, and define the sequential asynchronous task group in a sequential asynchronous task definition table based on sequential asynchronous task definition items, wherein the sequential asynchronous task definition items include a parallel strategy for the sequential asynchronous task group;
[0012] A sequential asynchronous task execution table adding module is used to add the plurality of sequential asynchronous tasks to the sequential asynchronous task execution table based on a sequential asynchronous task execution item, wherein the sequential asynchronous task execution item includes a task sequence number of each sequential asynchronous task in a corresponding sequential asynchronous task group;
[0013] a regular asynchronous task execution table adding module, configured to add the plurality of sequential asynchronous tasks to the regular asynchronous task execution table in batches, with one batch added in each task execution period, based on the parallel strategy, the task sequence number, and the regular asynchronous task execution item; and
[0014] The execution module is used to execute each batch of sequential asynchronous tasks in the corresponding task execution period based on the corresponding conventional asynchronous task execution table.
[0015] In a third aspect, an embodiment of the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, an asynchronous task execution method as described in any one of the embodiments of the present invention is implemented.
[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the asynchronous task execution method as described in any one of the embodiments of the present invention.
[0017] In a fifth aspect, an embodiment of the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the asynchronous task execution method as described in any one of the embodiments of the present invention.
[0018] An embodiment of the present invention provides an asynchronous task execution method, device, electronic device and storage medium, which obtains a sequential asynchronous task group by combining multiple related sequential asynchronous tasks, and defines the sequential asynchronous task group in a sequential asynchronous task definition table whose definition items include a parallel strategy, and then adds multiple sequences to a sequential asynchronous task execution table whose execution items include the task sequence numbers of each sequential asynchronous task in the corresponding sequential asynchronous task group. Further, based on the parallel strategy and task sequence number, the multiple sequential asynchronous tasks are added to the regular asynchronous task execution table in batches in a manner of adding a batch in each task execution period, and each batch of sequential asynchronous tasks is executed in the corresponding task execution period based on the regular asynchronous task execution table. When executing sequential asynchronous tasks, it can avoid excessive concurrency, thereby reducing system resource consumption, improving resource utilization, and improving system performance to ensure stable operation of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 This is a flowchart of an asynchronous task execution method provided by an embodiment of the present invention;
[0021] Figure 2 is another flowchart of the asynchronous task execution method provided by an embodiment of the present invention;
[0022] Figure 3 is another flowchart of the asynchronous task execution method provided by an embodiment of the present invention;
[0023] Figure 4 is another flowchart of the asynchronous task execution method provided by an embodiment of the present invention;
[0024] Figure 5 is another flowchart of the asynchronous task execution method provided by an embodiment of the present invention;
[0025] Figure 6 This is a schematic diagram of the structure of an asynchronous task execution device provided by an embodiment of the present invention;
[0026] Figure 7 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Figure 1 The present invention provides a flowchart of an asynchronous task execution method. This embodiment is applicable to scenarios where there are asynchronous tasks in the system that need to be executed sequentially. The method can be executed by the asynchronous task execution device provided by the embodiment of the present invention, which can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated into an electronic device, such as a computer, a server, etc. The following embodiments will be described using the example of the device being integrated into an electronic device.
[0030] refer to Figure 1 , the method may specifically include the following steps:
[0031] Step 101 combines multiple associated sequential asynchronous tasks to form a sequential asynchronous task group. The sequential asynchronous task group is defined in a sequential asynchronous task definition table based on the sequential asynchronous task definition item, which includes the sequential asynchronous task group's parallelization strategy. This step allows for a comprehensive definition of the multiple associated sequential asynchronous tasks, including the overall parallelization strategy, and facilitates adding these sequential asynchronous tasks to the regular asynchronous task definition table in batches based on the corresponding parallelization strategy.
[0032] Specifically, the process of defining the sequential asynchronous task group in the sequential asynchronous task definition table can be implemented through configuration pages, data changes, etc., or through program addition.
[0033] Specifically, the above-mentioned sequential asynchronous task definition table may define one sequential asynchronous task group, or may define multiple sequential asynchronous task groups.
[0034] Specifically, the above-mentioned sequential asynchronous tasks can be understood as asynchronous tasks that need to be executed sequentially.
[0035] Optionally, the multiple sequential asynchronous tasks include periodic asynchronous tasks.
[0036] Specifically, the aforementioned multiple sequential asynchronous tasks may also include event-triggered asynchronous tasks.
[0037] Specifically, the aforementioned associated multiple sequential asynchronous tasks may be multiple sequential asynchronous tasks having sequence dependency, resource conflict, or data consistency requirements.
[0038] In one specific example, the plurality of sequential asynchronous tasks include a plurality of repayment tasks of the same customer.
[0039] Specifically, the above-mentioned sequential asynchronous task definition table can be pre-set based on the definition items of the conventional asynchronous task definition table.
[0040] Specifically, the asynchronous task definition items of a conventional asynchronous task definition table usually include the task identifier of the asynchronous task, service code, execution start time, execution end time, task priority, whether retry is allowed, retry strategy, retryable error code, executable status, success rate threshold and / or time threshold. Therefore, the above-mentioned sequential asynchronous task definition items can be set to also include: the group identifier of the corresponding sequential asynchronous task group, the task identifier of each sequential asynchronous task in the group, the execution failure strategy, the current execution task sequence number and / or the group executable status.
[0041] Specifically, the above-mentioned sequential asynchronous task definition items can be set to: including the task identifier, service code, execution start time, execution end time, task priority, whether retry is allowed, retry strategy, retryable error code, executable status, success rate threshold and / or time threshold of the sequential asynchronous task.
[0042] Specifically, the above parallel strategy includes whether to allow parallelism and the maximum concurrency.
[0043] Step 102 adds multiple sequential asynchronous tasks to a sequential asynchronous task execution table based on the sequential asynchronous task execution item. The sequential asynchronous task execution item includes the task sequence number of each sequential asynchronous task in the corresponding sequential asynchronous task group. This step enables the overall management of the sequential asynchronous tasks in the sequential asynchronous task group and facilitates adding the sequential asynchronous tasks in the sequential asynchronous task group to the regular asynchronous task definition table in batches based on the task sequence numbers in the sequential asynchronous task execution table.
[0044] Specifically, the above process of adding multiple sequential asynchronous tasks to the sequential asynchronous task execution table can be implemented by adding a program or inserting a library.
[0045] Specifically, the above-mentioned sequential asynchronous task execution table is pre-set based on the execution items of the conventional asynchronous task execution table.
[0046] Specifically, the task execution items of a conventional asynchronous task execution table usually include the execution identifier, task identifier, task parameters, task status, error information, number of retries, submission time, execution time and / or time consumption of the asynchronous task. Therefore, the above-mentioned sequential asynchronous execution items can be set to also include: the group identifier of the corresponding sequential asynchronous task group, the task identifier of each sequential asynchronous task in the group, the execution identifier of each sequential asynchronous task in the group, the group task status, the group task parameters and / or the group task submission time.
[0047] It can be understood that the conventional asynchronous task execution table is usually used to record and manage the execution status and information of specific asynchronous tasks. The embodiment of the present invention sets up a sequential asynchronous task execution table including the task serial numbers of each sequential asynchronous task in the corresponding sequential asynchronous task group on top of the conventional asynchronous task execution table, so as to facilitate the overall management of the sequential asynchronous tasks in the corresponding sequential asynchronous task group.
[0048] Specifically, multiple sequential asynchronous tasks may be added to the sequential asynchronous task execution table directly at one time, or may be added to the sequential asynchronous task execution table in batches.
[0049] Step 103 adds the multiple sequential asynchronous tasks to the regular asynchronous task execution table in batches, one batch per task execution period, based on the parallelization strategy, task sequence numbers, and regular asynchronous task execution items. This step facilitates executing different batches of sequential asynchronous tasks at different execution periods, thereby avoiding high concurrency of sequential asynchronous tasks.
[0050] Specifically, the above-mentioned addition of multiple sequential asynchronous tasks to the regular asynchronous task execution table can be achieved by adding a program or inserting a library.
[0051] Specifically, the above-mentioned conventional asynchronous task execution table may be preset.
[0052] Specifically, the above-mentioned regular asynchronous task execution items may include: the execution identifier of the asynchronous task, the task identifier, the task parameters, the task status, the error message, the number of retries, the submission time, the execution time and the time consumption.
[0053] Optionally, the above process of adding multiple sequential asynchronous tasks to the regular asynchronous task execution table in batches by adding a batch in each task execution period based on the parallel strategy, task sequence number and regular asynchronous task execution items includes: determining the number of sequential asynchronous tasks added in each batch based on the parallel strategy; determining each batch of sequential asynchronous tasks based on the number of sequential tasks added in each batch and the task sequence number; adding each batch of sequential asynchronous tasks to the regular asynchronous task execution table by adding a batch in each task execution period based on the regular asynchronous task execution items.
[0054] Optionally, when the parallel strategy is to not allow parallelism, the number of sequential asynchronous tasks added in each batch is determined to be 1.
[0055] Optionally, when the parallel strategy is to allow parallelism, the number of sequential asynchronous tasks added in each batch is determined based on the maximum concurrency.
[0056] Specifically, before step 103, the execution time required to execute a batch of sequential asynchronous tasks can be determined based on empirical data, and the task execution period of each batch of sequential asynchronous tasks can be determined based on the execution time required for a batch of sequential asynchronous tasks. Then, based on the determined task execution period, multiple batches are added to the regular asynchronous task execution table in a manner of adding a batch in each task execution period.
[0057] Step 104 executes each batch of sequential asynchronous tasks during the corresponding task execution period based on the corresponding regular asynchronous task execution table. This step, based on steps 101 to 103, allows different batches of sequential asynchronous tasks to be executed during different execution periods, thereby avoiding high concurrency of sequential asynchronous tasks, thereby reducing system resource consumption, improving resource utilization, and improving system performance to ensure stable system operation.
[0058] Specifically, the corresponding regular asynchronous task execution table can be understood as a regular asynchronous task execution table after the corresponding batch sequential asynchronous tasks are added in the corresponding task execution period.
[0059] Specifically, the core parameters required for the execution of the corresponding sequential asynchronous task, such as execution identifier, task identifier, task parameters, task status, etc., can be first extracted from the regular task execution table, and then the sequential asynchronous tasks to be executed are scanned through the task scheduling engine, and execution resources are allocated based on the task parameters and the execution resources are used to execute the corresponding sequential asynchronous tasks.
[0060] The following further introduces the asynchronous task execution method provided by the embodiment of the present invention.
[0061] Optionally, the regular asynchronous task execution items include: the task status of each asynchronous task.
[0062] Optional, such as Figure 2 As shown, Figure 1 Step 103 in the embodiment may include the following steps:
[0063] Step 1031 : After adding each batch of sequential asynchronous tasks to the regular asynchronous task execution table, the execution status of the batch of sequential asynchronous tasks is obtained from the regular asynchronous task execution table.
[0064] Step 1032 : Determine the number of tasks in the next batch based on the parallel strategy and / or the number of unadded sequential asynchronous tasks, where the unadded sequential asynchronous tasks are sequential asynchronous tasks in the sequential asynchronous task group that have not been added to the regular asynchronous task execution table.
[0065] Specifically, the above process of determining the number of tasks in the next batch based on the parallel strategy and the number of unadded sequential asynchronous tasks can include: when the parallel strategy is to allow parallelism, based on whether the number of unadded sequential asynchronous tasks is less than the maximum concurrency, if it is less than, the number of unadded sequential asynchronous tasks is determined as the number of tasks in the next batch; if it is not less than, the maximum concurrency is determined as the number of tasks in the next batch.
[0066] Specifically, the process of determining the number of the next batch of tasks based on the parallel strategy may include: when the parallel strategy is not to allow parallelism and the maximum concurrency is 1, directly determining the maximum concurrency as the number of the next batch of tasks.
[0067] Specifically, the process of determining the number of the next batch of tasks based on the number of unadded sequential asynchronous tasks may include: when the number of added sequential asynchronous tasks is 1, determining the number of unadded sequential asynchronous tasks as the number of the next batch of tasks.
[0068] Step 1033: Obtain the next batch of sequential asynchronous tasks by obtaining the sequential asynchronous tasks with the smallest sequence number and the total number of the next batch of tasks among the unadded sequential asynchronous tasks.
[0069] Step 1034 : When the execution status of the current batch of sequential asynchronous tasks is successful, the next batch of sequential asynchronous tasks is added to the regular asynchronous task execution table based on the regular asynchronous task execution item.
[0070] Specifically, steps 1033 and 1034 may be executed when the execution status of the batch of sequential asynchronous tasks is successful, or may be executed after each batch of sequential asynchronous tasks is added to the regular asynchronous task execution table.
[0071] Specifically, when the execution status of the current batch of sequential asynchronous tasks is successful, it can be determined that the next task execution period has begun, and thus the adding operation of the next batch of sequential asynchronous tasks is started.
[0072] Optionally, the aforementioned sequential asynchronous task definition item includes: an execution failure strategy, where the execution failure strategy includes allowing skipping and not running skipping.
[0073] Optionally, the asynchronous task execution method provided by an embodiment of the present invention also includes: when the execution status of this batch of sequential asynchronous tasks is execution failure, obtaining the execution failure strategy of the sequential asynchronous task group from the sequential asynchronous task definition table; when the execution failure strategy is to allow skipping, skipping the failed execution of this batch of sequential asynchronous tasks, starting execution based on the regular asynchronous task execution items to add the next batch of sequential asynchronous tasks to the regular asynchronous task execution table; when the execution failure strategy is to not allow skipping, stopping adding the unadded sequential asynchronous tasks to the regular asynchronous task execution table.
[0074] Specifically, after skipping the batch of sequential asynchronous tasks that failed to execute or stopping adding the unadded sequential asynchronous tasks to the regular asynchronous task execution table, relevant staff are notified to intervene and check the reasons for the execution failure.
[0075] The embodiment of the present invention can ensure that sequential asynchronous tasks in different batches of the same group are executed in different task execution periods.
[0076] The following further introduces the asynchronous task execution method provided by the embodiment of the present invention.
[0077] Optionally, the aforementioned sequential asynchronous task definition item includes: the current execution task sequence number of the sequential asynchronous task group.
[0078] Optional, such as Figure 3 As shown, the asynchronous task execution method provided by the embodiment of the present invention may include the following steps:
[0079] Step 301: Combine multiple related sequential asynchronous tasks to obtain a sequential asynchronous task group, and define the sequential asynchronous task group in a sequential asynchronous task definition table based on the sequential asynchronous task definition items.
[0080] Step 302: Add multiple sequential asynchronous tasks to a sequential asynchronous task execution table based on the sequential asynchronous task execution item.
[0081] Step 303: Based on the parallel strategy, task sequence number, and regular asynchronous task execution item, add this batch of sequential asynchronous tasks to the regular asynchronous task execution table.
[0082] Step 304: Update the currently executed task sequence number of the sequential asynchronous task group to the task sequence number of the current batch of sequential asynchronous tasks.
[0083] In a specific example, the task numbers of this batch of sequential asynchronous tasks are 2 and 3, so the currently executing task numbers in the sequential asynchronous task definition table are updated to 2 and 3.
[0084] Optionally, after step 304, if this batch of sequential asynchronous tasks is the first batch of the corresponding sequential asynchronous task group, then the corresponding group task status in the sequential asynchronous task definition table is updated to being executed.
[0085] Optionally, if this batch of sequential asynchronous tasks is the last batch of the corresponding sequential asynchronous task group, then after this batch of sequential asynchronous tasks is successfully executed, the corresponding group task status in the sequential asynchronous task definition table is updated to execution success.
[0086] Optionally, after step 304, the submission time of the corresponding group task in the sequential asynchronous task definition table is updated to the submission time of the current batch of sequential asynchronous tasks.
[0087] Step 305: Execute the batch of sequential asynchronous tasks in the corresponding task execution period based on the regular asynchronous task execution table.
[0088] Step 306 : When the execution status of the current batch of sequential asynchronous tasks is successful, the number of tasks in the next batch is determined based on the parallel strategy and / or the number of unadded sequential asynchronous tasks.
[0089] Step 307: Obtain sequential asynchronous tasks whose task numbers are greater than the maximum number of the currently executed task and not greater than the sum of the maximum number of the currently executed task and the number of tasks in the next batch, and obtain the next batch of sequential asynchronous tasks.
[0090] In a specific example, the number of the next batch of tasks is 2, and sequential asynchronous tasks with task numbers greater than 3 and not greater than 5 are obtained, that is, the sequential asynchronous tasks with task numbers 4 and 5 obtain the next batch of sequential asynchronous tasks.
[0091] Step 308: Add the next batch of sequential asynchronous tasks to the regular asynchronous task execution table based on the regular asynchronous task execution item.
[0092] The embodiment of the present invention can determine the next batch of sequential asynchronous tasks in a more convenient manner, thereby improving the execution efficiency of the next batch of sequential asynchronous tasks.
[0093] The following further introduces the asynchronous task execution method provided by the embodiment of the present invention.
[0094] Optionally, the sequential asynchronous task definition item includes a group executable state of the sequential asynchronous task group.
[0095] Specifically, the above-mentioned group executable status includes executable and non-executable.
[0096] Optional such as Figure 4 As shown, the asynchronous task execution method provided by the embodiment of the present invention may include the following steps:
[0097] Step 401: Combine multiple related sequential asynchronous tasks to obtain a sequential asynchronous task group, and define the sequential asynchronous task group in a sequential asynchronous task definition table based on the sequential asynchronous task definition items.
[0098] Step 402: Add multiple sequential asynchronous tasks to a sequential asynchronous task execution table based on the sequential asynchronous task execution item.
[0099] Step 403: Acquire the group executable state of the sequential asynchronous task group from the sequential asynchronous task group.
[0100] Step 404 , when the group executable state is executable, based on the parallel strategy, task sequence number and regular asynchronous task execution items, multiple sequential asynchronous tasks are added to the regular asynchronous task execution table in batches by adding one batch in each task execution period.
[0101] Optionally, when the executable state is not executable, the sequential asynchronous tasks in the corresponding sequential asynchronous task group are not added to the regular asynchronous task execution table.
[0102] Step 405 : Execute each batch of sequential asynchronous tasks in a corresponding task execution period based on the corresponding regular asynchronous task execution table.
[0103] It is understandable that the associated sequential asynchronous tasks in a sequential asynchronous task group may be temporarily unable to execute due to common parameter missing, common configuration errors, common data not initialized, etc. By defining the group executable status of the sequential asynchronous task group as a whole in the sequential asynchronous task definition table, invalid scheduling or conflicts can be avoided efficiently, thereby avoiding resource waste to the greatest extent.
[0104] The following further describes the asynchronous task execution method provided by the embodiment of the present invention. Figure 5 As shown, the following steps may be included:
[0105] Step 501: define multiple sequential asynchronous tasks in a conventional asynchronous task definition table based on conventional asynchronous task definition items.
[0106] Optionally, the above-mentioned regular asynchronous task definition items include the task identifier, service code, execution start time, execution end time, task priority, whether retry is allowed, retry strategy, retryable error code, executable status, success rate threshold and time threshold of the corresponding asynchronous task.
[0107] It can be understood that defining sequential asynchronous tasks not only in the sequential asynchronous task definition table but also in the regular asynchronous task definition table can facilitate unified management and scheduling of sequential asynchronous tasks and non-sequential asynchronous tasks.
[0108] Specifically, the above-mentioned multiple sequential asynchronous tasks may be defined in a sequential asynchronous task definition table first, and then defined in a regular asynchronous task definition table.
[0109] Optionally, the process of defining multiple sequential asynchronous tasks in the conventional asynchronous task definition table based on the conventional asynchronous task definition item includes: defining the execution start time and execution end time of the multiple sequential asynchronous tasks as the same or similar time.
[0110] Step 502: Add multiple sequential asynchronous tasks to an asynchronous task scheduling table based on the asynchronous task scheduling item.
[0111] Optionally, the asynchronous task scheduling item includes the next schedulable time of the asynchronous task.
[0112] Optionally, the above asynchronous task scheduling items also include the task identifier of the corresponding asynchronous task, the 120s execution success rate, the 30min execution success rate, the 120s execution time, the 30min execution time, the most recent scheduling time and the next schedulable time.
[0113] Specifically, the 120-second execution success rate and 30-minute execution success rate can be understood as the probability of the corresponding asynchronous task successfully executing within 120 seconds and the probability of the corresponding asynchronous task successfully executing within 30 minutes. The 120-second execution time and 30-minute execution time can be understood as the average execution time of asynchronous tasks successfully executing within 120 seconds and the average execution time of asynchronous tasks successfully executing within 30 minutes.
[0114] Step 503: Combine the associated multiple sequential asynchronous tasks to obtain a sequential asynchronous task group, and define the sequential asynchronous task group in a sequential asynchronous task definition table based on the sequential asynchronous task definition item.
[0115] Step 504 : Add multiple sequential asynchronous tasks to a sequential asynchronous task execution table based on the sequential asynchronous task execution item.
[0116] Step 505 : Based on the parallel strategy, task sequence numbers, and regular asynchronous task execution items, multiple sequential asynchronous tasks are added to the regular asynchronous task execution table in batches, with one batch added in each task execution period.
[0117] Step 506 : Execute each batch of sequential asynchronous tasks in a corresponding task execution period based on the conventional asynchronous task definition table, the asynchronous task scheduling table, and the conventional asynchronous task execution table.
[0118] In a specific example, the process of executing batches of sequential asynchronous tasks in corresponding task execution periods based on the conventional asynchronous task definition table, the asynchronous task scheduling table, and the conventional asynchronous task execution table includes:
[0119] Step (1.1) for each batch of sequential asynchronous tasks, obtain the execution start time, execution end time, and executable status of the batch of sequential asynchronous tasks from the general asynchronous task definition table, and determine whether the batch of sequential asynchronous tasks is within the executable time based on the corresponding execution start time and the corresponding execution end time;
[0120] Step (1.2): If the batch of sequential asynchronous tasks is within the executable time and the executable status of the batch of sequential asynchronous tasks is executable, then obtain the next schedulable time of the batch of sequential asynchronous tasks from the asynchronous task scheduling table, and determine whether the corresponding next schedulable time is earlier than the current time;
[0121] In step (1.3), if the next schedulable time is earlier than the current time, the corresponding core parameters are obtained from the regular asynchronous task execution table, and the batch of sequential asynchronous tasks is executed based on the corresponding core parameters.
[0122] Optionally, if the batch of sequential asynchronous tasks is not within the executable time or the executable status of the batch of sequential asynchronous tasks is not executable, the batch of sequential asynchronous tasks is skipped.
[0123] Optionally, if the next schedulable time is not earlier than the current time, skip this batch of sequential asynchronous tasks.
[0124] Optionally, if the execution of this batch of sequential asynchronous tasks fails, and the general asynchronous task definition table defines that this batch of sequential asynchronous tasks allows retries, and the general asynchronous task definition table defines the retry strategy and retry code of this batch of sequential asynchronous tasks, then the task status of this batch of sequential asynchronous tasks in the general asynchronous task execution table is modified to pending execution, and the number of retries of this batch of sequential asynchronous tasks in the general asynchronous task execution table is increased by 1, waiting for the next scheduling of this batch of sequential asynchronous tasks.
[0125] Optionally, when this batch of sequential asynchronous tasks is executed successfully, the 120s execution success rate, 30min execution success rate, 120s execution time and 30min execution time of this batch of sequential asynchronous tasks are recalculated, and the next schedulable time of this batch of sequential asynchronous tasks is determined based on the corresponding calculation results, and the value of the next schedulable time of this batch of sequential asynchronous tasks in the asynchronous task scheduling table is updated.
[0126] Optionally, when the batch of sequential asynchronous tasks is successfully executed, the latest scheduling time in the asynchronous task scheduling table is updated based on the scheduling time of the batch of sequential asynchronous tasks.
[0127] Optionally, when this batch of sequential asynchronous tasks is executed successfully, the time consumption threshold of this batch of sequential asynchronous tasks is obtained from the general asynchronous task definition table, and the next schedulable time of this batch of sequential asynchronous tasks is determined based on whether the time consumption of executing this batch of sequential asynchronous tasks exceeds the above time consumption threshold.
[0128] Optionally, after this batch of sequential asynchronous tasks starts execution, the task status of this batch of sequential asynchronous tasks in the general asynchronous task execution table is updated to executing, and when this batch of sequential asynchronous tasks is successfully executed, the task status of this batch of sequential asynchronous tasks in the general asynchronous task execution table is updated to executed successfully.
[0129] Step 507: Define a non-sequential asynchronous task in a regular asynchronous task definition table based on the regular asynchronous task definition item.
[0130] Step 508: Add the non-sequential asynchronous task to the asynchronous task scheduling table based on the asynchronous task scheduling item.
[0131] Step 509: Add the non-sequential asynchronous task to the regular asynchronous task execution table based on the regular asynchronous task execution item.
[0132] Step 510: Execute the non-sequential asynchronous task based on the conventional asynchronous task definition table, the asynchronous task scheduling table, and the conventional asynchronous task execution table.
[0133] In a specific example, the process of executing the non-sequential asynchronous task based on the conventional asynchronous task definition table, the asynchronous task scheduling table, and the conventional asynchronous task execution table includes:
[0134] Step (2.1) obtains the execution start time, execution end time, and executable state of the non-sequential asynchronous task from the regular asynchronous task definition table, and determines whether the non-sequential asynchronous task is within the executable time based on the corresponding execution start time and the corresponding execution end time;
[0135] In step (2.2), if the non-sequential asynchronous task is within the executable time and the executable state of the non-sequential asynchronous task is executable, the next schedulable time of the non-sequential asynchronous task is obtained from the asynchronous task scheduling table, and it is determined whether the corresponding next schedulable time is earlier than the current time;
[0136] In step (2.3), if the next schedulable time is earlier than the current time, the corresponding core parameters are obtained from the regular asynchronous task execution table, and the non-sequential asynchronous task is executed based on the corresponding core parameters.
[0137] Optionally, if the non-sequential asynchronous task is not within the executable time or the executable state of the non-sequential asynchronous task is not executable, the non-sequential asynchronous task is skipped.
[0138] Optionally, if the next schedulable time is not earlier than the current time, the non-sequential asynchronous task is skipped.
[0139] Optionally, if the non-sequential asynchronous task fails to execute, and the regular asynchronous task definition table defines that the non-sequential asynchronous task allows retry, and the regular asynchronous task definition table defines the retry strategy and retry code of the non-sequential asynchronous task, then the task status of the non-sequential asynchronous task in the regular asynchronous task execution table is modified to pending execution, and the number of retries of the non-sequential asynchronous task in the regular asynchronous task execution table is increased by 1, waiting for the next scheduling of the non-sequential asynchronous task.
[0140] Optionally, when a non-sequential asynchronous task is executed successfully, the 120s execution success rate, 30min execution success rate, 120s execution duration and 30min execution duration of the non-sequential asynchronous task are recalculated, and the next schedulable time of the non-sequential asynchronous task is determined based on the corresponding calculation results, and the value of the next schedulable time of the non-sequential asynchronous task in the asynchronous task scheduling table is updated.
[0141] Optionally, when the non-sequential asynchronous task is successfully executed, the latest scheduling time in the asynchronous task scheduling table is updated based on the current scheduling time of the non-sequential asynchronous task.
[0142] Optionally, when a non-sequential asynchronous task is executed successfully, the time threshold of the non-sequential asynchronous task is obtained from the regular asynchronous task definition table, and the next schedulable time of the non-sequential asynchronous task is determined based on whether the time taken to execute the non-sequential asynchronous task exceeds the above time threshold.
[0143] Optionally, the above process of executing non-sequential asynchronous tasks based on the conventional asynchronous task definition table, asynchronous task scheduling table and conventional asynchronous task execution table includes: obtaining the task priority of the non-sequential asynchronous task from the conventional asynchronous task definition table, and scheduling the non-sequential asynchronous task based on the principle of prioritizing tasks with higher priority.
[0144] The implementation of the present invention directly adds a sequential asynchronous task definition table and a sequential asynchronous task execution table on top of the conventional asynchronous task definition table and the conventional asynchronous task execution table, rather than designing an independent sequential asynchronous task processing logic. Therefore, when processing sequential asynchronous tasks and non-sequential asynchronous tasks, the embodiment of the present invention can avoid the excessive concurrency of sequential asynchronous tasks at a lower cost, and does not impose concurrency restrictions when executing non-sequential asynchronous tasks, thereby effectively reducing system resource consumption and improving resource utilization at a lower cost.
[0145] Figure 6 This is a structural diagram of an asynchronous task execution device provided by an embodiment of the present invention, which is suitable for executing the asynchronous task execution method provided by an embodiment of the present invention. Figure 6 As shown, the device may specifically include:
[0146] Sequential asynchronous task group acquisition and definition module 601 is used to combine multiple related sequential asynchronous tasks to obtain a sequential asynchronous task group and define the sequential asynchronous task group in a sequential asynchronous task definition table based on the sequential asynchronous task definition items, which include the sequential asynchronous task group's parallel strategy. This module can comprehensively define multiple related sequential asynchronous tasks, including the overall parallel strategy, and facilitates adding these sequential asynchronous tasks to the regular asynchronous task definition table in batches based on the corresponding parallel strategy.
[0147] Optionally, the sequential asynchronous task definition item includes: execution failure strategy, which includes allowing skipping and not running skipping.
[0148] Optionally, the sequential asynchronous task definition item includes: the currently executed task sequence number of the sequential asynchronous task group.
[0149] Optionally, the sequential asynchronous task definition item includes a group executable state of the sequential asynchronous task group.
[0150] Sequential Asynchronous Task Execution Table Adding Module 602 is used to add multiple sequential asynchronous tasks to the sequential asynchronous task execution table based on sequential asynchronous task execution items. The sequential asynchronous task execution items include the task sequence number of each sequential asynchronous task in the corresponding sequential asynchronous task group. This module can comprehensively manage the sequential asynchronous tasks in the corresponding sequential asynchronous task group and facilitates adding the sequential asynchronous tasks in the corresponding sequential asynchronous task group to the regular asynchronous task definition table in batches based on the task sequence numbers in the sequential asynchronous task execution table.
[0151] The regular asynchronous task execution table addition module 603 is used to add multiple sequential asynchronous tasks to the regular asynchronous task execution table in batches, adding one batch per task execution period, based on the parallelization strategy, task sequence number, and regular asynchronous task execution items. The method implemented by this module for adding sequential asynchronous tasks to the regular asynchronous task execution table can facilitate the execution of different batches of sequential asynchronous tasks in different execution periods, thereby helping to avoid high concurrency of sequential asynchronous tasks.
[0152] Optionally, the regular asynchronous task execution items include: the task status of each asynchronous task.
[0153] Optionally, the above-mentioned regular asynchronous task execution table adding module 603 can be specifically used to, after adding each batch of sequential asynchronous tasks to the regular asynchronous task execution table, obtain the execution status of the current batch of sequential asynchronous tasks from the regular asynchronous task execution table; determine the number of tasks in the next batch based on the parallel strategy and / or the number of unadded sequential asynchronous tasks, and the unadded sequential asynchronous tasks are the sequential asynchronous tasks in the sequential asynchronous task group that have not been added to the regular asynchronous task execution table; obtain the sequential asynchronous tasks with the smallest serial number and a total amount of the next batch of tasks among the unadded sequential asynchronous tasks to obtain the next batch of sequential asynchronous tasks; when the execution status of the current batch of sequential asynchronous tasks is successful execution, add the next batch of sequential asynchronous tasks to the regular asynchronous task execution table based on the regular asynchronous task execution items.
[0154] Optionally, the above-mentioned regular asynchronous task execution table adding module 603 can be specifically used to obtain the execution failure strategy of the sequential asynchronous task group from the sequential asynchronous task definition table when the execution status of this batch of sequential asynchronous tasks is execution failure; when the execution failure strategy is to allow skipping, skip the current batch of sequential asynchronous tasks that failed to execute, start execution based on the regular asynchronous task execution items to add the next batch of sequential asynchronous tasks to the regular asynchronous task execution table; when the execution failure strategy is to not allow skipping, stop adding the unadded sequential asynchronous tasks to the regular asynchronous task execution table.
[0155] Optionally, the conventional asynchronous task execution table adding module 603 can be specifically used to update the currently executed task sequence number of the sequential asynchronous task group to the task sequence number of the batch of sequential asynchronous tasks after adding the batch of sequential asynchronous tasks to the conventional asynchronous task execution table.
[0156] Optionally, the above-mentioned conventional asynchronous task execution table adding module 603 can be specifically used to obtain sequential asynchronous tasks whose task numbers are greater than the maximum number of the currently executed task number and not greater than the sum of the maximum number of the currently executed task number and the number of the next batch of tasks, to obtain the next batch of sequential asynchronous tasks.
[0157] Execution module 604 is used to execute batches of sequential asynchronous tasks during the corresponding task execution period based on the corresponding regular asynchronous task execution table. This module, combined with modules 601 to 603, can execute different batches of sequential asynchronous tasks during different execution periods, thereby avoiding high concurrency of sequential asynchronous tasks, thereby reducing system resource consumption, improving resource utilization, and improving system performance to ensure stable system operation.
[0158] Optionally, the asynchronous task execution device provided by the embodiment of the present invention further includes: a regular asynchronous task definition module, which is used to define multiple sequential asynchronous tasks in a regular asynchronous task definition table based on regular asynchronous task definition items.
[0159] Optionally, the asynchronous task execution device provided by the embodiment of the present invention further includes: an asynchronous task scheduling table adding module, which is used to add multiple sequential asynchronous tasks to the asynchronous task scheduling table based on the asynchronous task scheduling items.
[0160] Optionally, the execution module 604 can be specifically configured to execute batches of sequential asynchronous tasks based on a conventional asynchronous task definition table, an asynchronous task scheduling table, and a conventional asynchronous task execution table.
[0161] Optionally, the aforementioned conventional asynchronous task definition module can also be specifically used to define non-sequential asynchronous tasks in a conventional asynchronous task definition table based on conventional asynchronous task definition items.
[0162] Optionally, the aforementioned asynchronous task scheduling table adding module can also be specifically used to add non-sequential asynchronous tasks to the asynchronous task scheduling table based on the asynchronous task scheduling items.
[0163] Optionally, the aforementioned conventional asynchronous task execution table adding module can also be specifically used to add non-sequential asynchronous tasks to the conventional asynchronous task execution table based on conventional asynchronous task execution items.
[0164] Optionally, the aforementioned execution module 604 can be specifically configured to execute batches of sequential asynchronous tasks in corresponding task execution periods based on a conventional asynchronous task definition table, an asynchronous task scheduling table, and a conventional asynchronous task execution table.
[0165] Optionally, the aforementioned execution module 604 can be specifically used to execute non-sequential asynchronous tasks based on a conventional asynchronous task definition table, an asynchronous task scheduling table, and a conventional asynchronous task execution table.
[0166] Optionally, the asynchronous task execution device provided by an embodiment of the present invention also includes: a group executable status acquisition module, which is used to obtain the group executable status of the sequential asynchronous task group from the sequential asynchronous task group before adding multiple sequential asynchronous tasks to the regular asynchronous task execution table in batches in each task execution period based on the parallel strategy, task sequence number and regular asynchronous task execution items.
[0167] Optionally, the aforementioned regular asynchronous task execution table adding module 603 can be specifically used to add multiple sequential asynchronous tasks to the regular asynchronous task execution table in batches by adding a batch in each task execution period based on the parallel strategy, task sequence number and regular asynchronous task execution items when the group executable state is executable.
[0168] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0169] An embodiment of the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the asynchronous task execution method provided in any of the above embodiments is implemented.
[0170] An embodiment of the present invention further provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the asynchronous task execution method provided by any of the above embodiments is implemented.
[0171] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the asynchronous task execution method as described in any one of the embodiments of the present invention.
[0172] Reference below Figure 7 , which shows a schematic structural diagram of a computer system 700 of an electronic device suitable for implementing an embodiment of the present invention. Figure 7 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0173] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the system 700 are also stored in the RAM 703. The CPU 701, ROM 702, and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0174] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output section 707 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 708 including a hard disk; and a communication section 709 including a network interface card such as a LAN card or a modem. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 710 as needed, so that computer programs read therefrom can be installed into the storage section 708 as needed.
[0175] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from a removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0176] It should be noted that the computer-readable medium described in the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A 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 thereof. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.
[0177] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0178] The modules and / or units involved in the embodiments of the present invention may be implemented in software or hardware. The modules and / or units described may also be provided in a processor. For example, they may be described as follows: a processor including a sequential asynchronous task group acquisition and definition module, a sequential asynchronous task execution table addition module, a regular asynchronous task execution table addition module, and an execution module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.
[0179] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device executes: combining multiple associated sequential asynchronous tasks to obtain a sequential asynchronous task group, and defining the sequential asynchronous task group in a sequential asynchronous task definition table based on a sequential asynchronous task definition item, the sequential asynchronous task definition item including a parallel strategy for the sequential asynchronous task group; adding multiple sequential asynchronous tasks to the sequential asynchronous task execution table based on a sequential asynchronous task execution item, the sequential asynchronous task execution item including the task sequence number of each sequential asynchronous task in the corresponding sequential asynchronous task group; adding multiple sequential asynchronous tasks to the regular asynchronous task execution table in batches in each task execution period based on the parallel strategy, the task sequence number and the regular asynchronous task execution item; and executing each batch of sequential asynchronous tasks in the corresponding task execution period based on the corresponding regular asynchronous task execution table.
[0180] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. An asynchronous task execution method, characterized in that: include: Combining the associated plurality of sequential asynchronous tasks to obtain a sequential asynchronous task group, and defining the sequential asynchronous task group in a sequential asynchronous task definition table based on a sequential asynchronous task definition item, wherein the sequential asynchronous task definition item includes a parallel strategy for the sequential asynchronous task group; Adding the plurality of sequential asynchronous tasks to a sequential asynchronous task execution table based on a sequential asynchronous task execution item, wherein the sequential asynchronous task execution item includes a task sequence number of each sequential asynchronous task in a corresponding sequential asynchronous task group; Based on the parallel strategy, the task sequence number and the regular asynchronous task execution item, the plurality of sequential asynchronous tasks are added to the regular asynchronous task execution table in batches in a manner of adding one batch in each task execution period; as well as Execute batches of sequential asynchronous tasks in corresponding task execution periods based on corresponding regular asynchronous task execution tables.
2. The asynchronous task execution method according to claim 1, wherein: The conventional asynchronous task execution items include: task status of each asynchronous task; The adding of the plurality of sequential asynchronous tasks to the regular asynchronous task execution table in batches in each task execution period based on the parallel strategy, the task sequence number, and the regular asynchronous task execution item includes: After adding each batch of sequential asynchronous tasks to the regular asynchronous task execution table, obtaining the execution status of the batch of sequential asynchronous tasks from the regular asynchronous task execution table; Determining the number of tasks in the next batch based on the parallel strategy and / or the number of unadded sequential asynchronous tasks, wherein the unadded sequential asynchronous tasks are sequential asynchronous tasks in the sequential asynchronous task group that have not been added to the regular asynchronous task execution table; Obtaining the sequential asynchronous tasks whose total amount is equal to the number of tasks in the next batch and whose sequence number is the smallest among the unadded sequential asynchronous tasks to obtain the next batch of sequential asynchronous tasks; and When the execution status of the current batch of sequential asynchronous tasks is successful, the next batch of sequential asynchronous tasks is added to the regular asynchronous task execution table based on the regular asynchronous task execution item.
3. The asynchronous task execution method according to claim 2, wherein: The sequential asynchronous task definition item includes: an execution failure strategy, wherein the execution failure strategy includes allowing skipping and not running skipping; The method further comprises: When the execution status of the batch of sequential asynchronous tasks is execution failure, obtaining the execution failure strategy of the sequential asynchronous task group from the sequential asynchronous task definition table; When the execution failure strategy is to allow skipping, skipping the batch of sequential asynchronous tasks that failed to execute, starting the execution of the conventional asynchronous task execution item based on the conventional asynchronous task to add the next batch of sequential asynchronous tasks to the conventional asynchronous task execution table; When the execution failure policy is not to allow skipping, the adding of the unadded sequence asynchronous task to the regular asynchronous task execution table is stopped.
4. The asynchronous task execution method according to claim 2, characterized in that: The sequential asynchronous task definition item includes: the currently executed task sequence number of the sequential asynchronous task group; The method further comprises: after adding the batch of sequential asynchronous tasks to the regular asynchronous task execution table, updating the currently executed task sequence number of the sequential asynchronous task group to the task sequence number of the batch of sequential asynchronous tasks; The obtaining of the sequential asynchronous tasks whose total amount is equal to the number of the next batch of tasks and whose sequence numbers are the smallest among the unadded sequential asynchronous tasks to obtain the next batch of sequential asynchronous tasks includes: Get the sequential asynchronous tasks whose task numbers are greater than the maximum number of the currently executing task numbers and not greater than the sum of the maximum number of the currently executing task numbers and the number of tasks in the next batch, and get the next batch of sequential asynchronous tasks.
5. The asynchronous task execution method according to claim 1, wherein: Before executing each batch of sequential asynchronous tasks in the corresponding task execution period based on the corresponding regular asynchronous task execution table, the method further includes: defining the plurality of sequential asynchronous tasks in a regular asynchronous task definition table based on a regular asynchronous task definition item; and adding the plurality of sequential asynchronous tasks to an asynchronous task scheduling table based on the asynchronous task scheduling item; The executing of each batch of sequential asynchronous tasks in the corresponding task execution period based on the corresponding conventional asynchronous task execution table includes: Execute batches of sequential asynchronous tasks in corresponding task execution periods based on the conventional asynchronous task definition table, the asynchronous task scheduling table, and the conventional asynchronous task execution table.
6. The asynchronous task execution method according to claim 5, characterized in that: Also includes: Define a non-sequential asynchronous task in a regular asynchronous task definition table based on a regular asynchronous task definition item; Adding the non-sequential asynchronous task to an asynchronous task scheduling table based on the asynchronous task scheduling item; Adding the non-sequential asynchronous task to a regular asynchronous task execution table based on a regular asynchronous task execution item; as well as The non-sequential asynchronous task is executed based on the conventional asynchronous task definition table, the asynchronous task scheduling table, and the conventional asynchronous task execution table.
7. The asynchronous task execution method according to claim 1, characterized in that: The sequential asynchronous task definition item includes a group executable state of the sequential asynchronous task group; Before adding the plurality of sequential asynchronous tasks to the regular asynchronous task execution table in batches by adding one batch in each task execution period based on the parallel strategy, the task sequence number, and the regular asynchronous task execution item, the method further includes: Acquire a group executable state of the sequential asynchronous task group from the sequential asynchronous task group; The adding of the plurality of sequential asynchronous tasks to the regular asynchronous task execution table in batches in each task execution period based on the parallel strategy, the task sequence number, and the regular asynchronous task execution item includes: When the group executable state is executable, based on the parallel strategy, the task sequence number and the regular asynchronous task execution item, the multiple sequential asynchronous tasks are added to the regular asynchronous task execution table in batches by adding one batch in each task execution period.
8. An asynchronous task execution device, characterized in that: include: a sequential asynchronous task group acquisition and definition module, configured to combine a plurality of associated sequential asynchronous tasks to obtain a sequential asynchronous task group, and define the sequential asynchronous task group in a sequential asynchronous task definition table based on sequential asynchronous task definition items, wherein the sequential asynchronous task definition items include a parallel strategy for the sequential asynchronous task group; A sequential asynchronous task execution table adding module is used to add the plurality of sequential asynchronous tasks to the sequential asynchronous task execution table based on a sequential asynchronous task execution item, wherein the sequential asynchronous task execution item includes a task sequence number of each sequential asynchronous task in a corresponding sequential asynchronous task group; A conventional asynchronous task execution table adding module is used to add the plurality of sequential asynchronous tasks to the conventional asynchronous task execution table in batches by adding one batch in each task execution period based on the parallel strategy, the task sequence number and the conventional asynchronous task execution item; as well as The execution module is used to execute each batch of sequential asynchronous tasks in the corresponding task execution period based on the corresponding conventional asynchronous task execution table.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the asynchronous task execution method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the asynchronous task execution method according to any one of claims 1 to 7 is implemented.