Communication method and device for quantum key distribution real-time simulation software

By adopting a universal message format for information transmission in quantum key distribution simulation software, the difficulty of comparing different simulation software when deployed across platforms is solved, direct comparison of results and modular design of simulation software are achieved, and the credibility of quantum key generation is improved.

CN120433939BActive Publication Date: 2025-09-05中电信量子信息科技集团有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510949056.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-10
Publication Date
2025-09-05
Estimated Expiration
2045-07-10

AI Technical Summary

Technical Problem

Existing quantum key distribution simulation software lacks a unified communication protocol standard, which makes it difficult to compare the results generated by different simulation software when deployed across platforms and makes it impossible to achieve interoperability, affecting the reuse and comparison of research results.

Method used

The quantum polarization state message and the basis message are encapsulated in a universal message format, and communication is carried out through quantum channels and traditional channels to ensure that the information transmission between the client and the server conforms to the universal message format, thereby realizing the generation and comparison of quantum key sequences.

Benefits of technology

Through standardized message parsing and generation methods, the complexity of result comparison is reduced, the modular design and maintenance of simulation software are promoted, and the credibility of quantum key generation is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120433939B_ABST
    Figure CN120433939B_ABST
Patent Text Reader

Abstract

The present application provides a communication method and device for real-time simulation software for quantum key distribution, including: generating a quantum polarization state message that conforms to a universal message format based on a first key sequence and a first basis sequence, and sending the quantum polarization state message through a quantum channel; a server configured to generate a second key sequence based on a second basis sequence and quantum polarization state information in the quantum polarization state message, generating a basis message that carries the first basis sequence and conforms to the universal message format, and sending the basis message to the server through a traditional channel; the server configured to generate a basis result based on the second basis sequence and the first basis sequence, generating a quantum key sequence based on the basis result and the second key sequence, and sending the basis result message that carries the basis result and conforms to the universal message format to a client through a traditional channel, and generating a quantum key sequence based on the first key sequence and the basis result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of quantum communication and information security technology, and specifically relates to a communication method and device for quantum key distribution real-time simulation software. Background Art

[0002] Quantum Key Distribution (QKD) is a key distribution technology based on the principles of quantum mechanics. Its core advantage lies in its ability to utilize the characteristics of quantum states, such as the quantum no-cloning theorem and the Heisenberg uncertainty principle, to achieve unconditionally secure key distribution.

[0003] The relevant technology simulates the QKD process through QKD simulation software, that is, performs a complete quantum key communication process so that both parties obtain the same quantum key sequence to research, develop and verify QKD technology.

[0004] However, existing QKD simulation software lacks a unified communication protocol standard, which makes it difficult to compare the results generated by different QKD simulation software when deployed across platforms. Summary of the Invention

[0005] This application aims to provide a communication method and device for quantum key distribution real-time simulation software, at least to solve the problem in the prior art that different simulation software cannot achieve cross-platform interconnection and interoperability, and research results are difficult to reuse and compare.

[0006] In a first aspect, an embodiment of the present application discloses a communication method for real-time simulation software for quantum key distribution, which is applied to a first device including a client simulated by the real-time simulation software, wherein the client is connected to a server simulated by the real-time simulation software in a second device based on a quantum channel and a traditional channel simulated by the real-time simulation software. The method includes:

[0007] generating a quantum polarization state message conforming to a universal message format based on the first key sequence and the first basis sequence, and sending the quantum polarization state message to the server through the quantum channel; the server being configured to generate a second key sequence based on the second basis sequence and the quantum polarization state information in the quantum polarization state message;

[0008] generating a basis message that carries the first basis sequence and conforms to the universal message format, and sending the basis message to the server through the traditional channel; the server being configured to generate a basis result based on the second basis sequence and the first basis sequence, generate a quantum key sequence based on the basis result and the second key sequence, and send a basis result message that carries the basis result and conforms to the universal message format to the client through the traditional channel;

[0009] The quantum key sequence is generated based on the first key sequence and the basis result.

[0010] In a second aspect, an embodiment of the present application discloses a communication method for quantum key distribution real-time simulation software, which is applied to a second device including a server simulated by the real-time simulation software, wherein the server is connected to a client simulated by the real-time simulation software in a first device based on a quantum channel and a traditional channel simulated by the real-time simulation software. The method includes:

[0011] receiving a quantum polarization state message sent through the quantum channel, and generating a second key sequence based on a second basis sequence and quantum polarization state information in the quantum polarization state message; the quantum polarization state message is a message generated by the client based on the first key sequence and the first basis sequence and conforming to a universal message format;

[0012] receiving a basis message sent via the conventional channel, generating a basis matching result based on the second basis sequence and the first basis sequence in the basis message, and sending a basis matching result message carrying the basis matching result and conforming to the universal message format to the client via the conventional channel; the basis message is generated by the client, carries the first basis sequence, and conforms to the universal message format; the client is configured to generate a quantum key sequence based on the first key sequence and the basis matching result;

[0013] The quantum key sequence is generated based on the second key sequence and the basis result.

[0014] In a third aspect, an embodiment of the present application discloses a communication device for quantum key distribution real-time simulation software, which is applied to a first device including a client simulated by the real-time simulation software. The client is connected to a server simulated by the real-time simulation software in a second device based on a quantum channel and a traditional channel simulated by the real-time simulation software. The method includes:

[0015] A first generating module is configured to generate a quantum polarization state message conforming to a universal message format based on a first key sequence and a first basis sequence, and to send the quantum polarization state message to the server through the quantum channel; the server is configured to generate a second key sequence based on a second basis sequence and quantum polarization state information in the quantum polarization state message;

[0016] a second generating module, configured to generate a basis message carrying the first basis sequence and conforming to the universal message format, and to send the basis message to the server via the traditional channel; the server being configured to generate a basis result based on the second basis sequence and the first basis sequence, generate a quantum key sequence based on the basis result and the second key sequence, and to send a basis result message carrying the basis result and conforming to the universal message format to the client via the traditional channel;

[0017] A third generation module is used to generate the quantum key sequence based on the first key sequence and the basis result.

[0018] In a fourth aspect, an embodiment of the present application discloses a communication device for quantum key distribution real-time simulation software, which is applied to a second device including a server simulated by the real-time simulation software, wherein the server is connected to a client simulated by the real-time simulation software in a first device based on a quantum channel and a traditional channel simulated by the real-time simulation software, and the method includes:

[0019] a first generating module, configured to receive a quantum polarization state message sent through the quantum channel, and generate a second key sequence based on a second basis sequence and quantum polarization state information in the quantum polarization state message; the quantum polarization state message is a message generated by the client based on the first key sequence and the first basis sequence and conforming to a universal message format;

[0020] a second generating module, configured to receive a basis message sent via the conventional channel, generate a basis matching result based on the second basis sequence and the first basis sequence in the basis message, and send a basis matching result message carrying the basis matching result and conforming to the universal message format to the client via the conventional channel; the basis message is generated by the client, carries the first basis sequence, and conforms to the universal message format; the client is configured to generate a quantum key sequence based on the first key sequence and the basis matching result;

[0021] A third generating module is used to generate the quantum key sequence based on the second key sequence and the basis result.

[0022] In a fifth aspect, an embodiment of the present application further discloses an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect or the second aspect are implemented.

[0023] In a sixth aspect, an embodiment of the present application further discloses a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.

[0024] In summary, in an embodiment of the present application, the quantum polarization state message generated by the client based on the first key sequence and the first basis sequence is a message that conforms to the universal message format, and when sending the first basis sequence to the server, the first basis sequence is encapsulated into a basis message that conforms to the universal message format to communicate with the server. In addition, after generating the basis result, the server sends a basis result message carrying the basis result to the client, and the basis result message is also a message that conforms to the universal message format. In the process of communication between the client and the server, the present application encapsulates the content to be sent into a message that conforms to the universal message format. Since the universal message format is used in the communication process of generating the quantum key sequence, various types of messages in the QKD simulation process are uniformly described. Therefore, when different QKD simulation software are deployed across platforms, the results generated by different QKD simulation software can be directly compared through standardized message parsing and generation methods. There is no need to customize the results generated by different QKD simulation software, thereby reducing the complexity of result comparison. In addition, in the communication method provided in the embodiment of the present application, by simulating the roles of the two communicating parties (simulated client-simulated server) in the real QKD system during the generation of the quantum key sequence, it is beneficial to the modular design and maintenance of the QKD simulation software, and by simulating the dual channel, the simulated quantum key is made more credible. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In the attached figure:

[0026] Figure 1 This is a flowchart of the steps of a communication method of quantum key distribution real-time simulation software provided in an embodiment of the present application;

[0027] Figure 2 This is a schematic diagram of a general message format provided in an embodiment of the present application;

[0028] Figure 3 This is a flowchart of another communication method of quantum key distribution real-time simulation software provided by an embodiment of the present application;

[0029] Figure 4 This is a flowchart of the interactive steps of a communication method of quantum key distribution real-time simulation software provided in an embodiment of the present application;

[0030] Figure 5 This is a flowchart of a key error correction method provided by an embodiment of the present application;

[0031] Figure 6 This is a flowchart of the steps of another communication method of quantum key distribution real-time simulation software provided in an embodiment of the present application;

[0032] Figure 7 It is a communication device for real-time simulation software of quantum key distribution provided in an embodiment of the present application;

[0033] Figure 8 It is another communication device for quantum key distribution real-time simulation software provided in an embodiment of the present application;

[0034] Figure 9 is a block diagram of an electronic device according to an embodiment of the present application;

[0035] Figure 10 This is a block diagram of an electronic device according to another embodiment of the present application. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0037] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0038] QKD is a key distribution technology based on the principles of quantum mechanics. Its core advantage lies in its ability to leverage the properties of quantum states, such as the quantum no-cloning theorem and the Heisenberg uncertainty principle, to achieve unconditionally secure key distribution. Unlike traditional key distribution methods, QKD changes the quantum state during key transmission if an eavesdropper attempts to steal information, allowing both communicating parties to detect the change in time and thus ensuring key security.

[0039] Despite the significant advantages of QKD technology, its practical application faces numerous limitations. One of the most prominent issues is the high cost of the equipment. The development and manufacturing of QKD equipment involves complex quantum optics, precision instrumentation, and other technologies, requiring a large amount of specialized equipment and high-end materials. This drives up prices, making such high costs prohibitive for many research institutions, businesses, and educational institutions. Furthermore, the maintenance and operation of QKD equipment requires specialized technicians, further increasing the cost and complexity of its use.

[0040] To address these issues, software simulation has emerged as a viable alternative. By simulating the QKD process with software, QKD technology can be researched, developed, and validated without relying on expensive hardware. Software simulation offers numerous advantages. First, it is low-cost. Only standard computer equipment and appropriate software are required to conduct QKD-related experiments and research, significantly reducing R&D costs and barriers to entry. Second, software simulation offers a high degree of flexibility and repeatability. Researchers can adjust simulation parameters as needed to simulate different QKD scenarios and conditions, enabling in-depth study of the performance and characteristics of QKD technology.

[0041] However, current QKD simulation software suffers from significant protocol fragmentation, severely hindering research efficiency and collaborative feasibility. Comparing mainstream simulation software (such as QKDsim and QuNetSim) reveals that existing tools employ proprietary binary formats (such as QKDsim's fixed-length header) or high-level encapsulation (such as QuNetSim's reliance on HTTP / REST). This results in cross-platform deployments requiring customized conversion for cross-platform data exchange, making comparison of generated results difficult.

[0042] In an embodiment of the present application, the quantum polarization state message generated by the client based on the first key sequence and the first basis sequence is a message that conforms to the universal message format, and when sending the first basis sequence to the server, the first basis sequence is encapsulated into a basis message that conforms to the universal message format to communicate with the server. In addition, after generating the basis result, the server sends a basis result message carrying the basis result to the client, and the basis result message is also a message that conforms to the universal message format. In the process of communication between the client and the server, the present application encapsulates the content to be sent into a message that conforms to the universal message format. Since the universal message format is used in the communication process of generating the quantum key sequence, various types of messages in the QKD simulation process are uniformly described. Therefore, when different QKD simulation software are deployed across platforms, the results generated by different QKD simulation software can be directly compared through standardized message parsing and generation methods. There is no need to customize the results generated by different QKD simulation software, thereby reducing the complexity of the result comparison. In addition, in the communication method provided in the embodiment of the present application, by simulating the roles of the two communicating parties (simulated client-simulated server) in the real QKD system during the generation of the quantum key sequence, it is beneficial to the modular design and maintenance of the QKD simulation software, and by simulating the dual channel, the simulated quantum key is made more credible.

[0043] Figure 1 This is a flowchart of a communication method for quantum key distribution real-time simulation software provided by an embodiment of the present application. The method is applied to a first device including a client simulated by the real-time simulation software. The client is connected to a server simulated by the real-time simulation software in a second device based on the quantum channel and the traditional channel simulated by the real-time simulation software. Figure 1 , the method may include the following steps:

[0044] Step 101: Based on a first key sequence and a first basis sequence, a quantum polarization state message conforming to a universal message format is generated, and the quantum polarization state message is sent to a server via a quantum channel; the server is configured to generate a second key sequence based on a second basis sequence and quantum polarization state information in the quantum polarization state message.

[0045] For example, see Figure 2The universal message format can be composed of three parts: a type field, a length field, and a value field. The type field occupies one byte and is used to identify the data type. The length field occupies four bytes and is used to indicate the byte length of the value field. The number of bytes occupied by the value field is variable and depends on the actual data content stored. The universal message format, with its standardized structure of type field, length field, and value field, excels in scenarios requiring flexible expansion and self-descriptiveness, and is particularly suitable for protocol design and binary data transmission. Encapsulation using a universal message format that includes the type field, length field, and value field ensures efficient data transmission and accurate parsing between different simulation software systems. Furthermore, encapsulation using a universal message format ensures good compatibility of the communication protocol, facilitating integration with different types of devices or other software systems. Furthermore, when new functionality or support for new protocols is required, it can be expanded based on the existing architecture and data format at a lower cost and effort, adapting to the evolving needs of quantum communication technology.

[0046] For example, the quantum channel is simulated via a TCP connection bound to the first port. The polarization state vector encoding protocol is used to encode quantum polarization state information and transmit quantum polarization state information of dimension C². Specifically, TCP is used at the network layer for communication, with a fixed listening connection on port 6789. This quantum channel is formed by binding TCP port 6789. The two communicating parties are Alice and Bob, using a client-server architecture. Alice is the sender of the key distribution protocol in the BB84 protocol, acting as the quantum state preparation terminal and the client in the software simulation. Bob is the receiver of the BB84 protocol, acting as the quantum state analysis terminal and the server in the software simulation. This architecture clearly simulates the roles of the two communicating parties in a real QKD system, making it easier to understand and implement, and facilitating modular software design and maintenance.

[0047] For example, the client generates a quantum polarization state message that conforms to the universal message format based on the first key sequence and the first basis sequence. It can generate quantum polarization state information based on the first key sequence and the first basis sequence, and then generate a quantum polarization state message that carries the quantum polarization state information and conforms to the universal message format. Finally, the quantum polarization state message is sent to the server through the quantum channel. Specifically, the client Alice is responsible for generating quantum polarization state information and sending it to the server Bob through the quantum channel. First, the random sequence generator is used to generate the first key sequence S A ={0, 1} L (a binary key sequence of length L), and the first basis sequence B A ={0, 1} L(Determine the polarization basis used for mapping, specifying 0 to represent the Z basis and 1 to represent the X basis), the first key sequence S A With the first basis sequence B A The bits correspond one to one, based on the first key sequence S A and the first basis sequence B A , using polarization state vector coding protocol to encode and generate quantum polarization state information P A Then, the client Alice generates a quantum polarization state information P A , and a quantum polarization state message that conforms to the universal message format of the type field, length field, and value field, and sends the quantum polarization state message to the server through the quantum channel.

[0048] For example, the server generates a second key sequence based on the second basis sequence and the quantum polarization state information in the quantum polarization state message. Specifically, after receiving the quantum polarization state message, the server Bob parses the value field of the quantum polarization state message to obtain the quantum polarization state information P A The server Bob first uses a random sequence generator to generate the second basis sequence B B ={0, 1} L (polarization basis used in the measurement), by the second basis sequence B B and quantum polarization state information P A Perform projection measurement operation to obtain the second key sequence S B , the second key sequence S obtained at this time B With the first key sequence S A There is a difference.

[0049] Step 102: Generate a basis message that carries the first basis sequence and conforms to a universal message format, and send the basis message to the server via a traditional channel; the server is configured to generate a basis result based on the second basis sequence and the first basis sequence, generate a quantum key sequence based on the basis result and the second key sequence, and send a basis result message that carries the basis result and conforms to the universal message format to the client via a traditional channel.

