Method and device for improving time keeping precision by using NTP auxiliary source

文档序号:1658224 发布日期:2019-12-27 浏览:27次 中文

阅读说明:本技术 一种利用ntp辅助作源提高守时精度的方法及装置 (Method and device for improving time keeping precision by using NTP auxiliary source ) 是由 赵旭阳 陈庆邦 刘晶 王绍伟 于 2019-09-20 设计创作,主要内容包括:本申请公开了一种利用NTP辅助作源提高守时精度的方法及装置,所述方法包括:利用NTP报文确定第一守时偏差值;其中,所述第一守时偏差值为实时获取的所述守时状态下时间同步装置的实际守时偏差值;基于守时偏差基准值及与预设的守时偏差波动幅度确定守时偏差波动范围;基于所述守时偏差波动范围与所述第一守时偏差值确定标志时间同步装置是否对守时精度进行调整的第一参数值、调整方向的及调整步数。应用本申请提供的一种利用NTP辅助作源提高守时精度的方法和装置可以实现时间同步装置外部时间源失效后,利用NTP辅助作源确定时间同步装置守时精度调整的参数,有助于减缓时间同步装置长时间守时精度的漂移。(The application discloses a method and a device for improving time keeping precision by using an NTP auxiliary source, wherein the method comprises the following steps: determining a first time keeping deviation value by using an NTP message; the first time keeping deviation value is an actual time keeping deviation value of the time synchronization device in the time keeping state acquired in real time; determining a punctuality deviation fluctuation range based on the punctuality deviation reference value and a preset punctuality deviation fluctuation range; and determining a first parameter value, an adjustment direction and an adjustment step number for determining whether the mark time synchronization device adjusts the time keeping precision or not based on the time keeping deviation fluctuation range and the first time keeping deviation value. By applying the method and the device for improving the time keeping precision by using the NTP auxiliary source, the time keeping precision adjustment parameters of the time synchronization device can be determined by using the NTP auxiliary source after the external time source of the time synchronization device fails, and the drift of the long-time keeping precision of the time synchronization device is favorably slowed down.)

1. A method for improving time keeping accuracy using an NTP auxiliary source, the method comprising:

determining a first time keeping deviation value by using an NTP message; the first time keeping deviation value is an actual time keeping deviation value of the time synchronization device in the time keeping state acquired in real time;

determining a punctuality deviation fluctuation range based on the punctuality deviation reference value and a preset punctuality deviation fluctuation range; the punctuality deviation reference value is a reference for punctuality deviation adjustment;

and determining a first parameter value, an adjustment direction and an adjustment step number for indicating whether the time synchronization device adjusts the time keeping precision or not based on the time keeping deviation fluctuation range and the first time keeping deviation value.

2. The method of claim 1, wherein determining the first time keeping offset value using the NTP message comprises:

acquiring an initial value of a time-keeping deviation by utilizing a timestamp for recording data packet receiving and sending in an NTP message, wherein the initial value is acquired when the external time source is effective and the time synchronization device is in a locking state;

acquiring a measured value of time-keeping deviation in real time, wherein the measured value is acquired when the time synchronization device is in the time-keeping state;

determining a difference between the measured value and the initial value as the first punctual deviation.

3. The method of claim 1, wherein determining the first parameter value that marks whether the time synchronization device adjusts the time keeping accuracy based on the time keeping deviation fluctuation range and the first time keeping deviation value comprises:

determining the maximum value and the minimum value of the punctual deviation fluctuation based on the punctual deviation reference value and the punctual deviation fluctuation amplitude; and comparing the first punctuality deviation with the maximum value and the minimum value every unit time;

and when the times that the first punctuality deviation is continuously greater than the maximum value exceed the preset times or the times that the first punctuality deviation is continuously less than the minimum value exceed the preset times, determining the first parameter value as a value for marking the adjustment of the punctuality accuracy.

4. The method of claim 1, wherein determining the adjustment direction comprises:

when the number of times that the first punctual deviation is continuously greater than the maximum value exceeds a preset number of times, determining that the adjustment direction is downward;

and when the number of times that the first punctual deviation is continuously smaller than the minimum value exceeds the preset number of times, determining that the adjustment direction is upward.

