Quartz-based batch general control automatic scheduling method and device, and storage medium

Through the quartz-based batch master control automatic scheduling method, the problems of low efficiency and low resource utilization of traditional task scheduling methods in complex business systems are solved, and efficient, reliable, and flexible task scheduling and resource utilization are achieved, and enhanced System scalability.

CN118796399AActive Publication Date: 2024-10-18CHENGDU TIENON TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411263251.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-10-18
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

Traditional task scheduling methods in complex business systems have problems such as low efficiency, low resource utilization, chaotic task execution, and lack of recovery mechanisms and monitoring capabilities. Especially in distributed system environments, it is difficult to achieve balanced distribution of tasks and collaborative work, affecting the system. performance and reliability.

Method used

Using quartz-based batch control automatic scheduling method, by pre-configuring batch task information maintenance table and batch control table, using quartz distributed scheduling-load balancing method to allocate tasks to the server side in the cluster, dynamically assemble task data and pass The reflection call of the Method class executes tasks to achieve centralized management and refined allocation of tasks.

Benefits of technology

It achieves efficient, reliable and flexible scheduling of tasks, reduces management costs, improves resource utilization and task execution effects, and enhances the scalability and flexibility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796399A_ABST
    Figure CN118796399A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a quartz-based batch general control automatic scheduling method and device and a storage medium, which can fully utilize the resources of a system and improve the overall performance and reliability of the system. Batch task information is preset at a master control end, the batch task information is obtained through timed triggering of an initialization platform or transaction initiation, batch control information is initialized, timed triggering of an execution platform is carried out, to-be-executed information is obtained from a batch control table, and the to-be-executed information is sent to the master control end. Then, the batch processing task is called to transmit parameters through a quartz distributed scheduling-load balancing method, the parameters are transmitted to a certain server side of a cluster, the batch processing task is called to process data for dynamic assembly, the data are stored in task data mapping, and a corresponding method is called in the execution process of the batch processing task of the server side through reflection of a Method. And then updating the batch control table, and repeating the process until the batch processing cannot be carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a batch master control automatic scheduling method, device and storage medium based on Quartz. Background Art

[0002] Traditional task scheduling methods have many limitations and shortcomings. For example, using simple timing tools or scripts to schedule tasks often lacks the ability to centrally manage and monitor tasks. This may lead to confusion and conflicts in task execution, as well as the inability to promptly discover and handle errors during task execution.

[0003] In some complex business systems, there may be a large number of tasks of different types, priorities, and execution cycles. If manual or simple scheduling methods are used, it is not only inefficient, but also difficult to ensure that tasks are accurately executed according to predetermined rules. In addition, traditional scheduling methods often lack effective recovery and rescheduling mechanisms when facing system failures, restarts, or resource shortages, which can easily lead to task delays or losses.

[0004] In a distributed system environment, traditional scheduling methods are also difficult to achieve balanced task allocation and collaborative work, and cannot fully utilize system resources, affecting the overall performance and reliability of the system.

[0005] It is in this context that the batch master control automatic scheduling mode based on Quartz came into being, aiming to solve the various problems faced by the above-mentioned traditional scheduling methods and provide an efficient, reliable, flexible and easy-to-manage task scheduling solution for complex business systems. Summary of the invention

[0006] The purpose of the present invention is to provide a batch master control automatic scheduling method based on Quartz, which provides an efficient, reliable, flexible and easy-to-manage task scheduling mode for complex business systems.

[0007] On the one hand, the batch master control automatic scheduling method based on Quartz includes the following steps: The batch master control automatic scheduling method based on Quartz is characterized by comprising the following steps: S1. The master control end pre-configures the batch task information maintenance table, and the platform timing trigger or transaction initiation trigger is assembled with the batch task information maintenance table into a batch control table; S2. When the platform is triggered on a scheduled basis, the batch control table is found and the information to be executed is obtained from the batch control table. The information to be executed includes the class of the task and the specific execution method. The name of the specific execution method is task execution method + [step]; S3. The master control end calls the batch task to pass the task class and specific execution method in the information to be executed, and passes the task class and specific execution method to different servers in the cluster through Quartz distributed scheduling-load balancing; S4. The server side dynamically assembles the class of the task passed and the specific execution method, and then stores them in the task data mapping on the server side. Then, the batch processing task on the server side is called to call the corresponding class and method in the task data mapping through reflection of the Method class. After the method is executed, the batch status in the batch control table is updated, and S2-S4 are repeated until batch processing cannot be performed.

