Self-adaptive time keeping time service method

文档序号:814472 发布日期:2021-03-26 浏览:12次 中文

阅读说明:本技术 一种自适应守时授时方法 (Self-adaptive time keeping time service method ) 是由 葛飞 王宁 贾明福 张伟彬 李晓庆 吴英攀 高凯 于 2020-12-18 设计创作,主要内容包括:本发明提供了一种自适应守时授时方法,采用两个计数器分别对滤波后的外部输入信号和本地信号进行计数,以修正本地信号的周期和相位,使本地信号对齐滤波后的外部输入信号,同时还消除了外部输入信号异常情况对本地信号的影响。本发明的方法利用已有的硬件电路资源即可实现,不必增加额外的复杂器件,也不影响其他功能,安全可靠且具备很好的通用性和实用性。本发明的方法已经过实际产品验证,可以实现守时和授时功能,且在首次同步守时或者外部输入信号异常的情况下,不会引起本地信号的跳变、抖动等异常情况。(The invention provides a self-adaptive time keeping time service method, which adopts two counters to count filtered external input signals and local signals respectively so as to correct the period and the phase of the local signals, so that the local signals are aligned with the filtered external input signals, and the influence of the abnormal condition of the external input signals on the local signals is eliminated. The method can be realized by utilizing the existing hardware circuit resources, does not need to add additional complex devices, does not influence other functions, is safe and reliable, and has good universality and practicability. The method of the invention can realize the functions of time keeping and time service after the actual product verification, and can not cause the abnormal conditions of jump, jitter and the like of local signals under the condition of first synchronous time keeping or abnormal external input signals.)

1. An adaptive time keeping time service method is characterized by comprising the following steps:

s10, filtering the external input signal to obtain a filtered external input signal;

s20, counting the filtered external input signals by the first counter, judging whether the filtered external input signals are correct or not based on the counting value of the first counter, if so, entering S30, and if not, continuing to execute S20 to judge the next filtered external input signals;

s30, synchronizing the local signal and the filtered external input signal for the first time, simultaneously resetting a second counter and counting the local signal, and setting the period of the local signal to be the same as the period of the filtered external input signal which is synchronized last time;

s40, judging whether the filtered external input signal is correct or not based on the count value of the first counter, if so, entering S50, and if not, entering S70;

s50, latching the count value of the second counter at the start edge moment of the collected filtered external input signal, and judging whether to correct the local signal or not based on the count value of the second counter, if so, entering S60, otherwise, entering S80;

s60, correcting the period of the local signal based on the count value of the second counter, simultaneously obtaining the time delay generated in the time keeping process, correcting the phase of the local signal based on the time delay to obtain a corrected local signal, and carrying out time service based on the corrected local signal;

s70, judging whether the number of the filtered external input signals which are continuously incorrect is larger than the preset number, if so, entering S90, and otherwise, entering S80;

s80, the local signal is not corrected, time service is carried out based on the local signal which is not corrected, and the next filtered external input signal is judged by returning to S40;

s90, shielding the filtered external input signal, then not using the filtered external input signal to correct the local signal, and timing based on the uncorrected local signal.

2. The method of claim 1, wherein determining whether the filtered external input signal is correct based on the count value of the first counter comprises:

acquiring count values of first counters corresponding to the periods of the two filtered external input signals;

judging whether the count values of the first counters corresponding to the periods of the two filtered external input signals are all in [ T ]0-a,T0+a]If so, determining that the filtered external input signal is correct, otherwise, determining that the filtered external input signal is incorrect, wherein T0A is a first allowable error for the period of the filtered external input signal.

3. The method of claim 2, further comprising: and setting an upper limit value for the first counter, and clearing when the count value of the first counter exceeds the upper limit value.

4. The method of claim 1, wherein determining whether to modify the local signal based on the count value of the second counter comprises:

judging whether the count value of the latched second counter is greater than T-b or less than b;

if yes, judging to correct the local signal, otherwise, judging not to correct the local signal;

