Batch task execution control method, system, program product, and related apparatus

By centrally managing the execution records of batch tasks through the task control center and communicating with services using the SDK, the problems of low development efficiency and high code duplication in existing technologies are solved, and efficient and unified management and monitoring of task execution are achieved.

CN122111583APending Publication Date: 2026-05-29HEBEI HAPPY CONSUMPTION FINANCE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEBEI HAPPY CONSUMPTION FINANCE CO LTD
Filing Date
2025-11-06
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, each service needs to create a separate table to record the task execution status, resulting in low development efficiency and high code duplication.

Method used

The task control center centrally manages the execution records of batch tasks, uses the SDK to communicate with services, and provides API and Java annotation access methods to uniformly manage task execution records and status.

Benefits of technology

It improves development efficiency, reduces code duplication, enables centralized management and unified monitoring of task execution, and supports timely warnings for task failures and timeouts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122111583A_ABST
    Figure CN122111583A_ABST
Patent Text Reader

Abstract

The present disclosure provides a batch task execution control method, system, program product and related device, which separates and centrally saves and manages task execution records, avoids repeated development, and can improve development efficiency. The method comprises the following steps: a task record table for centrally managing execution records of a plurality of batch tasks by a task control center; a service for executing batch tasks communicates with the task control center through an SDK to perform task control, wherein the operations performed through the SDK include: receiving task execution parameters transmitted by the service, the task execution parameters including a service name, a task execution date, a task type, a dependent sub-task list, a functional interface, and an identifier of whether the task can be repeatedly executed; calling the task control center according to the dependent sub-task list to query the execution status of dependent tasks in the task record table; and controlling the execution of the current task according to the execution status of the dependent tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer application technology, and more specifically, to batch task execution control methods, systems, program products, and related devices. Background Technology

[0002] The existing main method for batch task execution control is to save the execution record in the database table of the current service when each batch task is executed, recording the task execution status and time. When the task is executed again, the system first checks whether the current task record exists in the execution record table, or controls whether the task continues to execute based on the current task execution status.

[0003] Each service needs to create a table to record the task execution status, and each service needs to write similar task control and alert code, resulting in high repetition and low development efficiency. Summary of the Invention

[0004] This invention provides a batch task execution control method, system, program product, and related device, which extracts task execution records for centralized storage and management, avoiding redundant development and improving development efficiency.

[0005] On one hand, embodiments of the present invention relate to a batch task execution control method, which includes the following steps: a task record table that centrally manages the execution records of multiple batch tasks through a task control center; a service for executing batch tasks communicates with the task control center through an SDK to perform task control, wherein the operations performed through the SDK include:

[0006] Receive task execution parameters passed in by the service, the task execution parameters including service name, task execution date, task type, list of dependent subtasks, functional interface, and whether it can be executed repeatedly;

[0007] The task control center is invoked based on the list of dependent subtasks to query the execution status of dependent tasks in the task record table;

[0008] The execution of the current task is controlled based on the execution status of the dependent tasks.

[0009] In some embodiments of the present invention, the operations performed by the SDK further include: before the current task is executed, calling the task control center to generate an execution record of the current task and marking its status as being processed.

[0010] In some embodiments of the present invention, the operation performed by the SDK further includes: when the current task is in the final state, calling the task control center to update the execution record and update its status to success or failure.

[0011] In some embodiments of the present invention, the operations performed by the SDK further include: calling the task control center according to parameters including service name, execution date, and task type to query the execution record of the current task and determine whether to execute the current task; and / or, determining whether a task with a successful status should be executed repeatedly according to an identifier indicating whether it can be executed repeatedly.

[0012] In some embodiments of the present invention, the operations performed by the SDK further include: receiving the main logic for task execution through the functional interface, and controlling the execution of the task according to the main logic for task execution.

[0013] In some embodiments of the present invention, the operations performed by the SDK further include: capturing abnormal information during task execution; and calling the task control center to write the abnormal status into the task record table.

[0014] In some embodiments of the present invention, the method further includes: displaying the execution records and status information of each batch task through a background management page that communicates with the task control center.

[0015] In some embodiments of the present invention, the method further includes: querying the task record table through the task control center to issue an early warning for tasks that have not been completed or have failed due to timeout.

[0016] In some embodiments of the present invention, the task control center is invoked via an HTTP interface.

