Timer task automatic processing method and system
An automatic processing and task processing technology, applied in the computer field, can solve the problems of low utilization rate of system resources, low efficiency of Timer task processing, etc., and achieve the effect of improving utilization rate and concurrent processing ability
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0025] figure 1 The implementation flow of the timer task automatic processing method provided by Embodiment 1 of the present invention is shown, and the details are as follows:
[0026] In step S101, it is cyclically monitored whether a timer task enters the first preset queue.
[0027] In step S102, when it is detected that a timer task enters the first preset queue, the timer task is added to the second preset queue.
[0028] In the embodiment of the present invention, a queue is pre-established for storing timer tasks. The timer task can be a user-customized timing task, or a timing task generated by other application programs. There is no need to limit and invent here, and at the same time , to monitor the queue cyclically, so as to realize real-time discovery of user-defined timer tasks. When it is detected that a timer task enters the first preset queue, the timer task is added to the second preset queue, and the timer task is deleted from the first pre-queue.
[002...
Embodiment 2
[0037] In the embodiment of the present invention, the thread pool is used to execute the timer task, thereby preventing a large amount of system resource waste caused by frequent thread creation and destruction, so that more CPU time and memory can be used to process actual timer tasks (such as , commercial applications).
[0038] figure 2 The implementation flow of the timer task automatic processing method provided by Embodiment 2 of the present invention is shown, and the details are as follows:
[0039] In step S201, it is cyclically monitored whether there is a timer task entering in the first preset queue.
[0040] In step S202, when it is detected that a timer task enters the first preset queue, the timer task is added to the second preset queue.
[0041] In the embodiment of the present invention, a queue is pre-established for storing timer tasks. The timer task can be a user-customized timing task, or a timing task generated by other application programs. There i...
specific example
[0055] image 3 A specific example diagram of the timer task automatic processing method provided by Embodiment 3 of the present invention is shown, and the details are as follows:
[0056] In the embodiment of the present invention, the timer task automatic processing system includes three parts: a Web client, a server, and a database. The database can be used as a part of the server, or can be deployed independently. The query of failed tasks and the parameter configuration of timer tasks can be provided to users on the web client to facilitate the customization of user timer tasks; a thread pool for processing timer tasks and a thread pool for database access can be created on the server. DAO; the database is used to store timer-related data, for example: the first preset queue for storing user-defined timer tasks, the second preset queue for storing timer tasks entered from the first preset queue And a failed task queue for storing failed timer tasks in the thread pool. ...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 