[0050] In this example, a conventional channel is simulated via a TCP connection bound to a second port, used to transmit packets for basis comparison, error correction, and privacy enhancement. Specifically, the TCP connection is established, with data transmitted through port 6790, distinct from the quantum channel's port 6789 to avoid port conflicts. The simulation software simulates the quantum channel and the conventional channel using two TCP ports (6789 and 6790), respectively. This allows for a realistic simulation of the transmission of quantum and classical information in a real-world QKD system, making the simulation results more reliable and valuable. This communication process fully covers the key stages of the BB84 protocol (quantum polarization state generation, transmission, basis comparison, error detection, error correction, privacy enhancement, and key generation). A simulation platform designed based on this communication process can obtain the final quantum key, providing a powerful tool for performance optimization, architecture design, and security assessment of future practical QKD systems.

[0051] For example, a random sequence generator is used to generate a first basis sequence B A Afterwards, the first basis sequence B is transmitted through the conventional channel. A Send to the server so that the server can perform subsequent basis comparison. Specifically, the client Alice is based on the first basis sequence B A A base message conforming to a universal message format including a type field, a length field, and a value field is generated, and the base message is sent to the server Bob through a traditional channel.

[0052] For example, the server generates a basis result based on the second basis sequence and the first basis sequence. Specifically, after receiving the basis message, the server Bob parses the basis message and obtains the first basis sequence B A , that is, the basis information used by the client Alice, and the second basis sequence B B Compare and calculate the basis result, that is, the basis matching degree vector D, where the basis matching degree vector D is calculated as follows: , That is, if the first basis sequence B A , and the second basis sequence B B If the same basis is used, the basis matching degree vector D is 1, otherwise it is 0. After obtaining the basis matching degree vector D, the server Bob uses the basis matching degree vector D and the second key sequence B to match the basis matching degree vector D. B Generate a quantum key sequence.

[0053] Step 103: Generate a quantum key sequence based on the first key sequence and the basis result.

[0054] For example, based on the basis result, the first basis sequence B ASpecifically, the first basis sequence B is screened according to the basis matching degree vector D. A Generate the first key data T A , in order to filter out the key data that both parties use with the same base, that is, , where S Ai Represents the first key sequence S A The value at the i-th bit, Represents the value at the i-th bit of the basis matching degree vector D.

[0055] For example, after obtaining the first key data, key detection, error correction, and privacy enhancement can be performed on the first key data to obtain a quantum key sequence, so as to avoid the risk of reuse of traditional keys and reduce the probability of key leakage. This application defines specific operating procedures for each link such as the generation of first key data, key detection, error correction, and privacy enhancement, which can achieve high-precision simulation. In addition, different parameter settings, such as the number of quantum bits, the number of error correction cycles, etc., can be flexibly adjusted to meet diverse simulation needs.

[0056] In an embodiment of the present application, the quantum polarization state message generated by the client based on the first key sequence and the first basis sequence is a message that conforms to the universal message format, and when sending the first basis sequence to the server, the first basis sequence is encapsulated into a basis message that conforms to the universal message format to communicate with the server. In addition, after generating the basis result, the server sends a basis result message carrying the basis result to the client, and the basis result message is also a message that conforms to the universal message format. In the process of communication between the client and the server, the present application encapsulates the content to be sent into a message that conforms to the universal message format. Since the universal message format is used in the communication process of generating the quantum key sequence, various types of messages in the QKD simulation process are uniformly described. Therefore, when different QKD simulation software are deployed across platforms, the results generated by different QKD simulation software can be directly compared through standardized message parsing and generation methods. There is no need to customize the results generated by different QKD simulation software, thereby reducing the complexity of the result comparison. In addition, in the communication method provided in the embodiment of the present application, by simulating the roles of the two communicating parties (simulated client-simulated server) in the real QKD system during the generation of the quantum key sequence, it is beneficial to the modular design and maintenance of the QKD simulation software, and by simulating the dual channel, the simulated quantum key is made more credible.

[0057] Figure 3This is a flowchart of another communication method for quantum key distribution real-time simulation software provided by the present application. The method is applied to a second device including a server simulated by the real-time simulation software. The server is connected to a client simulated by the real-time simulation software in the first device based on the quantum channel and the traditional channel simulated by the real-time simulation software. Figure 3 , the method may include the following steps:

[0058] Step 201: Receive a quantum polarization state message sent through a quantum channel, and generate a second key sequence based on a second basis sequence and quantum polarization state information in the quantum polarization state message; the quantum polarization state message is a message generated by the client based on the first key sequence and the first basis sequence and conforming to a universal message format.

[0059] For example, after receiving the quantum polarization state message sent through the quantum channel, the server Bob parses the value field of the quantum polarization state message to obtain the quantum polarization state information P A The server Bob first uses a random sequence generator to generate the second basis sequence B B ={0, 1} L (polarization basis used in the measurement), by the second basis sequence B B and quantum polarization state information P A Perform projection measurement operation to obtain the second key sequence S B The projection measurement operation is , the second key sequence S obtained at this time B With the first key sequence S A There is a difference.

[0060] Step 202: Receive a basis message sent via a traditional channel, generate a basis result based on the second basis sequence and the first basis sequence in the basis message, and send a basis result message carrying the basis result and conforming to a universal message format to the client via the traditional channel; the basis message is a message generated by the client, carrying the first basis sequence and conforming to the universal message format; the client is configured to generate a quantum key sequence based on the first key sequence and the basis result.

[0061] For example, the first basis sequence B A , and the second basis sequence B B Compare and calculate the basis result, that is, the basis matching degree vector D, where the basis matching degree vector D is calculated as follows: , That is, if the first basis sequence B A , and the second basis sequence B B If the same basis is used, the basis matching degree vector D is 1, otherwise it is 0. After obtaining the basis matching degree vector D, the server Bob uses the basis matching degree vector D and the second key sequence B to match the basis matching degree vector D.B Generate quantum key sequence. According to the basis matching degree vector D, the second key sequence B B Generate the second key data T B , in order to filter out the key data that both parties use with the same base, that is, ,in, Represents the second key sequence S B The value on the i-th bit, D i Represents the value at the i-th bit of the basis matching degree vector D.

[0062] For example, after obtaining the basis matching result, a basis matching result message is generated that carries the basis matching degree vector D and conforms to a universal message format with a type field, a length field, and a value field. The basis matching result message is then sent to the client via a traditional channel. This allows the client to generate a quantum key sequence based on the first key sequence and the basis matching result.

[0063] Step 203: Generate a quantum key sequence based on the second key sequence and the basis result.

[0064] For example, the method for generating a quantum key sequence based on the second key sequence and the basis result is the same as the method for generating a quantum key sequence based on the first key sequence and the basis result, and will not be described in detail here.

[0065] In an embodiment of the present application, the quantum polarization state message generated by the client based on the first key sequence and the first basis sequence is a message that conforms to the universal message format, and when sending the first basis sequence to the server, the first basis sequence is encapsulated into a basis message that conforms to the universal message format to communicate with the server. In addition, after generating the basis result, the server sends a basis result message carrying the basis result to the client, and the basis result message is also a message that conforms to the universal message format. In the process of communication between the client and the server, the present application encapsulates the content to be sent into a message that conforms to the universal message format. Since the universal message format is used in the communication process of generating the quantum key sequence, various types of messages in the QKD simulation process are uniformly described. Therefore, when different QKD simulation software are deployed across platforms, the results generated by different QKD simulation software can be directly compared through standardized message parsing and generation methods. There is no need to customize the results generated by different QKD simulation software, thereby reducing the complexity of the result comparison. In addition, in the communication method provided in the embodiment of the present application, by simulating the roles of the two communicating parties (simulated client-simulated server) in the real QKD system during the generation of the quantum key sequence, it is beneficial to the modular design and maintenance of the QKD simulation software, and by simulating the dual channel, the simulated quantum key is made more credible.

[0066] Figure 4This is a flowchart of the interactive steps of a communication method of a quantum key distribution real-time simulation software provided in an embodiment of the present application, see Figure 4 , which includes:

[0067] Step 301: The client maps the first key sequence based on the first key sequence and the first basis sequence to obtain quantum polarization state information.

[0068] For example, the first basis sequence B A Used to determine the polarization direction of the photon, the polarization state modulation function is used to convert the binary first key sequence S A Mapped into quantum polarization state information P A Among them, the polarization state modulation function As shown below:

[0069]

[0070] Where L represents the sequence length, and the quantum polarization state information P A Expressed as a 2-dimensional vector, . and Represents quantum polarization state information P A The two components of each vector component are stored in IEEE 754 double-precision floating point format, and the quantum polarization state information P A Occupies 8 bytes.

[0071] Step 302: The client uses the first type identifier as the value of the type field defined in the universal message format, and uses the first sequence identifier, the number of quantum polarization states in the quantum polarization state information, and the quantum polarization state information as the values ​​of the value field defined in the universal message format, to obtain a quantum polarization state message, and sends the quantum polarization state message to the server via the quantum channel; the first sequence identifier is used to represent the current simulation round.

[0072] For example, the first type identifier is a predefined type field value in the universal message format, used to identify the functional category of the message (such as quantum state transmission, basis negotiation, etc.). The first type identifier can be 0x01. After receiving the message, the server quickly determines the processing logic by parsing the type field. For example, if the type is 0x01, it is determined to be a quantum polarization state message. The first sequence identifier is used to mark the round number of the current quantum communication simulation or protocol run, ensuring the timing and uniqueness of messages across multiple rounds of interaction.

[0073] For example, the value of the type field of the quantum polarization state message is the first type identifier 0x01. Referring to Table 1, the value field of the quantum polarization state message includes: a 32-bit quantum data packet sequence number QPktSeq, a 32-bit quantum polarization state number QPolCnt, and quantum polarization state information QPolInfo. The size of the quantum polarization state information QPolInfo is determined by the number of quantum polarization states. The quantum data packet sequence number QPktSeq is the first sequence identifier, and the quantum polarization state information QPolInfo is P A Taking the quantum polarization state number QPoICnt as L as an example, the quantum polarization state information is 8×L bytes. The length field of the quantum polarization state message is used to represent the first sequence identifier, L, and P A After receiving the quantum polarization state message, it is sent to the server through the quantum channel.

[0074] Table 1

[0075]

[0076] Step 303: The server generates a second key sequence based on the second basis sequence and the quantum polarization state information in the quantum polarization state message.

[0077] This step may be specifically referred to the above step 201 and will not be described in detail here.

[0078] Step 304: The client generates a base message that carries the first base sequence and conforms to the universal message format, and sends the base message to the server through a traditional channel.

[0079] This step may be specifically referred to the above step 102 and will not be described in detail here.

[0080] Optionally, before step 304, the method further includes:

[0081] Step A1: The client receives a quantum polarization state response message sent through a quantum channel; the quantum polarization state response message is a message generated by the server, carries a first sequence identifier, and conforms to a universal message format.

[0082] Step 304 may specifically include:

[0083] Sub-step 3041: When a quantum polarization state response message is received, the second type identifier is used as the value of the type field defined in the universal message format, and the length of the first basis sequence and the first basis sequence are used as the values ​​of the value field defined in the universal message format to obtain a basis message.

[0084] For step A1 and sub-step 3041, the value of the type field of the quantum polarization state response message generated by the server is 0x02. Referring to Table 2, the value field includes: a quantum data packet sequence number QPktSeq with a size of 32 bits. The quantum data packet sequence number QPktSeq is a first sequence identifier, and the first sequence identifier is used to mark the round number of the current quantum communication simulation or protocol operation. The length field of the quantum polarization state response message is used to indicate the byte length of the first sequence identifier, which occupies 4 bytes. After the client Alice receives the quantum polarization state response message sent through the quantum channel, a basis message that conforms to the general message format of the type field, length field, and value field is generated based on the first basis sequence. The value of the type field of the basis message is the second type identifier 0x03. Referring to Table 3, the value field of the basis message includes: a basis length Blend with a size of 32 bits, and basis information BInfo, the size of the basis information BInfo is determined by the basis length. The basis length Blend is the first basis sequence B A The length of the basis information BInfo is the first basis sequence B A The length field of the base message is used to indicate the first base sequence B A The length of the first basis sequence B A The byte length is 4 bytes.

[0085] Table 2

[0086]

[0087] Table 3

[0088]

[0089] Step 305: The server generates a basis result based on the second basis sequence and the first basis sequence, generates a quantum key sequence based on the basis result and the second key sequence, and sends a basis result message carrying the basis result and conforming to a universal message format to the client through a traditional channel.

[0090] This step may be specifically referred to the above step 202 and will not be described in detail here.

[0091] Optionally, step 305 may specifically include:

[0092] Sub-step 3051: The server uses the fifth type identifier as the value of the type field defined in the universal message format, and uses the length of the base matching result and the base matching result as the values ​​of the value field defined in the universal message format, to obtain a base matching result message.

[0093] Sub-step 3052: Send a base matching result message to the client through a traditional channel.

[0094] For sub-steps 3051 and 3052, the value of the type field of the base matching result message is the fifth type identifier 0x04. Referring to Table 4, the value field includes: the base matching result length BResLen, which is 32 bits in size, and the base matching result information BResInfo. The size of the base matching result information BResInfo is determined by the length of the base matching result. The base matching result length BResLen is the basis matching degree vector D, and the base matching result information BResInfo is the length of the basis matching degree vector D. The length field of the base matching result message is used to represent the byte length of the basis matching degree vector D, which occupies 4 bytes.

[0095] Table 4

[0096]

[0097] Step 306: The server generates a quantum key sequence based on the second key sequence and the basis result.

[0098] This step may be specifically referred to the above step 203 and will not be described in detail here.

[0099] Optionally, step 306 may specifically include:

[0100] Sub-step 3061: Filter the second key sequence based on the base matching result to obtain second key data, and generate a second verification key based on the second key data;

[0101] Sub-step 3062: Receive a key detection message sent via a traditional channel; the key detection message is a message generated by the client and carries a first verification key and conforms to a universal message format; the first verification key is generated by the client based on the first key data; the first key data is obtained by the client by filtering the first key sequence based on the base matching result;

[0102] Sub-step 3063: Calculate a bit error rate based on the second verification key and the first verification key, determine a status code based on the bit error rate, and send a key detection result message that carries the status code and conforms to the universal message format to the client via the traditional channel.

[0103] Sub-step 3064: When the state code is the first state code, generate a second error correction key based on the second key data, and correct the second error correction key to obtain the quantum key sequence.

[0104] For sub-steps 3061 to 3064, taking the basis result as the basis matching degree vector D as an example, the second key sequence B is matched according to the basis matching degree vector D. B Screening is performed to obtain the second key data T B, in order to filter out the key data that both parties use with the same base, that is, ,in, Represents the second key sequence S B The value at the i-th bit, Represents the value of the i-th bit of the basis matching degree vector D. A Generate the first key data T A , in order to filter out the key data that both parties use with the same base, that is, , where S Ai Represents the first key sequence S A The value at the i-th bit position, Di, represents the value at the i-th bit position of the basis matching degree vector D.

[0105] In order to detect whether the quantum polarization state information has been eavesdropped, the client Alice and the server Bob will select some bit sequences for key verification. Define the sampling scale factor , the client is based on the first key data T A and the sampling scale factor , determine the first verification key J A Specifically, J A =T A [(1- )|T A |:|T A |]. Taking 0.1 as an example, the first verification key J A It can be the first key data T A The last 10% of the bits are used to generate the first verification key J. A Afterwards, the client verifies the key J based on the first A Generate, carry the first verification key J A , and conforms to the key detection message of the general message format. The value of the type field of the key detection message is 0x05. Referring to Table 5, the value field includes: the verification key length VKeyLen of 32 bits, and the verification key information VKeyInfo, wherein the size of the verification key information VKeyInfo is determined by the verification key length, and the verification key length VKeyLen is ×length, length is the length of the first key data. The verification key information VKeyInfo is the first verification key J A The length field of the key detection message is used to indicate the first verification key J A The length of the first verification key J A The byte length is 4 bytes.

[0106] Table 5

[0107]

[0108] The server uses the second key data T B and the sampling scale factor , determine the second verification key J B Specifically, J B =T B [(1- )|T B |:|T B |]. For example, the second verification key J B It can be the second key data T B The last 10% of the bits are used to store the data. In this way, the bits with the same base position can be extracted from the first key sequence and the second key sequence according to the basis comparison result to generate the filtered first key data and second key data. Thus, according to the first key data, the second key data and the sampling scale factor , determining a first verification key and a second verification key to perform key verification based on the first verification key and the second verification key.

