Online detection method and device for base vector comparison of QKD (quantum key distribution) equipment

Through the online detection method and device, the base vector alignment process of the QKD device is directly detected, which solves the problem that the base vector alignment function of the QKD device cannot be accurately detected in the prior art, and realizes direct, accurate detection and intuitive and trustworthy test results of the equipment function.

CN120238183APending Publication Date: 2025-07-01QUANTUMCTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311866847.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The prior art cannot directly and accurately detect the base vector alignment function of the QKD device, resulting in the inability to ensure that the equipment performs normal base vector alignment according to the QKD protocol.

Method used

An online detection method and device are adopted to directly detect the base vector alignment process of the QKD device through data configuration analysis, online testing and consistency comparison steps to ensure that the detection results are intuitive and trustworthy.

Benefits of technology

It realizes direct and accurate detection of the base vector alignment function of QKD equipment, provides intuitive and trustworthy test results, and ensures that the equipment operates normally in accordance with the QKD protocol.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120238183A_ABST
    Figure CN120238183A_ABST
Patent Text Reader

Abstract

The invention discloses an online detection method and device for base vector comparison of QKD (quantum key distribution) equipment, which allow intuitive detection of the base vector comparison process of the detected QKD equipment in an online mode, realize direct detection of the base vector comparison function of the QKD equipment in a simple mode, and are intuitive and credible in test result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of quantum communication, and more particularly to an online detection method and device for basis comparison of QKD devices. Background Art

[0002] The BB84 protocol is a commonly used quantum key distribution (QKD) protocol internationally, which requires two channels, namely a quantum channel and a classical channel, between the two communicating parties. The information sender Alice sends quantum-encoded information to the information receiver Bob through the quantum channel. Then, the two communicating parties announce the selected bases through the classical channel and perform comparison. Only the measurement results where the sending basis and the measurement basis are the same are retained, and the measurement results with different basis selections are discarded. This process is called basis comparison.

[0003] Currently, only Figure 1 As shown, by comparing the output keys (i.e., the sifted keys) after basis comparison of both Alice and Bob in the QKD device, the normal operation of the basis comparison function of the QKD device is further determined. However, this basis comparison function test achieved by means of the consistency of the sifted keys of both communicating parties in the QKD device is an indirect test scheme, which cannot accurately reflect whether the QKD device can normally implement the basis comparison function according to the QKD protocol. Therefore, a scheme that can directly test the basis comparison process is needed to provide intuitive and accurate detection results of the basis comparison function. Summary of the Invention

[0004] Aiming at the above-mentioned defects of the prior art, the present invention discloses an online detection method and device for basis comparison of QKD devices, which allows for intuitive detection of the basis comparison process of the QKD device to be tested in an online manner, realizes direct detection of the basis comparison function of the QKD device in a simple way, and the test results are intuitive and reliable.

[0005] Specifically, the first aspect of the present invention relates to an online detection method for basis comparison of QKD devices, which includes a data configuration analysis step, an online test step, and a consistency comparison step;

[0006] The data configuration analysis step is used to establish a simulated QKD device transmitter and a simulated QKD device receiver according to the quantum key distribution protocol, set the light-emitting coding random number, sampling random number, and detection data, and obtain the sifted keys SK-A1 and SK-B1 generated by the simulated QKD device transmitter and the simulated QKD device receiver when using the set light-emitting coding random number, sampling random number, and detection data;

[0007] The online test step is used to inject the luminescence-coded random number and the sampled random number into the transmitter of the QKD device, inject the detection data into the receiver of the QKD device, and run the QKD device to extract the sifted key SK-A2 and SK-B2 from the QKD device transmitter and the QKD device receiver respectively;

[0008] The consistency comparison step is used to judge whether the basis comparison function of the QKD device is normal according to the consistency comparison result between the sifted key SK-A1 and SK-A2 and / or the consistency comparison result between the sifted key SK-B1 and SK-B2.

[0009] Further, in the data configuration analysis step, the detection data is configured corresponding to the luminescence-coded random number, where:

[0010] Set the position information and state information in the detection data to be the same as the position information and state information in the luminescence data corresponding to the corresponding luminescence-coded random number;

[0011] Randomly set the basis information in the detection data;

