A Beidou time synchronization attack detection method based on PSO-GRU under extreme weather conditions

By using the PSO-GRU network model to predict the clock state of the Beidou system and perform adaptive sliding window data preprocessing, the problems of inaccurate clock state estimation and low detection efficiency in the prior art are solved, and more efficient Time synchronization attack detection.

CN118584515BActive Publication Date: 2025-02-21NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410622178.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2025-02-21
Estimated Expiration
2044-05-20

AI Technical Summary

Technical Problem

The prior art is difficult to estimate the clock state of the Beidou system in real time in extreme weather, and the detection method based on neural networks has problems such as low accuracy, low computing efficiency and difficulty in parameter adjustment.

Method used

Using a PSO-GRU-based detection method, the PSO-GRU network model is constructed and trained, the clock state is predicted, and data preprocessing is used to detect and identify the type of time synchronization attacks.

Benefits of technology

It improves the accuracy and efficiency of Beidou system clock state estimation in extreme weather, reduces the risks of gradient explosion, gradient disappearance and overfitting, and improves the accuracy and efficiency of time-synchronous attack detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118584515B_ABST
    Figure CN118584515B_ABST
Patent Text Reader

Abstract

The present invention proposes a Beidou time synchronization attack detection method based on PSO-GRU under extreme weather conditions, including: constructing and training a PSO-GRU network model for predicting clock states; preprocessing Beidou clock data under the extreme weather conditions based on an adaptive sliding window; predicting and measuring clock states; performing time synchronization attack detection and identifying the type of time synchronization attack, and completing Beidou time synchronization attack detection based on PSO-GRU under extreme weather conditions. The present invention solves the problem that the time synchronization attack detection method based on Kalman filtering is greatly affected by noise and outliers in the data under extreme weather conditions, and it is difficult to estimate the clock state in real time. The present invention has good nonlinear mapping capabilities and a high degree of self-learning capabilities, and can avoid problems such as gradient explosion, gradient disappearance, and overfitting. At the same time, the accuracy and efficiency of TSA detection can be improved to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a Beidou time synchronization attack detection method, in particular to a Beidou time synchronization attack detection method based on PSO-GRU under extreme weather. Background Art

[0002] The BeiDou satellite navigation system can provide high-precision, high-reliability positioning, navigation, and timing services to all types of users around the world, all day and all night. It has been widely used in transportation, communications, electricity and other fields, and has become one of the foundations of the modern information society. However, due to the lack of authentication and encryption measures for BeiDou system signals, it is easy to receive false satellite signals sent by malicious attackers, causing the receiver to generate and output wrong time signals, affecting the normal operation of the system, and then causing catastrophic consequences. In addition, when extreme weather occurs, such as extreme heavy rainfall, typhoons, floods, etc., the signal may be affected to varying degrees by various factors such as atmospheric delay, causing the system to confuse the clock state and become abnormal, which brings additional challenges to the detection of time synchronization attacks on the BeiDou system. Therefore, detecting time synchronization attacks in extreme weather is of great significance to improving the accuracy of BeiDou system timing and ensuring the normal operation of key infrastructure in various fields. Khalajmehrabadi et al. used energy functional regularization based on Kalman filtering to optimally estimate the attack on the receiver clock error, and based on the constructed compensation model, used the estimated attack to compensate the receiver clock error, so that the receiver can still provide accurate time when it is attacked by time synchronization. However, it is difficult to select appropriate regularization parameters under extreme weather conditions, which may cause the estimation results to be over-smoothed or insufficient to suppress the influence of noise and attacks, and fail to accurately estimate the receiver clock error, which directly affects the accuracy and efficiency of TSA detection. Lee et al. proposed a tuning-free robust estimator against GNSS spoofing attacks. The robust estimator models the clock state as a first-order model. However, since the clock frequency undergoes nonlinear changes under extreme weather conditions, the second-order term of the clock frequency drift usually exists, so the first-order model affects the accuracy of the clock state estimate under extreme weather conditions. Therefore, even in the absence of time synchronization attacks, the estimator estimates and corrects the frequency drift as part of TSA. Chauhan et al. proposed an anti-spoofing state estimator that fuses GNSS and PMU using an extended Kalman filter. However, the extended Kalman filter may perform poorly when dealing with rapid and drastic changes in the system clock state caused by extreme weather, and the estimator is at risk of divergence when there is an interruption in the data or a sudden change in the bias.

[0003] With the rise of data mining and machine learning in recent years, deep learning-based methods have been used to detect GNSS time synchronization attacks. Orouji et al. proposed a method for correcting the receiver clock state based on a multilayer perceptron neural network. However, since the perceptron network lacks intrinsic time dynamic processing capabilities and does not contain cyclic connections, it cannot maintain the memory of historical clock states, resulting in low accuracy of the predicted clock state results, and is not a model suitable for clock state sequence prediction. Liu et al. proposed a time synchronization attack detection algorithm based on a long short-term memory neural network. The long short-term memory neural network model is used to predict the clock state and thus detect time synchronization attacks. The results show that the long short-term memory neural network has more accurate detection capabilities than existing algorithms. However, due to the low computational efficiency of the long short-term memory neural network and the need to rely on a large amount of training data, the TSA detection efficiency is low.

[0004] In summary, the prior art has the following problems:

[0005] (1) The existing time synchronization attack detection method based on Kalman filtering is greatly affected by noise and outliers in the data under extreme weather conditions, making it difficult to estimate the clock state in real time.

[0006] (2) Existing neural network-based time synchronization attack detection methods have low accuracy, rely on a large amount of training data, require manual adjustment of multiple parameters, take a long time to train and predict, and are prone to problems such as gradient explosion, gradient vanishing, and overfitting. Summary of the invention

