Key generation method and device and related equipment
By using wireless channel coefficients to adjust the time domain prediction model in the high-speed mobile scenario of cellular networks, the problem of poor wireless communication security in the prior art is solved, and higher channel reciprocity and security are achieved.
Patent Information
- Application Number
- CN202311086339.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-28
- Publication Date
- 2025-02-28
AI Technical Summary
The existing key generation method has poor wireless communication security in high-speed mobile scenarios of cellular networks and cannot effectively adapt to the problem of shortening channel coherence time.
By using the wireless channel as a natural random source, the first device adjusts the pre-trained time domain prediction model according to the uplink channel coefficients sent by the second device, generates the predicted downlink channel characteristics, and is used to generate a key. The second device generates a corresponding key based on the received downlink channel coefficient.
This method reduces the impact of shortening channel coherence time, improves the reciprocity of upstream and downstream channels, and can be better applied to high-speed mobile scenarios of cellular networks, thereby improving security in wireless communication.
Smart Images

Figure CN119545337A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a key generation method, device and related equipment. Background Art
[0002] Cryptographic technology for information encryption is widely used in wireless communication, and usually complex encryption algorithms are set in the encryption system. This makes it take eavesdroppers much longer to crack the key system than the validity period of the encrypted information itself, thus ensuring the security of the information. However, the existing encryption system faces problems such as difficulty in key distribution, over-reliance on computational complexity, and difficulty in applying to resource-constrained IoT devices, making it difficult to meet the current security requirements of wireless communications. In order to solve the above problems, physical layer key generation technology based on wireless channel reciprocity is generally used.
[0003] However, this key generation method is currently usually used in low-speed scenarios of time division duplex (TDD) systems. In high-speed mobile cellular network scenarios, the channel coherence time becomes shorter, making the uplink and downlink channels no longer completely reciprocal. Therefore, the existing key generation method is not suitable for high-speed mobile cellular network scenarios, resulting in poor wireless communication security in high-speed mobile cellular network scenarios. Summary of the invention
[0004] The embodiments of the present invention provide a key generation method, device and related equipment to solve the problem of poor wireless communication security in the prior art for high-speed mobile scenarios of cellular networks.
[0005] To solve the above technical problems, the present invention is achieved as follows:
[0006] In a first aspect, an embodiment of the present invention provides a key generation method, which is applied to a first device, and the method includes:
[0007] Adjusting parameters of a pre-trained first time domain prediction model according to a first uplink channel coefficient sent by the second device to obtain a target time domain prediction model;
[0008] According to the second uplink channel coefficient sent by the second device, a predicted first downlink channel characteristic is obtained through the target time domain prediction model, wherein the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, and the first downlink channel characteristic is a downlink channel characteristic at a target time after the second uplink channel coefficient;
[0009] A first key is generated according to the first downlink channel characteristic, and a first downlink channel coefficient is sent to the second device at the target time, where the first downlink channel coefficient is used by the second device to generate a second key.
[0010] In a second aspect, an embodiment of the present invention further provides a key generation method, which is applied to a second device, and the method includes:
[0011] Sending a first uplink channel coefficient and a second uplink channel coefficient to a first device, where the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, the first uplink channel coefficient is used by the first device to obtain a target time domain prediction model, the second uplink channel coefficient is used by the first device to obtain a predicted first downlink channel feature through the target time domain prediction model, the first downlink channel feature is used by the first device to generate a first key, and the first downlink channel feature is a downlink channel feature at a target time after the second uplink channel coefficient;
[0012] A second key is generated according to the first downlink channel coefficient sent by the first device at the target time.
[0013] In a third aspect, an embodiment of the present invention further provides a key generation device, applied to a first device, the device comprising:
[0014] A first processing module, configured to adjust parameters of a pre-trained first time domain prediction model according to a first uplink channel coefficient sent by a second device to obtain a target time domain prediction model;
[0015] a second processing module, configured to obtain a predicted first downlink channel characteristic through the target time domain prediction model according to a second uplink channel coefficient sent by the second device, wherein the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, and the first downlink channel characteristic is a downlink channel characteristic at a target time after the second uplink channel coefficient;
[0016] The first generating module is used to generate a first key according to the first downlink channel characteristics, and send a first downlink channel coefficient to the second device at the target time, wherein the first downlink channel coefficient is used by the second device to generate a second key.
[0017] In a fourth aspect, an embodiment of the present invention further provides a key generation device, applied to a second device, the device comprising:
[0018] A first sending module, configured to send a first uplink channel coefficient and a second uplink channel coefficient to a first device, wherein the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, the first uplink channel coefficient is used by the first device to obtain a target time domain prediction model, the second uplink channel coefficient is used by the first device to obtain a predicted first downlink channel feature through the target time domain prediction model, the first downlink channel feature is used by the first device to generate a first key, and the first downlink channel feature is a downlink channel feature at a target time after the second uplink channel coefficient;
[0019] The first generating module is used to generate a second key according to a first downlink channel coefficient sent by the first device at the target time.
[0020] In a fifth aspect, an embodiment of the present invention further provides an electronic device, including a transceiver and a processor.
[0021] The processor is used to adjust the parameters of the pre-trained first time domain prediction model according to the first uplink channel coefficient sent by the second device to obtain a target time domain prediction model;
[0022] The processor is further configured to obtain a predicted first downlink channel characteristic through the target time domain prediction model according to a second uplink channel coefficient sent by the second device, wherein the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, and the first downlink channel characteristic is a downlink channel characteristic at a target time after the second uplink channel coefficient;
[0023] The processor is further configured to generate a first key according to the first downlink channel characteristic, and send a first downlink channel coefficient to the second device at the target time, wherein the first downlink channel coefficient is used by the second device to generate a second key.
[0024] In a sixth aspect, an embodiment of the present invention further provides an electronic device, including a transceiver and a processor.
[0025] The transceiver is used to send a first uplink channel coefficient and a second uplink channel coefficient to a first device, where the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, the first uplink channel coefficient is used by the first device to obtain a target time domain prediction model, the second uplink channel coefficient is used by the first device to obtain a predicted first downlink channel feature through the target time domain prediction model, the first downlink channel feature is used by the first device to generate a first key, and the first downlink channel feature is a downlink channel feature at a target time after the second uplink channel coefficient;
[0026] The processor is configured to generate a second key according to a first downlink channel coefficient sent by the first device at the target time.
[0027] In the seventh aspect, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the key generation method as described in the first aspect are implemented, or the steps of the key generation method as described in the second aspect are implemented.
[0028] In the eighth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the key generation method as described in the first aspect are implemented, or the steps of the key generation method as described in the second aspect are implemented.
[0029] In an embodiment of the present invention, the wireless channel is used as a natural random source, and the first device obtains two consecutive first uplink channel coefficients and second uplink channel coefficients sent by the second device. First, the pre-trained model is adjusted according to the first uplink channel coefficient so that the prediction result of the target time domain prediction model is more consistent with the current channel characteristics; then, based on the target time domain prediction model and the second uplink channel coefficient, the first downlink channel characteristics at the target time are predicted; finally, the first device generates a first key according to the predicted first downlink channel characteristics, and the second device obtains the actual second downlink channel characteristics according to the first downlink channel coefficient obtained at the target time to generate a second key corresponding to the first key. The impact of the shortened channel coherence time is reduced, and the reciprocity of the uplink and downlink channels is improved. It can be better applied to the scenario of high-speed movement of cellular networks, thereby improving the security during wireless communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0031] Figure 1 is a flow chart of a key generation method provided by an embodiment of the present invention;
[0032] Figure 2 It is a structural diagram of a preset network model provided by an embodiment of the present invention;
[0033] Figure 3 This is a comparison chart of the normalized mean square error performance of the 40km / h network under different signal-to-noise ratios;
[0034] Figure 4 This is a performance comparison chart of the key error ratio of the initial key at 40km / h under different signal-to-noise ratios;
[0035] Figure 5 This is a performance comparison chart of the key error ratio of the initial key at 80km / h under different signal-to-noise ratios;
[0036] Figure 6 is a flow chart of another key generation method provided by an embodiment of the present invention;
[0037] Figure 7 It is a structural schematic diagram of a key generation device provided by an embodiment of the present invention;
[0038] Figure 8 is a schematic structural diagram of another key generation device provided by an embodiment of the present invention;
[0039] Fig. 9 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;
[0040] Fig.10 It is a schematic diagram of the structure of another electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] See also Figure 1 , Figure 1 is a flowchart of a key generation method provided by an embodiment of the present invention, which is applied to a first device, such as Figure 1 As shown, the method comprises the following steps:
[0043] Step 101: Adjust the parameters of a pre-trained first time domain prediction model according to a first uplink channel coefficient sent by a second device to obtain a target time domain prediction model;
[0044] The first device may be a base station side device, and the second device may be a user side device or a resource-constrained IoT device, etc. In an embodiment of the present invention, the wireless channel may be used as a natural random source, and the random coefficients therein may be extracted and converted into symmetric keys to reduce dependence on third parties. When a key is required for communication encryption, the first device obtains the first uplink channel coefficient currently sent by the second device, and adjusts the parameters of the pre-trained first time domain prediction model according to the first uplink channel coefficient to obtain a target time domain prediction model, so that the prediction results of the target time domain prediction model are more consistent with the current channel characteristics, thereby improving the accuracy of the prediction results of the target time domain prediction model.
[0045] In some optional implementations, before step 101, adjusting the parameters of the pre-trained first time domain prediction model according to the first uplink channel coefficient sent by the second device to obtain the target time domain prediction model, the method further includes:
[0046] Acquire N groups of uplink channel coefficients sent by the second device, each group of uplink channel coefficients in the N groups of uplink channel coefficients includes a third uplink channel coefficient and a fourth uplink channel coefficient, the fourth uplink channel coefficient is an uplink channel coefficient at an adjacent time after the third uplink channel coefficient, and N is an integer greater than 0;
[0047] Preprocessing the N groups of uplink channel coefficients to obtain N groups of uplink channel characteristics corresponding to the N groups of uplink channel coefficients, each group of uplink channel characteristics in the N groups of uplink channel characteristics including a third uplink channel characteristic corresponding to the third uplink channel coefficient and a fourth uplink channel characteristic corresponding to the fourth uplink channel coefficient;
[0048] The preset network model is trained according to the N groups of uplink channel characteristics to obtain the first time domain prediction model.
[0049] In this implementation, in the initial stage, N groups of uplink channel coefficients of two consecutive U frames are obtained, that is, the uplink channel coefficients of the two U frames are the third uplink channel coefficient and the fourth uplink channel coefficient, and the fourth uplink channel coefficient is the uplink channel coefficient at the adjacent time after the third uplink channel coefficient, to obtain N groups of uplink channel coefficients. Each group of uplink channel coefficients in the N groups can be recorded as Where N is the number of groups, H 11 is the third uplink channel coefficient, H 12 is the fourth uplink channel coefficient, is the third uplink channel coefficient in the nth group in the N groups, is the fourth uplink channel coefficient in the nth group in the N groups, where n is an integer greater than 1 and less than N.
[0050] Then, for N groups of uplink channel coefficients Perform preprocessing to obtain N groups of uplink channel coefficients The corresponding N groups of uplink channel characteristics Among them, X 11 is the third uplink channel characteristic, X 12 is the fourth uplink channel characteristic, is the third uplink channel characteristic of the nth group in the N groups, It is the fourth uplink channel characteristic of the nth group in the N groups.
[0051] Among them, for N groups of uplink channel coefficients Perform preprocessing to obtain N groups of uplink channel coefficients The corresponding N groups of uplink channel characteristics The preprocessing process may include real number processing and normalization processing. For details, please refer to the following description:
[0052] The real number processing process can be carried out according to the following formula:
[0053] H′ 11 =|H 11 |;
[0054] H′ 12 =|H 12 |;
[0055] Among them, || means taking the absolute value of each element in the matrix, the number of each element is the number of subcarriers corresponding to the channel coefficient, H′ 11 is the third uplink channel coefficient after real numbering, H′ 12 is the fourth uplink channel coefficient after real numbering.
[0056] The normalization process can be performed according to the following formula:
[0057]
[0058]
[0059] Among them, H′ 11,i H′ 11 The element of the i-th dimension in the number of subcarrier elements, H′ 12,i H′ 12 The element of the i-th dimension in the number of subcarrier elements, and They are H′ in the training set. 11 and H′ 12 The maximum value of the i-th dimension element of .
[0060] For N groups of uplink channel coefficients After real number processing and normalization processing, N groups of uplink channel characteristics are obtained:
[0061] The first device can use a neural network to build a preset network model, which can be a Time Division Duplex Mobile Cognitive Networks (TDPNet) model, and use N groups of uplink channel characteristics The uplink channel features of two consecutive U frames in the training TDPNet are used to obtain the model parameter Ω, thereby obtaining the first time domain prediction model. The channel features are generated according to the prediction results of the first time domain prediction model to reduce the deviation caused by the uplink and downlink channels no longer being completely reciprocal.
[0062] Among them, the structure of the preset network model can be as follows Figure 2 As shown in the figure, except for the output layer whose activation function is Sigmoid, the activation functions of other layers are ReLu. The uplink spectrum sensing (Uplink Channel State Information, UL CLI) signal passes through the input layer, hidden layer and output layer in sequence, and outputs the downlink spectrum sensing (Downlink Channel State Information, DL CLI) signal.
[0063] Step 102: According to the second uplink channel coefficient sent by the second device, a predicted first downlink channel characteristic is obtained through the target time domain prediction model, where the second uplink channel coefficient is the uplink channel coefficient at an adjacent time after the first uplink channel coefficient, and the first downlink channel characteristic is the downlink channel characteristic at a target time after the second uplink channel coefficient;
[0064] In one example, during the key generation phase, the first device obtains two consecutive uplink channel coefficients (i.e., the first uplink channel coefficient H 21 and the second uplink channel coefficient H 22 ), the coefficients of two consecutive uplink channels can be recorded as {H 21 ,H 22}. For the first uplink channel coefficient H 21 Perform preprocessing to obtain the first uplink channel feature X 21 ; and the second uplink channel coefficient H 22 Perform preprocessing to obtain the second uplink channel feature X 22 The process of preprocessing the uplink channel coefficients to obtain the uplink channel characteristics can refer to the above-mentioned real number processing and normalization processing processes, which will not be repeated here.
[0065] In this way, firstly, step 101 is used to adjust the parameters of the first time domain prediction model at the first moment to obtain the target time domain prediction model, so that the prediction result of the target time domain prediction model is more consistent with the current channel characteristics; then, the second uplink channel characteristic X corresponding to the second moment is adjusted. 22 Input into the target time domain prediction model to obtain the predicted first downlink channel characteristics at the target time Improved prediction of first downlink channel characteristics The second moment is an adjacent moment after the first moment, and the target moment is a moment after the second moment. The target moment may be the moment corresponding to when the first device sends the first downlink channel coefficient to the second device. By predicting the first downlink channel characteristic at the target moment Further through the subsequent step 103, in the process of generating a key between the first device and the second device, the reciprocity of the channel characteristics is improved.
[0066] Step 103: Generate a first key according to the first downlink channel characteristics, and send a first downlink channel coefficient to the second device at the target time, where the first downlink channel coefficient is used by the second device to generate a second key.
[0067] A first key is generated according to the first downlink channel characteristics of the predicted target moment, and the first downlink channel coefficient is sent to the second device at the target moment, so that the second device generates a second key according to the first downlink channel coefficient corresponding to the target moment, thereby improving the reciprocity of the uplink and downlink channels and being better suited to scenarios of high-speed movement in cellular networks.
[0068] In some optional implementations, generating a first key according to the first downlink channel characteristic includes:
[0069] quantizing the first downlink channel characteristic to obtain a first key bit;
[0070] The first key bits are subjected to information reconciliation processing and privacy amplification processing to obtain the first key.
[0071] Among them, quantizing the first downlink channel characteristic may be converting the channel characteristic into a binary bit stream to obtain a first key bit. Information reconciliation processing is used to detect and correct inconsistent bits. It should be understood that channel key generation is intended to generate a pair of keys for cryptographic applications for both communicating parties. Even if the measured channel state information is very close, it may cause differences in the quantized bits, which will lead to completely different decryption results during decryption. Therefore, after the first key bit is processed by information reconciliation, the bit inconsistency is reduced. The first device and the second device exchange information through a public channel during the information detection, quantization, and information reconciliation stages. An eavesdropper may eavesdrop on this information and infer the key. The information leaked by the legitimate communication party can be deleted through privacy amplification processing. The security of key generation is improved.
[0072] For example, the channel characteristics can be quantized using a quantization method with isolation band based on Gaussian distribution. The specific steps are as follows: First, the mean μ and variance σ of the elements in the feature vector are calculated. 2 , and fit the probability distribution of the channel characteristic elements into a Gaussian distribution N Q ~N(σ,σ 2 ). Then, calculate the Gaussian distribution N Q The inverse function of the cumulative distribution function F -1 , and F -1 (0.5-a), F -1 (0.5+a) are respectively set as the upper and lower bounds of the quantization isolation band, where a is called the quantization factor. When the eigenvalue is greater than or equal to the upper bound, the eigenvalue is quantized to 1; when the eigenvalue is less than or equal to the lower bound, the eigenvalue is quantized to 0; when the eigenvalue is between the upper and lower bounds, the eigenvalue is quantized to -1. After the first device and the second device quantize the obtained channel characteristics respectively, they send a characteristic index with a quantization value of -1 to each other, and then delete the bit of the index position.
[0073] In an embodiment of the present invention, the wireless channel is used as a natural random source, and the first device obtains two consecutive first uplink channel coefficients and second uplink channel coefficients sent by the second device. First, the pre-trained model is adjusted according to the first uplink channel coefficient so that the prediction result of the target time domain prediction model is more consistent with the current channel characteristics; then, based on the target time domain prediction model and the second uplink channel coefficient, the first downlink channel characteristics at the target time are predicted; finally, the first device generates a first key according to the predicted first downlink channel characteristics, and the second device obtains the actual second downlink channel characteristics according to the first downlink channel coefficient obtained at the target time to generate a second key corresponding to the first key. The impact of the shortened channel coherence time is reduced, and the reciprocity of the uplink and downlink channels is improved. It can be better applied to the scenario of high-speed movement of cellular networks, thereby improving the security during wireless communication.
[0074] In some optional implementations, in step 101: adjusting parameters of a pre-trained first time domain prediction model according to the first uplink channel coefficient sent by the second device to obtain a target time domain prediction model includes:
[0075] Acquire the first uplink channel coefficient sent by the second device;
[0076] Converting the first uplink channel coefficient to a real number to obtain a first uplink channel coefficient converted to a real number;
[0077] Normalizing the real-numbered first uplink channel coefficient to obtain a first uplink channel characteristic;
[0078] The pre-trained first time domain prediction model is adjusted according to the first uplink channel characteristics to obtain a target time domain prediction model.
[0079] In this implementation manner, when it is necessary to perform key encryption on the communication between the first device and the second device, the first device obtains the first uplink channel coefficient H sent by the second device. 21 , and then the first uplink channel coefficient H 21 Perform real number conversion to obtain the first uplink channel coefficient H′ after real number conversion 21 , and then the first uplink channel coefficient H′ after real numbering 21 Normalize and get the first uplink channel feature X 21 The specific real number conversion and normalization process can refer to the above preprocessing process, which will not be repeated here. 21 The pre-trained first time domain prediction model is adjusted to obtain a target time domain prediction model, so that the prediction result of the target time domain prediction model is more consistent with the current channel characteristics, thereby improving the accuracy of the prediction result of the target time domain prediction model.
[0080] Optionally, adjusting parameters of a pre-trained first time domain prediction model according to the first uplink channel feature to obtain a target time domain prediction model includes:
[0081] Inputting the first uplink channel characteristic into the first time domain prediction model to obtain a predicted channel characteristic corresponding to a second uplink channel characteristic, where the second uplink channel characteristic is an uplink channel characteristic obtained by converting the second uplink channel coefficient into a real number and normalizing it;
[0082] According to the predicted channel characteristics and the second uplink channel characteristics, the first time domain prediction model is adjusted through an objective function to obtain a target time domain prediction model, wherein the objective function is:
[0083]
[0084] in, is the vth feature in the predicted channel feature, is the vth feature of the second uplink channel feature, N X for and X 22 The vector length of is the predicted channel feature, X 22 is the second uplink channel feature, V is the batch size, ||·||2 represents the second norm, and Ω is the set of all trained model parameters.
[0085] In this example, the first device sets the first uplink channel characteristic X 21 Input into the first time domain prediction model to obtain the predicted second uplink channel feature X 21 The corresponding predicted channel characteristics According to the predicted channel characteristics and the second uplink channel characteristic X 21 , the first time domain prediction model is adjusted by the objective function to obtain the target time domain prediction model. The original data can be The noise-free fine-tuning set is a set in which Gaussian noise is added to generate fine-tuning sets with different signal-to-noise ratios, and the Adaptive Moment Estimation Algorithm (ADAM) is used to minimize the loss function to adjust the parameters of TDPNet. The parameter adjustment round can be G rounds. This further improves the accuracy of the prediction results of the target time domain prediction model.
[0086] Optionally, after obtaining the predicted first downlink channel characteristic through the target time domain prediction model according to the second uplink channel coefficient sent by the second device, and before generating the first key according to the first downlink channel characteristic, the method further includes:
[0087] Acquire a second downlink channel characteristic obtained by the second device according to the first downlink channel coefficient;
[0088] Calculating a normalized mean square error between the first downlink channel characteristic and the second downlink channel characteristic to obtain a normalized mean square error value;
[0089] The generating a first key according to the first downlink channel characteristic includes:
[0090] When the normalized mean square error value is less than or equal to a second threshold, a first key is generated according to the first downlink channel characteristic.
[0091] In this example, for the trained target time domain prediction model, the noise-free test data set Gaussian white noise is added to generate test sets under different signal-to-noise ratios, and the preprocessed test sets under different signal-to-noise ratios are used The target time domain prediction model is tested. The normalized mean square error (NMSE) is used as the evaluation index to evaluate the performance of the network. The calculation method is as follows:
[0092]
[0093] Among them, X 23 The second device is configured to receive the first downlink channel coefficient H 23 The obtained second downlink channel characteristics; is the second uplink channel characteristic X 22 Input into the target time domain prediction model to obtain the predicted first downlink channel characteristics at the target time. The test results under different signal-to-noise ratios (SNR) are as follows: Figure 3 As shown. It can be seen that TDPNet-fine-tuned (i.e., the target time domain prediction model) reduces the NMSE value compared to TDPNet-unfine-tuned (i.e., the first time domain prediction model). When the NMSE value is less than or equal to the second threshold (which can be 0.75), the first key is generated according to the first downlink channel characteristics. In this way, the prediction result of the target time domain prediction model is evaluated according to NMSE, and the accuracy of the target time domain prediction model predicting the first downlink channel characteristics according to the second uplink channel characteristics is reduced, thereby improving the key generation efficiency.
[0094] Optionally, after quantizing the first downlink channel feature to obtain a first key bit, and before performing information reconciliation processing and privacy amplification processing on the first key bit to obtain the first key, the method further includes:
[0095] Acquire a second key bit sent by the second device, where the second key bit is a key bit obtained by the second device by quantizing a second downlink channel characteristic, and the second downlink channel characteristic is a downlink channel characteristic obtained by the second device according to the first downlink channel coefficient;
[0096] Calculating a bit error rate between the first key bit and the second key bit to obtain a bit error rate value;
[0097] The performing information reconciliation processing and privacy amplification processing on the first key bits to obtain the first key includes:
[0098] When the bit error rate value is less than or equal to the first threshold, information reconciliation processing and privacy amplification processing are performed on the first key bits to obtain the first key.
[0099] In this example, the key error rate (Bit Error Rate, BER) can be used to evaluate the key. The key error rate is defined as the ratio of error bits in the total number of bits used to generate the initial key. Figure 4 and Figure 5 The BER performance of TDPNet at different speeds is demonstrated. When the bit error rate value is less than or equal to the first threshold (which can be 0.4), the first key bit is subjected to information reconciliation processing and privacy amplification processing to obtain the first key. In this way, the key is evaluated according to the BER, and the bit error rate in the key generation process is reduced, thereby improving the key generation efficiency and the security of key encryption.
[0100] See also Figure 6 , Figure 6 is a flowchart of another key generation method provided by an embodiment of the present invention, which is applied to a second device, such as Figure 6 As shown, the method comprises the following steps:
[0101] Step 601: Send a first uplink channel coefficient and a second uplink channel coefficient to a first device, where the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, the first uplink channel coefficient is used by the first device to obtain a target time domain prediction model, the second uplink channel coefficient is used by the first device to obtain a predicted first downlink channel feature through the target time domain prediction model, the first downlink channel feature is used by the first device to generate a first key, and the first downlink channel feature is a downlink channel feature at a target time after the second uplink channel coefficient;
[0102] Step 602: Generate a second key according to the first downlink channel coefficient sent by the first device at the target time.
[0103] In an embodiment of the present invention, the wireless channel is used as a natural random source, and the first device obtains two consecutive first uplink channel coefficients and second uplink channel coefficients sent by the second device. First, the pre-trained model is adjusted according to the first uplink channel coefficient so that the prediction result of the target time domain prediction model is more consistent with the current channel characteristics; then, based on the target time domain prediction model and the second uplink channel coefficient, the first downlink channel characteristics at the target time are predicted; finally, the first device generates a first key according to the predicted first downlink channel characteristics, and the second device obtains the actual second downlink channel characteristics according to the first downlink channel coefficient obtained at the target time to generate a second key corresponding to the first key. The impact of the shortened channel coherence time is reduced, and the reciprocity of the uplink and downlink channels is improved. It can be better applied to the scenario of high-speed movement of cellular networks, thereby improving the security during wireless communication.
[0104] Optionally, generating a second key according to a first downlink channel coefficient sent by the first device at the target time includes:
[0105] Acquire a first downlink channel coefficient sent by the first device at the target time;
[0106] Converting the first downlink channel coefficient to a real number to obtain a first downlink channel coefficient after converting the first downlink channel coefficient to a real number;
[0107] Normalizing the real-numbered first downlink channel coefficient to obtain a second downlink channel characteristic;
[0108] The second key is generated according to the second downlink channel characteristics.
[0109] In this implementation, when it is necessary to perform key encryption on the communication between the first device and the second device, the second device obtains the first downlink channel coefficient H sent by the first device at the target time. 23 , for the first downlink channel coefficient H 23 The real number is converted to obtain the first downlink channel coefficient H′ after real number conversion. 23 , and then the first downlink channel coefficient H′ after real numbering 23 Normalize and get the second row channel feature X 23 The specific real number conversion and normalization process can refer to the above preprocessing process, which will not be repeated here. Then, according to the second downlink channel feature X 23 Generate a second key corresponding to the first key. Reduce the impact of the shortened channel coherence time, improve the reciprocity of the uplink and downlink channels, and better apply to the high-speed mobile scene of the cellular network, thereby improving the security of the wireless communication process.
[0110] Optionally, the generating the second key according to the second downlink channel characteristic includes:
[0111] quantifying the second downlink channel characteristic to obtain a second key bit, and sending the second key bit to the first device;
[0112] When the bit error rate value is less than or equal to the first threshold, the second key bit is subjected to information reconciliation processing and privacy amplification processing to obtain the second key, the bit error rate value is the bit error rate obtained by the first device according to the first key bit and the second key bit, and the first key bit is the key bit obtained by the first device by quantifying the first downlink channel feature. In this way, the key is evaluated according to the BER, the bit error rate in the key generation process is reduced, thereby improving the key generation efficiency and the security of key encryption.
[0113] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a key generation device provided by an embodiment of the present invention, the key generation device is applied to a first device, such as Figure 7 As shown, the key generation device 700 includes:
[0114] The first processing module 701 is used to adjust the parameters of the pre-trained first time domain prediction model according to the first uplink channel coefficient sent by the second device to obtain a target time domain prediction model;
[0115] A second processing module 702 is configured to obtain a predicted first downlink channel characteristic through the target time domain prediction model according to a second uplink channel coefficient sent by the second device, wherein the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, and the first downlink channel characteristic is a downlink channel characteristic at a target time after the second uplink channel coefficient;
[0116] The first generating module 703 is used to generate a first key according to the first downlink channel characteristics, and send a first downlink channel coefficient to the second device at the target time, where the first downlink channel coefficient is used by the second device to generate a second key.
[0117] Optionally, the device further comprises:
[0118] A first acquisition module, configured to acquire N groups of uplink channel coefficients sent by the second device, each group of uplink channel coefficients in the N groups of uplink channel coefficients comprising a third uplink channel coefficient and a fourth uplink channel coefficient, the fourth uplink channel coefficient being an uplink channel coefficient at an adjacent time after the third uplink channel coefficient, and N being an integer greater than 0;
[0119] A preprocessing module, configured to preprocess the N groups of uplink channel coefficients to obtain N groups of uplink channel characteristics corresponding to the N groups of uplink channel coefficients, wherein each group of uplink channel characteristics in the N groups of uplink channel characteristics includes a third uplink channel characteristic corresponding to the third uplink channel coefficient and a fourth uplink channel characteristic corresponding to the fourth uplink channel coefficient;
[0120] A training module is used to train a preset network model according to the N groups of uplink channel characteristics to obtain the first time domain prediction model.
[0121] Optionally, the first processing module 701 includes:
[0122] an acquisition submodule, configured to acquire the first uplink channel coefficient sent by the second device;
[0123] A real numbering submodule, used for performing real numbering on the first uplink channel coefficient to obtain the real numbered first uplink channel coefficient;
[0124] A normalization submodule, used for normalizing the real-numbered first uplink channel coefficient to obtain a first uplink channel characteristic;
[0125] A parameter adjustment submodule is used to adjust the parameters of the pre-trained first time domain prediction model according to the first uplink channel characteristics to obtain a target time domain prediction model.
[0126] Optionally, the parameter adjustment submodule includes:
[0127] An input unit, configured to input the first uplink channel characteristic into the first time domain prediction model to obtain a predicted channel characteristic corresponding to a second uplink channel characteristic, wherein the second uplink channel characteristic is an uplink channel characteristic obtained by converting the second uplink channel coefficient into a real number and normalizing the second uplink channel coefficient;
[0128] A parameter adjustment unit is used to adjust the first time domain prediction model through an objective function according to the predicted channel characteristics and the second uplink channel characteristics to obtain a target time domain prediction model, wherein the objective function is:
[0129]
[0130] in, is the vth feature in the predicted channel feature, is the vth feature of the second uplink channel feature, N X for and X 22 The vector length of is the predicted channel feature, X 22is the second uplink channel feature, V is the batch size, ||·||2 represents the second norm, and Ω is the set of all trained model parameters.
[0131] Optionally, the first generating module 703 includes:
[0132] A quantization submodule, configured to quantize the first downlink channel characteristic to obtain a first key bit;
[0133] The processing submodule is used to perform information reconciliation processing and privacy amplification processing on the first key bits to obtain the first key.
[0134] Optionally, the device further comprises:
[0135] A second acquisition module, configured to acquire a second key bit sent by the second device, where the second key bit is a key bit obtained by the second device by quantizing a second downlink channel characteristic, where the second downlink channel characteristic is a downlink channel characteristic obtained by the second device according to the first downlink channel coefficient;
[0136] A first calculation module, used for calculating a bit error rate between the first key bit and the second key bit to obtain a bit error rate value;
[0137] The processing submodule comprises:
[0138] A processing unit is used to perform information reconciliation processing and privacy amplification processing on the first key bit to obtain the first key when the bit error rate value is less than or equal to a first threshold.
[0139] Optionally, the device further comprises:
[0140] A third acquisition module, configured to acquire a second downlink channel characteristic obtained by the second device according to the first downlink channel coefficient;
[0141] A second calculation module, used to calculate a normalized mean square error between the first downlink channel characteristic and the second downlink channel characteristic to obtain a normalized mean square error value;
[0142] The first generation module 703 includes:
[0143] A generating submodule is used to generate a first key according to the first downlink channel characteristic when the normalized mean square error value is less than or equal to a second threshold.
[0144] The key generation device 700 is capable of implementing each process of each embodiment of the key generation method applied to the first device. The technical features correspond one to one and can achieve the same technical effect. To avoid repetition, they will not be described here.
[0145] See also Figure 8 , Figure 8 is a schematic diagram of the structure of another key generation device provided by an embodiment of the present invention, the key generation device is applied to a second device, such as Figure 8 As shown, the key generation device 800 includes:
[0146] A first sending module 801 is configured to send a first uplink channel coefficient and a second uplink channel coefficient to a first device, where the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, the first uplink channel coefficient is used by the first device to obtain a target time domain prediction model, the second uplink channel coefficient is used by the first device to obtain a predicted first downlink channel feature through the target time domain prediction model, the first downlink channel feature is used by the first device to generate a first key, and the first downlink channel feature is a downlink channel feature at a target time after the second uplink channel coefficient;
[0147] The first generating module 802 is configured to generate a second key according to a first downlink channel coefficient sent by the first device at the target time.
[0148] Optionally, the first generating module 802 includes:
[0149] An acquisition module, used to acquire a first downlink channel coefficient sent by the first device at the target time;
[0150] A real numbering submodule, used for performing real numbering on the first downlink channel coefficient to obtain the real numbered first downlink channel coefficient;
[0151] A normalization submodule, used for normalizing the first downlink channel coefficient after real numbering to obtain a second downlink channel feature;
[0152] A generating submodule is used to generate the second key according to the characteristics of the second downlink channel.
[0153] Optionally, the generating submodule includes:
[0154] A first processing unit, configured to quantify the second downlink channel characteristic to obtain a second key bit, and send the second key bit to the first device;
[0155] The second processing unit is used to perform information reconciliation processing and privacy amplification processing on the second key bit to obtain the second key when the bit error rate value is less than or equal to the first threshold, wherein the bit error rate value is the bit error rate obtained by the first device according to the first key bit and the second key bit, and the first key bit is the key bit obtained by the first device by quantizing the first downlink channel characteristic.
[0156] The key generation device 800 is capable of implementing each process of each embodiment of the above-mentioned key generation method applied to the second device. The technical features correspond one to one and can achieve the same technical effect. To avoid repetition, they will not be described here.
[0157] An embodiment of the present invention also provides an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor. When the program is executed by the processor, each process of the above-mentioned fault prediction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0158] For details, see Fig. 9 An embodiment of the present invention further provides an electronic device, including a bus 901, a transceiver 902, an antenna 903, a bus interface 904, a processor 905 and a memory 906.
[0159] The processor 905 is configured to adjust the parameters of the pre-trained first time domain prediction model according to the first uplink channel coefficient sent by the second device to obtain a target time domain prediction model;
[0160] The processor 905 is further configured to obtain a predicted first downlink channel characteristic through the target time domain prediction model according to the second uplink channel coefficient sent by the second device, where the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, and the first downlink channel characteristic is a downlink channel characteristic at a target time after the second uplink channel coefficient;
[0161] The processor 905 is further configured to generate a first key according to the first downlink channel characteristic, and send a first downlink channel coefficient to the second device at the target time, wherein the first downlink channel coefficient is used by the second device to generate a second key.
[0162] Optionally, the processor 905 is further configured to obtain N groups of uplink channel coefficients sent by the second device, each group of uplink channel coefficients in the N groups of uplink channel coefficients includes a third uplink channel coefficient and a fourth uplink channel coefficient, the fourth uplink channel coefficient is an uplink channel coefficient at an adjacent time after the third uplink channel coefficient, and N is an integer greater than 0;
[0163] The processor 905 is further configured to preprocess the N groups of uplink channel coefficients to obtain N groups of uplink channel characteristics corresponding to the N groups of uplink channel coefficients, wherein each group of uplink channel characteristics in the N groups of uplink channel characteristics includes a third uplink channel characteristic corresponding to the third uplink channel coefficient and a fourth uplink channel characteristic corresponding to the fourth uplink channel coefficient;
[0164] The processor 905 is further used to train a preset network model according to the N groups of uplink channel characteristics to obtain the first time domain prediction model.
[0165] Optionally, adjusting parameters of a pre-trained first time domain prediction model according to the first uplink channel coefficient sent by the second device to obtain a target time domain prediction model includes:
[0166] Acquire the first uplink channel coefficient sent by the second device;
[0167] Converting the first uplink channel coefficient to a real number to obtain a first uplink channel coefficient converted to a real number;
[0168] Normalizing the real-numbered first uplink channel coefficient to obtain a first uplink channel characteristic;
[0169] The pre-trained first time domain prediction model is adjusted according to the first uplink channel characteristics to obtain a target time domain prediction model.
[0170] Optionally, adjusting parameters of a pre-trained first time domain prediction model according to the first uplink channel feature to obtain a target time domain prediction model includes:
[0171] Inputting the first uplink channel characteristic into the first time domain prediction model to obtain a predicted channel characteristic corresponding to a second uplink channel characteristic, where the second uplink channel characteristic is an uplink channel characteristic obtained by converting the second uplink channel coefficient into a real number and normalizing it;
[0172] According to the predicted channel characteristics and the second uplink channel characteristics, the first time domain prediction model is adjusted through an objective function to obtain a target time domain prediction model, wherein the objective function is:
[0173]
[0174] in, is the vth feature in the predicted channel feature, is the vth feature of the second uplink channel feature, N X for and X 22 The vector length of is the predicted channel feature, X 22 is the second uplink channel feature, V is the batch size, ||·||2 represents the second norm, and Ω is the set of all trained model parameters.
[0175] Optionally, the generating a first key according to the first downlink channel characteristic includes:
[0176] quantizing the first downlink channel characteristic to obtain a first key bit;
[0177] The first key bits are subjected to information reconciliation processing and privacy amplification processing to obtain the first key.
[0178] Optionally, the processor 905 is further configured to obtain a second key bit sent by the second device, where the second key bit is a key bit obtained by the second device by quantizing a second downlink channel characteristic, and the second downlink channel characteristic is a downlink channel characteristic obtained by the second device according to the first downlink channel coefficient;
[0179] The processor 905 is further configured to calculate a bit error rate between the first key bit and the second key bit to obtain a bit error rate value;
[0180] The performing information reconciliation processing and privacy amplification processing on the first key bits to obtain the first key includes:
[0181] When the bit error rate value is less than or equal to the first threshold, information reconciliation processing and privacy amplification processing are performed on the first key bits to obtain the first key.
[0182] Optionally, the processor 905 is further configured to obtain a second downlink channel characteristic obtained by the second device according to the first downlink channel coefficient;
[0183] The processor 905 is further configured to calculate a normalized mean square error between the first downlink channel characteristic and the second downlink channel characteristic to obtain a normalized mean square error value;
[0184] The generating a first key according to the first downlink channel characteristic includes:
[0185] When the normalized mean square error value is less than or equal to a second threshold, a first key is generated according to the first downlink channel characteristic.
[0186] exist Fig. 9In the embodiment, the bus architecture (represented by bus 901) may include any number of interconnected buses and bridges, and bus 901 links various circuits including one or more processors represented by processor 905 and memory represented by memory 906. Bus 901 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 904 provides an interface between bus 901 and transceiver 902. Transceiver 902 may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. Data processed by processor 905 is transmitted on a wireless medium via antenna 903, and further, antenna 903 also receives data and transmits the data to processor 905.
[0187] The processor 905 is responsible for managing the bus 901 and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 906 can be used to store data used by the processor 905 when performing operations.
[0188] Optionally, the processor 905 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a complex programmable logic device (CPLD).
[0189] An embodiment of the present invention also provides another electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor. When the program is executed by the processor, each process of the above-mentioned fault prediction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0190] For details, see Fig.10 An embodiment of the present invention further provides another electronic device, including a bus 1001, a transceiver 1002, an antenna 1003, a bus interface 1004, a processor 1005 and a memory 1006.
[0191] Wherein, the transceiver 1002 is used to send a first uplink channel coefficient and a second uplink channel coefficient to the first device, the second uplink channel coefficient is the uplink channel coefficient at an adjacent time after the first uplink channel coefficient, the first uplink channel coefficient is used by the first device to obtain a target time domain prediction model, the second uplink channel coefficient is used by the first device to obtain a predicted first downlink channel feature through the target time domain prediction model, the first downlink channel feature is used by the first device to generate a first key, and the first downlink channel feature is the downlink channel feature at a target time after the second uplink channel coefficient;
[0192] The processor 1005 is configured to generate a second key according to a first downlink channel coefficient sent by the first device at the target time.
[0193] Optionally, generating a second key according to a first downlink channel coefficient sent by the first device at the target time includes:
[0194] Acquire a first downlink channel coefficient sent by the first device at the target time;
[0195] Converting the first downlink channel coefficient to a real number to obtain a first downlink channel coefficient after converting the first downlink channel coefficient to a real number;
[0196] Normalizing the real-numbered first downlink channel coefficient to obtain a second downlink channel characteristic;
[0197] The second key is generated according to the second downlink channel characteristics.
[0198] Optionally, the generating the second key according to the second downlink channel characteristic includes:
[0199] quantifying the second downlink channel characteristic to obtain a second key bit, and sending the second key bit to the first device;
[0200] When the bit error rate value is less than or equal to the first threshold, the second key bit is subjected to information reconciliation processing and privacy amplification processing to obtain the second key, the bit error rate value is the bit error rate obtained by the first device according to the first key bit and the second key bit, and the first key bit is the key bit obtained by the first device by quantifying the first downlink channel characteristic.
[0201] exist Fig.10In the embodiment, the bus architecture (represented by bus 1001) may include any number of interconnected buses and bridges, and bus 1001 links various circuits including one or more processors represented by processor 1005 and memory represented by memory 1006. Bus 1001 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 1004 provides an interface between bus 1001 and transceiver 1002. Transceiver 1002 may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. Data processed by processor 1005 is transmitted on a wireless medium via antenna 1003, and further, antenna 1003 also receives data and transmits the data to processor 1005.
[0202] The processor 1005 is responsible for managing the bus 1001 and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 1006 can be used to store data used by the processor 1005 when performing operations.
[0203] Optionally, the processor 1005 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a complex programmable logic device (CPLD).
[0204] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the key generation method embodiment applied to the first device is implemented, or each process of the key generation method embodiment applied to the second device is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0205] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present invention is not limited to performing functions in the order discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0206] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0207] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A key generation method, characterized in that: Applied to a first device, the method includes: Adjusting parameters of a pre-trained first time domain prediction model according to a first uplink channel coefficient sent by the second device to obtain a target time domain prediction model; According to the second uplink channel coefficient sent by the second device, a predicted first downlink channel characteristic is obtained through the target time domain prediction model, wherein the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, and the first downlink channel characteristic is a downlink channel characteristic at a target time after the second uplink channel coefficient; A first key is generated according to the first downlink channel characteristic, and a first downlink channel coefficient is sent to the second device at the target time, where the first downlink channel coefficient is used by the second device to generate a second key.
2. The method according to claim 1, characterized in that Before adjusting the parameters of the pre-trained first time domain prediction model according to the first uplink channel coefficient sent by the second device to obtain the target time domain prediction model, the method further includes: Acquire N groups of uplink channel coefficients sent by the second device, each group of uplink channel coefficients in the N groups of uplink channel coefficients includes a third uplink channel coefficient and a fourth uplink channel coefficient, the fourth uplink channel coefficient is an uplink channel coefficient at an adjacent time after the third uplink channel coefficient, and N is an integer greater than 0; Preprocessing the N groups of uplink channel coefficients to obtain N groups of uplink channel characteristics corresponding to the N groups of uplink channel coefficients, each group of uplink channel characteristics in the N groups of uplink channel characteristics including a third uplink channel characteristic corresponding to the third uplink channel coefficient and a fourth uplink channel characteristic corresponding to the fourth uplink channel coefficient; The preset network model is trained according to the N groups of uplink channel characteristics to obtain the first time domain prediction model.
3. The method according to claim 1, characterized in that The step of adjusting parameters of a pre-trained first time domain prediction model according to the first uplink channel coefficient sent by the second device to obtain a target time domain prediction model includes: Acquire the first uplink channel coefficient sent by the second device; Converting the first uplink channel coefficient to a real number to obtain a first uplink channel coefficient converted to a real number; Normalizing the real-numbered first uplink channel coefficient to obtain a first uplink channel characteristic; The pre-trained first time domain prediction model is adjusted according to the first uplink channel characteristics to obtain a target time domain prediction model.
4. The method according to claim 3, characterized in that The step of adjusting parameters of a pre-trained first time domain prediction model according to the first uplink channel feature to obtain a target time domain prediction model includes: Inputting the first uplink channel characteristic into the first time domain prediction model to obtain a predicted channel characteristic corresponding to a second uplink channel characteristic, where the second uplink channel characteristic is an uplink channel characteristic obtained by converting the second uplink channel coefficient into a real number and normalizing it; According to the predicted channel characteristics and the second uplink channel characteristics, the first time domain prediction model is adjusted through an objective function to obtain a target time domain prediction model, wherein the objective function is: in, is the vth feature in the predicted channel feature, is the vth feature of the second uplink channel feature, N X for and X 22 The vector length of is the predicted channel feature, X 22 is the second uplink channel feature, V is the batch size, ||·||2 represents the second norm, and Ω is the set of all trained model parameters.
5. The method according to claim 1, characterized in that The generating a first key according to the first downlink channel characteristic includes: quantizing the first downlink channel characteristic to obtain a first key bit; The first key bits are subjected to information reconciliation processing and privacy amplification processing to obtain the first key.
6. The method according to claim 5, characterized in that After quantizing the first downlink channel feature to obtain the first key bit, and before performing information reconciliation processing and privacy amplification processing on the first key bit to obtain the first key, the method further includes: Acquire a second key bit sent by the second device, where the second key bit is a key bit obtained by the second device by quantizing a second downlink channel characteristic, and the second downlink channel characteristic is a downlink channel characteristic obtained by the second device according to the first downlink channel coefficient; Calculating a bit error rate between the first key bit and the second key bit to obtain a bit error rate value; The performing information reconciliation processing and privacy amplification processing on the first key bits to obtain the first key includes: When the bit error rate value is less than or equal to the first threshold, information reconciliation processing and privacy amplification processing are performed on the first key bits to obtain the first key.
7. The method according to claim 1, characterized in that After obtaining the predicted first downlink channel characteristic through the target time domain prediction model according to the second uplink channel coefficient sent by the second device, and before generating the first key according to the first downlink channel characteristic, the method further includes: Acquire a second downlink channel characteristic obtained by the second device according to the first downlink channel coefficient; Calculating a normalized mean square error between the first downlink channel characteristic and the second downlink channel characteristic to obtain a normalized mean square error value; The generating a first key according to the first downlink channel characteristic includes: When the normalized mean square error value is less than or equal to a second threshold, a first key is generated according to the first downlink channel characteristic.
8. A key generation method, characterized in that: Applied to the second device, the method includes: Sending a first uplink channel coefficient and a second uplink channel coefficient to a first device, where the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, the first uplink channel coefficient is used by the first device to obtain a target time domain prediction model, the second uplink channel coefficient is used by the first device to obtain a predicted first downlink channel feature through the target time domain prediction model, the first downlink channel feature is used by the first device to generate a first key, and the first downlink channel feature is a downlink channel feature at a target time after the second uplink channel coefficient; A second key is generated according to the first downlink channel coefficient sent by the first device at the target time.
9. The method according to claim 8, characterized in that The generating a second key according to the first downlink channel coefficient sent by the first device at the target time includes: Acquire a first downlink channel coefficient sent by the first device at the target time; Converting the first downlink channel coefficient to a real number to obtain a first downlink channel coefficient after converting the first downlink channel coefficient to a real number; Normalizing the real-numbered first downlink channel coefficient to obtain a second downlink channel characteristic; The second key is generated according to the second downlink channel characteristics.
10. The method according to claim 9, characterized in that The generating the second key according to the second downlink channel characteristic includes: quantifying the second downlink channel characteristic to obtain a second key bit, and sending the second key bit to the first device; When the bit error rate value is less than or equal to the first threshold, the second key bit is subjected to information reconciliation processing and privacy amplification processing to obtain the second key, the bit error rate value is the bit error rate obtained by the first device according to the first key bit and the second key bit, and the first key bit is the key bit obtained by the first device by quantifying the first downlink channel characteristic.
11. A key generation device, characterized in that: Applied to a first device, the apparatus comprises: A first processing module, configured to adjust parameters of a pre-trained first time domain prediction model according to a first uplink channel coefficient sent by a second device to obtain a target time domain prediction model; a second processing module, configured to obtain a predicted first downlink channel characteristic through the target time domain prediction model according to a second uplink channel coefficient sent by the second device, wherein the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, and the first downlink channel characteristic is a downlink channel characteristic at a target time after the second uplink channel coefficient; The first generating module is used to generate a first key according to the first downlink channel characteristics, and send a first downlink channel coefficient to the second device at the target time, wherein the first downlink channel coefficient is used by the second device to generate a second key.
12. A key generation device, characterized in that: Applied to a second device, the apparatus comprises: A first sending module, configured to send a first uplink channel coefficient and a second uplink channel coefficient to a first device, wherein the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, the first uplink channel coefficient is used by the first device to obtain a target time domain prediction model, the second uplink channel coefficient is used by the first device to obtain a predicted first downlink channel feature through the target time domain prediction model, the first downlink channel feature is used by the first device to generate a first key, and the first downlink channel feature is a downlink channel feature at a target time after the second uplink channel coefficient; The first generating module is used to generate a second key according to a first downlink channel coefficient sent by the first device at the target time.
13. An electronic device, characterized in that: Including transceiver and processor, The processor is used to adjust the parameters of the pre-trained first time domain prediction model according to the first uplink channel coefficient sent by the second device to obtain a target time domain prediction model; The processor is further configured to obtain a predicted first downlink channel characteristic through the target time domain prediction model according to a second uplink channel coefficient sent by the second device, wherein the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, and the first downlink channel characteristic is a downlink channel characteristic at a target time after the second uplink channel coefficient; The processor is further configured to generate a first key according to the first downlink channel characteristic, and send a first downlink channel coefficient to the second device at the target time, wherein the first downlink channel coefficient is used by the second device to generate a second key.
14. An electronic device, characterized in that: Including transceiver and processor, The transceiver is used to send a first uplink channel coefficient and a second uplink channel coefficient to a first device, where the second uplink channel coefficient is an uplink channel coefficient at an adjacent time after the first uplink channel coefficient, the first uplink channel coefficient is used by the first device to obtain a target time domain prediction model, the second uplink channel coefficient is used by the first device to obtain a predicted first downlink channel feature through the target time domain prediction model, the first downlink channel feature is used by the first device to generate a first key, and the first downlink channel feature is a downlink channel feature at a target time after the second uplink channel coefficient; The processor is configured to generate a second key according to a first downlink channel coefficient sent by the first device at the target time.
15. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the key generation method according to any one of claims 1 to 7, or implements the steps of the key generation method according to any one of claims 8 to 10.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the key generation method according to any one of claims 1 to 7 are implemented, or the steps of the key generation method according to any one of claims 8 to 10 are implemented.