[0012] Set the key information in a preset proportion of the detection data to be flipped with respect to the key information in the luminescence data corresponding to the corresponding luminescence-coded random number, and set the key information in other detection data to be the same as the key information in the luminescence data corresponding to the corresponding luminescence-coded random number.

[0013] Even further, the data configuration analysis step includes the following sub-steps:

[0014] Enable the simulated QKD device transmitter to generate luminescence data according to the luminescence-coded random number, which includes position information, state information, basis information, and key information;

[0015] Enable the simulated QKD device receiver to send the position information, state information, and basis information in the detection data to the simulated QKD device transmitter;

[0016] Enable the simulated QKD device transmitter to retain the data in the luminescence data that has the same position information, state information, and basis information as the received detection data, and send the position information, state information, and basis information in the retained luminescence data to the simulated QKD device receiver;

[0017] Enable the simulated QKD device transmitter to randomly sample the retained luminescence data according to the sampled random number to generate sampled data, and send the sampled data to the simulated QKD device receiver;

[0018] Cause the transmitter of the simulated QKD device to extract key information from the unsampled data in the reserved luminescence data, and generate the sifted key SK-A1;

[0019] Cause the receiver of the simulated QKD device to retain the data in the detection data that has the same position information, state information, and basis vector information as the received reserved luminescence data, and extract key information from the data in the reserved detection data that is different from the received sampled data, and generate the sifted key SK-B1.

[0020] Furthermore, in the data configuration analysis step, also cause the receiver of the simulated QKD device to perform error rate evaluation using the key information in the data in the reserved detection data that has the same position information, state information, and basis vector information as the received sampled data.

[0021] Preferably, in the data configuration analysis step, set a sampling identifier for the sampled data, and determine the data in the reserved detection data that is different from the received sampled data according to the sampling identifier.

[0022] Preferably, the preset ratio is 1%.

[0023] Further, the online detection method of the present invention may further include a step of outputting a detection result.

[0024] Preferably, the sampling random number can be set according to a sampling ratio of 10%.

[0025] The second aspect of the present invention relates to an online detection device for basis vector comparison of a QKD device, which includes a switch and a data configuration analysis module;

[0026] The data configuration analysis module includes a comparison analysis unit, a transmitter of a simulated QKD device, and a receiver of a simulated QKD device;

[0027] The transmitter of the simulated QKD device is configured to generate a sifted key SK-A1 according to the quantum key distribution protocol, using the set luminescence coding random number, sampling random number, and detection data;

[0028] The receiver of the simulated QKD device is configured to generate a sifted key SK-B1 according to the quantum key distribution protocol, using the luminescence coding random number, sampling random number, and detection data;

[0029] The switch is configured to inject the emitted encoded random number and the sampled random number into the transmitter of the QKD device, and inject the detection data into the receiver of the QKD device; and collect the sifted key SK-A2 generated by the QKD device transmitter and the sifted key SK-B2 generated by the QKD device receiver, and send the sifted key SK-A2 and the sifted key SK-B2 to the data configuration analysis module;

[0030] The comparison and analysis unit is configured to determine whether the basis comparison function of the QKD device is normal according to the consistency comparison result between the sifted keys SK-A1 and SK-A2 and / or the consistency comparison result between the sifted keys SK-B1 and SK-B2.

[0031] Furthermore, the simulated QKD device transmitter is configured to generate emitted light data according to the emitted encoded random number, which includes position information, state information, basis information, and key information; retain the data in the emitted light data that has the same position information, state information, and basis information as the detection data received from the simulated QKD device receiver; randomly sample the retained emitted light data according to the sampled random number to generate sampled data; extract the key information from the data in the retained emitted light data that has not been sampled to generate the sifted key SK-A1; send the position information, state information, and basis information in the retained emitted light data, and the sampled data to the simulated QKD device receiver;

[0032] The simulated QKD device receiver is configured to send the position information, state information, and basis information in the detection data to the simulated QKD device transmitter; retain the data in the detection data that has the same position information, state information, and basis information as the retained emitted light data received from the simulated QKD device transmitter; extract the key information from the data in the retained detection data that is different from the received sampled data to generate the sifted key SK-B1.

[0033] Even further, the simulated QKD device receiver is also configured to perform error rate evaluation using the key information in the data in the retained detection data that has the same position information, state information, and basis information as the received sampled data. Description of the Drawings

