Optimization method and system of software timers

An optimization method and timer technology, applied in the field of computer communication, can solve the problems of occupying CPU resources, inaccurate timing of timer overtime callback processing, and low efficiency of timer management, so as to improve timing accuracy and reduce CPU occupation efficiency and improve operational efficiency

Active Publication Date: 2014-09-10
湖州丰源农业装备制造有限公司
View PDF4 Cites 13 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0014] In view of the shortcomings of the prior art described above, the purpose of the present invention is to provide a method and system for optimizing a software timer, which is used to solve the problem of low management efficiency of timers in the prior art when there are too many timer instance objects, and a large amount of time is occupied. CPU resources, and the time offset in the process of timer timeout callback processing leads to inaccurate timing

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

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0054] This embodiment provides a software timer optimization method, which is applied to several business modules that need to use timers. Each business module includes multiple timer instance objects. Please refer to figure 2 , shown as a flow chart of the softening method of the software timer, the optimization method of the software timer includes:

[0055] S1, generate a timer linked list index number for each business module that needs to use a timer, create a first timer array A[] that includes linked list array elements consistent with the number of business modules; define the total running time, and record it as T1 , that is, gTimerJiffies, and the time required for timeout processing of all timer instance objects at each moment, recorded as T2, that is, gAlignmentTime, and initializing T1 (gTimerJiffies) and T2 (gAlignmentTime) to zero. The timer instance object includes a first node pointer that records the nodes that exist in the linked list array elements in the...

Embodiment 2

[0068] This embodiment provides an optimization system 1 for a software timer, which is applied to several business modules that need to use timers. Each business module includes multiple timer instance objects. Please refer to Figure 5 , is shown as a schematic structural diagram of an optimization system for a software timer, and the optimization system for a software timer includes: a first creation module 11, a management module 12, a second creation module 13, a processing module 14, a first judgment module 15, The second judging module 16 , the third judging module 17 , the fourth judging module 18 , and the assignment module 19 .

[0069] The first creation module 11 is used to generate a timer linked list index number for each service module that needs to use a timer, and create a first timer array A[] that includes linked list array elements consistent with the number of service modules; definition The total running time is recorded as T1 and the time required for ti...

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 provides an optimization method of software timers. The method includes the steps that a first timer array and a second timer array are created; total run time is defined and recorded as T1, time required for overtime processing of all timer instance objects at every moment is recorded as T2, and T1 and T2 are initialized to be zero; after waiting for a time slice, 1 is added to the total run time T1, and obtained time is recorded as T1'; the timer instance objects are added to chain table array elements of the first timer array according to chain table index numbers, overtime of the timer instance objects is detected, overtime T3 is recorded, and an index moment is generated; the timer instance objects corresponding to the index moment are added to chain table array elements of the second timer array according to the index moment; an overtime callback handler function is executed in the second timer array in a loop mode, and then the corresponding timer instance object is deleted until all the timer instance objects are executed. According to the method, operation efficiency of the timer instance objects is improved, the occupancy rate of a CPU is greatly reduced, time drift compensation is conducted on the timers, and timing accuracy of the timers is improved.

Description

technical field [0001] The invention relates to the technical field of computer communication, and relates to an optimization method and system, in particular to a software timer optimization method and system. Background technique [0002] Timers are often used in embedded multitasking system software design, which are divided into hardware timers and software timers. The hardware timer is implemented by means of interrupts, and has high time accuracy, but there are many restrictions on its use. For example, the timeout processing function is blocked, and when there are many timers, multiple interrupts will affect the system performance. The traditional software timer manages all operations of the timer instance object through a software timer linked list, including the creation, startup, timeout detection and processing, stop and deletion of the timer instance object. Each timeout judgment will go through the loop to scan all the timer instance objects in the linked list ...

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