where T is the period of the local signal and b is the second allowable error.

5. The method of claim 4, wherein modifying the period of the local signal based on the count value of the second counter comprises:

reducing the period of the local signal by T-T under the condition that the count value of the latched second counter is greater than T-b;

under the condition that the count value of the latched second counter is smaller than b, increasing the period of the local signal by t;

wherein t is the count value of the latched second counter.

Technical Field

The invention relates to the technical field of system synchronous time keeping, in particular to a self-adaptive time keeping time service method.

Background

In the design of a system, particularly a navigation system needing to unify synchronous signals in time keeping, each sub-component needs to complete time service or time keeping functions. When no external synchronous signal exists, the sub-component needs to generate a local synchronous signal with the same frequency; when an external synchronizing signal is present, the sub-unit times the external signal to synchronize the local signal to the external input signal. In many current implementation manners, when the device is in synchronous punctuality for the first time or an external signal is abnormal, abnormal conditions such as jump and jitter of a local time service signal can be caused.

Disclosure of Invention

The invention provides a self-adaptive time keeping time service method, which can solve the technical problem that the conventional time keeping method can cause abnormal conditions such as jump and jitter of local signals under the condition of first synchronous time keeping or abnormal external input signals.

The invention provides a self-adaptive time keeping time service method, which comprises the following steps:

the method comprises the following steps:

s10, filtering the external input signal to obtain a filtered external input signal;

s20, counting the filtered external input signals by the first counter, judging whether the filtered external input signals are correct or not based on the counting value of the first counter, if so, entering S30, and if not, continuing to execute S20 to judge the next filtered external input signals;

s30, synchronizing the local signal and the filtered external input signal for the first time, simultaneously resetting a second counter and counting the local signal, and setting the period of the local signal to be the same as the period of the filtered external input signal which is synchronized last time;

s40, judging whether the filtered external input signal is correct or not based on the count value of the first counter, if so, entering S50, and if not, entering S70;

s50, latching the count value of the second counter at the start edge moment of the collected filtered external input signal, and judging whether to correct the local signal or not based on the count value of the second counter, if so, entering S60, otherwise, entering S80;

s60, correcting the period of the local signal based on the count value of the second counter, simultaneously obtaining the time delay generated in the time keeping process, correcting the phase of the local signal based on the time delay to obtain a corrected local signal, and carrying out time service based on the corrected local signal;

s70, judging whether the number of the filtered external input signals which are continuously incorrect is larger than the preset number, if so, entering S90, and otherwise, entering S80;

s80, the local signal is not corrected, time service is carried out based on the local signal which is not corrected, and the next filtered external input signal is judged by returning to S40;

s90, shielding the filtered external input signal, then not using the filtered external input signal to correct the local signal, and timing based on the uncorrected local signal.

Preferably, the determining whether the filtered external input signal is correct based on the count value of the first counter includes:

acquiring count values of first counters corresponding to the periods of the two filtered external input signals;

judging whether the count values of the first counters corresponding to the periods of the two filtered external input signals are all in [ T ]0-a,T0+a]If so, determining that the filtered external input signal is correct, otherwise, determining that the filtered external input signal is incorrect, wherein T0A is a first allowable error for the period of the filtered external input signal.

Preferably, the method further comprises: and setting an upper limit value for the first counter, and clearing when the count value of the first counter exceeds the upper limit value.

Preferably, the determining whether to modify the local signal based on the count value of the second counter includes:

judging whether the count value of the latched second counter is greater than T-b or less than b;

if yes, judging to correct the local signal, otherwise, judging not to correct the local signal;

where T is the period of the local signal and b is the second allowable error.

Preferably, the modifying the period of the local signal based on the count value of the second counter includes:

reducing the period of the local signal by T-T under the condition that the count value of the latched second counter is greater than T-b;

under the condition that the count value of the latched second counter is smaller than b, increasing the period of the local signal by t;

wherein t is the count value of the latched second counter.

