CN111562809B - 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
CN111562809B
CN111562809B CN202010294794.2A CN202010294794A CN111562809B CN 111562809 B CN111562809 B CN 111562809B CN 202010294794 A CN202010294794 A CN 202010294794A CN 111562809 B CN111562809 B CN 111562809B
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.)
Active
Application number
CN202010294794.2A
Other languages
Chinese (zh)
Other versions
CN111562809A (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 multi-mode clock mechanism for improving the clock precision of Linux, processing and counting interrupt data of the four-level driving core, a Linux clock mechanism 1 and an improved Linux clock mechanism 1.1, wherein the Linux system error is reduced by determining the type number of a clock and a timer, and the kernel manages the running time of a system and the wall time. 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 multi-mode clock mechanism is adopted to improve the clock precision of Linux and process and count interrupt data of a four-stage drive core, the Linux clock mechanism 1 and the improved Linux clock mechanism 1.1 help to reduce the errors of a Linux system by determining the type number of a clock and a timer, and a kernel manages the running time of the system and the wall time;
s2, a large number of tasks in the kernel are based on four-level driving and time driving, wherein some tasks are periodically executed, the running queue in a scheduler is balanced and adjusted 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 management of the updated time and the tasks;
and S3, when the clock is interrupted every time, updating the jiffies during processing, maintaining a timer-list of the system timer, and processing the overtime timer, wherein 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 clock interruption hour-hour interruption service program.
S4, the system hour frequency of the Linux kernel is 1000Hz, namely the triggering period of clock interrupt is 1ms, the interrupt service program is executed every 1ms at the fastest speed, the dynamic timer is overtime at any time, but the overtime dynamic timer can be executed only by checking when the interrupt service processor program is executed, so that the average error of the dynamic timer is half of the system clock period.
S5, changing the clock interrupt fixed mode of the Linux into a single-trigger state, then providing the timing precision which is up to the clock frequency of a CPU by utilizing the TSC, transforming the Linux inside 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, interrupt processing in a standard mode, firstly, determining whether a real-time timer queue has a working mode of a machine core 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 have the next interrupt processing, and firstly judging whether a jiffies clock is due.
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 time of the earliest overtime real-time timer and the current event;
m3, detecting in a high-frequency periodic mode;
m4, stable control of the timer.
Preferably, in M3, the detecting in the high-frequency periodic mode specifically includes the steps of, in the high-frequency periodic mode, interrupting the processing to determine in advance whether the jfets clock expires, and if not, executing M1 and M2, if the real-time timer expires, marking the lower part of the interrupt, and if not, directly returning.
Preferably, in M4, the stable control of the timer specifically includes that an original coarse-grained timer of a common Linux system is suitable for the stability of the kernel and the non-real-time application that does not require high-speed timing, a high-precision timer queue is organized for the high-precision timing requirement application, the timers in the queue are arranged according to the non-descending order of the timeout time, and the timeout time of the 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 off before the slicing operation is started.
Preferably, in the step S3, after the lower half of the system clock interrupt processing in the core each time finishes processing the overtime real-time timer, 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 drive has the advantages that timely adjustment of clock errors can be achieved rapidly, 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.
Examples
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 1.1Linux clock mechanism help to reduce errors of a Linux system by determining the type of a clock and a timer, and a kernel needs 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 driving and time driving, wherein some tasks are periodically executed, the running queue in a scheduler is balanced and adjusted 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 management of the updated time and the tasks;
and S3, when the clock is interrupted every time, updating the jiffies during processing, maintaining a system timer linked list timer-list, and processing an overtime timer, wherein the dynamic timer is opposite to the system timer, the setting of the dynamic timer is suitable for a mechanism for scheduling the occurrence of a certain moment, the overtime high-precision timer before the clock interruption of the core system is removed from an original queue and inserted into the HRT-list queue after the overtime real-time timer is processed by the lower half part of the system clock interruption processing in the core each time depending on the clock interruption at the lower half part of the hour interrupt service program during the step S3, the integrity of data is ensured, and meanwhile, the stability of the system in the core is effectively improved.
S4, the system hour clock frequency of the Linux kernel is 1000Hz, namely the triggering period of clock interruption is 1ms, the interrupt service program is executed once every 1ms at the fastest speed, the dynamic timer is overtime at any time, but the overtime dynamic timer can be executed only by checking when the interrupt service processor program is executed, so that the average error of the dynamic timer is half of the system clock period;
and S5, changing the clock interrupt fixed mode of the Linux into a single-trigger state, then providing the timing precision which is up to the clock frequency of the CPU by utilizing the TSC, transforming the Linux in the core, and directly modifying the original Linux kernel data structure to meet the implementation requirement.
Examples
This example differs from example 1 in that;
the processing of the jiffies specifically comprises the following steps:
m1, interrupt processing in a standard mode, firstly determining whether a real-time timer queue has a working mode of a machine core 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 have the next interrupt 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 time 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, executing M1 and M2 if the jiffies clock does not expire, marking the part of the interrupt when the real-time timer expires, and directly returning if the real-time timer does not expire;
m4, stable control of the timer, specifically include that the original coarse-grained timer of the ordinary Linux system is suitable for the stability of the kernel and the non-real-time application that does not require high-speed timing, a high-precision timer queue is organized aiming at the high-precision timing requirement, the timers in the queue are arranged according to the non-descending order of the overtime time, the overtime time of the first timer in the queue is the earliest overtime time of the queue, and the timer of the original Linux kernel enables the time of the insertion and deletion operations of the timers to be arranged orderly through the structural management and maintenance of the core.
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 multi-mode clock mechanism is adopted to improve the clock precision of Linux and process and count interrupt data of a four-stage drive core, the Linux clock mechanism 1 and the improved Linux clock mechanism 1.1 help to reduce the errors of a Linux system by determining the type number of a clock and a timer, and a kernel manages the running time of the system and the wall time;
s2, a large number of tasks in the kernel are based on four-level driving and time driving, wherein some tasks are periodically executed, the running queue in a scheduler is balanced and adjusted 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 management of the updated time and the tasks;
s3, when the clock is interrupted every time, updating the jiffies during processing, maintaining a system timer linked list timer-list, and processing an overtime timer, wherein the system timer is a dynamic 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 the Linux kernel is 1000Hz, namely the triggering period of clock interruption is 1ms, the interrupt service program is executed once every 1ms at the fastest speed, the dynamic timer is overtime at any time, but the overtime dynamic timer can be executed only by checking when the interrupt service processor program is executed, so that the average error of the dynamic timer is half of the system clock period;
and S5, changing the clock interrupt fixed mode of the Linux into a single-trigger state, then providing the timing precision which is up to the clock frequency of the CPU by utilizing the TSC, transforming the 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, interrupt processing in a standard mode, firstly determining whether a real-time timer queue has a working mode of a machine core 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 have the next interrupt 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 time of the earliest overtime real-time timer and the current event;
m3, detecting in a high-frequency periodic mode;
m4, stable control of the timer.
3. The method for controlling the stability of a movement applied to a four-stage drive according to claim 2, wherein in M3, the detection in the high-frequency periodic mode specifically includes the steps of interrupting the process in the high-frequency periodic mode to judge whether the jiffies clock expires in advance, if the jiffies clock does not expire, executing M1 and M2, if the real-time timer expires, marking the lower part of the interrupt, and if the jiffies clock does not expire, directly returning.
4. The method for controlling the stability of the movement applied to the four-level drive according to claim 2, wherein in M4, the stable control of the 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-precision timing requirement application, the 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 as claimed in claim 4, wherein the timer of the original Linux kernel is managed and maintained through the structure of the movement, so that the time of the insertion and deletion operations of the timer is arranged in order.
6. The method for controlling the stability of a movement applied to a four-stage drive as claimed in claim 1, wherein in the step S3, after the lower half part of the system clock interrupt processing in 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 CN111562809A (en) 2020-08-21
CN111562809B true 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
CN111562809A (en) 2020-08-21

Similar Documents

Publication Publication Date Title
EP2904494B1 (en) Method for preemptively restarting software in a multisubsystem mobile communication device to increase mean time between failures
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
JP2010191937A (en) Computer device and method for sampling power consumption
CN111562809B (en) Movement stability control method applied to four-stage driving
CN102929735A (en) Clock-correcting method and equipment
CN111813552A (en) Scheduling execution method, device and medium based on multi-thread task
WO2009000122A1 (en) Device and method for measuring the utilization ratio of a processor
CN113038445B (en) Calibration method of Bluetooth sleep clock
CN1755614A (en) Timer realizing method
CN1202684C (en) Mobile telephone able to stop main timer
WO2019140551A1 (en) Timer implementation method and device
JP2011186739A (en) Program and apparatus for managing process
US20060208829A1 (en) System and method for timer windows
US10884785B2 (en) Precise accounting of processor time for multi-threaded time-critical applications
CN112445592A (en) Accurate scheduling method and device for high-priority tasks
EP1164483B1 (en) System and method for reducing jitter in a signal
JP2020052829A (en) Servo control device
CN113687916B (en) Data processing method and device, time updating method and device and electronic equipment
CN114840053A (en) Method for controlling redundancy of synchronous pulse and timer based on embedded software
CN116541470B (en) Synchronization method, device, equipment and medium of database read-only standby library
JPH04137142A (en) Timer control system
CN112667302B (en) Method for quickly responding to external equipment request of processor
CN114237845A (en) Method and electronic equipment for rapidly scheduling large-scale tasks with fixed frequency

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