Atomic clock frequency anomaly detection method

By combining wavelet transform and CNN-Transformer network, multi-scale features are extracted and long-distance dependencies are modeled, which solves the problem of accuracy in detecting atomic clock frequency anomalies and achieves high-precision detection of frequency jumps, frequency drift jumps and frequency outliers.

CN120704101APending Publication Date: 2025-09-26BEIHANG UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511077954.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing technologies make it difficult to efficiently and accurately detect abnormal phenomena such as frequency jumps, frequency drift jumps, and frequency outliers of atomic clocks, especially in dynamic non-stationary processes, where detection reliability and consistency are insufficient.

Method used

This method combines multi-layer wavelet transforms with CNN-Transformer networks to detect anomalies in frequency series through multi-scale feature extraction and long-range dependency modeling. The specific steps include collecting labeled frequency series for supervised training, extracting multi-layer features using wavelet transforms and CNN-Transformer networks, and performing feature fusion and classification.

Benefits of technology

It achieves high-precision detection of frequency jumps, frequency drift jumps and frequency outliers, improves the detection range and accuracy, and overcomes the limitations of traditional methods in dynamic non-stationary processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704101A_ABST
    Figure CN120704101A_ABST
Patent Text Reader

Abstract

The invention relates to an atomic clock frequency anomaly detection method, and belongs to the technical field of deep learning and the field of atomic clock anomaly detection. The method comprises the following steps: acquiring a frequency sequence set with a label generated by an atomic clock in a normal frequency sequence injection known abnormal mode; performing supervised training on the anomaly detection model by using the frequency sequence set; in the anomaly detection model, performing feature fusion, nonlinear transformation and classification on a first path of features extracted by performing multilayer decomposition on an input frequency sequence by adopting discrete wavelet transform and a second path of features extracted by adopting a CNN-Transformer network on the input frequency sequence, and then detecting an abnormal frequency sequence; and performing frequency anomaly detection on the atomic clock frequency sequence acquired in real time by using the trained anomaly detection model. According to the invention, high-precision detection of frequency anomalies with different characteristics is realized, the detection range is expanded, and the detection precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of deep learning technology and atomic clock anomaly detection, and in particular to a method for detecting atomic clock frequency anomaly. Background Art

[0002] Atomic clocks, as high-precision time and frequency reference devices based on atomic energy-level transitions, are widely used in communications and navigation. Their frequency stability directly impacts the system's time synchronization accuracy and overall performance. However, in actual operation, atomic clocks are susceptible to factors such as laser power fluctuations, magnetic field interference, temperature changes, and optical device aging, leading to anomalies such as frequency jumps, frequency drift jumps, and frequency outliers, which degrade the system's time synchronization accuracy. Therefore, developing efficient and accurate methods for detecting atomic clock frequency anomalies is of great significance for ensuring the reliability of time synchronization in communications and navigation equipment.

[0003] Frequency hopping refers to a sudden, short-term jump in the output frequency of an atomic clock. These "jumps" exhibit large amplitudes and distinct time-domain characteristics, primarily caused by sudden disturbances such as electromagnetic pulses or physical failures. Frequency drift hopping manifests as slow frequency changes over longer timescales, typically due to the superposition of long-term drift caused by device aging or temperature fluctuations. Frequency outliers are isolated anomalies in a normal frequency sequence, manifesting as single or small sampling points that deviate from the normal range. These are often caused by measurement errors, data loss, or transient interference noise.

[0004] With the increasing requirements for time-frequency accuracy, there is an urgent need for more intelligent and high-precision atomic clock frequency anomaly detection technologies. Traditional anomaly detection technologies such as BLKAVG, SEQAVG, and QUALUM have simple structures and are easy to implement, but they have difficulty handling complex non-stationary processes. The generalized likelihood ratio test based on statistical inference has difficulty quantifying the mapping relationship between anomaly intensity and detection parameters, and its fixed threshold mechanism is not suitable for handling dynamic non-stationary processes with time-varying characteristics such as atomic clock frequency drift. Dynamic Allan deviation (DADEV) and spectrogram methods can convert the raw phase and frequency measurements of atomic clocks into intuitive time-frequency characteristics, providing an effective visualization method for anomaly identification. However, they usually require longer time series measurement data to effectively identify anomaly patterns.

[0005] Kalman filtering and its improved algorithms, including N-step prediction, adaptive Kalman filtering, and Kalman FIR, all rely on accurate prior modeling of the system noise matrix and error covariance matrix. In recent years, machine learning has been introduced as a new data-driven approach to atomic clock anomaly detection. It can directly learn anomaly patterns from raw observation data without requiring precise physical model assumptions. However, methods combining change point detection with dynamic threshold functions are affected by hyperparameters such as the fixed width w, which reduces detection reliability and consistency. Summary of the Invention