5. The method of claim 3, wherein determining the time-keeping deviation reference value comprises:

when the first punctuality deviation value is positive and is greater than the preset punctuality deviation intermediate value, determining that the punctuality deviation reference value is a first punctuality deviation reference value;

when the first punctuality deviation value is negative and the absolute value is greater than the preset punctuality deviation intermediate value, determining that the punctuality deviation reference value is a second punctuality deviation reference value;

the absolute values of the first timekeeping deviation reference value and the second timekeeping deviation reference value are equal to the preset timekeeping deviation intermediate value, the first timekeeping deviation reference value is positive, and the second timekeeping deviation reference value is negative.

6. The method of claim 1, wherein said determining that the first parameter value is a value that marks an adjustment to the time-keeping accuracy comprises:

determining a difference between the first punctual deviation value and the punctual deviation reference value;

and determining the adjustment step number based on the difference and a preset adjustment step length.

7. An apparatus for improving time keeping accuracy using an NTP auxiliary source, the apparatus comprising:

a determine difference module: the method comprises the steps of determining a first time keeping deviation value by using an NTP message; the first time keeping deviation value is an actual time keeping deviation value of the time synchronization device in the time keeping state acquired in real time;

a determine range module: the device is used for determining the punctual deviation fluctuation range based on the punctual deviation reference value and the preset punctual deviation fluctuation range; the punctuality deviation reference value is a reference for punctuality deviation adjustment;

a parameter determination module: and determining a first parameter value, an adjustment direction and an adjustment step number for determining whether the mark time synchronization device adjusts the time keeping accuracy based on the time keeping deviation fluctuation range and the first time keeping deviation value.

8. The apparatus of claim 7, wherein the determine difference module is specifically configured to:

acquiring an initial value of a time-keeping deviation by utilizing a timestamp for recording data packet receiving and sending in an NTP message, wherein the initial value is acquired when the external time source is effective and the time synchronization device is in a locking state;

acquiring a measured value of time-keeping deviation in real time, wherein the measured value is acquired when the time synchronization device is in the time-keeping state;

determining a difference between the measured value and the initial value as the first punctual deviation.

9. The apparatus of claim 7, wherein the parameter determination module is specifically configured to:

determining the maximum value and the minimum value of the punctual deviation fluctuation based on the punctual deviation reference value and the punctual deviation fluctuation amplitude; and comparing the first punctuality deviation with the maximum value and the minimum value every unit time;

and when the times that the first punctuality deviation is continuously greater than the maximum value exceed the preset times or the times that the first punctuality deviation is continuously less than the minimum value exceed the preset times, determining the first parameter value as a value for marking the adjustment of the punctuality accuracy.

10. The apparatus of claim 7, wherein the determine parameters module is further to:

when the number of times that the first punctual deviation is continuously greater than the maximum value exceeds a preset number of times, determining that the adjustment direction is downward;

and when the number of times that the first punctual deviation is continuously smaller than the minimum value exceeds the preset number of times, determining that the adjustment direction is upward.

11. The apparatus of claim 9, wherein the apparatus further comprises:

determining a reference module: the device is used for determining the punctuality deviation reference value as a first punctuality deviation reference value when the first punctuality deviation value is positive and is greater than the preset punctuality deviation intermediate value;

when the first punctuality deviation value is negative and the absolute value is greater than the preset punctuality deviation intermediate value, determining that the punctuality deviation reference value is a second punctuality deviation reference value;

the absolute values of the first timekeeping deviation reference value and the second timekeeping deviation reference value are equal to the preset timekeeping deviation intermediate value, the first timekeeping deviation reference value is positive, and the second timekeeping deviation reference value is negative.

12. The apparatus of claim 7, wherein the determine parameter value module is further to:

determining a difference between the first punctual deviation value and the punctual deviation reference value;

and determining the adjustment step number based on the difference and a preset adjustment step length.

13. A computer storage medium, characterized in that the computer-readable storage medium comprises a computer program which, when run on a computer, causes the computer to perform the method according to any one of claims 1 to 6.

14. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 6.

Technical Field

The application relates to the technical field of clock synchronization application, in particular to a method and a device for improving time keeping precision by using an NTP auxiliary source.

Background

