CN111562809A - Movement stability control method applied to four-stage driving - Google Patents

Movement stability control method applied to four-stage driving Download PDF

Info

Publication number
CN111562809A
CN111562809A CN202010294794.2A CN202010294794A CN111562809A CN 111562809 A CN111562809 A CN 111562809A CN 202010294794 A CN202010294794 A CN 202010294794A CN 111562809 A CN111562809 A CN 111562809A
Authority
CN
China
Prior art keywords
timer
clock
time
interrupt
linux
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.)
Granted
Application number
CN202010294794.2A
Other languages
Chinese (zh)
Other versions
CN111562809B (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.)
Zhangzhou Deheng Electron Co ltd
Original Assignee
Zhangzhou Deheng Electron Co ltd
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 Zhangzhou Deheng Electron Co ltd filed Critical Zhangzhou Deheng Electron Co ltd
Priority to CN202010294794.2A priority Critical patent/CN111562809B/en
Publication of CN111562809A publication Critical patent/CN111562809A/en
Application granted granted Critical
Publication of CN111562809B publication Critical patent/CN111562809B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/14Time supervision arrangements, e.g. real time clock

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The invention relates to the technical field of clocks, and discloses a method for controlling the stability of a core applied to four-level driving, which comprises a multimode clock mechanism for improving the clock precision of Linux, processing and counting interrupt data of the core driven by four levels, a Linux clock mechanism 1 and an improved Linux clock mechanism 1.1, wherein the Linux system error is reduced by determining the type of a clock and a timer, and a kernel needs to manage the running time of a system and the time on a wall. The invention can quickly realize timely adjustment of clock errors and improve the travel accuracy of the clock.

Description

