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
relative
queue
absolute
tmcb
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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

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

Management system and management method for timer in software system
Technical Field
The present invention relates to a timing and timing technology in a software system, and more particularly, to a management system and a management method for a timer in a software system, which can be used in a mobile terminal and a network side switching device.
Background
At present, the complexity of a software system of the communication equipment is increased day by day, and the requirement on management and use of the timer is also the ship height. The requirements of the existing software system for the use of the timer are to reduce the system load caused by timer management to the minimum, reduce the timing error caused by timer updating, achieve strong universality of timer management and use, reduce the development difficulty and development cost of the software system, and improve the working efficiency and stability of the timer of the software system.
Chinese patent application No. CN02110936 proposes a timing method for a timer in an embedded real-time operating system, which comprises the following steps: a. setting a timer description array of the required maximum timer number; b. forming a circular timing queue by adopting an array with a certain length and a circular pointer variable, wherein the circular pointer variable points to each array element in a circular mode; c. when the upper application program needs a timer task, inserting a needed new timer into a circular timing queue; d. when each timing cycle arrives, the circular pointer variable moves backwards, whether the linked list queue of the pointed array element is empty is inquired, and if the linked list queue is empty, the arrival of the next timing cycle is waited; if not, judging whether the multiple value in the description structure of the timer in the linked list queue is 0 one by one, if so, indicating that the timing time of the timer is up, carrying out corresponding time-reporting operation and timer reinsertion operation, and simultaneously deleting the timer description array from the linked list queue; if the multiple value is not 0, the multiple value is reduced by 1, and then the next timer is judged. The above technical solution of this patent application includes the following drawbacks: 1. the multiple value in the linked list queue is decreased progressively, so that the burden of the system is increased; 2. it does not consider the problem of a lengthy timer.
Disclosure of Invention
In order to solve the above problems, an objective of the present invention is to provide a simple and efficient management system and management method for timers in a software system, which do not need to perform a decrement operation on the timing duration of each timer, not only consider the management of a short duration timer queue, but also increase the management of a long duration timer queue. The basic idea of the invention is as follows: uniformly managing timer resources in a software system; timers set by application tasks/processes are divided into two categories, namely absolute timers and relative timers, and different kinds of timers are respectively managed by different timer queues.
To achieve the above object, the present invention provides a management system for timers in a software system, which is suitable for timers set by application tasks/processes, wherein the timers set by the application tasks/processes include an absolute timer and a relative timer, and the management system at least includes an absolute timer management module and a relative timer management module, wherein:
the absolute timer management module at least comprises: an absolute timer queue for managing said absolute timer;
the relative timer management module at least comprises: a TICK queue for managing relative timers with short duration, wherein a relative timer queue with short duration is hung under each element in the TICK queue; and a long-duration relative timer queue for managing the long-duration relative timers.
Wherein, the absolute timer queue is a two-way linked list; the TICK queue is an array, the length of the array is MAX _ TMCB _ NUM, wherein MAX _ TMCB _ NUM is the maximum timer number allowed to be set by the relative timer management module; the timing duration of the relative timer in each short-duration relative timer queue is less than or equal to MAX _ TMCB _ NUM TICKs, wherein the TICK is a unit time; and the relative timer in each relative timer queue with the short time length is up at the same time.
In addition, the long relative timer queue is an array, the length of the array is MAX _ TMCB _ NUM, where MAX _ TMCB _ NUM is the maximum timer number allowed to be set by the relative timer management module; the timing duration of the relative timer in the long-duration relative timer queue is greater than MAX _ TMCB _ NUM TICKs, wherein the TICK is a unit time.
In order to achieve the above object, the present invention provides a method for managing a timer in a software system, which is suitable for a timer set by an application task/process, and at least comprises the following steps:
step 1: the management system divides the timer set by the application task/process into an absolute timer and a relative timer;
step 2: the management system judges whether the timer to be managed is an absolute timer or a relative timer, if the timer to be managed is the absolute timer, the step 3 is executed; if the relative timer is set, executing step 4;
and step 3: the absolute timer management module combines the absolute timers into an absolute timer queue, and the absolute timer queue manages the absolute timers;
and 4, step 4: the management system judges whether the timing duration of the relative timer is greater than MAX _ TMCB _ NUM TICKs, if not, step 5 is executed; otherwise, executing step 6;
and 5: the relative timer management module forms a relative timer queue with short time length by using relative timers which arrive at the same time and have the time length less than or equal to MAX _ TMCB _ NUM TICKs, the relative timer management module hangs the relative timer queue with short time length under one element in the TICK queue, and the TICK queue manages the relative timers with the time length less than or equal to MAX _ TMCB _ NUM TICKs; the array length of the TICK queue is MAX _ TMCB _ NUM, and MAX _ TMCB _ NUM is the maximum timer number allowed to be set by the relative timer management module;
step 6: the relative timer management module makes relative timers with timing duration longer than MAX _ TMCB _ NUM TICKs form a long relative timer queue, and the long relative timer queue manages the relative timers with timing duration longer than MAX _ TMCB _ NUM TICKs; the array length of the long relative timer queue is MAX _ TMCB _ NUM, and MAX _ TMCB _ NUM is the maximum timer number allowed to be set by the relative timer management module; each element in the long-duration relative timer queue indicates whether a TMCB having the same index number is set.
For example, the 10 th element in the long relative timer queue is TRUE (TRUE), indicating that TMCB [10] has been used by a certain timer.
Wherein, the step 3 comprises the following steps:
step 301: the absolute timer management module makes the absolute timer form the absolute timer queue according to the length of the set time, namely, the absolute timer which arrives earliest is arranged at the head of the absolute timer queue, and the absolute timer which arrives latest is arranged at the tail of the absolute timer queue;
step 302: the timer scanning task scans the absolute timer arranged at the head of the absolute timer queue in a scanning period;
step 303: the timer scanning task judges whether the absolute timer arranged at the head of the absolute timer queue expires, if not, the timer scanning task continues to scan the absolute timer in the next scanning period; if yes, go to step 304;
step 304: the timer scanning task removes the absolute timer from the head of the absolute timer queue and sends an overtime message to the task which sets the absolute timer; then step 305 is executed;
step 305: the timer scanning task scans the absolute timer arranged at the head of the absolute timer queue at the moment in the next scanning period;
step 306: and repeating the steps 303 to 305 until the absolute timer arranged at the head of the absolute timer queue does not expire or the absolute timer queue is empty.
The step 5 of composing the relative timer queue of the short duration includes the steps of:
step 501: the relative timer management module sets a system cursor, wherein the system cursor represents the current system time, and the value range of the system cursor is 0 to (MAX _ TMCB _ NUM-1);
step 502: the relative timer management module converts the timing duration of each relative timer with the timing duration less than or equal to MAX _ TMCB _ NUM TICKs into an offset in TICK units relative to the system cursor;
step 503: the relative timer management module combines all the relative timers with the same offset position as the system cursor into a relative timer queue with a short duration and hangs them down to an element in the TICK queue.
Wherein, in the step 5, managing the relative timer whose one timing duration is less than or equal to the MAX _ TMCB _ NUM TICKs includes the following steps:
step 504: the timer scanning task scans the relative timer in a scanning period, and the system vernier is increased by 1;
step 505: the timer scanning task judges whether the system cursor is overlapped with the relative timer, if not, the timer scanning task continues to scan the relative timer in the next scanning period, and the system cursor is increased by 1; otherwise, go to step 506;
step 506: and the timer scanning task removes the relative timer queue with the short time length where the relative timer is positioned from the TICK queue, and sends an overtime message to the task which sets the relative timer.
In step 503, all the relative timers in the short duration relative timer queue expire at the same time, since the TICK offset positions of all the relative timers and the system cursor are the same, regardless of whether all the relative timers in the short duration relative timer queue are set at the same time; the method for calculating the position of any relative timer with the timing duration less than or equal to MAX _ TMCBNUM TICKs in the TICK queue comprises the following steps: position (system cursor current position value + TICK number relative to timing duration of timer) mod (MAX _ TMCB _ NUM).
Wherein, for a relative timer in the long-duration relative timer queue, where one of the timing durations is greater than MAX _ TMCB _ NUM TICKs, the step 6 includes the following steps:
step 601: the relative timer management module sets a system cursor; wherein the system cursor represents the current system time, and the value range is 0 to (MAX _ TMCB _ NUM-1);
step 602: the relative timer management module gives a compensation value to the relative timer, and the final timing duration of the relative timer is the sum of the compensation value and the TICK number of the timing duration of the relative timer to be set, that is, the final timing duration of the relative timer is equal to the compensation value plus the TICK number of the timing duration of the relative timer to be set;
step 603: the timer scanning task scans the relative timer in a scanning period, and the system vernier is increased by 1;
step 604: subtracting the time lengths of MAX _ TMCB _ NUM TICKs from the final timing time length of the corresponding relative timer at the position of the system cursor by the timer scanning task;
step 605: the relative timer management module determines whether the reduced timing duration of the relative timer in the step 604 is less than or equal to MAX _ TMCB _ NUM TICKs, if yes, execute step 606; otherwise, go to step 607;
step 606: the relative timer management module takes the relative timer in step 604 out of the long relative timer queue and then puts it into the tail of the short relative timer queue hanging under one of the elements in the TICK queue;
step 607: step 603 to step 605 are repeatedly executed.
In addition, since the time taken for the system cursor to return to the original position after the system cursor circularly rotates one turn from the starting position is just the time of MAX _ TMCB _ NUM TICKs, the timer scanning task in step 604 may consider that the corresponding relative timer at the position where the system cursor arrives has passed the time of MAX _ TMCB _ NUM TICKs.
In step 602, the method for calculating the offset value by the relative timer management module includes:
step 611: the relative timer management module determines whether the index number (tid) of the TMCB used by the relative timer is greater than the current position value of the system cursor, if yes, step 612 is executed; otherwise, go to step 613;
step 612: MAX _ TMCB _ NUM- (index (tid) of TMCB used relative to timer-current position value of system cursor);
step 613: compensation value-the current position value of the system cursor-the index (tid) of TMCB used relative to the timer.
The management system and the management method have the advantages of the following aspects: 1. the burden of timer management in a software system in timing and timing is relieved; 2. confusion in the use of timers in software systems is prevented.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
FIG. 1 is a schematic view of a main flow of a management method according to the present invention;
FIG. 2 is a diagram of a TICK queue consisting of 2000 array elements according to the present invention.
Detailed Description
An embodiment is now proposed based on the present invention, but the present invention is not limited to this specific embodiment.
Fig. 1 is a schematic view of a main flow of the management method of the present invention. As shown in fig. 1, it comprises at least the following steps:
step 1: the management system divides the timer set by the application task/process into an absolute timer and a relative timer;
step 2: the management system judges whether the timer to be managed is an absolute timer or a relative timer, if the timer to be managed is the absolute timer, the step 3 is executed; if the relative timer is set, executing step 4;
and step 3: the absolute timer management module combines the absolute timers into an absolute timer queue, and the absolute timer queue manages the absolute timers;
and 4, step 4: the management system judges whether the timing duration of the relative timer is greater than MAX _ TMCB _ NUM TICKs, if not, step 5 is executed; otherwise, executing step 6;
and 5: the relative timer management module forms a relative timer queue with short time length by using relative timers which arrive at the same time and have the time length less than or equal to MAX _ TMCB _ NUM TICKs, the relative timer management module hangs the relative timer queue with short time length under one element in the TICK queue, and the TICK queue manages the relative timers with the time length less than or equal to MAX _ TMCB _ NUM TICKs; the array length of the TICK queue is MAX _ TMCB _ NUM, and MAX _ TMCB _ NUM is the maximum timer number allowed to be set by the relative timer management module;
step 6: the relative timer management module makes a relative timer with the timing duration greater than MAX _ TMCB _ NUM TICKs form a long relative timer queue TiCAlrray [ MAX _ TMCB _ NUM ], and the long relative timer queue manages the relative timers with the timing duration greater than MAX _ TMCB _ NUM TICKs; the array length of the long relative timer queue is MAX _ TMCB _ NUM, and MAX _ TMCB _ NUM is the maximum timer number allowed to be set by the relative timer management module; each element in the long-duration relative timer queue indicates whether a TMCB having the same index number is set.
For the management of the absolute timer, the timing precision set by the absolute timer management module is in the second level, and the management method of the absolute timer management module comprises the following steps:
step 301: the absolute timer management module makes the absolute timer form the absolute timer queue according to the length of the set time, namely, the absolute timer which arrives earliest is arranged at the head of the absolute timer queue, and the absolute timer which arrives latest is arranged at the tail of the absolute timer queue;
step 302: the timer scanning task scans the absolute timer arranged at the head of the absolute timer queue in a scanning period;
step 303: the timer scanning task judges whether the absolute timer arranged at the head of the absolute timer queue expires, if not, the timer scanning task continues to scan the absolute timer in the next scanning period; if yes, go to step 304;
step 304: the timer scanning task removes the absolute timer from the head of the absolute timer queue and sends an overtime message to the task which sets the absolute timer; then step 305 is executed;
step 305: the timer scanning task scans the absolute timer arranged at the head of the absolute timer queue at the moment in the next scanning period;
step 306: and repeating the steps 303 to 305 until the absolute timer arranged at the head of the absolute timer queue does not expire or the absolute timer queue is empty.
FIG. 2 is a schematic diagram of a TICK queue composed of 2000 array elements, a system cursor represents a current system time, and the value range of the system cursor is 0-1999. The management of the relative timers according to the invention is described below with reference to fig. 1 and 2.
For the relative timer with the timing duration less than or equal to 2000 TICKs, the relative timer queue with the short duration comprises the following steps:
step 501: the relative timer management module sets a system cursor, wherein the system cursor represents the current system time, and the value range of the system cursor is 0-1999;
step 502: said relative timer management module converting the timing duration of each of said relative timers having said timing duration less than or equal to 2000 TICKs to a TICK-unit offset with respect to said system cursor;
step 503: the relative timer management module combines all the relative timers with the same offset position as the system cursor into a relative timer queue with a short duration and hangs them down to an element in the TICK queue.
The method for managing the relative timer with the timing duration less than or equal to 2000 TICKs by the relative timer management module comprises the following steps:
step 504: the timer scanning task scans the relative timer in a scanning period, and the system vernier is increased by 1; the lifetimes of all the relative timers in the relative timer queue, which indicates the short duration in which the relative timer resides, are reduced by one TICK;
step 505: the timer scanning task judges whether the system cursor is overlapped with the relative timer, if not, the timer scanning task continues to scan the relative timer in the next scanning period, and the system cursor is increased by 1; otherwise, go to step 506;
step 506: and the timer scanning task removes the relative timer queue with the short time length where the relative timer is positioned from the TICK queue, and sends an overtime message to the task which sets the relative timer.
For example: a relative timer is set with a timing duration of 800 TICKs, and the offset of the relative timer relative to the system cursor is 800. In each scanning period, the system cursor is increased by 1, and the system cursor is just coincided with the relative timer after the timer scanning task scans for 800 times, namely the service life of the relative timer with the timing duration of 800 TICKs is ended.
For a relative timer with a timing duration greater than 2000 TICKs, the method for managing the relative timer with one timing duration greater than 2000 TICKs in the long-duration relative timer queue TidArray [2000] by the relative timer management module comprises the following steps:
step 601: the relative timer management module sets a system cursor; the system vernier represents the current system time, and the value range of the system vernier is 0-1999;
step 602: the relative timer management module gives a compensation value to the relative timer, and the final timing duration of the relative timer is the sum of the compensation value and the TICK number of the timing duration of the relative timer to be set, that is, the final timing duration of the relative timer is equal to the compensation value plus the TICK number of the timing duration of the relative timer to be set;
step 603: the timer scanning task scans the relative timer in a scanning period, and the system vernier is increased by 1;
step 604: subtracting the time length of 2000 TICKs from the final timing time length of the corresponding relative timer at the position of the system cursor by the timer scanning task; since the time taken for the system cursor to return to the original position after one rotation from the initial position is exactly 2000 TICKs, the timer scanning task in step 604 can assume that the corresponding relative timer at the position of the system cursor has elapsed 2000 TICKs;
step 605: the relative timer management module determines whether the reduced timing duration of the relative timer in the step 604 is less than or equal to 2000 TICKs, if yes, execute the step 606; otherwise, go to step 607;
step 606: the relative timer management module fetches the relative timer of step 604 from the long relative timer queue TidArray [2000] and then places it at the tail of the short relative timer queue pending one of the elements in the TICK queue;
step 607: step 603 to step 605 are repeatedly executed.
In step 602, the method for calculating the offset value by the relative timer management module includes:
step 611: the relative timer management module determines whether the index number (tid) of the TMCB used by the relative timer is greater than the current position value of the system cursor, if yes, step 612 is executed; otherwise, go to step 613;
step 612: the offset value is 2000- (index (tid) of TMCB used relative to timer-current position value of system cursor);
step 613: compensation value-the current position value of the system cursor-the index (tid) of TMCB used relative to the timer.
For example, assuming that the current position value of the system cursor is 1500, the number of TICKs of the timing duration of the relative timer to be set is 3000, and the index number (tid) of the TMCB used by the relative timer is 1000, the compensation value given to the relative timer by the relative timer management module is: 1500-: 500+3000 ═ 3500. The timer scanning process comprises the following steps: the system cursor needs to move to the position of the relative timer after 1500 TICK duration, namely to TidArray [1000 ]; at this time, the timer scanning task subtracts 2000 TICKs from the final timing duration of the relative timer, and 1500 TICKs remain; since the remaining timing duration of the relative timer is less than 2000 TICKs, the relative timer management module takes the relative timer TidArray [1000] out of the long relative timer queue TidArray [2000] and then places it at the tail of the short relative timer queue hanging under one of the elements in the TICK queue.
The foregoing detailed description illustrates the principles of the present invention, but this is merely an example of an embodiment for the convenience of understanding and is not to be taken as a limitation on the scope of the invention. Also, various possible equivalent changes or substitutions may be made in accordance with the technical solution of the present invention and the description of the preferred embodiment thereof, and all such changes or substitutions shall fall within the scope of the claims of the present invention.