[0034] Figure 1 Schematically shows the basis comparison detection scheme of the QKD device in the prior art;

[0035] Figure 2 Schematically shows the structural schematic diagram of the on-line detection device for basis comparison of the QKD device of the present invention;

[0036] Figure 3An example of an online detection method for basis comparison of a QKD device according to the present invention is schematically shown. Detailed implementation manners

[0037] Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. The following embodiments are provided by way of example so as to fully convey the spirit of the present invention to those skilled in the art to which the present invention pertains. Therefore, the present invention is not limited to the embodiments disclosed herein.

[0038] Figure 2 The structural schematic diagram of an online detection device for basis comparison of a QKD device according to the present invention is shown.

[0039] According to the present invention, the online detection device for basis comparison of a QKD device may include a switch and a data configuration analysis module. Among them, the switch is connected to the data configuration analysis module; and before starting the online detection, the switch can be connected to the QKD device under test, that is, the transmitter of the QKD device under test and the receiver of the QKD device are respectively connected to establish a data channel with the QKD device under test and complete the construction of the test environment.

[0040] Specifically, in the detection process of the present invention, parameters for subsequent testing of the QKD device can be set in advance, namely: the light-emitting coding random number, the sampling random number, and the detection data.

[0041] According to the present invention, the set light-emitting coding random number and sampling random number will be injected into the transmitter of the QKD device under test for its operation.

[0042] The light-emitting coding random number may include a random number for state coding, a random number for basis coding, and a random number for key coding.

[0043] As an example, the light-emitting coding random number can be encoded by a 5-bit random number, where:

[0044] The first 3 bits of the 5-bit random number are used for state coding. For example, for signal state, decoy state, and vacuum state coding, such as using the six encodings (111, 110, 101, 100, 011, 010) to represent the signal state, encoding 001 represents the decoy state, and encoding 000 represents the vacuum state, thereby providing random light-emitting coding data of signal state, decoy state, and vacuum state in a ratio of 6:1:1.

[0045] The 4th bit of the 5-bit random number is used for basis coding. For example, in the BB84 protocol, the encodings 0 and 1 on this bit can respectively represent the HV basis and the PN basis.

[0046] The 5th bit of the 5-bit random number is used for key coding. For example, the encodings 0 and 1 on this bit can respectively represent key 0 and key 1.

[0047] In the present invention, when generating a luminescent encoded random number (i.e., luminescent encoded data) using a random number, each luminescent encoded data is numbered in ascending order of the numbers, such as the 1st luminescent encoded data, the 2nd luminescent encoded data, ……, and this numbering is the position information.

[0048] According to the QKD protocol, after the QKD device transmitter and the QKD device receiver complete the basis comparison, it is also necessary to evaluate the error rate of the data after the basis comparison by comparing whether the data at both ends is consistent, which requires knowing the data at both ends. Therefore, at least one end needs to transmit its data to the other end. However, considering the risk of leakage during the data transmission process, a scheme of randomly selecting, for example, 10% of the data and transmitting it to the other end for comparison is proposed to reduce this leakage risk. For example, a random strategy for this scheme can be: after the basis comparison is completed, before determining whether each data is transmitted, first read a 10-bit random number (the value generated by the 10-bit random number is between 0 - 1023 each time). When the random value is between 0 - 101, control the current data to be transmitted to the other end. This process is to randomly sample the data using the sampling random number. For example, there are a total of 102 data from 0 - 101 and a total of 1024 data from 0 - 1023. Therefore, the proportion of the sampled data in the total data is 102 / 1024 = 9.96%, that is, 10%.

[0049] According to the present invention, the set detection data will be injected into the receiver of the QKD device under test for its operation, and for each luminescent encoded random number, a detection data needs to be correspondingly configured.

[0050] In the present invention, the detection data may include position information, state information, basis information, and key information, where:

[0051] The position information and state information in each detection data can be set to be the same as the position information and state information in the luminescent data corresponding to the corresponding luminescent encoded random number;

[0052] For the basis information in each detection data, a random setting method can be adopted;