[0007] Purpose of the invention: The technical problem to be solved by the present invention is to provide a Beidou time synchronization attack detection method based on PSO-GRU under extreme weather conditions in view of the shortcomings of the prior art.

[0008] In order to solve the above technical problems, the present invention discloses a Beidou time synchronization attack detection method based on PSO-GRU under extreme weather conditions, comprising the following steps:

[0009] Step 1, build and train a PSO-GRU network model to predict clock states;

[0010] Step 2, preprocessing the Beidou clock data under the extreme weather based on an adaptive sliding window;

[0011] Step 3, predicting and measuring clock status;

[0012] Step 4: Based on the predicted and measured clock states obtained in step 3, time synchronization attack detection is performed and the type of time synchronization attack is identified, completing Beidou time synchronization attack detection based on PSO-GRU under extreme weather conditions.

[0013] Furthermore, the construction and training of the PSO-GRU network model described in step 1 includes the following steps:

[0014] Step 1-1, construct a training data set;

[0015] Step 1-2, build a PSO-GRU network model;

[0016] Steps 1-3: train the PSO-GRU network model, that is, use the PSO algorithm to optimize the GRU network model parameters.

[0017] Furthermore, the step 1-1 of constructing a training data set specifically includes:

[0018] The original Beidou satellite data that has not been attacked by time synchronization is post-processed, and the actual clock deviation and clock drift are calculated according to the timing principle. The training data set is Among them, the clock bias X and clock drift in the original Beidou satellite data that has not been attacked by time synchronization as follows:

[0019] X=[b u,m (t),b u,m (t-τ),b u,m (t-2τ),…,b u,m (t-nτ)]

[0020]

[0021] Where τ represents the time interval between epochs, n represents the number of data in the clock sequence, and X represents the measured receiver clock bias of the Beidou satellite from epoch t-nτ to t. represents the measured receiver clock drift of Beidou satellite from epoch t-nτ to t; b u,m (t) represents the historical measured receiver clock bias, represents the historical measured receiver clock drift, u represents the data received by the BDS receiver, and m represents the actual measurement value.

[0022] Furthermore, the construction of the PSO-GRU network model described in step 1-2 specifically includes:

[0023] Step 1-2-1, constructing a GRU network model, the GRU network model specifically includes:

[0024] A reset gate is used to determine the historical data that needs to be retained, as follows:

[0025] r t =σ(W r ·[h t-1 ,xt ])

[0026] Among them, x t Indicates the clock status data input at the current moment, h t-1 represents the hidden state at the previous moment, r t is the reset gate output at the current moment, · represents the matrix product, σ represents the sigmoid function, W r is the weight matrix of the reset gate;

[0027] An update gate is used to determine the length of historical data to be retained, as follows:

[0028] z t =σ(W z ·[h t-1 ,x t ])

[0029] Among them, z t Represents the update gate output at the current moment, W z is the weight matrix of the update gate;

[0030] A candidate hidden state is used to represent a temporary hidden state, which contains the current input data and historical data, as follows:

[0031] h′ t =tanh(W h' ·[r t *h t-1 ,x t ])

[0032] Among them, h′ t is the candidate hidden layer state at the current moment, W h' is the weight matrix of the candidate hidden state, * represents the dot product, and tanh is the hyperbolic tangent function;

[0033] According to the reset gate, update gate and candidate hidden state, the current hidden state is calculated as follows:

[0034] h t =(1-z t )*h t-1 +z t *h′ t

[0035] Among them, h t is the final hidden state at the current moment;

[0036] Step 1-2-2, initialize the PSO algorithm parameters, use the number of hidden layers, time series length and number of hidden layer nodes of the GRU network model as the optimization hyperparameters of the PSO algorithm, set the range of the optimization hyperparameters and particle speed in the PSO algorithm, set the maximum number of iterations and the maximum flight speed of the particles;

[0037] Step 1-2-3, define the fitness, and use the mean square error of the clock state prediction value output by the GRU network model as the particle fitness value S in the PSO algorithm (θ) , as follows:

[0038]

[0039] Among them, n0 is the number of experimental predictions, z i represents the actual value, and z represents the predicted value;

[0040] Step 1-2-4, use the position information of particles in the PSO algorithm as the parameters of the GRU network model to complete the construction of the PSO-GRU network model.

[0041] Furthermore, the PSO algorithm is used to optimize the GRU network model parameters described in steps 1-3, specifically including:

[0042] Step 1-3-1, train the GRU network model, obtain the fitness value of each particle in the PSO algorithm, and update the current individual extreme value and group extreme value;

[0043] Step 1-3-2, iteratively update the particle velocity and position information using nonlinear inertia weights according to the current individual extreme value and group extreme value:

[0044] v id k+1 =ωV id k +Z1r1(P id k -X id k )+Z2r2(P gd k -X id k )

[0045]

[0046] Where k represents the current iteration number; V id k , X id k , P id k and P gd kThey represent the speed and position of the particle in the PSO algorithm, the local optimal solution of particle i, and the global optimal solution of the particle swarm; Z1, Z2∈[1,4] are environmental acceleration factors; r1, r2 are random real numbers in [0,1]; ω∈[0.5,1.5] is the inertia factor, and its value is non-negative;

[0047] Step 1-3-3, when the number of iterations reaches the set maximum number of iterations, the PSO algorithm terminates, and the optimal number of hidden layers L, time series length T, and number of hidden layer nodes H of the GRU network model are obtained. Based on this, steps 1-3 are re-executed to conduct a new round of PSO-GRU network model training.

[0048] Further, the preprocessing of the Beidou clock data under the extreme weather conditions based on the adaptive sliding window described in step 2 specifically includes:

[0049] Step 2-1, initialize the sliding window length to w;

[0050] Step 2-2, calculate the sliding window standard deviation of the Beidou clock data, that is, the clock sequence, to form a sliding window standard deviation sequence, wherein the calculation method of the sliding window standard deviation sequence is as follows:

[0051]

[0052] Where X represents the clock deviation sequence, n represents the number of data in the clock sequence, represents the i-th data in the sliding window mean sequence, X k represents the kth data in the clock deviation sequence, w represents the sliding window size and w<n, σ i Represents the i-th data in the sliding window standard deviation sequence.

[0053] Step 2-3: The area with too large amplitude in the sliding window standard deviation sequence is regarded as an abnormal area. The determination method of the abnormal area is as follows:

[0054]

[0055]

[0056] in, represents the mean of the sliding window standard deviation sequence, and q represents the standard deviation of the sliding window standard deviation sequence;

[0057] When σ i satisfy When the clock sequence The epoch is the starting point of the abnormal area, and the starting point of the abnormal area is denoted as s;

[0058] When σ i satisfy When the clock sequence The epoch is the end point of the abnormal area, and the position of the end point of the abnormal area is recorded as f;

[0059] After determining the start and end points of the abnormal region, the region of the clock sequence X in the abnormal region is differentiated as follows:

[0060] d i =|X i+1 -X i |,i=s,s+1,…,f-1

[0061] Among them, d i is the ith data of the abnormal area differential sequence; take the abnormal area differential sequence d i The maximum value of the maximum value is the subscript corresponding to the position of the abnormal point in the original coordinate sequence. The position of the abnormal point is e, and the clock state of the abnormal point is X e ;

[0062] Step 2-4, based on the clock deviation and drift of the abnormal point, and the mean of the sequence before and after the abnormal point, determines whether the abnormal point is a mutation point, as follows:

[0063] If satisfied:

[0064]

[0065] Then determine the abnormal point X e is the mutation point, and the position of the mutation point is recorded; wherein D(X e ) is the mutation discrimination value, ε is the threshold, represents the mean of w / 2 epochs before the abnormal point, represents the mean value of w / 2 epochs after the outlier point;

[0066] Step 2-5, interpolate the identified mutation points and translate the subsequent sequences, as shown below:

[0067]

[0068] Among them, d is the translation amplitude of the mutation point and its subsequent sequence, X e-1 and X e-2 They are the two data before the mutation point respectively;

[0069] Step 2-6, repeat steps 2-2 to 2-5 until there is no mutation point in the clock sequence.

[0070] Furthermore, the clock state described in step 3 includes: clock deviation, i.e. clock offset, and clock drift, i.e. clock drift;

[0071] The specific method of the prediction is as follows:

[0072] The clock data preprocessed in step 2 is input into the PSO-GRU network model to predict the clock state and obtain the predicted clock deviation b of the current epoch. u,p (t s ) and clock drift

[0073] The specific method of the actual measurement is as follows:

[0074] According to the BeiDou satellite timing principle and the receiver clock model, the actual BeiDou satellite clock deviation b is calculated. u,m (t s ) and clock drift

[0075] Further, the time synchronization attack detection and identification of the type of the time synchronization attack described in step 4 include the following steps:

[0076] Step 4-1, modeling the time synchronization attack, that is, modeling the time synchronization attack as a superposition attack on the pseudorange and pseudorange rate, as follows:

[0077] ρ s (m) = ρ(m) + s ρ (m)

[0078]

[0079] Among them, ρ s (m) is the pseudorange under time synchronization attack; ρ(m) represents the true pseudorange; s ρ (m) represents the pseudo-range attack amount, is the pseudorange rate under time synchronization attack; represents the true pseudorange rate; represents the pseudo-range rate attack amount;

[0080] According to the changes of the above attack volume on pseudorange and pseudorange rate, the time synchronization attack is divided into two types: sudden clock jump attack and gradual clock offset attack, and two types of attack models are established respectively;

[0081] Step 4-2: Detect and judge two types of attack models.

[0082] Furthermore, two types of attack models are established in step 4-1, as follows:

[0083] Step 4-1-1, establish a clock sudden jump attack model, add a fixed constant C1 and a corresponding delta function to the true pseudorange and pseudorange rate respectively, and the established clock sudden jump attack model is as follows:

[0084] s ρ (m) = C1

[0085]

[0086] Step 4-1-2, establish the clock progressive offset attack model as follows:

[0087]

[0088]

[0089] Where Δt is the time interval; and They represent the change rate of attack amount to pseudorange and pseudorange rate, s ρ (m) and They represent the pseudorange attack amount and pseudorange rate attack amount respectively.

[0090] Furthermore, the detection and judgment of the two types of attack models described in step 4-2 specifically include:

[0091] Step 4-2-1, check whether it is a sudden clock jump attack, as follows:

[0092]

[0093] Among them, b u,m (t s ) and b u,p (t s ) represent the measured and predicted clock biases, respectively; represents the difference between the measured and predicted clock bias, when Exceeding the threshold When , it means that the measured clock deviation is abnormal, and it is judged as a sudden clock jump attack;

[0094] Step 4-2-2, check whether it is a clock progressive offset attack, as follows:

[0095]

[0096] in, and denote the measured and predicted clock drift, respectively; represents the difference between the measured and predicted clock drift. Exceeding the threshold , it indicates that the measured clock drift is abnormal; it is judged as a gradual clock offset attack.

[0097] Beneficial effects:

[0098] (1) The present invention solves the problem that the time synchronization attack detection method based on Kalman filtering in the prior art is greatly affected by noise and outliers in the data under extreme weather conditions, making it difficult to estimate the clock state in real time.

[0099] (2) In view of the fact that the existing time synchronization attack detection methods based on neural networks have excessive data requirements, require manual adjustment of multiple parameters and hyperparameters, are sensitive to parameter settings, take a long time to train and predict, and are prone to problems such as gradient explosion, gradient disappearance, and overfitting, the method proposed in the present invention has fewer parameters in the GRU model, good nonlinear mapping capabilities and high self-learning capabilities, and can avoid problems such as gradient explosion, gradient disappearance, and overfitting. At the same time, the PSO algorithm can automatically adjust the parameters of the GRU network model to find the optimal parameters, so the accuracy and efficiency of TSA detection can be improved to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0100] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments, and the above and / or other advantages of the present invention will become more clear.