[0006] In view of the above analysis, the present invention aims to disclose a method for detecting anomaly in atomic clock frequency; the invention aims to overcome the limitations of existing methods and achieve more accurate multi-type anomaly detection.

[0007] The present invention discloses a method for detecting anomaly in atomic clock frequency, comprising:

[0008] S1, collect atomic clocks and inject known abnormal patterns into the normal frequency sequence to generate a labeled frequency sequence set;

[0009] S2, supervised training of anomaly detection model using frequency sequence set;

[0010] In the anomaly detection model, on the one hand, the input frequency sequence is decomposed by a discrete wavelet transform to extract the first channel of features. On the other hand, after the input frequency sequence is subjected to multi-level local feature extraction using a CNN network, a Transformer encoder is used to extract the second channel of features from the local features to reflect the long-distance temporal dependency of the frequency sequence in the training data. The first and second channel features are then subjected to feature fusion, nonlinear transformation, and classification to detect the frequency sequence where anomalies occur.

[0011] S3. Use the trained anomaly detection model to perform frequency anomaly detection on the atomic clock frequency sequence collected in real time.

[0012] Furthermore, in said S1,

[0013] Each sequence in the frequency sequence set is a frequency sequence segment obtained by performing sliding window sampling with a set data window length and sliding step length on the normal frequency sequence output by the atomic clock; adjacent windows of the sliding window sampling meet the set data overlap rate;

[0014] Selecting a set ratio of sequences from a frequency sequence set to inject abnormal patterns; abnormal patterns include frequency hopping, frequency drift hopping, and frequency outliers;

[0015] Window-level binary classification labels are used for data annotation, where label 0 represents a normal frequency sequence and label 1 represents an abnormal frequency sequence.

[0016] Furthermore, the anomaly detection model includes: a first module, a second module and a third module; wherein,

[0017] In the first module, the wavelet transform network is used to perform multi-layer decomposition on the input frequency series data and extract multi-scale features as the first feature path;

[0018] The second module uses a CNN-Transformer network. It first uses a dual-path multi-scale CNN layer to parallel process the input frequency series data at different receptive field scales to extract multi-level local features. It then uses a Transformer encoder to process these local features and extract features that reflect the long-range temporal dependencies of the input frequency series data as the second feature path.

[0019] The third module uses a deep feature fusion network to adaptively fuse, nonlinearly transform and classify the first and second features to detect abnormal frequency sequences.

[0020] Furthermore, in the first module, a variety of candidate wavelet basis functions are used to perform wavelet transform on the input frequency series data, and the wavelet basis functions that match the abnormal patterns in the frequency series data are adaptively selected to perform multi-layer decomposition to extract multi-scale features as the first-path features; the dimension of the first-path features is [batch_size, M], batch_size is the number of batched frequency sequences; M is the dimension of statistical features extracted by wavelet transform.

[0021] Furthermore, the processing in the first module includes:

[0022] 1) Taking the input frequency sequence data as the original signal, a variety of candidate wavelet basis functions are used to perform multi-layer decomposition, and the multi-scale features corresponding to each candidate wavelet basis function are extracted;

[0023] The scale function and the wavelet function of the multiple candidate wavelet basis functions are selected from the following function types:

[0024] (1) A scaling function with good low-frequency reconstruction capability and smoothness characteristics to process low-frequency signals in frequency sequences with abnormal frequency drift and jump patterns;

[0025] (2) Scaling functions with time localization and compact support characteristics are used to process low-frequency signals of frequency sequences with frequency outliers or frequency jump abnormal patterns;

[0026] (3) a plurality of wavelet functions having high correlation coefficients with the slope change characteristics of the frequency drift jump, the peak characteristics of the frequency anomaly value, or the step characteristics of the frequency jump, so as to be used for processing the high-frequency signals of the frequency sequence of the frequency drift jump, the frequency anomaly value, or the frequency jump abnormal pattern;

[0027] 3) Reconstruct the signal according to the multi-scale features corresponding to each candidate wavelet basis function to obtain the corresponding reconstructed signal;

[0028] 4) Based on the calculated reconstruction indicators including the mean square error and correlation coefficient between the reconstructed signal and the original signal, the multi-scale features after multi-layer decomposition corresponding to the wavelet basis function with the best reconstruction performance are selected and output as the output features of the first module.