Movement stability control method applied to four-stage driving
Technical Field
The invention relates to the technical field of clocks, in particular to a movement stability control method applied to four-stage driving.
Background
A clock is a common type of timer used in life, by which people record time. To date, four generations of timers have been documented in chinese history as follows: sundial, hourglass, mechanical clock, quartz clock;
the existing clock on the market has large error, and the movement cannot realize self-query and processing on the clock error, so that the clock is seriously time-biased.
Disclosure of Invention
The invention provides a movement stability control method applied to four-stage driving, which aims to solve the defect that the precision in the prior art has large error.
The invention provides a movement stability control method applied to four-stage driving, which specifically comprises the following steps:
s1, a dynamic multimode clock mechanism is adopted to improve the clock precision of Linux, interrupt data processing and statistics are realized on a four-level driven core, the Linux clock mechanism 1 and the improved Linux clock mechanism 1.1 are used to help reduce the errors of a Linux system by determining the type number of a clock and a timer, and the kernel is used to manage the running time of the system and the wall time;
s2, a large number of tasks in the kernel are based on four-level drive and time drive, wherein some tasks are periodically executed, balance adjustment is carried out on an operation queue in a scheduler or a screen is refreshed, I/O operations which are executed after the tasks need to be pushed need to be executed after a relative time, a system clock is the combination of timer hardware and system software, in the system structure, the most common timer hardware is an Intel8254 programmable timer chip PIT, the interrupt generated by the PIT is clock interrupt, the clock interrupt is specific periodic interrupt, the service program corresponding to the interrupt completes the updating time and the management of the tasks;
s3, when the clock is interrupted each time, the jiffies is updated during processing, a system timer linked list timer-list is maintained, overtime timers are processed, the dynamic timers are opposite to the system timers, and the setting of the dynamic timers is suitable for a mechanism for scheduling the occurrence of a certain moment and depends on a clock interrupt hour-hour interrupt service program.
S4, the system hour clock frequency of Linux kernel is 1000Hz, i.e. the triggering period of clock interrupt is 1ms, the interrupt service program is executed once every 1ms at the fastest, the dynamic timer will overtime at any time, but the dynamic timer can only be checked when the interrupt service processor program is executed, the overtime dynamic timer is executed, so the average error of the dynamic timer is about half of the system clock period.
S5, changing the clock interrupt fixed mode of Linux into a single trigger state, then utilizing TSC to provide the timing precision up to the CPU clock frequency, transforming Linux in the core, and directly modifying the original Linux kernel data structure to meet the implementation requirement.
Preferably, the processing of the jiffies specifically comprises the following steps:
m1, interruption clear separation in a standard mode, firstly determining whether a real-time timer queue has a working mode of a movement when the number of the real-time timers is set, executing events related to a function maintenance system, inquiring whether the real-time timers in the real-time timer queue are in the next interruption process, and judging whether a jiffies clock is due or not.
M2, inquiring a linked list of the real-time timer, and setting the time of the next interruption generated by the movement according to the difference between the overtime of the earliest overtime real-time timer and the current event;
m3, detection in a high-frequency periodic mode;
m4, and stable control of a timer.
Preferably, the detecting in the M3 high frequency cycle mode specifically includes the steps of, in the high frequency cycle mode, interrupting the processing to determine in advance whether the jiffies clock is expired, if not, executing the M1 and M2, if the real-time timer is expired, marking the lower part of the interruption, and if not, returning directly.
Preferably, the stable control of the M4 timer specifically includes that a coarse-grained timer originally existing in a common Linux system is suitable for the stability of a kernel and any non-real-time application which does not require high-progress timing, a high-precision timer queue is organized for the high-progress timing application, timers in the queue are arranged in a non-descending order according to timeout time, and the timeout time of a first timer in the queue is the earliest timeout time of the queue.
Preferably, the timer of the original Linux kernel is used for orderly arranging the time of the insertion and deletion operations of the timer through the structural management and maintenance of the movement.
Preferably, one end of the material is cut before the slicing operation is initiated.
Preferably, in the step S3, after the processing of the overtime real-time timer is completed in the lower half of the system clock interrupt processing in the core each time, the overtime high-precision timer before the core system clock interrupt is removed from the original queue and inserted into the HRT-list queue.
The movement stability control method applied to the four-stage driving has the advantages that clock errors can be quickly adjusted in time, the travel accuracy of a clock is improved, and later maintenance cost is low.
Detailed Description
The invention is further illustrated by the following examples.
Example 1
A movement stability control method applied to four-stage driving specifically comprises the following steps:
s1, a dynamic multimode clock mechanism is adopted to improve the clock precision of Linux, interrupt data processing and statistics are realized on a four-level driven core, the Linux clock mechanism 1 and the improved Linux clock mechanism 1.1 are used to help reduce the errors of a Linux system by determining the type number of a clock and a timer, and the kernel is used to manage the running time of the system and the wall time;
s2, a large number of tasks in the kernel are based on four-level drive and time drive, wherein some tasks are periodically executed, balance adjustment is carried out on an operation queue in a scheduler or a screen is refreshed, I/O operations which are executed after the tasks need to be pushed need to be executed after a relative time, a system clock is the combination of timer hardware and system software, in the system structure, the most common timer hardware is an Intel8254 programmable timer chip PIT, the interrupt generated by the PIT is clock interrupt, the clock interrupt is specific periodic interrupt, the service program corresponding to the interrupt completes the updating time and the management of the tasks;
s3, when the clock is interrupted every time, the jiffies are updated during processing, a system timer linked list timer-list is maintained, overtime timers are processed, the dynamic timers are opposite to the system timers, the setting of the dynamic timers is suitable for a mechanism for scheduling the occurrence of a certain moment, the overtime high-precision timers before the clock interruption of the core system are removed from an original queue and inserted into an HRT-list queue after the lower half part of the system clock interruption processing in the core system finishes processing the overtime real-time timers every time depending on the lower half part of the clock interruption processing in the core system, the integrity of data is guaranteed, and meanwhile the stability of the system in the core system is effectively improved.
S4, the system hour clock frequency of Linux kernel is 1000Hz, i.e. the triggering period of clock interrupt is 1ms, the interrupt service program is executed once every 1ms at the fastest speed, the dynamic timer will overtime at any time, but the overtime dynamic timer can be executed only when the interrupt service processor program is executed, so the average error of the dynamic timer is about half of the system clock period;
s5, changing the clock interrupt fixed mode of Linux into a single trigger state, then utilizing TSC to provide the timing precision up to the CPU clock frequency, transforming Linux in the core, and directly modifying the original Linux kernel data structure to meet the implementation requirement.
In the case of the example 2, the following examples are given,
this example differs from example 1 in that;
the processing of the jiffies specifically comprises the following steps:
m1, interrupting clear separation in a standard mode, firstly determining whether a real-time timer queue has a working mode of a movement when the number of the real-time timers is set, executing events related to a function maintenance system, inquiring whether the real-time timers in the real-time timer queue are in next interruption processing, and judging whether a jiffies clock is due or not;
m2, inquiring a linked list of the real-time timer, and setting the time of the next interruption generated by the movement according to the difference between the overtime of the earliest overtime real-time timer and the current event;
m3, detection in a high-frequency periodic mode, specifically comprising the steps of interrupting processing in the high-frequency periodic mode, judging whether a jiffies clock expires in advance, if not, executing M1 and M2, if the real-time timer expires, marking the lower part of the interruption, and if not, directly returning;
m4, stable control of timer, specially include that the original coarse-grained timer of ordinary Linux system is suitable for the stability of the inner core and the non-real-time application that does not require high-progress timing, the application that requires high-progress timing organizes a high-precision timer queue, the timers in the queue are arranged according to the non-descending order of the overtime, the overtime of the first timer in the queue is the earliest overtime of the queue, the timer of the original Linux inner core is managed and maintained through the structure of the inner core, so that the time of the insertion and deletion operation of the timer is arranged orderly.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.