[0008] Furthermore, the data items of the batch task information maintenance table are: Business category; Business serial number; The class of the task; Task execution method; Batch processing step sequence; Whether to schedule the task: 0-No 1-Yes; The time of the timing trigger; Cycle type: 1-year 2-season 3-month 4-week 5-day 6-hour 7-minute 8-second; Interval period; Last batch run time; The data items in the batch control table include: Batch number; Business category; Business serial number; The class of the task; Task execution method prefix; Batch status; Batch processing steps; The current processing step; Number of executions; Other information; The data items of the batch task information maintenance table are divided into three categories, including business information, task information, and time information; Business information includes business category and business serial number; Task information includes task class, task execution method, and batch processing steps; Time information includes whether it is a scheduled task, the time of the scheduled trigger, the cycle type, the interval cycle, and the last batch run time; The master control end obtains the business information and task information from the batch task information maintenance table, and registers the business information and task information in the batch control table; The batch number in the batch control table is generated according to the business category in the business information. The first step of the batch processing step in the task information is assigned to the current processing step as the initial value. The batch status has a default value of "0-unprocessed" and the execution count has a default value of 0.

[0009] Furthermore, the batch status in the batch control table includes: 0-unprocessed; 1-processing, 2-step completed, 3-step failed, 4-batch invalidated, 5-whole batch completed, 9-whole batch failed; when the batch status is 4-batch invalidated, 5-whole batch completed, 9-whole batch failed, the batch processing will no longer continue.

[0010] Furthermore, through the processing method of Quartz to batch process tasks, the parameters are dynamically assembled according to the batch information as follows: The data is stored in an array in the task data mapping, and the elements in the array include the batch business processing class corresponding to the business category, the task execution method and the current step.

[0011] Furthermore, the batch status flow is divided into step execution method status and method execution result: Step execution method status: Start the execution status of the unexecuted step from "0" to "1"; If a step fails, the failed step execution status will be re-initiated and changed from "3" to "1"; If a step fails continuously and the number of executions of the step is greater than or equal to 10 times, the entire batch fails and the status changes from "3" to "9".

[0012] Method execution results: When the method is executed successfully, the method execution result status changes from "1" to "2"; When the method execution fails, the method execution result status changes from "1" to "3"; There are no subsequent steps, and the method execution result status changes from "2" to "5"; When the manual work is invalid, the method execution result status changes from "Other" to "4".

[0013] Furthermore, a computer device includes: A memory for storing instructions; The processor is used to execute the instructions so as to realize the batch master control automatic scheduling method based on Quartz.

[0014] Furthermore, a computer-readable storage medium stores a computer program, which, when executed, can implement a batch master control automatic scheduling method based on Quartz.

[0015] The present invention has the beneficial effects: 1.By using the batch information maintenance table, the business information of different businesses is stored in it, which enables centralized management of a large number of tasks, reduces management costs and complexity, facilitates maintenance, and enhances the scalability and flexibility of the system, making it easy to add, modify and delete business information.

[0016] 2.Batch tasks are allocated through Quartz distributed scheduling-load balancing, which realizes the refined management of batch tasks and improves resource utilization and task execution effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a schematic diagram of the process of the present invention.

[0018] Figure 2 Maintains graph for batch task information.

[0019] Figure 3 It is a batch task control chart.

[0020] Figure 4 This is the state flow diagram of batch information. DETAILED DESCRIPTION

[0021] The present invention will be further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.

[0022] Example 1 See also Figures 1 to 4 , The batch master control automatic scheduling method based on Quartz includes the following steps: S1. The master control end pre-configures the batch task information maintenance table, and the platform timing trigger or transaction initiation trigger is assembled with the batch task information maintenance table into a batch control table; S2. When the platform is triggered on a scheduled basis, the batch control table is found and the information to be executed is obtained from the batch control table. The information to be executed includes the class of the task and the specific execution method. The name of the specific execution method is task execution method + [step]; S3. The master control end calls the batch task to pass the task class and specific execution method in the information to be executed, and passes the task class and specific execution method to the server end in the cluster through the Quartz distributed scheduling-load balancing method; S4. The server side dynamically assembles the class of the task passed and the specific execution method, and then stores them in the task data mapping on the server side. The batch processing task on the server side is called through the reflection of the Method class to call the corresponding class and method in the task data mapping. After the method is executed, the batch status is updated to the batch control table. Repeat S2-S4 until batch processing cannot be performed.