[0029] Furthermore, the dual-path multi-scale CNN network in the CNN-Transformer network includes: a small-scale convolution branch, a large-scale convolution branch, a feature splicing module, an attention enhancement module, a feature mapping module, a weight calculation module and a feature weighting module; wherein,

[0030] The small-scale convolution branch uses a convolution kernel of size 3 to capture local rapid changes and extract features reflecting point anomalies;

[0031] The large-scale convolution branch uses a convolution kernel size of 15 to perceive a wider range of pattern changes and extract features reflecting persistent anomalies including long-term frequency drift and frequency hopping anomalies;

[0032] The feature splicing module is used to splice the features output by the small-scale convolution branch and the large-scale convolution branch, and output the spliced ​​features;

[0033] Attention enhancement module, which uses the dot product attention mechanism to highlight the important features in the concatenated features;

[0034] The feature mapping module is used to perform feature mapping using 1x1 convolution and adjust the dimension of the output features of the attention enhancement module to obtain the mapped features;

[0035] The weight calculation module is used to calculate the weight of each feature using the Softmax function;

[0036] The feature weighting module is used to adjust the features spliced ​​by the feature splicing module using the calculated weights to obtain multi-level local features.

[0037] Furthermore, both the small-scale convolution branch and the large-scale convolution branch contain layers of convolution, normalization, activation, and pooling operations, enabling the model to simultaneously capture local subtle changes and global trend shifts in frequency data, thereby improving its adaptability to different types of anomalies. Group normalization is used in the normalization layer, and the LeakyReLU activation function is used in the activation layer.

[0038] Furthermore, a two-layer Transformer encoder is used in the CNN-Transformer network to process the multi-level local features output by the dual-path multi-scale CNN network. Each layer of the encoder contains a multi-head self-attention mechanism and a feedforward neural network. The second-channel features are output through the Transformer encoder. The second-channel features are three-dimensional feature data with a dimension of [batch_size, 1, N], where batch_size is the number of batch samples; 1 represents a single-channel time series, and N represents the number of sampling points in the time window.

[0039] Furthermore, the first and second features are subjected to a feature fusion process, including:

[0040] 1) The second-path feature three-dimensional data is mapped into feature space to obtain the second-path two-dimensional feature vector F transformer ;

[0041] 2) The first path of features is mapped through feature expansion to expand the data dimension to the first path of two-dimensional feature vector F aligned with the dimension of the two-dimensional feature vector in step 1) wavelet ;

[0042] 3) Concatenate the first two-dimensional feature vector and the second two-dimensional feature vector in the feature dimension to obtain a concatenated feature vector [F transformer ; F wavelet ];

[0043] 4) The concatenated feature vectors are mapped to a unified feature space through a fusion network to obtain fusion features that effectively integrate time domain and frequency domain information.

[0044] Furthermore, the fusion feature F output by the fusion network fused for:

[0045] F fused =LeakyReLU(LayerNorm(W fusion ×[F transformer ; F wavelet ]+b))

[0046] Among them, [F transformer ; F wavelet ] represents feature connection, W fusionand b are learnable fusion network parameters, LayerNorm(·) is the normalization function, and LeakyReLU(·) is the activation function.

[0047] The atomic clock frequency anomaly detection method disclosed in the present invention has the following beneficial effects:

[0048] 1. Adopting a multimodal feature fusion framework: Combining the analytical capabilities of wavelet transform with the modeling capabilities of deep learning, and extracting multi-scale time-frequency features through adaptive wavelet decomposition, it overcomes the limitations of single time domain analysis and improves the ability to detect weak abnormal signals.

[0049] 2. Adopting a multi-scale CNN architecture: A dual-path parallel convolution structure is proposed. Small-scale and large-scale convolution kernels are used to capture local rapid changes and global trend deviations respectively. Combined with the dot-product attention mechanism, it adaptively focuses on potential abnormal areas, effectively solving the problem of differences in the time scale of different types of abnormalities.

[0050] 3. Long-distance dependency modeling: The Transformer encoder was introduced to model long-distance dependencies in the sequence, overcoming the gradient vanishing problem of the traditional RNN model when processing long sequences, and providing technical support for contextual analysis of frequency anomalies.

[0051] In summary, the atomic clock frequency anomaly detection method disclosed in the present invention achieves high-precision detection of frequency anomalies with different characteristics, including frequency jumps, frequency drift jumps, and frequency outliers, expands the detection range, and improves the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like parts throughout the drawings.

[0053] Figure 1 Flowchart of a method for detecting anomaly in atomic clock frequency according to an embodiment of the present invention;

