CN101361320B - Timer management system in software system and management method - Google Patents

Timer management system in software system and management method Download PDF

Info

Publication number
CN101361320B
CN101361320B CN2005800525051A CN200580052505A CN101361320B CN 101361320 B CN101361320 B CN 101361320B CN 2005800525051 A CN2005800525051 A CN 2005800525051A CN 200580052505 A CN200580052505 A CN 200580052505A CN 101361320 B CN101361320 B CN 101361320B
Authority
CN
China
Prior art keywords
timer
mentioned
relative
tick
absolute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN2005800525051A
Other languages
Chinese (zh)
Other versions
CN101361320A (en
Inventor
叶川
李兴华
罗武
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Publication of CN101361320A publication Critical patent/CN101361320A/en
Application granted granted Critical
Publication of CN101361320B publication Critical patent/CN101361320B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • G06F9/4825Interrupt from clock, e.g. time of day
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control

Abstract

A management system and management method of the timer in the software system, applied to the timer applied the task/process setting, at least comprises an absolute timer management module and a relative timer management module, in which the absolute timer management module includes an absolute timer queue and the relative timer management module includes a TICK queue and a long time length relative timer queue. The main method comprises: the timer resource of the software system is managed unifiedly; the timers applied the task/process setting are divided into two kinds of absolute timers and relative timers, and the different kind of timers are managed respectively by the different timer queues. Using the present invention, it reduces the burden related to the timing and clocking of the timer management in the software system, and prevents the confusedness of the timer use in the software system.

Description

The management system of timer and management method in a kind of software systems
Technical field
The present invention relates to timing and timing technology in a kind of software systems, relate in particular to the management system and the management method of timer in a kind of software systems, it can be used in portable terminal and the network side exchange device.
Background technology
At present the complexity of the software systems of communication equipment increases day by day, and also when the river rises the boat goes up to the requirement of timer management and use.The requirement that present software systems are used timer is to drop to the system loading that brings because of timer management minimum, reduce timer and upgrade the timing error that brings, timer management and use will be accomplished highly versatile, reduce software system development difficulty and development cost, improve the operating efficiency and the stability of the timer of software systems.
Application number is that the Chinese patent application of CN02110936 has proposed the clocking method of timer in the embedded real-time operating system, and it may further comprise the steps: a, the timer that required maximum timer number is set are described array; B, the array that adopts certain-length and cycle index variable are formed a circulation timing formation, and the cycle index variable points to each array element in the mode of circulation; C, when upper level applications needs task of timer, required new timer is inserted in the circulation timing formation; D, when arrive each time-count cycle, the cycle index variable moves backward, whether the chained list formation of inquiry indication array element is empty, if be empty, then waits for the next one arrival of time-count cycle; If be not empty, judge one by one then whether the multiple value in the description scheme of timer in this chained list formation is 0, as be that 0 timing of representing this timer arrives, giving the correct time accordingly to operate and insert once more timer operation, this timer of deletion is described array from this chained list formation simultaneously; Be not 0 as multiple value multiple value is subtracted 1, judge next timer then.This patent application technique scheme comprises following defective: 1, want multiple value to successively decrease in the chained list formation, increased the burden of system; 2, it does not consider the problem of overlength duration timer.
Summary of the invention
In order to address the above problem, the objective of the invention is to propose the management system and the management method of timer in a kind of succinctly and efficiently software systems, it does not need the timing length of each timer is carried out decrement operations, not only consider the management of long timer queue in short-term, and increased the management of long duration timer queue.Basic ideas of the present invention are: the timer resource in the software systems is carried out unified management; The timer of application task/process setting is divided into absolute timer and relative timer two big classes, and different types of timer is respectively by different timer queue management.
For achieving the above object, the management system of timer in a kind of software systems of the present invention, be applicable to the timer that application task/process is provided with, the timer of above-mentioned application task/process setting comprises absolute timer and relative timer, and above-mentioned management system comprises an absolute timer management module and a relative timer administration module at least, wherein:
Above-mentioned absolute timer management module comprises at least: an absolute timer queue is used to manage above-mentioned absolute timer;
Above-mentioned relative timer administration module comprises at least: a TICK formation, be used to manage long in short-term relative timer, and wherein each element is hung a long in short-term relative timer formation down in this TICK formation; With the relative timer formation of a long duration, be used to manage the relative timer of long duration.
Wherein, above-mentioned absolute timer queue is a doubly linked list; Above-mentioned TICK formation is an array, and its array length is MAX_TMCB_NUM, and wherein MAX_TMCB_NUM is that above-mentioned relative timer administration module allows the maximum timer number that is provided with; The timing length of the relative timer in above-mentioned each long in short-term relative timer formation is less than or equal to MAX_TMCB_NUM TICK, and wherein TICK is a unit interval; And the relative timer in above-mentioned each long in short-term relative timer formation at synchronization then.
In addition, the relative timer formation of above-mentioned long duration is an array, and its array length is MAX_TMCB_NUM, and wherein MAX_TMCB_NUM is that above-mentioned relative timer administration module allows the maximum timer number that is provided with; The timing length of the relative timer in the relative timer formation of above-mentioned long duration is greater than MAX_TMCB_NUM TICK, and wherein TICK is a unit interval.
For achieving the above object, the management method of timer in a kind of software systems of the present invention is applicable to the timer that application task/process is provided with, and may further comprise the steps at least:
Step 1: management system is divided into absolute timer and relative timer with the timer of above-mentioned application task/process setting;
Step 2: above-mentioned management system judges that timer above-mentioned to be managed is absolute timer or relative timer, if absolute timer, then execution in step 3; If relative timer, then execution in step 4;
Step 3: absolute timer management module is formed an absolute timer queue with above-mentioned absolute timer, and this absolute timer queue manages above-mentioned absolute timer;
Step 4: whether above-mentioned management system judges the timing length of above-mentioned relative timer greater than MAX_TMCB_NUM TICK, and if not, then execution in step 5; Otherwise, execution in step 6;
Step 5: the relative timer administration module will be formed a long in short-term relative timer formation at synchronization relative timer then, that timing length is less than or equal to MAX_TMCB_NUM TICK, hang under the relative timer formation that this is long in short-term of above-mentioned relative timer administration module under the element to the TICK formation, and this TICK formation manages the relative timer that above-mentioned timing length is less than or equal to MAX_TMCB_NUM TICK; The array length of wherein above-mentioned TICK formation is MAX_TMCB_NUM, and MAX_TMCB_NUM is that above-mentioned relative timer administration module allows the maximum timer number that is provided with;
Step 6: above-mentioned relative timer administration module is with the relative timer formation of timing length greater than the long duration of relative timer composition of MAX_TMCB_NUM TICK, and the relative timer formation of this long duration manages the relative timer of above-mentioned timing length greater than MAX_TMCB_NUM TICK; Wherein the array length of the relative timer formation of above-mentioned long duration is MAX_TMCB_NUM, and MAX_TMCB_NUM is that above-mentioned relative timer administration module allows the maximum timer number that is provided with; Whether the TMCB that each element representation in the relative timer formation of above-mentioned long duration has same index number is set up.
For example, the 10th element in the relative timer formation of above-mentioned long duration is true (TRUE), then represents TMCB[10] used by certain timer.
Wherein, above-mentioned steps 3 may further comprise the steps:
Step 301: above-mentioned absolute timer management module is formed above-mentioned absolute timer queue with above-mentioned absolute timer according to setting length constantly, be about to the earliest the stem that then absolute timer comes above-mentioned absolute timer queue, then absolute timer the latest come the afterbody of above-mentioned absolute timer queue;
Step 302: the timer scan task comes the absolute timer of above-mentioned absolute timer queue stem a scan period interscan;
Step 303: whether then above-mentioned timer scan task judges the above-mentioned absolute timer that comes above-mentioned absolute timer queue stem, and if not, then above-mentioned timer scan task continues this absolute timer of scanning in the next scan period; If then, execution in step 304;
Step 304: above-mentioned timer scan task removes above-mentioned absolute timer from above-mentioned absolute timer queue stem, and sends time exceeded message to the task that this absolute timer is set; Execution in step 305 afterwards;
Step 305: above-mentioned timer scan task comes the absolute timer of above-mentioned absolute timer queue stem at this moment in next scan period interscan;
Step 306: repeated execution of steps 303~step 305, until the absolute timer that comes above-mentioned absolute timer queue stem not then or above-mentioned absolute timer queue for empty.
Forming above-mentioned long in short-term relative timer formation in above-mentioned steps 5 may further comprise the steps:
Step 501: above-mentioned relative timer administration module is set system's vernier, and wherein this system's vernier is represented current system time, and its span is 0~(MAX_TMCB_NUM-1);
Step 502: it is the skew of unit with TICK with respect to the said system vernier that the timing length that above-mentioned relative timer administration module is less than or equal to the relative timer of MAX_TMCB_NUM TICK with each above-mentioned timing length is converted to;
Step 503: above-mentioned relative timer administration module will have long in short-term relative timer formation of all above-mentioned relative timers compositions of same offset position with the said system vernier, and with under the element of hanging under it in extremely above-mentioned TICK formation.
Wherein, the relative timer that in above-mentioned steps 5 above-mentioned one of them timing length is less than or equal to MAX_TMCB_NUM TICK manages and may further comprise the steps:
Step 504: the timer scan task is at an above-mentioned relative timer of scan period interscan, and the said system vernier increases by 1;
Step 505: above-mentioned timer scan task judges whether the said system vernier overlaps with above-mentioned relative timer, and if not, then above-mentioned timer scan task continues this relative timer of scanning in the next scan period, and the said system vernier increases by 1; Otherwise, execution in step 506;
Step 506: above-mentioned timer scan task removes the long in short-term relative timer formation at above-mentioned relative timer place from above-mentioned TICK formation, and sends time exceeded message to the task that this relative timer is set.
In above-mentioned steps 503, no matter above-mentioned whether all relative timers in the long in short-term relative timer formation in the synchronization setting, all relative timers in the above-mentioned long in short-term relative timer formation at synchronization then because the TICK deviation post of above-mentioned all relative timers and said system vernier is all identical; The computational methods that the relative timer that any one timing length is less than or equal to MAX_TMCB_NUM TICK is put into the position of above-mentioned TICK formation are: position=(the TICK number of the timing length of system's vernier current location value+relative timer) mod (MAX_TMCB_NUM).
Wherein, for the relative timer of one of them timing length in the relative timer formation of above-mentioned long duration greater than MAX_TMCB_NUM TICK, above-mentioned steps 6 may further comprise the steps:
Step 601: above-mentioned relative timer administration module is set system's vernier; Wherein this system's vernier is represented current system time, and its span is 0~(MAX_TMCB_NUM-1);
Step 602: above-mentioned relative timer administration module is given offset of above-mentioned relative timer, then the final timing length of this relative timer is above-mentioned offset and the TICK of the timing length of the relative timer that needs to be provided with counts sum, i.e. the TICK number of the timing length of the relative timer of the final timing length=offset of relative timer+needs setting;
Step 603: the timer scan task is at an above-mentioned relative timer of scan period interscan, and the said system vernier increases by 1;
Step 604: above-mentioned timer scan task deducts the final timing length of the relative timer of the correspondence on the said system vernier location duration of MAX_TMCB_NUM TICK;
Step 605: above-mentioned relative timer administration module judges whether the timing length after the relative timer in the above-mentioned steps 604 subtracts is less than or equal to MAX_TMCB_NUM TICK, if then execution in step 606; Otherwise, execution in step 607;
Step 606: above-mentioned relative timer administration module takes out the relative timer in the above-mentioned steps 604 from the relative timer formation of above-mentioned long duration, puts it into the following long in short-term relative timer rear of queue that hangs under one of them element in the above-mentioned TICK formation afterwards;
Step 607: repeated execution of steps 603~step 605.
In addition, return the used time of original position after turning around and be the time of MAX_TMCB_NUM TICK just because the said system vernier begins to circulate from original position, so the timer scan task in the above-mentioned steps 604 can be thought the time that the relative timer of the correspondence on the said system vernier location has passed through MAX_TMCB_NUM TICK.
In addition, in above-mentioned steps 602, above-mentioned relative timer administration module calculates above-mentioned compensation value method and is:
Step 611: above-mentioned relative timer administration module judges that whether the call number (tid) of the TMCB that above-mentioned relative timer uses is greater than the current positional value of said system vernier, if then execution in step 612; Otherwise, execution in step 613;
Step 612: offset=MAX_TMCB_NUM-(call number (tid)-current positional value of system's vernier of the TMCB that relative timer uses);
Step 613: the call number (tid) of the TMCB that the current positional value-relative timer of offset=system's vernier uses.
Adopt management system of the present invention and management method, have the advantage of following several aspects: 1, alleviated in the software systems about timer management regularly and the burden aspect the timing; 2, the confusion of having prevented the timer in the software systems to use.
For above and other objects of the present invention, feature and advantage can be become apparent, preferred embodiment cited below particularly, and cooperation Figure of description are described in detail below.
Description of drawings
Fig. 1 is the main schematic flow sheet of management method of the present invention;
The schematic diagram of the TICK formation that Fig. 2 is made up of 2000 array elements for the present invention.
Embodiment
Now propose a kind of embodiment, but the invention is not restricted to this specific embodiments based on the present invention.
Fig. 1 is the main schematic flow sheet of management method of the present invention.As shown in Figure 1, it may further comprise the steps at least:
Step 1: management system is divided into absolute timer and relative timer with the timer of above-mentioned application task/process setting;
Step 2: above-mentioned management system judges that timer above-mentioned to be managed is absolute timer or relative timer, if absolute timer, then execution in step 3; If relative timer, then execution in step 4;
Step 3: absolute timer management module is formed an absolute timer queue with above-mentioned absolute timer, and this absolute timer queue manages above-mentioned absolute timer;
Step 4: whether above-mentioned management system judges the timing length of above-mentioned relative timer greater than MAX_TMCB_NUM TICK, and if not, then execution in step 5; Otherwise, execution in step 6;
Step 5: the relative timer administration module will be formed a long in short-term relative timer formation at synchronization relative timer then, that timing length is less than or equal to MAX_TMCB_NUM TICK, hang under the relative timer formation that this is long in short-term of above-mentioned relative timer administration module under the element to the TICK formation, and this TICK formation manages the relative timer that above-mentioned timing length is less than or equal to MAX_TMCB_NUM TICK; The array length of wherein above-mentioned TICK formation is MAX_TMCB_NUM, and MAX_TMCB_NUM is that above-mentioned relative timer administration module allows the maximum timer number that is provided with;
Step 6: above-mentioned relative timer administration module is formed timing length the relative timer formation TidArray[MAX_TMCB_NUM of a long duration greater than the relative timer of MAX_TMCB_NUM TICK], and the relative timer formation of this long duration manages the relative timer of above-mentioned timing length greater than MAX_TMCB_NUM TICK; Wherein the array length of the relative timer formation of above-mentioned long duration is MAX_TMCB_NUM, and MAX_TMCB_NUM is that above-mentioned relative timer administration module allows the maximum timer number that is provided with; Whether the TMCB that each element representation in the relative timer formation of above-mentioned long duration has same index number is set up.
For the management of absolute timer, the timing accuracy of above-mentioned absolute timer management module settings is a second level, and the management method of above-mentioned absolute timer management module may further comprise the steps:
Step 301: above-mentioned absolute timer management module is formed above-mentioned absolute timer queue with above-mentioned absolute timer according to setting length constantly, be about to the earliest the stem that then absolute timer comes above-mentioned absolute timer queue, then absolute timer the latest come the afterbody of above-mentioned absolute timer queue;
Step 302: the timer scan task comes the absolute timer of above-mentioned absolute timer queue stem a scan period interscan;
Step 303: whether then above-mentioned timer scan task judges the above-mentioned absolute timer that comes above-mentioned absolute timer queue stem, and if not, then above-mentioned timer scan task continues this absolute timer of scanning in the next scan period; If then, execution in step 304;
Step 304: above-mentioned timer scan task removes above-mentioned absolute timer from above-mentioned absolute timer queue stem, and sends time exceeded message to the task that this absolute timer is set; Execution in step 305 afterwards;
Step 305: above-mentioned timer scan task comes the absolute timer of above-mentioned absolute timer queue stem at this moment in next scan period interscan;
Step 306: repeated execution of steps 303~step 305, until the absolute timer that comes above-mentioned absolute timer queue stem not then or above-mentioned absolute timer queue for empty.
The schematic diagram of the TICK formation that Fig. 2 is made up of 2000 array elements for the present invention, system's vernier is represented current system time, the span of this system's vernier is 0~1999.Below in conjunction with Fig. 1 and Fig. 2 the present invention is described as follows the management of relative timer.
Be less than or equal to the relative timer of 2000 TICK for timing length, form above-mentioned long in short-term relative timer formation and may further comprise the steps:
Step 501: above-mentioned relative timer administration module is set system's vernier, and wherein this system's vernier is represented current system time, and its span is 0~1999;
Step 502: it is the skew of unit with TICK with respect to the said system vernier that the timing length that above-mentioned relative timer administration module is less than or equal to the relative timer of 2000 TICK with each above-mentioned timing length is converted to;
Step 503: above-mentioned relative timer administration module will have long in short-term relative timer formation of all above-mentioned relative timers compositions of same offset position with the said system vernier, and with under the element of hanging under it in extremely above-mentioned TICK formation.
Wherein, the method that manages of above-mentioned relative timer administration module relative timer that above-mentioned one of them timing length is less than or equal to 2000 TICK may further comprise the steps:
Step 504: the timer scan task is at an above-mentioned relative timer of scan period interscan, and the said system vernier increases by 1; The life-span of then representing all relative timers in the long in short-term relative timer formation at this relative timer place has reduced by a TICK;
Step 505: above-mentioned timer scan task judges whether the said system vernier overlaps with above-mentioned relative timer, and if not, then above-mentioned timer scan task continues this relative timer of scanning in the next scan period, and the said system vernier increases by 1; Otherwise, execution in step 506;
Step 506: above-mentioned timer scan task removes the long in short-term relative timer formation at above-mentioned relative timer place from above-mentioned TICK formation, and sends time exceeded message to the task that this relative timer is set.
For example: the relative timer that a timing length is set is 800 TICK, this relative timer is 800 with respect to the skew of system's vernier.In each scan period, this system's vernier increases by 1, lucky and this relative timer coincidence of system's vernier after the timer scan task scans 800 times, and promptly this timing length is the end-of-life of the relative timer of 800 TICK.
For the relative timer of timing length greater than 2000 TICK, above-mentioned relative timer administration module is to the relative timer formation TidArray[2000 of above-mentioned long duration] in one of them timing length may further comprise the steps greater than the method that the relative timer of 2000 TICK manages:
Step 601: above-mentioned relative timer administration module is set system's vernier; Wherein this system's vernier is represented current system time, and its span is 0~1999;
Step 602: above-mentioned relative timer administration module is given offset of above-mentioned relative timer, then the final timing length of this relative timer is above-mentioned offset and the TICK of the timing length of the relative timer that needs to be provided with counts sum, i.e. the TICK number of the timing length of the relative timer of the final timing length=offset of relative timer+needs setting;
Step 603: the timer scan task is at an above-mentioned relative timer of scan period interscan, and the said system vernier increases by 1;
Step 604: above-mentioned timer scan task deducts the final timing length of the relative timer of the correspondence on the said system vernier location duration of 2000 TICK; To return the used time of original position after turning around be the time of 2000 TICK just because the said system vernier begins to circulate from original position, so the timer scan task in the step 604 can be thought the time that the relative timer of the correspondence on the said system vernier location has passed through 2000 TICK;
Step 605: above-mentioned relative timer administration module judges whether the timing length after the relative timer in the above-mentioned steps 604 subtracts is less than or equal to 2000 TICK, if then execution in step 606; Otherwise, execution in step 607;
Step 606: above-mentioned relative timer administration module is with the relative timer formation TidArray[2000 of the relative timer in the above-mentioned steps 604 from above-mentioned long duration] take out, put it into the following relative timer rear of queue of growing in short-term that hangs over one of them element under in the above-mentioned TICK formation afterwards;
Step 607: repeated execution of steps 603~step 605.
In addition, in above-mentioned steps 602, above-mentioned relative timer administration module calculates above-mentioned compensation value method and is:
Step 611: above-mentioned relative timer administration module judges that whether the call number (tid) of the TMCB that above-mentioned relative timer uses is greater than the current positional value of said system vernier, if then execution in step 612; Otherwise, execution in step 613;
Step 612: offset=2000-(call number (tid)-current positional value of system's vernier of the TMCB that relative timer uses);
Step 613: the call number (tid) of the TMCB that the current positional value-relative timer of offset=system's vernier uses.
For example, the current positional value of supposing the system vernier is 1500, the TICK number of the timing length of the relative timer that need be provided with is 3000, the call number (tid) of the TMCB that this relative timer uses is 1000, then above-mentioned relative timer administration module is for the offset of this relative timer: 1500-1000=500, then the final timing length of this relative timer is: 500+3000=3500.The timer scanning process is: system's vernier need promptly move to TidArray[1000 through just moving to the position of this relative timer behind 1500 TICK durations]; At this moment, the timer scan task deducts 2000 TICK with the final timing length of this relative timer, remains 1500 TICK; Because the remaining timing length of this relative timer is less than 2000 TICK, therefore above-mentioned relative timer administration module is with relative timer TidArray[1000] from the relative timer formation TidArray[2000 of above-mentioned long duration] take out, put it into the following relative timer rear of queue of growing in short-term that hangs under one of them element in the above-mentioned TICK formation afterwards.
More than describe operation principle of the present invention in detail, but the example of this visualization of just lifting for the ease of understanding should not be considered to be limitation of the scope of the invention.Equally, according to the description of technical scheme of the present invention and preferred embodiment thereof, can make various possible being equal to and change or replacement, and all these changes or replacement all should belong to the protection range of claim of the present invention.

Claims (8)

1. the management system of timer in the software systems, be applicable to the timer that application task/process is provided with, the timer that it is characterized in that above-mentioned application task/process setting comprises absolute timer and relative timer, and above-mentioned management system comprises an absolute timer management module and a relative timer administration module at least, wherein:
Above-mentioned absolute timer management module comprises at least: an absolute timer queue is used to manage above-mentioned absolute timer;
Above-mentioned relative timer administration module comprises at least:
One is the TICK formation of element with unit interval TICK, is used to manage long in short-term relative timer, and wherein each element is hung a long in short-term relative timer formation down in this TICK formation;
The relative timer formation of a long duration is used to manage the relative timer of long duration;
Wherein,
Above-mentioned absolute timer queue is a doubly linked list;
Above-mentioned TICK formation is an array, and its array length is MAX_TMCB_NUM, and wherein MAX_TMCB_NUM is that above-mentioned relative timer administration module allows the maximum timer number that is provided with;
The timing length of the relative timer in above-mentioned each long in short-term relative timer formation is less than or equal to MAX_TMCB_NUM TICK, and wherein TICK is a unit interval; And
Relative timer in above-mentioned each long in short-term relative timer formation at synchronization then;
The relative timer formation of above-mentioned long duration is an array, and its array length is MAX_TMCB_NUM;
The timing length of the relative timer in the relative timer formation of above-mentioned long duration is greater than MAX_TMCB_NUM TICK.
2. the management method of timer in the software systems is applicable to the timer that application task/process is provided with, and it is characterized in that may further comprise the steps at least:
Step 1: management system is divided into absolute timer and relative timer with the timer of above-mentioned application task/process setting;
Step 2: above-mentioned management system judges that the timer of above-mentioned application task/process setting is absolute timer or relative timer, if absolute timer, then execution in step 3; If relative timer, then execution in step 4;
Step 3: absolute timer management module is formed an absolute timer queue with above-mentioned absolute timer, and this absolute timer queue manages above-mentioned absolute timer;
Step 4: whether above-mentioned management system judges the timing length of above-mentioned relative timer greater than MAX_TMCB_NUM TICK, and if not, then execution in step 5; Otherwise, execution in step 6, wherein, TICK is a unit interval;
Step 5: the relative timer administration module will be formed a long in short-term relative timer formation at synchronization relative timer then, that timing length is less than or equal to MAX_TMCB_NUM TICK, hang under the relative timer formation that this is long in short-term of above-mentioned relative timer administration module under the element to the TICK formation, and this TICK formation manages the relative timer that above-mentioned timing length is less than or equal to MAX_TMCB_NUM TICK; The array length of wherein above-mentioned TICK formation is MAX_TMCB_NUM, and MAX_TMCB_NUM is that above-mentioned relative timer administration module allows the maximum timer number that is provided with;
Step 6: above-mentioned relative timer administration module is with the relative timer formation of timing length greater than the long duration of relative timer composition of MAX_TMCB_NUM TICK, and the relative timer formation of this long duration manages the relative timer of above-mentioned timing length greater than MAX_TMCB_NUM TICK; Wherein the array length of the relative timer formation of above-mentioned long duration is MAX_TMCB_NUM, and MAX_TMCB_NUM is that above-mentioned relative timer administration module allows the maximum timer number that is provided with; Whether the timer management controll block TMCB that each element representation in the relative timer formation of above-mentioned long duration has same index number is set up.
3. management method according to claim 2 is characterized in that above-mentioned steps 3 may further comprise the steps:
Step 301: above-mentioned absolute timer management module is formed above-mentioned absolute timer queue with above-mentioned absolute timer according to setting length constantly, be about to the earliest the stem that then absolute timer comes above-mentioned absolute timer queue, then absolute timer the latest come the afterbody of above-mentioned absolute timer queue;
Step 302: the timer scan task comes the absolute timer of above-mentioned absolute timer queue stem a scan period interscan;
Step 303: whether then above-mentioned timer scan task judges the above-mentioned absolute timer that comes above-mentioned absolute timer queue stem, and if not, then above-mentioned timer scan task continues this absolute timer of scanning in the next scan period; If, execution in step 304;
Step 304: above-mentioned timer scan task removes above-mentioned absolute timer from above-mentioned absolute timer queue stem, and sends time exceeded message to the task that this absolute timer is set; Execution in step 305 afterwards;
Step 305: above-mentioned timer scan task comes the absolute timer of above-mentioned absolute timer queue stem in the described next scan period in next scan period interscan;
Step 306: repeated execution of steps 303~step 305 is empty until above-mentioned absolute timer queue.
4. management method according to claim 2 is characterized in that forming above-mentioned long in short-term relative timer formation and may further comprise the steps in above-mentioned steps 5:
Step 501: above-mentioned relative timer administration module is set system's vernier, and wherein this system's vernier is represented current system time, and its span is 0~(MAX_TMCB_NUM-1);
Step 502: it is the skew of unit with TICK with respect to the said system vernier that the timing length that above-mentioned relative timer administration module is less than or equal to the relative timer of MAX_TMCB_NUM TICK with each above-mentioned timing length is converted to;
Step 503: above-mentioned relative timer administration module will have long in short-term relative timer formation of all above-mentioned relative timers compositions of same offset position with the said system vernier, and with under the element of hanging under it in extremely above-mentioned TICK formation.
5. management method according to claim 4 is characterized in that in above-mentioned steps 5 relative timer that one of them timing length in the above-mentioned long in short-term relative timer formation is less than or equal to MAX_TMCB_NUM TICK managed and may further comprise the steps:
Step 504: the timer scan task is at an above-mentioned relative timer of scan period interscan, and the said system vernier increases by 1;
Step 505: above-mentioned timer scan task judges whether the said system vernier overlaps with above-mentioned relative timer, and if not, then above-mentioned timer scan task continues this relative timer of scanning in the next scan period, and the said system vernier increases by 1; Otherwise, execution in step 506;
Step 506: above-mentioned timer scan task removes the long in short-term relative timer formation at above-mentioned relative timer place from above-mentioned TICK formation, and sends time exceeded message to the task that this relative timer is set.
6. management method according to claim 5 is characterized in that
In above-mentioned steps 503, no matter above-mentioned whether all relative timers in the long in short-term relative timer formation in the synchronization setting, and all relative timers in the above-mentioned long in short-term relative timer formation at synchronization then;
The computational methods that the relative timer that any one timing length is less than or equal to MAX_TMCB_NUM TICK is put into the position of above-mentioned TICK formation are: position=(the TICK number of the timing length of system's vernier current location value+relative timer) mod (MAX_TMCB_NUM).
7. management method according to claim 2 is characterized in that above-mentioned steps 6 may further comprise the steps for the relative timer of above-mentioned one of them timing length greater than MAX_TMCB_NUM TICK:
Step 601: above-mentioned relative timer administration module is set system's vernier; Wherein this system's vernier is represented current system time, and its span is 0~(MAX_TMCB_NUM-1);
Step 602: above-mentioned relative timer administration module is given offset of above-mentioned relative timer, then the final timing length of this relative timer is above-mentioned offset and the TICK of the timing length of the relative timer that needs to be provided with counts sum, i.e. the TICK number of the timing length of the relative timer of the final timing length=offset of relative timer+needs setting;
Step 603: the timer scan task is at an above-mentioned relative timer of scan period interscan, and the said system vernier increases by 1;
Step 604: above-mentioned timer scan task deducts the final timing length of the relative timer of the correspondence on the said system vernier location duration of MAX_TMCB_NUM TICK;
Step 605: above-mentioned relative timer administration module judges whether the timing length after the relative timer in the above-mentioned steps 604 subtracts is less than or equal to MAX_TMCB_NUM TICK, if then execution in step 606; Otherwise, execution in step 607;
Step 606: above-mentioned relative timer administration module takes out the relative timer in the above-mentioned steps 604 from the relative timer formation of above-mentioned long duration, puts it into the following long in short-term relative timer rear of queue that hangs under one of them element in the above-mentioned TICK formation afterwards;
Step 607: repeated execution of steps 603~step 605.
8. management method according to claim 7 is characterized in that in above-mentioned steps 602, and above-mentioned relative timer administration module calculates above-mentioned compensation value method and is:
Step 611: above-mentioned relative timer administration module judges that whether the call number of the TMCB that above-mentioned relative timer uses is greater than the current positional value of said system vernier, if then execution in step 612; Otherwise, execution in step 613;
Step 612: offset=MAX_TMCB_NUM-(call number-current positional value of system's vernier of the TMCB that relative timer uses);
Step 613: the call number of the TMCB that the current positional value-relative timer of offset=system's vernier uses.
CN2005800525051A 2005-12-31 2005-12-31 Timer management system in software system and management method Expired - Fee Related CN101361320B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2005/002425 WO2007076636A1 (en) 2005-12-31 2005-12-31 A management system and management method of the timer in the software system

Publications (2)

Publication Number Publication Date
CN101361320A CN101361320A (en) 2009-02-04
CN101361320B true CN101361320B (en) 2011-11-09

Family

ID=38227893

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2005800525051A Expired - Fee Related CN101361320B (en) 2005-12-31 2005-12-31 Timer management system in software system and management method

Country Status (3)

Country Link
CN (1) CN101361320B (en)
HK (1) HK1126907A1 (en)
WO (1) WO2007076636A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019805A (en) * 2011-09-20 2013-04-03 佳都新太科技股份有限公司 Timer setting method under multithreading environment
CN103678095A (en) * 2012-09-03 2014-03-26 鼎桥通信技术有限公司 Warning detection method
CN103617072A (en) * 2013-10-23 2014-03-05 上海寰创通信科技股份有限公司 Timer implementation method based on multi-queue timing time decomposition processing
CN104268015B (en) * 2014-09-05 2017-08-01 烽火通信科技股份有限公司 The implementation method and timer of embedded device high availability timer
CN110908429B (en) * 2018-09-18 2023-12-05 阿里巴巴集团控股有限公司 Timer operation method and device
CN115525402A (en) * 2021-06-25 2022-12-27 中兴通讯股份有限公司 Timer task processing method, software timer and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6587804B1 (en) * 2000-08-14 2003-07-01 Micron Technology, Inc. Method and apparatus providing improved data path calibration for memory devices
CN1441570A (en) * 2002-02-28 2003-09-10 深圳市中兴通讯股份有限公司上海第二研究所 Timing method of timer in embedded real-time operation system
CN1713630A (en) * 2004-06-25 2005-12-28 华为技术有限公司 Method for triggering related timer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6587804B1 (en) * 2000-08-14 2003-07-01 Micron Technology, Inc. Method and apparatus providing improved data path calibration for memory devices
CN1441570A (en) * 2002-02-28 2003-09-10 深圳市中兴通讯股份有限公司上海第二研究所 Timing method of timer in embedded real-time operation system
CN1713630A (en) * 2004-06-25 2005-12-28 华为技术有限公司 Method for triggering related timer

Also Published As

Publication number Publication date
HK1126907A1 (en) 2009-09-11
CN101361320A (en) 2009-02-04
WO2007076636A1 (en) 2007-07-12

Similar Documents

Publication Publication Date Title
CN101361320B (en) Timer management system in software system and management method
CN101562894A (en) Sending method of buffer state report and equipment thereof
CN100370864C (en) Network element time synchronizing method in mobile communication system
CN110149369A (en) The rotation report method and tele-control system of terminal device based on Internet of Things
CN113626280B (en) Cluster state control method and device, electronic equipment and readable storage medium
CN104506462A (en) MAC (Media Access Control) address management method and equipment in distributed switch
CN103580846A (en) Method and system for transmitting precision clock message by spanning non-1588 network
CN103685309A (en) Asynchronous request queue model oriented to map visualization tile service
CN111507608B (en) Work order early warning method and device and storage medium
CN104660718B (en) A kind of information push method, device and push server
CN102448146B (en) Control method, device and access network element for network access for terminal equipment
CN104427607A (en) Method for time synchronization between nodes in self-organizing network
CN104639436B (en) Remaining life span ageing method and device
CN102393710A (en) Multitask production simulation schedule control system for production line travelling crane and method thereof
CN104052565A (en) Time synchronization method and communication terminal
CN111953655B (en) Method and equipment for server to respond to request message in communication system
CN101561795B (en) Method and device for synchronizing data in distribution-type system
CN101893876A (en) Control network design for large-scale distributed control system
CN104469902A (en) Method and device for controlling RRC (radio resource control) connection status between UE (user equipment) and network side
CN105591790A (en) Data communication connection pool management device
CN102710356B (en) A kind of real time redundancy master station data synchronization method
CN102904662B (en) Cross-domain clock synchronization method and system based on PTP (Precision Time Protocol)
CN103034480A (en) Embedded system timer realizing method
CN101599962A (en) Improve the method for Industrial Ethernet synchronization accuracy of network equipment
CN109274546A (en) A kind of scheduling method for timer and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1126907

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1126907

Country of ref document: HK

EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20090204

Assignee: SANECHIPS TECHNOLOGY Co.,Ltd.

Assignor: ZTE Corp.

Contract record no.: 2015440020319

Denomination of invention: Timer management system in software system and management method

Granted publication date: 20111109

License type: Common License

Record date: 20151123

LICC Enforcement, change and cancellation of record of contracts on the licence for exploitation of a patent or utility model
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20111109

Termination date: 20211231

CF01 Termination of patent right due to non-payment of annual fee