[0053] For the key information in each detection data, the key information in a preset proportion of the detection data can be set to be flipped with respect to the key information in the luminescent data corresponding to the corresponding luminescent encoded random number, and the key information in other detection data can be set to be the same as the key information in the luminescent data corresponding to the corresponding luminescent encoded random number.

[0054] Preferably, the preset ratio can be set to 1%. That is, the key information in the detection data is obtained by flipping the key information generated at the QKD device transmitter (Alice) (i.e., the key information in the light emission data) according to a 1% ratio.

[0055] After completing the setting of test parameters such as the light emission encoded random number, sampling random number, and detection data, the data configuration analysis module can be used to simulate the sifted keys generated by the QKD device transmitter and the QKD device receiver when the QKD device operates using the above test parameters according to the corresponding QKD protocol under the condition that the basis comparison process is correctly executed. Thus, by comparing the simulated sifted keys with the sifted keys actually generated by the QKD device under test when the same test parameters are injected into the QKD device under test later, it can be judged whether the QKD device under test correctly completes the basis comparison process as the data configuration analysis module does, and further judge whether the basis comparison function of the QKD device under test is correct.

[0056] Therefore, the data configuration analysis module of the present invention can include a comparison analysis unit, a simulated QKD device transmitter, and a simulated QKD device receiver.

[0057] The simulated QKD device transmitter can simulate the function of the QKD device transmitter according to the corresponding QKD protocol. For example, based on the set test parameters, it can simulate the generation of the corresponding sifted key SK-A1 by executing the basis comparison process.

[0058] Similarly, the simulated QKD device receiver can simulate the function of the QKD device receiver according to the corresponding QKD protocol. For example, based on the set test parameters, it can simulate the generation of the corresponding sifted key SK-B1 by executing the basis comparison process.

[0059] The comparison analysis unit can then perform a consistency comparison between the simulated sifted keys SK-A1 and SK-B1 and the corresponding sifted keys SK-A2 and SK-B2 actually generated by the QKD device under test later, and analyze and judge whether the basis comparison function of the device under test is normal according to the comparison result.

[0060] As Figure 2 shown, the data configuration analysis module can be implemented in the form of software, such as in the form of basis comparison test software. Correspondingly, the simulated QKD device transmitter, the simulated QKD device receiver, and the comparison analysis unit can also be in the form of software modules capable of implementing the corresponding functions.

[0061] Specifically, after setting the test parameters, the transmitter of the simulated QKD device in the data configuration analysis module can generate corresponding luminous data according to the set luminous coding random numbers, including position information, state information, basis vector information, and key information.

[0062] For the set detection data, the receiver of the simulated QKD device can remove the key information from the detection data and send the position information, state information, and basis vector information in the detection data to the transmitter of the simulated QKD device.

[0063] After receiving the data sent by the receiver of the simulated QKD device, the transmitter of the simulated QKD device compares these detection data with its corresponding luminous data and retains the luminous data (which includes key information in addition to position information, state information, and basis vector information) that has the same position information, the same state information, and the same basis vector information as the detection data of the receiver of the simulated QKD device.

[0064] Subsequently, the transmitter of the simulated QKD device sends the position information, state information, and basis vector information in these retained luminous data after comparison to the receiver of the simulated QKD device.

[0065] In addition, the transmitter of the simulated QKD device also randomly samples the retained luminous data according to the set sampling random numbers, generates sampling data, and sends the sampling data to the receiver of the simulated QKD device.

[0066] In the present invention, when generating the sampling data, the transmitter of the simulated QKD device can also set a sampling identifier for the sampling data to facilitate subsequent data processing.

[0067] Therefore, the transmitter of the simulated QKD device can extract key information from the unsampled data in the retained luminous data to generate the screened key SK-A1.

[0068] When the receiver of the simulated QKD device receives the position information, state information, and basis vector information in the retained luminous data sent by the transmitter of the simulated QKD device, it can also compare these data with its corresponding detection data and retain the data (which includes key information in addition to position information, state information, and basis vector information) in the detection data that has the same position information, the same state information, and the same basis vector information as the received retained luminous data.

[0069] When the receiver of the simulated QKD device further receives the sampling data from the transmitter of the simulated QKD device, it can compare the retained detection data with the sampling data and extract key information from those detection data that have the same position information, state information, and basis vector information as the sampling data for error rate evaluation.