[0054] Figure 2 Schematic diagram of the CNN-Transformer network structure in an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, which constitute a part of this application and are used to illustrate the principles of the present invention together with the embodiments of the present invention.

[0056] One embodiment of the present invention discloses a method for detecting anomaly in atomic clock frequency. Figure 1 As shown, including:

[0057] S1, collect atomic clocks and inject known abnormal patterns into the normal frequency sequence to generate a labeled frequency sequence set;

[0058] S2, supervised training of anomaly detection model using frequency sequence set;

[0059] In the anomaly detection model, on the one hand, the input frequency sequence is decomposed by a discrete wavelet transform to extract the first channel of features. On the other hand, after the input frequency sequence is subjected to multi-level local feature extraction using a CNN network, a Transformer encoder is used to extract the second channel of features from the local features to reflect the long-distance temporal dependency of the frequency sequence in the training data. The first and second channel features are then subjected to feature fusion, nonlinear transformation, and classification to detect the frequency sequence where anomalies occur.

[0060] S3. Use the trained anomaly detection model to perform frequency anomaly detection on the atomic clock frequency sequence collected in real time.

[0061] Specifically, in S1,

[0062] 1) Each sequence in the frequency sequence set is a frequency sequence segment obtained by performing sliding window sampling with a set data window length and sliding step size on the normal frequency sequence output by the atomic clock; adjacent windows of the sliding window sampling meet the set data overlap rate;

[0063] In a specific example of this embodiment, each data window contains 200 continuous frequency sampling points, and the sliding step is set to 50 sampling points to ensure a 75% overlap rate between adjacent windows and enhance the continuity of feature extraction.

[0064] 2) Selecting a set ratio of sequences from the frequency sequence set to inject abnormal patterns; abnormal patterns include frequency hopping, frequency drift hopping, and frequency outliers;

[0065] In a specific example of this embodiment, during the anomaly injection process, time positions are randomly selected as anomaly points, and the average anomaly amplitudes added to these positions are 2.17×10 -6 , 1.16×10 -6 and 1.4×10 -6 The three types of anomalies are frequency jump, frequency drift jump and frequency outlier. The anomaly direction is randomly selected to be positive or negative, and a random perturbation of 0.8-1.2 times the basic amplitude is applied to increase the diversity of anomaly patterns.

[0066] 3) Data are labeled using window-level binary classification labels, where label 0 represents a normal frequency sequence and label 1 represents an abnormal frequency sequence.

[0067] 4) Divide the frequency sequence set into a training set and a test set to provide a data basis for subsequent model training.

[0068] In a specific example of this embodiment, a stratified sampling strategy was used to construct the training and test sets to ensure representative data distribution and model generalization capabilities. All samples were first randomly divided into training and test sets at a ratio of 8:2 to ensure the independence of the test set. During the training set construction process, 95% of the windows were kept as original normal samples, and the remaining 5% of windows were injected with anomalies to form abnormal samples, thereby constructing a balanced dataset containing both normal and abnormal samples. The test set used the same anomaly injection ratio to ensure consistency between the training and test distributions.

[0069] Specifically, in S2, the anomaly detection model includes: a first module, a second module and a third module; wherein,

[0070] In the first module, the wavelet transform network is used to perform multi-layer decomposition on the input frequency series data and extract multi-scale features as the first feature path;

[0071] The second module uses a CNN-Transformer network. It first uses a dual-path multi-scale CNN layer to parallel process the input frequency series data at different receptive field scales to extract multi-level local features. It then uses a Transformer encoder to process these local features and extract features that reflect the long-range temporal dependencies of the input frequency series data as the second feature path.

[0072] The third module uses a deep feature fusion network to adaptively fuse, nonlinearly transform and classify the first and second features to detect abnormal frequency sequences.

[0073] Among them, in the first module, adaptive discrete wavelet transform is used to extract multi-scale features. In the adaptive discrete wavelet transform, a variety of candidate wavelet basis functions are used to perform wavelet transform on the input frequency sequence data respectively, and the wavelet basis function that matches the abnormal pattern in the frequency sequence data is adaptively selected from the candidate wavelet basis functions. The multi-scale features extracted by multi-layer decomposition are used as the first-path features; the dimension of the first-path features is [batch_size,M], batch_size is the number of batched frequency sequences; M is the dimension of the statistical features extracted by wavelet transform.

[0074] Specifically, the processing in the first module includes:

[0075] 1) Taking the input frequency sequence data as the original signal, the original signal is decomposed into multiple layers using a variety of candidate wavelet basis functions, and the multi-scale features corresponding to each candidate wavelet basis function are extracted;

