Temperature sensing-assisted time synchronization holdover method
By constructing a TimeNet neural network model, the clock crystal frequency offset is predicted using ambient temperature information and the clock phase offset is calculated, thus solving the stability problem of time synchronization under changes in ambient temperature and external connection interruptions, and achieving long-term time synchronization maintenance.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2024-12-27
- Publication Date
- 2026-07-02
AI Technical Summary
Existing time synchronization methods struggle to accurately predict and correct clock crystal frequency offsets when faced with changes in ambient temperature and interruptions in external connections, resulting in insufficient time synchronization stability, especially in the absence of external connections, making it difficult to maintain long-term synchronization.
A time series prediction model based on the TimeNet neural network is constructed. The ambient temperature information is used to predict the frequency offset of the clock crystal oscillator, and the clock phase offset is calculated through the frequency offset autoregressive state transition equation to realize the clock parameter tracking of the master and slave nodes.
The time synchronization method is more robust to dynamic changes in ambient temperature, the clock synchronization retention period is extended in the absence of external connection, and the long-term stability of time synchronization is improved.
Smart Images

Figure CN2024142953_02072026_PF_FP_ABST
Abstract
Description
A temperature sensing-assisted time synchronization maintenance method Technical Field
[0001] This invention belongs to the field of time synchronization technology and relates to a time synchronization maintenance method assisted by temperature sensing. Background Technology
[0002] Time synchronization, as an indispensable key supporting technology in distributed networks, is a fundamental prerequisite for the normal operation of the network and is widely used in industrial networks, power systems, and 5G communications. The purpose of time synchronization is to enable different devices in the network to operate on the same time scale, thereby ensuring the correctness of logical time and causal relationships when devices perform tasks. However, due to many adverse factors in the network operating environment (such as changes in ambient temperature and humidity, electromagnetic interference, crystal aging, etc.), the output frequency of the device clock crystal oscillator experiences nonlinear increasing or decreasing drift, making it difficult to maintain the time deviation between network devices and the master clock within a sufficiently small range. Especially when the system faces the loss or instability of external time source signals, packet-switched time synchronization protocols cannot be used for clock deviation estimation and correction. This necessitates designing a reasonable time synchronization maintenance method to accurately predict the changing trend of the crystal oscillator frequency, thereby compensating for the frequency offset and improving the long-term stability of time synchronization maintenance. Currently, there are two main time synchronization maintenance methods: one uses Kalman filtering to introduce a dynamic clock offset model to address frequency instability, but this is only suitable for random delays following a single distribution and has relatively low robustness. Another approach is to combine least squares parameter estimation to establish a differential model of the crystal oscillator. However, the learned model parameters are easily affected by initial conditions and have weak fault tolerance.
[0003] Therefore, there is an urgent need for a temperature-sensing-assisted time synchronization maintenance method that uses ambient temperature information as input and employs a neural network model to accurately predict and correct the clock crystal frequency offset, thereby enhancing the robustness of the time synchronization maintenance method to changes in ambient temperature and reducing the resynchronization frequency in the absence of external connections. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a temperature-sensing-assisted time synchronization maintenance method. This method addresses network communication scenarios where devices cannot synchronize due to master clock failure or communication link interruption. Considering the nonlinear dynamic time-varying characteristics of the device clock crystal output frequency due to ambient temperature changes, a TimeNet neural network model suitable for network time synchronization without external connections is constructed. Ambient temperature information is used as input to the TimeNet neural network model to accurately predict the clock crystal frequency offset. The clock phase offset is calculated using a frequency offset autoregressive state transition equation, enabling clock parameter tracking in the maintenance state. This effectively extracts the relationship between ambient temperature changes and clock crystal frequency offset, enhancing the robustness of the time synchronization maintenance method to dynamic changes in ambient temperature and extending the clock synchronization maintenance period in the absence of external connections.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A temperature-sensing-assisted time synchronization maintenance method specifically includes the following steps:
[0007] S1: For network communication scenarios where devices cannot synchronize information exchange due to master clock failure or communication link interruption, considering the nonlinear dynamic time-varying characteristics of the device clock crystal oscillator output frequency due to changes in ambient temperature, a time series prediction model based on TimeNet neural network suitable for devices without external connections is constructed; and the time series prediction model based on TimeNet neural network is trained using historical clock parameter data and temperature information.
[0008] S2: Using the trained TimeNet neural network-based time series prediction model, ambient temperature information is used as the input to the time series prediction model to predict the clock frequency offset of the slave node.
[0009] S3: Using the clock frequency offset predicted by the TimeNet neural network time series prediction model, the clock phase offset of the slave node is calculated by the frequency offset autoregressive state transition equation. Using the clock frequency offset and clock phase offset values, the slave node corrects its local clock and achieves clock self-holding with the master node, thereby realizing clock parameter tracking of the state between the master and slave nodes.
[0010] Furthermore, in step S1, training a time series prediction model based on the TimeNet neural network specifically includes the following steps:
[0011] S11: Using historical clock parameter data and temperature information of the node's environment as the dataset, randomly and uniformly divide it into R non-overlapping subsets, and each subset should maintain the consistency of data distribution as much as possible.
[0012] S12: Perform R rounds of iterations. In each iteration, select a subset as the validation set and the remaining R-1 subsets as the training set. Use the training set to train the model and the validation set to evaluate the model. The loss function Loss is obtained based on the network's expected output value and the target value:
[0013] Where γ(n) is the true value of clock skew, γ%(n) is the predicted value of clock skew, and n represents the number of samples;
[0014] S13: Based on the loss function in step S12, the gradient loss function is calculated as follows:
[0015] in, This represents the gradient vector of the prediction network;
[0016] S14: Train the time series prediction model until the model converges and obtain the optimal model parameters.
[0017] Furthermore, in step S2, predicting the clock frequency offset of the slave node specifically includes the following steps:
[0018] S21: Due to the different temperature dimensions during data acquisition, data normalization is performed to avoid adverse effects on model generalization. We use minimum-maximum normalization, scaling each feature range to between [0,1]. For a one-dimensional feature K... i Let i = 1, 2, and K be the one-dimensional feature corresponding to the nth sample value. i (n), n = 1, 2, ..., n; the normalization formula is:
[0019] Where max(K) i ) and min(K i ) are features K i Using the maximum and minimum values on the sample, It is the processed one-dimensional feature data;
[0020] S22: To represent the temporal changes within and between data periods, Fourier transform is used to process the time series data. The processed periodic characteristics will show corresponding high-amplitude frequency components. Only the frequency components corresponding to the first m largest amplitudes are taken to obtain m main periods. This process can be expressed as:
[0021] Where FFT(·) represents the calculation of the Fast Fourier Transform, Amp(·) represents the calculation of the amplitude, and Avg(·) represents the averaging; {f1,L,f m} represents the frequency set, M represents the amplitude, and T represents the sequence length;
[0022] S23: Based on the selected frequency {f1,L,f m} and the corresponding period lengths p1,L,p m One-dimensional time series Reconstructing it into a two-dimensional tensor can be represented as:
[0023] Padding(·) adds zeros to the end of the sequence so that the sequence length is divisible by the integer part of the sequence. represent The representation of a one-dimensional tensor being converted into a two-dimensional tensor; Reshape(·) is a reshaping operation that converts a one-dimensional tensor into a two-dimensional tensor.
[0024] S24: Obtaining feature information from two-dimensional tensors through efficient initial block processing with parameters. This process can be represented as:
[0025] in, After being converted into a two-dimensional tensor, the two-dimensional tensor is processed through a parameter-efficient initialization block, namely the Inception(·) function. This function involves a multi-scale two-dimensional kernel, and then the learned two-dimensional changes are processed. Convert to one-dimensional space The Trunc() function was used to convert the length of p i ×f i The padded sequence is truncated to a sequence of the original length n;
[0026] S25: The model needs to fuse m distinct one-dimensional features for the next layer. Since the amplitude M reflects the relative importance of the selected frequency and period, and thus corresponds to the importance of the two-dimensional tensor of each transformation, the model aggregates the amplitude M into one-dimensional data, as follows:
[0027] in, The amplitude represents the selected frequency. Represents the weighted value for each amplitude. This represents the output of a time block in a time series forecasting model.
[0028] S26: The time series prediction model based on the TimeNet neural network consists of stacked time blocks, which are organized using residuals. The overall process can be formalized as follows:
[0029] After stacking the TimeBlock time block layers, the final output of the time series prediction model based on the TimeNet neural network is represented as γ%(n), which is the predicted frequency offset value, where b represents the number of stacked time block layers.
[0030] Furthermore, step S3 specifically includes: using the predicted clock frequency offset value, calculating the clock phase offset value from the node using the frequency offset autoregressive state transition equation, which can be expressed as:
[0031] θ(n)=θ(n-1)+γ%(n-1)×τ
[0032] Where θ(n) represents clock phase offset and τ represents sampling interval; the clock phase offset value is calculated using the frequency offset autoregressive state transition equation, thereby realizing clock parameter tracking to maintain state between master and slave nodes.
[0033] The beneficial effects of this invention are as follows:
[0034] (1) The present invention takes into account the nonlinear dynamic time-varying characteristics of the output frequency of the device clock crystal oscillator due to changes in ambient temperature. By using ambient temperature information as the input of the network model, the law of ambient temperature change and clock crystal oscillator frequency offset can be effectively extracted.
[0035] (2) This invention constructs a time series prediction model based on TimeNet neural network suitable for network time synchronization. It utilizes the adaptability and nonlinear generalization ability of TimeNet neural network to accurately predict the frequency offset of clock crystal oscillator, thereby enhancing the robustness of the time synchronization maintenance method to dynamic changes in ambient temperature.
[0036] (3) This invention combines the clock crystal frequency offset predicted by the TimeNet neural network and uses the frequency offset autoregressive state transition equation to calculate the clock phase offset, thereby achieving long-term stable self-maintaining of time synchronization in the case of time base loss and extending the clock synchronization maintenance period in the case of no external connection.
[0037] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0038] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0039] Figure 1 is a schematic diagram of the overall framework of the TimeNet neural network model in the time synchronization maintenance method of the present invention;
[0040] Figure 2 is a flowchart of the time synchronization maintenance method assisted by temperature sensing according to an embodiment of the present invention. Detailed Implementation
[0041] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0042] Please refer to Figures 1 and 2. This invention provides a temperature-sensing-assisted time synchronization maintenance method, addressing network communication scenarios where master clock failure or communication link interruption prevents devices from exchanging synchronized information. Considering the nonlinear dynamic time-varying characteristics of the device clock crystal output frequency due to ambient temperature changes, this invention utilizes the adaptability and nonlinear generalization capability of neural network models to construct a time series prediction model based on the TimeNet neural network suitable for self-maintaining time synchronization in networks without external connections. Ambient temperature information is used as input to the TimeNet neural network to accurately predict the clock crystal frequency offset, and the clock phase offset is calculated using a frequency offset autoregressive state transition equation, achieving clock parameter tracking in the maintenance state. This invention employs a deep learning-based non-stationary time series prediction model, which can effectively extract the relationship between ambient temperature changes and clock crystal frequency offset, enhancing the robustness of the time synchronization maintenance method to dynamic changes in ambient temperature and extending the clock synchronization maintenance period in the absence of external connections.
[0043] Figure 1 is a schematic diagram of the overall framework of the TimeNet neural network model in the method of this invention. The TimeNet neural network model uses ambient temperature information as a one-dimensional feature input. After three cascaded time blocks, the data is processed layer by layer for feature extraction and transformation. The processed temperature data is integrated by a feature fusion module to generate the final clock phase shift. At the same time, each time block uses a parameter-efficient module to reshape the feature vector, perform Fourier transform and period selection to extract the time-frequency features of the data, and uses an exponential function to normalize them to enhance stability.
[0044] Example:
[0045] Figure 2 is a flowchart of the time synchronization maintenance method with temperature sensing assistance according to an embodiment of the present invention. The present invention provides a time synchronization maintenance method with temperature sensing assistance, as shown in Figure 2, and the specific steps are as follows:
[0046] V1~V2: Obtain historical data information and initialize network module parameters.
[0047] V3-V8: Based on historical frequency shift bias information and ambient temperature data, forward propagation is used, and the loss function is calculated and network parameters are updated simultaneously. If the loss function value drops below a certain value or an early stopping mechanism is triggered, a time series prediction model based on the TimeNet neural network is obtained after training; otherwise, training continues.
[0048] V9~V10: Combine the time series prediction model based on TimeNet neural network and the acquired temperature information to predict clock parameters; combine the predicted frequency offset value and use the frequency offset autoregressive state transition equation to calculate the clock phase offset.
[0049] V11~V12: Combine the acquired clock parameters to correct the local clock and realize clock parameter tracking to maintain the state of master and slave nodes.
[0050] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A time synchronization maintenance method assisted by temperature sensing, characterized in that, The method specifically includes the following steps: S1: For network communication scenarios where devices cannot synchronize information exchange due to master clock failure or communication link interruption, considering the nonlinear dynamic time-varying characteristics of the device clock crystal oscillator output frequency due to changes in ambient temperature, a time series prediction model based on TimeNet neural network suitable for devices without external connections is constructed; and the time series prediction model based on TimeNet neural network is trained using historical clock parameter data and temperature information. S2: Using the trained TimeNet neural network-based time series prediction model, ambient temperature information is used as the input to the time series prediction model to predict the clock frequency offset of the slave node. S3: Using the clock frequency offset predicted by the TimeNet neural network time series prediction model, the clock phase offset of the slave node is calculated by the frequency offset autoregressive state transition equation. Using the clock frequency offset and clock phase offset values, the slave node corrects its local clock and achieves clock self-holding with the master node.
2. The time synchronization maintenance method assisted by temperature sensing according to claim 1, characterized in that, In step S1, training a time series prediction model based on the TimeNet neural network specifically includes the following steps: S11: Using historical clock parameter data and temperature information of the node's environment as the dataset, randomly and uniformly divide it into R non-overlapping subsets, with each subset maintaining the consistency of data distribution. S12: Perform R rounds of iterations. In each iteration, select a subset as the validation set and the remaining R-1 subsets as the training set. Use the training set to train the model and the validation set to evaluate the model. The loss function Loss is obtained based on the network's expected output value and the target value: Where γ(n) is the actual value of the clock skew. This is the predicted value for clock skew, where n represents the number of samples. S13: Based on the loss function in step S12, the gradient loss function is calculated as follows: in, This represents the gradient vector of the prediction network; S14: Train the time series prediction model until the model converges and obtains the optimal model parameters.
3. The time synchronization maintenance method assisted by temperature sensing according to claim 2, characterized in that, In step S2, predicting the clock frequency offset of the slave node specifically includes the following steps: S21: Using minimum-maximum normalization, each feature range is normalized to the range [0,1] by scaling. For a one-dimensional feature K... i Let i = 1, 2, and K be the one-dimensional feature corresponding to the nth sample value. i (n), n = 1, 2, ..., n; the normalization formula is: Where max(K) i ) and min(K i These are the maximum and minimum values of feature Ki when used with samples. It is the processed one-dimensional feature data; S22: The time series data is processed using Fourier transform. The processed periodic features will show corresponding high-amplitude frequency components. Only the frequency components corresponding to the first m largest amplitudes are taken to obtain m main periods. This process is expressed as: Where FFT(·) represents the calculation of the Fast Fourier Transform, Amp(·) represents the calculation of the amplitude, and Avg(·) represents the averaging; {f1,L,f m } represents the frequency set, M represents the amplitude, and T represents the sequence length; S23: Based on the selected frequency {f1,L,f m } and the corresponding period lengths p1,L,p m One-dimensional time series Reconstructing it into a two-dimensional tensor, the process can be represented as: Padding(·) adds zeros to the end of the sequence so that the sequence length is divisible by the integer part of the sequence. represent The representation of a one-dimensional tensor being converted into a two-dimensional tensor; Reshape(·) is a reshaping operation that converts a one-dimensional tensor into a two-dimensional tensor. S24: Obtain feature information by efficiently initializing the two-dimensional tensor using parametric initial blocks. This process is represented as follows: in, After being converted into a two-dimensional tensor, the two-dimensional tensor is processed through a parameter-efficient initialization block, namely the Inception(·) function. This function involves a multi-scale two-dimensional kernel, and then the learned two-dimensional changes are processed. Convert to one-dimensional space The Trunc() function was used to convert the length of p i ×f i The padded sequence is truncated to a sequence of the original length n; S25: The model needs to fuse m distinct one-dimensional features for the next layer. The model aggregates amplitude M into one-dimensional data, represented as follows: in, The amplitude represents the selected frequency. Represents the weighted value for each amplitude. This represents the output of a time block in a time series forecasting model. S26: The time series prediction model based on the TimeNet neural network consists of stacked time blocks, which are organized using residuals. The overall process is formalized as follows: After stacking TimeBlock time block layers, the final output of the time series prediction model based on the TimeNet neural network is represented as follows: That is, the predicted frequency offset value, where b represents the number of time block layers in the stack.
4. The time synchronization maintenance method assisted by temperature sensing according to claim 3, characterized in that, Step S3 specifically includes: using the predicted clock frequency offset value, calculating the clock phase offset value from the node using the frequency offset autoregressive state transition equation, expressed as: Where θ(n) represents clock phase offset and τ represents sampling interval.