[0109] For example, the bit error rate is a key indicator for measuring whether a quantum channel has been eavesdropped on. By calculating the bit error rate, it can be determined whether there is an illegal eavesdropper in the channel (such as Eve introducing interference through photon interception measurement). Based on the second verification key and the first verification key, the formula for calculating the bit error rate is as follows:

[0110]

[0111] Where BER represents the bit error rate, and HanmingDistance represents the first test key J A With the second verification key J B The number of inconsistencies, |J| represents the total number of verification keys.

[0112] The server generates a second error correction key based on the second key data, and performs error correction on the second error correction key to obtain a quantum key sequence. B and the sampling scale factor , determine the second error correction key Specifically, =T B [1:(1- )|T B |]. Taking 0.1 as an example, the second error correction key It can be the second key data T B The first 90% of the bits of data.

[0113] The status code is used to inform the client of the server's evaluation results of the current key, ensuring that both parties reach an agreement on the "usable status" of the key. After the bit error rate is calculated, the status code can be determined based on the bit error rate. Specifically, the status code can be determined based on the comparison result of the bit error rate with a preset threshold. A key detection result message carrying a status code and conforming to a universal message format is sent to the client via a traditional channel, so that the client can determine whether to re-initiate the quantum key distribution process or perform error correction and privacy enhancement on the key to obtain a quantum key sequence based on the status code. Transmitting the status code through a traditional channel can give full play to the low latency and high reliability advantages of traditional communications.

[0114] Optionally, sub-step 3064 may specifically include:

[0115] Sub-step 30641: When the bit error rate is greater than a preset threshold, determine the first status code as the status code;

[0116] Sub-step 30642: If the bit error rate is less than or equal to the preset threshold, determine the second status code as the status code;

[0117] Sub-step 30643: Use the sixth type identifier as the value of the type field defined in the universal message format, and use the status code as the value of the value field defined in the universal message format to obtain a key detection result message, and send the key detection result message to the client through a traditional channel.

[0118] For sub-steps 30641-30643, taking the preset threshold of 11%, the first status code of 0x11, and the first status code of 0x22 as an example, when the bit error rate is greater than 11%, 0x11 is determined as the status code. At this time, the value of the type field of the key detection result message is 0x06, and the value field is the status code SCode, whose value is 0x11. When the bit error rate is less than or equal to 11%, 0x22 is determined as the status code. At this time, the value of the type field of the key detection result message is 0x06. Referring to Table 6, the value field is the status code SCode with a size of 8 bits, and its value is 0x22. The length field of the key detection result message is used to indicate the byte length of 0x22, which occupies 4 bytes.

[0119] Table 6

[0120]

[0121] Step 307: The client generates a quantum key sequence based on the first key sequence and the basis result.

[0122] This step may be specifically referred to the above step 103 and will not be described in detail here.

[0123] Optionally, step 307 may specifically include:

[0124] Sub-step 3071: Filter the first key sequence based on the base matching result to obtain first key data; the server is configured to filter the second key sequence based on the base matching result to obtain second key data;

[0125] Sub-step 3072: Generate a first verification key based on the first key data, and send a key detection message in a universal message format and carrying the first verification key to the server via a traditional channel. The server is configured to generate a second verification key based on the second key data, calculate a bit error rate based on the second verification key and the first verification key, determine a status code based on the bit error rate, and send a key detection result message in a universal message format and carrying the status code to the client.

[0126] Sub-step 3073: In response to the key detection result message, when the state code is the first state code, generate a first error correction key based on the first key data, and correct the first error correction key to obtain a quantum key sequence.

[0127] For sub-steps 3071 to 3073, taking the first status code as 0x22 as an example, when the status code is 0x22, the first error correction key is generated based on the first key data. Specifically, the client generates the first error correction key based on the first key data T A and the sampling scale factor , determine the first error correction key Specifically, =T A [1:(1- )|T A |]. Taking 0.1 as an example, the first error correction key It can be the first key data T A The first 90% of the bits of data.

[0128] The specific process of sub-step 3071-sub-step 3072 can refer to the above sub-step 3061-sub-step 3062, and will not be described in detail here.

[0129] Optionally, step 3073 may specifically include:

[0130] Sub-step 20731: Correct the first error correction key to obtain a first enhanced key, and obtain a quantum key sequence based on the random parameter and the first enhanced key;

[0131] The method also includes:

[0132] Step B1: Generate a privacy-enhanced message that conforms to a universal message format based on random parameters, and send the privacy-enhanced message to a server via a traditional channel; the server is configured to obtain a quantum key sequence based on the random parameters and a second enhanced key; the second enhanced key is obtained by correcting the second error correction key; the second error correction key is generated based on the second key data.

[0133] For sub-step 20731-step B1, the first error correction key is corrected to obtain the first enhanced key. The total number of key error correction cycles is defined as N, and the dynamic grouping strategy is implemented in the kth round (1≤k≤N):

[0134] The current number of cycles is k, first the error correction key The sequence is grouped and the length of each group is defined as I k =k+1, (the first cycle group length is 2, the second is 3, and so on), and the group information G is obtained j ={S j , E j , P j}, j , S j Indicates the starting sequence number, E j Indicates the end sequence number, a total of m groups, where Indicates parity. The client Alice constructs a packet information message with a type field of 0x07. Referring to Table 7, the value field of the packet information message includes: the total number of loops LTotal of 8 bits, the number of loops in this round of loops LoopIdx of 8 bits, the number of packets GrpCnt of 32 bits, and the packet information GrpInfo. The size of the packet information GrpInfo is determined by the number of packets. The total number of loops LTotal is N, the number of loops in this round of loops LoopIdx is the current number of loops k, and the number of packets GrpCnt is m. The length field of the packet information message is used to indicate the total number of loops N, the current number of loops k, the number of packets m, and the byte length of the packet information, which occupies 4 bytes. After the packet information message is generated, the packet information message is sent to the server through a traditional channel.

[0135] Table 7

[0136]

[0137] As shown in Table 8, the group information GrpInfo includes: a 32-bit group start number GrpStart, a 32-bit group end number GrpEnd, and an 8-bit intra-group parity GrpParity. j , the group end number GrpEnd is the end sequence number Ej , the parity GrpParity within the group is the parity P j .

[0138] Table 8

[0139]

[0140] After receiving the packet information message, the server compares the parity of each group based on the group information in the message. If a parity error is found for a group, the server performs a binary search on the group. The server constructs a binary message with the Type field set to 0x0A (see Table 9). The Value field of the binary message includes a 32-bit starting sequence number, Start, and an ending sequence number, End. The server then sends the binary message to the client via a traditional channel. The Length field of the binary message indicates the byte length of the Start and End sequence numbers, which is 4 bytes.

[0141] Table 9

[0142]

[0143] After receiving the binary search message, the client calculates the parity of the interval from the starting sequence number to the ending sequence number based on the starting sequence number and the ending sequence number, and constructs a binary search result message with a type field of 0x0B. As shown in Table 10, the value field of the binary search result message includes an 8-bit parity value. The length field of the binary search result message indicates the byte length of the parity value, which occupies 4 bytes. The binary search result message is sent to the server via a traditional channel. After receiving the binary search result message, the server performs error correction based on the parity value. This process is repeated for multiple binary search requests and binary search results.

[0144] Table 10

[0145]

[0146] Finally, the server constructs a Group Information Result message with a Type field of 0x08. As shown in Table 11, the Group Information Result message includes a 32-bit loop number, LoopNo, for this loop, which is k. The Group Information Result message is sent to the client via a traditional channel. The Length field of the Group Information Result message indicates the byte length of loop number k, which is 4 bytes. After receiving the Group Information Result message, the client checks whether the loop number is less than N. If so, the client proceeds to the next loop. If it is equal to N, the client completes the final loop and ends the error correction process.

[0147] Table 11

[0148]

[0149] Based on random parameters and the first enhanced key, a quantum key sequence is obtained. Specifically, the random parameters include: a first parameter sequence a and a second parameter sequence b, wherein, The fourth type identifier 0x0C is used as the value of the type field defined in the universal message format, and the first parameter sequence a and the second parameter sequence b are used as the values ​​of the value field defined in the universal message format to obtain a privacy-enhancing message. Referring to Table 12, the value field of the privacy-enhancing message includes: RandA and RandB, each of 16 bits in size, where RandA represents the random sequence a and RandB represents the random sequence b. The high bit of the first parameter sequence a is filled with 0 to obtain the parameter sequence , fill the high bit of the second parameter sequence b with 0 to obtain the parameter sequence The random sequence a is the parameter sequence , random sequence b is the parameter sequence The length field of the privacy enhancement message is used to indicate the parameter sequence. , parameter sequence After the privacy enhancement message is generated, it is sent to the server through the traditional channel.