[0101] Figure 1 It is a schematic diagram of the overall process of the present invention.

[0102] Figure 2 It is a structural diagram of the GRU network model in the present invention.

[0103] Figure 3 Schematic diagram of the effect of Type I TSA on clock deviation and clock drift in one embodiment.

[0104] Figure 4 Schematic diagram of the effect of Type II TSA on clock deviation and clock drift in an embodiment. DETAILED DESCRIPTION

[0105] The key point of the present invention is a Beidou time synchronization attack detection method based on PSO-GRU under extreme weather conditions. The main principle is to use an adaptive sliding window to process Beidou clock data under extreme weather conditions, use PSO to optimize the parameters of the GRU neural network, and detect different types of time synchronization attacks in the Beidou system based on the PSO-GRU model and implement the entire process.

[0106] The core content of this invention is a Beidou time synchronization attack detection method based on PSO-GRU under extreme weather conditions, which includes the following four stages: (1) training the PSO-GRU network model; (2) data preprocessing based on adaptive sliding windows; (3) predicting and measuring clock states; (4) detecting time synchronization attacks and identifying their types. The overall process is as follows: Figure 1 As shown:

[0107] (1) Training PSO-GRU network model

[0108] 1) Construction of training dataset

[0109] In the offline training phase, the original BDS (Beidou satellite) data that has not been subjected to TSA (Time Synchronization Attack) is post-processed, and the actual clock deviation and clock drift are calculated according to the timing principle. The formula is:

[0110]

[0111] Among them, ρ n represents the pseudorange between satellite n and the receiver; represents the position of satellite n, which can be obtained from the ephemeris; represents the receiver position; is the real distance between satellite n and the receiver; c is the speed of light; b u Indicates the receiver clock error; b n represents the clock error of satellite n, which can be obtained from the ephemeris; represents the measurement noise of satellite n. In the pseudorange measurement equation, the receiver position and clock difference u is an unknown quantity and can be calculated by observing 4 or more satellites.

[0112] Doppler shift is also a measurement parameter of the receiver, which can be used to obtain the speed of the receiver. Doppler shift can be converted into pseudo-range rate, and then the receiver clock drift can be obtained according to the pseudo-range rate.

[0113]

[0114] in, is the pseudorange rate of satellite n, λ represents the wavelength of the signal, represents the Doppler shift of satellite n.

[0115] The pseudorange rate measurement equation is as follows:

[0116]

[0117] in, represents the speed of satellite n, which can be obtained from the ephemeris; Indicates the speed of the receiver; represents the normalized vector between satellite n and the receiver; Indicates the receiver clock drift; represents the clock drift of satellite n, which can be obtained from the ephemeris; represents the pseudo-range rate measurement noise. In the pseudo-range rate measurement equation, the receiver velocity He Zhongpiao It is an unknown quantity and can be obtained by observing 4 or more satellites. The measurement equation based on pseudorange and pseudorange rate can be solved to calculate the position, velocity, clock bias and clock drift of the receiver. Clock bias and clock drift change according to the clock model. The clock model is:

[0118]

[0119] Among them, b u (t) and b u (y-τ) represents the clock bias at epoch t and y-τ respectively; and denote the clock drift at epoch t and t-τ respectively; τ is the time interval between epochs; ε(t) and represent phase noise and frequency noise respectively.

[0120] The input training data set is Includes BDS clock bias X and clock drift without TSA They are:

[0121] X=[b u,m (t),b u,m (t-τ),b u,m (t-2τ),…,b u,m (t-nτ)]

[0122]

[0123] Where τ represents the time interval between epochs, n represents the number of data in the clock sequence, and X represents the BDS measured receiver clock bias from epoch t-nτ to t. It represents the BDS measured receiver clock drift from epoch t-nτ to t.

[0124] 2) Training PSO-GRU network model

[0125] a. Train the GRU (Gated Recurrent Unit) model

[0126] Step 1: Initialize the PSO algorithm parameters. The number of hidden layers, time series length, and number of hidden layer nodes of the GRU network are used as the optimization hyperparameters of the PSO algorithm. Based on experience, the ranges of the hyperparameters and the particle speed are given, and the maximum number of iterations and the maximum particle flight speed are set.

[0127] Step 2: Build the GRU model. The structure of the GRU network model is as follows Figure 2As shown:

[0128] a. Reset gate: used to decide how much past information needs to be retained. This gating mechanism enables GRU to decide which information in the previous state is to be ignored at the current data input point. Its calculation formula is as follows:

[0129] r t =σ(W r ·[h t-1 ,x t ])

[0130] Among them, x t Indicates the clock status data input at the current moment, h t-1 represents the hidden state at the previous moment, r t is the reset gate output at the current moment, · represents the matrix product, σ represents the sigmoid function, W r is the weight matrix of the reset gate;

[0131] b. Update gate: It is used to determine the extent to which the information of the previous state is retained. This mechanism helps the model determine how long the historical information is retained in the current state. The update gate affects the calculation of the current state and the next state at the same time. Its calculation formula is as follows:

[0132] z t =σ(W z ·[h t-1 ,x t ])

[0133] Among them, z t Represents the update gate output at the current moment, W z is the weight matrix of the update gate;

[0134] c. Candidate hidden state: It is a temporary hidden state representation, which contains information about the current input and past states. Since this state has been adjusted by the reset gate, the result of the reset gate determines how much information from the past state is retained in the candidate hidden state. The calculation formula is as follows:

[0135] h′ t =tanh(W h' ·[r t *h t-1 ,x t ])

[0136] Among them, h′ t is the candidate hidden layer state at the current moment, W h' is the weight matrix of the candidate hidden state, * represents the dot product, and tanh is the hyperbolic tangent function;

[0137] d. Hidden state: regulated by the update gate, which is used to determine the ratio of the previous hidden state and the current candidate hidden state combination. Through this mechanism, GRU can decide how much old information to keep and how much new information to add. The calculation formula is as follows:

[0138] h t =(1-z t )*h t-1 +z t *h′ t

[0139] Among them, h t is the final hidden state at the current moment. This state is the result of mixing the previous state and the candidate state according to the output of the update gate;

[0140] In summary, the calculation of the entire neural unit is completed by calculating the update gate and the reset gate. The calculation process is as follows:

[0141] z t =σ(W z ·[h t-1 ,x t ])

[0142] r t =σ(W r ·[h t-1 ,x t ])

[0143] h′ t =tanh(W h' ·[r t *h t-1 ,x t ])

[0144] h t =(1-z t )*h t-1 +z t *h′ t

[0145] Among them, x t Indicates the clock status data input at the current moment; h t-1 represents the output of the previous neuron, r t is the reset gate, z t is the update gate, h′ t is the hidden layer state, h t is the current output, · represents matrix product, * represents dot product, σ represents sigmoid function, tanh is hyperbolic tangent function, W z To update the gate weight matrix, W h To reset the gate weight matrix.

[0146] Step 3: Define the fitness, and use the mean square error of the clock state prediction value output by the GRU network as the particle fitness value:

[0147]

[0148] Among them, n is the number of experimental predictions, z i represents the actual value and z represents the predicted value.

[0149] Step 4: Use the particle position information as the parameters of the GRU network to build the GRU model.

[0150] b. Use PSO algorithm to optimize GRU network model parameters

[0151] Step 1: Train the GRU model, obtain the fitness value of each particle, and update the individual extreme value and group extreme value.

[0152] Step 2: Update particle velocity and position information using nonlinear inertia weight iterations based on individual and group extreme values:

[0153] v id k+1 =ωV id k +Z1r1(P id k -X id k )+Z2r2(P gd k -X id k)

[0154]

[0155] Where k represents the current iteration number; V id k , X id k , P id k , P gd k They represent the speed and position of the particle, the local optimal solution of particle i and the global optimal solution of the particle swarm respectively; Z1 and Z2∈[1,4] are environmental acceleration factors; r1 and r2 are random real numbers in [0,1]; ω∈[0.5,1.5] is the inertia factor, which is non-negative. When its value is large, the global optimization ability is strong and the local optimization ability is weak; when its value is small, the global optimization ability is weak and the local optimization ability is strong, so the optimization effect can be adjusted by adjusting the size of ω.

[0156] Step 3: When the number of iterations reaches the set maximum number of iterations, the PSO algorithm terminates, and the optimal number of hidden layers L, time series length T, and number of hidden layer nodes H of the GRU model are obtained, and the PSO-GRU model is retrained based on this.

[0157] (2) Data preprocessing based on adaptive sliding window

[0158] Before the data are calculated, data preprocessing is performed to screen and clean the BDS measured clock deviation and drift data.

[0159] Step 1: Initialize the sliding window length to w, calculate the sliding window standard deviation of the BDS clock sequence, and form a sliding window standard deviation sequence. The sliding window standard deviation is calculated as follows:

[0160]

[0161] Where X represents the clock sequence including clock bias and clock drift, n represents the number of data in the clock sequence, represents the i-th data in the sliding window mean sequence, w represents the sliding window size (w<n), σ i Represents the i-th data in the sliding window standard deviation sequence.

[0162] Step 2: The areas with excessively large amplitudes in the sliding window standard deviation sequence are regarded as abnormal areas that may have mutations caused by extreme weather. The determination method of abnormal areas is expressed as:

[0163]

[0164]

[0165] in, The mean of the sliding window standard deviation sequence, q represents the standard deviation of the sliding window standard deviation sequence.

[0166] When σ i satisfy , which represents the first epoch is the starting point of the abnormal area, and the starting point of the abnormal area is s; when σ i satisfy , which represents the first The epoch is the end point of the abnormal region, and the position of the end point of the abnormal region is recorded as f; after determining the start and end points of the abnormal region, the region of the clock sequence X in the abnormal region is differentiated:

[0167] d i =|X i+1 -X i |,i=s,s+1,…,f-1

[0168] Among them, d i is the ith data of the abnormal area differential sequence; take the abnormal area differential sequence d i The maximum value of the maximum value is the subscript corresponding to the position of the abnormal point in the original coordinate sequence. The position of the abnormal point is e, and the clock state of the abnormal point is X e .

[0169] Step 3: Determine whether the abnormal point is a mutation point based on the clock deviation and drift of the abnormal point, and the mean of the sequence before and after the abnormal point. The determination method is expressed as:

[0170]

[0171]

[0172] in, represents the mean of w / 2 epochs before the abnormal point, represents the mean value of w / 2 epochs after the outlier point;

[0173]

[0174] Among them, D(X e ) is the mutation discrimination formula, and ε is the threshold. If the above formula is satisfied, then the abnormal point X is considered e The mutation point is recorded.

[0175] Step 4: interpolate the identified mutation points and translate the subsequent sequences, expressed as:

[0176]

[0177] Among them, δ is the translation amplitude of the mutation point and its subsequent sequence, X e-1 and X e-2 They are the two data before the mutation point respectively.

[0178] The sliding window standard deviation sequence calculation, abnormal region determination, mutation point determination and sequence translation are iteratively performed until there are no mutation points in the sequence.

[0179] (3) Predicting and measuring clock bias and clock drift

[0180] Then it is input into the PSO-GRU network model, and the clock prediction of the BDS receiver without TSA is realized according to the training rules to obtain the predicted clock deviation b of the current epoch. u,p (t s ) and clock drift

[0181] According to the BDS timing principle and the receiver clock model, the actual BDS clock deviation b is calculated.u,m (t s ) and clock drift

[0182] (4) Detecting time synchronization attacks and determining the type of time synchronization attacks

[0183] 1) Modeling time synchronization attacks. By distorting the true pseudorange and pseudorange rate of the receiver, the clock bias and clock drift of the receiver can be distorted without changing the position and velocity of the receiver. This TSA is difficult to be detected by the receiver, and its principle is shown in the following formula:

[0184]

[0185]

[0186] in, represents the measured pseudorange of satellite n under TSA; represents the attack amount of pseudorange on satellite n; represents the position of satellite n; Indicates the receiver position; represents the measured pseudorange rate of satellite n under TSA; represents the pseudo-range rate attack on satellite n; c is the speed of light; b u Indicates the receiver clock error; b n represents the clock error of satellite n, which can be obtained from the ephemeris; represents the measurement noise of satellite n. According to the above equation, the attack on pseudorange and pseudorange rate will be absorbed into the clock error and drift results. Therefore, TSA can be modeled as a superposition attack on pseudorange and pseudorange rate:

[0187] ρ s (m) = ρ(m) + s ρ (m)

[0188]

[0189] Among them, ρ s (m) is the pseudorange under TSA; ρ(m) represents the true pseudorange; s ρ (m) represents the pseudo-range attack amount, is the pseudorange rate under TSA; represents the true pseudorange rate; Indicates the attack volume of pseudorange rate. According to the change of pseudorange and pseudorange rate due to the attack volume, time synchronization attacks are divided into two types: sudden clock jump attack and gradual clock offset attack.

[0190] a. Add a fixed constant C1 and a corresponding δ function to the true pseudorange and pseudorange rate respectively, and the established clock sudden jump attack model is:

[0191] s ρ (m) = C1

[0192]

[0193] In the PVT solution process, the attacks on pseudorange and pseudorange rate are absorbed into clock bias and clock drift respectively. This type of TSA makes the clock drift reach its peak at the attack time.

[0194] b. Since the pseudorange attack amount and pseudorange rate of the clock progressive offset attack gradually change over time, the clock progressive offset attack model is:

[0195]

[0196]

[0197] Among them, Δt is the time interval, which is determined by the receiver PVT solution cycle; and They represent the rate of change of the attack amount to the pseudorange and pseudorange rate, respectively. The attack on the pseudorange and pseudorange rate is absorbed into the clock bias and clock drift, respectively. The effect of this type of TSA is that the clock bias gradually increases and the clock drift gradually changes.

[0198] 2) Detect and judge different types of time synchronization attacks