The timekeeping capability of the time synchronization device mainly depends on the frequency stability of a standard frequency source, the accuracy of the crystal oscillator frequency of the time synchronization device, the influence of factors such as temperature, voltage, chip aging and the like, the time variation, the temperature and the voltage variation, or the chip aging can cause the crystal oscillator frequency to generate small amplitude fluctuation, and the long-time frequency deviation can cause the precision drift of the time synchronization device to be larger and larger, in the prior art, in order to improve the accuracy drift problem of the time synchronization device, a compensation algorithm is generally adopted, and compensating the generated deviation, for example, measuring the temperature, the clock duration and the crystal frequency of the local clock crystal oscillator as required, establishing an aging prediction model of the corresponding relation of the temperature, the working duration and the frequency deviation of the local clock crystal oscillator, and adjusting the local clock according to the frequency deviation of the local clock crystal oscillator. Moreover, although the generated deviation is compensated correspondingly based on the prediction models or the compensation algorithms, the time-keeping accuracy drift can be reduced, but the time-keeping accuracy drift is accumulated more and more after a long time, and finally the time-keeping accuracy drift of the time synchronization device is overlarge.

Disclosure of Invention

The embodiment of the application provides a method and a device for maintaining a time-keeping state, which are used for solving the problems that an external time source of a time synchronization device fails and the time-keeping precision of the time synchronization device drifts too much after a long time in the prior art.

In a first aspect, a method for improving time keeping accuracy by using an NTP auxiliary source is provided, including:

determining a first time keeping deviation value by using an NTP message; the first time keeping deviation value is an actual time keeping deviation value of the time synchronization device in the time keeping state acquired in real time;

determining a punctuality deviation fluctuation range based on the punctuality deviation reference value and a preset punctuality deviation fluctuation range; the punctuality deviation reference value is a reference for punctuality deviation adjustment;

and determining a first parameter value, an adjustment direction and an adjustment step number for determining whether the mark time synchronization device adjusts the time keeping precision or not based on the time keeping deviation fluctuation range and the first time keeping deviation value.

By the method for maintaining the time-keeping state, whether the parameters, the adjusting direction and the adjusting step number of the mark time-keeping precision are adjusted by using the NTP auxiliary source or not can be determined when the external time source of the time synchronization device fails for a long time, so that the time synchronization device adjusts the time-keeping precision based on the determined parameters, the time-keeping precision is kept in a preset range, and the time-keeping precision of the time synchronization device is ensured not to drift too much.

Optionally, the determining the first time-keeping deviation value by using the NTP message includes:

acquiring an initial value of a time-keeping deviation by utilizing a timestamp for recording data packet receiving and sending in an NTP message, wherein the initial value is effective in the external time source, and is acquired when the time synchronization device is in a locking state;

acquiring a measured value of time-keeping deviation in real time, wherein the measured value is acquired when the time synchronization device is in the time-keeping state;

determining a difference between the measured value and the initial value as the first punctual deviation.

Optionally, the determining, based on the timekeeping deviation fluctuation range and the first timekeeping deviation value, whether the mark time synchronization device adjusts the timekeeping accuracy includes:

determining the maximum value and the minimum value of the punctual deviation fluctuation based on the punctual deviation reference value and the punctual deviation fluctuation amplitude; and comparing the first punctuality deviation with the maximum value and the minimum value every unit time;

and when the times that the first punctuality deviation is continuously greater than the maximum value exceed the preset times or the times that the first punctuality deviation is continuously less than the minimum value exceed the preset times, determining the first parameter value as a value for marking the adjustment of the punctuality accuracy.

The method determines whether the symbolic numerical value for adjusting the punctuality deviation is determined, and can ensure that when the punctuality deviation exceeds a preset range, the first parameter value is determined to be the numerical value for adjusting the punctuality deviation, so that the punctuality deviation can be adjusted in time and is in the preset range.

Optionally, determining the adjustment direction includes:

when the number of times that the first punctual deviation is continuously greater than the maximum value exceeds a preset number of times, determining that the adjustment direction is downward;

and when the number of times that the first punctual deviation is continuously smaller than the minimum value exceeds the preset number of times, determining that the adjustment direction is upward.

