Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Universal timed task management realization method

A timing task and implementation method technology, applied in the direction of program startup/switching, multi-program device, etc., can solve the problems of complex programming and difficulty in ensuring that timing signals are triggered on time, and achieve the effect of simple operation and convenient integration

Inactive Publication Date: 2011-07-20
NANJING NRIET IND CORP
View PDF3 Cites 38 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The purpose of the present invention is to solve the problem that the programming is complicated or it is difficult to ensure that each timing signal can be triggered on time if the timer that comes with the system is used to realize timing management in the current lightweight application system, and to invent a universal , a well-targeted, easy-to-port and develop general timing task manager and implement timing management through this manager

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Universal timed task management realization method
  • Universal timed task management realization method
  • Universal timed task management realization method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0024] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0025] Such as figure 1 , 2 shown.

[0026] A method for implementing general scheduled task management, comprising the following steps:

[0027] First, set up a manager such as figure 1 As shown), the manager consists of a synchronous ordered queue and multiple producer and consumer threads; the scheduled tasks are stored in the queue by the producer to form a queue manager, and then executed regularly by the consumer thread;

[0028] Secondly, let the above-mentioned queue manager manage different timed tasks in it through a synchronous and ordered queue. The tasks in the queue are sorted in ascending order according to the execution time. Every time a task is added to the queue, a notification will be triggered, and by inserting Sorting guarantees that the order of the queue does not change. The queue uses a mutex to ensure that only one thread ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a universal timed task management realization method, which is characterized by comprising three steps. In the first step, a manager consisting of a synchronous ordered queue, a plurality of generator threads and a plurality of consumer threads is set. In the second step, the queue manager manages different timed tasks by the synchronous ordered queue, sorts the tasks in the queue in an ascending way according to execution time, triggers a notice every time when tasks are added into the queue, and ensures that the order of the queue is unchanged by insertion sort. The third step specifically comprises the following steps of: when the consumer threads are started, checking whether the queue comprises periodical tasks or not; if the queue is checked not to comprise the periodic tasks, blocking the threads, awakening waiting tasks by using the notice when the waiting tasks are inserted and rechecking the queue; if the queue is checked to comprise the periodical tasks, checking whether the tasks are expired, and if the tasks are checked to be expired, calculating expiration dates, starting blocking the threads and waiting for a limited time; rechecking the queue if waiting for the limited time or the waiting tasks are awakened by the notice; executing the expired tasks immediately when the expired tasks are found in the queue checking of each time; and for the periodical tasks, modifying execution starting time after the execution of each time, and inserting the periodical tasks into the queue again for calling and execution. The method has the characteristics of universality and high efficiency.

Description

technical field [0001] The present invention relates to a method for timing management of configurable tasks in a timing system, especially a method for triggering timing tasks suitable for light-weight applications, in particular a method for implementing general timing task management . Background technique [0002] As we all know, in the information system, some job tasks need to be executed periodically, and these tasks can be completed by some job schedulers (such as: quartz, cron), such job schedulers periodically execute registered tasks by reading and parsing cron expressions . These schedulers are fully functional, but they are relatively complex and bulky, and are not suitable for some lightweight applications. [0003] In addition, the operating system also provides a type of timer, which sends a special signal regularly through the underlying signal trigger mechanism, and then the application program executes periodic tasks by capturing the signal. The disadva...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/48
Inventor 刘小明
Owner NANJING NRIET IND CORP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products