By applying the technical scheme of the invention, two counters are adopted to count the filtered external input signal and the local signal respectively so as to correct the period and the phase of the local signal, so that the local signal is aligned with the filtered external input signal, and the influence of the abnormal condition of the external input signal on the local signal is eliminated. The method can be realized by utilizing the existing hardware circuit resources, does not need to add additional complex devices, does not influence other functions, is safe and reliable, and has good universality and practicability. The method of the invention can realize the functions of time keeping and time service after the actual product verification, and can not cause the abnormal conditions of jump, jitter and the like of local signals under the condition of first synchronous time keeping or abnormal external input signals.

Drawings

The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.

FIG. 1 is a flow chart of an adaptive time keeping method according to an embodiment of the invention;

FIG. 2 illustrates a schematic diagram of a first synchronization provided in accordance with an embodiment of the present invention;

fig. 3 shows a schematic diagram of modifying a local signal period provided according to an embodiment of the invention.

Detailed Description

It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments according to the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.

The relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise. Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description. Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate. In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.

Fig. 1 is a flowchart illustrating an adaptive time keeping method according to an embodiment of the present invention.

As shown in fig. 1, the present invention provides an adaptive time keeping time service method, including:

s10, filtering the external input signal to obtain a filtered external input signal;

s20, counting the filtered external input signals by the first counter, judging whether the filtered external input signals are correct or not based on the counting value of the first counter, if so, entering S30, and if not, continuing to execute S20 to judge the next filtered external input signals;

s30, synchronizing the local signal and the filtered external input signal for the first time, simultaneously resetting a second counter and counting the local signal, and setting the period of the local signal to be the same as the period of the filtered external input signal which is synchronized last time;

s40, judging whether the filtered external input signal is correct or not based on the count value of the first counter, if so, entering S50, and if not, entering S70;

s50, latching the count value of the second counter at the start edge moment of the collected filtered external input signal, and judging whether to correct the local signal or not based on the count value of the second counter, if so, entering S60, otherwise, entering S80;

s60, correcting the period of the local signal based on the count value of the second counter, simultaneously obtaining the time delay generated in the time keeping process, correcting the phase of the local signal based on the time delay to obtain a corrected local signal, and carrying out time service based on the corrected local signal;

s70, judging whether the number of the filtered external input signals which are continuously incorrect is larger than the preset number, if so, entering S90, and otherwise, entering S80;

s80, the local signal is not corrected, time service is carried out based on the local signal which is not corrected, and the next filtered external input signal is judged by returning to S40;

s90, shielding the filtered external input signal, then not using the filtered external input signal to correct the local signal, and timing based on the uncorrected local signal.

In the invention, the first counter is used for counting each period of the filtered external input signal, the count value of the first counter is latched at the starting edge moment of the filtered external input signal, and meanwhile, the first counter is cleared and counts the next period. The second counter is used for counting each period of the local signal, latching the count value of the second counter at the initial edge moment of the collected filtered external input signal, and clearing the second counter and counting the next period at the initial edge moment of the collected local signal.

The invention adopts two counters to count the filtered external input signal and the local signal respectively so as to correct the period and the phase of the local signal, so that the local signal is aligned with the filtered external input signal, and the influence of the abnormal condition of the external input signal on the local signal is eliminated. The method can be realized by utilizing the existing hardware circuit resources, does not need to add additional complex devices, does not influence other functions, is safe and reliable, and has good universality and practicability. The method of the invention can realize the functions of time keeping and time service after the actual product verification, and can not cause the abnormal conditions of jump, jitter and the like of local signals under the condition of first synchronous time keeping or abnormal external input signals.

Fig. 2 shows a schematic diagram of a first synchronization provided according to an embodiment of the invention. As shown in fig. 2, according to an embodiment of the present invention, the determining whether the filtered external input signal is correct based on the count value of the first counter includes:

acquiring count values of first counters corresponding to the periods of the two filtered external input signals;