[0199] a. Check whether it is a TSA with sudden clock jump:

[0200]

[0201] Among them, b u,m (t s ) and b u,p (t s ) represent the measured and predicted clock biases, respectively; represents the difference between the measured and predicted clock bias. Exceeding the threshold When , it indicates that the measured clock deviation is abnormal. Threshold Depends on the accuracy requirements of system time synchronization.

[0202] b. Check whether it is a clock progressive offset type TSA:

[0203]

[0204] in, and denote the measured and predicted clock drift, respectively; Represents the difference between the measured and predicted clock drift. Exceeding the threshold When , it indicates that the measured clock drift is abnormal. Threshold It also depends on the accuracy requirements of system time synchronization.

[0205] Example:

[0206] In one embodiment of the present invention, the above method is used to detect Beidou time synchronization attacks based on PSO-GRU under extreme weather conditions, as follows:

[0207] By installing a BDS receiver on a vehicle to collect raw BDS data for 5 consecutive hours under heavy rain conditions, the raw BDS data was post-processed using MATLAB code, and the measured clock bias and clock drift were calculated based on the timing principle. The clock bias and clock drift data for the first 3 hours were used to construct a training data set. Type I and Type II TSA were simulated separately. During the navigation solution process, attacks on pseudorange and pseudorange rate are absorbed into the clock error and clock drift, respectively. The impact of Type I TSA is a sudden jump in the clock bias, and the clock drift reaches a peak at the moment of attack, such as Figure 3 The effect of Type II TSA is that the clock deviation is gradually pulled apart and the clock drift gradually changes, as shown in Figure 4 Then, the clock deviation and drift data within the last 2 hours are added to test the trained model.

[0208] In a specific implementation, the present application provides a computer storage medium and a corresponding data processing unit, wherein the computer storage medium can store a computer program, and the computer program can run the invention content of a Beidou time synchronization attack detection method based on PSO-GRU in extreme weather provided by the present invention and some or all steps in each embodiment when executed by the data processing unit. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0209] Those skilled in the art can clearly understand that the technical solutions in the embodiments of the present invention can be implemented by means of computer programs and their corresponding general hardware platforms. Based on such an understanding, the technical solutions in the embodiments of the present invention can be essentially or partly contributed to the prior art in the form of computer programs, i.e., software products, which can be stored in a storage medium and include several instructions for enabling a device including a data processing unit (which can be a personal computer, a server, a single-chip microcomputer, an MCU or a network device, etc.) to execute the methods described in various embodiments of the present invention or certain parts of the embodiments.