Optionally, determining the punctuality deviation reference value includes: when the first punctuality deviation value is positive and is greater than the preset punctuality deviation intermediate value, determining that the punctuality deviation reference value is a first punctuality deviation reference value;

when the first punctuality deviation value is negative and the absolute value is greater than the preset punctuality deviation intermediate value, determining that the punctuality deviation reference value is a second punctuality deviation reference value;

the absolute values of the first timekeeping deviation reference value and the second timekeeping deviation reference value are equal to the preset timekeeping deviation intermediate value, the first timekeeping deviation reference value is positive, and the second timekeeping deviation reference value is negative.

Optionally, the determining that the first parameter value is a value for marking adjustment of the time keeping accuracy includes:

determining a difference between the first punctual deviation value and the punctual deviation reference value;

and determining the adjustment step number based on the difference and a preset adjustment step length.

In a second aspect, there is provided an apparatus for improving time keeping accuracy using an NTP auxiliary source, the apparatus comprising:

a determine difference module: the method comprises the steps of determining a first time keeping deviation value by using an NTP message; the first time keeping deviation value is an actual time keeping deviation value of the time synchronization device in the time keeping state acquired in real time;

a determine range module: the device is used for determining the punctual deviation fluctuation range based on the punctual deviation reference value and the preset punctual deviation fluctuation range; the punctuality deviation reference value is a reference for punctuality deviation adjustment;

a parameter determination module: and determining a first parameter value, an adjustment direction and an adjustment step number for determining whether the mark time synchronization device adjusts the time keeping accuracy based on the time keeping deviation fluctuation range and the first time keeping deviation value.

Optionally, the difference determining module is specifically configured to:

acquiring an initial value of a time-keeping deviation by utilizing a timestamp for recording data packet receiving and sending in an NTP message, wherein the initial value is acquired when the external time source is effective and the time synchronization device is in a locking state;

acquiring a measured value of time-keeping deviation in real time, wherein the measured value is acquired when the time synchronization device is in the time-keeping state;

determining a difference between the measured value and the initial value as the first punctual deviation.

Optionally, the parameter determining module is specifically configured to:

determining the maximum value and the minimum value of the punctual deviation fluctuation based on the punctual deviation reference value and the punctual deviation fluctuation amplitude; and comparing the first punctuality deviation with the maximum value and the minimum value every unit time;

and when the times that the first punctuality deviation is continuously greater than the maximum value exceed the preset times or the times that the first punctuality deviation is continuously less than the minimum value exceed the preset times, determining the first parameter value as a value for marking the adjustment of the punctuality accuracy.

Optionally, the parameter determining module is further configured to:

when the number of times that the first punctual deviation is continuously greater than the maximum value exceeds a preset number of times, determining that the adjustment direction is downward;

and when the number of times that the first punctual deviation is continuously smaller than the minimum value exceeds the preset number of times, determining that the adjustment direction is upward.

Optionally, the apparatus further comprises:

determining a reference module: the device is used for determining the punctuality deviation reference value as a first punctuality deviation reference value when the first punctuality deviation value is positive and is greater than the preset punctuality deviation intermediate value;

when the first punctuality deviation value is negative and the absolute value is greater than the preset punctuality deviation intermediate value, determining that the punctuality deviation reference value is a second punctuality deviation reference value;

the absolute values of the first timekeeping deviation reference value and the second timekeeping deviation reference value are equal to the preset timekeeping deviation intermediate value, the first timekeeping deviation reference value is positive, and the second timekeeping deviation reference value is negative.

Optionally, the determining that the first parameter value is a value for marking adjustment of the time keeping accuracy includes:

determining a difference between the first punctual deviation value and the punctual deviation reference value;

and determining the adjustment step number based on the difference and a preset adjustment step length.

In a third aspect, an embodiment of the present application further provides a computer storage medium, including:

the computer readable storage medium comprises a computer program which, when run on a computer, causes the computer to perform the method of the first aspect of the above-described methods.

In a fourth aspect, an embodiment of the present application further provides a computer program product including instructions, including:

when run on a computer, the instructions cause the computer to perform the method of the first aspect of the above method.

Drawings

