## 1 Introduction  
With the diversified development of information transmission methods since the third revolution in science and technology, optical networks carry a large amount of important information in many application fields such as military and finance. In 2014, an attack on an online trading platform caused huge economic loss [1]. In 2015, there were 16 known optical cable attacks in San Francisco [2]. Preventing the information in optical network from being intercepted and improving the security of data information transmission has become an increasingly urgent demand. The key distribution based on traditional cryptography has the risk of being cracked by more advanced attack algorithms, which cannot easily meet the needs of security. Different from the traditional encryption methods based on mathematical computational complexity and the symmetric encryption algorithm, quantum key distribution (QKD) technology has more advantages. The BB84 protocol first describes the method of transmitting information by using photon polarization state coding [3]. It uses the characteristics and laws of quantum mechanics to maintain communication security, transmitting coded states through quantum channels. The protocol also enables both sides of communication to share random secure symmetric keys in the process of information transmission. The key is a secret bit string used for secure communication and authentication [4]. These pairwise keys allow terminal nodes to generate their own keys, provided that all intermediate nodes are trusted [5]. This process is based on the Heisenberg uncertainty principle, so the eavesdroppers can neither successfully measure and obtain quantum state information nor affect the key transmission. QKD also uses the quantum state no-cloning theorem, which improves the security of the communication process by making the eavesdropper unable to copy the quantum state. In the BB84 protocol, the linear polarization and circular polarization of photons are in conjugate states, which conforms the uncertainty principle. Therefore, whenever there is a third-party measurement made by eavesdroppers, the original quantum state will inevitably change [6]. According to the quantum bit error rate of the selected measurement base, we can judge whether the channel transmission data have been eavesdropped or tampered. Combined with the \"one-time pad\" encryption technology, the BB84 protocol can achieve unconditional security in theory. The DARPA QKD network, the world's first quantum key distribution network (QKDN), was proposed in December 2002, laying a foundation for the development of a QKDN based on trusted relay [7], which was developed in SECOQC [8]. In 2017, the backbone QKDN in Beijing and Shanghai began to operate. It was the longest QKDN in the world at that time, realizing the decoy state BB84 protocol based on optical polarization coding [9]. QKD has developed to the degree of networking communication and has become the key technology of quantum communication. In optical networks, the key generated in the process of QKD can occupy the resources of the communication channel. If the network fails, the key service will be interrupted. Therefore, it is necessary to study survivability technology based on a QKDN. In previous studies, protection schemes and recovery measures proposed for QKDNs have been proposed, such as an adaptive protection scheme of key capacity [10] and key recovery strategies [11; 12]. Although the BB84 protocol has theoretical security, due to the gap between reality and theory, the devices in the actual QKD system are not perfect. Therefore, there are still some hidden dangers regarding security in the information key transmission. It may lead to the operation mode state of the real equipment being different from the mathematical model established in the previous ideal state, which can easily cause eavesdroppers to attack. Eavesdroppers can carry out time-shift attacks by learning distributed keys [13].