Claims (8)

1. A management system of timers in a software system, adapted to the timers set by an application task/process, characterized in that the timers set by the application task/process comprise an absolute timer and a relative timer, and the management system comprises at least an absolute timer management module and a relative timer management module, wherein:
the absolute timer management module at least comprises: an absolute timer queue for managing said absolute timer;
the relative timer management module at least comprises:
a TICK queue taking a unit time TICK as an element and used for managing a relative timer with short time, wherein a relative timer queue with short time is hung under each element in the TICK queue;
a long-duration relative timer queue for managing long-duration relative timers;
wherein,
the absolute timer queue is a two-way linked list;
the TICK queue is an array, the length of the array is MAX _ TMCB _ NUM, wherein MAX _ TMCB _ NUM is the maximum timer number allowed to be set by the relative timer management module;
the timing duration of the relative timer in each short-duration relative timer queue is less than or equal to MAX _ TMCB _ NUM TICKs, wherein the TICK is a unit time; and
the relative timers in each short-duration relative timer queue arrive at the same time;
the long-time relative timer queue is an array, and the length of the array is MAX _ TMCB _ NUM;
the timing duration of the relative timer in the long-duration relative timer queue is greater than MAX _ TMCB _ NUM TICKs.
2. A management method of a timer in a software system is suitable for the timer set by an application task/process, and is characterized by at least comprising the following steps:
step 1: the management system divides the timer set by the application task/process into an absolute timer and a relative timer;
step 2: the management system judges whether the timer set by the application task/process is an absolute timer or a relative timer, and if the timer is the absolute timer, the step 3 is executed; if the relative timer is set, executing step 4;
and step 3: the absolute timer management module combines the absolute timers into an absolute timer queue, and the absolute timer queue manages the absolute timers;
and 4, step 4: the management system judges whether the timing duration of the relative timer is greater than MAX _ TMCB _ NUM TICKs, if not, step 5 is executed; otherwise, executing step 6, wherein the TICK is a unit time;
and 5: the relative timer management module forms a relative timer queue with short time length by using relative timers which arrive at the same time and have the time length less than or equal to MAX _ TMCB _ NUM TICKs, the relative timer management module hangs the relative timer queue with short time length under one element in the TICK queue, and the TICK queue manages the relative timers with the time length less than or equal to MAX _ TMCB _ NUM TICKs; the array length of the TICK queue is MAX _ TMCB _ NUM, and MAX _ TMCB _ NUM is the maximum timer number allowed to be set by the relative timer management module;
step 6: the relative timer management module makes relative timers with timing duration longer than MAX _ TMCB _ NUM TICKs form a long relative timer queue, and the long relative timer queue manages the relative timers with timing duration longer than MAX _ TMCB _ NUM TICKs; the array length of the long relative timer queue is MAX _ TMCB _ NUM, and MAX _ TMCB _ NUM is the maximum timer number allowed to be set by the relative timer management module; each element in the above-described long-duration relative timer queue indicates whether the timer management control block TMCB having the same index number is set.
3. The management method according to claim 2, wherein the step 3 comprises the steps of:
step 301: the absolute timer management module makes the absolute timer form the absolute timer queue according to the length of the set time, namely, the absolute timer which arrives earliest is arranged at the head of the absolute timer queue, and the absolute timer which arrives latest is arranged at the tail of the absolute timer queue;
step 302: the timer scanning task scans the absolute timer arranged at the head of the absolute timer queue in a scanning period;
step 303: the timer scanning task judges whether the absolute timer arranged at the head of the absolute timer queue expires, if not, the timer scanning task continues to scan the absolute timer in the next scanning period; if yes, go to step 304;
step 304: the timer scanning task removes the absolute timer from the head of the absolute timer queue and sends an overtime message to the task which sets the absolute timer; then step 305 is executed;
step 305: the timer scanning task scans the absolute timer arranged at the head of the absolute timer queue in the next scanning period;
step 306: and repeating the steps 303 to 305 until the absolute timer queue is empty.
4. The method of claim 2, wherein said step 5 of forming said short duration relative timer queue comprises the steps of:
step 501: the relative timer management module sets a system cursor, wherein the system cursor represents the current system time, and the value range of the system cursor is 0 to (MAX _ TMCB _ NUM-1);
step 502: the relative timer management module converts the timing duration of each relative timer with the timing duration less than or equal to MAX _ TMCB _ NUM TICKs into an offset in TICK units relative to the system cursor;
step 503: the relative timer management module combines all the relative timers with the same offset position as the system cursor into a relative timer queue with a short duration and hangs them down to an element in the TICK queue.
5. The method according to claim 4, wherein the step 5 of managing a relative timer in the short-duration relative timer queue, wherein the timing duration of one of the relative timers in the short-duration relative timer queue is less than or equal to MAX _ TMCB _ NUM TICKs, comprises the steps of:
step 504: the timer scanning task scans the relative timer in a scanning period, and the system vernier is increased by 1;
step 505: the timer scanning task judges whether the system cursor is overlapped with the relative timer, if not, the timer scanning task continues to scan the relative timer in the next scanning period, and the system cursor is increased by 1; otherwise, go to step 506;
step 506: and the timer scanning task removes the relative timer queue with the short time length where the relative timer is positioned from the TICK queue, and sends an overtime message to the task which sets the relative timer.
6. The method of claim 5, wherein the management is performed in accordance with a protocol selected from the group consisting of a
In step 503, all the relative timers in the short duration relative timer queue expire at the same time, regardless of whether all the relative timers in the short duration relative timer queue are set at the same time;
the method for calculating the position of any relative timer with the timing duration less than or equal to MAX _ TMCBNUM TICKs in the TICK queue comprises the following steps: position (system cursor current position value + TICK number relative to timing duration of timer) mod (MAX _ TMCB _ NUM).
7. The method of claim 2, wherein for said one relative timer having a timing duration greater than MAX _ TMCB _ NUM times TICKs, said step 6 comprises the steps of:
step 601: the relative timer management module sets a system cursor; wherein the system cursor represents the current system time, and the value range is 0 to (MAX _ TMCB _ NUM-1);
step 602: the relative timer management module gives a compensation value to the relative timer, and the final timing duration of the relative timer is the sum of the compensation value and the TICK number of the timing duration of the relative timer to be set, that is, the final timing duration of the relative timer is equal to the compensation value plus the TICK number of the timing duration of the relative timer to be set;
step 603: the timer scanning task scans the relative timer in a scanning period, and the system vernier is increased by 1;
step 604: subtracting the time lengths of MAX _ TMCB _ NUM TICKs from the final timing time length of the corresponding relative timer at the position of the system cursor by the timer scanning task;
step 605: the relative timer management module determines whether the reduced timing duration of the relative timer in the step 604 is less than or equal to MAX _ TMCB _ NUM TICKs, if yes, execute step 606; otherwise, go to step 607;
step 606: the relative timer management module takes the relative timer in step 604 out of the long relative timer queue and then puts it into the tail of the short relative timer queue hanging under one of the elements in the TICK queue;
step 607: step 603 to step 605 are repeatedly executed.
8. The method of claim 7, wherein in step 602, the method for calculating the offset value by the relative timer management module comprises:
step 611: the relative timer management module determines whether the index number of the TMCB used by the relative timer is greater than the current position value of the system cursor, if so, step 612 is executed; otherwise, go to step 613;
step 612: MAX _ TMCB _ NUM- (index of TMCB used relative to timer-current position value of system cursor);
step 613: compensation value-the current position value of the system cursor-the index number of TMCB used relative to the timer.
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
CN101361320A (en) 2009-02-04
HK1126907A1 (en) 2009-09-11
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
CN100484017C (en) Method for statistics of mass performance data in network element management system
TW201633054A (en) Information collection and processing method, client terminal and server
EP3594809A1 (en) Control system for microkernel architecture of industrial server and industrial server comprising the same
CN102455940B (en) Processing method and system of timers and asynchronous events
CN103297395A (en) Achievement method, system and device of internet business
KR20040019379A (en) Server, mobile communication system, positional information managing method, radio base station, mobile station, method for calling in mobile communication system, and mobile communication method
CN1285662A (en) Updating method for timing offset in communication equipment
CN102916992B (en) A kind of method and system of United Dispatching cloud computing remote resource
CN114285515A (en) Method and device for realizing any TSN time window period
Pedreiras et al. Combining event-triggered and time-triggered traffic in FTT-CAN: Analysis of the asynchronous messaging system
CN115811537A (en) Resource adjusting method and device, computer equipment and storage medium
CN104469902A (en) Method and device for controlling RRC (radio resource control) connection status between UE (user equipment) and network side
CN101833450B (en) Timing method and device
CN110324837B (en) Network management method and device
CN115378888B (en) Data processing method, device, equipment and storage medium
KR102176763B1 (en) Adc sampling and resource usage optimization with active variable sampling and active variable phase control
CN114401233B (en) Message scheduling method of time-aware scheduler and time-aware scheduler
CN101925008A (en) Long-period event action time indicating method
CN1332534C (en) Method of supporting node monitoring mobile user state by service universal packet wireless service
CN100502388C (en) Route processing method for modules of border gateway protocol (BGP)
CN1558691A (en) Method for timed monitoring of memory database in mobile communication equipment
CN109525675B (en) Northbound server file downloading method and device, computer equipment and storage medium
CN105264944B (en) Statistical information report method 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