[0017] In some embodiments of the present invention, the SDK communicates with the service via API or Java annotation.

[0018] On the other hand, embodiments of the present invention relate to a system for implementing the batch task execution control method according to any embodiment of the present invention, comprising the task control center, the SDK, and a batch processing system providing the services for executing batch tasks. The batch processing system communicates with the task control center via the SDK.

[0019] Furthermore, embodiments of the present invention relate to a computer program product comprising a computer program that, when executed by a processor, performs any one of the operations described in any one embodiment of the present invention. Correspondingly, embodiments of the present invention also relate to a computer-readable storage medium storing a computer program that, when executed by a processor, performs any one of the operations described in any one embodiment of the present invention.

[0020] Furthermore, embodiments of the present invention relate to a computer device comprising: a memory storing a computer program thereon; and a processor that, when executing the computer program, performs any one of the operations described in any embodiment of the present invention.

[0021] According to the embodiments, the present invention has the following beneficial effects:

[0022] This invention establishes a task control center to centrally store and manage batch task execution records. The batch processing service can pass parameters, record, and control task step execution through the SDK interface. This centralized management and control of batch tasks results in low code duplication, ease of use, and improved efficiency.

[0023] This invention provides two standard access methods for the SDK: API and Java annotation, which are standardized and flexible to use.

[0024] This invention establishes a backend page management function for task execution records, allowing for unified viewing and maintenance of task execution status. Furthermore, this invention provides timely monitoring and early warning for task execution failures and timeouts.

[0025] The various aspects, features, advantages, etc., of the embodiments of the present invention will now be described in detail with reference to the accompanying drawings. Attached Figure Description

[0026] Figure 1 This is a schematic diagram illustrating an example of a batch task execution control system according to an embodiment of the present invention.

[0027] Figure 2 This is a schematic diagram illustrating an example of a batch task execution control method according to an embodiment of the present invention.

[0028] Figure 3 This is a schematic diagram illustrating an exemplary batch task execution control process according to an embodiment of the present invention.

[0029] Figure 4 This is a schematic diagram illustrating an example of a batch task execution control device according to an embodiment of the present invention. Detailed Implementation

[0030] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. It should be noted that the present invention can be implemented in various forms and is not limited to the specific embodiments described herein or shown in the accompanying drawings.

[0031] In this document, the terms “comprising,” “including,” and “having” are used to indicate the presence of certain features, steps, operations, elements, and / or components, but do not exclude the presence or addition of other features, steps, operations, elements, components, or combinations thereof. Unless explicitly defined by context, the terms “first,” “second,” and similar terms do not indicate any priority or order, but are used only to distinguish different objects in the description.

[0032] Furthermore, although the steps or operations of the method are described or shown in a certain order in this document or in the accompanying drawings, it should be understood that the method of the present invention is not necessarily performed in the order described or shown, and may have other suitable and different execution orders.

[0033] refer to Figure 1 The figure illustrates an example of a batch task execution control system according to an embodiment of the present invention. In an exemplary embodiment, the batch task execution control system includes a task control center 100, an SDK 200, and a batch processing system 300. The batch processing system 300 provides services for executing batch tasks (also referred to as "batch services") and communicates with the task control center 100 through the SDK 200 to achieve task execution control.

[0034] The following is combined with Figure 2 The processing procedure of the batch task execution control system according to the embodiments of the present invention is described in detail. This procedure can also be referred to as a batch task execution control method. Figure 2 This is a schematic diagram illustrating an example of the batch task execution control method.

[0035] In an exemplary implementation, such as Figure 2 As shown, the process includes the following steps: S100, a task record table that centrally manages the execution records of multiple batch tasks through a task control center; S200, a service for executing batch tasks communicates with the task control center via an SDK to perform task control, wherein the operations performed through the SDK include:

[0036] S201, Receive task execution parameters passed in by the service, the task execution parameters include service name, task execution date, task type, list of dependent subtasks, functional interface, and an identifier of whether it can be executed repeatedly;

[0037] S202, The task control center is invoked according to the list of dependent subtasks to query the execution status of dependent tasks in the task record table;

[0038] S203, control the execution of the current task according to the execution status of the dependent task.

[0039] In some implementations, in S201, the SDK connects with the batch processing system providing the service and passes parameters through one of the following two methods: one is through a standard API call; the other is through a Java annotation call.