[0070] In addition, the receiver of the simulated QKD device can also deduct the detection data for error rate evaluation from the reserved detection data, extract key information from the remaining detection data, and generate the sifted key SK-B1.

[0071] After the data configuration analysis module uses the above-mentioned set test parameters to simulate and generate the sifted key SK-A1 and the sifted key SK-B1, the same test parameters (emission coding random numbers, sampling random numbers, and detection data) can be injected into the QKD device under test, that is: inject the set emission coding random numbers and sampling random numbers into the transmitter of the QKD device under test, and inject the set detection data into the receiver of the QKD device under test.

[0072] After injecting the set test parameters into the QKD device under test, the QKD device can be run to perform the basis comparison process according to the above test parameters, and extract the corresponding sifted key SK-A2 and sifted key SK-B2 from the QKD device transmitter and the QKD device receiver respectively.

[0073] At this time, the sifted key SK-A2 and the sifted key SK-B2 can be collected from the QKD device under test with the help of a switch and sent to the data configuration analysis module. Therefore, the comparison and analysis unit can compare the simulated sifted key SK-A1 with the actually collected sifted key SK-A2 for consistency, and at the same time compare the simulated sifted key SK-B1 with the actually collected sifted key SK-B2 for consistency, and judge whether the basis comparison function of the QKD device under test is normal according to the consistency comparison result. For example, if the consistency comparison passes, it means that the basis comparison process performed by the QKD device under test during operation is consistent with the basis comparison process required by the corresponding QKD protocol, and its basis comparison function is normal, otherwise it is considered that its basis comparison function is abnormal.

[0074] The following will be combined with Figure 3 , to further describe the online detection method for basis comparison of QKD devices according to the present invention, in order to better understand the structure and functional principle of each component in the online detection device, especially the function of the data configuration analysis module mainly used to implement the detection method.

[0075] Figure 3 Schematically shows an example of the online detection method for basis comparison of QKD devices according to the present invention.

[0076] As Figure 3 shown, the online detection method for basis comparison of QKD devices according to the present invention can include a data configuration analysis step, an online test step, and a consistency comparison step.

[0077] After starting the basis comparison test and, for example, selecting online analysis, first, the data configuration analysis step can be executed with the help of the data configuration analysis module.

[0078] In the data configuration analysis step of the present invention, it is necessary to establish a simulated QKD device transmitter and a simulated QKD device receiver according to the corresponding QKD protocol, which can respectively correctly implement, for example, the basis comparison process.

[0079] On this basis, the configuration work of the test parameters can be carried out, that is, the luminous coding random number, the sampling random number, and the detection data are set. The configuration requirements of the test parameters have been described in detail above, so they will not be elaborated here.

[0080] Therefore, the simulated QKD device transmitter and the simulated QKD device receiver can use the luminous coding random number, the sampling random number, and the detection data to simulate, for example, the basis comparison process according to the QKD protocol, and generate their respective sifted keys SK-A1 and SK-B1.

[0081] Specifically, the simulated QKD device transmitter in the data configuration analysis module can generate corresponding luminous data according to the set luminous coding random number, which includes position information, state information, basis information, and key information.

[0082] The simulated QKD device receiver will remove the key information in the set detection data and send the position information, state information, and basis information in the detection data to the simulated QKD device transmitter.

[0083] After the simulated QKD device transmitter receives the data sent by the simulated QKD device receiver, it will compare these detection data with its own corresponding luminous data, and retain the luminous data (which includes key information in addition to position information, state information, and basis information) that has the same position information, the same state information, and the same basis information as the detection data of the simulated QKD device receiver.

[0084] Subsequently, the simulated QKD device transmitter sends the position information, state information, and basis information in these luminous data retained after comparison to the simulated QKD device receiver.

[0085] In addition, the simulated QKD device transmitter also randomly samples the luminous data retained after comparison according to the set sampling random number, generates sampling data, and sends the sampling data to the simulated QKD device receiver. Among them, the simulated QKD device transmitter can also set a sampling identifier for the sampling data for subsequent data processing.

[0086] Therefore, the simulated QKD device transmitter can extract the key information from the data that has not been sampled in the retained luminous data and generate the sifted key SK-A1.