[0023] The corresponding classes and methods in the reflection call task data mapping of the Method class are as follows: For example, 1: Task data mapping content [job_bean: classA, job_method: A_deal0], calling the A_deal0 method of classA; For example, 2: Task data mapping content [job_bean: classA, job_method: A_deal1], calling the A_deal1 method of classA; For example, 3: Task data mapping content [job_bean: classB, job_method: B_deal1], calling the B_deal1 method of classB; Furthermore, the data items of the batch task information maintenance table are: Business category; Business serial number; The class of the task; Task execution method; Batch processing step sequence; Whether to schedule the task: 0-No 1-Yes; The time of the timing trigger; Cycle type: 1-year 2-season 3-month 4-week 5-day 6-hour 7-minute 8-second; Interval period; Last batch run time; The data items in the batch control table include: Batch number; Business category; Business serial number; The class of the task; Task execution method prefix; Batch status; Batch processing steps; The current processing step; Number of executions; Additional information.

[0024] The data items of the batch task information maintenance table are divided into three categories, including business information, task information, and time information.

[0025] Business information includes business category and business serial number; Task information includes task class, task execution method, and batch processing steps; Time information includes whether it is a scheduled task, the time of the scheduled trigger, the cycle type, the interval cycle, and the last batch run time.

[0026] The master control end obtains the business information and task information from the batch task information maintenance table, and registers the business information and task information in the batch control table.

[0027] The batch number in the batch control table is generated according to the business category in the business information. The first step of the batch processing step in the task information is assigned to the current processing step as the initial value. The batch status has a default value of "0-unprocessed" and the execution count has a default value of 0.

[0028] The batch control table is composed of the platform timing trigger or transaction initiation trigger and the batch task information maintenance table.

[0029] The platform obtains the class and actual execution method of the task in the corresponding batch control table through timed triggering of the master control end, calls the batch processing task to pass the class and actual execution method of the task as parameters to the server for processing, and calls the actual execution method under the class of the corresponding task through reflection of the Method class; then updates the batch control table, and the class and actual execution method of the task in the batch control table can be obtained without the platform being triggered by timed triggering, and repeats the above steps until batch processing cannot be performed.

[0030] Furthermore, the batch status in the batch control table includes: 0-unprocessed; 1-processing, 2-step completed, 3-step failed, 4-batch invalidated, 5-whole batch completed, 9-whole batch failed; when the batch status is 4-batch invalidated, 5-whole batch completed, 9-whole batch failed, the batch processing will no longer continue.

[0031] Furthermore, through the processing method of Quartz to batch process tasks, the parameters are dynamically assembled according to the batch information as follows: The data is stored in an array in the task data mapping, and the elements in the array contain the corresponding business categories, task execution methods and current steps in sequence.

[0032] For example: The class of the task is classA, the method of the task is A_deal, the current step is "0", and the task data mapping is stored in: [job_bean: classA, job_method: A_deal0] The class of the task is classB, the method of the task is B_deal, the current step is "1", and the task data mapping is stored in: [job_bean: classB, job_method: B_deal1] Furthermore, the batch status flow is as follows: Start the execution status of the unexecuted step from "0" to "1"; If a step fails, the failed step execution status will be re-initiated and changed from "3" to "1"; If a step fails continuously and the number of executions of the step is greater than or equal to 10 times, the entire batch fails and the status changes from "3" to "9".

[0033] When the method is executed successfully, the method execution result status changes from "1" to "2"; When the method execution fails, the method execution result status changes from "1" to "3"; There are no subsequent steps, and the method execution result status changes from "2" to "5"; When the manual work is invalid, the method execution result status changes from "Other" to "4".

[0034] Furthermore, a computer device includes: A memory for storing instructions; The processor is used to execute the instructions so as to realize the batch master control automatic scheduling method based on Quartz.