[0150] Table 12

[0151]

[0152] Based on the random parameters and the first enhanced key, a quantum key sequence is obtained. Specifically, the first enhanced key is grouped according to the first preset bit position to obtain multiple key subsequences, the first parameter sequence and the multiple key subsequences are multiplied to obtain multiple product results, and the multiple product results are added to the second parameter sequence to obtain multiple summation results. The values ​​of the second preset bit position in the multiple summation results are spliced ​​to obtain the quantum key sequence. Assume that the first preset bit position is 15 bits, the second preset bit position is 12 bits, and the first parameter sequence is the parameter sequence. , the second parameter sequence is the parameter sequence For example, the first enhanced key is divided into a group of 15 bits each, and multiple key subsequences {t1, t2, ..., t n}, the parameter sequence , parameter sequence , and multiple key subsequences {t1, t2, ..., t n} Perform decimal conversion respectively to obtain a decimal parameter sequence , decimal parameter sequence , and multiple decimal key subsequences {t1, t2, ..., t n}. The decimal parameter sequence with multiple decimal key subsequences {t1, t2, ..., t n} perform product operation, and then add multiple product results to the decimal parameter sequence Perform addition operations to obtain multiple summation results, select the value of the last 12 bits in each summation result, and splice them to obtain the quantum key sequence. The specific calculation formula is as follows:

[0153]

[0154] Where K represents the quantum key sequence, LSB 12 Indicates the last 12 bits, a represents the decimal number of the first parameter sequence, b represents the decimal number of the second parameter sequence, t i A decimal number representing the key subsequence of group i.

[0155] For example, the method for obtaining a quantum key sequence based on random parameters and a second enhanced key is the same as the method for obtaining a quantum key sequence based on random parameters and the first enhanced key. The method for generating a second error correction key based on the second key data and correcting the second error correction key to obtain a second enhanced key is the same as the method for generating a first error correction key based on the first key data and correcting the first error correction key to obtain a first enhanced key, and will not be described in detail here.

[0156] After the server obtains the final quantum key sequence, it generates a QKD end message that conforms to the universal message format. Specifically, the QKD end message is constructed with a type field of 0x0D. As shown in Table 13, the value field of the QKD end message includes an 8-bit status code Scode. The status code Scode is set to 0x01, occupying 1 byte, indicating that the entire QKD communication process has successfully concluded. The length field of the end message is used to indicate the byte length of 0x01, occupying 4 bytes. This message is sent to the client via a traditional channel, indicating the completion of a complete quantum key communication process, and both parties have obtained the same quantum key sequence.

[0157] Table 13

[0158]

[0159] Figure 5 This is a flowchart of a key error correction method provided by an embodiment of the present application, see Figure 5 , this step may specifically include:

[0160] Step S1: The client sends a packet information message to the server.

[0161] Step S2: The server sends a binary message to the client.

[0162] Step S3: The client sends a binary search result message to the server.

[0163] Step S4: The client and the server request binary division messages multiple times and reply binary division result messages.

[0164] Step S5: The server sends a grouping information result message to the client.

[0165] Figure 6 This is a flowchart of the steps of another communication method of quantum key distribution real-time simulation software provided in the embodiment of the present application, see Figure 6 , which includes:

[0166] Step M1: The client sends a quantum polarization state message to the server.

[0167] Step M2: The server sends a quantum polarization state response message to the client.

[0168] Step M3: The client sends a base message to the server.

[0169] Step M4: The server sends a base matching result message to the client.

[0170] Step M5: The client sends a key detection message to the server.

[0171] Step M6: The server sends a key detection result message to the client.

[0172] Step M7: The client determines the key detection result. If it meets the conditions, it jumps to step M8; otherwise, the simulation process ends.

[0173] Step M8: The client and the server perform a key error correction process.

[0174] Step M9: The client sends a privacy enhancement message to the server.

[0175] Step M10: The client generates a quantum key sequence.

[0176] Step M11: The server generates a quantum key sequence.

[0177] Step M12: The server sends a quantum key distribution end message to the client.

[0178] The communication method proposed in this application provides consistent development specifications for QKD simulation software, helping to address the current fragmentation and lack of unified standards in simulation software. QKD simulation software developed by different teams can be interconnected across platforms simply by implementing standardized packet parsing and generation logic, significantly lowering the barrier to collaboration. This not only improves the comparability of simulation results but also lays the foundation for future interoperability of quantum communication technologies.

[0179] See also Figure 7 , which shows a communication device 40 for quantum key distribution real-time simulation software provided in an embodiment of the present application, applied to a first device including a client simulated by the real-time simulation software, wherein the client is connected to a server simulated by the real-time simulation software in a second device based on the quantum channel and the traditional channel simulated by the real-time simulation software, and the device 40 includes:

[0180] A first generating module 401 is configured to generate a quantum polarization state message conforming to a universal message format based on a first key sequence and a first basis sequence, and send the quantum polarization state message to the server through the quantum channel; the server is configured to generate a second key sequence based on a second basis sequence and the quantum polarization state information in the quantum polarization state message;

[0181] A second generating module 402 is configured to generate a basis message that carries the first basis sequence and conforms to the universal message format, and send the basis message to the server via the traditional channel; the server is configured to generate a basis result based on the second basis sequence and the first basis sequence, generate a quantum key sequence based on the basis result and the second key sequence, and send a basis result message that carries the basis result and conforms to the universal message format to the client via the traditional channel;

[0182] The third generating module 403 is configured to generate the quantum key sequence based on the first key sequence and the basis result.

[0183] Optionally, the first generating module includes:

[0184] a mapping submodule, configured to map the first key sequence based on the first key sequence and the first basis sequence to obtain the quantum polarization state information;

[0185] A first determination submodule is configured to use a first type identifier as the value of a type field defined in the universal message format, and use a first sequence identifier, the number of quantum polarization states in the quantum polarization state information, and the quantum polarization state information as the values ​​of a value field defined in the universal message format to obtain the quantum polarization state message; the first sequence identifier is used to characterize a current simulation round.

[0186] Optionally, the device further includes:

[0187] A first receiving module is configured to receive a quantum polarization state response message sent through the quantum channel; the quantum polarization state response message is a message generated by the server, carries a first sequence identifier, and conforms to the universal message format;

[0188] The second generation module includes:

[0189] The second determination submodule is used to, upon receiving the quantum polarization state response message, use the second type identifier as the value of the type field defined in the universal message format, and use the length of the first basis sequence and the first basis sequence as the values ​​of the value field defined in the universal message format to obtain the basis message.

[0190] Optionally, the third generation module includes:

[0191] a screening submodule, configured to screen the first key sequence based on the base matching result to obtain first key data; and the server is configured to screen the second key sequence based on the base matching result to obtain second key data;

[0192] a first generation submodule, configured to generate a first verification key based on the first key data, and send a key detection message carrying the first verification key and conforming to the universal message format to the server via the traditional channel; the server being configured to generate a second verification key based on the second key data, calculate a bit error rate based on the second verification key and the first verification key, determine a status code based on the bit error rate, and send a key detection result message carrying the status code and conforming to the universal message format to the client;

[0193] a second generating submodule, configured to, in response to the key detection result message, generate a first error correction key based on the first key data when the status code is the first state code, and perform error correction on the first error correction key to obtain the quantum key sequence.

[0194] Optionally, the first generation submodule includes:

[0195] a first determining unit, configured to use the third type identifier as a value of the type field defined in the universal message format, and use the length of the first verification key and the first verification key as values ​​of the value field defined in the universal message format, to obtain the key detection message;

[0196] The first sending unit is configured to send the key detection message to the server through the traditional channel.

[0197] Optionally, the second generation submodule includes:

[0198] an error correction enhancement unit, configured to perform error correction on the first error correction key to obtain a first enhanced key, and obtain the quantum key sequence based on a random parameter and the first enhanced key;

[0199] The device further comprises:

[0200] A fourth generation module is configured to generate a privacy-enhanced message that conforms to the universal message format based on the random parameters, and to send the privacy-enhanced message to the server through the traditional channel; the server is configured to obtain the quantum key sequence based on the random parameters and a second enhanced key; the second enhanced key is obtained by correcting the second error correction key; and the second error correction key is generated based on the second key data.

