CN111817714B - Electronic equipment time synchronization and time keeping method based on crystal oscillator second pulse synchronization technology - Google Patents

Electronic equipment time synchronization and time keeping method based on crystal oscillator second pulse synchronization technology Download PDF

Info

Publication number
CN111817714B
CN111817714B CN202010674857.7A CN202010674857A CN111817714B CN 111817714 B CN111817714 B CN 111817714B CN 202010674857 A CN202010674857 A CN 202010674857A CN 111817714 B CN111817714 B CN 111817714B
Authority
CN
China
Prior art keywords
crystal oscillator
pulse
time
common
external clock
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
CN202010674857.7A
Other languages
Chinese (zh)
Other versions
CN111817714A (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.)
Integrated Electronic Systems Lab Co Ltd
Original Assignee
Integrated Electronic Systems Lab 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 Integrated Electronic Systems Lab Co Ltd filed Critical Integrated Electronic Systems Lab Co Ltd
Priority to CN202010674857.7A priority Critical patent/CN111817714B/en
Publication of CN111817714A publication Critical patent/CN111817714A/en
Application granted granted Critical
Publication of CN111817714B publication Critical patent/CN111817714B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION, OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L7/00Automatic control of frequency or phase; Synchronisation
    • H03L7/06Automatic control of frequency or phase; Synchronisation using a reference signal applied to a frequency- or phase-locked loop
    • H03L7/08Details of the phase-locked loop
    • H03L7/14Details of the phase-locked loop for assuring constant frequency when supply or correction voltages fail or are interrupted
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION, OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L7/00Automatic control of frequency or phase; Synchronisation
    • H03L7/06Automatic control of frequency or phase; Synchronisation using a reference signal applied to a frequency- or phase-locked loop
    • H03L7/08Details of the phase-locked loop
    • H03L7/085Details of the phase-locked loop concerning mainly the frequency- or phase-detection arrangement including the filtering or amplification of its output signal
    • H03L7/087Details of the phase-locked loop concerning mainly the frequency- or phase-detection arrangement including the filtering or amplification of its output signal using at least two phase detectors or a frequency and phase detector in the loop
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention discloses an electronic equipment time synchronization and time keeping method based on a crystal oscillator-to-crystal oscillator second pulse synchronization technology, and relates to the technical field of clock synchronization. The method comprises the following steps: s01, detecting whether an external clock source time synchronization signal second pulse exists or not, and if so, synchronizing the common crystal oscillator second pulse and the high stable crystal oscillator second pulse of the electronic equipment by using the external clock source time synchronization signal second pulse; if not, the high-stability crystal oscillator second pulse of the electronic equipment is used for synchronizing the common crystal oscillator second pulse; s02, repeating the step S01. The invention uses the second pulse generated by the common crystal oscillator as the second pulse of the system, and adopts the external clock source to synchronize the second pulse of the common crystal oscillator with the time synchronizing signal or the high-stability second pulse of the crystal oscillator, thereby realizing the functions of high-precision time synchronization and time keeping and improving the reliability of the clock system.

Description

Electronic equipment time synchronization and time keeping method based on crystal oscillator second pulse synchronization technology
Technical Field
The embodiment of the invention relates to the technical field of clock synchronization, in particular to a method for time synchronization and time conservation of electronic equipment based on a crystal oscillator-to-crystal oscillator second pulse synchronization technology.
Background
With the rapid development of electronic technology, the requirements on the precision and stability of clocks in electronic equipment are also increasing. In the prior art, an external clock source is generally used for high-precision time synchronization of an electronic device, and when the time synchronization signal disappears, the electronic device uses an internal clock for high-precision time conservation. The specific implementation mode generally adopts an oscillation period counter based on crystal oscillator in the electronic equipment, and the counter generates a second pulse signal every second for the clock system of the equipment to use: when an external clock source time setting signal is received, synchronizing an internal crystal oscillator second pulse by using a second edge of the time setting signal; when the clock signal disappears, the clock signal is clocked by the second pulse synchronized by the external clock signal.
Crystal oscillators used in electronic devices are generally classified into normal crystal oscillators and high-stability crystal oscillators in terms of frequency accuracy. The common crystal oscillator has simple structure and is not easy to damage, but has poorer frequency stability. The high-stability crystal oscillator has a complex structure and is easy to damage, but the frequency stability is higher. If a common crystal oscillator is selected, the time keeping performance is poor because the frequency of the crystal oscillator is unstable. If the high-stability crystal oscillator is selected, the time alignment and the time conservation can be realized with high precision, but the crystal oscillator is easy to damage and lose efficacy when being subjected to mechanical impact such as vibration and the like due to poor mechanical performance.
Based on the defects existing in the prior art, the invention provides a time synchronization and time keeping method of electronic equipment based on a crystal oscillator second pulse synchronization technology, which improves the reliability of a clock system and realizes high-precision time synchronization and time keeping functions.
Disclosure of Invention
The invention provides a time synchronization and time keeping method of electronic equipment based on a crystal oscillator-to-crystal pulse synchronization technology, which uses a common crystal oscillator to provide second pulses for a system and uses an external clock source or a high-stability crystal oscillator to perform the common crystal oscillator
And the synchronization is realized, and the functions of high-precision time synchronization and time keeping are realized.
The invention is realized by the following technical scheme:
an electronic equipment time synchronization and time keeping method based on a crystal oscillator second pulse synchronization technology comprises the following steps:
s01, detecting whether the second pulse of the external clock source time synchronization signal exists,
if so, using an external clock source to synchronize the normal crystal oscillator second pulse and the high-stability crystal oscillator second pulse of the time synchronization signal second pulse electronic device;
if not, the high-stability crystal oscillator second pulse of the electronic equipment is used for synchronizing the common crystal oscillator second pulse;
s02, repeating the step S01.
The method uses a crystal oscillator oscillation counter to represent the time of second pulse and the size of second interval inside the equipment. The counter value is incremented by 1 every crystal oscillation period, and the second interval is counted as Dn assuming that the number of oscillation periods contained per second is Dn. Assuming that the counter value is N when the current pulse per second is generated, the next pulse per second is generated when the counter value is n+dn, and so on.
Based on the scheme, the method is optimized as follows:
further, in the step S01, the step of synchronizing the normal crystal oscillator second pulse and the high-stability crystal oscillator second pulse of the electronic device with the clock second pulse by using the external clock source includes the following steps:
s11, judging whether the detected time signal second pulse of the external clock source is the first second pulse, if so, respectively recording a common crystal oscillator counter value and a high stable crystal oscillator counter value, continuously executing the step S11, and if not, executing the step S12;
and S12, respectively recording a common crystal oscillator counter value and a high stable crystal oscillator counter value, judging whether the common crystal oscillator counter value and the high stable crystal oscillator counter value are valid, if so, synchronizing the common crystal oscillator second pulse and the high stable crystal oscillator second pulse by using an external clock source to time signal second pulse, and synchronizing the time setting state, and if the common crystal oscillator counter value or the high stable crystal oscillator counter value is invalid, executing the step S01 to detect whether the external clock source operates to time signal second pulse.
Specifically, in the step S12, it is determined whether the ordinary crystal oscillator counter value and the high stable crystal oscillator counter value are valid, including the following steps:
recording a common crystal oscillator counter value CNsyn (i) and a high stable crystal oscillator counter value GNsyn (i) respectively, wherein i represents an ith second pulse;
calculating a second interval CDnsyn (i) =CNsyn (i) -CNsyn (i-1) of the external clock source time-setting signal based on the common crystal oscillator counter, and calculating a second interval GDnsyn (i) =GNsyn (i) -GNsyn (i-1) of the external clock source time-setting signal based on the high-stability crystal oscillator counter;
whether the second intervals CDnsyn (i) and GDnsyn (i) between the last two second pulses are within the maximum allowable value and the minimum allowable value range or not is judged, if yes, the method is effective, and if not, the method is ineffective.
Further, in the step S12, the clock signal second pulse is synchronized with the normal crystal oscillator second pulse and the high stable crystal oscillator second pulse by using the external clock source, and the following formula is used for calculating:
assuming that the value of the crystal oscillator counter is CNloc (i) when the second pulse of the common crystal oscillator occurs, the second interval CDnLoc (i) =cnsyn (i) +cdnsyn (i) -CNloc (i) of the common crystal oscillator;
assuming that the value of the crystal oscillator counter is GNloc (i) when the second high steady crystal oscillator second pulse occurs, the second interval GDnLoc (i) =gnsyn (i) +gdnsyn (i) -GNloc (i) of the high steady crystal oscillator.
In the above-mentioned method for time synchronization and time keeping of electronic equipment based on inter-crystal oscillator second pulse synchronization technology, in the step S01, before using high-stability crystal oscillator second pulse of the electronic equipment to synchronize common crystal oscillator second pulse, the method further includes the following steps:
and S20, judging whether the external clock source time synchronization signal second pulse is overtime, if not, executing the step S01 to detect whether the external clock source time synchronization signal second pulse has operation, and if so, using the high-stability crystal oscillator second pulse of the electronic equipment to synchronize the common crystal oscillator second pulse.
Further, in the step S20, the step of using the high-stability crystal oscillator second pulse of the electronic device to synchronize the common crystal oscillator second pulse includes the following steps:
s21, detecting whether high-stability crystal oscillator second pulse exists, if so, executing a step S22, and if not, executing a step S23;
s22, recording a common crystal oscillator counter value when the high-stability crystal oscillator second pulse is generated, judging whether the common crystal oscillator counter value is valid, if so, synchronizing the common crystal oscillator second pulse by using the high-stability crystal oscillator second pulse, and setting the time-setting state as asynchronous, and if not, directly setting the time-setting state as asynchronous;
s23, judging whether the time setting state is synchronous, generating an alarm, setting the time setting state as asynchronous, judging whether the high-stability crystal oscillator second pulse is overtime if the time setting state is asynchronous, executing the step S01 if the time setting state is not overtime, generating the alarm if the time setting state is overtime, and continuously executing the step S01 to detect whether the external clock source time setting signal second pulse operates.
Specifically, in the step S22, it is determined whether the value of the ordinary crystal oscillator counter is valid, including the following steps:
judging whether the time setting state is a synchronous state or not;
if yes, calculating a high stable crystal oscillator second pulse based on a second interval CDngw (i) =CNgw (i) -CNsyn (i-1) of a common crystal oscillator counter;
if not, calculating the second pulse of the high-stability crystal oscillator based on the second interval CDngw (i) =CNgw (i) -CNgw (i-1) of the common crystal oscillator counter;
whether the second interval CDngw (i) between the last two second pulses is within the maximum allowable value and the minimum allowable value range or not is judged, if so, the method is effective, and if not, the method is ineffective.
Further, in the step S22, the high-stability crystal oscillator second pulse is used to synchronize the normal crystal oscillator second pulse, and the following formula is used to calculate the pulse:
let the value of the crystal oscillator counter at the time of the second normal crystal oscillator second pulse generation be CNloc (i), then the normal crystal oscillator second interval CDnLoc (i) =cngw (i) +cdngw (i) -CNloc (i).
The effects provided in the summary of the invention are merely effects of embodiments, not all effects of the invention, and one of the above technical solutions has the following advantages or beneficial effects:
the electronic equipment time synchronization and time keeping method based on the inter-crystal oscillator second pulse synchronization technology provided by the embodiment of the application uses the common crystal oscillator and the high-stability crystal oscillator to generate the common crystal oscillator second pulse and the high-stability crystal oscillator second pulse, and selects the common crystal oscillator second pulse as the system second pulse. After the system is started, the high-stability crystal oscillator is used for carrying out second pulse synchronization on the common crystal oscillator to compensate second pulse deviation and second interval deviation between the common crystal oscillator and the high-stability crystal oscillator. When an external clock source is connected to the time synchronization signal, the equipment uses the clock synchronization signal to synchronize the common crystal oscillator with the high-stability crystal oscillator second pulse, and the high-stability crystal oscillator is not used for synchronizing the common crystal oscillator second pulse; and when the external clock source is used for synchronizing the clock signals, the equipment continuously uses the high-stability crystal oscillator to perform second pulse synchronization on the common crystal oscillator. The electronic equipment uses an external clock source or a high-stability crystal oscillator to perform second pulse synchronization on the common crystal oscillator, and uses the common crystal oscillator with better mechanical property to provide second pulses for the system, so that the problems of poor frequency accuracy and poor time keeping performance of the common crystal oscillator, and the problems of poor mechanical property and easy breakdown of a clock system of the equipment after the high-stability crystal oscillator is subjected to mechanical impact are solved, the functions of high-precision time synchronization and time keeping are realized, and meanwhile, the reliability of the equipment is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
FIG. 1 is a schematic diagram of a method of an embodiment of the present application when an external clock source clock signal is present;
FIG. 2 is a timing diagram of the method according to the embodiment of the present application when the external clock source is not present;
fig. 3 is a flowchart of an electronic device time synchronization and time keeping method based on the inter-crystal oscillator second pulse synchronization technology according to an embodiment of the present application.
Detailed Description
In order to make the technical solution of the present invention better understood by those skilled in the art, the technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
According to the electronic equipment time synchronization and time keeping method based on the inter-crystal oscillator second pulse synchronization technology, the electronic equipment synchronizes the common crystal oscillator second pulse based on the inter-crystal oscillator second pulse synchronization, uses the common crystal oscillator second pulse as a system second pulse, and uses an external clock source or a high-stability crystal oscillator to synchronize the common crystal oscillator second pulse.
Fig. 1 and fig. 2 respectively show a time synchronization schematic diagram when an external clock source time synchronization signal exists and a time synchronization schematic diagram when an external clock source time synchronization signal does not exist in an electronic device time synchronization and time synchronization method based on a crystal oscillator second pulse synchronization technology provided by the embodiment of the application.
As shown in FIG. 1, when the external clock source time synchronization signal exists, the electronic device uses the external clock source time synchronization signal to synchronize the common crystal oscillator second pulse and the high-stability crystal oscillator second pulse, so that the crystal oscillator second pulse in the device is kept synchronous, and the common crystal oscillator with better mechanical property is used for providing the system second pulse, thereby improving the reliability of the system. As shown in FIG. 2, when the external clock source is not present, the electronic device uses the high-stability crystal oscillator second pulse to synchronize the common crystal oscillator second pulse, so that the stability of the clock system of the device is improved, and the common crystal oscillator with better mechanical performance is used for providing the system second pulse, so that the reliability of the system is improved. After the electronic equipment is clocked by the external clock source, when the external clock source clock signal is disappeared, the high-stability crystal oscillator second pulse is synchronized by the external clock source clock signal, and the equipment is switched to synchronize the common crystal oscillator second pulse by using the high-stability crystal oscillator second pulse, so that high-precision time keeping is realized.
Fig. 3 shows a flowchart of a method for electronic device time synchronization and time keeping based on the inter-crystal oscillator second pulse synchronization technology in this embodiment. Referring to fig. 3, the implementation steps of the present embodiment are as follows:
s01, detecting whether the second pulse of the external clock source time synchronization signal exists,
if so, using an external clock source to synchronize the normal crystal oscillator second pulse and the high-stability crystal oscillator second pulse of the time synchronization signal second pulse electronic device;
if not, the high-stability crystal oscillator second pulse of the electronic equipment is used for synchronizing the common crystal oscillator second pulse;
s02, repeating the step S01.
The method of the embodiment uses a crystal oscillator oscillation counter to represent the time of the second pulse and the size of the second interval inside the device. The counter value is incremented by 1 every crystal oscillation period, and the second interval is counted as Dn assuming that the number of oscillation periods contained per second is Dn. Assuming that the counter value is N when the current pulse per second is generated, the next pulse per second is generated when the counter value is n+dn, and so on.
Based on the above scheme, specifically, in the step S01, the clock signal second pulse synchronization electronic device uses an external clock source to synchronize the normal crystal oscillator second pulse and the high stable crystal oscillator second pulse, and the method includes the following steps:
and S11, judging whether the detected external clock source time synchronization signal second pulse is the first second pulse, if so, recording a common crystal oscillator counter value CNsyn1 and a high stable crystal oscillator counter value GNsyn1 respectively, continuing to execute the step S11, and if not, executing the step S12.
S12, assuming the pulse is the ith second pulse, respectively recording a common crystal oscillator counter value CNsyn (i) and a high stable crystal oscillator counter value GNsyn (i) at the moment; then calculating a second interval CDnsyn (i) =CNsyn (i) -CNsyn (i-1) of the external clock source time-setting signal based on the common crystal oscillator counter, and calculating a second interval GDnsyn (i) =GNsyn (i) -GNsyn (i-1) of the external clock source time-setting signal based on the high-stability crystal oscillator counter;
judging whether the second interval CDnsyn (i) and GDnsyn (i) between the last two second pulses are in the range of the maximum allowable value DnMaxLimit and the minimum allowable value DnMinLimit, if so, setting the time setting state to be synchronous, synchronizing the common crystal oscillator second pulse and the high-stability crystal oscillator second pulse by using the external clock source time setting signal second pulse, and if not, executing the step S01 to detect whether the external clock source time setting signal second pulse has operation;
the synchronization of the clock signal second pulse with the common crystal oscillator second pulse and the high stable crystal oscillator second pulse by using the external clock source can be realized by using the following formula: assuming that the value of the crystal oscillator counter is CNloc (i) when the second pulse of the common crystal oscillator occurs, the second interval CDnLoc (i) =cnsyn (i) +cdnsyn (i) -CNloc (i) of the common crystal oscillator; let the value of the crystal oscillator counter at the time of second pulse generation of the high stable crystal oscillator of this second be GNloc (i), then the high stable crystal oscillator is between second of this second
The interval GDnLoc (i) =gnsyn (i) +gdnsyn (i) -GNloc (i).
Based on the above scheme, in step S01, before the high-stability crystal oscillator second pulse of the electronic device is used to synchronize the normal crystal oscillator second pulse, it is further required to determine whether the external clock source times the time signal second pulse over time, if not, step S01 is executed, and if so, the high-stability crystal oscillator second pulse of the electronic device is used to synchronize the normal crystal oscillator second pulse.
Specifically, the high-stability crystal oscillator second pulse synchronous common crystal oscillator second pulse of the electronic equipment comprises the following steps:
s21, detecting whether high-stability crystal oscillator second pulse exists, if so, executing a step S22, and if not, executing a step S23;
s22, recording a crystal oscillator counter value corresponding to a common crystal oscillator when a second high-stability crystal oscillator second pulse is generated as CNgw (i), judging whether a time synchronization state is a synchronous state or not, if so, calculating a second interval CDngw (i) =CNgw (i) -CNsyn (i-1) of the high-stability crystal oscillator second pulse based on the common crystal oscillator counter, and if not, calculating a second interval CDngw (i) =CNgw (i) -CNgw (i-1) of the high-stability crystal oscillator second pulse based on the common crystal oscillator counter;
setting the time setting state as asynchronous, judging whether a second interval CDngw (i) between the last two second pulses is within a maximum allowable value DnMaxLimit and a minimum allowable value DnMinLimit, and if so, synchronizing the second pulses of the common crystal oscillator by using the second pulses of the high-stability crystal oscillator; the high-stability crystal oscillator second pulse synchronous common crystal oscillator second pulse using the electronic equipment can be realized by the following formula: let the value of the crystal oscillator counter at the time of the second normal crystal oscillator second pulse generation be CNloc (i), then the normal crystal oscillator second interval CDnLoc (i) =cngw (i) +cdngw (i) -CNloc (i).
S23, judging whether the time setting state is synchronous, generating an alarm, setting the time setting state as asynchronous, judging whether the high-stability crystal oscillator second pulse is overtime if the time setting state is asynchronous, executing the step S01 if the time setting state is not overtime, generating the alarm if the time setting state is overtime, and continuously executing the step S01 to detect whether the external clock source time setting signal second pulse operates.
The method of the embodiment uses the second pulse generated by the common crystal oscillator as the second pulse of the system, and adopts the external clock source to synchronize the second pulse of the common crystal oscillator with the time synchronizing signal or the high-stability crystal oscillator second pulse, thereby realizing the functions of high-precision time synchronization and time keeping and improving the reliability of the clock system.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (5)

1. The electronic equipment time synchronization and time keeping method based on the inter-crystal oscillator second pulse synchronization technology is characterized by comprising the following steps of:
s01, detecting whether the second pulse of the external clock source time synchronization signal exists,
if so, using an external clock source to synchronize the normal crystal oscillator second pulse and the high-stability crystal oscillator second pulse of the time synchronization signal second pulse electronic device;
if not, the high-stability crystal oscillator second pulse of the electronic equipment is used for synchronizing the common crystal oscillator second pulse;
s02, repeating the step S01;
in the step S01, the clock signal second pulse synchronization method uses an external clock source to synchronize the normal crystal oscillator second pulse and the high stable crystal oscillator second pulse of the electronic device, and includes the following steps:
s11, judging whether the detected time signal second pulse of the external clock source is the first second pulse, if so, respectively recording a common crystal oscillator counter value and a high stable crystal oscillator counter value, continuously executing the step S11, and if not, executing the step S12;
s12, respectively recording a common crystal oscillator counter value and a high stable crystal oscillator counter value, judging whether the common crystal oscillator counter value and the high stable crystal oscillator counter value are valid, if both are valid, setting a time synchronization state to be synchronous, using an external clock source to synchronize a time signal second pulse with the high stable crystal oscillator second pulse, and if the common crystal oscillator counter value or the high stable crystal oscillator counter value is invalid, executing the step S01 to detect whether the external clock source exists or not;
in the step S01, before the high-stability crystal oscillator second pulse of the electronic device is used to synchronize the common crystal oscillator second pulse, the method further includes the following steps:
s20, judging whether the external clock source time synchronization signal second pulse is overtime, if not, executing the step S01 to detect whether the external clock source time synchronization signal second pulse has operation, and if so, using the high-stability crystal oscillator second pulse of the electronic equipment to synchronize the common crystal oscillator second pulse;
in the step S20, the step of using the high-stability crystal oscillator second pulse of the electronic device to synchronize the common crystal oscillator second pulse includes the following steps:
s21, detecting whether high-stability crystal oscillator second pulse exists, if so, executing a step S22, and if not, executing a step S23;
s22, recording a common crystal oscillator counter value when the high-stability crystal oscillator second pulse is generated, judging whether the common crystal oscillator counter value is valid, if so, synchronizing the common crystal oscillator second pulse by using the high-stability crystal oscillator second pulse, and setting a time synchronization state as asynchronous; if not, directly setting the time setting state as asynchronous;
s23, judging whether the time setting state is synchronous, generating an alarm, setting the time setting state as asynchronous, judging whether the high-stability crystal oscillator second pulse is overtime if the time setting state is asynchronous, if not, executing the step S01 to detect whether the external clock source time setting signal second pulse operates, if so, generating the alarm, and continuously executing the step S01 to detect whether the external clock source time setting signal second pulse operates.
2. The method for time synchronization and time keeping of electronic equipment based on inter-crystal oscillator second pulse synchronization technology according to claim 1, wherein in the step S12, it is determined whether the ordinary crystal oscillator counter value and the high stable crystal oscillator counter value are valid, comprising the following steps:
recording a common crystal oscillator counter value CNsyn (i) and a high stable crystal oscillator counter value GNsyn (i) respectively, wherein i represents an ith second pulse; calculating a second interval CDnsyn (i) =CNsyn (i) -CNsyn (i-1) of the external clock source time-setting signal based on the common crystal oscillator counter, and calculating a second interval GDnsyn (i) =GNsyn (i) -GNsyn (i-1) of the external clock source time-setting signal based on the high-stability crystal oscillator counter;
whether the second intervals CDnsyn (i) and GDnsyn (i) between the last two second pulses are within the maximum allowable value and the minimum allowable value range or not is judged, if yes, the method is effective, and if not, the method is ineffective.
3. The method for electronic equipment time synchronization and time keeping based on inter-crystal oscillator second pulse synchronization technology according to claim 2, wherein in the step S12, the clock signal second pulse synchronization method uses an external clock source to synchronize the normal crystal oscillator second pulse and the high stable crystal oscillator second pulse, and the method is calculated by using the following formula: assuming that the value of the crystal oscillator counter is CNloc (i) when the second pulse of the common crystal oscillator occurs, the second interval CDnLoc (i) =cnsyn (i) +cdnsyn (i) -CNloc (i) of the common crystal oscillator; assuming that the value of the crystal oscillator counter is GNloc (i) when the second high steady crystal oscillator second pulse occurs, the second interval GDnLoc (i) =gnsyn (i) +gdnsyn (i) -GNloc (i) of the high steady crystal oscillator.
4. The method for time synchronization and time keeping of electronic equipment based on inter-crystal oscillator second pulse synchronization technology according to claim 1, wherein in the step S22, it is determined whether the ordinary crystal oscillator counter value is valid, comprising the following steps:
judging whether the time setting state is a synchronous state or not;
if yes, calculating a high stable crystal oscillator second pulse based on a second interval CDngw (i) =CNgw (i) -CNsyn (i-1) of a common crystal oscillator counter;
if not, calculating the second pulse of the high-stability crystal oscillator based on the second interval CDngw (i) =CNgw (i) -CNgw (i-1) of the common crystal oscillator counter;
whether the second interval CDngw (i) between the last two second pulses is within the maximum allowable value and the minimum allowable value range or not is judged, if so, the method is effective, and if not, the method is ineffective.
5. The method for time synchronization and time conservation of electronic equipment based on inter-crystal oscillator second pulse synchronization technology according to claim 4, wherein in the step S22, the high-stability crystal oscillator second pulse is used for synchronizing the common crystal oscillator second pulse, and the following formula is used for calculating:
let the value of the crystal oscillator counter at the time of the second normal crystal oscillator second pulse generation be CNloc (i), then the normal crystal oscillator second interval CDnLoc (i) =cngw (i) +cdngw (i) -CNloc (i).
CN202010674857.7A 2020-07-14 2020-07-14 Electronic equipment time synchronization and time keeping method based on crystal oscillator second pulse synchronization technology Active CN111817714B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010674857.7A CN111817714B (en) 2020-07-14 2020-07-14 Electronic equipment time synchronization and time keeping method based on crystal oscillator second pulse synchronization technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010674857.7A CN111817714B (en) 2020-07-14 2020-07-14 Electronic equipment time synchronization and time keeping method based on crystal oscillator second pulse synchronization technology

Publications (2)

Publication Number Publication Date
CN111817714A CN111817714A (en) 2020-10-23
CN111817714B true CN111817714B (en) 2024-01-26

Family

ID=72842825

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010674857.7A Active CN111817714B (en) 2020-07-14 2020-07-14 Electronic equipment time synchronization and time keeping method based on crystal oscillator second pulse synchronization technology

Country Status (1)

Country Link
CN (1) CN111817714B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008019605A1 (en) * 2006-08-11 2008-02-21 Huawei Technologies Co., Ltd. A method and device for improving satellite time synchronization pulse hold performance
CN108803300A (en) * 2018-05-23 2018-11-13 许继集团有限公司 The punctual method of time synchronism apparatus based on constant-temperature crystal oscillator and time synchronism apparatus
CN108873669A (en) * 2017-05-10 2018-11-23 中国航空工业集团公司西安飞行自动控制研究所 A kind of UTC time calculation method of computer synchronised clock
CN109150351A (en) * 2017-06-27 2019-01-04 许继集团有限公司 A kind of UTC time realization method and system applied to substation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008019605A1 (en) * 2006-08-11 2008-02-21 Huawei Technologies Co., Ltd. A method and device for improving satellite time synchronization pulse hold performance
CN108873669A (en) * 2017-05-10 2018-11-23 中国航空工业集团公司西安飞行自动控制研究所 A kind of UTC time calculation method of computer synchronised clock
CN109150351A (en) * 2017-06-27 2019-01-04 许继集团有限公司 A kind of UTC time realization method and system applied to substation
CN108803300A (en) * 2018-05-23 2018-11-13 许继集团有限公司 The punctual method of time synchronism apparatus based on constant-temperature crystal oscillator and time synchronism apparatus

Also Published As

Publication number Publication date
CN111817714A (en) 2020-10-23

Similar Documents

Publication Publication Date Title
US10615810B2 (en) Integrated circuit comprising circuitry to determine settings for an injection-locked oscillator
EP2337421B1 (en) Method and terminal for obtaining frequency difference
JP2012242190A (en) Reference signal generation device and reference signal generating method
CN111817714B (en) Electronic equipment time synchronization and time keeping method based on crystal oscillator second pulse synchronization technology
JP2002217722A (en) Reference frequency generator
JP2000174615A (en) Method and device for automatically correcting internal clock frequency of integrated circuit
JPH0831847B2 (en) Digital signal relay transmission device
US6304979B1 (en) Logic to enable/disable a clock generator in a secure way
JP2012004914A (en) Timing synchronizing apparatus, and timing synchronizing method
CN115080495B (en) Time synchronization method and system for standard peripheral extension interface equipment
US7281025B2 (en) Triggered DDS pulse generator architecture
EP2333954B1 (en) Clock recovery in a battery powered device
JP2004023560A (en) Oscillating state discrimination circuit and oscillation control circuit
TWI400596B (en) Synchronized receiving circuit and method thereof
JP2000040958A (en) Reference frequency/timing generating device
CN214959452U (en) Atomic clock starting performance evaluation device
JP2000269949A (en) Phase synchronizing controller
TWI779921B (en) Method for correcting 1 pulse per second signal and timing receiver
JP2011182099A (en) Reference signal generation device and method
KR0129144B1 (en) Clock synchronization device
KR200262927Y1 (en) Clock fail detector
KR0146060B1 (en) Clock generator
CN105591632B (en) Real-time clock generation method and device
US7397294B2 (en) Charge pump clock generating circuit and method thereof
CN115202182A (en) Pulse-per-second signal output method, circuit and chip

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