[0040] In some implementations, in S202, the task control center is invoked via an HTTP request, and the task control center returns the queried execution status as a response to the caller.

[0041] In some implementations, in S203, the response is parsed to determine whether the execution status of the dependent task is successful. If it is, the execution of the current task is allowed; if the status of the dependent task is failure or incomplete, the execution of the current task is prevented.

[0042] In some implementations, the operations performed by the SDK further include: before the current task is executed, for example, by calling the task control center via an HTTP interface to generate an execution record for the current task and mark its status as "processing". In some implementations, when the current task has reached its final state, the task control center is called to update the execution record, changing its status to success or failure.

[0043] In some implementations, the operations performed through the SDK further include: invoking the task control center based on parameters including service name, execution date, and task type to query the execution record of the current task and determine whether to execute the current task; and / or, determining whether a task with a successful status should be executed again based on a repeatable execution flag. In some implementations, the query result determines whether the task has already been executed, and the "repeatable execution" flag is used to control whether the task can be executed again. For example, if the task has been successful but cannot be repeated, it will not be executed again.

[0044] In some implementations, the operations performed by the SDK further include: receiving the main task execution logic through the functional interface and controlling the execution of the task according to the main task execution logic. In some implementations, the batch service encapsulates the main task execution logic as a functional interface (such as Supplier or Runnable in Java) and passes it to the SDK. The SDK calls this functional interface to execute the task logic at an appropriate time (such as after dependency checks pass).

[0045] In some implementations, the operations performed by the SDK also include: capturing exception information during task execution; and calling the task control center to write the exception status into the task record table.

[0046] In some implementations, the method further includes: S300, displaying the execution records and status information of each batch task through a background management page communicating with the task control center. Specifically, the background management configuration web page displays the records and status.

[0047] In some implementations, the method further includes: S400, querying the task record table through the task control center to issue a warning for tasks that have not been completed or have failed due to timeout.

[0048] For example, this invention can be implemented using Java version 1.8 or higher and based on the Spring Boot framework. Figure 3 As shown, a task execution control center is set up to extract task execution records and store them in a database for centralized management. It also provides an SDK interface and Java annotations to the outside world. Batch services can record and control the execution of task steps by passing parameters through the SDK interface.

[0049] The batch processing system incorporates an SDK provided by the Task Control Center. This SDK offers two integration methods for the current batch processing system: one is through standard API calls, and the other is through Java annotation calls. For example... Figure 3 As shown, batch service A integrates the SDK package, and batch service B integrates annotations.

[0050] For batch processing systems invoked via standard APIs, the SDK for batch service A can automatically read parameters such as the service name (i.e., the channel name of the current batch processing system), execution date, task type, list of dependent subtasks, and whether the task can be repeated, and then pass these parameters to the SDK. After the parameters are passed, when the task is executed, the API provided by the SDK will call the task control center via HTTP, and the task control center will provide the SDK with the information query results via the API.

[0051] Batch service A uses the SDK to determine if the list of dependent subtasks in the current batch processing system is empty. If it is empty, it calls the task control center to query execution records and determine if the current task already has a record. If the current task does not have an execution record, it executes the current task and calls the task control center to record the task execution status, generating a web record for the caller to view the progress of batch processing. If the list of dependent subtasks is not empty, it calls the task control center to query execution records and determine if the dependent subtasks have been completed (i.e., executed successfully). If successful, it checks if the current task has an execution record, and allows the current task to execute if no execution record exists.

[0052] If the current task execution status is successful, then check whether the parameters of the current task contain a flag indicating that it can be executed repeatedly; if so, it can be executed repeatedly; otherwise, it cannot be executed repeatedly, and an exception is thrown to issue a warning and prevent duplicate batch execution.

[0053] Additionally, if the current task execution status is failed, the task control center is first invoked to update the status, and the batch processing continues. If the current task execution status is successful after continuing the batch processing, the task control center is invoked to update it to success. If the batch processing fails, the task control center is invoked again to update the failure status and an exception is thrown as a warning.

[0054] As described above, the task control center records the execution progress of each batch processing step. Furthermore, the task control center allows users, such as R&D personnel and business personnel, to view each step of the current batch processing and the task execution status via a web page.