[0076] The scale function and the wavelet function of the multiple candidate wavelet basis functions are selected from the following function types:

[0077] (1) Scaling functions with good low-frequency reconstruction capability and smoothness characteristics, used to process low-frequency signals in frequency sequences with abnormal frequency drift and jump patterns; for example, scaling functions of the Daubechies wavelet family;

[0078] (2) Scaling functions with time localization and compact support characteristics, used to process low-frequency signals of frequency sequences with frequency outliers or frequency jump abnormal patterns; for example, scaling functions of the Biorthogonal wavelet family;

[0079] (3) Multiple wavelet functions with high correlation coefficients with the slope change characteristics of frequency drift jumps, the peak characteristics of frequency anomalies, or the step characteristics of frequency jumps, so as to process high-frequency signals of frequency sequences with frequency drift jumps, frequency anomalies, or frequency jump abnormal patterns; wavelet functions of the Coiflets wavelet family.

[0080] The formula for wavelet decomposition is as follows:

[0081] The atomic clock frequency signal is a discrete sequence x[n], where n=0, 1, 2, ..., N-1. It is decomposed using discrete wavelet transform. After convolution of the scaling function φ[n] and the wavelet function ψ[n], the low-frequency component cA[k] and the high-frequency component cD[k] are obtained:

[0082]

[0083] Among them, cA j [k]、cD j [k] are the low-frequency component and high-frequency component of the k-th position in the j-th layer, respectively, h j [·] and g j [·] are the coefficients of the low-pass filter and high-pass filter of the j-th layer, n-2k represents the position index of the convolution operation, j=1,…,J, J is the number of decomposition layers, Downsampling means that the length of the output sequence is half of the original signal length.

[0084] 3) Reconstruct the signal according to the multi-scale features corresponding to each candidate wavelet basis function to obtain the corresponding reconstructed signal;

[0085] The reconstruction formula of its wavelet transform is:

[0086]

[0087] Among them, φ j,k [n] and ψ j′,k[n] is the basis function after scale and translation transformation.

[0088] 4) Based on the calculated reconstruction indicators including the mean square error and correlation coefficient between the reconstructed signal and the original signal, the multi-scale features after multi-layer decomposition corresponding to the wavelet basis function with the best reconstruction performance are selected and output as the output features of the first module.

[0089] Among them, the second module CNN-Transformer network includes a dual-path multi-scale CNN network and a Transformer network;

[0090] A dual-path multi-scale CNN network is used to extract frequency anomalies of atomic clocks at different time scales;

[0091] The dual-path multi-scale CNN network includes: a small-scale convolution branch, a large-scale convolution branch, a feature splicing module, an attention enhancement module, a feature mapping module, a weight calculation module and a feature weighting module; wherein,

[0092] The small-scale convolution branch uses a convolution kernel of size 3 (kernel=3) to capture local rapid changes and extract features reflecting point anomalies;

[0093] The large-scale convolution branch uses a convolution kernel of size 15 (kernel=15) to perceive a wider range of pattern changes and extract features reflecting persistent anomalies including long-term frequency drift and frequency hopping anomalies;

[0094] The feature splicing module is used to splice the features output by the small-scale convolution branch and the large-scale convolution branch, and output the spliced ​​features;

[0095] Attention enhancement module, which uses the dot product attention mechanism to highlight the important features in the concatenated features;

[0096] The feature mapping module is used to perform feature mapping using 1x1 convolution and adjust the dimension of the output features of the attention enhancement module to obtain the mapped features;

[0097] The weight calculation module is used to calculate the weight of each feature using the Softmax function;

[0098] The feature weighting module is used to adjust the features spliced ​​by the feature splicing module using the calculated weights to obtain multi-level local features.

[0099] Specifically, the small-scale convolution branch and the large-scale convolution branch are designed in parallel, both containing layers of convolution, normalization, activation, and pooling operations, enabling the model to simultaneously capture local subtle changes and global trend shifts in frequency data, thereby improving its adaptability to different types of anomalies. Group normalization is used in the normalization layer to enhance the stability of small-batch training. The LeakyReLU activation function is used in the activation layer.

[0100] The calculation formula for group normalization is:

[0101]

[0102] Here, x is the input, μ and σ are the mean and standard deviation within each group, and γ and β are learnable scaling and offset parameters.

[0103] Specifically,

[0104] Atomic clock frequency anomalies often manifest as abnormal deviations at certain key points in the sequence. To solve the problem that traditional models focus on overall features while ignoring local but key features,