[0210] The present invention provides an idea and method for detecting Beidou time synchronization attacks based on PSO-GRU in extreme weather. There are many methods and ways to implement the technical solution. The above is only a preferred implementation of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the scope of protection of the present invention. All components not specified in this embodiment can be implemented by existing technologies.

Claims

1. A Beidou time synchronization attack detection method based on PSO-GRU under extreme weather conditions, characterized in that: The following steps are involved: Step 1, build and train a PSO-GRU network model to predict clock states; Step 2, preprocessing the Beidou clock data under the extreme weather based on an adaptive sliding window; Step 3, predicting and measuring clock status; Step 4: Based on the predicted and measured clock states obtained in step 3, time synchronization attack detection is performed and the type of time synchronization attack is identified, completing Beidou time synchronization attack detection based on PSO-GRU under extreme weather conditions.

2. According to a Beidou time synchronization attack detection method based on PSO-GRU under extreme weather conditions in claim 1, it is characterized in that: The construction and training of the PSO-GRU network model described in step 1 includes the following steps: Step 1-1, construct a training data set; Step 1-2, build a PSO-GRU network model; Steps 1-3: train the PSO-GRU network model, that is, use the PSO algorithm to optimize the GRU network model parameters.

3. According to a Beidou time synchronization attack detection method based on PSO-GRU under extreme weather conditions in claim 2, it is characterized in that: The construction of the training data set described in step 1-1 specifically includes: The original Beidou satellite data that has not been attacked by time synchronization is post-processed, and the actual clock deviation and clock drift are calculated according to the timing principle. The training data set is Among them, the clock bias X and clock drift in the original Beidou satellite data that has not been attacked by time synchronization as follows: Where τ represents the time interval between epochs, n represents the number of data in the clock sequence, and X represents the measured receiver clock bias of the Beidou satellite from epoch T-nτ to t. represents the measured receiver clock drift of Beidou satellite from epoch t-nτ to t; b u,m (t) represents the historical measured receiver clock bias, represents the historical measured receiver clock drift, u represents the data received by the BDS receiver, and m represents the actual measurement value.

4. According to a method for detecting Beidou time synchronization attacks based on PSO-GRU in extreme weather conditions in claim 3, it is characterized in that: The construction of the PSO-GRU network model described in step 1-2 specifically includes: Step 1-2-1, constructing a GRU network model, the GRU network model specifically includes: A reset gate is used to determine the historical data that needs to be retained, as follows: r t =σ(W r ·[h t-1 ,x t ]) Among them, x t Indicates the clock status data input at the current moment, h t-1 represents the hidden state at the previous moment, r t is the reset gate output at the current moment, · represents the matrix product, σ represents the sigmoid function, W r is the weight matrix of the reset gate; An update gate is used to determine the length of historical data to be retained, as follows: z t =σ(W z ·[h t-1 ,x t ]) Among them, z t Represents the update gate output at the current moment, W z is the weight matrix of the update gate; A candidate hidden state is used to represent a temporary hidden state, which contains the current input data and historical data, as follows: h' t =tanh(W h ,·[r t *h t-1 ,x t ]) Among them, h′ t is the candidate hidden layer state at the current moment, W h’ is the weight matrix of the candidate hidden state, * represents the dot product, and tanh is the hyperbolic tangent function; According to the reset gate, update gate and candidate hidden state, the current hidden state is calculated as follows: h t =(1-z t )*h t-1 +z t *h′ t Among them, h t is the final hidden state at the current moment; Step 1-2-2, initialize the PSO algorithm parameters, use the number of hidden layers, time series length and number of hidden layer nodes of the GRU network model as the optimization hyperparameters of the PSO algorithm, set the range of the optimization hyperparameters and particle speed in the PSO algorithm, set the maximum number of iterations and the maximum flight speed of the particles; Step 1-2-3, define the fitness, and use the mean square error of the clock state prediction value output by the GRU network model as the particle fitness value S in the PSO algorithm ( θ), as follows: Among them, n0 is the number of experimental predictions, z i represents the actual value, z θ represents the predicted value; Step 1-2-4, use the position information of particles in the PSO algorithm as the parameters of the GRU network model to complete the construction of the PSO-GRU network model.

5. According to the method for detecting Beidou time synchronization attacks based on PSO-GRU in extreme weather conditions in claim 4, it is characterized in that: The PSO algorithm is used to optimize the GRU network model parameters described in steps 1-3, specifically including: Step 1-3-1, train the GRU network model, obtain the fitness value of each particle in the PSO algorithm, and update the current individual extreme value and group extreme value; Step 1-3-2, iteratively update the particle velocity and position information using nonlinear inertia weights according to the current individual extreme value and group extreme value: v id k+1 =ωV id k +Z1r1(P id k -X id k )+Z2r2(P gd k -X id k ) Where k represents the current iteration number; V id k , X id k , P id k and P gd k They represent the speed and position of the particle in the PSO algorithm, the local optimal solution of particle i, and the global optimal solution of the particle swarm; Z1, Z2∈[1,4] are environmental acceleration factors; r1, r2 are random real numbers in [0,1]; ω∈[0.5,1.5] is the inertia factor, and its value is non-negative; Step 1-3-3, when the number of iterations reaches the set maximum number of iterations, the PSO algorithm terminates, and the optimal number of hidden layers L, time series length T, and number of hidden layer nodes H of the GRU network model are obtained. Based on this, steps 1-3 are re-executed to conduct a new round of PSO-GRU network model training.

