WIFI signal decoding method and device, detection equipment and storage medium
By performing cross-correlation calculations between the WIFI signal and the preset preamble in the detection device, the position of the preamble and the identification information are determined, solving the problem that the detection device cannot distinguish the WIFI signal transmission source in the existing technology, and realizing efficient drone detection and identification.
Patent Information
- Application Number
- CN202511561784.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-01-23
AI Technical Summary
Existing detection equipment cannot effectively distinguish the source of WIFI signals, resulting in the need to decode a large number of WIFI signals, which requires a large amount of computation and makes the detection performance of the equipment poor when detecting drone targets.
By performing cross-correlation calculations between the pre-set preamble and the WIFI signal sent by the target device, the position of the preamble is determined, thereby obtaining the identification information and MAC address of the target device. Based on the identification information, the device type is determined, and targeted decoding is performed.
It effectively reduces the computational load of detection equipment and improves the detection efficiency and identification accuracy of UAV targets.
Smart Images

Figure CN121397472A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a WIFI signal decoding method, a WIFI signal decoding device, a detection device, and a computer-readable storage medium. Background Technology
[0002] With the rapid development and popularization of drones, their application areas are constantly expanding, and they have penetrated into many different scenarios such as logistics and distribution, environmental monitoring, security patrol, and entertainment aerial photography. At the same time, the security risks, privacy threats and economic losses caused by the misuse of drones are rising sharply, which makes drone detection technology and countermeasures equipment a hot trend at the forefront of technology.
[0003] For drones that transmit data or images via Wi-Fi signals, detection devices can detect and identify them by collecting and decoding the Wi-Fi signals sent by the drone. However, due to the low cost and high efficiency of Wi-Fi technology, it has become a standard service in various public places. Existing detection devices cannot distinguish the source of the collected Wi-Fi signals, requiring them to analyze a large number of Wi-Fi signals in the environment to find the drone's signal and thus detect it. This results in poor drone target detection performance for these devices. Summary of the Invention
[0004] In view of the above problems, this application provides a WIFI signal decoding method, a WIFI signal decoding device, a detection device, and a computer-readable storage medium to solve the problem of poor detection performance of detection devices for UAV targets in the prior art.
[0005] According to a first aspect of the embodiments of this application, a method for decoding a Wi-Fi signal is provided. The method includes: acquiring a preset preamble and a Wi-Fi signal sent by a target device; performing cross-correlation calculation on the Wi-Fi signal and the preset preamble, and determining the position of the preamble in the Wi-Fi signal based on the calculation result; acquiring identification information corresponding to the target device from the Wi-Fi signal based on the preamble position; comparing the identification information corresponding to the target device with preset identification information to determine the target device type; if the target device type matches the preset device type, decoding the Wi-Fi signal based on the preamble position to obtain the MAC address corresponding to the target device.
[0006] In one optional approach, the identification information corresponding to the target device is obtained from the WIFI signal based on the preamble position. Specifically, this includes: demapping the WIFI signal to generate a bit stream corresponding to the WIFI signal; extracting data frames from the bit stream based on the preamble position and a preset positional relationship to obtain the identification information corresponding to the target device. The positional relationship is used to characterize the positional relationship between the data frame corresponding to the preamble and the data frame corresponding to the identification information in the bit stream.
[0007] In one optional approach, multiple preset preambles are used, and each preset preamble has corresponding protocol information. The process involves cross-correlation calculations between the Wi-Fi signal and the preset preambles, and determining the preamble position in the Wi-Fi signal based on the calculation results. Specifically, this includes: performing cross-correlation calculations between the Wi-Fi signal and each preset preamble, and recording the peak data corresponding to each preset preamble; determining the target preamble from the multiple preset preambles based on the peak data corresponding to each preset preamble; determining the protocol information corresponding to the target preamble as the target protocol, and determining the preamble position in the Wi-Fi signal based on the peak data corresponding to the target preamble; and decoding the Wi-Fi signal based on the preamble position to obtain the MAC address corresponding to the target device. Specifically, this includes: decoding the Wi-Fi signal based on the target protocol and the preamble position to obtain the MAC address corresponding to the target device.
[0008] In one optional approach, a cross-correlation calculation is performed between the WIFI signal and a preset preamble, and the position of the preamble in the WIFI signal is determined based on the calculation result. Specifically, this includes: determining a sliding window based on the length of the preset preamble; traversing the WIFI signal through the sliding window and performing a cross-correlation calculation between the signal segment within each sliding window and the preset preamble to generate a correlation value sequence between the WIFI signal and the preset preamble; analyzing the correlation value sequence to obtain the peak points of the correlation value sequence; and determining the position corresponding to the peak point where the peak value is greater than a preset threshold as the preamble position in the WIFI signal.
[0009] In one alternative approach, the WIFI signal is traversed through a sliding window, and the signal segment within each sliding window is cross-correlated with a preset preamble. Specifically, for each signal segment within the sliding window, the following steps are performed: the mean and variance of the signal segment within the sliding window are calculated; the signal segment within the sliding window is normalized based on the mean and variance to obtain the target signal segment; and the target signal segment is cross-correlated with the preset preamble to obtain the correlation coefficient between the target signal segment and the preset preamble.
[0010] In one optional approach, cross-correlation calculation is performed between the target signal segment and the preset preamble to obtain the correlation coefficient between the target signal segment and the preset preamble. Specifically, this includes: calculating the correlation value between the target signal segment and the preset preamble based on the target signal segment, the preset preamble, and the length of the preset preamble; calculating the variance between the target signal segment and the preset preamble based on the target signal segment and the preset preamble, and determining a correction coefficient based on the variance; and determining the correlation coefficient between the target signal segment and the preset preamble segment based on the correlation value and the correction coefficient.
[0011] In one alternative approach, the correlation value between the target signal segment and the preset preamble is calculated based on the target signal segment, the preset preamble, and the length of the preset preamble. Specifically, this includes: taking the conjugate of the preset preamble and calculating the product between the target signal segment and the conjugate preset preamble; dividing the product by the length of the preset preamble to obtain the correlation value between the target signal segment and the preset preamble.
[0012] According to a second aspect of the embodiments of this application, a WIFI signal decoding device is provided, comprising: a signal acquisition module, configured to acquire a preset preamble and a WIFI signal sent by a target device; a preamble position determination module, configured to perform cross-correlation calculation on the WIFI signal and the preset preamble, and determine the position of the preamble in the WIFI signal based on the calculation result; an identification information acquisition module, configured to acquire identification information corresponding to the target device from the WIFI signal based on the preamble position; a comparison module, configured to compare the identification information corresponding to the target device with preset identification information to determine the target device type; and a decoding module, configured to decode the WIFI signal based on the preamble position when the target device type matches the preset device type, to obtain the MAC address corresponding to the target device.
[0013] According to a third aspect of the embodiments of this application, a detection device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the WIFI signal decoding method described in any of the preceding claims.
[0014] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the WIFI signal decoding method described in any of the preceding claims.
[0015] This application embodiment determines the position of the preamble in the WIFI signal by performing cross-correlation calculation on the WIFI signal sent by the target device and a preset preamble. Then, based on the position of the preamble, it obtains the identification information corresponding to the target device from the WIFI signal. Based on the identification information corresponding to the target device, it determines the type of target device. Thus, based on the target device type, it determines what type of device the WIFI signal detected by the detection device comes from. This enables the detection device to specifically decode the collected WIFI signal to obtain the MAC address of the target device, thereby realizing the detection and identification of the target device. The detection device can filter a large number of WIFI signals in the environment based on the target device type, effectively reducing the computational load of the detection device and improving the detection efficiency of the detection device.
[0016] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description
[0017] The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart illustrating the WIFI signal decoding method provided in an embodiment of this application is shown; Figure 2 This illustration shows a schematic diagram of the data packet structure of a WIFI signal according to an embodiment of this application; Figure 3 A graph illustrating the preset preamble involved in the embodiments of this application is shown; Figure 4 This paper presents a correlation curve between a WIFI signal and a preset preamble provided in an embodiment of this application. Figure 5 A graph illustrating the WIFI signal involved in an embodiment of this application is shown; Figure 6 This paper presents another correlation curve between the WIFI signal and the preset preamble provided in an embodiment of this application; Figure 7 A schematic diagram of the structure of the WIFI signal decoding device provided in an embodiment of this application is shown; Figure 8 A schematic diagram of the detection device provided in an embodiment of this application is shown. Detailed Implementation
[0018] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein.
[0019] Wi-Fi is a wireless local area network technology that allows devices to communicate interconnectedly without a physical connection. Detection devices can detect and identify targets by collecting and decoding Wi-Fi signals to obtain the MAC address carried within them. Taking drone detection as an example, drones need to transmit data and images via Wi-Fi signals. Detection devices integrate Wi-Fi chips to detect the data and image transmission link signals (i.e., Wi-Fi signals) of the drone. By decoding the drone's Wi-Fi signals, the MAC address of the drone can be obtained, thus enabling the detection and identification of the drone.
[0020] With the development of Wi-Fi technology, as a low-cost, high-efficiency local area network solution, it has penetrated into people's lives and work, much like electricity, and is widely deployed in public places such as libraries, schools, shopping malls, factories, and industrial parks. This means that when detection equipment collects Wi-Fi signals from drones, it also collects a large number of Wi-Fi signals from other devices. Furthermore, because existing detection equipment cannot distinguish the source of the Wi-Fi signals, it needs to decode a large number of signals to obtain the corresponding MAC addresses, and then analyze these MAC addresses to extract the drone's MAC address for detection and identification. This results in a high computational load for the detection equipment and relatively low drone detection efficiency.
[0021] Based on this, in order to improve the detection efficiency of detection equipment for drones, this application provides a WIFI signal decoding method. After the detection equipment obtains the WIFI signal sent by the target device, it first analyzes the WIFI signal to determine the position of the preamble in the WIFI signal, then obtains the identification information corresponding to the target device from the WIFI signal based on the position of the preamble, and finally compares the identification information corresponding to the target device with preset identification information to determine whether the target device is the target detected by the detection equipment. If so, the obtained WIFI signal is decoded to obtain the MAC address of the target device from the WIFI signal, thereby completing the detection and identification of the target device.
[0022] In this approach, the detection device can determine the device type of the target device by acquiring the identification information in the WIFI signal. This allows the detection device to distinguish which WIFI signals it detects come from the drone and which come from other devices. In other words, the detection device can filter out the WIFI signal corresponding to the drone from a large number of collected WIFI signals based on the identification information, thereby decoding the WIFI signal from the drone more effectively and completing the detection and identification of the drone. This effectively reduces the computational load of the detection device and improves the efficiency of drone detection.
[0023] Of course, the WIFI signal decoding method provided in this application can not only decode the WIFI signals of drones, but also detect and identify other targets with the same characteristics, that is, targets whose WIFI signals carry specific identification information. For ease of explanation, the following embodiments only use drone detection as an example.
[0024] According to a first aspect of the embodiments of this application, a method for decoding WIFI signals is provided. Figure 1 A flowchart of a WIFI signal decoding method provided in an embodiment of this application is shown. This method is executed by a detection device, which listens to and analyzes WIFI signals in the environment, and identifies information such as the device type and MAC address of the target device from the WIFI signals. Figure 1 As shown, the method includes the following steps: Step S100: Obtain the preset preamble and the WIFI signal sent by the target device.
[0025] The target device is any device capable of transmitting Wi-Fi signals, such as a router, in-vehicle Wi-Fi router, or drone. The Wi-Fi signal transmitted by the target device typically carries data including a preamble, identification information, a MAC header, and a payload. The preamble is a fixed, known sequence appended to the beginning of each actual data packet in the Wi-Fi signal. It is used to synchronize the clocks of the sender and receiver and to help the receiver adjust signal gain and perform channel estimation.
[0026] Furthermore, preambles can also serve a positioning function, such as... Figure 2 As shown, Figure 2The diagram illustrates the data packet structure of a Wi-Fi signal. The data carried by a Wi-Fi signal is typically arranged in the order of preamble, identification information, header structure, MAC frame header, and payload. The lengths of the preamble, identification information, and header structure are fixed. During the decoding process of a Wi-Fi signal, once the position of the preamble is determined, the specific positions of the identification information, MAC frame header, payload, and other data within the Wi-Fi signal can be determined based on the position of the preamble. This allows the detection device to decode the sequence at the corresponding positions in the Wi-Fi signal, accurately obtaining the MAC address, transmitted data, or images carried by the Wi-Fi signal.
[0027] As an example, when demodulating a Wi-Fi signal, it's necessary to first determine the position of the preamble in the Wi-Fi signal, and then extract the header structure from the signal based on the preamble position. This header structure includes data frames such as Signal, Service, Length, and CRC. The Signal segment indicates the data rate. Taking a drone using the Wi-Fi b protocol as an example, this data rate can be 1 Mbps or 2 Mbps. 1 Mbps corresponds to DBPSK modulation, while 2 Mbps corresponds to DQPSK modulation. The detection device can determine the modulation scheme of the Wi-Fi signal through the Signal segment, and thus determine the demodulation method based on the modulation scheme. Furthermore, the Length segment indicates the length of the MAC frame header (in bytes). After obtaining the header structure, the detection device can accurately extract the MAC frame header from the Wi-Fi signal based on the information corresponding to the Length segment, and then obtain the target device's MAC address by demodulating the MAC frame header.
[0028] Step S200: Perform cross-correlation calculation between the WIFI signal and the preset preamble, and determine the position of the preamble in the WIFI signal based on the calculation result.
[0029] Among them, such as Figure 3 As shown, Figure 3 A graph of the preset preamble is shown, in which... Figure 3 The horizontal axis of the curve represents the number of sampling points, and the vertical axis represents the amplitude. Since the preamble is a fixed and known sequence, the detection device generates a corresponding preset preamble (i.e., based on the characteristics of the preamble in the WIFI signal) in advance. Figure 3The curve shown is illustrated in the graph. The shape of the curve representing the location of the preamble in the Wi-Fi signal should be approximately the same as the shape of the curve representing the preset preamble. Therefore, the detection device can determine the location of the preamble in the Wi-Fi signal by calculating the similarity between the preset preamble and the Wi-Fi signal. As an example, the detection device can measure the similarity between the Wi-Fi signal and the preset preamble through cross-correlation calculations. Specifically, methods such as Pearson correlation coefficient, spectral cosine similarity, and coherence can be used to calculate the similarity between the Wi-Fi signal and the preset preamble. The location where the similarity is greater than a preset threshold is then determined as the location of the preamble in the Wi-Fi signal.
[0030] Specifically, the detection device can use a sliding cross-correlation method to calculate the similarity between the preset preamble and the signal segments at various locations on the WIFI signal, thereby determining the position of the preamble in the WIFI signal based on the cross-correlation calculation results. That is, step S200 may include the following steps (steps S210 to S220): Step S210: Determine the sliding window based on the length of the preset preamble.
[0031] Step S220: Traverse the WIFI signal through a sliding window, and perform cross-correlation calculation between the signal segment in each sliding window and the preset preamble to generate a correlation value sequence between the WIFI signal and the preset preamble.
[0032] Step S230: Analyze the correlation value sequence and obtain the peak points of the correlation value sequence.
[0033] Step S240: Determine the position corresponding to the peak point where the peak value is greater than the preset threshold as the preamble position in the WIFI signal.
[0034] The detection device first determines the sliding window based on the length of the preset preamble, and sets the length of the sliding window to be equal to the length of the preset preamble. This ensures that when the sliding window traverses the WIFI signal, it can completely capture the preamble on the WIFI signal, thus ensuring the accuracy of the cross-correlation calculation results.
[0035] Next, a sliding window is used to traverse the Wi-Fi signal, and the signal segment within each sliding window is cross-correlated with a preset preamble to generate a correlation value sequence between the Wi-Fi signal and the preset preamble. For details, please refer to [link to relevant documentation]. Figure 4 , Figure 4The diagram shows the correlation curve between the Wi-Fi signal and the preset preamble, where the horizontal axis represents the number of sampling points and the vertical axis represents the correlation value. Specifically, the sliding window can traverse the Wi-Fi signal at a specific step size, and correlate the signal captured at each step with the preset preamble to obtain the correlation value corresponding to the signal at that position, i.e., the correlation value corresponding to the first sampling point within the sliding window. After traversing the entire Wi-Fi signal, the correlation value sequence corresponding to each Wi-Fi signal can be obtained.
[0036] by Figure 3 Taking the preset preamble as an example, the length of the preset preamble is approximately 52. Therefore, the length of the sliding window can be set to 52, and the step size can be set to 1. First, the sliding window starts from... Figure 5 The WIFI signal shown (where, Figure 5 The signal segment with an abscissa of 0 to 51 is extracted from the graph (where the x-axis represents the number of sampling points and the y-axis represents the amplitude), and this signal segment is compared with... Figure 3 The preset preamble is cross-correlation calculated to obtain the similarity between the signal segment and the preset preamble. Figure 4 The vertical coordinate value of the position where the horizontal coordinate is 0 in the relevant curve shown; then move the sliding window one step to the right, so that the value can be obtained from the position where the horizontal coordinate is 0 in the relevant curve shown in the curve. Figure 5 The signal segment with an abscissa of 1 to 52 is extracted from the WIFI signal shown, and then this signal segment is compared with... Figure 3 The preset preamble is cross-correlation calculated to obtain the similarity between the signal segment and the preset preamble. Figure 4 The vertical coordinate value of the position where the horizontal axis is 1 in the correlation curve shown; and so on, the original signal is traversed by a sliding window, and the similarity between the signal segment in each sliding window and the preset preamble is calculated to generate a correlation value sequence corresponding to the WIFI signal and the preset preamble, that is... Figure 4 The relevant curves are shown.
[0037] Finally, the correlation value sequence was analyzed, and the positions corresponding to the peak points in the correlation value sequence whose peak values exceeded a preset threshold were determined as the positions of the preamble in the WIFI signal. Figure 4 Taking the correlation curve shown as an example, the preset threshold can be set to 0.9. Then, the location of the peak point in the correlation value sequence where the peak value is greater than 0.9 is the preamble position in the WIFI signal. For example, Figure 4 The peak values of the correlation curve at positions such as approximately 55, 105, and 155 on the horizontal axis are all greater than 0.9, so these positions can be considered as the locations of the preamble in the WIFI signal.
[0038] Through steps S210 to S240, the WIFI signal is traversed using a sliding window approach. Then, the signal within each sliding window is cross-correlated with a preset preamble to generate a correlation value sequence between the WIFI signal and the preset preamble. Finally, the peak value of the peak point in the correlation value sequence is compared with a preset threshold to determine the location of all preambles in the WIFI signal. The calculation method used is relatively simple, and by traversing the WIFI signal once with a sliding window, the location of all preambles in the WIFI signal can be determined. Thus, each data packet in the WIFI signal can be parsed based on the location of each preamble.
[0039] Furthermore, since different Wi-Fi protocols may correspond to different preambles, to improve the adaptability of the detection device, multiple preset preambles can be pre-generated on the detection device, and each preset preamble has corresponding protocol information. That is, the detection device can generate preset preambles corresponding to each Wi-Fi protocol separately. Moreover, since different Wi-Fi protocols may use different specific decoding methods, to improve the decoding accuracy, the Wi-Fi signal sent by the target device can be cross-correlated with each preset preamble, and the Wi-Fi protocol used by the Wi-Fi signal can be determined based on the cross-correlation calculation results.
[0040] Specifically, step S200 may also include the following steps (steps S201 to S203): Step S201: Perform cross-correlation calculations between the WIFI signal and each preset preamble, and record the peak data corresponding to each preset preamble.
[0041] Step S202: Determine the target preamble from multiple preset preambles based on the peak data corresponding to each preset preamble.
[0042] Step S203: Determine the protocol information corresponding to the target preamble as the target protocol, and determine the position of the preamble in the WIFI signal based on the peak data corresponding to the target preamble.
[0043] This method utilizes the principle that different Wi-Fi protocols correspond to different preset preambles. The Wi-Fi signal is cross-correlated with each preset preamble. This not only allows us to determine the Wi-Fi protocol corresponding to the Wi-Fi signal based on the similarity between the Wi-Fi signal and each preset preamble, but also allows us to determine the position of the preamble in the Wi-Fi signal based on the calculation results.
[0044] Specifically, assuming there are two preset preambles, corresponding to the WIFI b protocol and the WIFI n protocol respectively, then by performing cross-correlation calculations between the WIFI signal and the two preset preambles, we can obtain the result... Figure 4The correlation value sequence corresponding to the correlation curve in the middle, and the correlation with Figure 6 The correlation value sequence corresponding to the correlation curve in the middle. Figure 4 and Figure 6 The correlation curves obtained by cross-correlation calculation of WIFI signals with different preset preambles are shown respectively. The horizontal axis of both is the number of sampling points, and the vertical axis is the correlation value.
[0045] Depend on Figure 4 As shown by the curve, there are multiple peak points with a peak value greater than 0.9 in the peak data corresponding to the curve. Figure 6 The highest peak in the curve shown corresponds to a peak value of only 0.7. Therefore, after obtaining the peak data corresponding to each preset preamble, the target preamble can be obtained from multiple preset preambles based on the maximum value in the peak data. Figure 4 The preset preamble corresponding to the correlation curve is determined as the target preamble. Figure 4 If the protocol information of the preset preamble corresponding to the correlation curve is the WIFI b protocol, then the target protocol is the WIFI b protocol. Subsequently, the demodulation method corresponding to the WIFI b protocol can be used to decode the WIFI signal. Figure 4 If the protocol information of the preset preamble corresponding to the correlation curve is WIFI n protocol, then the target protocol is WIFI n protocol, and the demodulation method corresponding to WIFI n protocol can be used to decode the WIFI signal.
[0046] In addition, by Figure 6 It is known that for preambles and Wi-Fi signals using different protocols, even if there are peaks with larger peak values in the peak data due to interference signals, the maximum peak value is only 0.7. However, for preambles and Wi-Fi signals using the same protocol, the peak value in the peak data can reach 0.9. Therefore, when determining the target preamble, a preset threshold can be set. If there are peaks in the peak data with a peak value greater than the preset threshold, it indicates that the preamble and Wi-Fi signal corresponding to that peak data use the same protocol. This preset preamble can then be identified as the target preamble, and the protocol information corresponding to that preset preamble can be identified as the target protocol.
[0047] After determining the target protocol, the position of the preamble can also be determined based on the peak data corresponding to the target preamble. Figure 4 Taking the relevant curve shown as an example, according to Figure 4 The peak value of the peak point of the correlation curve (i.e., the peak data) can determine that the preset preamble corresponding to the correlation curve is the target preamble, and the position of the peak point in the correlation curve where the peak value is greater than the preset threshold (i.e., the peak point in the peak data where the peak value is greater than the preset threshold) is the position of the preamble in the WIFI signal.
[0048] Through steps S201 to S203, the peak data corresponding to each preset preamble is obtained by cross-correlation calculation between the WIFI signal and each preset preamble. This allows the detection device to directly determine the target protocol and the position of the preamble in the WIFI signal based on the peak data, thereby enabling the detection device to decode the WIFI signal more accurately based on the target protocol and the position of the preamble in the subsequent process. After step S200, step S300 is executed: obtain the identification information corresponding to the target device from the WIFI signal based on the preamble position.
[0049] The identification information is a segment of data at a specific location within the Wi-Fi signal. This data is used to characterize the device type of the target device. In other words, the detection device can determine whether the detected Wi-Fi signal originates from a drone, a router, a vehicle-mounted Wi-Fi device, or another device by acquiring the identification information. Figure 2 Taking the structure shown as an example, the data after the preamble and the data before the WIFI signal header structure are the identification information of the WIFI signal.
[0050] Therefore, the detection device can directly extract the corresponding signal segment from the WIFI signal based on the preamble position and determine the extracted signal segment as the identification information corresponding to the target device. When determining the type of the target device, the type of the target device can be determined by calculating the similarity between the identification information and the preset identification information. Of course, to facilitate the comparison of identification information, the WIFI signal can also be mapped to 0 and 1 bits, and the data frame composed of 0 and 1 bits can be extracted as the identification information. This allows the type of the target device to be determined directly by comparing whether the identification information and the preset identification information are completely identical. Specifically, step S300 may also include the following steps: Step S310: Demap the WIFI signal to generate the bit stream corresponding to the WIFI signal.
[0051] Step S320: Extract data frames from the bitstream according to the preamble position and the preset positional relationship to obtain the identification information corresponding to the target device. The positional relationship is used to characterize the positional relationship between the data frame corresponding to the preamble and the data frame corresponding to the identification information in the bitstream.
[0052] First, the WIFI signal is mapped into 0 and 1 bits to generate the bit stream corresponding to the WIFI signal. Specifically, hard decision demapping methods such as calculating Euclidean distance, finding nearest neighbors, and table lookup can be used, or soft decision demapping methods based on log-likelihood ratio (such as maximum a posteriori probability criterion, maximum log approximation, etc.) can be used.
[0053] Furthermore, since the demapping of WIFI signals differs for different protocols, step S203 can determine the target protocol and employ the corresponding method to demapping the WIFI signal. Taking a WIFI signal using the WIFI b protocol as an example, the WIFI signal can first be mapped to 0 and 1 bits by comparing signal phases. Then, the bit stream is XORed with the scrambling code to obtain the descrambled bit stream. Finally, the identification information is obtained from the descrambled bit stream based on the preamble position and a preset positional relationship. As an example, the scrambling code can be generated by a scrambler, and the generator polynomial of the scrambler can be as follows:
[0054] The feedback logic of the scrambler is set using the polynomial described above, with the feedback connection being the 7th and 4th bits. The initial value of the register is set to [1 1 0 1 1 0 0]. Then, according to the feedback logic of the scrambler, a pseudo-random sequence (i.e., scrambling code) is generated bit by bit. The state of the register is updated accordingly after each bit of scrambling code is generated. Finally, the bit stream is XORed with the 128-bit scrambling code to descramble the bit stream and restore the original data, thus ensuring the accuracy of subsequent target device type determination and decoding processes.
[0055] Positional relationships are used to characterize the positional relationship between the data frames corresponding to the preamble and the data frames corresponding to the identification information in the bitstream. Figure 2 Taking the data packet structure shown as an example, the data frame following the preamble is the data frame corresponding to the identification information. After determining the target data frame corresponding to the preamble from the bit stream based on the preamble position, the consecutive 16-bit data frames following the target data frame can be identified as the identification information corresponding to the target device. Of course, the positional relationship between the preamble and the identification information may be different in WIFI signals corresponding to different protocols. Therefore, the detection device can also select the corresponding positional relationship from the bit stream according to the target protocol determined in step S203 to extract the identification information corresponding to the target device.
[0056] Through steps S310 to S320, the corresponding identification information is extracted from the bit stream corresponding to the WIFI signal, so that the extracted identification information is a data frame composed of 0 and 1 bits. When determining the type of the target device through the identification information, the type of the target device can be determined directly by comparing whether the values at the same position in the identification information corresponding to the target device and the preset identification information are the same. The comparison method is simpler and requires less computation.
[0057] After step S300, step S400 is executed: the identification information corresponding to the target device is compared with the preset identification information to determine the type of the target device.
[0058] Step S500: If the target device type matches the preset device type, the WIFI signal is decoded according to the preamble position to obtain the MAC address corresponding to the target device.
[0059] The preset device type is used to characterize the target detected by the detection device. For example, if the detection device is a drone detection device, the preset device type can be set to drone. The identification information corresponding to the target device is compared with the preset identification information to determine the target device type. If the target device type matches the preset device type, it means that the target device is the target detected by the detection device. The WIFI signal sent by the target device needs to be decoded according to the preamble position to obtain the MAC address of the target device, thereby realizing the detection and identification of the target device. If the target device type does not match the preset device type, it means that the target device is not the target detected by the detection device. The detection device does not need to decode the WIFI signal sent by the target device, so as to reduce the computational load of the detection device and improve the detection efficiency of the detection device.
[0060] As an example, suppose the detection device is used to detect and identify drones, and the preset identification information for the drone is 0000 1100 0101 1111. After obtaining the identification information for the target device, the device compares the target device's identification information with the preset identification information. If the comparison is successful (i.e., the target device's identification information is also 0000 1100 0101 1111), it indicates that the target device is a drone. The detection device needs to extract the header structure and MAC frame header of the Wi-Fi signal, and decode the MAC frame header based on the header structure to obtain the MAC address of the target device, thus enabling the detection and identification of the drone. If the comparison fails (i.e., the target device's identification information is not 0000 1100 01011111), it indicates that the target device is not a drone, and the detection device can ignore the Wi-Fi signal sent by the target device to reduce computation.
[0061] Since the modulation methods used by WIFI signals generated by the same type of device using different protocols may be different, the corresponding demodulation methods may also be different. In order to further improve the accuracy of WIFI signal decoding, step S500 may also include the following step (i.e., step S510): Step S510: Decode the WIFI signal according to the target protocol and preamble position to obtain the MAC address corresponding to the target device.
[0062] The target protocol is used to determine the modulation scheme of the WIFI signal, thereby selecting the correct decoding method based on the modulation scheme. For example, if the target protocol is WIFI b, the detection device can decode the WIFI signal by following the steps of demapping the WIFI signal to 0 and 1 bits, descrambling the bit stream, and extracting the header structure of the WIFI signal. If the target protocol is WIFI n, the detection device can decode the WIFI signal by following the steps of channel estimation and phase deviation correction through a long training sequence in the WIFI signal, channel equalization, demapping, deinterleaving, and Viterbi decoding.
[0063] Step S510 allows the WIFI signal to be decoded using the corresponding decoding method according to the target protocol adopted by the WIFI signal. On the one hand, the correct demodulation method is adopted according to the target protocol to ensure the accuracy of the decoding result. On the other hand, multiple decoding methods can be set in the detection device, and the corresponding demodulation method can be selected according to the target protocol, so that the detection device can decode WIFI signals of multiple protocols, reduce blind spots, and improve the applicability of the detection device.
[0064] In the above embodiments, the position of the preamble in the WIFI signal is determined by cross-correlation calculation of the WIFI signal sent by the target device and the preset preamble. Then, the identification information corresponding to the target device is obtained from the WIFI signal based on the position of the preamble. The target device type is determined based on the identification information corresponding to the target device. Thus, the type of device from which the WIFI signal detected by the detection device comes is determined based on the target device type. This enables the detection device to specifically decode the collected WIFI signal to obtain the MAC address of the target device, thereby realizing the detection and identification of the target device. The detection device can filter a large number of WIFI signals in the environment based on the target device type, effectively reducing the computational load of the detection device and improving the detection efficiency of the detection device.
[0065] Furthermore, the cross-correlation calculation is based on the amplitude of the WIFI signal and the preset preamble (i.e. Figure 3 and Figure 5 The correlation coefficient (calculated using the ordinate of the curve shown) is calculated based on the amplitude of the Wi-Fi signal and the preset preamble. If the amplitudes of the Wi-Fi signal and the preset preamble are large, the correlation value obtained from cross-correlation calculation using the original data will also be large, which will increase the computational load and difficulty of the detection device to a certain extent. Therefore, in order to reduce the computational load and difficulty of the detection device, the preset preamble and the Wi-Fi signal can be normalized before performing cross-correlation calculation. This normalization process concentrates the amplitudes of the preset preamble and the Wi-Fi signal within a certain range, thereby reducing the computational load and difficulty. Specifically, normalization methods such as minimum-maximum normalization, zero-mean normalization, and robust scaling can be used to process the preset preamble and the Wi-Fi signal.
[0066] Furthermore, since the distance between the target device and the detection device also affects the strength of the Wi-Fi signal—that is, the closer the target device and the detection device are, the stronger the Wi-Fi signal collected by the detection device, and the farther the target device and the detection device are, the weaker the Wi-Fi signal collected by the detection device—and changes in signal strength will affect the signal amplitude to some extent, for movable target devices, in order to reduce the impact of Wi-Fi signal strength on the cross-correlation calculation results, the signal within each sliding window can be normalized separately to avoid affecting the accuracy of the cross-correlation calculation due to the target device being in a moving state.
[0067] Specifically, step S220 may include the following steps (steps S221 to S223): For each signal segment within the sliding window, the following steps are performed: Step S221: Calculate the mean and variance of the signal segment within the sliding window.
[0068] Step S222: Normalize the signal segments within the sliding window based on the mean and variance to obtain the target signal segment.
[0069] Step S223: Perform cross-correlation calculation between the target signal segment and the preset preamble to obtain the correlation coefficient between the target signal segment and the preset preamble.
[0070] Specifically, each signal segment within a sliding window undergoes individual normalization processing. First, the mean and variance of the signal segment within the sliding window are calculated. Then, zero-mean normalization is applied to the signal segment within the sliding window based on the mean and variance to compress the amplitude of the target signal segment to a certain range. Finally, cross-correlation calculation is performed between the target signal segment and a preset preamble to determine the correlation coefficient between the signal segment and the preset preamble. This correlation coefficient is... Figure 4 The vertical axis of the correlation curve at each position indicates that the higher the correlation coefficient, the higher the similarity between the target signal segment and the preset preamble.
[0071] In the above embodiments, by performing normalization processing on the signal segment within each sliding window separately, the influence of signal strength on the normalization processing is reduced. This reduces the amount of computation and computational difficulty while ensuring the accuracy of the correlation coefficient. Consequently, the detection device can more accurately determine the position of the preamble in the WIFI signal based on the correlation coefficient, providing more accurate information for subsequent steps.
[0072] Furthermore, to facilitate the determination of the preamble position, in the following embodiment, step S223 may include the following steps: Step S223a: Calculate the correlation value between the target signal segment and the preset preamble based on the target signal segment, the preset preamble, and the length of the preset preamble.
[0073] Step S223b: Calculate the variance between the target signal segment and the preset preamble based on the target signal segment and the preset preamble, and determine the correction coefficient based on the variance.
[0074] Step S223c: Determine the correlation coefficient between the target signal segment and the preset preamble segment based on the correlation value and correction coefficient.
[0075] First, based on the target signal segment, the preset preamble, and the length of the preset preamble, the correlation value between the target signal segment and the preset preamble is calculated. Specifically, methods such as Pearson correlation coefficient, spectral cosine similarity, and coherence can be used to calculate the correlation value between the target signal segment and the preset preamble. As an example, step S223a may also include the following steps (steps S610 to S620): Step S610: Take the conjugate of the preset preamble and calculate the product between the target signal segment and the preset preamble after taking the conjugate.
[0076] Step S620: Divide the product by the length of the preset preamble to obtain the correlation value between the target signal segment and the preset preamble.
[0077] Specifically, steps S610 to S620 can be implemented using the following formulas:
[0078] Where R represents the correlation value, Indicates the target signal segment. This indicates the length of the preset preamble, which is also the length of the sliding window. This can also be understood as a sliding window in a Wi-Fi signal. The signal segment within the range, P refers to the preset preamble, and conj means taking the conjugate. The correlation value between the target signal segment and the preset preamble can be calculated using the above formula.
[0079] Furthermore, as can be seen from the above formula, the correlation value R is obtained through the amplitude of the target signal segment (i.e., Figure 5 The correlation value R is calculated using the ordinate of the curve shown and the preamble after conjugation. The larger the amplitude of the target signal segment, the larger the calculated correlation value R. The signal strength directly affects the amplitude. For the same Wi-Fi signal, the greater the signal strength, the greater the amplitude of the Wi-Fi signal, and the smaller the signal strength, the smaller the amplitude of the Wi-Fi signal.
[0080] For mobile target devices, the distance between the target device and the detection device directly affects the strength of the Wi-Fi signal detected by the detection device. The farther the distance between the target device and the detection device, the weaker the Wi-Fi signal detected by the detection device will be. This results in a smaller Wi-Fi signal amplitude. Even if the similarity between the target signal segment and the preset preamble is very high, the small amplitude of the target signal segment will lead to a smaller calculated correlation value R. Conversely, if the distance between the target device and the detection device is relatively close, the strength of the Wi-Fi signal detected by the detection device will be stronger. This results in a larger Wi-Fi signal amplitude. Even if the similarity between the target signal segment and the preset preamble is low, the large amplitude of the target signal segment will lead to a larger calculated correlation value R. This can cause the detection device to mistakenly identify the location of the target signal segment as the location of the preamble in the Wi-Fi signal, resulting in a false alarm.
[0081] Therefore, after calculating the correlation value between the target signal segment and the preset preamble, a correction coefficient can be determined based on the variance between them. This correction coefficient can be either the reciprocal of the variance or the reciprocal of the standard deviation. The correlation value between the target signal segment and the preset preamble is then corrected using this correction coefficient. As an example, the standard deviation between the target signal segment and the preset preamble can be used as the correction coefficient to calculate the correlation coefficient between them. The specific formula is as follows:
[0082] in, Represents the correlation coefficient. This indicates the calculation of variance.
[0083] Through steps S223a to S223c, the detection device can normalize the correlation value between the target signal segment and the preset preamble to compress the correlation coefficient between the target signal segment and the preset preamble to a specified range, thereby reducing the influence of signal strength on the correlation coefficient and reducing false alarms caused by high power noise. In particular, for movable target devices, it can avoid the influence of changes in the distance between the target device and the detection device on the cross-correlation calculation results, thus improving the detection accuracy of the detection device.
[0084] According to a second aspect of the embodiments of this application, a WIFI signal decoding device is provided, such as... Figure 7 As shown, Figure 7 A schematic diagram of the structure of the WIFI signal decoding device provided in the embodiment of this application is shown. The device 1 includes: a signal acquisition module 11, a preamble position determination module 12, an identification information acquisition module 13, a comparison module 14, and a decoding module 15.
[0085] The signal acquisition module 11 is used to acquire a preset preamble and the WIFI signal sent by the target device. The preamble position determination module 12 is used to perform cross-correlation calculation between the WIFI signal and the preset preamble, and determine the position of the preamble in the WIFI signal based on the calculation result. The identification information acquisition module 13 is used to acquire the identification information corresponding to the target device from the WIFI signal based on the preamble position. The comparison module 14 is used to compare the identification information corresponding to the target device with the preset identification information to determine the target device type. The decoding module 15 is used to decode the WIFI signal based on the preamble position when the target device type matches the preset device type to obtain the MAC address corresponding to the target device.
[0086] In the above embodiments, the position of the preamble in the WIFI signal is determined by cross-correlation calculation of the WIFI signal sent by the target device and the preset preamble. Then, the identification information corresponding to the target device is obtained from the WIFI signal based on the position of the preamble. The target device type is determined based on the identification information corresponding to the target device. Thus, the type of device from which the WIFI signal detected by the detection device comes is determined based on the target device type. This enables the detection device to specifically decode the collected WIFI signal to obtain the MAC address of the target device, thereby realizing the detection and identification of the target device. The detection device can filter a large number of WIFI signals in the environment based on the target device type, effectively reducing the computational load of the detection device and improving the detection efficiency of the detection device.
[0087] According to a third aspect of the embodiments of this application, a detection device is provided, such as... Figure 8 As shown, Figure 8 The diagram shows a schematic of the detection device provided in an embodiment of this application. The specific embodiments of this application do not limit the specific implementation of the detection device.
[0088] like Figure 8 As shown, the detection device 2 may include a processor 21 and a memory 22.
[0089] The memory 22 is used to store the computer program 23. The memory 22 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device. The computer program 23 may include computer-executable instructions.
[0090] The processor 21 is used to execute the computer program 23 to implement the above-described WIFI signal decoding method embodiment.
[0091] The processor 21 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The detection device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0092] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described WIFI signal decoding method embodiment.
[0093] This application provides a computer program that can be executed by a processor to implement the above-described WIFI signal decoding method embodiment.
[0094] This application provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described WIFI signal decoding method embodiment.
[0095] In the several embodiments provided in this application, any function, if implemented as a software functional module / unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, part or all of the technical solutions of this application can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or other electronic device) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing computer program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0096] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of this application are not directed to any particular programming language. It should be understood that the content of this application described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of this application.
[0097] It should be noted that the above embodiments are illustrative of this application and not restrictive, and those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In claims enumerating several means, several units or modules of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.
[0098] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for decoding a WIFI signal, characterized in that, The method comprises: acquiring a preset preamble and a WIFI signal sent by a target device; performing cross-correlation calculation on the WIFI signal and the preset preamble, and determining a preamble position in the WIFI signal according to a calculation result; acquiring identification information corresponding to the target device from the WIFI signal according to the preamble position; comparing the identification information corresponding to the target device with preset identification information to determine a target device type; if the target device type matches a preset device type, decoding the WIFI signal according to the preamble position to acquire a MAC address corresponding to the target device.
2. The WIFI signal decoding method of claim 1, wherein, The method of acquiring identification information corresponding to the target device from the WIFI signal according to the preamble position comprises: demapping the WIFI signal to generate a bit stream corresponding to the WIFI signal; extracting a data frame from the bit stream according to the preamble position and a preset position relationship to obtain the identification information corresponding to the target device, wherein the position relationship represents a position relationship between a data frame corresponding to the preamble and a data frame corresponding to the identification information in the bit stream.
3. The method of claim 1, wherein, The preset preambles are multiple, and each preset preamble has corresponding protocol information. The method of performing cross-correlation calculation on the WIFI signal and the preset preamble and determining a preamble position in the WIFI signal according to a calculation result comprises: performing cross-correlation calculation on the WIFI signal and each preset preamble respectively, and recording peak value data corresponding to each preset preamble; determining a target preamble from the multiple preset preambles according to the peak value data corresponding to each preset preamble; determining a target protocol as the protocol information corresponding to the target preamble, and determining the preamble position in the WIFI signal according to the peak value data corresponding to the target preamble; The method of decoding the WIFI signal according to the preamble position to acquire a MAC address corresponding to the target device comprises: decoding the WIFI signal according to the target protocol and the preamble position to acquire the MAC address corresponding to the target device.
4. The method of claim 1, wherein, The method of performing cross-correlation calculation on the WIFI signal and the preset preamble and determining a preamble position in the WIFI signal according to a calculation result comprises: determining a sliding window according to the length of the preset preamble; traversing the WIFI signal through the sliding window, performing cross-correlation calculation on a signal segment in each sliding window and the preset preamble to generate a correlation value sequence between the WIFI signal and the preset preamble; analyzing the correlation value sequence to acquire a peak point of the correlation value sequence; determining a position corresponding to a peak point with a peak value greater than a preset threshold as the preamble position in the WIFI signal.
5. The WIFI signal decoding method of claim 4, wherein, The method of traversing the WIFI signal through the sliding window and performing cross-correlation calculation on a signal segment in each sliding window and the preset preamble comprises: For each signal segment in the sliding window, the following steps are performed: Calculate the mean and variance of the signal segment in the sliding window; Normalize the signal segment in the sliding window according to the mean and the variance to obtain a target signal segment; Calculate the cross-correlation between the target signal segment and the preset preamble to obtain the correlation coefficient between the target signal segment and the preset preamble.
6. The WIFI signal decoding method of claim 5, wherein, The cross-correlation calculation between the target signal segment and the preset preamble to obtain the correlation coefficient between the target signal segment and the preset preamble specifically includes: According to the target signal segment, the preset preamble, and the length of the preset preamble, calculate the correlation value between the target signal segment and the preset preamble; According to the target signal segment and the preset preamble, calculate the variance between the target signal segment and the preset preamble, and determine a correction coefficient according to the variance; According to the correlation value and the correction coefficient, determine the correlation coefficient between the target signal segment and the preset preamble segment.
7. The WIFI signal decoding method of claim 6, wherein, The calculation of the correlation value between the target signal segment and the preset preamble according to the target signal segment, the preset preamble, and the length of the preset preamble specifically includes: Take the conjugate of the preset preamble, and calculate the product between the target signal segment and the conjugated preset preamble; Divide the product by the length of the preset preamble to obtain the correlation value between the target signal segment and the preset preamble.
8. A WIFI signal decoding apparatus, characterized by, The device includes: A signal acquisition module for acquiring a preset preamble and a WIFI signal sent by a target device; A preamble position determination module for calculating the cross-correlation between the WIFI signal and the preset preamble, and determining the preamble position in the WIFI signal according to the calculation result; An identification information acquisition module for acquiring the identification information corresponding to the target device from the WIFI signal according to the preamble position; A comparison module for comparing the identification information corresponding to the target device with preset identification information to determine the target device type; A decoding module for decoding the WIFI signal according to the preamble position to obtain the MAC address corresponding to the target device when the target device type matches the preset device type.
9. A detection device comprising a memory, a processor and a computer program stored on the memory, characterized in that, The processor executes the computer program to implement the WIFI signal decoding method of any one of claims 1-7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the WIFI signal decoding method of any one of claims 1-7.