[0105] In the attention enhancement module, a dot product attention mechanism is added to highlight the important features in the spliced ​​features, thereby improving the model's sensitivity to outliers.

[0106] In the feature mapping module, the output features of the attention enhancement module are reduced in dimension through a series of 1×1 convolutional layers;

[0107] In the weight calculation module, the attention weight distribution at each time point is generated, and the Softmax function is applied to ensure that the sum of the weights is 1; the weight calculation is:

[0108] α=Softmax(W2·σ(W1·X))

[0109] Among them, X is the concatenated feature, W1 is the first parameter matrix, which is used to highlight the important features of X; σ(W1·X) is the dimensionality reduction through 1×1 convolution; W2 is the second parameter matrix, which is used to further adjust the parameters and reduce the dimensionality of the reduced features. Softmax(·) converts the parameters into parameters α with a sum of weights of 1.

[0110] Multiplying the original features with the attention weights enables the model to adaptively highlight the features of potential outliers while suppressing the contribution of normal areas;

[0111] X weighted =X·α.

[0112] The CNN-Transformer network uses a two-layer Transformer encoder to process the multi-level local features output by the dual-path multi-scale CNN network. Each layer of the encoder contains a multi-head self-attention mechanism and a feedforward neural network. The second-channel features are output through the Transformer encoder. The second-channel features are three-dimensional feature data with a dimension of [batch_size, 1, N], where batch_size is the number of batch samples; 1 represents a single-channel time series, and N represents the number of sampling points in the time window.

[0113] The position encoding function of Transformer embeds sequence position information into the feature representation, enabling the model to distinguish the same features at different positions. The position encoding function formula is:

[0114]

[0115] Among them, pos is the position index, i is the data dimension index, d model It is the unified input dimension of the Transformer model. The sine-cosine encoding method can provide temporal position information for the model and is not limited by the sequence length.

[0116] The multi-head attention mechanism of the Transformer model consists of multiple self-attention mechanism modules, allowing the model to learn feature associations from different representation subspaces. Assuming that the input data has N features, the input data X is linearly transformed to obtain the query vector Q, the key vector K, and the value vector V. The attention score matrix obtained by the self-attention mechanism satisfies formula (9).

[0117]

[0118] Among them, d k Represents the dimension of the key vector sequence, d k =d model / h, h represents the number of self-attention mechanism modules.

[0119] The multi-head attention mechanism maps the query vector Q, key vector K, and value vector V through a fully connected neural network and then inputs them into multiple self-attention mechanism modules. Then, the outputs of multiple self-attention mechanism modules are spliced ​​and integrated through a fully connected layer. The score matrix of the multi-head attention mechanism module can be expressed as:

[0120] MultiHead(Q,K,V)=Concat(head1,…,head h )W O

[0121] Among them, the calculation formula for each attention head is as follows:

[0122]

[0123] Among them, W Q ,W K ,W V and W O Represents the parameter matrix of the fully connected layer.

[0124] The Transformer model structure can effectively capture long-range dependencies in frequency sequences, which is particularly important for identifying and detecting frequency anomalies. This global modeling capability complements the aforementioned local feature extraction and jointly improves anomaly detection performance. Figure 2 Schematic diagram of the structure of the CNN-Transformer model.

[0125] Among them, in the third module, the feature fusion process of the first and second features includes:

[0126] 1) The second-path feature three-dimensional data is mapped into feature space to obtain the second-path two-dimensional feature vector F transformer ;

[0127] Features are extracted through CNN-Transformer. The data format is a three-dimensional tensor [batch_size, 1, N]. A fusion method based on feature space mapping is adopted. For three-dimensional data, multi-scale convolution, attention mechanism and Transformer encoder are used for feature extraction. Finally, global average pooling is used to aggregate the sequence features into a two-dimensional feature vector of [batch_size, 128].

[0128] 2) The first path of features is mapped through feature expansion to expand the data dimension to the first path of two-dimensional feature vector F aligned with the dimension of the two-dimensional feature vector in step 1) wavelet ;

[0129] For the first-path features, the M-dimensional features are expanded and mapped to a 128-dimensional feature space through a two-layer fully connected network to achieve dimensional alignment with the second-path features.

[0130] 3) Concatenate the first two-dimensional feature vector and the second two-dimensional feature vector in the feature dimension to obtain a concatenated feature vector [F transformer ; F wavelet ];

[0131] 4) The concatenated feature vectors are mapped to a unified feature space through a fusion network to obtain fusion features that effectively integrate time domain and frequency domain information.

[0132] Specifically, the fusion feature F output by the fusion network fused for:

[0133] Ffused =LeakyReLU(LayerNorm(W fusion ×[F transformer ; F wavelet ]+b))

[0134] Among them, [F transformer ; F wavelet ] represents feature connection, W fusion and b are learnable fusion network parameters, LayerNorm(·) is the normalization function, and LeakyReLU(·) is the activation function.

[0135] The fused features are input into the multi-layer perceptron for nonlinear transformation, and the output is an anomaly detection probability score through the Sigmoid function. The format is a two-dimensional tensor of [batch_size, 1]. The output value range is between 0 and 1, where a value close to 1 indicates a high probability of anomaly, and a value close to 0 indicates a high probability of normal state.

[0136] An end-to-end training method is adopted. After training, the trained model is used to detect anomalies on the test data, and three evaluation indicators are used to comprehensively evaluate the model performance: Precision, Recall and F-Score.

[0137] Specifically, in S3, when frequency anomaly detection is performed on the atomic clock frequency sequence collected in real time, the sliding window method in step S1 is used to slide the window of the atomic clock frequency sequence collected in real time, and the window data is output to the trained anomaly detection model. Whether the frequency sequence in the window data is abnormal is detected based on the output result of the anomaly detection model.

[0138] In summary, the atomic clock frequency anomaly detection method disclosed in this embodiment achieves high-precision detection of frequency anomalies with different characteristics, including frequency jumps, frequency drift jumps, and frequency outliers, expands the detection range, and improves detection accuracy.

[0139] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with this technical field within the technical scope disclosed by the present invention should be covered by the scope of protection of the present invention.

Claims

1. A method for detecting anomaly in atomic clock frequency, characterized in that: include: S1, collect atomic clocks and inject known abnormal patterns into the normal frequency sequence to generate a labeled frequency sequence set; S2, supervised training of anomaly detection model using frequency sequence set; In the anomaly detection model, on the one hand, the input frequency sequence is decomposed by a discrete wavelet transform to extract the first channel of features. On the other hand, after the input frequency sequence is subjected to multi-level local feature extraction using a CNN network, a Transformer encoder is used to extract the second channel of features from the local features to reflect the long-distance temporal dependency of the frequency sequence in the training data. The first and second channel features are then subjected to feature fusion, nonlinear transformation, and classification to detect the frequency sequence where anomalies occur. S3. Use the trained anomaly detection model to perform frequency anomaly detection on the atomic clock frequency sequence collected in real time.

2. The method for detecting anomaly in atomic clock frequency according to claim 1, wherein: In the S1, Each sequence in the frequency sequence set is a frequency sequence segment obtained by performing sliding window sampling with a set data window length and sliding step length on the normal frequency sequence output by the atomic clock; adjacent windows of the sliding window sampling meet the set data overlap rate; Selecting a set ratio of sequences from a frequency sequence set to inject abnormal patterns; abnormal patterns include frequency hopping, frequency drift hopping, and frequency outliers; Window-level binary classification labels are used for data annotation, where label 0 represents a normal frequency sequence and label 1 represents an abnormal frequency sequence.

3. The method for detecting anomaly in atomic clock frequency according to claim 2, wherein: The anomaly detection model includes: a first module, a second module and a third module; wherein, In the first module, the wavelet transform network is used to perform multi-layer decomposition on the input frequency series data and extract multi-scale features as the first feature path; The second module uses a CNN-Transformer network. It first uses a dual-path multi-scale CNN layer to parallel process the input frequency series data at different receptive field scales to extract multi-level local features. It then uses a Transformer encoder to process these local features and extract features that reflect the long-range temporal dependencies of the input frequency series data as the second feature path. The third module uses a deep feature fusion network to adaptively fuse, nonlinearly transform and classify the first and second features to detect abnormal frequency sequences.

4. The method for detecting anomaly in atomic clock frequency according to claim 3, wherein: In the first module, a variety of candidate wavelet basis functions are used to perform wavelet transform on the input frequency series data, and the wavelet basis functions that match the abnormal patterns in the frequency series data are adaptively selected to perform multi-layer decomposition to extract multi-scale features as the first-path features; the dimension of the first-path features is [batch_size, M], where batch_size is the number of batched frequency sequences; M is the dimension of statistical features extracted by wavelet transform.

5. The method for detecting anomaly in atomic clock frequency according to claim 3, wherein: The processing in the first module includes: 1) Taking the input frequency sequence data as the original signal, a variety of candidate wavelet basis functions are used to perform multi-layer decomposition, and the multi-scale features corresponding to each candidate wavelet basis function are extracted; The scale function and the wavelet function of the multiple candidate wavelet basis functions are selected from the following function types: (1) A scaling function with good low-frequency reconstruction capability and smoothness characteristics to process low-frequency signals in frequency sequences with abnormal frequency drift and jump patterns; (2) Scaling functions with time localization and compact support characteristics are used to process low-frequency signals of frequency sequences with frequency outliers or frequency jump abnormal patterns; (3) a plurality of wavelet functions having high correlation coefficients with the slope change characteristics of the frequency drift jump, the peak characteristics of the frequency anomaly value, or the step characteristics of the frequency jump, so as to be used for processing the high-frequency signals of the frequency sequence of the frequency drift jump, the frequency anomaly value, or the frequency jump abnormal pattern; 3) Reconstruct the signal according to the multi-scale features corresponding to each candidate wavelet basis function to obtain the corresponding reconstructed signal; 4) Based on the calculated reconstruction indicators including the mean square error and correlation coefficient between the reconstructed signal and the original signal, the multi-scale features after multi-layer decomposition corresponding to the wavelet basis function with the best reconstruction performance are selected and output as the output features of the first module.

6. The method for detecting anomaly in atomic clock frequency according to claim 3, wherein: The dual-path multi-scale CNN network in the CNN-Transformer network includes: small-scale convolution branch, large-scale convolution branch, feature splicing module, attention enhancement module, feature mapping module, weight calculation module and feature weighting module; among them, The small-scale convolution branch uses a convolution kernel of size 3 to capture local rapid changes and extract features reflecting point anomalies; The large-scale convolution branch uses a convolution kernel size of 15 to perceive a wider range of pattern changes and extract features reflecting persistent anomalies including long-term frequency drift and frequency hopping anomalies; The feature splicing module is used to splice the features output by the small-scale convolution branch and the large-scale convolution branch, and output the spliced ​​features; Attention enhancement module, which uses the dot product attention mechanism to highlight the important features in the concatenated features; The feature mapping module is used to perform feature mapping using 1x1 convolution and adjust the dimension of the output features of the attention enhancement module to obtain the mapped features; The weight calculation module is used to calculate the weight of each feature using the Softmax function; The feature weighting module is used to adjust the features spliced ​​by the feature splicing module using the calculated weights to obtain multi-level local features.

7. The method for detecting anomaly in atomic clock frequency according to claim 6, wherein: Both the small-scale convolution branch and the large-scale convolution branch contain layers of convolution, normalization, activation, and pooling operations, enabling the model to simultaneously capture local subtle changes and global trend shifts in frequency data, thereby improving its adaptability to different types of anomalies. Group normalization is used in the normalization layer, and the LeakyReLU activation function is used in the activation layer.

8. The method for detecting anomaly in atomic clock frequency according to claim 6, wherein: The CNN-Transformer network uses a two-layer Transformer encoder to process the multi-level local features output by the dual-path multi-scale CNN network. Each layer of the encoder contains a multi-head self-attention mechanism and a feedforward neural network. The second channel of features is output through the Transformer encoder. The second feature is three-dimensional feature data with a dimension of [batch_size, 1, N], where batch_size is the number of batch samples; 1 represents a single-channel time series, and N represents the number of sampling points in the time window.

9. The method for detecting anomaly in atomic clock frequency according to claim 8, wherein: The feature fusion process of the first and second features includes: 1) The second-path feature three-dimensional data is mapped into feature space to obtain the second-path two-dimensional feature vector F transformer ; 2) The first path of features is mapped through feature expansion to expand the data dimension to the first path of two-dimensional feature vector F aligned with the dimension of the two-dimensional feature vector in step 1) wavelet ; 3) Concatenate the first two-dimensional feature vector and the second two-dimensional feature vector in the feature dimension to obtain a concatenated feature vector [F transformer ; F wavelet ]; 4) The concatenated feature vectors are mapped to a unified feature space through a fusion network to obtain fusion features that effectively integrate time domain and frequency domain information.

10. The method for detecting anomaly in atomic clock frequency according to claim 9, wherein: The fusion feature F output by the fusion network fused for: F fused =LeakyReLU(LayerNorm(W fusion ×[F transformer ;F wavelet ]+b)) Among them, [F transformer ; F wavelet ] represents feature connection, W fusion and b are learnable fusion network parameters, LayerNorm(·) is the normalization function, and LeakyReLU(·) is the activation function.

Citation Information

Cited By

  • Method and device for deducting frequency drift of hydrogen atomic clock

    CN121276931A

  • Method and device for frequency drift subtraction of a hydrogen maser

    CN121276931B