Timer processing method and device

A processing method and timer technology, applied in the field of data processing, can solve problems such as large system overhead, and achieve the effects of solving relatively large system overhead, reducing the number of executions, and reducing system overhead

Active Publication Date: 2017-03-08
ALIBABA GRP HLDG LTD
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0008] Aiming at the problem that the system overhead of the timer processing method in the prior art is relatively large, the main purpose of this application is to provide a timer processing method and device to solve the above problems

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 processing method and device
  • Timer processing method and device
  • Timer processing method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0032] figure 1 is a flowchart of a timer processing method according to an embodiment of the present application. like figure 1 As shown, the processing method of the timer includes:

[0033] Step S102, dividing the triggering time of the timer event into multiple time periods, wherein each time period corresponds to a hash value.

[0034] Preferably, when the trigger time of the timer event is converted into a hash value, it can also be converted according to the accuracy requirement. If the timer accuracy requirement is 1 second, the trigger time of the timer event adopts 32-bit binary data; if the timer accuracy is required to be 0.001 second, the trigger time of the timer event is represented by 64-bit binary data.

[0035] Step S104, inserting the timer events whose trigger time is in the same time period into the same linked list.

[0036] Preferably, the timer events belonging to the same hash value are inserted into the same linked list according to the time seque...

Embodiment 2

[0042] It should be noted that, the timer processing method in this embodiment may not only include a processing method for existing timer events, but may also include a processing method for newly added timer events. figure 2 That is, it is a flowchart of a method for processing a timer for a new timer event according to an embodiment of the present application.

[0043] Assuming that multiple timer events are newly added, here only the first timer event is added as an example for description, where the first timer event may be any timer event among the multiple newly added timer events. Specifically include the following steps:

[0044] Step S202, converting the triggering time of the first timer event into a first hash value.

[0045] Step S204, searching for a linked list corresponding to the first hash value.

[0046] Step S206, judging whether the linked list corresponding to the first hash value can be found, if the judging result is yes, go to step S210, otherwise g...

Embodiment 3

[0056] Based on the hash table obtained in Embodiment 1 or 2 above, each timer event in the linked list can be executed through scheduling. This embodiment provides a preferred way of scheduling timer events.

[0057] The scheduling process of the embodiment of the present application is described below, and the scheduling process includes the following steps:

[0058] Step S1, after mapping the timer events in each of the linked lists to the hash table, obtaining the current hash value corresponding to the current time period;

[0059] Step S2, looking up the identifier of the linked list corresponding to the current hash value in the hash table;

[0060] Step S3, execute the timer event in the linked list indicated by the identified identifier of the linked list.

[0061] For how to execute the timer event in the linked list indicated by the identified linked list, the present application provides several preferred implementation modes, which specifically include the follo...

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 discloses a processing method and a processing device of a timer. The processing method of the timer includes: dividing trigger time of timer events into a plurality of time periods, wherein each time period corresponds to a hash value; inserting timer events with the trigger time at an identical time period into an identical chain table; and mapping the timer events of various chain tables into a hash table, wherein each timer event correspondingly stores a hash value and identification of the chain table where the timer event is located into the hash table. The processing method and the processing device of the timer solve the problem that a timer in the prior art is relatively large in system overhead due to the processing mode, and achieve the technical effect that the system overhead of processing a timer event is reduced.

Description

technical field [0001] The present application relates to the field of data processing, and in particular, to a timer processing method and device. Background technique [0002] With the development of Internet technology, mass element timers are getting more and more applications. Here, first describe several basic concepts about massive element timers: 1) A timer refers to the specific implementation of hardware or software that triggers a preset event at a specified time point or within a specified time range; An event refers to a data structure entity that needs to do something at a certain point in time or within a time range; a mass element refers to a large number of events that need to be triggered, such as a level of more than one million; a mass element timer refers to, The specific realization of the hardware or software that triggers the preset massive elements at a specified time point or within a specified time range. [0003] In the prior art, from the botto...

Claims

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

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F17/30
Inventor 王冠
Owner ALIBABA GRP HLDG 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