A physical layer key generation method based on adaptive non-uniform segmentation and tree-like layer order matching
Through the adaptive non-uniform segmentation and tree-like hierarchical sequence matching method, the problems of inaccurate and inefficient key generation caused by fixed-length segmentation are solved, and more efficient and reliable physical layer key generation is achieved.
Patent Information
- Application Number
- CN202510496447.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-04-21
AI Technical Summary
Existing physical layer key generation methods based on fixed-length segmentation are difficult to maintain the accuracy and generation rate of keys in a variable environment, resulting in low efficiency and reliability.
Adaptive non-uniform segmentation and tree hierarchy matching method is adopted to dynamically divide the channel sample sequence through sliding window mechanism, and segmentation differences are enhanced by dynamic time regular distances, and key generation is performed through random segmentation rearrangement and dynamic path perception.
It significantly improves the accuracy and efficiency of key generation, and can achieve accurate and efficient key generation in high dynamic and high noise environments.
Smart Images

Figure CN120017274B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wireless communication security technology, and in particular to a physical layer key generation method based on adaptive non-uniform segmentation and tree-like layer sequence matching. Background Art
[0002] The rapid development of 5G, B5G (Beyond 5G) and 6G communication technologies has promoted the widespread integration of diverse wireless devices, including the Internet of Things (IoT), Internet of Vehicles (IoV) and Unmanned Aerial Vehicles (UAV). Although high-speed data transmission and wide coverage bring convenience to users, the inherent openness of wireless media makes it vulnerable to unauthorized eavesdropping, posing great risks to the confidentiality and security of wireless communications. To address these security threats, physical layer key generation, as an important security guarantee, ensures the security of communications by utilizing the inherent physical characteristics of wireless channels.
[0003] In the physical layer key generation process, the short-term reciprocity of the wireless channel provides the possibility for paired devices to extract highly correlated channel samples. These channel samples are unpredictable due to the time variability of the channel and can be used as a shared random source for key generation, thereby eliminating the reliance on complex cryptographic algorithms or key distribution centers. For most physical layer key generation, the quantization algorithm is a key step that defines a quantization interval based on the statistical characteristics of the channel samples and quantizes the channel samples into initial key bits according to the specific quantization interval they fall into. However, in practical applications, channel reciprocity is often affected by environmental noise and hardware defects, which may lead to a decrease in the correlation of channel samples between devices, which in turn generates errors in the quantization process, thereby increasing the overhead of information mediation and limiting the efficiency and reliability of key generation.
[0004] In order to overcome the limitations of traditional quantization algorithms, some key generation methods based on segment matching have been proposed in recent years. These methods usually divide the channel samples into several segments and randomly rearrange these segments, so as to establish segment matching by measuring the similarity between channel segments, and finally derive the rearrangement sequence through the matching process for key generation. However, most of the existing key generation methods based on segment matching adopt a uniform segmentation strategy of fixed length when generating channel segments. This strategy may not be applicable in some variable environments. For example, shorter segments tend to generate similar patterns, resulting in increased ambiguity in the matching process, thereby reducing the accuracy of the key; while longer segments reduce the number of available segments, which has a negative impact on the key generation rate. Therefore, how to find a suitable balance between key accuracy and generation rate has become a key issue in the field of key generation. To this end, it is necessary to explore a new adaptive segmentation strategy that dynamically adjusts the division method of channel samples according to a suitable distance metric to enhance the difference between segments, thereby improving the accuracy and efficiency of key generation. Summary of the invention
[0005] The present application provides a physical layer key generation method based on adaptive non-uniform segmentation and tree-like layer order matching, aiming to solve the problems of inaccurate and inefficient key generation caused by fixed channel segmentation in the prior art.
[0006] The technical solution adopted in this application is:
[0007] A physical layer key generation method based on adaptive non-uniform segmentation and tree-like layer sequence matching, the method comprising the following steps:
[0008] Step 1, channel detection:
[0009] Terminal A and terminal B respectively perform alternate detection on the channel between them to generate first channel sample sequences of terminal A and terminal B with the same sequence length;
[0010] Step 2, adaptive segment generation with difference enhancement:
[0011] Terminal A adopts a sliding window mechanism to perform adaptive non-uniform segmentation processing according to the local channel characteristics of its first channel sample in the current window, obtains several sequence segments of the first channel sample, and generates a second channel sample sequence of terminal A based on all the sequence segments;
[0012] Step 3: Abnormal segmentation identification and calibration:
[0013] Based on the adopted sequence segment distance measurement method, terminal A determines the sequence segment pairs whose distance in its second channel sample sequence is less than or equal to the preset distance threshold as abnormal segments; and calibrates the abnormal segments based on the random value to obtain the calibrated channel sample segments of terminal A, and sequentially concatenates the calibrated channel sample segments to obtain the third channel sample sequence of terminal A;
[0014] Terminal A generates calibration information based on its first channel sample sequence and third channel sample sequence, and then sends the calibration information to terminal B using a random matrix confusion method;
[0015] Terminal B reconstructs its calibrated channel sample sequence based on its first channel sample sequence and the received calibration information;
[0016] Step 4, random segment rearrangement:
[0017] Terminal A generates a random rearrangement sequence of a predetermined length, the length of which is used to characterize the number of segments of the third channel sample sequence; based on the random rearrangement sequence, randomly rearranges the sequence segments of its third channel sample sequence, sequentially concatenates the randomly rearranged sequence segments to obtain a fourth channel sample sequence of terminal A and sends it to terminal B;
[0018] Step 5: Dynamic path awareness and tree-level order matching key generation:
[0019] Terminal B uses dynamic path perception and tree-like hierarchical matching key generation algorithm to perform hierarchical matching on the calibrated channel sample sequence of terminal B and the fourth channel sample sequence of terminal A, and generates a key based on the matching result.
[0020] Furthermore, in step 2, local channel characteristics of the first channel sample of terminal A in the current window are obtained based on the dynamic time warping distance.
[0021] Furthermore, step 2 specifically includes:
[0022] Step 201, taking the first channel sample of the first channel sample sequence of terminal A as the current segment position;
[0023] Based on the segment length range you set , randomly select a length value as the first length;
[0024] Based on the first length, a candidate segment with a segment length of the first length is generated, and the starting position of the candidate segment is the current segment position; and the candidate segment is used as the first segment of the second channel sample sequence of terminal A;
[0025] Then, the current segment position is adjusted to the position of the last channel sample of the first segment in the first channel sample sequence of terminal A;
[0026] Step 202, starting from the second channel sample of the first channel sample sequence of terminal A, traverse each channel sample in turn, and perform segment processing on each channel sample of the first channel sample sequence in turn:
[0027] The current segment position is used as the starting position of the candidate segment of the current channel sample, and each candidate segment that falls within the segment length range is The segment length value is taken, and a candidate segment corresponding to the segment length value is generated respectively, so as to obtain several candidate segments of the current channel sample; and the dynamic time warping distance between each candidate segment and each segment in the second channel sample sequence of terminal A is calculated, and the minimum value is found to obtain the minimum dynamic time warping distance of the current candidate segment; then the candidate segment corresponding to the maximum of the minimum dynamic time warping distances of all the candidate segments currently generated is taken as the optimal candidate segment, and it is added to the second channel sample sequence of terminal A; at the same time, the current segment position is adjusted to the position of the last channel sample of the current optimal candidate segment in the first channel sample sequence of terminal A.
[0028] Furthermore, in step 3, the sequence segment distance measurement method used is dynamic time warping distance.
[0029] Further, in step 3, terminal A determines a sequence segment pair whose distance in its second channel sample sequence is less than or equal to a preset distance threshold as an abnormal segment; and calibrates the abnormal segment based on a random value to obtain a calibrated channel sample segment of terminal A, and sequentially concatenates the calibrated channel sample segments to obtain a third channel sample sequence of terminal A, specifically including:
[0030] Step 301: Terminal A calculates the dynamic time warping distance between two segments in its second channel sample sequence, and determines the sequence segment pairs whose dynamic time warping distance is less than or equal to a preset distance threshold as abnormal segments;
[0031] Step 302: for a pair of sequence segments whose current distance is less than or equal to a preset distance threshold, randomly select one of the sequence segments as a target segment, and replace any channel sample in the target segment with a uniformly distributed random number; wherein the minimum value of the uniform distribution is set as the minimum value of the target segment, and the maximum value of the uniform distribution is set as the maximum value of the target segment;
[0032] Step 303, based on the adjusted target segmentation, repeat steps 301~302 until the dynamic time warping distances between all segments in the second channel sample sequence of terminal A exceed the preset distance threshold, and then obtain the calibrated channel sample segmentation based on all current segments, and concatenate the calibrated channel sample segments in sequence to obtain the third channel sample sequence of terminal A.
[0033] Furthermore, step 303 also includes: performing zero-mean conversion on the calibrated channel sample segments of terminal A, and then sequentially concatenating the calibrated channel sample segments to obtain a third channel sample sequence of terminal A.
[0034] Furthermore, in step 3, the calibration information is specifically:
[0035] Terminal A generates the dimension Random Gaussian Matrix , and according to the formula Calculate the offset vector ;in, represents the first channel sample sequence of terminal A, is the length of the first channel sample sequence; represents the third channel sample sequence of terminal A;
[0036] Terminal A converts the random Gaussian matrix and the offset vector as calibration information.
[0037] Furthermore, in step 3, the calibrated channel sample sequence is specifically:
[0038] Terminal B according to the formula Reconstruct the calibrated channel sample sequence ;
[0039] in, Represents the first channel sample sequence of terminal B.
[0040] Furthermore, step 5 specifically includes:
[0041] Step 501: Terminal B calculates the Euclidean distance between the channel sample sequence after calibration of terminal B and the channel samples at the same position in the fourth channel sample sequence of terminal A, and records the minimum and maximum values thereof as , ; and calculate the current dynamic threshold based on the two ,in, represents the threshold scaling factor, and ;
[0042] Step 502: Terminal B determines the value of the dynamic threshold value. Match the calibrated channel sample sequence of terminal B with the fourth channel sample sequence of terminal A. If the Euclidean distance between the channel samples at the current position is less than or equal to , then the current channel sample pair is considered to match, and its channel sample index is recorded, using a subarray Record the channel sample index of the matching channel sample pair at the current position, where the subscript is used to characterize each position index, and , is the length of the first channel sample sequence; if for the current position, there is no Euclidean distance less than or equal to The channel sample pairs, then the subarray Empty; Based on Subarray Get the index array ;
[0043] Step 503: Terminal B discards the index array The subarray in is an empty element and indexes the array The continuous indexes contained in the neutron array are combined into segments, and then based on the starting index of each segment and end index Get the segment interval of the current segment , based on the segmented intervals of all segments, we get the interval sequence ,in Indicates The starting and ending indexes of the segments, , represents the number of intervals, , ;
[0044] Step 504: Terminal B constructs a range hash table To record a continuous set of intervals, recursively construct a hash table based on the interval from the starting index To end index The interval set of ;
[0045] Step 505: Terminal B segments the constructed interval set based on the fourth channel sample sequence of terminal A to obtain a first segment array;
[0046] Terminal B is based on the first segment array and index array , mapping the index of the matched channel sample in the fourth channel sample sequence of terminal A to the index in the calibrated channel sample sequence of terminal B to obtain a second segment array;
[0047] The number of segments of the first and second segment arrays is the same, and the value thereof is consistent with the length of the random rearrangement sequence of terminal A;
[0048] Step 506: Terminal B generates a key for communicating with Terminal A based on tree-like hierarchical matching. :
[0049] Terminal B uses each segment index of the second segment array as its initial key;
[0050] Terminal B builds a complete binary tree based on the first segment array , where complete binary tree A single leaf node is used to represent each segment in the first segment array, and the parent node saves the merge of the segments represented by the corresponding leaf node, a complete binary tree The height is ,in Indicates floor rounding operation, parameter The value of is the length of the random rearrangement sequence of terminal A;
[0051] Terminal B builds a complete binary tree based on the second segment array , where complete binary tree A single leaf node is used to represent each segment in the first segment array, and the parent node saves the merge of the segments represented by the corresponding leaf node, a complete binary tree The height is ;
[0052] Terminal B complete binary tree and No. The branch nodes from the first layer to the second layer are matched in order, and the initial key of terminal B is connected in series with the order matching results between each layer to generate the key for communication with terminal A. ;
[0053] Step 507: Terminal A generates a key for communicating with terminal B based on tree-like hierarchical matching. :
[0054] Terminal A constructs a complete binary tree based on all randomly rearranged sequence segments , where complete binary tree A single leaf node is used to represent each randomly rearranged sequence segment of terminal A, and the parent node saves the merge of the sequence segments represented by the corresponding leaf node. The height is ;
[0055] Terminal A constructs a complete binary tree based on its calibrated channel sample segments , where complete binary tree A single leaf node is used to represent a single calibrated channel sample segment, and the parent node saves the merge of the segments represented by the corresponding leaf node, a complete binary tree The height is ;
[0056] Terminal A complete binary tree and No. The branch nodes from the first layer to the second layer are matched in order, and the random rearrangement sequence of terminal A is connected in series with the order matching results between each layer to generate the local key for communication with terminal B. .
[0057] Furthermore, step 502 further includes:
[0058] Based on index array Dynamic Threshold To make adaptive adjustments:
[0059] If the index array If the number of empty sub-arrays in exceeds the first threshold, the dynamic threshold is increased. The value of
[0060] If the index array If the number of non-empty sub-arrays in exceeds the set second threshold, the dynamic threshold is lowered The value of .
[0061] The technical solution provided by this application brings at least the following beneficial effects:
[0062] (1) This application overcomes the limitations of the traditional key generation method based on fixed-length segments by adopting an adaptive non-uniform segment matching method, and achieves more accurate and efficient physical layer key generation;
[0063] (2) The present application uses an adaptive segmentation generation method of dynamic time warping distance to dynamically divide the channel sample sequence according to the channel characteristics, significantly improving the difference between segments, thereby improving the matching accuracy;
[0064] (3) The key generation method based on dynamic path search proposed in this application can achieve consistent matching between terminals and can realize accurate and efficient key generation in a highly dynamic and high-noise environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0066] Figure 1 A schematic diagram of the processing procedure of a physical layer key generation method based on adaptive non-uniform segmentation and tree-like layer sequence matching provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions of the embodiments of the present invention will be described in detail and completely with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the embodiments described with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, but cannot be understood as limiting the present invention.
[0068] The embodiment of the present application provides a physical layer key generation method based on adaptive non-uniform segmentation and tree-like hierarchical order matching, which achieves the purpose of improving the accuracy and efficiency of physical layer key generation through the steps of channel detection, adaptive segmentation generation based on dynamic time warping (DTW) distance, abnormal segmentation identification and calibration, random segmentation rearrangement, and key generation based on dynamic path perception and tree-like hierarchical order matching. In the present application, channel detection collects channel sample sequences by exchanging detection packets by terminals; and adaptive segmentation generation with enhanced difference adopts a sliding window mechanism to dynamically divide the channel sample sequence according to the local channel characteristics of the channel sample in the current window, and maximizes the distance between the channel sample segments with the help of dynamic time warping measurement, so that the difference between each segment is significantly improved to improve the accuracy of segment matching; and abnormal segmentation discrimination and calibration identifies possible abnormal segments in the channel sample sequence divided in the previous step, further calibrates the abnormal segments by random replacement, increases the difference between segments to improve the accuracy of segment matching; and also based on dynamic path perception, key generation identifies possible segmentation patterns by constructing inter-sample matching, and reconstructs the random order of segments through segment matching, so as to generate keys, and finally meets the requirements for key generation accuracy and generation rate in actual scenarios.
[0069] In one example, the method proposed in the embodiment of the present application is applied to the physical layer key generation between wireless devices. In this scenario, a pair of legal terminals A and B establish a shared secret key based on the reciprocal channel characteristics of each other. In a physical layer key generation method based on adaptive non-uniform segmentation and tree-like hierarchical matching provided in the embodiment of the present application, a passive attacker is considered, who attempts to infer the shared secret key generated by the passive attacker by passively eavesdropping on the wireless communication between the legal terminal A or terminal B. In a real wireless environment, the passive attacker is generally kept at a minimum distance of at least half a wavelength from the legal terminal A and terminal B to avoid exposing the passive attacker's attack intention; at this distance, the channel fading experienced by the passive attacker is almost unrelated to the channel fading experienced by the legal terminal, ensuring that the channel sample of the passive attacker is independent of the channel sample of the legal terminal; the embodiment of the present application assumes that the passive attacker is fully aware of the key generation method adopted by the legal terminal; in addition, the embodiment of the present application only focuses on passive attackers, that is, attackers who only perform passive eavesdropping, and does not consider active attackers who interfere with the key generation process or tamper with the information exchanged between legal terminals.
[0070] As a possible implementation, see Figure 1 The embodiment of the present application provides a method for generating a physical layer key based on adaptive non-uniform segmentation and tree-like layer sequence matching, comprising the following steps:
[0071] Step 1: Channel detection: Terminal A and terminal B respectively perform alternate detection on the channel between them to generate the first channel sample sequence of terminal A and terminal B;
[0072] Step 2: Adaptive segment generation with enhanced difference: Terminal A uses a sliding window mechanism to dynamically divide the first channel sample sequence of terminal A according to the local channel characteristics of its first channel sample in the current window, obtains several sequence segments of the first channel sample, and generates the second channel sample sequence of terminal A based on all the sequence segments;
[0073] Step 3: abnormal segment identification and calibration. Terminal A determines the sequence segment pair with a distance less than or equal to the preset distance in the second channel sample sequence as an abnormal segment, calibrates the abnormal segment through a random value, obtains the calibrated channel sample segment of terminal A, sequentially concatenates the calibrated channel sample segments to obtain the third channel sample sequence of terminal A, and sends the calibration information to terminal B using a random matrix confusion method; terminal B obtains the calibrated channel sample sequence of terminal B based on its first channel sample sequence and the received calibration information;
[0074] Step 4: Random segmentation rearrangement: Terminal A generates a random rearrangement sequence of a predetermined length, the length of which is used to characterize the number of segments of the third channel sample sequence; based on the random rearrangement sequence, the sequence segments of the third channel sample sequence are randomly rearranged, and the randomly rearranged sequence segments are sequentially concatenated to obtain the fourth channel sample sequence of terminal A and send it to terminal B;
[0075] Step 5: Dynamic path perception and tree-like hierarchical matching key generation algorithm. Terminal B uses dynamic path perception and tree-like hierarchical matching key generation algorithm to perform hierarchical matching on the calibrated channel sample sequence of terminal B and the fourth channel sample sequence of terminal A, and generates a key based on the matching result.
[0076] In one embodiment, in step 1 of the embodiment of the present application, the specific process of channel detection includes:
[0077] Step 101: Terminal A and terminal B perform alternate detection of the channel between them during the channel coherence time of terminal A and terminal B, and until both terminal A and terminal B have collected a certain number of channel samples, and the first channel sample sequences collected by terminal A and terminal B are recorded as and ;in, is the first channel sample sequence of terminal A, is the first channel sample sequence of terminal B, Indicates the length of the first channel sample sequence of the terminal.
[0078] In one embodiment, the step of generating adaptive segments with enhanced differences in step 2 of the embodiment of the present application includes:
[0079] Step 201: Terminal A sets a segment length range , and the first channel sample sequence of terminal A The first channel sample of the current segment position is taken as the current segment position, within the segment length range A length value is randomly selected as the first length, and the first candidate segment is generated based on the first length , so that its length is the first length, and the candidate segment As the first segment of the second channel sample sequence of terminal A, it is expressed as ;
[0080] Then adjust the current segment position to the first segment The last channel sample of the first channel sample sequence of terminal A Position in
[0081] Step 202: Terminal A obtains a first channel sample sequence from terminal A. Starting from the second channel sample in, the segment length does not exceed A series of candidate segments, calculate each candidate segment and the second channel sample sequence of terminal A The dynamic time warping distance between each segment in the , and record its minimum dynamic time warping distance ( ). Terminal A selects the minimum dynamic time warping distance from a series of candidate segments The candidate segment with the largest value Add the second channel sample sequence of terminal A ,Right now , and adjust the current segment position to the selected candidate segment The last sample in the first channel sample sequence of terminal A Position in
[0082] In this step, for example, the current first channel sample sequence is ,set up , which means that the segment length ranges from arrive , then two candidate segments are generated, and the current segment position is element The candidate segments that meet the length requirements are generated in sequence. and .
[0083] Step 2.3: Terminal A repeats the segmentation process of step 202 until the first channel sample sequence of terminal A is is completely divided, and the second channel sample sequence of terminal A is obtained .in, Represents the second channel sample sequence The number of segments included, such as Figure 1 In , an example with 4 segments is given.
[0084] Step 2 can be formally defined by the following objective function:
[0085]
[0086] in, Representation sequence No. Segments With Segments The dynamic time warping distance between them.
[0087] In one embodiment, the abnormal segmentation identification and calibration step in step 3 of the embodiment of the present application includes:
[0088] Step 301: Terminal A calculates its second channel sample sequence The dynamic time warping distance between two segments is less than or equal to the preset distance threshold. The segment pairs As the abnormal segment that needs to be calibrated, , ;
[0089] Step 302: For the abnormal segments that need to be calibrated, terminal A randomly selects one of the segments , and replace any channel sample therein with a uniformly distributed random number, wherein the minimum value of the uniform distribution is set to the minimum value of the abnormal segment, and the maximum value of the uniform distribution is set to the maximum value of the abnormal segment;
[0090] Step 303: Terminal A repeats steps 301 to 302 until the second channel sample sequence of terminal A is The dynamic time warping distance between all segments in exceeds the preset distance threshold Stop when , and get the channel sample segment after terminal A calibration ;
[0091] Step 304: Terminal A segments the channel samples calibrated by Terminal A Zero mean, and then concatenate the calibrated channel sample segments in sequence to obtain the third channel sample sequence of terminal A ;
[0092] Terminal A generates the dimension Random Gaussian Matrix , and according to the formula Calculate the offset vector ;in, represents the first channel sample sequence of terminal A, is the length of the first channel sample sequence; represents the third channel sample sequence of terminal A;
[0093] Furthermore, terminal A converts the random Gaussian matrix and the offset vector Sent to terminal B as calibration information;
[0094] Step 305: After receiving the random Gaussian matrix and the offset vector After that, terminal B uses the first channel sample sequence of terminal B According to the formula Reconstruct the calibrated channel sample sequence ; Based on channel reciprocity, the channel sample sequence after terminal B calibration is Approximately the channel sample sequence after terminal A calibration , so that terminal B completes the abnormal segment calibration in the same way.
[0095] In one embodiment, the step of random segment rearrangement in step 4 of the embodiment of the present application is: terminal A generates a arrive Randomly rearranged sequence , based on the random rearrangement sequence Segment the calibrated channel samples Perform random rearrangement and obtain the channel sample segment after rearrangement by terminal A , concatenation Each segment in obtains the fourth channel sample sequence of terminal A And send it to terminal B.
[0096] In one embodiment, the steps of dynamic path awareness and tree-level order matching key generation in step 5 of the embodiment of the present application are:
[0097] Step 501: Terminal B calculates the channel sample sequence after terminal B calibration and the fourth channel sample sequence of terminal A The Euclidean distance between samples at the same position in , and the minimum and maximum values are recorded as , ; and calculate the current dynamic threshold based on the two ;in, represents the threshold scaling factor, and .
[0098] Step 502: Terminal B determines the value of the dynamic threshold value. Channel sample sequence after calibration of terminal B and the fourth channel sample sequence of terminal A Perform matching processing. If the Euclidean distance between the channel samples at the current position is less than or equal to , then the current channel sample pair is considered to match, and its channel sample index is recorded, using a subarray Record the channel sample index of the matching channel sample pair at the current position, where the subscript is used to characterize each position index, and , is the length of the first channel sample sequence; if for the current position, there is no Euclidean distance less than or equal to The channel sample pairs, then the subarray Empty; Based on Subarray Get the index array ;
[0099] It should be noted that the dynamic threshold in step 501 The corresponding increase or decrease adjustment can also be made according to the sample matching situation of terminal B in step 502 in the actual wireless environment. For example, if the index array If there are a large number of empty subarray elements in the , the dynamic threshold can be increased accordingly The value of can contain more sample matches, and if the index array If the neutron array contains too many elements, the dynamic threshold can be reduced accordingly. to speed up the subsequent recursive process; that is, when the number of empty elements exceeds the set empty element threshold, the dynamic threshold is increased The value of (e.g., increasing by a specified step size, for example, by adjusting the threshold scaling factor When the number of elements contained exceeds the set element number threshold, the dynamic threshold is lowered The value of can also be decreased by a specified step size.
[0100] Step 503: Terminal B discards the index array The subarray in is an empty element and indexes the array The continuous indexes contained in the neutron array are combined into segments, and then based on the starting index of each segment and end index Get the segment interval of the current segment , based on the segmented intervals of all segments, we get the interval sequence ,in Indicates The starting and ending indexes of the segments, , represents the number of intervals, , ;
[0101] Step 504: Terminal B constructs a range hash table To record a continuous set of intervals, recursively construct a hash table based on the interval from the starting index To end index Several continuous intervals of , represented as interval sets ;
[0102] Step 505: Terminal B sets the interval The fourth channel sample sequence of terminal A Segment and get the first segment array of terminal B ; Terminal B is based on the first segment array and index array , the fourth channel sample sequence of terminal A The index of the matched channel sample in is mapped to the channel sample sequence after calibration by terminal B The index in Segment and get the second segment array ; Then, terminal B will The segment index in is used as the initial key, expressed as ;
[0103] Step 506: Terminal B uses the first segment array Constructing a complete binary tree , where complete binary tree No. Leaf nodes save The Channel sample segment , , whose parent node stores the merge of the channel sample segments in the corresponding leaf node. Terminal B repeats the above construction method until the root node, and the height is Complete binary tree of ,in Indicates floor rounding operation, parameter The value of is the length of the random rearrangement sequence of terminal A; similarly, terminal B follows the same complete binary tree construction method, based on the second segment array Constructing a complete binary tree ;
[0104] Terminal B complete binary tree and No. The branch nodes from the first layer to the second layer are matched in order, and the initial key of terminal B is concatenated. Match the results with the layer sequence between layers to generate the key for communicating with terminal A ;
[0105] The above sequence matching can be expressed as: layer, , the number of branch nodes can be calculated as , complete binary tree The node set is , among which Nodes by Middle Layer and The node strings are connected and obtained, which is expressed as For the layer, the number of leaf nodes is , complete binary tree The node set is ;
[0106] Similarly, for the layer, , complete binary tree The node set is , among which Nodes by Middle Layer and The node strings are connected and obtained, which is expressed as For the layer, the number of leaf nodes is , complete binary tree The node set is ;
[0107] Terminal B for a complete binary tree and No. The objective function of layer order matching is:
[0108]
[0109] in Indicates that terminal B inferred The layer order matching result of the layer, For arrive A random sequence of Elements satisfy ;
[0110] After the complete binary tree and From The order of layers from layer 1 to layer 2 matches, and terminal B forms a key to communicate with terminal A. .
[0111] Step 507: Similar to step 506, terminal A uses the rearranged channel sample segment and the channel sample segmentation after calibration with terminal A Construct a complete binary tree, denoted as and , and for The branch nodes from the first layer to the second layer are matched in order, and their random rearrangement sequences are connected in series. The matching results between each layer form the key for communicating with terminal B ,in Represents a complete binary tree and No. The layer order matching result of the layer, .
[0112] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A physical layer key generation method based on adaptive non-uniform segmentation and tree-like layer order matching, characterized in that: The following steps are involved: Step 1: Terminal A and terminal B respectively perform alternate detection on the channel between them to generate first channel sample sequences of terminal A and terminal B with the same sequence length; Step 2: Terminal A adopts a sliding window mechanism to perform adaptive non-uniform segmentation processing according to the local channel characteristics of its first channel sample in the current window, obtains several sequence segments of the first channel sample, and generates a second channel sample sequence of terminal A based on all the sequence segments; Step 3: Based on the adopted sequence segment distance measurement method, terminal A determines the sequence segment pairs whose distance in its second channel sample sequence is less than or equal to the preset distance threshold as abnormal segments; and calibrates the abnormal segments based on the random value to obtain the calibrated channel sample segments of terminal A, and sequentially concatenates the calibrated channel sample segments to obtain the third channel sample sequence of terminal A; Terminal A generates calibration information based on its first channel sample sequence and third channel sample sequence, and then sends the calibration information to terminal B using a random matrix confusion method; Terminal B reconstructs its calibrated channel sample sequence based on its first channel sample sequence and the received calibration information; Step 4: Terminal A generates a random rearrangement sequence of a predetermined length, the length of which is used to characterize the number of segments of the third channel sample sequence; based on the random rearrangement sequence, the sequence segments of the third channel sample sequence are randomly rearranged, and the randomly rearranged sequence segments are sequentially concatenated to obtain the fourth channel sample sequence of terminal A and send it to terminal B; Step 5: Terminal B uses dynamic path perception and tree-like hierarchical matching key generation algorithm to perform hierarchical matching on the calibrated channel sample sequence of terminal B and the fourth channel sample sequence of terminal A, and generates a key based on the matching result.
2. A method for generating a physical layer key based on adaptive non-uniform segmentation and tree-like layer sequence matching as claimed in claim 1, characterized in that: In step 2, the local channel characteristics of the first channel sample of terminal A in the current window are obtained based on the dynamic time warping distance.
3. A method for generating a physical layer key based on adaptive non-uniform segmentation and tree-like layer sequence matching as claimed in claim 1, characterized in that: Step 2 specifically includes: Step 201, taking the first channel sample of the first channel sample sequence of terminal A as the current segment position; Based on the segment length range you set , randomly select a length value as the first length; Based on the first length, a candidate segment with a segment length of the first length is generated, and the starting position of the candidate segment is the current segment position; and the candidate segment is used as the first segment of the second channel sample sequence of terminal A; Then, the current segment position is adjusted to the position of the last channel sample of the first segment in the first channel sample sequence of terminal A; Step 202, starting from the second channel sample of the first channel sample sequence of terminal A, traverse each channel sample in turn, and perform segment processing on each channel sample of the first channel sample sequence in turn: The current segment position is used as the starting position of the candidate segment of the current channel sample, and each candidate segment that falls within the segment length range is The segment length value is taken, and a candidate segment corresponding to the segment length value is generated respectively, so as to obtain several candidate segments of the current channel sample; and the dynamic time warping distance between each candidate segment and each segment in the second channel sample sequence of terminal A is calculated, and the minimum value is found to obtain the minimum dynamic time warping distance of the current candidate segment; then the candidate segment corresponding to the maximum of the minimum dynamic time warping distances of all the candidate segments currently generated is taken as the optimal candidate segment, and it is added to the second channel sample sequence of terminal A; at the same time, the current segment position is adjusted to the position of the last channel sample of the current optimal candidate segment in the first channel sample sequence of terminal A.
4. A method for generating a physical layer key based on adaptive non-uniform segmentation and tree-like layer sequence matching as claimed in claim 1, characterized in that: In step 3, the sequence segment distance measurement method used is dynamic time warping distance.
5. A method for generating a physical layer key based on adaptive non-uniform segmentation and tree-like layer sequence matching as claimed in claim 4, characterized in that: In step 3, terminal A determines a sequence segment pair whose distance in its second channel sample sequence is less than or equal to a preset distance threshold as an abnormal segment; and calibrates the abnormal segment based on a random value to obtain a calibrated channel sample segment of terminal A, and sequentially concatenates the calibrated channel sample segments to obtain a third channel sample sequence of terminal A, specifically including: Step 301: Terminal A calculates the dynamic time warping distance between two segments in its second channel sample sequence, and determines the sequence segment pairs whose dynamic time warping distance is less than or equal to a preset distance threshold as abnormal segments; Step 302: for a pair of sequence segments whose current distance is less than or equal to a preset distance threshold, randomly select one of the sequence segments as a target segment, and replace any channel sample in the target segment with a uniformly distributed random number; wherein the minimum value of the uniform distribution is set as the minimum value of the target segment, and the maximum value of the uniform distribution is set as the maximum value of the target segment; Step 303, based on the adjusted target segmentation, repeat steps 301~302 until the dynamic time warping distances between all segments in the second channel sample sequence of terminal A exceed the preset distance threshold, and then obtain the calibrated channel sample segmentation based on all current segments, and concatenate the calibrated channel sample segments in sequence to obtain the third channel sample sequence of terminal A.
6. A method for generating a physical layer key based on adaptive non-uniform segmentation and tree-like layer sequence matching as claimed in claim 5, characterized in that: Step 303 also includes: performing zero-mean conversion on the calibrated channel sample segments of terminal A, and then sequentially concatenating the calibrated channel sample segments to obtain a third channel sample sequence of terminal A.
7. A method for generating a physical layer key based on adaptive non-uniform segmentation and tree-like layer sequence matching as claimed in claim 6, characterized in that: In step 3, the calibration information is specifically: Terminal A generates the dimension Random Gaussian Matrix , and according to the formula Calculate the offset vector ;in, represents the first channel sample sequence of terminal A, is the length of the first channel sample sequence; represents the third channel sample sequence of terminal A; Terminal A converts the random Gaussian matrix and the offset vector as calibration information.
8. A method for generating a physical layer key based on adaptive non-uniform segmentation and tree-like layer sequence matching as claimed in claim 7, characterized in that: In step 3, the calibrated channel sample sequence is specifically: Terminal B according to the formula Reconstruct the calibrated channel sample sequence ; in, Represents the first channel sample sequence of terminal B.
9. A method for generating a physical layer key based on adaptive non-uniform segmentation and tree-like layer sequence matching as claimed in claim 1, characterized in that: Step 5 specifically includes: Step 501: Terminal B calculates the Euclidean distance between the channel sample sequence after calibration of terminal B and the channel samples at the same position in the fourth channel sample sequence of terminal A, and records the minimum and maximum values thereof as , ; and calculate the current dynamic threshold based on the two ,in, represents the threshold scaling factor, and ; Step 502: Terminal B determines the value of the dynamic threshold value. Match the calibrated channel sample sequence of terminal B with the fourth channel sample sequence of terminal A. If the Euclidean distance between the channel samples at the current position is less than or equal to , then the current channel sample pair is considered to match, and its channel sample index is recorded, using a subarray Record the channel sample index of the matching channel sample pair at the current position, where the subscript is used to characterize each position index, and , is the length of the first channel sample sequence; if for the current position, there is no Euclidean distance less than or equal to The channel sample pairs, then the subarray Empty; Based on Subarray Get the index array ; Step 503: Terminal B discards the index array The subarray in is an empty element and indexes the array The continuous indexes contained in the neutron array are combined into segments, and then based on the starting index of each segment and end index Get the segment interval of the current segment , based on the segmented intervals of all segments, we get the interval sequence ,in Indicates The starting and ending indexes of the segments, , represents the number of intervals, , ; Step 504: Terminal B constructs a range hash table To record a continuous set of intervals, recursively construct a hash table based on the interval from the starting index To end index The interval set of ; Step 505: Terminal B segments the constructed interval set based on the fourth channel sample sequence of terminal A to obtain a first segment array; Terminal B is based on the first segment array and index array , mapping the index of the matched channel sample in the fourth channel sample sequence of terminal A to the index in the calibrated channel sample sequence of terminal B to obtain a second segment array; The number of segments of the first and second segment arrays is the same, and the value thereof is consistent with the length of the random rearrangement sequence of terminal A; Step 506: Terminal B generates a key for communicating with Terminal A based on tree-like hierarchical matching. : Terminal B uses the segment indexes of the second segment array as its initial key; Terminal B constructs a complete binary tree based on the first segment array , where complete binary tree A single leaf node is used to represent each segment in the first segment array, and the parent node saves the merge of the segments represented by the corresponding leaf node, a complete binary tree The height is ,in Indicates floor rounding operation, parameter The value of is the length of the random rearrangement sequence of terminal A; Terminal B builds a complete binary tree based on the second segment array , where complete binary tree A single leaf node is used to represent each segment in the first segment array, and the parent node saves the merge of the segments represented by the corresponding leaf node, a complete binary tree The height is ; Terminal B complete binary tree and No. The branch nodes from the first layer to the second layer are matched in order, and the initial key of terminal B is connected in series with the order matching results between each layer to generate the key for communication with terminal A. ; Step 507: Terminal A generates a key for communicating with terminal B based on tree-like hierarchical matching. : Terminal A constructs a complete binary tree based on all randomly rearranged sequence segments , where complete binary tree A single leaf node is used to represent each randomly rearranged sequence segment of terminal A, and the parent node saves the merge of the sequence segments represented by the corresponding leaf node. The height is ; Terminal A constructs a complete binary tree based on its calibrated channel sample segments , where complete binary tree A single leaf node is used to represent a single calibrated channel sample segment, and the parent node saves the merge of the segments represented by the corresponding leaf node, a complete binary tree The height is ; Terminal A complete binary tree and No. The branch nodes from the first layer to the second layer are matched in order, and the random rearrangement sequence of terminal A is connected in series with the order matching results between each layer to generate the local key for communication with terminal B. .
10. A method for generating a physical layer key based on adaptive non-uniform segmentation and tree-like layer sequence matching as claimed in claim 1, characterized in that: Step 502 also includes: Based on index array Dynamic Threshold To make adaptive adjustments: If the index array If the number of empty sub-arrays in exceeds the first threshold, the dynamic threshold is increased. The value of If the index array If the number of non-empty sub-arrays in exceeds the set second threshold, the dynamic threshold is lowered The value of .
Citation Information
Patent Citations
Scientific research data privacy protection enhancement method and system for wireless network environment
CN113473420A
Physical layer identity authentication method based on channel key and label signal
CN114640442A