[0055] In addition, the task control center can provide jobs so that users can poll the current batch processing steps from the web configuration or obtain them, compare them with the real-time batch processing steps, and check whether the status is successful. The current batch processing status can also be pushed to followers of the current batch processing channel via WeChat.

[0056] If the current batch processing system is invoked via annotations, such as batch service B, it obtains parameters similarly to batch service A. When the batch processing system starts running, the SDK intercepts the execution of each step through Spring AOP and calls the task control center via HTTP to query and update records. The specific processing is similar to the above and will not be repeated here.

[0057] It should be understood that the steps, processes, and operations described in the above embodiments can be implemented by computer software programs. Therefore, the embodiments of the present invention also relate to a computer program product, which includes a computer program that, when executed by a processor, implements the steps, processes, or operations of the method described in any embodiment of the present invention. In some embodiments, program code for executing the computer program of the embodiments of the present invention can be written in any combination of one or more programming languages. For example, the computer program can be written using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on a personal computing device, partially on a personal computing device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the personal computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0058] It should also be understood that the computer program product may be stored on a computer-readable storage medium, such as hard disks, floppy disks, magnetic tapes, optical disks, solid-state drives, flash memory, etc.

[0059] Furthermore, it can be understood that the method of any embodiment of the present invention can be executed by a computer device. Accordingly, embodiments of the present invention also relate to a computer device comprising: a memory storing a computer program thereon; and a processor that, when executing the computer program, implements the steps (processing, operations, etc.) of the method described in any embodiment of the present disclosure. Therefore, this computer device can also be referred to as a "batch task execution control device".

[0060] Figure 4 An exemplary structure of a computer device is shown. Figure 4 As shown, the computer device 100 may include at least a processor 101 and a memory 102, wherein the memory 102 may be or include a storage medium storing a computer program (or computer-readable instructions) thereon, and the processor 101 executes the computer program to perform some or all of the operations in the batch task execution control method described in any embodiment of the present disclosure.

[0061] In some embodiments, the computer device 100 may further include a data storage device 103, a display 104, a speaker 105, and a communication module 106. The processor 101, memory 102, and data storage device 103 communicate with each other via a bus and interact with peripheral devices, such as the display 104 and communication module 106, via the bus and I / O module 107.

[0062] Specifically, data storage device 103 can store application programs and their various configuration files and data. Computer programs are stored on memory 102. Processor 101 executes the computer programs to perform various processes, operations, or steps of the batch task execution control method. Display 104 can be used to display various data, charts, etc.

[0063] In optional embodiments, the communication module 106 may be omitted where communication with the other systems, devices, or equipment is not required. In some embodiments, the computer device 100 may further include a speaker 105 for voice output.

[0064] In some implementations, processor 101 may include any suitable semiconductor-based electronic processing unit, chip, microchip, or integrated circuit (IC). Memory 102 is a programmable memory, which may include any suitable electronic storage device configured to store instructions and be reprogrammable. For example, programmable memory may include an erasable programmable read-only memory (EPROM) device. Data storage device 103 may be a persistent storage device, which may include any suitable electronic storage configured to retain stored information as power cycles. For example, data storage device 103 may include a hard disk drive, solid-state drive (SSD), flash memory drive, hybrid drive, etc., or any combination thereof.

[0065] Therefore, processor 101 can control the output of information on I / O module 107 by storing information in memory and / or executing programs / instructions stored in memory. For example, several aspects of the batch task execution control method described herein can be executed by processor 101 according to programs / instructions stored in memory (e.g., memory 102 and / or data storage device 103).

[0066] Furthermore, the processor 101 can electronically communicate with the I / O module 107 and / or the communication module 106 to receive or send relevant instructions and information. The I / O module 107 may include any suitable mechanical or virtual user interface configured to enable a user to interact with the computer device 100 or to allow the user to perform one or more functions of the computer device 100 itself, such as a graphical user interface (GUI) on a screen or other display. In some instances, the user interface may include a voice interface capable of speech recognition, through which an operator can provide voice commands to the processor.