[0201] Optionally, the random parameters include: a first parameter sequence and a second parameter sequence;

[0202] The error correction enhancement unit comprises:

[0203] a grouping subunit, configured to group the first enhanced key according to a first preset bit position to obtain a plurality of key subsequences;

[0204] an operation subunit, configured to perform a multiplication operation on each of the first parameter sequence and the plurality of key subsequences to obtain a plurality of multiplication results, and perform an addition operation on each of the plurality of multiplication results and the second parameter sequence to obtain a plurality of summation results;

[0205] The splicing subunit is used to splice the values ​​of the second preset bits in the multiple addition results to obtain the quantum key sequence.

[0206] Optionally, the fourth generating module includes:

[0207] The third determination submodule is configured to use the fourth type identifier as the value of the type field defined in the universal message format, and use the random parameter as the value of the value field defined in the universal message format, to obtain the privacy enhancement message.

[0208] Optionally, the quantum channel is simulated by a TCP connection bound to the first port; and the traditional channel is simulated by a TCP connection bound to the second port.

[0209] See also Figure 8 , which shows another communication device 50 for real-time simulation software of quantum key distribution provided by an embodiment of the present application, applied to a second device including a server simulated by the real-time simulation software, wherein the server is connected to a client simulated by the real-time simulation software in a first device based on the quantum channel and the traditional channel simulated by the real-time simulation software, and the device 50 includes:

[0210] A first generating module 501 is configured to receive a quantum polarization state message sent through the quantum channel and generate a second key sequence based on a second basis sequence and quantum polarization state information in the quantum polarization state message; the quantum polarization state message is a message generated by the client based on the first key sequence and the first basis sequence and conforming to a universal message format;

[0211] A second generating module 502 is configured to receive a basis message sent via the conventional channel, generate a basis matching result based on the second basis sequence and the first basis sequence in the basis message, and send a basis matching result message carrying the basis matching result and conforming to the universal message format to the client via the conventional channel; the basis message is generated by the client, carries the first basis sequence, and conforms to the universal message format; the client is configured to generate a quantum key sequence based on the first key sequence and the basis matching result;

[0212] The third generating module 503 is configured to generate the quantum key sequence based on the second key sequence and the basis result.

[0213] Optionally, the second generating module 502 includes:

[0214] a first determining submodule, configured to use the fifth type identifier as the value of the type field defined in the universal message format, and use the length of the base matching result and the base matching result as the values ​​of the value field defined in the universal message format, to obtain the base matching result message;

[0215] The sending submodule is used to send the base matching result message to the client through the traditional channel.

[0216] Optionally, the third generation module includes:

[0217] a screening submodule, configured to screen the second key sequence based on the base matching result to obtain second key data, and generate a second verification key based on the second key data;

[0218] a receiving submodule, configured to receive a key detection message sent via the traditional channel; the key detection message is a message generated by the client and carries a first verification key and conforms to the universal message format; the first verification key is generated by the client based on first key data; the first key data is obtained by the client by screening the first key sequence based on the basis matching result;

[0219] a calculation submodule, configured to calculate a bit error rate based on the second verification key and the first verification key, determine a status code according to the bit error rate, and send a key detection result message carrying the status code and conforming to the universal message format to the client via the traditional channel;

[0220] The second determining submodule is used to generate a second error correction key based on the second key data when the state code is the first state code, and correct the second error correction key to obtain the quantum key sequence.

[0221] Optionally, the second determining submodule includes:

[0222] a first determining unit, configured to determine a first state code as the state code when the bit error rate is greater than a preset threshold;

[0223] a second determining unit, configured to determine a second state code as the state code when the bit error rate is less than or equal to the preset threshold;

[0224] The third determination unit is used to use the sixth type identifier as the value of the type field defined in the universal message format, and use the status code as the value of the value field defined in the universal message format, to obtain the key detection result message, and send the key detection result message to the client through the traditional channel.

[0225] In an embodiment of the present application, the quantum polarization state message generated by the client based on the first key sequence and the first basis sequence is a message that conforms to the universal message format, and when sending the first basis sequence to the server, the first basis sequence is encapsulated into a basis message that conforms to the universal message format to communicate with the server. In addition, after generating the basis result, the server sends a basis result message carrying the basis result to the client, and the basis result message is also a message that conforms to the universal message format. In the process of communication between the client and the server, the present application encapsulates the content to be sent into a message that conforms to the universal message format. Since the universal message format is used in the communication process of generating the quantum key sequence, various types of messages in the QKD simulation process are uniformly described. Therefore, when different QKD simulation software are deployed across platforms, the results generated by different QKD simulation software can be directly compared through standardized message parsing and generation methods. There is no need to customize the results generated by different QKD simulation software, thereby reducing the complexity of the result comparison. In addition, in the communication method provided in the embodiment of the present application, by simulating the roles of the two communicating parties (simulated client-simulated server) in the real QKD system during the generation of the quantum key sequence, it is beneficial to the modular design and maintenance of the QKD simulation software, and by simulating the dual channel, the simulated quantum key is made more credible.

[0226] Figure 9 This is a block diagram of an electronic device 600 according to an embodiment of the present application. Figure 9 , electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .

[0227] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 602 may include one or more modules to facilitate interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.

[0228] The memory 604 is used to store various types of data to support operations on the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, multimedia, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0229] The power supply assembly 606 provides power to the various components of the electronic device 600. The power supply assembly 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.

[0230] The multimedia component 608 includes an interface that provides an output interface between the electronic device 600 and the user. In some embodiments, the interface may include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensors can not only sense the demarcation of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action. In some embodiments, the multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When the electronic device 600 is in an operating mode, such as a capture mode or a multimedia mode, the front-facing camera and / or the rear-facing camera can receive external multimedia data. Each front-facing camera and the rear-facing camera can have a fixed optical lens system or have focal length and optical zoom capabilities.

[0231] The audio component 610 is used to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC) that is used to receive external audio signals when the electronic device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals can be further stored in the memory 604 or transmitted via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.

[0232] The input / output I / O interface 612 provides an interface between the processing component 602 and peripheral interface modules, such as a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0233] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the electronic device 600, the relative positioning of components, such as the display and keypad of the electronic device 600. The sensor assembly 614 can also detect changes in the position of the electronic device 600 or a component of the electronic device 600, the presence or absence of user contact with the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and temperature changes of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0234] The communication component 616 is used to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0235] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to implement a communication method for quantum key distribution real-time simulation software provided in an embodiment of the present application.

[0236] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, which can be executed by a processor 420 of an electronic device 400 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0237] Figure 10 is a block diagram of an electronic device 700 according to another embodiment of the present application. For example, the electronic device 700 may be provided as a server. Figure 10 The electronic device 700 includes a processing component 722, which further includes one or more processors, and a memory resource represented by a memory 732 for storing instructions executable by the processing component 722, such as an application. The application stored in the memory 732 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 722 is configured to execute instructions to perform a communication method for quantum key distribution real-time simulation software provided in an embodiment of the present application.

[0238] The electronic device 700 may further include a power supply component 726 configured to perform power management of the electronic device 700, a wired or wireless network interface 750 configured to connect the electronic device 700 to a network, and an input / output (I / O) interface 758. The electronic device 700 may operate based on an operating system stored in the memory 732, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.

[0239] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0240] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A communication method for quantum key distribution real-time simulation software, characterized in that: The method is applied to a first device including a client simulated by the real-time simulation software, wherein the client is connected to a server simulated by the real-time simulation software in a second device based on a quantum channel and a traditional channel simulated by the real-time simulation software, and comprises: generating a quantum polarization state message conforming to a universal message format based on the first key sequence and the first basis sequence, and sending the quantum polarization state message to the server through the quantum channel; the server being configured to generate a second key sequence based on the second basis sequence and the quantum polarization state information in the quantum polarization state message; generating a basis message that carries the first basis sequence and conforms to the universal message format, and sending the basis message to the server through the traditional channel; the server being configured to generate a basis result based on the second basis sequence and the first basis sequence, generate a quantum key sequence based on the basis result and the second key sequence, and send a basis result message that carries the basis result and conforms to the universal message format to the client through the traditional channel; The quantum key sequence is generated based on the first key sequence and the basis result.

