WO2007076636A1 - A management system and management method of the timer in the software system - Google Patents

A management system and management method of the timer in the software system Download PDF

Info

Publication number
WO2007076636A1
WO2007076636A1 PCT/CN2005/002425 CN2005002425W WO2007076636A1 WO 2007076636 A1 WO2007076636 A1 WO 2007076636A1 CN 2005002425 W CN2005002425 W CN 2005002425W WO 2007076636 A1 WO2007076636 A1 WO 2007076636A1
Authority
WO
WIPO (PCT)
Prior art keywords
timer
relative
queue
absolute
tmcb
Prior art date
Application number
PCT/CN2005/002425
Other languages
French (fr)
Chinese (zh)
Inventor
Chuan Ye
Xinghua Li
Wu Luo
Original Assignee
Zte Corporation
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 Corporation filed Critical Zte Corporation
Priority to CN2005800525051A priority Critical patent/CN101361320B/en
Priority to PCT/CN2005/002425 priority patent/WO2007076636A1/en
Publication of WO2007076636A1 publication Critical patent/WO2007076636A1/en
Priority to HK09105599.5A priority patent/HK1126907A1/en

Links

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

Definitions

  • the present invention relates to a timing and timing technique in a software system, and more particularly to a management system and management method for a timer in a software system, which can be used in a mobile terminal and a network side switching device.
  • the current software system requires the use of timers to minimize the system load caused by timer management, reduce the timing error caused by timer updates, and make the timer management and use highly versatile and reduce the software system. Development difficulty and development cost, improve the efficiency and stability of the software system timer.
  • the Chinese patent application with the application number CN02110936 proposes a timing method for the timer in the embedded real-time operating system, which comprises the following steps: a. setting a timer description array of the required maximum number of timers; b, using an array of a certain length and The loop pointer variable constitutes a loop timing queue, and the loop pointer variable points to each array element in a circular manner; c. When the upper layer application needs a timer task, inserts a new timer into the loop timing queue; d. When the timing period comes, the loop pointer variable moves backward, and the queue list queue of the index group element is emptied.
  • an object of the present invention is to provide a simple and efficient management system and management method for a timer in a software system, which does not need to perform a decrementing operation on the timing duration of each timer, and not only considers a short duration timer.
  • the management of the queue, and the management of the long-term timer queue is added.
  • the basic idea of the present invention is: unified management of timer resources in a software system; the timers set by application tasks/processes are divided into two categories: absolute timers and relative timers, and different types of timers are respectively different. Timer queue management.
  • a timer management system in a software system of the present invention is applicable to a timer set by an application task/process, and the timer set by the application task/process includes an absolute timer and a relative timer, and the foregoing
  • the management system includes at least one absolute timer management module and one relative timer management module, wherein:
  • the foregoing absolute timer management module includes at least: an absolute timer queue for managing the above absolute timer;
  • the foregoing relative timer management module includes at least: a TICK queue for managing a relative timer of a short duration, wherein each element in the TICK queue hangs a short duration relative timer queue; and a long duration relative timer Queue, a relative timer used to manage long periods of time.
  • the above-mentioned absolute timer queue is a doubly linked list; the TICK queue is an array whose length is MAX-TMCB-NUM, where MAX_TMCB_NUM is the maximum number of timers allowed by the relative timer management module.
  • the timing duration of the relative timer in each of the short-term relative timer queues is less than or equal to MAX_TMCB_NUM TIC:, where TICK is one unit time; and the relative timer in each of the short-term relative timer queues described above At the same time.
  • the long-term relative timer queue is an array whose length is MAX_TMCB_UM, where MAX_TMCB_NUM is the maximum number of timers allowed by the relative timer management module; the relative duration of the long duration The relative timers in the queue have a timing greater than MAXJTMCB—NUM TICKs, where TICK is one unit time.
  • a method for managing a timer in a software system of the present invention is applicable to a timer set by an application task/process, and includes 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 determines whether the timer to be managed is an absolute timer or a relative timer, if Absolute timer, step 3 is performed; if it is a relative timer, step 4 is performed;
  • Step 3 The absolute timer management module forms the above absolute timer into an absolute timer queue, and the absolute timer queue manages the above absolute timer.
  • Step 4 The management system determines whether the timing duration of the relative timer is greater than MAX TMCB NUM TICK, and if not, step 5 is performed;
  • Step 5 The relative timer management module forms a relative timer queue of a short duration, which is a relative timer that is less than or equal to MAX_TMCB JNiUM TICKs at the same time, and the relative timer management module is short.
  • the relative timer queue of the duration is hung to an element in the TICK queue, and the TICK queue manages the relative timers whose timing duration is less than or equal to MAX_TMCB_NUM TICKs; wherein the array length of the TICK queue is MAX_TMCB— NUM, and MAX__TMCB__NUM is the maximum number of timers allowed by the above relative timer management module;
  • Step 6 The relative timer management module forms a relative timer queue with a duration longer than MAX_TMCB__NUM TICKs, and the relative duration of the long timer is greater than MAX_TMCB_UM.
  • the relative timer of the TICK is managed; wherein the length of the long-term relative timer queue is MAX-TMCB-UM, and MAX_TMCB-NUM is the maximum number of timers allowed by the relative timer management module;
  • Each element in the long-term relative timer queue indicates whether the TMCB with the same index number is set.
  • TMCB[10] has been used by a certain timer.
  • step 3 includes the following steps:
  • Step 301 The absolute timer management module configures the absolute timer according to the length of the set time to form the absolute timer queue, and the absolute timer of the earliest arrival time is arranged in the first part of the absolute timer queue, and the latest arrival time The absolute timer is listed at the end of the above absolute timer queue;
  • Step 302 The timer scan task scans in the above absolute period in one scan period Absolute timer of the queue header;
  • Step 303 The timer scanning task determines whether the absolute timer ranked in the first timer queue is expired, and if not, the timer scanning task continues to scan the absolute timer in the next scanning period; if Perform step 304;
  • Step 304 The timer scanning task removes the foregoing absolute timer from the absolute timer queue header, and sends a timeout message to the task that sets the absolute timer; and then performs step 305;
  • Step 305 The timer scanning task scans an absolute timer that is ranked at the head of the absolute timer queue in the next scanning period.
  • Step 306 Steps 303 to 305 are repeatedly executed until the absolute timer of the first timer queue is not reached or the absolute timer queue is empty.
  • the relative timer queue that constitutes the short duration includes the following steps: Step 501: The relative timer management module sets a system cursor, where the system cursor indicates the current system time, and the value ranges from 0 to 0. (MAX_TMCB_NUM-1); Step 502: The relative timer management module converts the timing duration of each of the relative timers whose timing duration is less than or equal to MAX_TMCB-NUM TICK to TICK relative to the system cursor The offset of the unit;
  • Step 503 The relative timer management module forms a short-term relative timer queue of all the relative timers having the same offset position as the system cursor, and hangs it down to an element in the TICK queue.
  • managing the relative timer in which one of the timing durations is less than or equal to MAX TMCB NUM TICKs includes the following steps - Step 504:
  • the timer scan task scans the relative timer in one scan period, and the system cursor is increased by 1;
  • Step 505 The timer scan task determines whether the system cursor overlaps with the relative timer. If not, the timer scan task continues to scan the relative timer in the next scan period, and the system cursor increases by 1; otherwise, Go to step 506;
  • Step 506 The timer scanning task removes the relative timer queue of the short duration of the relative timer from the TICK queue, and sends a timeout message to the task that sets the relative timer.
  • the step 6 includes the following steps: Step 601: The foregoing relative timer management module sets a system cursor, where the relative timer of the long-term relative timer queue is greater than MAX_TMCB_NUM TICK.
  • the system cursor indicates the current system time, and the value ranges from 0 to (: MAX - TMCB - UM - 1);
  • Step 603 The timer scan task scans the relative timer in one scan period, and the system cursor is increased by 1;
  • Step 604 The timer scanning task subtracts the duration of the MAXJTMCB-NUM TICKs from the final timing duration of the corresponding relative timer at the location of the system cursor;
  • Step 605 The foregoing relative timer management module determines the above step 604. Whether the timing duration of the relative timer subtraction is less than or equal to MAX_TMCB_UM TICK, if yes, step 606 is performed; otherwise, step 607 is performed;
  • Step 606 The relative timer management module removes the relative timer in the foregoing step 604 from the long-term relative timer queue, and then puts it into the TICK queue for a short duration under one of the elements. The tail of the relative timer queue;
  • Step 607 Repeat steps 603 to 605.
  • the timer scan task in the above step 604 can be considered as the above.
  • the corresponding relative timer at the location of the system cursor has passed the MAXJTMCB_NUM TICK time.
  • the method for calculating the compensation value by the relative timer management module is:
  • 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, and if yes, step 612 is performed; otherwise, step 613 is performed;
  • Step 613 The compensation value of the second system cursor current position value is relative to the TMCB index number used by the timer (tic.
  • the management system and the management method according to the present invention have the following advantages: 1. The burden on the timing and timing of the timer management in the software system is alleviated; 2. The timer in the software system is prevented from being used. The chaos on it.
  • FIG. 1 is a schematic diagram of main processes of the management method according to the present invention.
  • FIG. 2 is a schematic diagram of a TICK queue consisting of 2000 array elements of the present invention. detailed description
  • FIG. 1 is a schematic diagram of main processes of the management method according to the present invention. As shown in Figure 1, it includes at least the following steps:
  • Step 1 The management system divides the timer set by the above application task/process into an absolute timer and a relative timer;
  • Step 2 The management system determines whether the timer to be managed is an absolute timer or a relative timer. If it is an absolute timer, step 3 is performed; if it is a relative timer, step 4 is performed; Step 3: The absolute timer management module forms the above absolute timer into an absolute timer queue, and the absolute timer queue manages the above absolute timer.
  • Step 4 The management system determines whether the timing duration of the relative timer is greater than MAX_TMCBJNTUM TICK, if not, execute step 5; otherwise, perform step 6; Step 5: The relative timer management module will arrive at the same time The relative timers whose timing duration is less than or equal to MAX_TMCB_NUM TICKs constitute a short-term relative timer queue, and the relative timer management module hangs the short-term relative timer queue to the TICK queue.
  • the TICK queue manages the relative timers whose timing duration is less than or equal to MAX_TMCB_NUM TICKs; wherein the array length of the TICK queue is MAXJTMCB_NUM, and MAX_TMCB_UM is the relative timer management module The maximum number of timers allowed to be set;
  • Step 6 The relative timer management module forms a relative timer queue TidArray [MAX_TMCB_NUM] whose timing duration is greater than MAX_TMCB_NUM TICK, and the relative timer queue of the long duration is opposite to the timing.
  • the relative timers whose duration is greater than MAXJTMCB-NUM TICKs are managed; wherein the length of the long-term relative timer queue array is MAXJTMCB_NUM, and the MAXJTMCB-NUM is the maximum number of timers allowed by the relative timer management module.
  • Each of the above-mentioned long-term relative timer queues indicates whether or not the TMCB having the same index number is set.
  • the timing precision set by the above-mentioned absolute timer management module is a second level, and the management method of the above absolute timer management module includes the following steps:
  • Step 301 The above absolute timer management module sets the above absolute timer according to the set time.
  • the length of the above-mentioned absolute timer queue, the absolute timer of the earliest arrival time is ranked in the first part of the above absolute timer queue, and the latest absolute timer is arranged at the end of the above absolute timer queue;
  • Step 302 The timer scan task scans an absolute timer ranked in the header of the absolute timer queue in one scan period;
  • Step 303 The timer scanning task determines whether the absolute timer listed in the header of the absolute timer queue is up, if not, the timer scanning task continues to scan the absolute timer in the next scanning period; if Perform step 304;
  • Step 304 The timer scanning task removes the absolute timer from the absolute timer queue header, and sends a timeout message to the task that sets the absolute timer; then step 305 is performed;
  • Step 305 The timer scanning task scans an absolute timer that is ranked at the head of the absolute timer queue in the next scanning period.
  • Step 306 Steps 303 to 305 are repeatedly executed until the absolute timer of the first timer queue is not reached or the absolute timer queue is empty.
  • FIG. 2 is a schematic diagram of a TICK queue consisting of 2000 array elements according to the present invention.
  • the system cursor indicates the current system time, and the system cursor has a value ranging from 0 to 1999.
  • the management of the relative timer of the present invention will be described below with reference to Figs. 1 and 2.
  • the relative timer queue constituting the short duration includes the following steps: Step 501: The relative timer management module sets a system cursor, where the system cursor represents the current system At the moment, its value ranges from 0 to 1999 ; Step 502: The relative timer management module converts a timing duration of each of the relative timers whose timing duration is less than or equal to 2000 TICKs into an offset in units of TICK with respect to the system cursor.
  • Step 503 The relative timer management module forms a short-term relative timer queue of all the relative timers having the same offset position as the system cursor, and hangs it down to an element in the TICK queue.
  • the foregoing relative timer management module is less than or equal to one of the foregoing timing durations.
  • the method for managing the relative timers of 2000 TICKs includes the following steps: Step 504: The timer scan task scans the relative timers in one scan period, and the system cursor increases by 1; indicating the short duration of the relative timers The relative lifetime of all relative timers in the relative timer queue is reduced by one TICK;
  • Step 505 The timer scan task determines whether the system cursor overlaps with the relative timer, and if not, the timer scan task continues to scan the relative timer in the next scan period, and the system cursor increases. 1; otherwise , performing step 506;
  • Step 506 The timer scanning task removes the relative timer queue of the short duration of the relative timer from the TICK queue, and sends a timeout message to the task that sets the relative timer.
  • Step 601 The foregoing relative timer management module sets a system a cursor; wherein the system cursor indicates a current system time, and the range of the cursor is 0 to 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 relative timing.
  • the final timing of the device the compensation value + the number of TICKs of the relative duration of the relative timer to be set;
  • Step 603 The timer scan task scans the relative timer in one scan period, and the system cursor is increased by 1;
  • Step 604 The timer scan task subtracts the duration of the corresponding timing of the corresponding relative timer at the position of the system cursor by 2000 TICK; since the system cursor rotates from the starting position and then returns to the circle The time taken to the original location is exactly 2000 TICK time, so the timer scan task in step 604 can assume that the corresponding relative timer at the location of the system cursor has passed 2000 TICK time;
  • Step 605 The relative timer management module determines whether the timing duration of the relative timer subtraction in the above step 604 is less than or equal to 2000 TICKs, and if yes, executing step 606; otherwise, executing step 607;
  • Step 606 The relative timer management module removes the relative timer in the foregoing step 604 from the long-term relative timer queue TidArmy[2000], and then puts it into one of the elements in the TICK queue. The tail of the relative timer queue for a short duration; Step 607: Steps 603 to 605 are repeatedly performed.
  • the method for calculating the compensation value by the relative timer management module is:
  • 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, and if yes, step 612 is performed; otherwise, step 613 is performed;
  • the timer scanning process is as follows: The system cursor needs to pass 1500 TICK durations before moving to the relative timer position, that is, moving to TidArray[1000] ; at this time, the timer scanning task reduces the final timing of the relative timer.
  • the relative timer management module will compare the timer TidArray[1000] from the long-term relative timer queue TidArray [ It is taken out in 2000] and then placed in the tail of the short-term relative timer queue hanging under one of the elements in the above TICK queue.

Abstract

A management system and management method of the timer in the software system, applying 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 of timer in software system
本发明涉及一种软件系统中的定时和计时技术, 尤其涉及一种软件系 统中定时器的管理系统及管理方法,其可用于移动终端和网络侧交换设备 中。 背景技术  The present invention relates to a timing and timing technique in a software system, and more particularly to a management system and management method for a timer in a software system, which can be used in a mobile terminal and a network side switching device. Background technique
目前通信设备的软件系统的复杂程度日趋增加, 对定时器管理和使用 的要求也水涨船高。现在的软件系统对定时器使用的要求是把因为定时器 管理带来的系统负荷降到最低, 减少定时器更新带来的定时误差, 定时器 管理和使用要做到通用性强, 降低软件系统开发难度和开发成本, 提高软 件系统的定时器的工作效率和稳定性。  At present, the complexity of the software system of communication equipment is increasing, and the requirements for timer management and use are also rising. The current software system requires the use of timers to minimize the system load caused by timer management, reduce the timing error caused by timer updates, and make the timer management and use highly versatile and reduce the software system. Development difficulty and development cost, improve the efficiency and stability of the software system timer.
申请号为 CN02110936的中国专利申请提出了嵌入式实时操作系统中 定时器的计时方法, 其包括以下步骤: a、 设置所需最大定时器数的定时 器描述数组; b、 采用一定长度的数组和循环指针变量组成一个循环计时 队列, 循环指针变量以循环的方式指向各数组元素; c、 当上层应用程序 需要定时器任务时, 将所需新的定时器插入循环计时队列中; d、 在每个 计时周期到来时, 循环指针变量向后移动, 查询所指数组元素的链表队列 是否为空, 如果为空, 则等待下一个计时周期的到来; 如果不为空, 则逐 一判断该链表队列中定时器的描述结构中的倍数值是否为 0, 如为 0则表 示该定时器的定时时间到, 进行相应的报时操作和再次插入定时器操作, 同时从该链表队列中删除该定时器描述数组;如倍数值不为 0则将倍数值 减 1, 然后判断下一个定时器。 该专利申请上述技术方案包括以下缺陷: 1、 链表队列中要倍数值递减, 增加了系统的负担; 2、 其没有考虑超长时 长定时器的问题。 发明内容 The Chinese patent application with the application number CN02110936 proposes a timing method for the timer in the embedded real-time operating system, which comprises the following steps: a. setting a timer description array of the required maximum number of timers; b, using an array of a certain length and The loop pointer variable constitutes a loop timing queue, and the loop pointer variable points to each array element in a circular manner; c. When the upper layer application needs a timer task, inserts a new timer into the loop timing queue; d. When the timing period comes, the loop pointer variable moves backward, and the queue list queue of the index group element is emptied. If it is empty, it waits for the next timing period to arrive; if it is not empty, it judges the list queue one by one. Whether the multiple value in the description structure of the timer is 0. If it is 0, it indicates that the timer has expired, and the corresponding timing operation and re-insertion timer operation are performed. At the same time, the timer description array is deleted from the linked list queue; if the multiple value is not 0, the multiple value is decremented by 1, and then the next timer is determined. The above technical solution of the patent application includes the following defects: 1. The number of times in the linked list queue is decremented, which increases the burden on the system; 2. It does not consider the problem of the ultra long time timer. Summary of the invention
为了解决上述问题,本发明的目的在于提出一种简洁而高效的软件系 统中定时器的管理系统及管理方法,其不需要对各个定时器的定时时长进 行递减操作, 不仅考虑了短时长定时器队列的管理, 而且增加了长时长定 时器队列的管理。 本发明的基本思路是: 对软件系统中的定时器资源进行 统一管理;将应用任务 /进程设置的定时器分为绝对定时器和相对定时器两 大类, 不同种类的定时器分别由不同的定时器队列管理。  In order to solve the above problems, an object of the present invention is to provide a simple and efficient management system and management method for a timer in a software system, which does not need to perform a decrementing operation on the timing duration of each timer, and not only considers a short duration timer. The management of the queue, and the management of the long-term timer queue is added. The basic idea of the present invention is: unified management of timer resources in a software system; the timers set by application tasks/processes are divided into two categories: absolute timers and relative timers, and different types of timers are respectively different. Timer queue management.
为实现上述目的, 本发明的一种软件系统中定时器的管理系统, 适用 于应用任务 /进程设置的定时器, 上述应用任务 /进程设置的定时器包括绝 对定时器和相对定时器,且上述管理系统至少包括一个绝对定时器管理模 块和一个相对定时器管理模块, 其中:  In order to achieve the above object, a timer management system in a software system of the present invention is applicable to a timer set by an application task/process, and the timer set by the application task/process includes an absolute timer and a relative timer, and the foregoing The management system includes at least one absolute timer management module and one relative timer management module, wherein:
上述绝对定时器管理模块至少包括: 一个绝对定时器队列, 用于管理 上述绝对定时器;  The foregoing absolute timer management module includes at least: an absolute timer queue for managing the above absolute timer;
上述相对定时器管理模块至少包括: 一个 TICK队列, 用于管理短时 长的相对定时器, 其中该 TICK队列中每一个元素下挂一个短时长的相对 定时器队列; 和一个长时长的相对定时器队列, 用于管理长时长的相对定 时器。 其中, 上述绝对定时器队列为一个双向链表; 上述 TICK队列为一个 数组, 其数组长度为 MAX一 TMCB— NUM, 其中 MAX— TMCB— NUM为上 述相对定时器管理模块所允许设置的最大定时器数;上述每一个短时长的 相对定时器队列中 的相对定时器的定时时长小于或等于 MAX_TMCB_NUM个 TIC :,其中 TICK为一个单位时间; 及上述每一个 短时长的相对定时器队列中的相对定时器在同一时刻到时。 The foregoing relative timer management module includes at least: a TICK queue for managing a relative timer of a short duration, wherein each element in the TICK queue hangs a short duration relative timer queue; and a long duration relative timer Queue, a relative timer used to manage long periods of time. The above-mentioned absolute timer queue is a doubly linked list; the TICK queue is an array whose length is MAX-TMCB-NUM, where MAX_TMCB_NUM is the maximum number of timers allowed by the relative timer management module. The timing duration of the relative timer in each of the short-term relative timer queues is less than or equal to MAX_TMCB_NUM TIC:, where TICK is one unit time; and the relative timer in each of the short-term relative timer queues described above At the same time.
此外, 上述长时长的相对定时器队列为一个数组, 其数组长度为 MAX_TMCB_ UM, 其中 MAX— TMCB— NUM为上述相对定时器管理模 块所允许设置的最大定时器数;上述长时长的相对定时器队列中的相对定 时器的定时时长大于 MAXJTMCB—NUM个 TICK, 其中 TICK为一个单 位时间。  In addition, the long-term relative timer queue is an array whose length is MAX_TMCB_UM, where MAX_TMCB_NUM is the maximum number of timers allowed by the relative timer management module; the relative duration of the long duration The relative timers in the queue have a timing greater than MAXJTMCB—NUM TICKs, where TICK is one unit time.
为实现上述目的, 本发明的一种软件系统中定时器的管理方法, 适用 于应用任务 /进程设置的定时器, 至少包括以下步骤:  To achieve the above objective, a method for managing a timer in a software system of the present invention is applicable to a timer set by an application task/process, and includes at least the following steps:
步骤 1: 管理系统将上述应用任务 /进程设置的定时器分为绝对定时器 和相对定时器; ' 步骤 2: 上述管理系统判断上述待管理的定时器为绝对定时器还是相 对定时器, 若为绝对定时器, 则执行步骤 3 ; 若为相对定时器, 则执行步 骤 4;  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 determines whether the timer to be managed is an absolute timer or a relative timer, if Absolute timer, step 3 is performed; if it is a relative timer, step 4 is performed;
步骤 3: 绝对定时器管理模块将上述绝对定时器组成一个绝对定时器 队列, 且该绝对定时器队列对上述绝对定时器进行管理;  Step 3: The absolute timer management module forms the above absolute timer into an absolute timer queue, and the absolute timer queue manages the above absolute timer.
步骤 4: 上述管理系统判断上述相对定时器的定时时长是否大于 MAX TMCB NUM个 TICK, 若否, 则执行步骤 5; 否贝 lj, 执行步骤 6; 步骤 5: 相对定时器管理模块将在同一时刻到时的、 定时时长小于或 等于 MAX— TMCB JNiUM个 TICK的相对定时器组成一个短时长的相对定 时器队列,上述相对定时器管理模块将该短时长的相对定时器队列下挂至 TICK队列中的一个元素下, 且该 TICK队列对上述定时时长小于或等于 MAX_TMCB_NUM个 TICK的相对定时器进行管理; 其中上述 TICK队 列的数组长度为 MAX—TMCB—NUM, 且 MAX__TMCB__NUM为上述相对 定时器管理模块所允许设置的最大定时器数; Step 4: The management system determines whether the timing duration of the relative timer is greater than MAX TMCB NUM TICK, and if not, step 5 is performed; Step 5: The relative timer management module forms a relative timer queue of a short duration, which is a relative timer that is less than or equal to MAX_TMCB JNiUM TICKs at the same time, and the relative timer management module is short. The relative timer queue of the duration is hung to an element in the TICK queue, and the TICK queue manages the relative timers whose timing duration is less than or equal to MAX_TMCB_NUM TICKs; wherein the array length of the TICK queue is MAX_TMCB— NUM, and MAX__TMCB__NUM is the maximum number of timers allowed by the above relative timer management module;
步骤 6:上述相对定时器管理模块将定时时长大于 MAX—TMCB__NUM 个 TICK的相对定时器组成一个长时长的相对定时器队列, 且该长时长的 相对定时器队列对上述定时时长大于 MAX_TMCB— UM个 TICK的相对 定时器进行管理; 其中上述长时长的相对定时器队列的数组长度为 MAX— TMCB一 UM, 且 MAX— TMCB一 NUM为上述相对定时器管理模块 所允许设置的最大定时器数;上述长时长的相对定时器队列中的每一个元 素表示具有相同索引号的 TMCB是否被设置。  Step 6: The relative timer management module forms a relative timer queue with a duration longer than MAX_TMCB__NUM TICKs, and the relative duration of the long timer is greater than MAX_TMCB_UM. The relative timer of the TICK is managed; wherein the length of the long-term relative timer queue is MAX-TMCB-UM, and MAX_TMCB-NUM is the maximum number of timers allowed by the relative timer management module; Each element in the long-term relative timer queue indicates whether the TMCB with the same index number is set.
例如, 上述长时长的相对定时器队列中的第 10个元素为真 (TRUE), 则表示 TMCB[10]已经被某个定时器使用了。  For example, if the 10th element in the long-term relative timer queue is true (TRUE), it means that TMCB[10] has been used by a certain timer.
其中, 上述步骤 3包括以下步骤:  Wherein, the above step 3 includes the following steps:
步骤 301 : 上述绝对定时器管理模块将上述绝对定时器按照设定时刻 的长短组成上述绝对定时器队列, 即将最早到时的绝对定时器排在上述绝 对定时器队列的首部,将最晚到时的绝对定时器排在上述绝对定时器队列 的尾部;  Step 301: The absolute timer management module configures the absolute timer according to the length of the set time to form the absolute timer queue, and the absolute timer of the earliest arrival time is arranged in the first part of the absolute timer queue, and the latest arrival time The absolute timer is listed at the end of the above absolute timer queue;
步骤 302: 定时器扫描任务在一个扫描周期内扫描排在上述绝对定时 器队列首部的绝对定时器; Step 302: The timer scan task scans in the above absolute period in one scan period Absolute timer of the queue header;
步骤 303: 上述定时器扫描任务判断上述排在上述绝对定时器队列首 部的绝对定时器是否到时, 若否, 则上述定时器扫描任务在下一个扫描周 期内继续扫描该绝对定时器; 若则, 执行步骤 304;  Step 303: The timer scanning task determines whether the absolute timer ranked in the first timer queue is expired, and if not, the timer scanning task continues to scan the absolute timer in the next scanning period; if Perform step 304;
步骤 304: 上述定时器扫描任务将上述绝对定时器从上述绝对定时器 队列首部移除, 并向设置该绝对定时器的任务发送超时消息; 之后执行步 骤 305 ;  Step 304: The timer scanning task removes the foregoing absolute timer from the absolute timer queue header, and sends a timeout message to the task that sets the absolute timer; and then performs step 305;
步骤 305: 上述定时器扫描任务在下一个扫描周期内扫描此时排在上 述绝对定时器队列首部的绝对定时器;  Step 305: The timer scanning task scans an absolute timer that is ranked at the head of the absolute timer queue in the next scanning period.
步骤 306:重复执行步骤 303〜步骤 305,直至排在上述绝对定时器队 列首部的绝对定时器没有到时或上述绝对定时器队列为空。  Step 306: Steps 303 to 305 are repeatedly executed until the absolute timer of the first timer queue is not reached or the absolute timer queue is empty.
在上述步骤 5中组成上述短时长的相对定时器队列包括以下步骤- 步骤 501 : 上述相对定时器管理模块设定一个系统游标, 其中该系统 游标表示当前的系统时刻, 其取值范围为 0〜(MAX_TMCB—NUM—1); 步骤 502: 上述相对定时器管理模块将每一个上述定时时长小于或等 于 MAX— TMCB一 NUM个 TICK的相对定时器的定时时长转换为相对于上 述系统游标的以 TICK为单位的偏移;  In the above step 5, the relative timer queue that constitutes the short duration includes the following steps: Step 501: The relative timer management module sets a system cursor, where the system cursor indicates the current system time, and the value ranges from 0 to 0. (MAX_TMCB_NUM-1); Step 502: The relative timer management module converts the timing duration of each of the relative timers whose timing duration is less than or equal to MAX_TMCB-NUM TICK to TICK relative to the system cursor The offset of the unit;
步骤 503: 上述相对定时器管理模块将与上述系统游标具有相同偏移 位置的所有上述相对定时器组成一个短时长的相对定时器队列, 并将其下 挂至上述 TICK队列中的一个元素下。  Step 503: The relative timer management module forms a short-term relative timer queue of all the relative timers having the same offset position as the system cursor, and hangs it down to an element in the TICK queue.
其中, 在上述步骤 5 中对上述其中一个定时时长小于或等于 MAX TMCB NUM个 TICK的相对定时器进行管理包括以下步骤- 步骤 504: 定时器扫描任务在一个扫描周期内扫描上述相对定时器, 且上述系统游标增加 1 ; Wherein, in the above step 5, managing the relative timer in which one of the timing durations is less than or equal to MAX TMCB NUM TICKs includes the following steps - Step 504: The timer scan task scans the relative timer in one scan period, and the system cursor is increased by 1;
步骤 505: 上述定时器扫描任务判断上述系统游标是否与上述相对定 时器重合, 若否, 则上述定时器扫描任务在下一个扫描周期内继续扫描该 相对定时器, 且上述系统游标增加 1 ; 否则, 执行步骤 506;  Step 505: The timer scan task determines whether the system cursor overlaps with the relative timer. If not, the timer scan task continues to scan the relative timer in the next scan period, and the system cursor increases by 1; otherwise, Go to step 506;
步骤 506: 上述定时器扫描任务将上述相对定时器所在的短时长的相 对定时器队列从上述 TICK队列中移除, 并向设置该相对定时器的任务发 送超时消息。  Step 506: The timer scanning task removes the relative timer queue of the short duration of the relative timer from the TICK queue, and sends a timeout message to the task that sets the relative timer.
在上述步骤 503中, 无论上述短时长的相对定时器队列中的所有相对 定时器是否在同一时刻设置,上述短时长的相对定时器队列中的所有相对 定时器在同一时刻到时, 因为上述所有相对定时器和上述系统游标的 TICK 偏移位置都相同; 将任何一个定时时长小于或等于 MAX_TMCB_NUM个 TICK的相对定时器放入上述 TICK队列中的位置 的计算方法为: 位置 = (系统游标当前位置值 +相对定时器的定时时长的 TICK数) mod (MAX— TMCB— NUM)。  In the above step 503, regardless of whether all the relative timers in the short-term relative timer queue are set at the same time, all the relative timers in the short-term relative timer queue arrive at the same time, because all of the above The relative timer and the above system cursor have the same TICK offset position; any relative timer with a timing duration less than or equal to MAX_TMCB_NUM TICK is placed in the above TICK queue as: position = (system cursor current position) Value + TICK number relative to the timer's timing duration) mod (MAX - TMCB - NUM).
其中,对于上述长时长的相对定时器队列中的其中一个定时时长大于 MAX_TMCB_NUM个 TICK的相对定时器, 上述步骤 6包括以下步骤: 步骤 601 : 上述相对定时器管理模块设定一个系统游标; 其中该系统 游标表示当前的系统时刻, 其取值范围为 0〜(: MAX— TMCB— UM— 1); 步骤 602: 上述相对定时器管理模块给上述相对定时器一个补偿值, 则该相对定时器的最终定时时长为上述补偿值与需要设置的相对定时器 的定时时长的 TICK数之和, 即相对定时器的最终定时时长=补偿值 +需 要设置的相对定时器的定时时长的 TICK数; The step 6 includes the following steps: Step 601: The foregoing relative timer management module sets a system cursor, where the relative timer of the long-term relative timer queue is greater than MAX_TMCB_NUM TICK. The system cursor indicates the current system time, and the value ranges from 0 to (: MAX - TMCB - UM - 1); Step 602: The relative timer management module gives a compensation value to the relative timer, and the relative timer The final timing is the sum of the above compensation value and the number of TICKs of the relative timers to be set, that is, the final timing of the relative timer = compensation value + The number of TICKs of the relative duration of the relative timer to be set;
' 步骤 603 : 定时器扫描任务在一个扫描周期内扫描上述相对定时器, 且上述系统游标增加 1 ;  Step 603: The timer scan task scans the relative timer in one scan period, and the system cursor is increased by 1;
步骤 604: 上述定时器扫描任务将上述系统游标所到位置上的对应的 相对定时器的最终定时时长减去 MAXJTMCB—NUM个 TICK的时长; 步骤 605: 上述相对定时器管理模块判断上述步骤 604中的相对定时 器减后的定时时长是否小于或等于 MAX—TMCB— UM个 TICK, 若是, 则执行步骤 606; 否则, 执行步骤 607; .  Step 604: The timer scanning task subtracts the duration of the MAXJTMCB-NUM TICKs from the final timing duration of the corresponding relative timer at the location of the system cursor; Step 605: The foregoing relative timer management module determines the above step 604. Whether the timing duration of the relative timer subtraction is less than or equal to MAX_TMCB_UM TICK, if yes, step 606 is performed; otherwise, step 607 is performed;
步骤 606: 上述相对定时器管理模块将上述步骤 604中的相对定时器 从上述长时长的相对定时器队列中取出, 之后将其放入上述 TICK队列中 的下挂在其中一个元素下的短时长的相对定时器队列的尾部;  Step 606: The relative timer management module removes the relative timer in the foregoing step 604 from the long-term relative timer queue, and then puts it into the TICK queue for a short duration under one of the elements. The tail of the relative timer queue;
步骤 607: 重复执行步骤 603〜步骤 605。  Step 607: Repeat steps 603 to 605.
此外, 由于上述系统游标从起始位置幵始循环转一圈后再回到原先的 位置所用的时间恰好为 MAX—TMCB_ UM个 TICK的时间, 因此上述步 骤 604中的定时器扫描任务可以认为上述系统游标所到位置上的对应的相 对定时器已经经过了 MAXJTMCB_NUM个 TICK的时间。  In addition, since the time taken by the system cursor from the start position to the original position and then back to the original position is exactly the time of the MAX_TMCB_UM TICK, the timer scan task in the above step 604 can be considered as the above. The corresponding relative timer at the location of the system cursor has passed the MAXJTMCB_NUM TICK time.
另外, 在上述步骤 602中, 上述相对定时器管理模块计算上述补偿值 的方法为: .  In addition, in the above step 602, the method for calculating the compensation value by the relative timer management module is:
步骤 611 : 上述相对定时器管理模块判断上述相对定时器使用的 TMCB的索引号 (tid)是否大于上述系统游标当前的位置值, 若是, 则执行 步骤 612; 否则, 执行步骤 613 ;  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, and if yes, step 612 is performed; otherwise, step 613 is performed;
步骤 612: 补偿值 =MAX_TMCB一 NUM— (相对定时器使用的 TMCB 的索引号 (tid)—系统游标当前的位置值:); Step 612: Compensation value = MAX_TMCB - NUM - (TMCB relative to the timer used) Index number (tid) - the current position value of the system cursor:);
步骤 613 : 补偿值二系统游标当前的位置值一相对定时器使用的 TMCB的索引号 (tic 。  Step 613: The compensation value of the second system cursor current position value is relative to the TMCB index number used by the timer (tic.
采用本发明所述的管理系统及管理方法, 具有如下几个方面的优点: 1、 减轻了软件系统中有关定时器管理在定时和计时方面的负担; 2、 预防 了软件系统中的定时器使用上的混乱。  The management system and the management method according to the present invention have the following advantages: 1. The burden on the timing and timing of the timer management in the software system is alleviated; 2. The timer in the software system is prevented from being used. The chaos on it.
为让本发明的上述和其它目的、特征和优点能更明显易懂, 下文特举 较佳实施例, 并配合说明书附图, 作详细说明如下。 附图说明  The above and other objects, features, and advantages of the present invention will become more apparent and understood by the appended claims appended claims DRAWINGS
图 1为本发明所述管理方法的主要流程示意图;  1 is a schematic diagram of main processes of the management method according to the present invention;
图 2为本发明由 2000个数组元素组成的 TICK队列的示意图。 具体实施方式  Figure 2 is a schematic diagram of a TICK queue consisting of 2000 array elements of the present invention. detailed description
现基于本发明提出一种实施方案, 但本发明不限于这种具体实施方 案。  An embodiment is now proposed based on the present invention, but the invention is not limited to this specific embodiment.
图 1为本发明所述管理方法的主要流程示意图。 如图 1所示, 其至少 包括以下步骤:  FIG. 1 is a schematic diagram of main processes of the management method according to the present invention. As shown in Figure 1, it includes at least the following steps:
步骤 1 : 管理系统将上述应用任务 /进程设置的定时器分为绝对定时器 和相对定时器;  Step 1: The management system divides the timer set by the above application task/process into an absolute timer and a relative timer;
步骤 2: 上述管理系统判断上述待管理的定时器为绝对定时器还是相 对定时器, 若为绝对定时器, 则执行步骤 3; 若为相对定时器, 则执行步 骤 4; · 步骤 3 : 绝对定时器管理模块将上述绝对定时器组成一个绝对定时器 队列, 且该绝对定时器队列对上述绝对定时器进行管理; Step 2: The management system determines whether the timer to be managed is an absolute timer or a relative timer. If it is an absolute timer, step 3 is performed; if it is a relative timer, step 4 is performed; Step 3: The absolute timer management module forms the above absolute timer into an absolute timer queue, and the absolute timer queue manages the above absolute timer.
步骤 4: 上述管理系统判断上述相对定时器的定时时长是否大于 MAX— TMCBJNTUM个 TICK, 若否, 则执行步骤 5; 否则, 执行步骤 6; 步骤 5: 相对定时器管理模块将在同一时刻到时的、 定时时长小于或 等于 MAX—TMCB— NUM个 TICK的相对定时器组成一个短时长的相对定 时器队列, 上述相对定时器管理模块将该短时长的相对定时器队列下挂至 TICK队列中的一个元素下, 且该 TICK队列对上述定时时长小于或等于 MAX_TMCB_NUM个 TICK的相对定时器进行管理; 其中上述 TICK队 列的数组长度为 MAXJTMCB— NUM, 且 MAX— TMCB— UM为上述相对 定时器管理模块所允许设置的最大定时器数;  Step 4: The management system determines whether the timing duration of the relative timer is greater than MAX_TMCBJNTUM TICK, if not, execute step 5; otherwise, perform step 6; Step 5: The relative timer management module will arrive at the same time The relative timers whose timing duration is less than or equal to MAX_TMCB_NUM TICKs constitute a short-term relative timer queue, and the relative timer management module hangs the short-term relative timer queue to the TICK queue. Under one element, the TICK queue manages the relative timers whose timing duration is less than or equal to MAX_TMCB_NUM TICKs; wherein the array length of the TICK queue is MAXJTMCB_NUM, and MAX_TMCB_UM is the relative timer management module The maximum number of timers allowed to be set;
步骤 6:上述相对定时器管理模块将定时时长大于 MAX— TMCB— NUM 个 TICK 的相对定时器组成一个长时长的相对定时器队列 TidArray [MAX_TMCB_NUM] , 且该长时长的相对定时器队列对上述定时 时长大于 MAXJTMCB—NUM个 TICK的相对定时器进行管理; 其中上述 长时长的相对定时器队列的数组长度为 MAXJTMCB—NUM, 且 MAXJTMCB一 NUM为上述相对定时器管理模块所允许设置的最大定时器 数;上述长时长的相对定时器队列中的每一个元素表示具有相同索引号的 TMCB是否被设置。  Step 6: The relative timer management module forms a relative timer queue TidArray [MAX_TMCB_NUM] whose timing duration is greater than MAX_TMCB_NUM TICK, and the relative timer queue of the long duration is opposite to the timing. The relative timers whose duration is greater than MAXJTMCB-NUM TICKs are managed; wherein the length of the long-term relative timer queue array is MAXJTMCB_NUM, and the MAXJTMCB-NUM is the maximum number of timers allowed by the relative timer management module. Each of the above-mentioned long-term relative timer queues indicates whether or not the TMCB having the same index number is set.
对于绝对定时器的管理,上述绝对定时器管理模块设定的定时精度为 秒级, 且上述绝对定时器管理模块的管理方法包括以下步骤:  For the management of the absolute timer, the timing precision set by the above-mentioned absolute timer management module is a second level, and the management method of the above absolute timer management module includes the following steps:
步骤 301 : 上述绝对定时器管理模块将上述绝对定时器按照设定时刻 的长短组成上述绝对定时器队列, 即将最早到时的绝对定时器排在上述绝 对定时器队列的首部,将最晚到时的绝对定时器排在上述绝对定时器队列 的尾部; ' Step 301: The above absolute timer management module sets the above absolute timer according to the set time. The length of the above-mentioned absolute timer queue, the absolute timer of the earliest arrival time is ranked in the first part of the above absolute timer queue, and the latest absolute timer is arranged at the end of the above absolute timer queue;
步骤 302: 定时器扫描任务在一个扫描周期内扫描排在上述绝对定时 器队列首部的绝对定时器;  Step 302: The timer scan task scans an absolute timer ranked in the header of the absolute timer queue in one scan period;
步骤 303 : 上述定时器扫描任务判断上述排在上述绝对定时器队列首 部的绝对定时器是否到时, 若否, 则上述定时器扫描任务在下一个扫描周 期内继续扫描该绝对定时器; 若则, 执行步骤 304;  Step 303: The timer scanning task determines whether the absolute timer listed in the header of the absolute timer queue is up, if not, the timer scanning task continues to scan the absolute timer in the next scanning period; if Perform step 304;
步骤 304: 上述定时器扫描任务将上述绝对定时器从上述绝对定时器 队列首部移除, 并向设置该绝对定时器的任务发送超时消息; 之后执行步 骤 305;  Step 304: The timer scanning task removes the absolute timer from the absolute timer queue header, and sends a timeout message to the task that sets the absolute timer; then step 305 is performed;
步骤 305: 上述定时器扫描任务在下一个扫描周期内扫描此时排在上 述绝对定时器队列首部的绝对定时器;  Step 305: The timer scanning task scans an absolute timer that is ranked at the head of the absolute timer queue in the next scanning period.
步骤 306:重复执行步骤 303〜步骤 305,直至排在上述绝对定时器队 列首部的绝对定时器没有到时或上述绝对定时器队列为空。  Step 306: Steps 303 to 305 are repeatedly executed until the absolute timer of the first timer queue is not reached or the absolute timer queue is empty.
图 2为本发明由 2000个数组元素组成的 TICK队列的示意图, 系统 游标表示当前的系统时刻, 该系统游标的取值范围为 0〜1999。 下面结合 图 1和图 2对本发明对相对定时器的管理说明如下。  2 is a schematic diagram of a TICK queue consisting of 2000 array elements according to the present invention. The system cursor indicates the current system time, and the system cursor has a value ranging from 0 to 1999. The management of the relative timer of the present invention will be described below with reference to Figs. 1 and 2.
对于定时时长小于或等于 2000个 TICK的相对定时器, 组成上述短 时长的相对定时器队列包括以下步骤- 步骤 501 : 上述相对定时器管理模块设定一个系统游标, 其中该系统 游标表示当前的系统时刻, 其取值范围为 0〜1999; 步骤 502: 上述相对定时器管理模块将每一个上述定时时长小于或等 于 2000个 TICK的相对定时器的定时时长转换为相对于上述系统游标的 以 TICK为单位的偏移; For a relative timer whose timing duration is less than or equal to 2000 TICK, the relative timer queue constituting the short duration includes the following steps: Step 501: The relative timer management module sets a system cursor, where the system cursor represents the current system At the moment, its value ranges from 0 to 1999 ; Step 502: The relative timer management module converts a timing duration of each of the relative timers whose timing duration is less than or equal to 2000 TICKs into an offset in units of TICK with respect to the system cursor.
步骤 503: 上述相对定时器管理模块将与上述系统游标具有相同偏移 位置的所有上述相对定时器组成一个短时长的相对定时器队列, 并将其下 挂至上述 TICK队列中的一个元素下。  Step 503: The relative timer management module forms a short-term relative timer queue of all the relative timers having the same offset position as the system cursor, and hangs it down to an element in the TICK queue.
其中, 上述相对定时器管理模块对上述其中一个定时时长小于或等于 The foregoing relative timer management module is less than or equal to one of the foregoing timing durations.
2000个 TICK的相对定时器进行管理的方法包括以下步骤- 步骤 504: 定时器扫描任务在一个扫描周期内扫描上述相对定时器, 且上述系统游标增加 1 ; 则表示该相对定时器所在的短时长的相对定时器 队列中的所有相对定时器的寿命减少了一个 TICK; The method for managing the relative timers of 2000 TICKs includes the following steps: Step 504: The timer scan task scans the relative timers in one scan period, and the system cursor increases by 1; indicating the short duration of the relative timers The relative lifetime of all relative timers in the relative timer queue is reduced by one TICK;
步骤 505: 上述定时器扫描任务判断上述系统游标是否与上述相对定 时器重合, 若否, 则上述定时器扫描任务在下一个扫描周期内继续扫描该 相对定时器, 且上述系统游标增加 . 1 ; 否则, 执行步骤 506;  Step 505: The timer scan task determines whether the system cursor overlaps with the relative timer, and if not, the timer scan task continues to scan the relative timer in the next scan period, and the system cursor increases. 1; otherwise , performing step 506;
步骤 506: 上述定时器扫描任务将上述相对定时器所在的短时长的相 对定时器队列从上述 TICK队列中移除, 并向设置该相对定时器的任务发 送超时消息。  Step 506: The timer scanning task removes the relative timer queue of the short duration of the relative timer from the TICK queue, and sends a timeout message to the task that sets the relative timer.
例如: 设置一个定时时长为 800个 TICK的相对定时器, 该相对定时 器相对于系统游标的偏移为 800。 在每一个扫描周期内, 该系统游标增加 1, 定时器扫描任务扫描 800次后系统游标恰好和该相对定时器重合, 即 该定时时长为 800个 TICK的相对定时器的寿命结束。  For example: Set a relative timer with a duration of 800 TICKs, which is offset from the system cursor by 800. During each scan cycle, the system cursor is incremented by 1. After the timer scan task scans 800 times, the system cursor coincides with the relative timer, that is, the duration of the relative timer of 800 TICK is over.
对于定时时长大于 2000个 TICK的相对定时器, 上述相对定时器管 理模块对上述长时长的相对定时器队列 TidArray[2000]中的其中一个定时 时长大于 2000个 TICK的相对定时器进行管理的方法包括以下步骤- 步骤 601 : 上述相对定时器管理模块设定一个系统游标; 其中该系统 游标表示当前的系统时刻, 其取 ί直范围为 0〜1999; For a relative timer with a timing duration greater than 2000 TICK, the above relative timer tube The method for managing the relative timer of one of the long-term relative timer queues TidArray[2000] with a timing duration greater than 2000 TICKs includes the following steps: Step 601: The foregoing relative timer management module sets a system a cursor; wherein the system cursor indicates a current system time, and the range of the cursor is 0 to 1999;
步骤 602: 上述相对定时器管理模块给上述相对定时器一个补偿值, 则该相对定时器的最终定时时长为上述补偿值与需要设置的相对定时器 的定时时长的 TICK数之和, 即相对定时器的最终定时时长=补偿值 +需 要设置的相对定时器的定时时长的 TICK数;  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 relative timing. The final timing of the device = the compensation value + the number of TICKs of the relative duration of the relative timer to be set;
步骤 603: 定时器扫描任务在一个扫描周期内扫描上述相对定时器, 且上述系统游标增加 1 ;  Step 603: The timer scan task scans the relative timer in one scan period, and the system cursor is increased by 1;
步骤 604: 上述定时器扫描任务将上述系统游标所到位置上的对应的 相对定时器的最终定时时长减去 2000个 TICK的时长; 由于上述系统游 标从起始位置开始循环转一圈后再回到原先的位置所用的时间恰好为 2000个 TICK的时间,因此步骤 604中的定时器扫描任务可以认为上述系 统游标所到位置上的对应的相对定时器已经经过了 2000个 TICK的时间; 步骤 605: 上述相对定时器管理模块判断上述步骤 604中的相对定时 器减后的定时时长是否小于或等于 2000个 TICK,若是,则执行步骤 606; 否则, 执行步骤 607; .  Step 604: The timer scan task subtracts the duration of the corresponding timing of the corresponding relative timer at the position of the system cursor by 2000 TICK; since the system cursor rotates from the starting position and then returns to the circle The time taken to the original location is exactly 2000 TICK time, so the timer scan task in step 604 can assume that the corresponding relative timer at the location of the system cursor has passed 2000 TICK time; Step 605 The relative timer management module determines whether the timing duration of the relative timer subtraction in the above step 604 is less than or equal to 2000 TICKs, and if yes, executing step 606; otherwise, executing step 607;
步骤 606: 上述相对定时器管理模块将上述步骤 604中的相对定时器 从上述长时长的相对定时器队列 TidArmy[2000]中取出, 之后将其放入上 述 TICK队列中的下挂在其中一个元素下的短时长的相对定时器队列的尾 部; 步骤 607: 重复执行步骤 603〜步骤 605。 Step 606: The relative timer management module removes the relative timer in the foregoing step 604 from the long-term relative timer queue TidArmy[2000], and then puts it into one of the elements in the TICK queue. The tail of the relative timer queue for a short duration; Step 607: Steps 603 to 605 are repeatedly performed.
另外, 在上述步骤 602中, 上述相对定时器管理模块计算上述补偿值 的方法为:  In addition, in the above step 602, the method for calculating the compensation value by the relative timer management module is:
步骤 611 : 上述相对定时器管理模块判断上述相对定时器使用的 TMCB的索引号 (tid)是否大于上述系统游标当前的位置值, 若是, 则执行 步骤 612; 否则, 执行步骤 613 ;  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, and if yes, step 612 is performed; otherwise, step 613 is performed;
步骤 612: 补偿值 =2000— (相对定时器使用的 TMCB 的索引号 (tid) 一系统游标当前的位壹值);  Step 612: Compensation value = 2000 - (relative to the TMCB index number (tid) used by the timer) The current position value of a system cursor;
步骤 613 : 补偿值 =系统游标当前的位置值一相对定时器使用的 TMCB的索引号 (tid)。  Step 613: Compensation value = the current position value of the system cursor is the index number (tid) of the TMCB used by the timer.
例如,假设系统游标当前的位置值为 1500,需要设置的相对定时器的 定时时长的 TICK数为 3000, 该相对定时器使用的 TMCB的索引号 (tid) 为 1000, 则上述相对定时器管理模块给该相对定时器的补偿值为: 1500 - 1000 = 500, 则该相对定时器的最终定时时长为: 500+3000=3500。 定 时器扫描过程为: 系统游标需要经过 1500个 TICK时长后才能移动到该 相对定时器的位置, 即移动到 TidArray[1000]; 此时, 定时器扫描任务将 该相对定时器的最终定时时长减去 2000个 TICK,剩余 1500个 TICK; 由 于该相对定时器剩余的定时时长小于 2000个 TICK,因此上述相对定时器 管理模块将相对定时器 TidArray[1000〗 从上述长时长的相对定时器队列 TidArray[2000]中取出,之后将其放入上述 TICK队列中的下挂在其中一个 元素下的短时长的相对定时器队列的尾部。 For example, suppose the current position value of the system cursor is 1500, the TICK number of the relative timer of the relative timer to be set is 3000, and the index number (tid) of the TMCB used by the relative timer is 1000, then the relative timer management module The compensation value for the relative timer is: 1500 - 1000 = 500, then the final timing of the relative timer is: 500+3000=3500. The timer scanning process is as follows: The system cursor needs to pass 1500 TICK durations before moving to the relative timer position, that is, moving to TidArray[1000] ; at this time, the timer scanning task reduces the final timing of the relative timer. Go to 2000 TICK, leaving 1500 TICK; Since the relative timer duration of the relative timer is less than 2000 TICK, the relative timer management module will compare the timer TidArray[1000] from the long-term relative timer queue TidArray [ It is taken out in 2000] and then placed in the tail of the short-term relative timer queue hanging under one of the elements in the above TICK queue.
以上详细说明了本发明的工作原理,但这只是为了便于理解而举的一 N2005/002425 个形象化的实例, 不应被视为是对本发明范围的限制。 同样, 根据本发明 的技术方案及其较佳实施例的描述, 可以做出各种可能的等同改变或替 换, 而所有这些改变或替换都应属于本发明的权利要求的保护范围。 The working principle of the present invention has been described in detail above, but this is only for ease of understanding. The visualized examples of N2005/002425 should not be construed as limiting the scope of the invention. Also, various possible equivalents and modifications may be made without departing from the scope of the invention as defined by the appended claims.

Claims

权 利 要 求 Rights request
1、 一种软件系统中定时器的管理系统, 适用于应用任务 /进程设置的 定时器,其特征在于上述应用任务 /进程设置的定时器包括绝对定时器和相 对定时器,且上述管理系统至少包括一个绝对定时器管理模块和一个相对 定时器管理模块, 其中: A timer management system for a software system, which is applicable to a timer set by an application task/process, wherein the timer set by the application task/process includes an absolute timer and a relative timer, and the foregoing management system is at least It includes an absolute timer management module and a relative timer management module, where:
上述绝对定时器管理模块至少包括: 一个绝对定时器队列, 用于管理 上述绝对定时器;  The foregoing absolute timer management module includes at least: an absolute timer queue for managing the above absolute timer;
上述相对定时器管理模块至少包括:  The foregoing relative timer management module includes at least:
一个 TICK队列, 用于管理短时长的相对定时器, 其中该 TICK 队列中每一个元素下挂一个短时长的相对定时器队列;  a TICK queue for managing a relative timer of a short duration, wherein each element in the TICK queue hangs a short duration relative timer queue;
一个长时长的相对定时器队列, 用于管理长时长的相对定时器。 A long-term relative timer queue for managing long-term relative timers.
2、 根据权利要求 1所述的管理系统, 其特征在于 2. The management system of claim 1 wherein
上述绝对定时器队列为一个双向链表;  The above absolute timer queue is a doubly linked list;
上述 TICK队列为一个数组, 其数组长度为 MAX— TMCB—NUM, 其 中 MAX— TMCB—NUM为上述相对定时器管理模块所允许设置的最大定时 器数;  The above TICK queue is an array whose array length is MAX_TMCB_NUM, where MAX_TMCB_NUM is the maximum number of timers allowed by the above relative timer management module;
上述每一个短时长的相对定时器队列中的相对定时器的定时时长小 于或等于 MAX_TMCB—NUM个 TICK, 其中 TICK为一个单位时间; 及 上述每一个短时长的相对定时器队列中的相对定时器在同一时刻到 时。  The timing duration of the relative timer in each of the short-term relative timer queues is less than or equal to MAX_TMCB_NUM TICK, where TICK is one unit time; and the relative timer in each of the short-term relative timer queues described above At the same time.
3、 根据权利要求 2所述的管理系统, 其特征在于 上述长时长的相对定时器队列为一个数组, 其数组长度为3. A management system according to claim 2, characterized in that The above long-term relative timer queue is an array whose array length is
MAX_TMCB_NUM, 其中 MAX—TMCB一 NUM为上述相对定时器管理模 块所允许设置的最大定时器数; MAX_TMCB_NUM, where MAX_TMCB_NUM is the maximum number of timers allowed for the relative timer management module described above;
上述长时长的相对定时器队列中的相对定时器的定时时长大于 MAX_TMCB_NUM个 TICK, 其中 TICK为一个单位时间。  The relative duration of the relative timers in the long-term relative timer queue is greater than MAX_TMCB_NUM TICK, where TICK is one unit time.
4、 一种软件系统中定时器的管理方法, 适用于应用任务 /进程设置的 定时器, 其特征在于至少包括以下步骤:  4. A method for managing a timer in a software system, which is applicable to a timer set by an application task/process, and is characterized by at least the following steps:
步骤 1 : 管理系统将上述应用任务 /进程设置的定时器分为绝对定时器 和相对定时器;  Step 1: The management system divides the timer set by the above application task/process into an absolute timer and a relative timer;
步骤 2: 上述管理系统判断上述待管理的定时器为绝对定时器还是相 对定时器, 若为绝对定时器, 则执行步骤 3 ; 若为相对定时器, 则执行步 骤 4;  Step 2: The management system determines whether the timer to be managed is an absolute timer or a relative timer, if it is an absolute timer, step 3 is performed; if it is a relative timer, step 4 is performed;
步骤 3 : 绝对定时器管理模块将上述绝对定时器组成一个绝对定时器 队列, 且该绝对定时器队列对上述绝对定时器进行管理;  Step 3: The absolute timer management module forms the above absolute timer into an absolute timer queue, and the absolute timer queue manages the above absolute timer.
步骤 4 : 上述管理系统判断上述相对定时器的定时时长是否大于 MAX—TMCB_NUM个 TIC :, 若否, 则执行步骤 5; 否则, 执行步骤 6; 步骤 5: 相对定时器管理模块将在同一时刻到时的、 定时时长小于或 等于 MAX—TMCB— NUM个 TICK的相对定时器组成一个短时长的相对定 时器队列,上述相对定时器管理模块将该短时长的相对定时器队列下挂至 TICK队列中的一个元素下, 且该 TICK队列对上述定时时长小于或等于 MAX— TMCB— NUM个 TICK的相对定时器进行管理; 其中上述 TICK队 列的数组长度为 MAX—TMCB— NUM, 且 MAX—TMCB一 NUM为上述相对 定时器管理模块所允许设置的最大定时器数; Step 4: The management system determines whether the timing duration of the relative timer is greater than MAX_TMCB_NUM TIC:, if not, execute step 5; otherwise, perform step 6; Step 5: The relative timer management module will arrive at the same time The relative timers whose timing duration is less than or equal to MAX_TMCB_NUM TICKs constitute a short-term relative timer queue, and the relative timer management module hangs the short-term relative timer queue to the TICK queue. Under one element, the TICK queue manages the relative timers whose timing duration is less than or equal to MAX_TMCB-NUM TICKs; wherein the array length of the TICK queue is MAX-TMCB-NUM, and MAX-TMCB-NUM For the above relative The maximum number of timers allowed by the timer management module;
步骤 6:上述相对定时器管理模块将定时时长大于 MAX_TMCB— UM 个 TICK的相对定时器组成一个长时长的相对定时器队列, 且该长时长的 相对定时器队列对上述定时时长大于 MAX_TMCB_NUM个 TICK的相对 定时器进行管理; 其中上述长时长的相对定时器队列的数组长度为 MAX_TMCB_NUM, 且 MAX— TMCB— NUM为上述相对定时器管理模块 所允许设置的最大定时器数;上述长时长的相对定时器队列中的每一个元 素表示具有相同索引号的 TMCB是否被设置。  Step 6: The relative timer management module forms a relative timer queue whose timing duration is greater than MAX_TMCB_UM TICKs, and the relative timer queue of the long duration is longer than the MAX_TMCB_NUM TICK. The relative timer is managed; wherein the length of the long-term relative timer queue is MAX_TMCB_NUM, and MAX_TMCB_NUM is the maximum number of timers allowed by the relative timer management module; the relative duration of the long duration Each element in the queue indicates whether a TMCB with the same index number is set.
5、 根据权利要求 4所述的管理方法, 其特征在于上述步骤 3包括以 下步骤:  5. The management method according to claim 4, wherein the step 3 comprises the following steps:
步骤 301 : 上述绝对定时器管 模块将上述绝对定时器按照设定时刻 的长短组成上述绝对定时器队列, 即将最早到时的绝对定时器排在上述绝 对定时器队列的首部,将最晚到时的绝对定时器排在上述绝对定时器队列 的尾部;  Step 301: The absolute timer tube module forms the absolute timer according to the length of the set time to form the absolute timer queue, and the absolute timer of the earliest arrival time is arranged in the first part of the absolute timer queue, and the latest arrival time The absolute timer is listed at the end of the above absolute timer queue;
步骤 302: 定时器扫描任务在一个扫描周期内扫描排在上述绝对定时 器队列首部的绝对定时器;  Step 302: The timer scan task scans an absolute timer ranked in the header of the absolute timer queue in one scan period;
步骤 303 : 上述定时器扫描任务判断上述排在上述绝对定时器队列首 部的绝对定时器是否到时, 若否, 则上述定时器扫描任务在下一个扫描周 期内继续扫描该绝对定时器; 若则, 执行步骤 304;  Step 303: The timer scanning task determines whether the absolute timer listed in the header of the absolute timer queue is up, if not, the timer scanning task continues to scan the absolute timer in the next scanning period; if Perform step 304;
, 步骤 304: 上述定时器扫描任务将上述绝对定时器从上述绝对定时器 队列首部移除, 并向设置该绝对定时器的任务发送超时消息; 之后执行步 骤 305; 步骤 305: 上述定时器扫描任务在下一个扫描周期内扫描此时排在上 述绝对定时器队列首部的绝对定时器; Step 304: The timer scanning task removes the absolute timer from the absolute timer queue header, and sends a timeout message to the task that sets the absolute timer; then step 305 is performed; Step 305: The timer scanning task scans an absolute timer that is ranked at the head of the absolute timer queue in the next scanning period.
步骤 306: 重复执行步骤 303〜步骤 305,直至排在上述绝对定时器队 列首部的绝对定时器没有到时或上述绝对定时器队列为空。  Step 306: Repeat steps 303 to 305 until the absolute timer of the first timer queue is not reached or the absolute timer queue is empty.
6、 根据权利要求 4所述的管理方法, 其特征在于在上述步骤 5中组 成上述短时长的相对定时器队列包括以下步骤:  The management method according to claim 4, wherein the forming the relative timer queue of the short duration in the above step 5 comprises the following steps:
步骤 501 : 上述相对定时器管理模块设定一个系统游标, 其中该系统 游标表示当前的系统时刻, 其取值范围为 0〜(MAX— TMCB—NUM— 1); 步骤 502: 上述相对定时器管理模块将每一个上述定时时长小于或等 于 MAX—TMCB— NUM个 TICK的相对定时器的定时时长转换为相对于上 述系统游标的以 TICK为单位的偏移;  Step 501: The relative timer management module sets a system cursor, where the system cursor represents a current system time, and the value ranges from 0 to (MAX - TMCB - NUM - 1); Step 502: The above relative timer management The module converts each of the above-mentioned timing durations of the relative timers whose timing duration is less than or equal to MAX_TMCB-NUM TICKs into an offset of TICK with respect to the above system cursors;
步骤 503: 上述相对定时器管理模块将与上述系统游标具有相同偏移 位置的所有上述相对定时器组成一个短时长的相对定时器队列,并将其下 挂至上述 TICK队列中的一个元素下。  Step 503: The relative timer management module forms a short-term relative timer queue of all the relative timers having the same offset position as the system cursor, and hangs it down to an element in the TICK queue.
7、 根据权利要求 6所述的管理方法, 其特征在于在上述步骤 5中对 上述长时长的相对定时器队列中的其中一个定时时长小于或等于 MAX_TMCB_NUM个 TICK的相对定时器进行管理包括以下步骤:  7. The management method according to claim 6, wherein managing the relative timer of one of the long-term relative timer queues having a timing duration less than or equal to MAX_TMCB_NUM TICKs in the step 5 includes the following steps. :
步骤 504: 定时器扫描任务在一个扫描周期内扫描上述相对定时器, 且上述系统游标增加 1 ;  Step 504: The timer scan task scans the relative timer in one scan period, and the system cursor is increased by 1;
步骤 505: 上述定时器扫描任务判断上述系统游标是否与上述相对定 时器重合, 若否, 则上述定时器扫描任务在下一个扫描周期内继续扫描该 相对定时器, 且上述系统游标增加 1 ; 否则, 执行步骤 506; 步骤 506: 上述定时器扫描任务将上述相对定时器所在的短时长的相 对定时器队列从上述 TICK队列中移除, 并向设置该相对定时器的任务发 送超时消息。 Step 505: The timer scan task determines whether the system cursor overlaps with the relative timer. If not, the timer scan task continues to scan the relative timer in the next scan period, and the system cursor increases by 1; otherwise, Go to step 506; Step 506: The timer scanning task removes the short timer duration relative timer queue in which the relative timer is located from the TICK queue, and sends a timeout message to the task that sets the relative timer.
8、 根据权利要求 7所述的管理方法, 其特征在于  8. The management method according to claim 7, characterized in that
在上述步骤 503中, 无论上述短时长的相对定时器队列中的所有相对 定时器是否在同一时刻设置,上述 fe时长的相对定时器队列中的所有相对 定时器在同一时刻到时;  In the foregoing step 503, regardless of whether all the relative timers in the relative timer queue of the short duration are set at the same time, all the relative timers in the relative timer queue of the fe duration are at the same time;
将任何一个定时时长小于或等于 MAXJTMCB— NUM个 TICK的相对 定时器放入上述 TICK队列中的位置的计算方法为:位置 = (系统游标当前 位置值 +相对定时器的定时时长的 TICK数) mod (MAX— TMCB一 NUM)。  The calculation method for placing any relative timer whose timing duration is less than or equal to MAXJTMCB-NUM TICK into the above TICK queue is: position = (the current position value of the system cursor + the number of TICKs relative to the timer duration) mod (MAX - TMCB - NUM).
9、 根据权利要求 4所述的管理方法, 其特征在于对于上述其中一个 定时时长大于 MAX— TMCB—NUM个 TICK的相对定时器, 上述步骤 6包 括以下步骤: '  The management method according to claim 4, characterized in that, for the relative timer in which one of the timing durations is greater than MAX_TMCB-NUM TICKs, the above step 6 includes the following steps:
步骤 601 : 上述相对定时器管理模块设定一个系统游标; 其中该系统 游标表示当前的系统时刻, 其取值范围为 0〜(MAX— TMCB— UM— 1); 步骤 602: 上述相对定时器管理模块给上述相对定时器一个补偿值, 则该相对定时器的最终定时时长为上述补偿值与需要设置的相对定时器 的定时时长的 TICK数之和, 即相对定时器的最终定时时长=补偿值 +需 要设置的相对定时器的定时时长的 TICK数;  Step 601: The foregoing relative timer management module sets a system cursor; wherein the system cursor represents a current system time, and the value ranges from 0 to (MAX - TMCB - UM - 1); Step 602: The foregoing relative timer management The 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 relative timer of the relative timer to be set, that is, the final timing duration of the relative timer = the compensation value. + the number of TICKs of the relative duration of the relative timer that needs to be set;
步骤 603 : 定时器扫描任务在一个扫描周期内扫描上述相对定时器, 且上述系统游标增加 1 ;  Step 603: The timer scan task scans the relative timer in one scan period, and the system cursor is increased by 1;
步骤 604: 上述定时器扫描任务将上述系统游标所到位置上的对应的 相对定时器的最终定时时长减去 MAX—TMCB— NUM个 TICK的时长; 步骤 605: 上述相对定时器管理模块判断上述步骤 604中的相对定时 器减后的定时时长是否小于或等于. MAX_TMCB_NUM个 TICK, 若是, 则执行步骤 606; 否则, 执行步骤 607; Step 604: The above timer scanning task corresponds to the location of the system cursor Comparing the final timing of the timer with the duration of the MAX-TMCB-NUM TICK; Step 605: The relative timer management module determines whether the timing duration of the relative timer subtraction in the above step 604 is less than or equal to. MAX_TMCB_NUM TICK If yes, go to step 606; otherwise, go to step 607;
步骤 606: 上述相对定时器管理模块将上述步骤 604中的相对定时器 从上述长时长的相对定时器队列中取出, 之后将其放入上述 TICK队列中 的下挂在其中一个元素下的短时长的相对定时器队列的尾部;  Step 606: The relative timer management module removes the relative timer in the foregoing step 604 from the long-term relative timer queue, and then puts it into the TICK queue for a short duration under one of the elements. The tail of the relative timer queue;
步骤 607: 重复执行步骤 603〜步骤 605。  Step 607: Repeat steps 603 to 605.
10、根据权利要求 9所述的管理方法,其特征在于在上述步骤 602中, 上述相对定时器管理模块计算上述补偿值的方法为:  The management method according to claim 9, wherein in the step 602, the method for calculating the compensation value by the relative timer management module is:
步骤 611 : 上述相对定时器管理模块判断上述相对定时器使用的 TMCB的索引号是否大于上述系统游标当前的位置值, 若是, 则执行步骤 612; 否则, 执行步骤 613 ;  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, and if yes, step 612 is performed; otherwise, step 613 is performed;
步骤 612: 补偿值 -MAX— TMCB—NUM— (相对定时器使用的 TMCB 的索引号一系统游标当前的位置值);  Step 612: Compensation value -MAX_TMCB_NUM- (relative to the TMCB index number used by the timer, the current position value of the system cursor);
步骤 613 : 补偿值 =系统游标当前的位置值一相对定时器使用的 TMCB的索引号。  Step 613: Compensation value = The current position value of the system cursor is relative to the index number of the TMCB used by the timer.
PCT/CN2005/002425 2005-12-31 2005-12-31 A management system and management method of the timer in the software system WO2007076636A1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN2005800525051A CN101361320B (en) 2005-12-31 2005-12-31 Timer management system in software system and management method
PCT/CN2005/002425 WO2007076636A1 (en) 2005-12-31 2005-12-31 A management system and management method of the timer in the software system
HK09105599.5A HK1126907A1 (en) 2005-12-31 2009-06-22 A management system and management method of the timer in the software system

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 (1)

Publication Number Publication Date
WO2007076636A1 true WO2007076636A1 (en) 2007-07-12

Family

ID=38227893

Family Applications (1)

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

Country Status (3)

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

Cited By (3)

* 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
CN104268015A (en) * 2014-09-05 2015-01-07 烽火通信科技股份有限公司 Implementation method of high-availability timer of embedded equipment and timer
CN110908429A (en) * 2018-09-18 2020-03-24 阿里巴巴集团控股有限公司 Timer operation method and device

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN115525402A (en) * 2021-06-25 2022-12-27 中兴通讯股份有限公司 Timer task processing method, software timer and storage medium

Citations (2)

* 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
CN1713630A (en) * 2004-06-25 2005-12-28 华为技术有限公司 Method for triggering related timer

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1275423C (en) * 2002-02-28 2006-09-13 中兴通讯股份有限公司 Timing method of timer in embedded real-time operation system

Patent Citations (2)

* 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
CN1713630A (en) * 2004-06-25 2005-12-28 华为技术有限公司 Method for triggering related timer

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HE X. AND YIN F.: "THE TIMER'S QUEUE MANAGEMENT MODEL IN COMMUNICATION FIELD", JOURNAL OF SOUTHWEST UNIVERSITY OF NATIONALITIES NATURAL SCIENCE EDITION, vol. 31, no. 4, July 2005 (2005-07-01) *

Cited By (4)

* 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
CN104268015A (en) * 2014-09-05 2015-01-07 烽火通信科技股份有限公司 Implementation method of high-availability timer of embedded equipment and timer
CN110908429A (en) * 2018-09-18 2020-03-24 阿里巴巴集团控股有限公司 Timer operation method and device
CN110908429B (en) * 2018-09-18 2023-12-05 阿里巴巴集团控股有限公司 Timer operation method and device

Also Published As

Publication number Publication date
CN101361320B (en) 2011-11-09
HK1126907A1 (en) 2009-09-11
CN101361320A (en) 2009-02-04

Similar Documents

Publication Publication Date Title
TW563308B (en) A system and method of repetitive transmission of frames for frame-based communications
WO2007076636A1 (en) A management system and management method of the timer in the software system
TWI355180B (en) Arbitration circuit and method thereof and wireles
TWI327039B (en) A method for forming a device power savings class, a mobile station for wirelee communication and wireless communication
EP2135429A2 (en) Data transmission scheduler
WO2018149263A1 (en) Method and apparatus for instantiating network service
US9699100B2 (en) Lossless time based data acquisition and control in a distributed system
WO2009129740A1 (en) A buffer status report transmitting method and the device thereof
CN106559737B (en) Bluetooth operating mode switching control method and device
WO2014201990A1 (en) Wake-up control method, device and terminal equipment
CN1839638A (en) Method and apparatus for facilitating data transmissions
CN104052565B (en) Time synchronization method and communication terminal
WO2012094862A1 (en) Method, apparatus and computer for task scheduling in operating system
CN108845872B (en) Method for implementing software timer for embedded system
EP3066574B1 (en) Lossless time based data acquisition and control in a distributed system
WO2011131010A1 (en) Method and apparatus for timing
JP3161369B2 (en) Network management information collection method
CN115378888B (en) Data processing method, device, equipment and storage medium
CN103455402B (en) A kind of timer control method without accumulated error
JP5174701B2 (en) Vehicle control network relay device
CN103002508A (en) Method for discovering AC (Access Controller) by AP (Access Point) and AP
Chen et al. Petri net modeling of the reconfigurable protocol stack for cloud computing control systems
CN100337228C (en) Time-out adaptive method in remote synchronous calling procedure
JPWO2006043411A1 (en) Communication device and terminal existence confirmation method
CN109644368A (en) The method and terminal device of wireless communication

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 200580052505.1

Country of ref document: CN

122 Ep: pct application non-entry in european phase

Ref document number: 05847853

Country of ref document: EP

Kind code of ref document: A1