Method for smoothly switching clock input source, electronic device and storage medium
By detecting and switching the clock input source of the 5G RU device, and adjusting the OCXO input source using the OCXO dynamic compensation module, the time synchronization jitter problem during GPS interruption was solved, and high-precision time synchronization switching was achieved.
Patent Information
- Application Number
- CN202410925690.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2026-01-13
AI Technical Summary
In 5G RU devices, how can we automatically and smoothly switch between GPS and PTP input sources when the GPS input source is interrupted or its quality is degraded, while ensuring minimal time synchronization jitter?
The PTP input source pulse signal is detected by the multi-input source stability detection module and the input source adaptive stability detection module. When an abnormality occurs, the PTP input source is automatically switched to the OCXO input source. The OCXO dynamic compensation module adjusts the OCXO input source according to the PTP timestamp to maintain synchronization.
This reduces time synchronization jitter during clock input source switching, improving the accuracy and stability of time synchronization.
Smart Images

Figure CN121333464A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to time synchronization methods, and more particularly to a method, electronic device, and storage medium for smoothly switching clock input sources. Background Technology
[0002] Figure 1 This is a schematic diagram of the time synchronization system for a 5G Radio Unit (RU). The 5G RU time synchronization system 100 includes a baseband unit 110 and a 5G RU 130. The baseband unit (BBU) 110 includes a Global Positioning System (GPS) antenna 111, an Oven-Controlled Crystal Oscillator (OCXO) module 112, and a Precision Time Protocol (PTP) module 113. The 5G RU 130 includes a BBU 150, a GPS antenna 151, an OCXO module 152, a PTP module 153, and a time synchronization module 154. PPT 113 and PPT 153 are connected via a communication medium 120 (e.g., fiber optic cable or RJ45 cable).
[0003] To ensure the stability, security, and accuracy of 5G RU synchronization performance, 5G RU devices typically support multiple clock synchronization sources (also known as clock input sources), such as GPS, PTP, Synchronous Ethernet (SyncE), and OCXO. GPS input sources are used in open outdoor areas, while PTP input sources are used in indoor scenarios where GPS antennas are difficult to deploy. When neither GPS nor PTP input sources are available, OCXO input sources are used.
[0004] However, it is important to consider how 5G RU devices can automatically switch between GPS and PTP input sources when GPS satellite signal reception is interrupted or degraded, and how to ensure minimal time synchronization jitter during the switching process. Summary of the Invention
[0005] In view of the above, it is necessary to provide a method, electronic device, and storage medium for smoothly switching clock input sources, which can automatically detect whether the pulse signal (e.g., pulse per second, 1PPS) of the clock input source is abnormal, and automatically switch to other normal clock input sources when an abnormality occurs.
[0006] This invention provides a method for smoothly switching clock input sources, applied in an electronic device, comprising: selecting a Precision Time Protocol (PTP) input source for time synchronization according to an initial configuration; determining whether the pulse signal of the PTP input source is normal within a time period T; if the pulse signal of the PTP input source is normal within the time period T, locking the PTP input source; and dynamically adjusting the Oven Controlled Crystal Oscillator (OCXO) input source for calibration according to the PTP timestamp of the PTP input source, so that the pulse signal of the OCXO input source follows the pulse signal of the PTP input source.
[0007] This invention also provides an electronic device, including a multi-input source stability detection module, an input source adaptive stability detection module, an input source switching module, and an OCXO dynamic compensation module, wherein: the input source switching module selects a PTP input source for time synchronization according to an initial configuration; the multi-input source stability detection module determines whether the pulse signal of the PTP input source is normal within a time period T; if the 1PPS signal of the PTP input source is normal within a time period T, the input source switching module locks the PTP input source; the OCXO dynamic compensation module dynamically adjusts the OCXO input source for calibration according to the PTP timestamp of the PTP input source, so that the pulse signal of the OCXO input source follows the pulse signal of the PTP input source.
[0008] This invention also provides a storage medium storing a computer program that, when executed, implements the steps of the method for smoothly switching clock input sources as described above.
[0009] The method, electronic device, and storage medium for smoothly switching clock input sources in this invention adjust the OCXO using the timestamp of the master clock source, so that its output 1PPS signal follows the master clock input 1PPS signal. Therefore, when the master clock input source temporarily disappears, the switch to the OCXO can be performed relatively smoothly, improving the accuracy of time synchronization and reducing time synchronization jitter. Attached Figure Description
[0010] Figure 1This is a schematic diagram of the time synchronization system for a 5G Radio Unit (RU).
[0011] Figure 2 This is a functional block diagram of an electronic device according to an embodiment of the present invention.
[0012] Figure 3 This is a flowchart of the steps of a method for smoothly switching clock input sources according to an embodiment of the present invention.
[0013] Figure 4 This is a schematic diagram of the hardware architecture of the electronic device according to an embodiment of the present invention.
[0014] Explanation of main component symbols
[0015]
[0016]
[0017] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation
[0018] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0019] Numerous specific details are set forth in the following description to provide a thorough understanding of the invention. The described embodiments are merely some, not all, of the embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0021] It should be noted that the descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of the stated features. Furthermore, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0022] Figure 2 This is a functional block diagram of an electronic device according to an embodiment of the present invention. The device 200 for smoothly switching clock input sources according to an embodiment of the present invention, such as a 5G RU device, includes a multi-input source stability detection module 210, an input source adaptive stability detection module 220, an input source switching module 230, and an OCXO dynamic compensation module 240.
[0023] The multi-input source stability detection module 210 is suitable for situations where all system main clock input sources exist. It compares each clock input source pairwise and calculates the pulse-per-second (1PPS) rise-edge time error (TE) to determine the stability of the clock input source. The system's main clock input sources are GPS and PTP, and the backup clock input source is an OCXO.
[0024] The multi-input source stability detection module 210 detects the 1PPS input signal pointer of the master clock input source at any given time, and calculates the error ΔTE between the current clock input source and other clock input sources within time T. For example, the deviation range of ΔTE is ±100ns. Taking the currently selected PTP input source as an example, the errors of the 1PPS rise time between the PTP input source and the OCXO input source and the GPS input source are calculated separately, as shown below:
[0025] 1PPS rise time error between PTP and OCXO: △TE PO =TE PTP -TE OCXO ;as well as
[0026] 1PPS rise time error between PTP and GPS: △TE PG =TE PTP -TE GPS .
[0027] If △TE PO and △TE PG If all values are within the error range, it indicates that the PTP input source is normal.
[0028] If △TE PO and △TE PG If at least one is outside the error range, the input source adaptive stability detection module 220 is used to determine whether the clock input source is normal.
[0029] The input source adaptive stability detection module 220 is suitable for situations where the master clock input source is lost or recovered. It continuously detects the input signal pointer at 1PPS intervals and calculates the mean u and variance σ of the rise time errors of N groups of 1PPS signals within time T. If the mean u and the error of each group of 1PPS signals are within a preset range (e.g., ±100ns), and the variance σ is also within a preset range (e.g., 0≤σ≤σ), then the input source stability detection module is suitable for situations where the master clock input source is lost or recovered. max If the PTP input source is stable, then it is stable; otherwise, it indicates that the PTP input source is malfunctioning. max It is obtained by computer dynamic programming or exhaustive algorithm. It should be noted that the calculation method of the mean u and variance σ of the 1PPS rise time error is common knowledge to those skilled in the art and will not be elaborated in this article.
[0030] When the input source switching module 230 detects an abnormality in one of the 1PPS signals of the master clock input source, it automatically switches to the other master clock input source. If both master clock input sources have abnormal 1PPS signals, it switches to the OCXO, which maintains timing synchronization.
[0031] The OCXO dynamic compensation module 240 dynamically adjusts the OCXO input source using the master clock timestamp when at least one of the 1PPS signals from the master clock input source is normal, so that the 1PPS signal output by the OCXO input source follows the 1PPS signal input by the master clock input source. It should be noted that the OCXO dynamic compensation method is common knowledge to those skilled in the art and will not be elaborated upon here.
[0032] In this embodiment of the invention, the main clock input sources of the smooth switching clock input source device 200 are all in the same time reference frame. The multi-input source stability detection module 210 and the input source adaptive stability detection module 220 continuously detect whether the 1PPS signal of the main clock input source is normal. If at least one main clock input source 1PPS signal is normal, the input source switching module 230 locks the normal input source, and the OCXO is dynamically compensated using the main clock timestamp; otherwise, the input source switching module 230 locks the OCXO, and the input source adaptive stability detection module 220 continues to detect whether the main clock input source has recovered. If at least one main clock input source 1PPS signal recovers and stabilizes within a certain period of time, the input source switching module 230 locks this main clock input source, and the OCXO is continuously dynamically compensated using this main clock timestamp.
[0033] Figure 3This is a flowchart illustrating the steps of a method for smoothly switching clock input sources according to an embodiment of the present invention, applied in an electronic device, specifically a 5G radio unit. The order of the steps in the flowchart can be changed, and some steps can be omitted, depending on different requirements.
[0034] Step S31: After the system starts, the input source switching module 230 selects the PTP input source for time synchronization according to the initial configuration and enters the synchronization adjustment stage.
[0035] Step S32, the multi-input source stability detection module 210 determines whether the 1PPS signal of the PTP input source is normal within time T.
[0036] Step S33: If the 1PPS signal of the PTP input source is normal within time T, the input source switching module 230 locks the PTP input source.
[0037] In step S34, the OCXO dynamic compensation module 240 dynamically adjusts the OCXO input source for calibration based on the PTP timestamp of the PTP input source, so that the 1PPS signal of the OCXO input source follows the 1PPS signal of the PTP input source.
[0038] Step S35: If the 1PPS signal of the PTP input source is abnormal within time T, the input source adaptive stability detection module 220 determines whether the 1PPS signal of the GPS input source is normal within time T.
[0039] Step S36: If the 1PPS signal of the GPS input source is normal within time T, the input source switching module 230 locks the GPS input source.
[0040] In step S37, the OCXO dynamic compensation module 240 dynamically adjusts the OCXO input source according to the GPS timestamp of the GPS input source for calibration, so that the 1PPS signal of the OCXO input source follows the 1PPS signal of the GPS input source.
[0041] Step S38: If the 1PPS signal of the GPS input source is abnormal within time T, the input source switching module 230 locks the OCXO input source, and the multi-input source stability detection module 210 and the input source adaptive stability detection module 220 constantly detect whether the 1PPS signals of the PTP input source and the GPS input source have recovered.
[0042] Figure 4 This is a schematic diagram of the hardware architecture of an electronic device according to an embodiment of the present invention. The electronic device 300, for example, but not limited to, a 5G radio unit, can be interconnected via a system bus with a processor 310, memory 320, and a system 330 that smoothly switches clock input sources. Figure 4Only an electronic device 300 with components 310-330 is shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0043] The memory 320 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 320 may be an internal storage unit of the electronic device 300, such as the hard disk or memory of the electronic device 300. In other embodiments, the memory may also be an external storage device of the electronic device 300, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 300. Of course, the memory 320 may also include both internal storage units and external storage devices of the electronic device 300. In this embodiment, the memory 320 is typically used to store the operating system and various application software installed on the electronic device 300, such as the program code of the system 330 for smoothly switching clock input sources. Furthermore, the memory 320 can also be used to temporarily store various types of data that have been output or will be output.
[0044] In some embodiments, the processor 310 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 310 is typically used to control the overall operation of the electronic device 300. In this embodiment, the processor 310 is used to run program code stored in the memory 320 or process data, for example, to run the system 330 with the smoothly switching clock input source.
[0045] It should be noted that, Figure 4 The electronic device 300 is only illustrated by way of example. In other embodiments, the electronic device 300 may also include more or fewer components, or have different component configurations.
[0046] If the modules / units integrated in the electronic device 300 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, disks, optical discs, computer memory, read-only memory, random access memory, electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0047] Figure 2 Device 200 for smooth switching of clock input sources and Figure 4 The electronic device 300 is used to execute a method for smoothly switching clock input sources. The method for smoothly switching clock input sources according to embodiments of the present invention can be implemented by a computer program stored in a storage medium, such as memory 320 in the electronic device 300. When a computer program implementing the method of the present invention is loaded into memory 320 by processor 310, it drives processor 310 of the electronic device 300 to execute the method for smoothly switching clock input sources according to embodiments of the present invention.
[0048] It is understood that the module division described above is merely a logical functional division, and other division methods may be used in actual implementation. Furthermore, the functional modules in the various embodiments of this application can be integrated into the same processing unit, or each module can exist physically separately, or two or more modules can be integrated into the same unit. The integrated modules described above can be implemented in hardware or in a combination of hardware and software functional modules.
[0049] For those skilled in the art, other corresponding changes or adjustments can be made to the technical solutions and concepts provided in the embodiments of the present invention in combination with actual needs, and all such changes and adjustments should fall within the protection scope of the claims of the present invention.
Claims
1. A method for smoothly switching clock input sources, applied in an electronic device, characterized in that, The method includes: Select a Precision Time Protocol (PTP) input source for time synchronization based on the initial configuration; Determine whether the pulse signal of the PTP input source is normal within time T; If the pulse signal of the PTP input source is normal during the time period T, lock the PTP input source; and The Oven Controlled Crystal Oscillator (OCXO) input source is dynamically adjusted and calibrated according to the PTP timestamp of the PTP input source, so that the pulse signal of the OCXO input source follows the pulse signal of the PTP input source.
2. The method for smoothly switching clock input sources as described in claim 1, characterized in that, Also includes: If the pulse signal of the PTP input source is abnormal during the time period T, determine whether the pulse signal of the Global Positioning System (GPS) input source is normal during the time period T. If the pulse signal of the GPS input source is normal during the time period T, the GPS input source is locked. as well as The OCXO input source is dynamically adjusted for calibration based on the GPS timestamp of the GPS input source, so that the pulse signal of the OCXO input source follows the pulse signal of the GPS input source.
3. The method for smoothly switching clock input sources as described in claim 2, characterized in that, Also includes: If the pulse signal of the GPS input source is abnormal during the time period T, the OCXO input source is locked, and the pulse signal of the PTP input source and the pulse signal of the GPS input source are continuously checked to see if they return to normal.
4. An electronic device, characterized in that, include: The module includes a multi-input source stability detection module, an input source switching module, and an OCXO dynamic compensation module, among which: The input source switching module selects a PTP input source for time synchronization based on the initial configuration. The multi-input source stability detection module determines whether the pulse signal of the PTP input source is normal within time T. If the pulse signal of the PTP input source is normal within time T, the input source switching module locks the PTP input source. The OCXO dynamic compensation module dynamically adjusts the OCXO input source for calibration based on the PTP timestamp of the PTP input source, so that the pulse signal of the OCXO input source follows the pulse signal of the PTP input source.
5. The electronic device as claimed in claim 4, characterized in that, The electronic device further includes an input source adaptive stability detection module, wherein: If the pulse signal of the PTP input source is abnormal within the time period T, the input source adaptive stability detection module determines whether the pulse signal of the GPS input source is normal within the time period T. If the pulse signal of the GPS input source is normal within the time period T, the input source switching module locks the GPS input source; and The OCXO dynamic compensation module dynamically adjusts the OCXO input source for calibration based on the GPS timestamp of the GPS input source, so that the pulse signal of the OCXO input source follows the pulse signal of the GPS input source.
6. The electronic device as claimed in claim 5, characterized in that, in: If the pulse signal of the GPS input source is abnormal during the time period T, the input source switching module locks the OCXO input source, and the multi-input source stability detection module and the input source adaptive stability detection module continuously detect whether the pulse signal of the PTP input source and the pulse signal of the GPS input source have returned to normal.
7. A storage medium storing at least one computer instruction thereon, characterized in that, The instructions are executed by the processor and loaded to perform the method of smoothly switching clock input sources as described in any one of claims 1-3.