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

Realization method and system of software timer

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

Active Publication Date: 2016-05-11
深圳市路通网络技术有限公司
View PDF4 Cites 0 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
  • Realization method and system of software timer
  • Realization method and system of software timer
  • Realization method and system of software timer

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0053] see figure 1 , figure 1 A flow chart of a method for implementing a software timer provided in the embodiment of the present application, including:

[0054] Step S101: Predefine a cycle timer;

[0055] The counting digit 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. That is to say, each timing moment of the cycle timer is represented...

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 realizing a software timer. Background technique [0002] In the process of software development, a large number of timers (that is, software timers) are needed. The function of the timer is to control the time interval that the software waits for a certain event to occur. Specifically, when implementing, it is necessary to detect whether the timer reaches the time limit. If If yes, the corresponding event is triggered. There are two common implementation methods of 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 ascending order of timing duration. When adding a timer, it is inserted into the The corresponding position of the current queue. Although this method is simple to implement, in the scenario of massive timers, the...

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 Patents(China)
IPC IPC(8): G06F9/44
Inventor 李锐明黄世华钟虎林罗均文朱敬毅甘鸣春别业辉
Owner 深圳市路通网络技术有限公司
Features
  • Generate Ideas
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More