An Execution Method of Time Difference Sequential Linked List Timer
An execution method and time difference technology, applied in the direction of instruments, multi-channel program devices, program control design, etc., can solve problems such as affecting timing accuracy, reducing system running speed, and deteriorating counter performance, saving resources and ensuring timing accuracy. Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0028] Such as figure 1 The execution method of a time difference sequence linked list timer shown includes several timing tasks with different timing durations. When processing timing tasks, follow the steps below:
[0029] (1) Arrange all timing tasks in a doubly linked list in ascending order of timing duration;
[0030] (2) Each node counts according to t n to count:
[0031] (n≥2, t 1 = T 1 ) 1)
[0032] (3) Using a single counting thread, let t 1 '=t 1 / a, will t 1 ’ As the task count value under the first node, every execution count cycle will be t 1 ’ minus 1, the original t 1 The difference after subtracting 1 from the value of ’ is t after executing 1 counting cycle 1 ’ the actual value, when t 1 When 'is 0, delete the timing task under the first node in the doubly linked list, and create a separate execution thread at the same time, execute the timing task in the first node in the execution thread, and re-repair the linked list at this time, specifical...
Embodiment 2
[0045] The difference from Example 1 is that now there are 4 timing tasks respectively c1, c2, c3 and c4, c1 needs to run after 1s, c2 needs to run after 2s, c3 needs to run after 3s, and c4 needs to run after Run after 2s, set the counting period to 1s, the timing duration of c2 and c4 is the same, so c2 and c4 are under the same node in the linked list, the absolute count and relative count of c1 are respectively: T1=1, t1=1, c2 The absolute count and relative count of c4 and c4 are respectively T2=2, t2=2-1=1, the absolute count and relative count of c3 are respectively: T3=3, t3=3-2=1, and the total count in the linked list is t1+t2+t3=3; after 1s, the absolute count and task count in c1 are respectively: T1=1, t1'=1 / 1-1=0, at this time, c1 needs to be moved from the first in the linked list Delete the node and put it into the newly created execution thread to execute, trim the linked list, the trimmed linked list is: T1=2, t1=1, T2=3, t2=1, the total count in the linked l...
Embodiment 3
[0047] The difference from Examples 1 and 2 is that now there are 5 scheduled tasks, namely d1, d2, d3, d4 and d5, d1 needs to run after 1s, d2 needs to run after 2s, and d3 needs to run after 5s , d4 needs to run after 6s, d5 needs to run after 7s, set the counting period to 1s, the absolute count and relative count of d1 are respectively T1=1, t1=1-0=1; the absolute count and relative count of d2 T2=2, t2=T2-t1=2-1=1, the absolute and relative counts of d3 are T3=5, t3=T3-(t1+t2)=5-(1+1)=3 , the absolute and relative counts of d4 are T4=6, t4=T4-(t1+t2+t3)=1, and the absolute and relative counts of d5 are T5=7, t5=T5-(t1+t2+ t3+t4)=1, the total count of the linked list is t1+t2+t3+t4+t5=7; after 1s, the absolute count and task count in d1 are T1=1, t1'=1 / 1- 1=0, at this time, it is necessary to delete d1 from the first node in the linked list and put it into the newly created execution thread for execution, trim the linked list, and the trimmed linked list is: T1=2, t1=1, T...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com