Claims (6)

1. A movement stability control method applied to four-stage driving is characterized by comprising the following steps:
s1, a dynamic multimode clock mechanism is adopted to improve the clock precision of Linux, interrupt data processing and statistics are realized on a four-level driven core, the Linux clock mechanism 1 and the improved Linux clock mechanism 1.1 are used to help reduce the errors of a Linux system by determining the type number of a clock and a timer, and the kernel is used to manage the running time of the system and the wall time;
s2, a large number of tasks in the kernel are based on four-level drive and time drive, wherein some tasks are periodically executed, balance adjustment is carried out on an operation queue in a scheduler or a screen is refreshed, I/O operations which are executed after the tasks need to be pushed need to be executed after a relative time, a system clock is the combination of timer hardware and system software, in the system structure, the most common timer hardware is an Intel8254 programmable timer chip PIT, the interrupt generated by the PIT is clock interrupt, the clock interrupt is specific periodic interrupt, the service program corresponding to the interrupt completes the updating time and the management of the tasks;
s3, when the clock is interrupted every time, the jiffies are updated during processing, a system timer linked list timer-list is maintained, an overtime timer is processed, the dynamic timer is opposite to the system timer, and the setting of the dynamic timer is suitable for a mechanism for scheduling the occurrence of a certain moment and depends on the lower half part of an hour-hour interrupt service program of the clock interrupt;
s4, the system hour clock frequency of Linux kernel is 1000Hz, i.e. the triggering period of clock interrupt is 1ms, the interrupt service program is executed once every 1ms at the fastest speed, the dynamic timer will overtime at any time, but the overtime dynamic timer can be executed only when the interrupt service processor program is executed, so the average error of the dynamic timer is about half of the system clock period;
s5, changing the clock interrupt fixed mode of Linux into a single trigger state, then utilizing TSC to provide the timing precision up to the CPU clock frequency, transforming Linux in the core, and directly modifying the original Linux kernel data structure to meet the implementation requirement.
2. The method for controlling the stability of a movement applied to a four-stage drive according to claim 1, wherein the processing of the jiffies specifically comprises the following steps:
m1, interrupting clear separation in a standard mode, firstly determining whether a real-time timer queue has a working mode of a movement when the number of the real-time timers is set, executing events related to a function maintenance system, inquiring whether the real-time timers in the real-time timer queue are in next interruption processing, and judging whether a jiffies clock is due or not;
m2, inquiring a linked list of the real-time timer, and setting the time of the next interruption generated by the movement according to the difference between the overtime of the earliest overtime real-time timer and the current event;
m3, detection in a high-frequency periodic mode;
m4, and stable control of a timer.
3. The method for controlling the stability of a movement applied to four-stage driving according to claim 2, wherein the detection in the M3 high-frequency periodic mode specifically includes the steps of judging whether a jiffies clock expires in advance in the interrupt processing in the high-frequency periodic mode, executing the M1 and the M2 if the jiffies clock does not expire, marking the lower part of the interrupt if the real-time timer expires, and returning directly if the real-time timer does not expire.
4. The method for controlling the stability of the movement applied to the four-level drive as claimed in claim 2, wherein the stable control of the M4 timer specifically includes that a coarse-grained timer originally existing in a common Linux system is suitable for the stability of the inner core and a non-real-time application which does not require high-progress timing, a high-precision timer queue is organized for the high-progress timing application, timers in the queue are arranged in a non-descending order of timeout time, and the timeout time of the first timer in the queue is the earliest timeout time of the queue.
5. The method for controlling the stability of a movement applied to a four-level drive according to claim 4, wherein the timer of the original Linux kernel is subjected to structural management and maintenance on the movement, so that the time of the insertion and deletion operations of the timer is orderly arranged.
6. The method for controlling the stability of a movement applied to a four-stage drive according to claim 1, wherein in the step S3, after the lower half part of the system clock interrupt processing inside the movement processes the overtime real-time timer, the overtime high-precision timer before the movement system clock interrupt is removed from the original queue and inserted into the HRT-list queue.
CN202010294794.2A 2020-04-15 2020-04-15 Movement stability control method applied to four-stage driving Active CN111562809B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010294794.2A CN111562809B (en) 2020-04-15 2020-04-15 Movement stability control method applied to four-stage driving

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010294794.2A CN111562809B (en) 2020-04-15 2020-04-15 Movement stability control method applied to four-stage driving