6. According to the method for detecting Beidou time synchronization attacks based on PSO-GRU in extreme weather conditions in claim 5, it is characterized in that: The preprocessing of the Beidou clock data under the extreme weather conditions based on the adaptive sliding window described in step 2 specifically includes: Step 2-1, initialize the sliding window length to w; Step 2-2, calculate the sliding window standard deviation of the Beidou clock data, that is, the clock sequence, to form a sliding window standard deviation sequence, wherein the calculation method of the sliding window standard deviation sequence is as follows: Where X represents the clock deviation sequence, n represents the number of data in the clock sequence, represents the i-th data in the sliding window mean sequence, X k represents the kth data in the clock deviation sequence, w represents the sliding window size and w<n, σ i Represents the i-th data in the sliding window standard deviation sequence; Step 2-3: The area with too large amplitude in the sliding window standard deviation sequence is regarded as an abnormal area. The determination method of the abnormal area is as follows: in, represents the mean of the sliding window standard deviation sequence, and q represents the standard deviation of the sliding window standard deviation sequence; When σ i satisfy When the clock sequence The epoch is the starting point of the abnormal area, and the starting point of the abnormal area is denoted as s; When σ i satisfy When the clock sequence The epoch is the end point of the abnormal area, and the position of the end point of the abnormal area is recorded as f; After determining the start and end points of the abnormal region, the region of the clock sequence X in the abnormal region is differentiated as follows: d i =|X i+1 -X i |,i=s,s+1,…,f-1 Among them, d i is the ith data of the abnormal area differential sequence; take the abnormal area differential sequence d i The maximum value of the maximum value is the subscript corresponding to the position of the abnormal point in the original coordinate sequence. The position of the abnormal point is e, and the clock state of the abnormal point is X e ; Step 2-4, based on the clock deviation and drift of the abnormal point, and the mean of the sequence before and after the abnormal point, determines whether the abnormal point is a mutation point, as follows: If satisfied: Then determine the abnormal point X e is the mutation point, and the position of the mutation point is recorded; wherein D(X e ) is the mutation discrimination value, ε is the threshold, represents the mean of w / 2 epochs before the abnormal point, represents the mean value of w / 2 epochs after the outlier point; Step 2-5, interpolate the identified mutation points and translate the subsequent sequences, as shown below: Among them, d is the translation amplitude of the mutation point and its subsequent sequence, X e-1 and X e-2 They are the two data before the mutation point respectively; Step 2-6, repeat steps 2-2 to 2-5 until there is no mutation point in the clock sequence.

7. The method for detecting Beidou time synchronization attacks based on PSO-GRU in extreme weather according to claim 6 is characterized in that: The clock state described in step 3 includes: clock deviation, i.e. clock offset, and clock drift, i.e. clock drift; The specific method of the prediction is as follows: The clock data preprocessed in step 2 is input into the PSO-GRU network model to predict the clock state and obtain the predicted clock deviation b of the current epoch. u,p (t s ) and clock drift The specific method of the actual measurement is as follows: According to the BeiDou satellite timing principle and the receiver clock model, the actual BeiDou satellite clock deviation b is calculated. u,m (t s ) and clock drift 8. According to the method for detecting Beidou time synchronization attacks based on PSO-GRU in extreme weather conditions in claim 7, it is characterized in that: The time synchronization attack detection and identification of the time synchronization attack type described in step 4 include the following steps: Step 4-1, modeling the time synchronization attack, that is, modeling the time synchronization attack as a superposition attack on the pseudorange and pseudorange rate, as follows: r s (m)=ρ(m)+s ρ (m) Among them, ρ s (m) is the pseudorange under time synchronization attack; ρ(m) represents the true pseudorange; s ρ (m) represents the pseudo-range attack amount, is the pseudorange rate under time synchronization attack; represents the true pseudorange rate; represents the pseudo-range rate attack amount; According to the changes of the above attack volume on pseudorange and pseudorange rate, the time synchronization attack is divided into two types: sudden clock jump attack and gradual clock offset attack, and two types of attack models are established respectively; Step 4-2: Detect and judge two types of attack models.

9. The method for detecting Beidou time synchronization attacks based on PSO-GRU in extreme weather according to claim 8 is characterized in that: The two types of attack models described in step 4-1 are established as follows: Step 4-1-1, establish a clock sudden jump attack model, add a fixed constant C1 and a corresponding delta function to the true pseudorange and pseudorange rate respectively, and the established clock sudden jump attack model is as follows: s ρ (m)=C1 Step 4-1-2, establish the clock progressive offset attack model as follows: Where Δt is the time interval; and They represent the change rate of attack amount to pseudorange and pseudorange rate, s ρ (m) and They represent the pseudorange attack amount and pseudorange rate attack amount respectively.

10. The method for detecting Beidou time synchronization attacks based on PSO-GRU in extreme weather according to claim 9 is characterized in that: The detection and judgment of the two types of attack models described in step 4-2 specifically include: Step 4-2-1, check whether it is a sudden clock jump attack, as follows: Among them, b u,m (t s ) and b u,p (t s ) represent the measured and predicted clock biases, respectively; represents the difference between the measured and predicted clock bias, when Exceeding the threshold When , it means that the measured clock deviation is abnormal, and it is judged as a sudden clock jump attack; Step 4-2-2, check whether it is a clock progressive offset attack, as follows: in, and denote the measured and predicted clock drift, respectively; represents the difference between the measured and predicted clock drift, when Exceeding the threshold , it indicates that the measured clock drift is abnormal; it is judged as a gradual clock offset attack.

Citation Information

Patent Citations

  • Time synchronization attack detection and correction method and device based on optimal estimation

    CN112711039A

  • Beidou deception signal detection method based on BP neural network assistance

    CN117872413A