2. The method according to claim 1, characterized in that The step of generating a quantum polarization state message conforming to a universal message format based on the first key sequence and the first basis sequence includes: Mapping the first key sequence based on the first key sequence and the first basis sequence to obtain the quantum polarization state information; The first type identifier is used as the value of the type field defined in the universal message format, and the first sequence identifier, the number of quantum polarization states in the quantum polarization state information, and the quantum polarization state information are used as the values ​​of the value field defined in the universal message format to obtain the quantum polarization state message; the first sequence identifier is used to characterize the current simulation round.

3. The method according to claim 1, characterized in that Before generating the base message that carries the first base sequence and conforms to the universal message format, the method further includes: receiving a quantum polarization state response message sent through the quantum channel; the quantum polarization state response message is a message generated by the server, carries a first sequence identifier, and conforms to the universal message format; The generating of the base message that carries the first base sequence and conforms to the universal message format includes: Upon receiving the quantum polarization state response message, the second type identifier is used as the value of the type field defined in the universal message format, and the length of the first basis sequence and the first basis sequence are used as the values ​​of the value field defined in the universal message format to obtain the basis message.

4. The method according to claim 1, wherein Generating the quantum key sequence based on the first key sequence and the basis result includes: The first key sequence is screened based on the base matching result to obtain first key data; the server is configured to screen the second key sequence based on the base matching result to obtain second key data; generating a first verification key based on the first key data, and sending a key detection message that carries the first verification key and conforms to the universal message format to the server via the traditional channel; the server is configured to generate a second verification key based on the second key data, calculate a bit error rate based on the second verification key and the first verification key, determine a status code based on the bit error rate, and send a key detection result message that carries the status code and conforms to the universal message format to the client; In response to the key detection result message, when the state code is the first state code, a first error correction key is generated based on the first key data, and the first error correction key is corrected to obtain the quantum key sequence.

5. The method according to claim 4, characterized in that The sending, through the traditional channel, to the server a key detection message that carries the first verification key and conforms to the universal message format, includes: Using the third type identifier as the value of the type field defined in the universal message format, and using the length of the first verification key and the first verification key as the values ​​of the value field defined in the universal message format, to obtain the key detection message; The key detection message is sent to the server through the traditional channel.

6. The method according to claim 4, characterized in that Correcting the first error-correcting key to obtain the quantum key sequence includes: Correcting the first error correction key to obtain a first enhanced key, and obtaining the quantum key sequence based on a random parameter and the first enhanced key; The method further comprises: A privacy-enhanced message conforming to the universal message format is generated based on the random parameters, and the privacy-enhanced message is sent to the server through the traditional channel; the server is used to obtain the quantum key sequence based on the random parameters and a second enhanced key; the second enhanced key is obtained by correcting the second error correction key; the second error correction key is generated based on the second key data.

7. The method according to claim 6, characterized in that The random parameters include: a first parameter sequence and a second parameter sequence; The obtaining the quantum key sequence based on the random parameter and the first enhanced key includes: Grouping the first enhanced key according to first preset bits to obtain multiple key subsequences; performing a multiplication operation on each of the first parameter sequence and the plurality of key subsequences to obtain a plurality of product results, and performing an addition operation on each of the plurality of product results and the second parameter sequence to obtain a plurality of summation results; The values ​​of the second preset bits in the multiple addition results are concatenated to obtain the quantum key sequence.

8. The method according to claim 6, characterized in that The generating, based on the random parameter, a privacy-enhancing message conforming to the universal message format includes: The fourth type identifier is used as the value of the type field defined in the universal message format, and the random parameter is used as the value of the value field defined in the universal message format to obtain the privacy enhancement message.

9. The method according to claim 1, characterized in that The quantum channel is simulated by a TCP connection bound to a first port; the traditional channel is simulated by a TCP connection bound to a second port.

10. A communication method for quantum key distribution real-time simulation software, characterized in that: The method is applied to a second device including a server simulated by the real-time simulation software, wherein the server is connected to a client simulated by the real-time simulation software in the first device based on the quantum channel and the traditional channel simulated by the real-time simulation software, and comprises: receiving a quantum polarization state message sent through the quantum channel, and generating a second key sequence based on a second basis sequence and quantum polarization state information in the quantum polarization state message; the quantum polarization state message is a message generated by the client based on the first key sequence and the first basis sequence and conforming to a universal message format; receiving a basis message sent via the conventional channel, generating a basis matching result based on the second basis sequence and the first basis sequence in the basis message, and sending a basis matching result message carrying the basis matching result and conforming to the universal message format to the client via the conventional channel; the basis message is generated by the client, carries the first basis sequence, and conforms to the universal message format; the client is configured to generate a quantum key sequence based on the first key sequence and the basis matching result; The quantum key sequence is generated based on the second key sequence and the basis result.

11. The method according to claim 10, characterized in that The sending, through the traditional channel, to the client, a base matching result message that carries the base matching result and conforms to the universal message format, includes: Using the fifth type identifier as the value of the type field defined in the universal message format, and using the length of the basis result and the basis result as the values ​​of the value field defined in the universal message format, to obtain the basis result message; The base matching result message is sent to the client through the traditional channel.

12. The method according to claim 10, characterized in that Generating the quantum key sequence based on the second key sequence and the basis result includes: Filtering the second key sequence based on the basis result to obtain second key data, and generating a second verification key based on the second key data; receiving a key detection message sent via the traditional channel; the key detection message is a message generated by the client and carries a first verification key and conforms to the universal message format; the first verification key is generated by the client based on first key data; the first key data is obtained by the client by screening the first key sequence based on the basis matching result; Calculating a bit error rate based on the second verification key and the first verification key, determining a status code according to the bit error rate, and sending a key detection result message that carries the status code and conforms to the universal message format to the client through the traditional channel; When the state code is the first state code, a second error correction key is generated based on the second key data, and the second error correction key is corrected to obtain the quantum key sequence.

13. The method according to claim 12, characterized in that The determining of the status code according to the bit error rate, and sending a key detection result message carrying the status code and conforming to the universal message format to the client through the traditional channel, includes: When the bit error rate is greater than a preset threshold, determining the first state code as the state code; When the bit error rate is less than or equal to the preset threshold, determining the second state code as the state code; The sixth type identifier is used as the value of the type field defined in the universal message format, and the status code is used as the value of the value field defined in the universal message format to obtain the key detection result message, and the key detection result message is sent to the client through the traditional channel.

14. A communication device for quantum key distribution real-time simulation software, characterized in that: The apparatus is applied to a first device including a client simulated by the real-time simulation software, wherein the client is connected to a server simulated by the real-time simulation software in a second device based on a quantum channel and a conventional channel simulated by the real-time simulation software, and comprises: A first generating module is configured to generate a quantum polarization state message conforming to a universal message format based on a first key sequence and a first basis sequence, and to send the quantum polarization state message to the server through the quantum channel; the server is configured to generate a second key sequence based on a second basis sequence and quantum polarization state information in the quantum polarization state message; a second generating module, configured to generate a basis message carrying the first basis sequence and conforming to the universal message format, and to send the basis message to the server via the traditional channel; the server being configured to generate a basis result based on the second basis sequence and the first basis sequence, generate a quantum key sequence based on the basis result and the second key sequence, and to send a basis result message carrying the basis result and conforming to the universal message format to the client via the traditional channel; A third generation module is used to generate the quantum key sequence based on the first key sequence and the basis result.

15. A communication device for quantum key distribution real-time simulation software, characterized in that: A second device including a server simulated by the real-time simulation software is connected to a client simulated by the real-time simulation software in the first device based on the quantum channel and the traditional channel simulated by the real-time simulation software, the device comprising: a first generating module, configured to receive a quantum polarization state message sent through the quantum channel, and generate a second key sequence based on a second basis sequence and quantum polarization state information in the quantum polarization state message; the quantum polarization state message is a message generated by the client based on the first key sequence and the first basis sequence and conforming to a universal message format; a second generating module, configured to receive a basis message sent via the conventional channel, generate a basis matching result based on the second basis sequence and the first basis sequence in the basis message, and send a basis matching result message carrying the basis matching result and conforming to the universal message format to the client via the conventional channel; the basis message is generated by the client, carries the first basis sequence, and conforms to the universal message format; the client is configured to generate a quantum key sequence based on the first key sequence and the basis matching result; A third generating module is used to generate the quantum key sequence based on the second key sequence and the basis result.

16. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 13 are implemented.

17. A readable storage medium, characterized in that The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.

Citation Information

Patent Citations

  • Quantum key distribution method and system based on password block link mode

    CN115174051A

  • System and method for quantum-secure microgrids

    US20250007700A1