Publications (2)

Publication Number Publication Date
CN111562809A true CN111562809A (en) 2020-08-21
CN111562809B CN111562809B (en) 2023-03-31

Family

ID=72071724

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010294794.2A Active CN111562809B (en) 2020-04-15 2020-04-15 Movement stability control method applied to four-stage driving

Country Status (1)

Country Link
CN (1) CN111562809B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080069453A (en) * 2007-01-23 2008-07-28 엘지전자 주식회사 Method for treating external input in system using real time operating system
CN101299193A (en) * 2008-04-07 2008-11-05 谢维信 Method for enhancing computer inner core timer control precision
CN102637126A (en) * 2011-02-15 2012-08-15 无锡物联网产业研究院 Method, device and system for timing embedded system
CN102722099A (en) * 2012-06-13 2012-10-10 东莞市洲进钟表有限公司 Clock correction system with error computing function and correction method
CN104133520A (en) * 2014-07-29 2014-11-05 江苏宏云技术有限公司 High-precision calibration method of oscillators in embedded processor chip
CN108566505A (en) * 2018-05-31 2018-09-21 山东中泳体育股份有限公司 A kind of finish film machine of sports tournament auxiliary timing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080069453A (en) * 2007-01-23 2008-07-28 엘지전자 주식회사 Method for treating external input in system using real time operating system
CN101299193A (en) * 2008-04-07 2008-11-05 谢维信 Method for enhancing computer inner core timer control precision
CN102637126A (en) * 2011-02-15 2012-08-15 无锡物联网产业研究院 Method, device and system for timing embedded system
CN102722099A (en) * 2012-06-13 2012-10-10 东莞市洲进钟表有限公司 Clock correction system with error computing function and correction method
CN104133520A (en) * 2014-07-29 2014-11-05 江苏宏云技术有限公司 High-precision calibration method of oscillators in embedded processor chip
CN108566505A (en) * 2018-05-31 2018-09-21 山东中泳体育股份有限公司 A kind of finish film machine of sports tournament auxiliary timing

Also Published As

Publication number Publication date
CN111562809B (en) 2023-03-31

Similar Documents

Publication Publication Date Title
US20140007101A1 (en) Changing frequency of a virtual programmable interrupt timer in virtual machines to control virtual time
CN100592260C (en) Method for enhancing computer inner core timer control precision
US7120911B1 (en) Processor power-saving control method, storage medium, and processor power-saving control device
CN111813552B (en) Scheduling execution method, device and medium based on multi-thread task
WO2014055198A1 (en) Method for preemptively restarting software in a multisubsystem mobile communication device to increase mean time between failures
US7043729B2 (en) Reducing interrupt latency while polling
JP2010191937A (en) Computer device and method for sampling power consumption
CN111562809B (en) Movement stability control method applied to four-stage driving
WO2009000122A1 (en) Device and method for measuring the utilization ratio of a processor
CN1755614A (en) Timer realizing method
CN1202684C (en) Mobile telephone able to stop main timer
WO2019140551A1 (en) Timer implementation method and device
CN1324423C (en) Timer system and related method capable of dynamically compensating a difference of a timer
JPS63163932A (en) System monitoring system for control computer
CN114647540B (en) Embedded scheduler fault recovery method, embedded system and storage medium
CN114840053A (en) Method for controlling redundancy of synchronous pulse and timer based on embedded software
JPH04137142A (en) Timer control system
KR20150058618A (en) Method and apparatus for compensating delay in real-time embedded system
CN113687916B (en) Data processing method and device, time updating method and device and electronic equipment
JP2924154B2 (en) Time measurement method
CN114237845A (en) Method and electronic equipment for rapidly scheduling large-scale tasks with fixed frequency
US20230130826A1 (en) Real-time operating system with a cpu cycle time base
JPH1114775A (en) Method for automatically correcting display time of electronic clock
CN113779061A (en) SQL statement processing method, device, medium and electronic equipment
JPH08278828A (en) Timer correction device for computer system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant