Realizing method and system of software timers

An implementation method and timer technology, applied in the direction of program control devices, etc., can solve the problems of time-consuming and low timing efficiency of timers, and achieve the effects of uniform distribution, improved timing efficiency, and reduced number of scan queues

Active Publication Date: 2013-12-25
深圳市路通网络技术有限公司
View PDF4 Cites 9 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In the process of realizing the present invention, the inventor found that, compared with the single-queue implementation method, the current multi-queue timer implementation method has improved efficiency, but there will be many redundant traversal timer operations. For example, assuming that there are N queues, then, when there is only one timer, the system also needs to detect whether the other N-1 queues have a timer timeout, so that the system wastes the time of polling the N-1 queues. Therefore, when the timer When the number is large, the timing efficiency of the timer is still low

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
  • Realizing method and system of software timers
  • Realizing method and system of software timers
  • Realizing method and system of software timers

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0052] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.

[0053] See figure 1 , figure 1 The flowchart of a method for implementing a software timer provided in an embodiment of this application includes:

[0054] Step S101: Predefine a cycle timer;

[0055] The number of digits n of the cycle timer can be customized. For example, the value of n can be 16, or 22, or other values, such as 15, or 32, etc., which are not specifically limited here. In other words, each timing of the cyclic timer is re...

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 embodiment of the invention discloses a realizing method of software timers, wherein the timers are managed in a manner of double-array and multi-queue; a timer queue which the timers belong to is determined according to the timing length of the timers and a current timing moment, so that the timers are distributed uniformly, and the phenomenon that a certain timer queue is too long is unlikely to occur; in addition, only two timer queues are scanned at a certain timing moment to judge whether the timer reaches the timing length, the queue scanning number is reduced, so that the timing efficiency of the timers is improved. The embodiment of the invention also provides a realizing system of the software timers.

Description

Technical field [0001] The present invention relates to the technical field of timers, and more specifically, to a method and system for implementing a software timer. Background technique [0002] In the software development process, a large number of timers (ie software timers) need to be used. The function of the timer is to control the time interval at which the software waits for an event to occur. In the implementation, it is necessary to check whether the timer reaches the timing duration. If yes, the corresponding event is triggered. There are two ways to implement common software timers: [0003] One is a single-queue implementation method. This method uses a queue for timer management and control, that is, the timers are arranged in the order of timing duration from small to large. When a timer is added, it is inserted into The corresponding position of the current queue, although this method is simple to implement, but in the massive timer scenario, the number of timer...

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/44
Inventor 李锐明黄世华钟虎林罗均文朱敬毅甘鸣春别业辉
Owner 深圳市路通网络技术有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products