A multi-reference source time synchronization method, system, module and medium
By integrating multiple clock reference sources and cyclically judging their validity, the problem of poor stability of clock reference sources in the existing technology is solved, the stability and reliability of the local clock are improved, and the accuracy of time synchronization is improved.
Patent Information
- Application Number
- CN202211638661.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-12-19
AI Technical Summary
In the time synchronization process of the existing technology, the clock reference source is easily affected by factors such as network quality and satellite position, resulting in errors, and it is difficult to obtain a stable and effective clock reference source.
Adopting a multi-reference source time synchronization method, integrating satellite signals, synchronous network time protocol signals and precision network time protocol signals, cyclically judging the validity of each signal, selecting valid signals as reference sources for time synchronization, and maintaining the local clock during signal switching stability.
Through the validity detection and switching of multiple reference sources, clock drift caused by network instability is avoided, the stability and reliability of the local clock are ensured, and the accuracy of time synchronization is improved.
Smart Images

Figure CN115987477B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of timing technology, and in particular to a multi-reference source time synchronization method, system, module and medium. Background Art
[0002] In various distributed system applications, the events of each node of the system have a sequence. In order for the distributed system to complete redundant detection of the same event, it is necessary to do a good job of time synchronization between the nodes of the system to provide support for tasks such as information perception, synchronous sleep, location services, network security and scheduling, industrial wireless networks, distributed control, and smart grid monitoring. Time synchronization is to maintain a globally consistent reference clock so that the messages, time, and time-related behaviors of each node in the distributed system have a globally consistent explanation. When implementing time synchronization, the prior art usually uses one of the GPS signals, time signals from the precision time network protocol, or frequency signals from the synchronous time network protocol as a clock reference source to tame the local clocks of each node, but the above clock reference source may be affected by factors such as network quality and satellite position in actual application scenarios and produce errors. Therefore, how to obtain a stable and effective clock reference source is an important issue in the time synchronization process. Summary of the invention
[0003] In order to obtain a stable and effective clock reference source, the present invention provides a multi-reference source time synchronization method, which integrates three clock reference source inputs and cyclically determines the validity of the reference sources, so that the clock reference source of the local clock is always stable and effective. The multi-reference source time synchronization method includes the following steps:
[0004] Step 1: obtaining a signal source, wherein the signal source includes a first signal based on a satellite, a second signal based on a synchronous network time protocol, and a third signal based on a precision network time protocol;
[0005] Step 2: Determine the validity of the first signal. If the first signal is valid, use the first signal as a reference source for time synchronization, and return to continue to obtain the signal source;
[0006] If the first signal is invalid, determine the validity of the second signal; if the second signal is valid, use the second signal as a reference source for time synchronization, and return to step 1;
[0007] If the second signal is invalid, determine the validity of the third signal; if the third signal is valid, use the third signal as a reference source for time synchronization, and return to step 1;
[0008] If the third signal is invalid, the process enters the time holding state and returns to step 1.
[0009] The principle of this method is as follows: after obtaining a signal source including a first signal based on a satellite, a second signal based on a synchronous network time protocol, and a third signal based on a precision network time protocol, the validity of each signal in the signal source is judged in turn, and a valid signal is selected as a reference source to synchronize the local clock, and then a new signal source is obtained by returning, and the above judgment is continued. According to the judgment result, a valid signal is selected and the reference source of time synchronization is switched accordingly, so that the reference source of the local clock is always stable and valid.
[0010] Furthermore, the validity of the satellite signal is determined by the number of available satellites and the quality of the available satellites. Therefore, in order to accurately determine the validity of the satellite signal obtained by the satellite signal receiver, the specific method for determining the validity of the first signal is:
[0011] Obtaining first data corresponding to the first signal, the first data including the number of satellites, satellite signal-to-noise ratio, satellite elevation angle, and signal credibility;
[0012] The validity of the first signal is determined according to the first data.
[0013] Furthermore, the second signal based on the synchronous network time protocol is a frequency signal, and the second signal based on the synchronous network time protocol comes from the network and is greatly affected by network fluctuations. Therefore, when judging the validity of the second signal, it is necessary to measure the frequency deviation between the second signal and the local clock, that is, the first clock jitter data corresponding to the second signal, and then judge the validity of the signal based on the measurement result to avoid the signal delay and signal jitter caused by the reading and writing of network messages. Therefore, the specific method for judging the validity of the second signal is:
[0014] measuring first clock jitter data corresponding to the second signal according to the second signal and a local clock;
[0015] Obtaining second data corresponding to the second signal, the second data including an upper-level clock level and an upper-level clock reliability;
[0016] The validity of the second signal is determined according to the second data and the first clock jitter data.
[0017] Further, in order to accurately measure the frequency of the second signal, obtain the first clock jitter data, and record the deviation change rate between the local crystal oscillator and the second signal over time, so as to facilitate the subsequent use of the second signal as a reference source for time synchronization, the specific measurement method of the first clock jitter data is:
[0018] Obtain a first periodic pulse according to the local clock, and obtain a second periodic pulse according to the second signal;
[0019] respectively obtaining rising edges of the first periodic pulse and the second periodic pulse;
[0020] Obtaining a phase deviation between rising edges of the first periodic pulse and the second periodic pulse;
[0021] The first clock jitter data is obtained by calculation according to the phase deviation.
[0022] Furthermore, the third signal based on the precision network time protocol is a timestamp signal, and the third signal based on the precision network time protocol comes from the network and is greatly affected by network fluctuations. Therefore, when judging the validity of the third signal, it is also necessary to measure the frequency deviation between the third signal and the local clock, that is, the second clock jitter data corresponding to the third signal, and then judge the validity of the signal based on the measurement result to avoid the signal delay and signal jitter caused by network message reading and writing. Therefore, the specific method for judging the validity of the third signal is:
[0023] Measuring second clock jitter data corresponding to the third signal according to the third signal and the local clock;
[0024] Obtaining third data corresponding to the third signal, wherein the third data includes a source clock category and a source clock level;
[0025] The validity of the third signal is determined according to the third data and the second clock jitter data.
[0026] Furthermore, since the third signal based on the precision network time protocol is a timestamp signal, the timestamp signal can be converted into a pulse signal, and the deviation between the third signal and the local clock can be obtained by measuring the pulse signal according to the local clock, that is, the second clock jitter data. Therefore, the specific method for measuring the second clock jitter data is:
[0027] Perform frequency multiplication processing on the local clock to obtain a first clock;
[0028] Obtaining two adjacent rising edges of the third signal, and calculating a time interval between the two adjacent rising edges based on the first clock to obtain a first count value;
[0029] The second clock jitter data is obtained by calculating according to the first count value.
[0030] Further, since the third signal based on the precision network time protocol is a timestamp, the processor can obtain the phase difference between the third signal and the local signal according to the timestamp. Therefore, the specific method for measuring the second clock jitter data is:
[0031] Obtaining timestamp information and a local clock corresponding to the third signal;
[0032] Processing the timestamp information to obtain clock information;
[0033] Phase deviation information between the local clock and the clock information is calculated to obtain the second clock jitter data.
[0034] In order to achieve the above object, the present invention provides a multi-reference source time synchronization system, the multi-reference source time synchronization system comprising:
[0035] A signal receiving unit, configured to obtain a signal source, wherein the signal source includes a first signal based on a satellite, a second signal based on a synchronous time network, and a third signal based on a precision time network;
[0036] A signal selection unit, used to determine the validity of the signal source and obtain a reference source;
[0037] A time synchronization unit, configured to perform time synchronization according to the reference source;
[0038] The step of obtaining the reference source by the signal selection unit is specifically as follows:
[0039] determining the validity of the first signal, and if the first signal is valid, using the first signal as the reference source;
[0040] If the first signal is invalid, determining the validity of the second signal, and if the second signal is valid, using the second signal as the reference source;
[0041] If the second signal is invalid, determining the validity of the third signal, and if the third signal is valid, using the third signal as the reference source;
[0042] If the third signal is invalid, the time holding state is entered.
[0043] The principle of this system is as follows: after the signal receiving unit obtains the signal sources including the first signal based on the satellite, the second signal based on the synchronous network time protocol and the third signal based on the precision network time protocol, the signal selection unit judges the validity of each signal in the signal source in turn to obtain the reference source; the time synchronization unit synchronizes the local clock according to the reference source determined by the signal selection unit, so that the reference source of the local clock is always stable and valid.
[0044] In order to achieve the above-mentioned purpose, the present invention provides a multi-reference source time synchronization module, including a crystal oscillator, a control chip, a phase-locked loop chip, a signal receiver, and a program stored in the control chip and runnable on the control chip, the control chip is used to execute the program, and when the control chip executes the program, the steps of any one of the above-mentioned multi-reference source time synchronization methods are implemented.
[0045] In order to achieve the above object, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned multi-reference source time synchronization methods are implemented.
[0046] One or more technical solutions provided by the present invention have at least the following technical effects or advantages: a multi-reference source time synchronization method provided by the present invention integrates three signal input sources, determines the validity of the input signal source based on network messages, satellite data and local measurement circuits, avoids the reference source clock drift caused by network instability, realizes the detection of the validity of multiple signal sources, maintains smooth switching of the local clock under different signal sources as reference sources, obtains a stable and effective clock reference source, and improves the reliability of time synchronization. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of the present invention, and do not constitute a limitation on the embodiments of the present invention;
[0048] Figure 1 It is a schematic diagram of the flow chart of the multi-reference source time synchronization method in the present invention;
[0049] Figure 2 It is a schematic diagram of the framework of the multi-reference source time synchronization system in the present invention;
[0050] Figure 3 It is a schematic diagram of the structure of the multi-reference source time synchronization module in the present invention. DETAILED DESCRIPTION
[0051] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those within the scope of this description. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0053] Embodiment 1
[0054] Please refer to Figure 1 Embodiment 1 of the present invention provides a multi-reference source time synchronization method, and the multi-reference source time synchronization method includes the following steps:
[0055] Step 1: obtaining a signal source, wherein the signal source includes a first signal based on a satellite, a second signal based on a synchronous network time protocol, and a third signal based on a precision network time protocol;
[0056] Step 2: Determine the validity of the first signal. If the first signal is valid, use the first signal as a reference source for time synchronization, and return to continue to obtain the signal source;
[0057] If the first signal is invalid, determine the validity of the second signal; if the second signal is valid, use the second signal as a reference source for time synchronization, and return to step 1;
[0058] If the second signal is invalid, determine the validity of the third signal; if the third signal is valid, use the third signal as a reference source for time synchronization, and return to step 1;
[0059] If the third signal is invalid, the process enters the time holding state and returns to step 1.
[0060] Among them, the first signal based on the satellite is a second pulse signal and a TOD signal (Time of Day); Synchronous Ethernet technology is a technology that recovers the upstream clock frequency by extracting the physical clock signal of the physical link layer. Its advantages are stable clock recovery performance and high reliability, but it requires the support of physical hardware. The second signal based on the synchronous network time protocol is a SyncE (Synchronous Ethernet) frequency signal with an output of 25MHz or 125MHz; PTP (Precision Time Synchronization Protocol) technology is a packet recovery clock method that obtains time information through network messages to complete the recovery of clock frequency and phase, but is greatly affected by network fluctuations. The third signal based on the precision network time protocol is a timestamp signal based on the PTP message. Since the accuracy of the first signal is better than that of the second signal and the third signal, and the efficiency of time synchronization based on the second signal is higher than that of time synchronization based on the third signal, the validity of the first signal, the second signal and the third signal are judged in turn in step 2 to obtain a reference source.
[0061] Among them, the time synchronization is to compensate the local clock generated by the local crystal oscillator according to the time information or frequency information corresponding to the reference source, so as to tame the local clock generated by the crystal oscillator and realize time synchronization. The specific compensation method and compensation size are determined according to the relationship between the reference source and the local clock during actual use, and this embodiment does not make specific limitations here.
[0062] Among them, the time keeping state is to keep the original compensation value of the local clock unchanged without a reference source, so as to keep the local clock stable. The original compensation value of the local clock is determined according to actual needs, and this embodiment does not make any specific limitations here.
[0063] Specifically, after the step 2 obtains a valid reference source or enters the time holding state, return to execute step 1, continue to obtain the signal source, and re-judge the validity of the first signal, the second signal and the third signal in the signal source in turn, and update the reference source according to the judgment result, and synchronize the local clock according to the updated reference source.
[0064] Among them, the factors affecting the satellite signal generally include the satellite signal strength and the satellite signal transmission quality. In the process of receiving the satellite signal, the more satellites that can transmit information and the greater the signal-to-noise ratio of the satellite signal, the better the satellite signal strength obtained; for the satellite that can transmit information, the greater the elevation angle between the signal receiver and the satellite and the greater the satellite signal credibility, the better the satellite signal transmission quality. Therefore, in this embodiment, the specific method for determining the validity of the first signal is:
[0065] Obtaining first data corresponding to the first signal, the first data including the number of satellites, satellite signal-to-noise ratio, satellite elevation angle, and signal credibility;
[0066] The validity of the first signal is determined according to the first data.
[0067] Among them, in order to obtain reliable satellite signals, this embodiment preferably has the satellite elevation angle greater than 15 degrees, the satellite signal-to-noise ratio greater than 30 dB, and the number of satellites greater than 4; the signal credibility is determined according to the precision factor corresponding to the satellite, and the precision factor includes the horizontal position precision factor and the elevation precision factor. In this embodiment, the horizontal position precision factor is preferably less than 2, and the elevation precision factor is less than 3. The specific standards of the number of satellites, satellite signal-to-noise ratio, satellite elevation angle and signal credibility can also be adjusted according to the specific requirements of the system for time accuracy during actual use. When the number of satellites, satellite signal-to-noise ratio, satellite elevation angle and signal credibility in the first data all meet the requirements, the first signal is considered valid.
[0068] In this embodiment, the specific method for determining the validity of the second signal is:
[0069] measuring first clock jitter data corresponding to the second signal according to the second signal and a local clock;
[0070] Obtaining second data corresponding to the second signal, the second data including an upper-level clock level and an upper-level clock reliability;
[0071] The validity of the second signal is determined according to the second data and the first clock jitter data.
[0072] Among them, since the second signal is a SyncE frequency signal based on the synchronous network time protocol, the upper-level clock level and the upper-level clock reliability are obtained according to the signal broadcast by the upper-level network, and the specific standard is determined according to actual needs, and this embodiment does not make specific limitations here; the first clock jitter data is the deviation between the local clock and the second signal. Since the phase deviation of the local clock will not exceed 1ns within one second, when the second signal is unstable, the deviation between the local clock and the second signal is also unstable. Therefore, it is possible to judge whether the second signal is valid based on the change of the first clock jitter data over a period of time. It is preferred to monitor the first clock jitter data for 30 consecutive seconds. If the first clock jitter data is greater than 50ns and the variance is greater than 30, it is considered that the second signal obtained in this time period is invalid and cannot be used as a reference source; when the second data and the first clock jitter data both meet the standards, the second signal is considered valid.
[0073] In this embodiment, the specific method for measuring the first clock jitter data is:
[0074] Obtain a first periodic pulse according to the local clock, and obtain a second periodic pulse according to the second signal;
[0075] In order to facilitate the comparison between the first periodic pulse and the second periodic pulse, the frequency of the first periodic pulse is the same as the frequency of the second periodic pulse. The specific frequency is determined according to actual needs and is not specifically limited in this embodiment.
[0076] respectively obtaining rising edges of the first periodic pulse and the second periodic pulse;
[0077] Obtaining a phase deviation between rising edges of the first periodic pulse and the second periodic pulse;
[0078] Specifically, the phase deviation between the first periodic pulse and the second periodic pulse within a period of time is:
[0079]
[0080] Wherein, Δφ represents the phase deviation value between the first periodic pulse and the second periodic pulse in a time period of duration t, Indicates the first cycle pulse frequency f in the time period t a The integral of The second cycle pulse frequency f in the time period t b 's points.
[0081] The first clock jitter data is obtained by calculation according to the phase deviation.
[0082] Specifically, when the second signal is valid, the second signal is used as a reference source to synchronize the local clock, i.e., compensate the local clock, so that the phase deviation value Δφ measured in the above step approaches 0. It can be understood that this method achieves the taming of the local clock by achieving frequency synchronization between the first periodic pulse and the second periodic pulse, and does not require processing of the clock phase, so the time synchronization process can be completed faster.
[0083] In this embodiment, the specific method for determining whether the third signal is valid is:
[0084] Measuring second clock jitter data corresponding to the third signal according to the third signal and the local clock;
[0085] Obtaining third data corresponding to the third signal, wherein the third data includes a source clock category and a source clock level;
[0086] The validity of the third signal is determined according to the third data and the second clock jitter data.
[0087] Among them, since the third signal is a timestamp signal based on the precision network time protocol, the source clock category and the source clock level are in accordance with the provisions of the precision network time protocol, and this embodiment does not make specific limitations here; the second clock jitter data is the deviation between the local clock and the third signal. Since the phase deviation of the local clock will not exceed 1ns within one second, when the third signal is unstable, the deviation between the local clock and the third signal is also unstable. The validity of the third signal can be judged according to the change of the second clock jitter data over a period of time. Preferably, the second clock jitter data is monitored for 30 consecutive seconds. If the second clock jitter data is greater than 50ns and the variance is greater than 30, it is considered that the network is unstable during the time period. At this time, the third signal obtained from the network message cannot be used as a reference source; when the third data and the second clock jitter data both meet the standards, the third signal is considered valid.
[0088] In this embodiment, the second clock jitter data measurement is implemented by the following method:
[0089] Obtaining timestamp information and a local clock corresponding to the third signal;
[0090] Processing the timestamp information to obtain clock information;
[0091] Phase deviation information between the local clock and the clock information is calculated to obtain the second clock jitter data.
[0092] The timestamp information is the total number of seconds from January 1, 1970 to the current time of Greenwich Mean Time, which can be converted into clock information through calculation. The calculation process is determined according to actual needs and is not specifically limited in this embodiment.
[0093] In this embodiment, the second clock jitter data measurement can also be implemented by the following method:
[0094] Perform frequency multiplication processing on the local clock to obtain a first clock;
[0095] Obtaining two adjacent rising edges of the third signal, and calculating a time interval between the two adjacent rising edges based on the first clock to obtain a first count value;
[0096] The second clock jitter data is obtained by calculating according to the first count value.
[0097] After obtaining two adjacent rising edges of the third signal, since the third signal is known and the phase deviation of the local clock will not exceed 1 ns within one second, the second clock jitter data corresponding to the third signal can be measured according to the local clock.
[0098] The specific multiple of the frequency multiplication of the local clock is determined according to actual needs, and is not specifically limited in this embodiment.
[0099] Specifically, the local clock is multiplied to obtain a first clock. After obtaining the rising edge of the third signal, the third signal is counted based on the first clock until an adjacent rising edge of the third signal is obtained. Finally, calculation is performed based on the counting result and the first clock to obtain the measured frequency of the third signal. The second time jitter data is the difference between the measured frequency and the third signal.
[0100] Embodiment 2
[0101] Please refer to Figure 2 Embodiment 1 of the present invention provides a multi-reference source time synchronization system, the multi-reference source time synchronization system comprising:
[0102] A signal receiving unit, configured to obtain a signal source, wherein the signal source includes a first signal based on a satellite, a second signal based on a synchronous time network, and a third signal based on a precision time network;
[0103] A signal selection unit, used to determine the validity of the signal source and obtain a reference source;
[0104] A time synchronization unit, configured to perform time synchronization according to the reference source;
[0105] The step of obtaining the reference source by the signal selection unit is specifically as follows:
[0106] determining the validity of the first signal, and if the first signal is valid, using the first signal as the reference source;
[0107] If the first signal is invalid, determining the validity of the second signal, and if the second signal is valid, using the second signal as the reference source;
[0108] If the second signal is invalid, determining the validity of the third signal, and if the third signal is valid, using the third signal as the reference source;
[0109] If the third signal is invalid, the time holding state is entered.
[0110] Among them, the first satellite-based signal is a second pulse signal and a TOD signal (Time of Day); the second signal based on the synchronous network time protocol is a SyncE (Synchronous Ethernet) frequency signal with an output of 25MHz or 125MHz; the third signal based on the precision network time protocol is a timestamp. Since the accuracy of the first signal is better than that of the second signal and the third signal, and the efficiency of time synchronization based on the second signal is higher than that based on the third signal, the signal selection unit judges the validity of the first signal, the second signal and the third signal in turn to obtain a reference source.
[0111] Embodiment 3
[0112] Please refer to Figure 1-3 Embodiment 3 of the present invention provides a multi-reference source time synchronization module, including a crystal oscillator, a control chip, a phase-locked loop chip, a signal receiver, a delay measurement chip, and a program stored in and runnable on the control chip, wherein the control chip is used to execute the program, and when the control chip executes the program, the steps of the multi-reference source time synchronization method described in Embodiment 1 are implemented.
[0113] Among them, the crystal oscillator can be a temperature compensated crystal oscillator, a voltage-controlled crystal oscillator or a constant-temperature crystal oscillator. In order to reduce the impact of ambient temperature changes on the output frequency of the crystal oscillator and obtain a stable local clock, this embodiment preferably uses a constant-temperature crystal oscillator.
[0114] The control chip may be a programmable logic device such as an FPGA or a single-chip microcomputer. The type of the control chip is determined according to actual needs and is not specifically limited in this embodiment.
[0115] The signal receiver is used to receive satellite signals. The signal receiver may be a multi-channel receiver, a sequential channel receiver or a multi-channel receiver. The type of the signal receiver is determined according to actual needs and is not specifically limited in this embodiment.
[0116] For details, please refer to Figure 3 , the GPS / BDS receiver module obtains the first signal based on the satellite and sends it to the control chip, the phase-locked loop chip obtains the second signal based on the synchronous network time protocol and sends it to the control chip, the control chip obtains the third signal based on the precision network time protocol and the local clock generated by the crystal oscillator; after the control chip measures the deviation between the signal source and the local clock through the delay measurement chip, it judges the validity of the first signal, the second signal and the third signal in turn, determines the reference source, and compensates the local clock according to the reference source to complete time synchronization, and finally obtains the local 1PPS output and the local TOD output; at the same time, the phase-locked loop chip divides or multiplies the tamed local clock to obtain the corresponding clock output as needed.
[0117] Embodiment 4
[0118] Embodiment 4 of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the multi-reference source time synchronization method are implemented.
[0119] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors, application-specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0120] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the multi-reference source time synchronization module in the invention by running or executing the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0121] If the multi-reference source time synchronization module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be stored in a computer-readable storage medium through a computer program. When the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, point carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0122] The present invention has described the basic concepts. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are suggested in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.
[0123] At the same time, this specification uses specific words to describe the embodiments of this specification. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of this specification. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures or characteristics in one or more embodiments of this specification can be appropriately combined.
[0124] In addition, it will be understood by those skilled in the art that various aspects of this specification may be illustrated and described by a number of patentable categories or situations, including any new and useful process, machine, product or combination of substances, or any new and useful improvements thereto. Accordingly, various aspects of this specification may be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data blocks", "modules", "engines", "units", "components" or "systems". In addition, various aspects of this specification may be represented as a computer product located in one or more computer-readable media, which includes computer-readable program code.
[0125] A computer storage medium may include a propagated data signal containing computer program code, for example, in baseband or as part of a carrier wave. The propagated signal may be in a variety of forms, including electromagnetic, optical, etc., or a suitable combination. A computer storage medium may be any computer-readable medium other than a computer-readable storage medium, which can be connected to an instruction execution system, device or apparatus to communicate, propagate or transmit the program for use. The program code on the computer storage medium may be transmitted via any suitable medium, including radio, cable, fiber optic cable, RF, or similar media, or any combination of the above media.
[0126] The computer program code required for the operation of each part of this specification can be written in any one or more programming languages, including object-oriented programming languages such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB.NET, Python, etc., conventional procedural programming languages such as C language, Visual Basic, Fortran 2003, Perl, COBOL 2002, PHP, ABAP, dynamic programming languages such as Python, Ruby and Groovy, or other programming languages. The program code can be run entirely on the user's computer, or run on the user's computer as an independent software package, or run partially on the user's computer and partially on a remote computer, or run entirely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer through any network form, such as a local area network (LAN) or a wide area network (WAN), or connected to an external computer (e.g., via the Internet), or in a cloud computing environment, or used as a service such as software as a service (SaaS).
[0127] In addition, unless explicitly stated in the claims, the order of the processing elements and sequences described in this specification, the use of alphanumeric characters, or the use of other names are not intended to limit the order of the processes and methods of this specification. Although the above disclosure discusses some invention embodiments that are currently considered useful through various examples, it should be understood that such details are only for illustrative purposes, and the attached claims are not limited to the disclosed embodiments. On the contrary, the claims are intended to cover all modifications and equivalent combinations that are consistent with the essence and scope of the embodiments of this specification. For example, although the system components described above can be implemented by hardware devices, they can also be implemented only by software solutions, such as installing the described system on an existing server or mobile device.
[0128] Similarly, it should be noted that in order to simplify the description disclosed in this specification and thus help understand one or more embodiments of the invention, in the above description of the embodiments of this specification, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the subject matter of this specification are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.
[0129] Each patent, patent application, patent application publication, and other materials, such as articles, books, specifications, publications, documents, etc., cited in this specification are hereby incorporated by reference in their entirety. Except for application history documents that are inconsistent with or conflicting with the contents of this specification, documents that limit the broadest scope of the claims of this specification (currently or later attached to this specification) are also excluded. It should be noted that if the descriptions, definitions, and / or use of terms in the materials attached to this specification are inconsistent or conflicting with the contents described in this specification, the descriptions, definitions, and / or use of terms in this specification shall prevail.
[0130] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0131] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A multi-reference source time synchronization method, characterized in that: The multi-reference source time synchronization method comprises the following steps: Step 1: obtaining a signal source, wherein the signal source includes a first signal based on a satellite, a second signal based on a synchronous network time protocol, and a third signal based on a precision network time protocol; Step 2: Determine the validity of the first signal. If the first signal is valid, use the first signal as a reference source for time synchronization, and return to continue to obtain the signal source; If the first signal is invalid, determine the validity of the second signal; if the second signal is valid, use the second signal as a reference source for time synchronization, and return to step 1; If the second signal is invalid, determine the validity of the third signal; if the third signal is valid, use the third signal as a reference source for time synchronization, and return to step 1; If the third signal is invalid, the time holding state is entered and the execution returns to step 1; The specific method for determining the validity of the first signal is: Obtaining first data corresponding to the first signal, the first data including the number of satellites, satellite signal-to-noise ratio, satellite elevation angle, and signal credibility; determining the validity of the first signal according to the first data; The specific method for determining the validity of the second signal is: measuring first clock jitter data corresponding to the second signal according to the second signal and a local clock; Obtaining second data corresponding to the second signal, the second data including an upper-level clock level and an upper-level clock reliability; determining the validity of the second signal according to the second data and the first clock jitter data; The specific method for determining whether the third signal is valid is: Measuring second clock jitter data corresponding to the third signal according to the third signal and the local clock; Obtaining third data corresponding to the third signal, wherein the third data includes a source clock category and a source clock level; The validity of the third signal is determined according to the third data and the second clock jitter data.
2. A multi-reference source time synchronization method according to claim 1, characterized in that: The specific measurement method of the first clock jitter data is: Obtain a first periodic pulse according to the local clock, and obtain a second periodic pulse according to the second signal; respectively obtaining rising edges of the first periodic pulse and the second periodic pulse; Obtaining a phase deviation between rising edges of the first periodic pulse and the second periodic pulse; The first clock jitter data is obtained by calculation according to the phase deviation.
3. A multi-reference source time synchronization method according to claim 1, characterized in that: The specific method for measuring the second clock jitter data is: Perform frequency multiplication processing on the local clock to obtain a first clock; Obtaining two adjacent rising edges of the third signal, and calculating a time interval between the two adjacent rising edges based on the first clock to obtain a first count value; The second clock jitter data is obtained by calculating according to the first count value.
4. A multi-reference source time synchronization method according to claim 1, characterized in that: The specific method for measuring the second clock jitter data is: Obtaining timestamp information and a local clock corresponding to the third signal; Processing the timestamp information to obtain clock information; Phase deviation information between the local clock and the clock information is calculated to obtain the second clock jitter data.
5. A multi-reference source time synchronization system, characterized in that: The multi-reference source time synchronization system comprises: A signal receiving unit, configured to obtain a signal source, wherein the signal source includes a first signal based on a satellite, a second signal based on a synchronous time network, and a third signal based on a precision time network; A signal selection unit, used to determine the validity of the signal source and obtain a reference source; A time synchronization unit, configured to perform time synchronization according to the reference source; The step of obtaining the reference source by the signal selection unit is specifically as follows: determining the validity of the first signal, and if the first signal is valid, using the first signal as the reference source; If the first signal is invalid, determining the validity of the second signal, and if the second signal is valid, using the second signal as the reference source; If the second signal is invalid, determining the validity of the third signal, and if the third signal is valid, using the third signal as the reference source; If the third signal is invalid, entering the time holding state; The specific method for determining the validity of the first signal is: Obtaining first data corresponding to the first signal, the first data including the number of satellites, satellite signal-to-noise ratio, satellite elevation angle, and signal credibility; determining the validity of the first signal according to the first data; The specific method for determining the validity of the second signal is: measuring first clock jitter data corresponding to the second signal according to the second signal and a local clock; Obtaining second data corresponding to the second signal, the second data including an upper-level clock level and an upper-level clock reliability; determining the validity of the second signal according to the second data and the first clock jitter data; The specific method for determining whether the third signal is valid is: Measuring second clock jitter data corresponding to the third signal according to the third signal and the local clock; Obtaining third data corresponding to the third signal, wherein the third data includes a source clock category and a source clock level; The validity of the third signal is determined according to the third data and the second clock jitter data.
6. A multi-reference source time synchronization module, comprising a crystal oscillator, a control chip, a phase-locked loop chip, a signal receiver, a delay measurement chip, and a program stored in and executable on the control chip, characterized in that: The control chip is used to execute the program, and when the control chip executes the program, the steps of the multi-reference source time synchronization method as described in any one of claims 1-4 are implemented.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the multi-reference source time synchronization method as claimed in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Multi-source dynamic self-adaptation clock synchronization method and device
CN103823361A
Time synchronizing high-reliability source selecting method
CN104125031A
Clock reference seamless switching method and device
CN106656392A
System and method of synchronizing clocks of servers based on PTP protocol
CN107947887A
Multi-reference source time synchronization method and device
CN109687868A