Fig. 1 is a schematic block diagram of an overall structure of an application system of a method for improving time-keeping accuracy by using an NTP auxiliary source according to an embodiment of the present application;

fig. 2 is a schematic flow chart of a method for improving time keeping accuracy by using an NTP auxiliary source according to an embodiment of the present application;

fig. 3 is a schematic diagram illustrating a method for obtaining an initial value of a time-keeping deviation according to an embodiment of the present application;

FIG. 4a is a schematic diagram of the precision of the before-punctuality deviation of the modified driver provided in the embodiment of the present application;

FIG. 4b is a schematic diagram illustrating the accuracy of the punctuality deviation after the driver is modified according to the embodiment of the present application;

FIG. 5 is a diagram illustrating comparison of the start-up forbidden time keeping accuracy of the time keeping method provided in the embodiment of the present application;

fig. 6 is a schematic diagram of an apparatus for improving time keeping accuracy by using NTP as an auxiliary source according to an embodiment of the present invention.

Detailed Description

The problem that the time keeping precision of the time synchronization device drifts too much after an external time source of the time synchronization device in the prior art fails for a long time is solved. The embodiments of the present application provide the following solutions.

In order to solve the above problems, the embodiments of the present invention have the following general ideas:

firstly, the real-time-keeping deviation of a time synchronization device in a time-keeping state is determined by utilizing an NTP message, then the fluctuation range of the time-keeping deviation is determined, and finally, a first parameter value for marking whether the time-keeping precision is adjusted or not is determined based on the determined fluctuation range of the time-keeping deviation and the real-time value of the time-keeping deviation, so that the adjustment direction and the adjustment step number are determined.

By the method for maintaining the time-keeping state, whether the mark time-keeping precision utilizes NTP for assisting in source adjustment parameters, adjustment directions and adjustment steps can be determined when an external time source of the time synchronization device fails for a long time, so that the time synchronization device adjusts the time-keeping precision based on the determined parameters, the time-keeping precision is kept in a preset range, and the time-keeping precision of the time synchronization device is guaranteed not to drift too much.

Firstly, in the embodiment of the present application, the provided system for improving time keeping accuracy by using NTP auxiliary as a source is applied to the system shown in fig. 1, and the system includes a core processing module, a satellite receiving module, an IRIG-B input decoding module, a power supply module, a system configuration maintenance module, a network interface module, an output module (three output forms of pulse signal output, IRIG-B time output, and time message output), and an NTP auxiliary source module, wherein the satellite receiving module and the IRIG-B input decoding module are equivalent to an external time source, and when the external time source is valid, a reference time is determined based on the external time source; when the external time source is invalid, the reference time is determined by using the NTP auxiliary source.

When the NTP auxiliary source module determines that the time keeping accuracy needs to be adjusted, a first parameter value g for marking whether the time synchronization device adjusts the time keeping accuracy is set to 1, it should be noted that in this embodiment of the present application, g is a 1 mark to adjust the time keeping accuracy, and g is a 0 mark to adjust the time keeping accuracy; that is, when the NTP auxiliary source module adjusts the first parameter value of the flag bit to 1, the reference time determining unit adjusts the timekeeping accuracy.

Next, a time synchronization device according to an embodiment of the present application is introduced, where the time synchronization device includes an internal state machine and an NTP auxiliary source; the internal state machine has two states, one is called a locking state, and the internal state machine establishes an internal reference time source and is in the locking state under the condition that an external time source is effective; a time keeping state is provided, in which the time keeping accuracy is corrected by an NTP auxiliary source inside the device when an external time source fails and no valid time source is present.

The method for improving the time-keeping accuracy adjustment by using the NTP auxiliary source according to the embodiment of the present application is specifically described as follows.

As shown in fig. 2, a method for improving time keeping accuracy by using an NTP auxiliary source according to an embodiment of the present application includes the following specific implementation steps:

step 201: determining a first time keeping deviation value by using an NTP message; the first time keeping deviation value is an actual time keeping deviation value of the time synchronization device in the time keeping state acquired in real time;

acquiring an actual time keeping deviation value of a time synchronization device, firstly measuring an initial time keeping deviation value of the time synchronization device, and determining the initial time keeping deviation value by utilizing a timestamp for recording data packet receiving and sending when an external time source effective time synchronization device is in a locking state;

