Timer instance adding method and device

A technology for timers and adding requests, applied in program control devices, execution paradigms, etc., can solve problems such as low efficiency and long time for adding timer instances, and achieve the effect of improving adding efficiency and shortening adding time.

Pending Publication Date: 2021-07-16
SHENZHEN IPANEL TECH LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The invention provides a method and device for adding a timer instance, aiming at solving the problems of too long time and low efficiency for adding a timer instance

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Timer instance adding method and device
  • Timer instance adding method and device
  • Timer instance adding method and device

Examples

Experimental program
Comparison scheme
Effect test

example

[0115] and figure 1 Corresponding to the above method, the embodiment of the present invention also provides a device for adding a timer instance, which is used for figure 1 The specific implementation of the method in the method, its structural diagram is as follows Figure 4 As shown, the adding device of the timer instance can be applied to the timer manager, and the timer manager manages multiple timer instances through an array, the array includes a plurality of array elements, and each array element is a first timer Instance collection, the timer instance specifically includes:

[0116]The first acquiring unit 401 is configured to acquire the current system time and the current reference time of the timer manager in response to a request for adding a new timer instance;

[0117] The first calculation unit 402 is configured to calculate an offset time difference between the wake-up time and the reference time according to the wake-up time included in the adding request,...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention provides a timer instance adding method and device, and the method comprises the steps of calculating an offset time difference based on the wake-up time, the current system time and the reference time contained in an adding request, dividing the offset time difference by the number of array elements to obtain a first remainder value, and determining the current position of an array pointer; and determining a first offset according to the current position, the first remainder value and the number of the array elements; moving the array pointer according to the first offset, and adding a new timer instance into the target data element when the array pointer moves to the target array element corresponding to the first offset. Visibly, by determining the moving offset of the array pointer and moving the array pointer based on the offset, when the array pointer moves to the target array element corresponding to the offset, the new timer instance is directly added to the target array element, and the whole array does not need to be traversed, so that the adding time of the timer instance is shortened, and the adding efficiency of the timer instance is improved.

Description

technical field [0001] The invention relates to the technical field of software timing, in particular to a method and device for adding a timer instance. Background technique [0002] Applications that include timing wake-up logic, such as alarm clocks and schedule reminders, are widely used applications. In such applications, the implementation of timing wake-up timer instances is called timing. To achieve timing, you need to The timer instance is added to the timer manager. [0003] In the prior art, the timer manager manages each timer instance through a queue, and the timer instances in the queue are sorted according to the wake-up time. At the end, when a new timer instance is added to the queue in the timer manager, it is first necessary to traverse the ordered queue to determine the sort order of the wake-up time of the new timer instance in the wake-up time of each timer instance in the queue , that is, determine the adding position of the new timer instance, and t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F9/448
CPCG06F9/448
Inventor 徐佳宏李银李威青刘彬
Owner SHENZHEN IPANEL TECH LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products