[0087] When the receiver of the simulated QKD device receives the position information, state information, and basis vector information in the retained emitted light data sent by the transmitter of the simulated QKD device, it will similarly compare these data with its own corresponding detection data, and retain the detection data that has the same position information, state information, and basis vector information as the received retained emitted light data (which includes key information in addition to the position information, state information, and basis vector information).

[0088] After the receiver of the simulated QKD device further receives the sampling data from the transmitter of the simulated QKD device, it can compare the retained detection data with the sampling data, extract the key information from those detection data that have the same position information, state information, and basis vector information as the sampling data, and perform error rate evaluation.

[0089] In addition, the receiver of the simulated QKD device can also subtract the detection data used for error rate evaluation from the retained detection data, extract the key information from the remaining detection data, and generate the sifted key SK-B1.

[0090] After generating the sifted keys SK-A1 and SK-B1 corresponding to the set test parameters through the data configuration analysis step, the online test step can be initiated for the QKD device under test connected to the switch.

[0091] In the online test step, the switch injects the set test parameters into the QKD device under test as operation data, that is: injects the set emitted light coding random numbers and sampling random numbers into the transmitter of the QKD device under test, and injects the detection data into the receiver of the QKD device under test.

[0092] After injecting the set operation data, the operation of the QKD device under test can be controlled to generate the respective sifted keys SK-A2 and SK-B2 at the transmitter and receiver of the QKD device under test respectively.

[0093] At this time, the switch can collect the sifted keys SK-A2 and SK-B2 actually generated by the operation of the QKD device under test and return them to the data configuration analysis module for subsequent consistency comparison steps.

[0094] In the consistency comparison step, the sieved key SK-A1 generated by simulation is compared with the sieved key SK-A2 actually collected, and at the same time, the sieved key SK-B1 generated by simulation is compared with the sieved key SK-B2 actually collected. According to the consistency comparison result, it is judged whether the basis comparison function of the QKD device under test is normal. For example, if the consistency comparison passes, it indicates that the basis comparison process executed by the QKD device under test during operation is consistent with the basis comparison process required by the corresponding QKD protocol, and its basis comparison function is normal; otherwise, its basis comparison function is considered abnormal.

[0095] Furthermore, the online detection method of the present invention may further include a report output step for outputting a corresponding test report according to the consistency comparison result.

[0096] As can be seen from the above description, the present invention proposes an online detection method and device for basis comparison of QKD devices, which allows for an intuitive detection of the basis comparison process of the QKD device under test in an online manner, and realizes a direct detection of the basis comparison function of the QKD device in a simple way, and its test results are intuitive and reliable.

[0097] Although the present invention has been described above with reference to specific embodiments in conjunction with the accompanying drawings, it is easy for those skilled in the art to recognize that the above embodiments are merely exemplary and are used to illustrate the principle of the present invention, and they will not limit the scope of the present invention. Those skilled in the art can make various combinations, modifications and equivalent replacements of the above embodiments without departing from the spirit and scope of the present invention.

Claims

1. An online detection method for basis comparison of QKD devices, which includes a data configuration analysis step, an online test step, and a consistency comparison step; The data configuration analysis step is used to establish a simulated QKD device transmitter and a simulated QKD device receiver according to the quantum key distribution protocol, set the light-emitting coding random number, sampling random number, and detection data, and obtain the sifted key SK-A1 and SK-B1 generated by the simulated QKD device transmitter and the simulated QKD device receiver when using the set light-emitting coding random number, sampling random number, and detection data; The online test step is used to inject the light-emitting coding random number and the sampling random number into the transmitter of the QKD device, inject the detection data into the receiver of the QKD device, and run the QKD device to extract the sifted keys SK-A2 and SK-B2 from the QKD device transmitter and the QKD device receiver respectively; The consistency comparison step is used to judge whether the basis comparison function of the QKD device is normal according to the consistency comparison result of the sifted key SK-A1 and SK-A2 and / or the consistency comparison result of the sifted key SK-B1 and SK-B2; 2. The on-line detection method according to claim 1, wherein, In the data configuration analysis step, the detection data is configured corresponding to the light-emitting coding random number, where: The position information and state information in the detection data are set to be the same as the position information and state information in the light-emitting data corresponding to the corresponding light-emitting coding random number; The basis information in the detection data is randomly set; The key information in a preset proportion of the detection data is set to be flipped with respect to the key information in the light-emitting data corresponding to the corresponding light-emitting coding random number, and the key information in other detection data is set to be the same as the key information in the light-emitting data corresponding to the corresponding light-emitting coding random number.