it should be noted that the methods for maintaining the time-keeping state provided in the embodiments of the present application are all performed in the case where the external time source is invalid and the NTP auxiliary source is used, and the method for determining the initial value of the time-keeping offset is a Client/Server method using the NTP auxiliary source. As shown in fig. 3, if the Client represents the time synchronizer and the Server represents the Server, the specific method flow for determining the initial value of the time-keeping deviation is as follows: the time synchronizer firstly sends a data packet to the server, T1 is a time stamp of the data packet leaving the time synchronizer, and T2 is a time stamp of the data packet received by the server; t3 is a time stamp for the packet to leave the server and return to the time synchronization, and the time synchronization device records the time stamp T4 of the packet return when receiving the response packet. The 4 time parameters are acquired based on NTP messages, and the time synchronization device can calculate the time keeping deviation value of the time synchronization device by using the 4 time parameters.

The method for calculating the punctuality deviation comprises the following steps: the punctual Offset value Offset is ((T2-T1) + (T3-T4))/2.

Usually, the processing time of these timestamps is implemented in the user layer, so the calculation of the offset is affected by the scheduling of the kernel process of the operating system or the uncertainty of the delay of the time slice rotation, and the measured time keeping offset value has a large error. It can be seen from figure 4a that the time-keeping deviation exceeds 100 microseconds.

In order to reduce the uncertain delay influence of kernel process scheduling or time slice rotation of the operating system, the time stamp of the NTP packet sending/receiving can be as close as possible to the real time of the host sending/receiving the packet. Under the condition of not changing hardware, a feasible method is to modify a network card driver at a network driver interface layer, and move a record NTP data packet sending/receiving timestamp from an application program to the network card driver, so that errors caused by uncertain processing delay of an operating system kernel can be eliminated. With the same method for obtaining the time-keeping deviation value, as shown in fig. 4b, in order to modify the driver, the accuracy of the time stamp obtaining and the time-keeping deviation is improved, as can be seen from the data in the figure, the method can greatly improve the time-keeping accuracy to microsecond level.

The real-time deviation of the time synchronizer is measured in real time by using the method, and the difference value between the real-time acquired real-time deviation measurement and the initial value of the real-time deviation is the actual real-time deviation value.

After the actual punctuality deviation value is determined, the following step 202 is performed.

Step 202: determining a punctuality deviation fluctuation range based on the punctuality deviation reference value and a preset punctuality deviation fluctuation range; the punctuality deviation reference value is a reference for punctuality deviation adjustment;

generally, according to the application scenario of the time synchronization apparatus and the requirement for the time keeping accuracy thereof, a time keeping deviation median value, that is, a standard time keeping accuracy, is preset for the time synchronization apparatus.

When determining the timekeeping deviation fluctuation range, firstly, a timekeeping deviation reference value needs to be determined based on an actual timekeeping deviation value, and the specific method comprises the following steps:

when the first punctuality deviation value is positive and is greater than the preset punctuality deviation intermediate value, determining that the punctuality deviation reference value is a first punctuality deviation reference value;

when the first punctuality deviation value is negative and the absolute value is greater than the preset punctuality deviation intermediate value, determining that the punctuality deviation reference value is a second punctuality deviation reference value;

the absolute values of the first timekeeping deviation reference value and the second timekeeping deviation reference value are equal to the preset timekeeping deviation intermediate value, the first timekeeping deviation reference value is positive, and the second timekeeping deviation reference value is negative.

When the actual punctuality deviation value is positive and is greater than the preset punctuality deviation intermediate value, determining the punctuality deviation reference value as a first punctuality deviation reference value; when the actual punctuality deviation value is negative and the absolute value is greater than the preset punctuality deviation intermediate value, determining the punctuality deviation reference value as a second punctuality deviation reference value; the absolute values of the first and second punctuality deviation reference values are equal to a preset punctuality deviation intermediate value, the first punctuality deviation reference value is positive, and the second punctuality deviation reference value is negative.

After the punctuality deviation standard is determined, the punctuality deviation fluctuation range can be determined by combining the preset punctuality deviation fluctuation range, and the punctuality deviation fluctuation range is determined by respectively adding the punctuality deviation fluctuation range and subtracting the punctuality deviation fluctuation range on the basis of the punctuality deviation standard value.