[0067] The communication module 106 may include any suitable devices and / or structures configured to facilitate information exchange between the computer device 100 and external electronic devices. The communication module 106 may include devices configured to send and / or receive wireless or wired information with other devices. For example, the communication module 106 may include an antenna, a transceiver, a connector for wired reception and / or transmission of data, a data exchange device, etc., or any combination thereof. The communication module 106 may also include ancillary components, such as filtering circuits, encryption / decryption circuits, and / or integrated circuit (IC) chips for processing signals (e.g., (Chip). In some implementations, the communication module 106 may include a WiFi device configured to connect to a local wireless network.

[0068] In some embodiments, computer device 100 may include a smartphone, wearable computer, portable / mobile electronic device, tablet computer, smartwatch, personal digital assistant (PDA), personal computer (PC), desktop computer, laptop computer, server, etc. Computer device 100 may include or have installed one or more application programs (APPs), one of which is configured to perform some or all of the operations of the batch task execution control method described herein.

[0069] Although not shown, it should be understood that the computer device 100 also includes a power supply component, which may include any suitable device and / or structure configured to provide an electrical interface between the computer device 100 and a power source. The power source may include any suitable source of electrical energy, such as a battery, socket, capacitor, fuel cell, etc., or any combination thereof. Additionally or optionally, the power source may be included within the power supply component. For example, a battery or battery pack may be included within the computer device 100. In some embodiments, the battery may be rechargeable, for example, charged via a cable or an interface provided by the power supply component. In some embodiments, the power supply component may share features with or repeat features of the communication module 106. For example, a USB or micro-USB cable connector may be included in the computer device 100, so that power supply or data communication is performed by the same component.

[0070] Those skilled in the art should understand that the above disclosure is merely illustrative of embodiments of the present invention, and the scope of patent protection sought in this application is not limited thereto. Various modifications, alterations, substitutions, and other changes can be made to the embodiments disclosed herein without departing from the spirit of the claims of this application, and such changes are within the scope covered by the claims of this application.

Claims

1. A batch task execution control method, characterized in that, The method includes the following steps: The task record table centrally manages the execution records of multiple batch tasks through the task control center; The service used to execute batch tasks communicates with the task control center via the SDK to perform task control, wherein the operations performed by the SDK include: Receive task execution parameters passed from the service, the task execution parameters including service name, task execution date, task type, list of dependent subtasks, functional interface, and whether it can be executed repeatedly; The task control center is invoked based on the list of dependent subtasks to query the execution status of dependent tasks in the task record table; The execution of the current task is controlled based on the execution status of the dependent tasks.

2. The method according to claim 1, characterized in that, The operations performed through the SDK also include: Before the current task is executed, the task control center is invoked to generate the execution record of the current task and mark its status as being processed.

3. The method according to claim 2, characterized in that, The operations performed through the SDK also include: When the current task is in the final state, the task control center is invoked to update the execution record and change its status to success or failure.

4. The method according to claim 2, characterized in that, The operations performed through the SDK also include: Based on parameters including service name, execution date, and task type, the task control center is invoked to query the execution record of the current task and determine whether to execute the current task; and / or Based on the flag indicating whether a task with a successful status can be executed repeatedly, determine whether to execute it again.

5. The method according to any one of claims 1 to 4, characterized in that, The operations performed through the SDK also include: The main logic for task execution is received through the functional interface, and the execution of the task is controlled according to the main logic for task execution.

6. The method according to claim 1, characterized in that, The operations performed through the SDK also include: Capture abnormal information during task execution; The task control center is invoked to write the abnormal status into the task record table.

7. The method according to claim 1, characterized in that, The method also includes: displaying the execution records and status information of each batch task through a background management page that communicates with the task control center.

8. The method according to claim 1, characterized in that, The method also includes: querying the task record table through the task control center to issue warnings for tasks that have not been completed or have failed due to timeouts.

9. The method according to any one of claims 1 to 4 and 6, characterized in that, The task control center is invoked via an HTTP interface.

10. The method according to claim 1, characterized in that, The SDK communicates with the service via API or Java annotations.

11. A system for implementing the batch task execution control method according to any one of claims 1 to 10, comprising the task control center, the SDK, and a batch processing system providing the services for executing batch tasks. in, The batch processing system communicates with the task control center through the SDK.

12. A computer program product comprising a computer program, characterized in that, When executed by a processor, the computer program performs any one of the operations of the method described in any one of claims 1 to 10.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program performs any one of the operations of the method described in any one of claims 1 to 10.

14. A computer device, characterized in that, include: A memory on which computer programs are stored; A processor that, when executing the computer program, performs any one of the operations of the method described in any one of claims 1 to 10.