determining a connection between two filtered external input signalsWhether the count values of the first counters corresponding to the periods of the numbers are all in [ T ]0-a,T0+a]If so, determining that the filtered external input signal is correct, otherwise, determining that the filtered external input signal is incorrect, wherein T0A is a first allowable error for the period of the filtered external input signal.

The above embodiment is specifically described by taking the first synchronization in fig. 2 as an example. Setting a period T of the filtered external input signal0Is 1s, the first allowable error a is 1 ms. Obtaining the count value of the first counter corresponding to the last period of the filtered external input signal, and recording as T1And resetting the first counter, and then obtaining the count value of the first counter corresponding to the current period of the filtered external input signal, and recording the count value as T2And clearing the first counter. Then, T is judged1And T2Whether all are in the range of [1s-1ms, 1s +1ms]If so, judging that the currently filtered external input signal is correct, and then carrying out primary synchronization on the next local signal and the next filtered external input signal; otherwise, the current filtered external input signal is judged to be incorrect, and at the moment, the next local signal is not synchronized with the next filtered external input signal.

According to an embodiment of the invention, the method further comprises: and setting an upper limit value for the first counter, and clearing when the count value of the first counter exceeds the upper limit value, so as to avoid the first counter from continuously counting when no external input signal exists.

According to an embodiment of the present invention, the determining whether to modify the local signal based on the count value of the second counter includes:

judging whether the count value of the latched second counter is greater than T-b or less than b;

if yes, judging to correct the local signal, otherwise, judging not to correct the local signal;

where T is the period of the local signal and b is the second allowable error.

According to an embodiment of the present invention, the modifying the period of the local signal based on the count value of the second counter includes:

reducing the period of the local signal by T-T under the condition that the count value of the latched second counter is greater than T-b;

under the condition that the count value of the latched second counter is smaller than b, increasing the period of the local signal by t;

wherein t is the count value of the latched second counter.

Under the condition that the count value of the latched second counter is greater than T-b, the filtered external input signal is advanced, and at the moment, the local signal needs to be reduced by step length; when the count value of the latched second counter is smaller than b, the filtered external input signal lags, and at the moment, the local signal needs to be increased by a step length; when the count value of the latched second counter is greater than b and smaller than T-b, it indicates that the filtered external input signal is disturbed to generate a large deviation, and at this time, the local signal is corrected, so that a jump is generated to affect the time service of other equipment, and the local signal is not corrected.

Fig. 3 shows a schematic diagram of modifying a local signal period provided according to an embodiment of the invention. Assuming that the filtered external input signals in fig. 3 are all correct, as shown in fig. 3, the first filtered external input signal is synchronized with the first local signal, and the count value of the second counter, denoted as T1, is latched at the beginning of the acquisition of the second filtered external input signal, where T1 > T-b, as shown in fig. 3, indicates that the second filtered external input signal is advanced, and the local signal needs to be reduced by the step size, that is, the period of the local signal is reduced by T-T1. When the starting edge of the third filtered external input signal is acquired, the count value of the second counter is latched and recorded as t2, and as can be seen from fig. 3, t2 > b indicates that the filtered external input signal is disturbed to generate a large deviation, and at this time, the local signal is corrected, so that a jump is generated to affect the time service of other devices, and therefore, the period of the local signal is not corrected.

Spatially relative terms, such as "above … …," "above … …," "above … …," "above," and the like, may be used herein for ease of description to describe one device or feature's spatial relationship to another device or feature as illustrated in the figures. It will be understood that the spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientation depicted in the figures. For example, if a device in the figures is turned over, devices described as "above" or "on" other devices or configurations would then be oriented "below" or "under" the other devices or configurations. Thus, the exemplary term "above … …" can include both an orientation of "above … …" and "below … …". The device may be otherwise variously oriented (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein interpreted accordingly.

It should be noted that the terms "first", "second", and the like are used to define the components, and are only used for convenience of distinguishing the corresponding components, and the terms have no special meanings unless otherwise stated, and therefore, the scope of the present invention should not be construed as being limited.

The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:高频电源装置以及高频功率的输出方法

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!