Quantum key-based data security transmission method, device and equipment and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU DBAPPSECURITY CO LTD
- Filing Date
- 2025-07-14
- Publication Date
- 2026-06-19
Smart Images

Figure CN120856319B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quantum secure communication technology, and in particular to a method, apparatus, device, and medium for secure data transmission based on quantum keys. Background Technology
[0002] With the rapid development of information technology, data privacy protection has become a top priority. Federated learning, as an emerging machine learning framework, trains models across multiple distributed devices or institutions, eliminating the need for centralized data collection and thus protecting user data privacy to some extent. It is widely used in fields such as healthcare, finance, and industry. In multi-node transmission scenarios, the real-time performance and security requirements of data are extremely high. However, traditional federated learning frameworks rely on classical encryption algorithms, such as AES (Advanced Encryption Standard), during data transmission. The security of these algorithms is based on mathematical problems, such as large number factorization and discrete logarithms. With the rapid development of quantum computing technology, the powerful computing capabilities of quantum computers make these mathematical problems vulnerable to easy cracking, potentially rendering traditional encryption algorithms ineffective in protecting data confidentiality and integrity in the post-quantum era. Furthermore, traditional federated learning faces other challenges in multi-node transmission scenarios. First, unconditional security is difficult to guarantee. Classical encryption algorithms rely on mathematical problems, but the advent of quantum computing makes these problems no longer insurmountable, thus making them vulnerable to quantum attacks. Second, dynamic key management is inefficient. In industrial multi-node scenarios, the frequency of key distribution and updates is crucial, but existing solutions struggle to meet this requirement, limiting the efficiency and security of key management. Finally, end-to-end integrity is difficult to guarantee. Data is susceptible to tampering during transmission, directly impacting the accuracy of model aggregation and consequently affecting the performance and reliability of the entire federated learning system.
[0003] While quantum key distribution (QKD) technology can theoretically provide unconditionally secure keys, thereby enhancing data transmission security, the integration of QKD with federated learning currently lacks systematic design and research. In particular, existing technical solutions have many shortcomings in areas such as industrial data stream parsing, dynamic key adaptation, and lightweight encryption, limiting their widespread application and practical deployment in multi-node transmission scenarios. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for secure data transmission based on quantum key distribution, which can overcome the contradiction between key management efficiency and computational resource consumption in traditional schemes while ensuring unconditional security. It achieves organic adaptation between quantum key distribution protocols and federated learning processes, enabling industrial nodes to complete secure parameter exchange and model collaborative training in dynamic network environments, significantly improving the security and availability of data streams in complex industrial scenarios. The specific solution is as follows:
[0005] In a first aspect, this application discloses a quantum key-based secure data transmission method, applicable to participating parties, including:
[0006] The gradient update amount is determined based on the target dataset, and the gradient of the current federated learning model is hierarchically encrypted using quantum key distribution based on the gradient update amount to obtain the corresponding encrypted gradient; the target dataset is a dataset constructed based on data collected by industrial sensors participating in federated learning.
[0007] The encrypted gradient and the quantum key are transmitted to the central server so that the central server can determine the aggregated global gradient based on the encrypted gradient and the quantum key.
[0008] The quantum key is updated based on a preset update cycle, and the updated key is sent to the central server through a redundant quantum channel. The central server then uses the updated key to encrypt the aggregated global gradient and broadcasts the encrypted global gradient to the participants.
[0009] The encrypted global gradient is decrypted based on the updated key to obtain the decrypted gradient. The current federated learning model is then updated based on the decrypted gradient to complete the multi-node transmission of federated learning data.
[0010] Optionally, before determining the gradient update amount based on the target dataset, the method further includes:
[0011] The raw data collected by the industrial sensor is normalized to obtain the processed data;
[0012] If the original data is non-numerical data, then the original data is mapped into a numerical vector through one-hot encoding;
[0013] The dimension-reduced vector data is determined based on the relationship between the mutual information value between the processed data or the numerical vector and the target variable and a preset threshold.
[0014] The dimensionality-reduced vector data is encapsulated using a data generation timestamp, a data source device identifier, and a cyclic redundancy check code to obtain the target dataset.
[0015] Optionally, before performing hierarchical encryption of the gradient of the current federated learning model using a quantum key based on the gradient update amount, the method further includes:
[0016] Generate the initial key using the BB84 protocol;
[0017] The initial key is divided into blocks using the Cascade protocol, and the corresponding blocks are verified level by level to correct erroneous bits and generate the quantum key.
[0018] Optionally, determining the gradient update amount based on the target dataset includes:
[0019] The gradient update amount is determined based on the target dataset using a gradient update amount determination formula; the gradient update amount determination formula is as follows:
[0020] ;
[0021] in, The gradient update amount; The learning rate; For each piece of data in the dataset; The target dataset; is the loss function; W is the gradient of the previous federated learning model.
[0022] Optionally, the step of using a quantum key to perform hierarchical encryption of the gradient of the current federated learning model based on the gradient update amount to obtain the corresponding encrypted gradient includes:
[0023] The gradient of the current federated learning model is determined based on the difference between the gradient of the previous federated learning model and the gradient update amount.
[0024] The first gradient component is determined by identifying the number of gradient components with the largest absolute value in the gradient of the current federated learning model. The remaining gradient components in the current federated learning model are then identified, and the component with the largest percentage of the target selected from the remaining gradient components is identified as the second gradient component.
[0025] The first gradient component is encrypted using the advanced cryptography standard-Galois / counter mode based on the quantum key to obtain the first encrypted gradient;
[0026] Generate a metadata encryption key based on the quantum key, random salt value, and context identifier;
[0027] The second gradient component is encrypted using the ChaCha20 encryption algorithm based on the metadata encryption key and a random number to obtain the second encrypted gradient.
[0028] A hash seed is randomly generated using a quantum random number generator;
[0029] A gradient quantum hash signature value is generated based on the hash seed and the gradient of the current federated learning model.
[0030] Optionally, transmitting the encrypted gradient and the quantum key to a central server so that the central server determines the aggregated global gradient based on the encrypted gradient and the quantum key includes:
[0031] The quantum key is split into several key fragments based on the polynomial difference method.
[0032] Several key fragments are transmitted in parallel to the central server through several quantum channels, so that the central server can determine the quantum key based on the several key fragments;
[0033] The first encrypted gradient, the second encrypted gradient, and the gradient quantum hash signature value are transmitted to the central server so that the central server can decrypt the encrypted gradient using the quantum key to verify the validity of the gradient quantum hash signature value based on the first gradient component. According to the corresponding verification result, the nodes corresponding to the failed gradients are marked as suspicious nodes. The first gradient component and the second gradient component are merged to construct a new gradient. The median of all nodes is calculated based on the parameter index of the new gradient. Malicious nodes are identified and removed from all nodes based on the calculation result. The aggregation weight of each node is adjusted according to the suspicious nodes, the malicious nodes, and the historical contribution of each node. The aggregated global gradient is determined according to the corresponding adjusted aggregation weight and the new gradient corresponding to each node.
[0034] Optionally, the central server encrypts the aggregated global gradient using the updated key and broadcasts the corresponding encrypted global gradient to the participants, including:
[0035] The central server uses the Advanced Encryption Standard - Galois / Counter mode to encrypt the aggregated global gradient based on the updated key and a random initialization vector, and broadcasts the corresponding encrypted global gradient to the participants.
[0036] Secondly, this application discloses a quantum key-based secure data transmission device, applicable to participating parties, including:
[0037] The gradient encryption module is used to determine the gradient update amount based on the target dataset, and to perform hierarchical encryption on the gradient of the current federated learning model using a quantum key based on the gradient update amount to obtain the corresponding encrypted gradient; the target dataset is a dataset constructed based on data collected by industrial sensors participating in federated learning.
[0038] A quantum key transmission module is used to transmit the encrypted gradient and the quantum key to a central server, so that the central server can determine the aggregated global gradient based on the encrypted gradient and the quantum key;
[0039] The updated key sending module is used to update the quantum key based on a preset update cycle and send the corresponding updated key to the central server through a redundant quantum channel, so that the central server can use the updated key to encrypt the aggregated global gradient and broadcast the corresponding encrypted global gradient to the participants.
[0040] The model update module is used to decrypt the encrypted global gradient based on the updated key, obtain the decrypted gradient, and update the current federated learning model according to the decrypted gradient to complete the multi-node transmission of federated learning data.
[0041] Thirdly, this application discloses an electronic device, including:
[0042] Memory, used to store computer programs;
[0043] A processor is used to execute computer programs to implement the aforementioned quantum key-based secure data transmission method.
[0044] Fourthly, this application discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the aforementioned quantum key-based secure data transmission method.
[0045] In this application, participating parties determine the gradient update amount based on the target dataset, and use quantum keys to perform hierarchical encryption on the gradient of the current federated learning model based on the gradient update amount to obtain the corresponding encrypted gradient. The target dataset is a dataset constructed based on data collected by industrial sensors participating in the federated learning. The encrypted gradient and the quantum key are transmitted to a central server, so that the central server determines the aggregated global gradient based on the encrypted gradient and the quantum key. The quantum key is updated according to a preset update cycle, and the corresponding updated key is sent to the central server through a redundant quantum channel, so that the central server uses the updated key to encrypt the aggregated global gradient and broadcasts the corresponding encrypted global gradient to the participating parties. The encrypted global gradient is decrypted based on the updated key to obtain the decrypted gradient, and the current federated learning model is updated according to the decrypted gradient to complete the multi-node transmission of federated learning data. It can be seen that this application constructs a quantum-federated collaborative architecture, which, through the deep coupling of quantum key sharding mechanism and hierarchical encryption strategy, overcomes the contradiction between key management efficiency and computational resource consumption in traditional schemes while ensuring unconditional security. This method is the first to achieve organic integration of quantum key distribution protocols and federated learning processes, enabling industrial nodes to complete secure parameter exchange and collaborative model training in dynamic network environments. It significantly improves the security and availability of data streams in complex industrial scenarios and achieves full lifecycle protection of industrial data streams from acquisition to aggregation. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0047] Figure 1 This is a flowchart of a quantum key-based secure data transmission method disclosed in this application;
[0048] Figure 2 This is a schematic diagram of a fragmented distribution method disclosed in this application;
[0049] Figure 3 This is a schematic diagram of a quantum key-based secure data transmission device disclosed in this application;
[0050] Figure 4 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0051] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] Current technologies analyze historical client data (such as computing power and network connection quality) to select nodes for federated learning, thereby optimizing model training efficiency and resource allocation. The core process of existing solutions includes: Client data selection and prediction: Causal inference methods are used to select key features from historical prior information of the client (such as CPU (Central Processing Unit) frequency and memory status), and a regression model is built to predict its unknown parameters (such as computing power and network connection quality). An LSTM (Long Short-Term Memory) network is used to perform temporal modeling on the selected features, generating dynamic prediction results to support client selection decisions. Client selection and incentive mechanism: The server selects candidate clients based on the prediction results, and the client decides whether to participate in training based on its own resource consumption and the server's reward strategy (such as energy compensation). A utility function (client benefit = reward - energy consumption, server benefit = model quality - payment cost) is designed to quantify the interests of both parties, but this relies on a static game model and does not achieve dynamic policy adaptation. Secure transmission mechanisms: Traditional encryption algorithms (such as AES) are used to protect model parameter transmission, but the threat of quantum attacks is not considered. Key management relies on a centralized architecture, which poses a single point of failure risk. The limitations of existing technologies are particularly significant in high-real-time industrial scenarios. Although some research attempts to improve transmission efficiency by optimizing symmetric encryption algorithms (such as shortening key length), such solutions often sacrifice security and cannot meet the dual requirements of millisecond-level latency and resistance to quantum attacks in multi-node transmission systems. At the same time, traditional key distribution mechanisms rely on centralized architectures, which pose a single point of failure risk, and the long key update cycle makes it difficult to cope with the dynamic environment of frequent network access and deactivation of industrial equipment. Current industrial data secure transmission systems still have systemic defects at the end-to-end protection level. Most solutions only focus on communication link encryption, neglecting the integrity verification requirements of data in the federated learning aggregation stage, which allows malicious nodes to inject polluting gradients to disrupt model convergence. In addition, existing auditing mechanisms lack quantum-level randomness guarantees, logs are easily forged or tampered with, and it is difficult to achieve full lifecycle traceability. Constructing an industrial-grade transmission framework that balances quantum security, low-latency communication, and dynamic scalability remains a critical technological bottleneck. To address this challenge, this invention discloses a quantum key-based data security transmission method, apparatus, device, and medium. This approach ensures unconditional security while overcoming the trade-off between key management efficiency and computational resource consumption inherent in traditional solutions. It achieves seamless integration of quantum key distribution protocols with federated learning processes, enabling industrial nodes to exchange secure parameters and collaboratively train models in dynamic network environments, significantly improving the security and availability of data streams in complex industrial scenarios.
[0053] See Figure 1As shown, this embodiment of the invention discloses a quantum key-based secure data transmission method, applied to participating parties, including:
[0054] Step S11: Determine the gradient update amount based on the target dataset, and use a quantum key to perform hierarchical encryption on the gradient of the current federated learning model based on the gradient update amount to obtain the corresponding encrypted gradient; the target dataset is a dataset constructed based on data collected by industrial sensors participating in federated learning.
[0055] In this embodiment, the fusion of quantum-secure communication and federated learning faces multiple challenges in the field of secure industrial data transmission. Traditional solutions generally rely on classical encryption algorithms (such as RSA and AES) to construct transmission channels. While these algorithms offer a certain level of reliability in conventional scenarios, they expose serious security vulnerabilities when facing quantum computing attacks. For example, encryption mechanisms based on mathematical problems are easily cracked by Shor's algorithm, and static key management schemes are ill-suited to the dynamic networking requirements of multi-node systems in industry. Furthermore, existing federated learning frameworks lack defenses against quantum attacks, making model parameter transmission vulnerable to man-in-the-middle tampering and affecting the overall training reliability. To ensure the reliability of training, the participating parties in this application... It will be based on the local dataset (i.e., the target dataset). The training model first determines the gradient update amount based on the target dataset. Before determining the gradient update amount based on the target dataset, this application normalizes the raw data collected by the industrial sensor to obtain processed data. If the raw data is non-numerical data, it maps the raw data into a numerical vector through one-hot encoding. The dimensionality-reduced vector data is determined based on the relationship between the mutual information value between the processed data or the numerical vector and the target variable and a preset threshold. The dimensionality-reduced vector data is encapsulated using a data generation timestamp, a data source device identifier, and a cyclic redundancy check code to obtain the target dataset. Specifically, in the data preprocessing and feature extraction part, the following preprocessing process needs to be designed for the heterogeneous data (such as time-series signals, device status codes, and environmental parameters) collected by the industrial sensor:
[0056] Data standardization requires processing the raw data. Normalization is performed, and the normalized data values are... ;in For any original data, For the original dataset The mean; represents the standard deviation of the original dataset. For non-numerical data (such as equipment fault codes), one-hot encoding is used to map them into numerical vectors.
[0057] In the feature selection and dimensionality reduction steps, mutual information is used to filter key features, retaining those with mutual information values higher than a threshold. The features that constitute a simplified dataset The filtering logic involves calculating the mutual information value I(X;Y) between each feature and the target variable (such as device status), and retaining those with I(X;Y) > 0. Features ( (This is a preset threshold).
[0058] Structured data encapsulation will Encapsulated into a fixed format data packet : Where Timestamp is the data generation time; Device ID is the identifier of the data source device; Feature Vector is the feature vector after dimensionality reduction; and CRC is the cyclic redundancy check code used to verify data integrity.
[0059] After determining the target dataset (the simplified dataset mentioned above) according to the above process, the gradient update amount is determined based on the target dataset using the gradient update amount determination formula; the gradient update amount determination formula is:
[0060] ;
[0061] in, The gradient update amount; The learning rate; For each piece of data in the dataset; The target dataset; y is the loss function; W is the gradient of the previous federated learning model. Specifically, x is the independent variable, i.e., the indicator, and y is the result value, i.e., the label corresponding to the sample. For example, x is personal information, and y might be the decision to buy a house. Then, the federated learning model is the training model for an individual's home purchase decision.
[0062] With the continuous development of quantum computing, traditional data security transmission technologies face new challenges. Quantum computers possess powerful computing capabilities and the potential to break traditional encryption algorithms, potentially jeopardizing existing data security transmission technologies. Therefore, to address this challenge, a more secure and reliable data security transmission technology is needed. Quantum key-based data security transmission technology was proposed to solve this problem. It utilizes principles and techniques from quantum mechanics to ensure secure key distribution and encrypted data transmission, providing new ideas and methods for future data security transmission. Quantum key distribution (QKD), as an important technology in modern cryptography, is based on the fundamental principles of quantum mechanics, especially the no-cloning of quantum states and the uncertainty principle of quantum measurement. These characteristics theoretically enable unconditionally secure communication, meaning that communication security can be guaranteed against any attacker with unlimited computing power and any attack methods permitted by the laws of physics.
[0063] In quantum key distribution (QKD), the information carrier is typically a single photon. These photons are prepared in specific quantum states, such as polarization or phase states, to carry key information. The sender modulates the quantum states of these photons to encode the key information into a photon sequence and sends these photons to the receiver. Upon receiving the photons, the receiver measures their quantum states using appropriate measurement devices to decode the key information. To ensure communication security, QKD protocols typically include a series of security checks. These checks are designed to detect and defend against potential eavesdropping attacks. For example, in the BB84 protocol (the basic protocol for quantum key distribution), the sender and receiver randomly select measurement bases to measure the photons and compare partial measurement results to detect the presence of an eavesdropper. If an abnormally high error rate is detected, it indicates that the communication may be being eavesdropped on. In this case, both parties discard the insecure key portion and restart the key distribution process. As a novel key distribution technology, QKD's security and reliability have been widely verified and recognized. With the continuous development and maturation of quantum technology, QKD is expected to become one of the important means of ensuring communication security in the future. Meanwhile, with the popularization and application of distributed machine learning frameworks such as federated learning, combining quantum key distribution with these frameworks to achieve secure data transmission and privacy protection will become one of the important directions for future research. Quantum key-based secure data transmission technology has many unique advantages. First, due to the non-cloning property of quantum states, attackers cannot copy the quantum key during transmission, thus ensuring key security. Second, quantum measurement causes irreversible damage to quantum states, making it immediately detectable if an attacker attempts to steal the key, thereby guaranteeing the confidentiality of data transmission. Furthermore, quantum key-based secure data transmission technology can be combined with existing encryption technologies, digital signature technologies, etc., to form a more comprehensive secure data transmission scheme, improving the security and reliability of the entire system.
[0064] Therefore, before performing hierarchical encryption of the gradient of the current federated learning model using quantum keys based on the gradient update amount, this application generates an initial key using the BB84 protocol; the initial key is divided into blocks using the Cascade protocol, and the corresponding blocks are verified level by level to correct erroneous bits, thus generating the quantum key. Specifically, quantum state encoding and initial key generation use the BB84 protocol to generate the initial key, and the specific steps are as follows: Quantum state preparation: The sender (Alice) randomly selects two sets of basis vectors. Basis vector set 1 (Z basis) has a polarization state of vertical (0°) or horizontal (90°), corresponding to bits 0 or 1 respectively. Basis vector set 2 (X basis) has a polarization state of +45° or -45°, corresponding to bits 0 or 1 respectively. Alice randomly selects a basis vector set (Z or X) to prepare a single-photon sequence. ,in The first two are Z-based fundamental eigenstates, and the latter two are X-based fundamental eigenstates. N is the total number of single photons generated, i.e., the number of photons sent during key negotiation. is also the sequence length, usually agreed upon in advance, such as 1024, 4096, or powers of 2. This refers to the polarization direction of the photon (which can be understood as the orientation, or the direction of the vector). The specific directions are given in the previous line, where 0 represents the y-axis (0, 1), 1 represents the x-axis (1, 0), + represents (1, 1), and - represents (1, -1). The quantum state of the i-th photon has the value set {|0> (vertical polarization), |1> (horizontal polarization), |+> (+45° polarization), |−> (-45° polarization)}, which is used to encode the key bits (0 or 1).
[0065] Quantum state transmission and measurement: The receiver (Bob) randomly selects a set of basis vectors (Z or X) to measure each photon and records the measurement results. N is the total number of single photons generated; The receiver measures the i-th photon (0 or 1). Both parties publicly compare their basis selection sequences via a classical channel, retaining only positions where the basis vectors are consistent (approximately 50%), thus forming the original key. .
[0066] Key negotiation and error correction: Information reconciliation is performed through a classic channel to eliminate transmission errors. The Cascade protocol is used to... The key is divided into blocks and verified level by level, correcting erroneous bits. Finally, a consistent key is generated. .
[0067] Subsequently, this application determines the gradient of the current federated learning model based on the difference between the gradient of the previous federated learning model and the gradient update amount; it identifies the top number of gradient components with the largest absolute value in the gradient of the current federated learning model as the first gradient component, determines the remaining gradients in the gradient of the current federated learning model, and identifies the component with the largest percentage of the target selected from the remaining gradients as the second gradient component; it encrypts the first gradient component using the Advanced Encryption Standard - Galois / Counter mode based on the quantum key to obtain the first encrypted gradient; it generates a metadata encryption key based on the quantum key, random salt value, and context identifier; it encrypts the second gradient component using the ChaCha20 encryption algorithm based on the metadata encryption key and a random number to obtain the second encrypted gradient; it randomly generates a hash seed using a quantum random number generator; and it generates a gradient quantum hash signature value based on the hash seed and the gradient of the current federated learning model.
[0068] Step S12: Transmit the encrypted gradient and the quantum key to the central server so that the central server can determine the aggregated global gradient based on the encrypted gradient and the quantum key.
[0069] In this embodiment, after obtaining the encrypted gradient, the encrypted gradient and the quantum key are transmitted to the central server. During this process, the quantum key is split into several key fragments based on the polynomial difference method; these key fragments are then transmitted in parallel to the central server via several quantum channels, so that the central server can determine the quantum key based on the key fragments. Specifically, to improve anti-interception capability, a key fragmentation mechanism based on a threshold scheme is designed. Key fragment generation: Split into n pieces This satisfies polynomial interpolation. By selecting a prime number p, a polynomial of degree t-1 is constructed. ; Generate fragments ;in It is a unique identifier. It also satisfies the Shamir secret sharing threshold condition, guaranteeing that any t fragments can be reconstructed. However, the t-1 fragments cannot obtain any key information. For example... Figure 2 As shown, fragmented distribution: fragments are transmitted in parallel through n independent quantum channels. Each channel uses a different wavelength (wavelength division multiplexing) or spatial path (space division multiplexing). The receiver (server) needs to collect at least t valid fragments to recover the key. It should also be noted that the key fragmentation distribution satisfies the ratio of the number of fragments n to the threshold t. Furthermore, the fragments are transmitted via independent quantum channels to ensure anti-interference and error correction. Quantum channel fault tolerance employs repetition coding to combat photon loss; each quantum bit is repeatedly transmitted m times, and the receiver decodes it using majority voting. Channel noise suppression uses decoy-state technology to detect photon number separation attacks, with a bit error rate threshold set to... If the bit error rate Immediately terminate the transmission and trigger a key reset. The key update cycle T is adapted to the real-time requirements of multi-node transmission scenarios, satisfying T≤1 hour.
[0070] Subsequently, the first encrypted gradient, the second encrypted gradient, and the gradient quantum hash signature value are transmitted to the central server. The central server uses the quantum key to decrypt the encrypted gradient, and verifies the validity of the gradient quantum hash signature value based on the first gradient component. Nodes corresponding to failed verification gradients are marked as suspicious nodes based on the verification results. The first and second gradient components are merged to construct a new gradient. The median of all nodes is calculated based on the parameter index of the new gradient. Malicious nodes are identified and removed based on the calculation results. The aggregation weights of each node are adjusted based on the suspicious nodes, the malicious nodes, and the historical contribution of each node. The aggregated global gradient is determined based on the adjusted aggregation weights and the new gradients corresponding to each node. Specifically, during tamper-resistant aggregation, for each gradient component with parameter index j... Calculate the median of all nodes. If a node exceeds The components deviate from the median by more than the threshold. Nodes identified as malicious are removed. Dynamic weight adjustments are based on a node's historical contribution. Assign aggregate weights based on factors such as data volume and model accuracy. ; This is the new gradient constructed by merging the first and second gradient components.
[0071] Step S13: Update the quantum key based on a preset update cycle, and send the updated key to the central server through a redundant quantum channel so that the central server can use the updated key to encrypt the aggregated global gradient and broadcast the encrypted global gradient to the participants.
[0072] In this embodiment, the application also constructs a key update cycle model, assuming the update cycle is T, the key pool capacity is C, and the rate of dynamically generating new keys is... (Unit: bps). Key updates are triggered periodically; old key fragments are automatically destroyed, and new keys are distributed via redundant quantum channels. Synchronization protocol: The network latency tolerance is pre-defined as... Under this premise, the server broadcasts timestamps. To all nodes. Nodes at + The key switching is completed within the specified time. Therefore, this application updates the quantum key based on a preset update cycle and sends the updated key to the central server via a redundant quantum channel. That is, it updates the aggregated global gradient. Perform layered encryption to obtain the encrypted result value. ;in, For the updated quantum key; A random initialization vector (96 bits) is generated for each encryption, ensuring that the same key encrypts different results. Finally, the central server encrypts the global gradient. The quantum hash signature (the hash value of the aggregated global gradient) is broadcast to all participants, marking the safe completion of data transmission.
[0073] Step S14: Decrypt the encrypted global gradient based on the updated key to obtain the decrypted gradient, and update the current federated learning model according to the decrypted gradient to complete the multi-node transmission of federated learning data.
[0074] In this embodiment, after receiving the encrypted global gradient and the hash value of the aggregated global gradient, the participating party can decrypt the encrypted global gradient based on the updated key to obtain the decrypted gradient. Finally, it updates the current federated learning model based on the decrypted gradient to complete the multi-node transmission of federated learning data. Specifically, the participating party updates its local model after decryption. , The global gradient after model aggregation in the previous training round. In this way, this application uses a robust aggregation algorithm to decrypt, verify, and aggregate the encrypted local model gradients, generating a global model and transmitting it back in encryption. By integrating dynamic quantum key management, layered lightweight encryption, and a quantum-resistant aggregation protocol, it systematically solves the complex challenges of data privacy protection, resistance to quantum attacks, and real-time collaboration in multi-node transmission scenarios. In smart grid and smart manufacturing scenarios, it demonstrates a measured reduction in end-to-end latency and an improved tolerance for malicious nodes.
[0075] In addition, this application includes end-to-end security verification: data transmission integrity verification is achieved based on a quantum hash signature chain and a dynamic auditing mechanism. Quantum hash signature and integrity verification: Quantum random number generation (QRNG) uses a quantum entropy source based on photon count rate to generate true random number seeds. Dynamic hash chain construction begins by initializing the chain head, whose hash value is... Calculate the hash value for the j-th data packet. ; The hash value of the preceding data packet (chain dependency); For the j-th secure transmission unit (encrypted data packet); To comply with the IEEE 1588 protocol (a precision clock synchronization protocol standard for networked measurement and control systems) and synchronize timestamps accurate to nanoseconds. Appended to the data packet to form a signature chain For each data packet A unique hash value is generated, and a chain structure is built to prevent replay attacks. During the recipient's verification, the hash chain is traced back level by level to complete the signature verification process.
[0076] In this application, participating parties determine the gradient update amount based on the target dataset, and use quantum keys to perform hierarchical encryption on the gradient of the current federated learning model based on the gradient update amount to obtain the corresponding encrypted gradient. The target dataset is a dataset constructed based on data collected by industrial sensors participating in the federated learning. The encrypted gradient and the quantum key are transmitted to a central server, so that the central server determines the aggregated global gradient based on the encrypted gradient and the quantum key. The quantum key is updated according to a preset update cycle, and the corresponding updated key is sent to the central server through a redundant quantum channel, so that the central server uses the updated key to encrypt the aggregated global gradient and broadcasts the corresponding encrypted global gradient to the participating parties. The encrypted global gradient is decrypted based on the updated key to obtain the decrypted gradient, and the current federated learning model is updated according to the decrypted gradient to complete the multi-node transmission of federated learning data. It can be seen that this application constructs a quantum-federated collaborative architecture, which, through the deep coupling of quantum key sharding mechanism and hierarchical encryption strategy, overcomes the contradiction between key management efficiency and computational resource consumption in traditional schemes while ensuring unconditional security. This method is the first to achieve organic integration of quantum key distribution protocols and federated learning processes, enabling industrial nodes to complete secure parameter exchange and collaborative model training in dynamic network environments. It significantly improves the security and availability of data streams in complex industrial scenarios and achieves full lifecycle protection of industrial data streams from acquisition to aggregation.
[0077] As described in the previous embodiment, in this application, the participants use a quantum key to perform layered encryption on the gradient of the current federated learning model based on the gradient update amount, in order to obtain the corresponding encrypted gradient. The specific encryption process will be explained below.
[0078] The layered encryption strategy addresses data sensitivity and real-time requirements; therefore, this application designs differentiated encryption for the core parameter layer and the metadata layer. The core parameter layer encryption (AES-GCM) first requires dynamically selecting a 256-bit key from the quantum key pool. The key is entered using the KeyID index. The subsequent encryption process requires initializing the GCM (Galois Counter Mode) to generate a 96-bit random number IV. Then, the Feature Vector is encrypted using a quantum-key-driven AES-GCM algorithm. ;in, The ciphertext is encrypted at the core parameter layer; it is generated by encrypting the feature vector using the AES-GCM algorithm and contains the ciphertext and an authentication tag (AuthTag). Finally, a 128-bit authentication tag (AuthTag) is generated, which is used to verify data integrity during decryption.
[0079] Metadata layer encryption (ChaCha20-Poly1305) requires a foundation based on Generate metadata encryption key Complete key derivation Where Salt is a random salt value and Info is a context identifier. The specific encryption process requires processing the metadata. Using the lightweight ChaCha20 algorithm Non-sensitive information is encrypted. Finally, a 128-bit authentication tag (MAC) is generated using the Poly1305 algorithm. This generates a 128-bit Message Authentication Code (MAC) for metadata (such as timestamps and device IDs), ensuring data integrity and authenticity. Structure: Based on a multinomial hash function, it takes a key and a message as input and outputs a fixed-length authentication tag.
[0080] The implementation of a Secure Transmission Unit (STU) encapsulation requires binding encrypted data with auxiliary information to construct a verifiable secure transmission unit. The Secure Transmission Unit (STU) is bound to the hash seed generated by the quantum random number generator (QRNG) to calculate and generate a final, unique quantum hash signature value resistant to quantum collisions. By binding a secure transmission unit (STU) to a quantum random number seed, a final, unique quantum hash signature value resistant to quantum collisions is calculated and generated. This hash value is used to defend against replay attacks and data tampering. The "||" symbol represents the direct concatenation of two values; for example, 2||3 is the string "23".
[0081] Based on the above steps, this application's quantum key... The gradients are stratified and refined. For the core gradient components (the top k parameters with the largest absolute values in the local model gradient, which have a significant impact on model updates), the top k gradient components with the largest absolute values are selected. The encrypted result is obtained by using AES-GCM encryption. For the residual gradient Before keeping The largest component is selected, and the rest are subjected to Top-S sparsification. Then, ChaCha20 encryption is used to obtain the final result. ,in, For derived self The metadata encryption key; Nonce: a random number (one-time value) to prevent replay attacks. Finally, a gradient quantum hash signature value is generated. ;in, It is a hash seed generated by a quantum random number generator (QRNG). Ultimately, the encrypted sparse gradient and core gradient are obtained.
[0082] In this application, lightweight performance optimization is achieved through the reallocation of computing resources. Parallel pipelined hardware acceleration of AES-GCM and ChaCha20 is implemented in an FPGA to improve throughput. This results in AES-GCM encryption latency of less than or equal to 10ns (based on FPGA hardware acceleration), ChaCha20 encryption speed of greater than or equal to 20 Gbps, and CPU utilization of less than 5%. Furthermore, encryption resources are dynamically allocated based on packet size to achieve dynamic load balancing. Hardware accelerators are prioritized for the core parameter layer, while the metadata layer switches to software implementation when the CPU load is light.
[0083] This application integrates QKD threshold sharding, layered lightweight encryption, and a quantum-resistant aggregation protocol into the federated learning process. It systematically solves the complex challenges of data privacy protection, resistance to quantum attacks, and real-time collaboration in multi-node transmission scenarios, demonstrating significant technological value in fields such as smart manufacturing and smart grids. It achieves organic adaptation between the quantum key distribution protocol and the federated learning process, enabling industrial nodes to complete secure parameter exchange and collaborative model training in dynamic network environments, significantly improving the security and availability of data streams in complex industrial scenarios.
[0084] See Figure 3 As shown, this embodiment of the invention discloses a quantum key-based secure data transmission device, applied to participating parties, including:
[0085] The gradient encryption module 11 is used to determine the gradient update amount based on the target dataset, and to perform hierarchical encryption on the gradient of the current federated learning model using a quantum key based on the gradient update amount to obtain the corresponding encrypted gradient; the target dataset is a dataset constructed based on data collected by industrial sensors participating in federated learning.
[0086] Quantum key transmission module 12 is used to transmit the encrypted gradient and the quantum key to the central server, so that the central server can determine the aggregated global gradient based on the encrypted gradient and the quantum key;
[0087] The updated key sending module 13 is used to update the quantum key based on a preset update cycle and send the corresponding updated key to the central server through a redundant quantum channel, so that the central server can use the updated key to encrypt the aggregated global gradient and broadcast the corresponding encrypted global gradient to the participants.
[0088] The model update module 14 is used to decrypt the encrypted global gradient based on the updated key, obtain the decrypted gradient, and update the current federated learning model according to the decrypted gradient to complete the multi-node transmission of federated learning data.
[0089] In this application, participating parties determine the gradient update amount based on the target dataset, and use quantum keys to perform hierarchical encryption on the gradient of the current federated learning model based on the gradient update amount to obtain the corresponding encrypted gradient. The target dataset is a dataset constructed based on data collected by industrial sensors participating in the federated learning. The encrypted gradient and the quantum key are transmitted to a central server, so that the central server determines the aggregated global gradient based on the encrypted gradient and the quantum key. The quantum key is updated according to a preset update cycle, and the corresponding updated key is sent to the central server through a redundant quantum channel, so that the central server uses the updated key to encrypt the aggregated global gradient and broadcasts the corresponding encrypted global gradient to the participating parties. The encrypted global gradient is decrypted based on the updated key to obtain the decrypted gradient, and the current federated learning model is updated according to the decrypted gradient to complete the multi-node transmission of federated learning data. It can be seen that this application constructs a quantum-federated collaborative architecture, which, through the deep coupling of quantum key sharding mechanism and hierarchical encryption strategy, overcomes the contradiction between key management efficiency and computational resource consumption in traditional schemes while ensuring unconditional security. This method is the first to achieve organic integration of quantum key distribution protocols and federated learning processes, enabling industrial nodes to complete secure parameter exchange and collaborative model training in dynamic network environments. It significantly improves the security and availability of data streams in complex industrial scenarios and achieves full lifecycle protection of industrial data streams from acquisition to aggregation.
[0090] In some specific embodiments, the device is further configured to normalize the raw data collected by the industrial sensor to obtain processed data; if the raw data is non-numerical data, the raw data is mapped into a numerical vector through one-hot encoding; the dimensionality-reduced vector data is determined based on the relationship between the mutual information value between the processed data or the numerical vector and the target variable and a preset threshold; the dimensionality-reduced vector data is encapsulated using a data generation timestamp, a data source device identifier, and a cyclic redundancy check code to obtain the target dataset.
[0091] In some specific embodiments, the device is further configured to generate an initial key via the BB84 protocol; divide the initial key into blocks using the Cascade protocol; and verify the corresponding blocks of keys at each level to correct erroneous bits, thereby generating the quantum key.
[0092] In some specific embodiments, the gradient encryption module 11 is used to determine the gradient update amount based on the target dataset using a gradient update amount determination formula; the gradient update amount determination formula is:
[0093] ;
[0094] in, The gradient update amount; The learning rate; For each piece of data in the dataset; The target dataset; is the loss function; W is the gradient of the previous federated learning model.
[0095] In some specific embodiments, the gradient encryption module 11 is used to determine the gradient of the current federated learning model based on the difference between the gradient of the previous federated learning model and the gradient update amount; determine the top number of gradient components with the largest absolute value in the gradient of the current federated learning model as the first gradient component; determine the remaining gradients in the gradient of the current federated learning model; determine the component with the largest percentage of the target selected from the remaining gradients as the second gradient component; encrypt the first gradient component using the advanced encryption standard - Galois / counter mode based on the quantum key to obtain the first encrypted gradient; generate a metadata encryption key based on the quantum key, random salt value, and context identifier; encrypt the second gradient component using the ChaCha20 encryption algorithm based on the metadata encryption key and a random number to obtain the second encrypted gradient; randomly generate a hash seed using a quantum random number generator; and generate a gradient quantum hash signature value based on the hash seed and the gradient of the current federated learning model.
[0096] In some specific embodiments, the quantum key transmission module 12 is used to split the quantum key based on the polynomial difference method to obtain several key fragments; transmit several key fragments in parallel to the central server through several quantum channels, so that the central server can determine the quantum key based on the several key fragments; transmit the first encrypted gradient, the second encrypted gradient, and the gradient quantum hash signature value to the central server, so that the central server can use the quantum key to decrypt the encrypted gradient, and perform legality verification of the gradient quantum hash signature value based on the first gradient component; mark the nodes corresponding to the failed gradients as suspicious nodes according to the corresponding verification results; merge the first gradient component and the second gradient component to construct a new gradient; calculate the median of all nodes according to the parameter index of the new gradient, and determine and remove malicious nodes from all nodes according to the calculation results; adjust the aggregation weight of each node according to the suspicious nodes, the malicious nodes, and the historical contribution of each node; and determine the aggregated global gradient according to the corresponding adjusted aggregation weight and the new gradient corresponding to each node.
[0097] In some specific embodiments, the updated key sending module 13 is used by the central server to encrypt the aggregated global gradient based on the updated key and a random initialization vector using the Advanced Encryption Standard - Galois / Counter mode, and broadcast the corresponding encrypted global gradient to the participants.
[0098] Furthermore, embodiments of this application also disclose an electronic device, Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0099] Figure 4 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the quantum key-based secure data transmission method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0100] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0101] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0102] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the quantum key-based secure data transmission method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0103] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned quantum key-based secure data transmission method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0104] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0105] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0106] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0107] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0108] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for secure data transmission based on quantum key distribution, characterized in that, Applied to participating parties, including: The gradient update amount is determined based on the target dataset, and the gradient of the current federated learning model is hierarchically encrypted using quantum key distribution based on the gradient update amount to obtain the corresponding encrypted gradient; the target dataset is a dataset constructed based on data collected by industrial sensors participating in federated learning. The encrypted gradient and the quantum key are transmitted to the central server so that the central server can determine the aggregated global gradient based on the encrypted gradient and the quantum key. The quantum key is updated based on a preset update cycle, and the updated key is sent to the central server through a redundant quantum channel. The central server then uses the updated key to encrypt the aggregated global gradient and broadcasts the encrypted global gradient to the participants. The encrypted global gradient is decrypted based on the updated key to obtain the decrypted gradient. The current federated learning model is then updated based on the decrypted gradient to complete the multi-node transmission of federated learning data. The step of determining the gradient update amount based on the target dataset includes: The gradient update amount is determined based on the target dataset using a gradient update amount determination formula; the gradient update amount determination formula is as follows: ; in, The gradient update amount; The learning rate; For each piece of data in the dataset; The target dataset; Let W be the loss function; W is the gradient of the previous federated learning model. The step of using quantum keys to perform hierarchical encryption of the gradient of the current federated learning model based on the gradient update amount to obtain the corresponding encrypted gradient includes: The gradient of the current federated learning model is determined based on the difference between the gradient of the previous federated learning model and the gradient update amount. The first gradient component is determined by identifying the number of gradient components with the largest absolute value in the gradient of the current federated learning model. The remaining gradient components in the current federated learning model are then identified, and the component with the largest percentage of the target selected from the remaining gradient components is identified as the second gradient component. The first gradient component is encrypted using the advanced cryptography standard-Galois / counter mode based on the quantum key to obtain the first encrypted gradient; Generate a metadata encryption key based on the quantum key, random salt value, and context identifier; The second gradient component is encrypted using the ChaCha20 encryption algorithm based on the metadata encryption key and a random number to obtain the second encrypted gradient. A hash seed is randomly generated using a quantum random number generator; A gradient quantum hash signature value is generated based on the hash seed and the gradient of the current federated learning model.
2. The quantum key based data secure transmission method of claim 1, wherein, Before determining the gradient update amount based on the target dataset, the process also includes: The raw data collected by the industrial sensor is normalized to obtain the processed data; If the original data is non-numerical data, then the original data is mapped into a numerical vector through one-hot encoding; The dimension-reduced vector data is determined based on the relationship between the mutual information value between the processed data or the numerical vector and the target variable and a preset threshold. The dimensionality-reduced vector data is encapsulated using a data generation timestamp, a data source device identifier, and a cyclic redundancy check code to obtain the target dataset.
3. The quantum key based data secure transmission method of claim 1, wherein, Before performing hierarchical encryption of the gradient of the current federated learning model using quantum keys based on the gradient update amount, the method further includes: Generate the initial key using the BB84 protocol; The initial key is divided into blocks using the Cascade protocol, and the corresponding blocks are verified level by level to correct erroneous bits and generate the quantum key.
4. The quantum key based data secure transmission method of claim 1, wherein, The step of transmitting the encrypted gradient and the quantum key to the central server, so that the central server can determine the aggregated global gradient based on the encrypted gradient and the quantum key, includes: The quantum key is split into several key fragments based on the polynomial difference method. Several key fragments are transmitted in parallel to the central server through several quantum channels, so that the central server can determine the quantum key based on the several key fragments; The first encrypted gradient, the second encrypted gradient, and the gradient quantum hash signature value are transmitted to the central server. The central server uses the quantum key to decrypt the first encrypted gradient and the second encrypted gradient, and verifies the validity of the gradient quantum hash signature value based on the first gradient component. According to the corresponding verification result, the nodes corresponding to the failed gradients are marked as suspicious nodes. The first gradient component and the second gradient component are merged to construct a new gradient. The median of all nodes is calculated based on the parameter index of the new gradient. Malicious nodes are identified and removed from all nodes based on the calculation result. The aggregation weight of each node is adjusted according to the suspicious nodes, the malicious nodes, and the historical contribution of each node. The aggregated global gradient is determined according to the corresponding adjusted aggregation weight and the new gradient corresponding to each node.
5. The quantum key based data secure transmission method according to any one of claims 1 to 4, characterized in that, The central server uses the updated key to encrypt the aggregated global gradient and broadcasts the corresponding encrypted global gradient to the participants, including: The central server uses the Advanced Encryption Standard - Galois / Counter mode to encrypt the aggregated global gradient based on the updated key and a random initialization vector, and broadcasts the corresponding encrypted global gradient to the participants.
6. A quantum key based data security transmission apparatus, characterized by, Applied to participating parties, including: The gradient encryption module is used to determine the gradient update amount based on the target dataset, and to perform hierarchical encryption on the gradient of the current federated learning model using a quantum key based on the gradient update amount to obtain the corresponding encrypted gradient; the target dataset is a dataset constructed based on data collected by industrial sensors participating in federated learning. A quantum key transmission module is used to transmit the encrypted gradient and the quantum key to a central server, so that the central server can determine the aggregated global gradient based on the encrypted gradient and the quantum key; The updated key sending module is used to update the quantum key based on a preset update cycle and send the corresponding updated key to the central server through a redundant quantum channel, so that the central server can use the updated key to encrypt the aggregated global gradient and broadcast the corresponding encrypted global gradient to the participants. The model update module is used to decrypt the encrypted global gradient based on the updated key, obtain the decrypted gradient, and update the current federated learning model according to the decrypted gradient to complete the multi-node transmission of federated learning data. The gradient encryption module is used to determine the gradient update amount based on the target dataset using a gradient update amount determination formula; the gradient update amount determination formula is: ; in, The gradient update amount; The learning rate; For each piece of data in the dataset; The target dataset; Let W be the loss function; W is the gradient of the previous federated learning model. The gradient encryption module is used to determine the gradient of the current federated learning model based on the difference between the gradient of the previous federated learning model and the gradient update amount; determine the top number of gradient components with the largest absolute value in the gradient of the current federated learning model as the first gradient component; determine the remaining gradients in the gradient of the current federated learning model; determine the component with the largest percentage of the target selected from the remaining gradients as the second gradient component; encrypt the first gradient component using the advanced encryption standard - Galois / counter mode based on the quantum key to obtain the first encrypted gradient; generate a metadata encryption key based on the quantum key, random salt value, and context identifier; encrypt the second gradient component using the ChaCha20 encryption algorithm based on the metadata encryption key and a random number to obtain the second encrypted gradient; randomly generate a hash seed using a quantum random number generator; and generate a gradient quantum hash signature value based on the hash seed and the gradient of the current federated learning model.
7. An electronic device, comprising: include: Memory, used to store computer programs; A processor for executing a computer program to implement the steps of the quantum key-based secure data transmission method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, A computer program is stored on a computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the quantum key-based secure data transmission method as described in any one of claims 1 to 5.