[0035] Furthermore, a computer-readable storage medium stores a computer program, which, when executed, can implement a batch master control automatic scheduling method based on Quartz.

[0036] It is understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.

Claims

1. The batch master control automatic scheduling method based on Quartz is characterized by: The following steps are involved: S1. The master control terminal pre-configures the batch task information maintenance table, and the platform timing trigger or transaction initiation trigger is assembled with the batch task information maintenance table into a batch control table; S2. When the platform is triggered on a scheduled basis, the batch control table is found and the information to be executed is obtained from the batch control table. The information to be executed includes the class of the task and the specific execution method. The name of the specific execution method is task execution method + [step]; S3. The master control end calls the batch task to pass the task class and specific execution method in the information to be executed, and passes the task class and specific execution method to different servers in the cluster through Quartz distributed scheduling-load balancing; S4. The server stores the class of the task and the specific execution method into the task data map on the server side, and then calls the batch processing task on the server side for dynamic assembly. The corresponding class and method in the task data map are called through reflection of the Method class. After the method is executed, the batch status is updated to the batch control table. S2-S4 are repeated until batch processing cannot be performed.

2. The batch master control automatic scheduling method based on Quartz according to claim 1 is characterized in that: The data items of the batch task information maintenance table are: Business category; Business serial number; The class of the task; Task execution method. The actual execution method name is the specific execution method, corresponding to the method name of the specific batch processing step; Batch processing step sequence; Whether to schedule the task: 0-No 1-Yes; The time of the timing trigger; Cycle type: 1-year 2-season 3-month 4-week 5-day 6-hour 7-minute 8-second; Interval period; Last batch run time; The data items in the batch control table include: Batch number; Business category; Business serial number; The class of the task; Task execution method; Batch processing steps; The current processing step; Batch status; Number of executions; Other information; The data items of the batch task information maintenance table are divided into three categories, including business information, task information, and time information; Business information includes business category and business serial number; Task information includes task class, task execution method, and batch processing steps; Time information includes whether it is a scheduled task, the time of the scheduled trigger, the cycle type, the interval cycle, and the last batch run time; The master control end obtains the business information and task information from the batch task information maintenance table, and registers the business information and task information in the batch control table; The batch number in the batch control table is generated according to the business category in the business information. The first step of the batch processing step in the task information is assigned to the current processing step as the initial value. The batch status has a default value of "0-unprocessed" and the execution count has a default value of 0.

3. The batch master control automatic scheduling method based on Quartz according to claim 2 is characterized in that: The batch status in the batch control table includes: 0-unprocessed; 1-processing, 2-step completed, 3-step failed, 4-batch invalidated, 5-batch completed, 9-batch failed; When the batch status is 4-batch invalidated, 5-batch completed, or 9-batch failed, the batch processing will not continue.

4. The batch master control automatic scheduling method based on Quartz according to claim 1 is characterized in that: By calling the batch processing task, the parameters are dynamically assembled according to the batch information as follows: The data is stored in an array in the task data map. The elements in the array contain the class corresponding to the business category and the task execution method prefix and the current processing step.

5. The batch master control automatic scheduling method based on Quartz according to claim 3 is characterized in that: The batch status flow is as follows: Start the unexecuted step execution status from "0" to "1"; If a step fails, the failed step execution status will be re-initiated and changed from "3" to "1"; If a step fails continuously and the number of executions of the step is greater than or equal to 10 times, the entire batch fails and the status changes from "3" to "9"; When the method is executed successfully, the method execution result status changes from "1" to "2"; When the method execution fails, the method execution result status changes from "1" to "3"; There are no subsequent steps, and the method execution result status changes from "2" to "5"; When this method step is interrupted manually, the method execution result status changes from "other" to "4".

6. A computer device, characterized in that: include A memory for storing instructions; The processor is used to execute the instructions so as to realize the batch master control automatic scheduling method based on Quartz.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, a batch master control automatic scheduling method based on quartz can be implemented.

Citation Information

Patent Citations

  • Interactive management system for C# interface data

    CN106648858A

  • Method and device for processing batch task scheduling

    CN106775985A

  • Batch task processing method, device and equipment and storage medium

    CN110806933A

  • Batch processing device and method based on distributed architecture

    CN111160873A