3. The online detection method according to claim 2, wherein, The data configuration analysis step includes the following sub-steps: Make the simulated QKD device transmitter generate light-emitting data according to the light-emitting coding random number, which includes position information, state information, basis information, and key information; Make the simulated QKD device receiver send the position information, state information, and basis information in the detection data to the simulated QKD device transmitter; Make the simulated QKD device transmitter retain the data in the light-emitting data that has the same position information, state information, and basis information as the received detection data, and send the position information, state information, and basis information in the retained light-emitting data to the simulated QKD device receiver; Make the simulated QKD device transmitter randomly sample the retained light-emitting data according to the sampling random number to generate sampling data, and send the sampling data to the simulated QKD device receiver; Make the simulated QKD device transmitter extract the key information from the data in the retained light-emitting data that has not been sampled, and generate the sifted key SK-A1; Cause the receiver of the simulated QKD device to retain the data in the detection data that has the same position information, state information, and basis vector information as the received retained emission data, and extract key information from the data in the retained detection data that is different from the received sampling data, to generate the sifted key SK-B1.

4. The online detection method according to claim 3, wherein, In the data configuration analysis step, also cause the receiver of the simulated QKD device to perform error rate evaluation using the key information in the data in the retained detection data that has the same position information, state information, and basis vector information as the received sampling data.

5. The online detection method according to claim 3, wherein, In the data configuration analysis step, set a sampling identifier for the sampling data, and determine the data in the retained detection data that is different from the received sampling data according to the sampling identifier.

6. The online detection method according to claim 2, wherein, The preset ratio is 1%.

7. The online detection method according to claim 1, further comprising a step of outputting a detection result; and / or, setting the sampling random number according to a sampling ratio of 10%.

8. An online detection device for basis vector comparison of a QKD device, comprising a switch and a data configuration analysis module; The data configuration analysis module includes a comparison analysis unit, a transmitter of a simulated QKD device, and a receiver of a simulated QKD device; The transmitter of the simulated QKD device is configured to generate a sifted key SK-A1 according to the quantum key distribution protocol, using the set emission coding random number, sampling random number, and detection data; The receiver of the simulated QKD device is configured to generate a sifted key SK-B1 according to the quantum key distribution protocol, using the emission coding random number, sampling random number, and detection data; The switch is configured to inject the emission coding random number and the sampling random number into the transmitter of the QKD device, inject the detection data into the receiver of the QKD device; and collect the sifted key SK-A2 generated by the transmitter of the QKD device and the sifted key SK-B2 generated by the receiver of the QKD device, and send the sifted key SK-A2 and the sifted key SK-B2 to the data configuration analysis module; The comparison analysis unit is configured to judge whether the basis vector comparison function of the QKD device is normal according to the consistency comparison result between the sifted key SK-A1 and SK-A2 and / or the consistency comparison result between the sifted key SK-B1 and SK-B2.

9. The online detection device according to claim 8, wherein: The transmitter of the simulated QKD device is configured to generate emission data according to the emission coding random number, which includes position information, state information, basis vector information, and key information; Retain the data in the emission data that has the same position information, state information, and basis vector information as the detection data received from the receiver of the simulated QKD device; randomly sample the retained emission data according to the sampling random number to generate sampling data; Extract key information from the data in the retained emission data that has not been sampled to generate the sifted key SK-A1; send the position information, state information, and basis vector information in the retained emission data, and the sampling data to the receiver of the simulated QKD device; The receiver of the simulated QKD device is configured to send the position information, state information, and basis information in the detection data to the transmitter of the simulated QKD device; Retain the data in the detection data that has the same position information, state information, and basis information as the retained emission data received from the transmitter of the simulated QKD device; Extract the key information from the data in the retained detection data that is different from the received sampling data, and generate the sifted key SK-B1.

10. The on-line detection device according to claim 9, wherein, The receiver of the simulated QKD device is further configured to perform error rate evaluation using the key information in the data in the retained detection data that has the same position information, state information, and basis information as the received sampling data.