Quartz framework-based task scheduling method and system, and terminal device
A task scheduling and task technology, applied in the computer field, can solve the problems of forgetting multi-account management, cumbersome account and password login operations, etc.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0034] Such as figure 1 As shown, the present embodiment provides a task scheduling method based on the Quartz framework, which specifically includes:
[0035] Step S101: Obtain the configuration file of the server, determine the cluster name variable corresponding to the server according to the configuration file of the server, and configure the attributes of the task scheduler of the Quartz framework according to the cluster name variable; the cluster name variable is used to distinguish Each cluster system.
[0036] It should be noted that the Quartz framework includes a task (JOB), a task trigger (Trigger) and a task scheduler (Scheduler). The task (JOB) is the object for scheduling and management by the Quartz framework. The task (JOB) provides an interface to the task implementation class. The task implementation class is the specific code for task execution. When the Quaqrtz framework executes the task (JOB), it will create A task instance (JobDeatail), through (JobDe...
Embodiment 2
[0050] Such as figure 2 As shown, in this embodiment, step S101 in Embodiment 1 specifically includes:
[0051] Step S201: Create a task scheduler through the interface of the Quartz framework.
[0052] Step S202: Set the instance name of the task scheduler to the cluster name variable.
[0053] In a specific application, a task scheduler (Scheduler) is created through the StdSchedulerFactory interface of the Quartz framework. The properties of the task scheduler are configured through the quartz.properties property configuration file of the scheduler. The above quartz.properties property configuration file is used to configure the properties of the task scheduler, thread pool and job storage.
[0054] In a specific application, the instance name (org.quartz.scheduler.instanceName) of the task scheduler is set as the above-mentioned cluster name variable through the quartz.properties attribute configuration file.
Embodiment 3
[0056] Such as image 3 As shown, in this embodiment, step S104 in Embodiment 1 specifically includes:
[0057] Step S301: Issue a task execution instruction through the task scheduler according to the task management table.
[0058] In a specific application, each task is assigned an execution time according to the execution status field, start time field, and end time field of each task in the task management table. The above execution status field is used to identify the execution status of the task, and the execution status includes not executed, in progress and executed. The above start time field and end time field are used to identify the time point when the execution of the task starts and the time point when the execution ends. The task scheduler generates and issues task execution instructions according to the task execution time, task code and task implementation class.
[0059] In a specific application, the above-mentioned task execution time may also consider ...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


