A clock holding method and system
By introducing the PSO-BPNN model to predict the frequency control word, the problem of poor clock hold capability was solved, and the system achieved high-precision and stable frequency output after GNSS signal loss, thus improving the long-term stability of the system.
Patent Information
- Application Number
- CN202310427978.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-20
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-04-20
AI Technical Summary
Existing technologies have poor clock retention capabilities, especially after the loss of GNSS satellite signals, where the frequency drift of the thermostatic crystal oscillator leads to a decrease in the stability of the system output frequency.
A BP neural network model optimized by particle swarm optimization algorithm (PSO-BPNN) is used to predict and compensate the system output frequency. Combined with the DPLL chip module and MCU module, the frequency control word is predicted by the trained PSO-BPNN model and written into the DPLL chip module to achieve clock hold.
It improves the system's clock hold capability, enabling it to maintain high accuracy and stability after GNSS signal loss. Compared with traditional models, it has a longer training time and higher accuracy, solving the problems of long training time, slow convergence speed and easy getting trapped in local optima in BPNN models.
Smart Images

Figure CN116527043B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a clock holding method and system, belonging to the field of wireless communication technology. Background Technology
[0002] Since the beginning of the 21st century, the rapid development of modern information technology has led to the application of time and frequency information in an increasing number of technological fields, such as communications, transportation, power, and navigation and positioning. High-precision time synchronization systems play an indispensable role in national scientific, economic, and military development, as well as in people's daily lives. For example, in 5G communications, if base stations cannot guarantee clock synchronization, severe time slot interference may occur, leading to a deterioration in communication quality between users. Satellite navigation systems rely heavily on high-precision frequency sources to maintain time synchronization between satellite clocks and user equipment and to provide distance measurement data. High-precision frequency sources can provide the high stability and accuracy required by satellite clocks. Radar also requires high-precision frequency sources to generate radio frequency signals and time base signals to achieve target detection, tracking, ranging, and imaging functions. Common frequency sources include atomic clocks, optical clocks, and various crystal oscillators. Among them, the frequency accuracy of atomic clocks is generally better than 10. -12 Frequency stability is generally better than 10. -11 This belongs to the first-level frequency standard, boasting extremely high precision but also being very expensive and requiring a harsh environment with constant temperature and humidity. The frequency accuracy of various crystal oscillators is generally 10-1. -7 ~10 -10 Frequency stability is generally below 10. -9 This belongs to the second-order frequency standard, which has lower precision but is small in size and inexpensive. In order to combine the advantages of both, more and more companies and individuals are beginning to focus on improving crystal oscillators, with improving long-term stability while minimizing the impact on short-term stability being the main research direction at present.
[0003] A cryogenic crystal oscillator is a widely used type of crystal oscillator. Its internal thermostatic bath keeps the crystal oscillator's operating temperature constant, minimizing frequency drift caused by temperature changes and resulting in high frequency stability and accuracy. It also boasts advantages such as small size, low cost, and low power consumption. However, cryogenic crystal oscillators exhibit aging and temperature characteristics; the output frequency will drift with aging time and temperature variations, thus requiring calibration using an external reference source.
[0004] Currently, GNSS (Global Navigation Satellite System) timing technology is developing rapidly, and many companies and individuals are beginning to use GNSS pulse-per-second (1PPS) signals as a reference frequency source to discipline and calibrate local crystal oscillators. This method can improve the long-term stability of local crystal oscillators while also saving costs. However, GNSS satellite signals are easily affected by electromagnetic interference, weather, and terrain during transmission, leading to deterioration or even complete loss of the signal received by the receiver. This necessitates the adoption of technical measures to improve the system's hold-up capability, enabling the system to still output high-accuracy and stable frequency signals after the loss of the reference signal. Summary of the Invention
[0005] The purpose of this invention is to provide a clock holding method and system to solve the problem of poor clock holding capability in the prior art.
[0006] To achieve the above objectives, the present invention employs the following technical solution:
[0007] In a first aspect, the present invention provides a clock holding method, comprising:
[0008] Obtain time information;
[0009] The time information is input into the trained PSO-BPNN model, and the predicted value of the frequency control word is output.
[0010] The predicted value of the frequency control word is written into the DPLL chip module to obtain the system output signal. The frequency of the system output signal is controlled by the predicted value of the frequency control word to achieve clock hold.
[0011] In conjunction with the first aspect, the PSO-BPNN model is further trained using the following method:
[0012] The frequency control word data of the MCU module during the taming phase is obtained, and the PSO-BPNN model is trained multiple times using the frequency control word data to obtain the trained PSO-BPNN model.
[0013] In conjunction with the first aspect, the PSO-BPNN model is further constructed using the following method:
[0014] The Particle Swarm Optimization (PSO) algorithm is used to optimize the BPNN model. The gradient correction process in the BPNN model is replaced by the iteration of the particle swarm, resulting in the PSO-BPNN model.
[0015] In conjunction with the first aspect, the frequency of the system output signal is further controlled by the following formula:
[0016]
[0017] Among them, f d It is the frequency of the system output signal, f. w This is the predicted value of the frequency control word, where N is the number of bits in the frequency control word, and 0 ≤ f. w ≤2 N-1 f s It is the sampling frequency.
[0018] In conjunction with the first aspect, further, N = 48, and 0 ≤ f w ≤2 47 .
[0019] In a second aspect, the present invention also provides a clock holding system based on the method described in any one of the first aspects, comprising:
[0020] The receiver module is used to receive and process GNSS signals to obtain a 1PPS signal, providing a standard reference time source for the DPLL chip module.
[0021] A temperature-controlled crystal oscillator is used to input a signal of a preset frequency to the DPLL chip module;
[0022] The DPLL chip module is used to obtain the system output signal by writing the frequency control word prediction value, control the frequency of the system output signal by the frequency control word prediction value, and thus achieve clock hold according to the frequency of the system output signal. The frequency control word prediction value is obtained by a trained PSO-BPNN model.
[0023] The MCU module is used to train the PSO-BPNN model and write the frequency control word prediction value into the DPLL chip module.
[0024] In conjunction with the second aspect, the DPLL chip module further includes a frequency control unit for controlling the frequency of the system output signal using the following formula:
[0025]
[0026] Among them, f d It is the frequency of the system output signal, f. w This is the predicted value of the frequency control word, where N is the number of bits in the frequency control word, N = 48, and 0 ≤ f. w ≤2 N-1 f s It is the sampling frequency.
[0027] In conjunction with the second aspect, the MCU module further includes a model training unit for training the PSO-BPNN model using the following method:
[0028] The frequency control word data of the MCU module during the taming phase is obtained, and the PSO-BPNN model is trained multiple times using the frequency control word data to obtain the trained PSO-BPNN model.
[0029] In conjunction with the second aspect, the MCU module is further used to read and write registers in the DPLL chip module.
[0030] Compared with the prior art, the beneficial effects achieved by the present invention are:
[0031] This invention provides a clock-holding method and system that introduces the Particle Swarm Optimization (PSO) algorithm into the Backpropagation Neural Network (BPNN) model to predict and compensate for the system's output frequency, further improving the overall clock-holding capability of the system. The PSO-BPNN model is adept at handling large amounts of multidimensional data, and compared with traditional linear prediction models such as Kalman filtering, it can achieve a longer clock-holding time and higher accuracy. In addition, compared with the general BPNN model, the PSO-BPNN model solves to some extent the problems of long training time, slow convergence speed, and easy getting trapped in local optima in the BPNN model, and has a better fitting and prediction effect. Attached Figure Description
[0032] Figure 1 This is a flowchart of a clock holding method provided in an embodiment of the present invention;
[0033] Figure 2 This is an algorithm flowchart of the PSO-BPNN model provided in an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of a clock holding system provided in an embodiment of the present invention;
[0035] Figure 4 This is a frequency accuracy curve provided in an embodiment of the present invention that does not use the algorithm of the present invention;
[0036] Figure 5 This is a frequency accuracy curve diagram of using the algorithm of the present invention provided in an embodiment of the present invention. Detailed Implementation
[0037] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to illustrate the technical solution of the present invention more clearly, and should not be used to limit the scope of protection of the present invention.
[0038] Example 1
[0039] like Figure 1 As shown, an embodiment of the present invention provides a clock holding method, including the following steps:
[0040] S1. Obtain time information.
[0041] S2. Input the time information into the trained PSO-BPNN model and output the frequency control word prediction value.
[0042] Step S2 through Figure 2 The PSO-BPNN model is implemented using an MCU module and a PC. The MCU module collects FTW data (frequency control word data) during the taming phase once per minute and sends the collected FTW data to the PC via a serial port. The PC obtains the frequency control word data of the MCU module during the taming phase and uses the frequency control word data to perform multiple training on the PSO-BPNN model to obtain a trained PSO-BPNN model.
[0043] The PSO-BPNN model is constructed using the following method:
[0044] The Particle Swarm Optimization (PSO) algorithm is used to optimize the BPNN model. The gradient correction process in the BPNN model is replaced by the iteration of the particle swarm, resulting in the PSO-BPNN model.
[0045] S3. Write the predicted value of the frequency control word into the DPLL chip module to obtain the system output signal. Control the frequency of the system output signal through the predicted value of the frequency control word to achieve clock hold.
[0046] The frequency of the system output signal is controlled by the following formula:
[0047]
[0048] Among them, f d It is the frequency of the system output signal (DDS output frequency), f w This is the predicted value of the frequency control word, where N is the number of bits in the frequency control word, N = 48, and 0 ≤ f. w ≤2 N-1 That is, 0≤f w ≤2 47 f s It is the sampling frequency.
[0049] Example 2
[0050] To address the shortcomings of existing technologies, this invention designs a miniaturized, low-cost, and highly stable clock holding system based on GNSS 1PPS. The system uses the long-term stable GNSS 1PPS signal to discipline and calibrate a cryogenic crystal oscillator, solving the problem of poor long-term stability of the cryogenic crystal. Furthermore, to address the issue of reduced system output frequency stability caused by frequency drift due to the loss of the reference 1PPS signal, this invention innovatively introduces a Particle Swarm Optimization BP Neural Network (PSO-BPNN) model optimized by the particle swarm optimization algorithm to predict and compensate for the system output frequency, further improving the overall holding capability of the system. The PSO-BPNN model excels at handling large amounts of multidimensional data, achieving longer holding times and higher accuracy compared to traditional linear prediction models such as Kalman filtering. In addition, compared to general BPNN models, the PSO-BPNN model, to some extent, solves the problems of long training time, slow convergence speed, and susceptibility to local optima in BPNN models, exhibiting better fitting and prediction performance.
[0051] Algorithm principle:
[0052] First, we introduce the error reduction process of the BP neural network model, taking a three-layer perceptron as an example. This requires determining the number of nodes in each layer, the transfer function form, the selection of weights and thresholds, and the learning rate. After one forward propagation, if the output O of the BP neural network is not equal to the expected output d, then the error E is defined as:
[0053]
[0054] Where k is the number of output nodes. Expanding the above error definition to the hidden layer, we get:
[0055]
[0056] Where f(x) refers to the transfer function, w jk y represents the weights between the output layer and the hidden layer. j This represents the value of the hidden layer node. Expanding this further to the input layer, we have:
[0057]
[0058] Among them, v ij x represents the weights between the hidden layer and the input layer. i This represents the value of the i-th node in the input layer. The network input error is the weights w of each layer. jk v ij Since the function is such that the error E can be continuously reduced by adjusting the weights, the weights should be proportional to the gradient descent of the error, i.e.:
[0059]
[0060]
[0061] For a multilayer perceptron, taking forward propagation as an example, assume there are h hidden layers, and the number of nodes in each hidden layer is denoted as m1, m2, ..., mn. h The outputs of each hidden layer are y1, y2, ..., y h Let the weight matrices of each layer be denoted as W1, W2, ..., W h W h+1 The formula for adjusting the weights of the output layer is:
[0062]
[0063] j=0,1,2,…,mh; k=1,2,…,l
[0064] Where η is the learning rate and δ is the error signal output by this layer. Then, for the h-th hidden layer, its weight adjustment formula is:
[0065]
[0066] i=0,1,2,…,n(h-1); j=1,2,…,m h
[0067] By recursively applying the above steps, we have the formula for adjusting the weights of the hidden layer:
[0068]
[0069] p=0,1,2,…,n; j=1,2,…,m1
[0070] As can be seen from the above formulas, for a BP neural network, the adjustment formulas for the weights of each layer are exactly the same, and are all determined by three factors: the learning rate η, the output error signal δ of the current layer, and the input Y (or X) of the current layer.
[0071] The selection of weights and thresholds in a backpropagation (BP) neural network affects the error reduction effect, easily leading to slow convergence and local minima. This invention utilizes a particle swarm optimization (PSO) algorithm to optimize the BP neural network. By replacing gradient correction in the BP algorithm with iterative PSO, it can improve the problems of long training time and slow convergence speed in BP neural networks. The specific steps are as follows:
[0072] S1: Initialize all particles, including velocity initialization and position initialization, and set the individual's historical best gBest to the current position, while the best individual in the swarm is set as the current gBest;
[0073] S2: In each round of evolution, calculate the fitness function value F of each particle. i ;
[0074] S3: Determine the particle's current F i With the particle's pBEst, if F i If F is better than pBEst, then F i As the best historical position;
[0075] S4: Compare the particle's pBest with the global optimal vector gBest. If pBest is better than gBest, then pBest is taken as the global optimal value of the entire particle swarm.
[0076] S5: The velocity and position of each particle i in the d-th dimension are updated according to the following two formulas:
[0077]
[0078]
[0079] S6: Determine if the termination condition has been met. If not, continue to S2; otherwise, output gBest and terminate.
[0080] S7: Use the values of each dimension of the optimal particle as the weights and thresholds of the BP neural network.
[0081] In the above formula, ω is the inertia weight, typically initialized to 0.9 and then linearly decreased to 0.4 during the evolutionary process. c1 and c2 are acceleration coefficients (also known as learning factors), traditionally set to a fixed value of 2.0. The two rand values in the above formula are random numbers in the interval [0,1]. It is important to note that during the update process, PSO requires the use of a maximum velocity V. max To limit the range of speed, V max Each dimension V max Generally, 10%-20% of the corresponding dimension can be taken. Figure 3 This is a flowchart of the PSO-BPNN algorithm.
[0082] like Figure 2 As shown, this embodiment of the invention also provides a clock holding system, including a receiver module, a temperature-controlled crystal oscillator (TCC), a DPLL chip module, and an MCU module.
[0083] The receiver module receives and processes GNSS signals, including GPS and BeiDou signals. After internal processing, it outputs a 1PPS signal with a pulse accuracy of less than 20ns, exhibiting high reliability and accuracy. After waveform shaping, the signal provides a standard reference time source for the DPLL chip module, ensuring smooth subsequent training.
[0084] The temperature-controlled crystal oscillator is used as a locally controlled crystal oscillator to output a 10MHz signal. This signal, after being divided by a frequency divider, can be used as another comparison signal for the digital phase detector. It can also be multiplied to synthesize a 1GHz system clock frequency.
[0085] The DPLL chip module is used to perform clock synchronization and clock hold functions. When the reference 1PPS signal is valid, the system is in disciplined mode, and the DPLL chip can lock the frequency and phase of the system output signal with the reference 1PPS signal to achieve clock synchronization. When the reference 1PPS signal is lost, the system switches to hold mode. In this mode, the output of the DPLL chip is determined by the internal DDS (Direct Digital Synthesizer) module. The output of the DDS module is related to the frequency control word and the sampling frequency, as shown in the following formula:
[0086]
[0087] Among them, f d f is the DDS output frequency. s f is the sampling frequency. w For frequency control word, f w The range of values for f is 0 ≤ f w ≤2 N-1 The DPLL chip module selected for this system requires a 48-bit frequency control word, therefore N is 48, and f w The range of values is 0 ≤ f w ≤2 47 .
[0088] By manually writing the frequency control word (FTW) into the DDS module inside the chip, the system can output the corresponding frequency signal to achieve the hold function. The FTW data here is obtained by the PSO-BPNN model mentioned above.
[0089] The MCU module needs to configure the relevant registers of the DPLL chip via SPI communication. In addition, it needs to acquire FTW data during the training phase once per minute and send the acquired FTW data to the PC via serial port. The PC uses the FTW data to train the model. After training the model using a large amount of FTW data, if the reference 1PPS signal is lost for a certain minute, the system enters hold mode. The PC, based on the time information, causes the model to output the FTW prediction value at that moment and sends it to the MCU chip via serial port. Finally, the MCU chip writes the prediction value into the DDS module.
[0090] The hardware platform built using the above modules verifies and maintains algorithm performance. Figure 4 This is a frequency accuracy curve without using the algorithm of this invention. After losing the reference 1PPS signal calibration, the temperature-controlled crystal oscillator will continue to drift in frequency due to its own aging and temperature. At this time, the system output frequency accuracy shows a downward trend and the jitter range gradually increases, with the worst frequency accuracy reaching -9×10. -11 .
[0091] Figure 5 This is a frequency accuracy curve under the algorithm of this invention. Under the effect of the algorithm, the system output frequency accuracy is significantly improved compared to before, and is basically maintained at ±6×10 during the first 9 hours of the hold phase. -11 As the system operating time in hold mode increases, the frequency accuracy continuously deteriorates, but the frequency accuracy can still be maintained within ±8×10⁻⁶ over 24 hours. -11 Within this order of magnitude, it fully demonstrates the excellent performance of the algorithm.
[0092] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A clock holding method, characterized in that, include: Obtain time information; The time information is input into the trained PSO-BPNN model, and the predicted value of the frequency control word is output. The frequency control word prediction value is written into the DPLL chip module to obtain the system output signal. The frequency of the system output signal is controlled by the frequency control word prediction value to achieve clock hold. The PSO-BPNN model is trained using the following method: Acquire the frequency control word data of the MCU module during the taming phase, and use the frequency control word data to perform multiple training on the PSO-BPNN model to obtain the trained PSO-BPNN model. The PSO-BPNN model was constructed using the following method: The Particle Swarm Optimization (PSO) algorithm is used to optimize the BPNN model. The gradient correction process in the BPNN model is replaced by the iteration of the particle swarm, resulting in the PSO-BPNN model. The frequency of the system output signal is controlled by the following formula: ; in, It is the frequency of the system output signal. It is the frequency control word prediction value. It is the number of bits in the frequency control word, and , It is the sampling frequency; =48, and .
2. A clock holding system based on the method of claim 1, characterized in that, include: The receiver module is used to receive and process GNSS signals to obtain a 1PPS signal, providing a standard reference time source for the DPLL chip module. A temperature-controlled crystal oscillator is used to input a signal of a preset frequency to the DPLL chip module; The DPLL chip module is used to obtain the system output signal by writing the frequency control word prediction value, control the frequency of the system output signal by the frequency control word prediction value, and thus achieve clock hold according to the frequency of the system output signal. The frequency control word prediction value is obtained by a trained PSO-BPNN model. The MCU module is used to train the PSO-BPNN model and write the frequency control word prediction value into the DPLL chip module. The MCU module includes a model training unit for training the PSO-BPNN model using the following method: Acquire the frequency control word data of the MCU module during the taming phase, and use the frequency control word data to perform multiple training on the PSO-BPNN model to obtain the trained PSO-BPNN model. The PSO-BPNN model was constructed using the following method: The Particle Swarm Optimization (PSO) algorithm is used to optimize the BPNN model. The gradient correction process in the BPNN model is replaced by the iteration of the particle swarm, resulting in the PSO-BPNN model. The DPLL chip module includes a frequency control unit, which controls the frequency of the system output signal using the following formula: ; in, It is the frequency of the system output signal. It is the frequency control word prediction value. It is the number of bits in the frequency control word, and , It is the sampling frequency; =48, and .
3. A clock holding system according to claim 2, characterized in that, The MCU module is also used to read and write registers in the DPLL chip module.