For example, the preset middle value of the time keeping deviation is 10us, the actual time keeping deviation of the time keeping device is obtained, if the actual time keeping deviation is 11us, the reference value of the time keeping deviation is determined to be 10us, and if the actual time keeping deviation is-11 us, the reference value of the time keeping deviation is determined to be-10 us. If the standard value of the punctual deviation is 10us and the preset punctual deviation fluctuation range is 5us, the maximum allowable value of the punctual deviation is 15us, and the minimum allowable value of the punctual deviation is 5us, the punctual deviation fluctuation range is 5 us-15 us.

After the timekeeping deviation fluctuation range is determined, the following step 203 is performed.

Step 203: and determining a first parameter value, an adjustment direction and an adjustment step number for indicating whether the time synchronization device adjusts the time keeping precision or not based on the time keeping deviation fluctuation range and the first time keeping deviation value.

Firstly, determining a first parameter value for marking whether a time synchronization device adjusts the time keeping precision or not based on the time keeping deviation fluctuation range and a first time keeping deviation value, and specifically determining the maximum value and the minimum value of the time keeping deviation fluctuation based on the time keeping deviation reference value and the time keeping deviation fluctuation amplitude; and comparing the first punctuality deviation with the maximum value and the minimum value every unit time; and when the times that the first punctuality deviation is continuously greater than the maximum value exceed the preset times or the times that the first punctuality deviation is continuously less than the minimum value exceed the preset times, determining the first parameter value as a value for marking the adjustment of the punctuality accuracy.

Determining a maximum value and a minimum value of the punctual deviation fluctuation based on the punctual deviation reference value and the punctual deviation fluctuation range, and comparing the first punctual deviation with the maximum value and the minimum value every unit time; if the maximum allowable value of the time-keeping deviation is 15us and the minimum allowable value is 5us, determining that the first parameter value is 1 when the real-time-keeping deviation is continuously greater than the maximum value and exceeds a preset number of times, in this embodiment of the present application, the preset number of times may be 5 times, that is, determining that the first parameter value is 1 when the real-time-keeping deviation value is continuously greater than 15us and exceeds 5 times; similarly, when the real-time timekeeping deviation value is continuously less than 5us and exceeds 5 times, the first parameter value is determined to be 1, that is, the mark needs to adjust the timekeeping deviation value. And if the real-time punctual deviation value is within the determined fluctuation range, determining that the first parameter value is 0, namely, the punctual deviation does not need to be adjusted.

In the embodiment of the present application, the preset number may be 5, and the setting of the continuous preset number is greater than the starting of the adjustment is to avoid accidental change of the time keeping accuracy of the time synchronization device. Determining that the first parameter is 1, and the punctual deviation needs to be adjusted, so as to determine the adjustment direction, specifically, when the number of times that the first punctual deviation is continuously greater than the maximum value exceeds a preset number of times, determining that the adjustment direction is downward; and when the number of times that the first punctual deviation is continuously smaller than the minimum value exceeds the preset number of times, determining that the adjustment direction is upward.

When the number of times that the first timekeeping deviation is continuously larger than the maximum value exceeds a preset number of times, determining that the adjusting direction is downward, wherein the adjusting direction can be represented by a parameter e, and specifically, if the adjusting direction is downward, the adjusting direction is 2; when the number of times that the first punctual deviation is continuously smaller than the minimum value exceeds a preset number of times, determining that the adjustment direction is upward, and then, e is 1.

Determining the number of adjustment steps, and determining the difference between the first timekeeping deviation value and a timekeeping deviation reference value in the first step; and secondly, determining the number of adjustment steps based on the difference and a preset adjustment step length.

In the embodiment of the present application, when specifically adjusting the time keeping accuracy, a preset adjustment step length is used for adjustment, and the step length is 200ns in the embodiment of the present application as an example, but the embodiment of the present application does not limit the size of the adjustment step length. And after the difference between the first punctual deviation value and the punctual deviation reference value is determined, the ratio of the determined difference to the adjustment step length of 200ns is the adjustment step number.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种两轴云台建模以及自动整定PID参数方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类