Bssid detection method and device, electronic equipment and storage medium
By receiving and parsing the signal power of Wi-Fi signals, analyzing the start and end points of beacon frames, calculating the operating frequency of the target transmitter, controlling the frequency of the radio frequency module to obtain the preamble and decode the BSSID, the problem of slow segment-by-segment parsing of Wi-Fi signals is solved, and fast and accurate BSSID identification and positioning are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE M2M
- Filing Date
- 2023-12-26
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, parsing Wi-Fi signals segment by segment to obtain the BSSID is slow, which affects the positioning accuracy of subsequent electronic devices.
By analyzing the start and end points of the beacon frame through the received Wi-Fi signal power, the operating frequency of the target transmitter is calculated, the frequency of the radio frequency module is controlled to receive the Wi-Fi signal, the preamble is obtained and the BSSID is decoded, thus avoiding parsing the entire Wi-Fi signal segment by segment.
It improves the resolution speed of BSSID, reduces the amount of computation, lowers the manufacturing cost of SoC chips, and achieves accurate BSSID identification.
Smart Images

Figure CN118804025B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technology, and in particular relates to a BSSID detection method, apparatus, electronic device and storage medium. Background Technology
[0002] In related technologies, electronic devices scan the Wi-Fi signals that can be received in their environment, parse the Wi-Fi signals segment by segment to obtain the BSSID, and then query the geographical location information of the sender that sent the Wi-Fi signal through the BSSID, thereby analyzing and obtaining the geographical location information of the electronic device.
[0003] Parsing Wi-Fi signals segment by segment to obtain the BSSID is slow and not conducive to locating electronic devices using the BSSID. Summary of the Invention
[0004] This application provides a BSSID detection method, apparatus, electronic device, and storage medium to solve the technical problem of slow speed in obtaining BSSID by parsing Wi-Fi signals segment by segment.
[0005] In a first aspect, embodiments of this application provide a BSSID detection method, the method comprising:
[0006] Receive the first Wi-Fi signal and collect the signal power of the first Wi-Fi signal, the first Wi-Fi signal including the Wi-Fi signal sent by the target transmitter;
[0007] Based on the signal power, the start and end points of the beacon frames in the first Wi-Fi signal are obtained through analysis;
[0008] Based on the start and end points, a predicted frequency that matches the operating frequency of the target transmitter is calculated. The operating frequency of the radio frequency module is controlled to be the predicted frequency so that the second Wi-Fi signal sent by the target transmitter can be received by the radio frequency module at the operating frequency.
[0009] The preamble is obtained by analyzing the second Wi-Fi signal;
[0010] Based on the preamble, the second Wi-Fi signal is decoded to obtain the BSSID.
[0011] In one embodiment, the start and end points of the beacon frame in the first Wi-Fi signal are determined by analyzing the signal power, including:
[0012] Interpolation processing is performed on the signal power of multiple consecutive subframes in the first Wi-Fi signal to obtain a first analysis sequence, which includes m signal powers corresponding to n preset beacon frame periods;
[0013] Calculate the average power of multiple signals that are spaced at integer multiples of the preset beacon frame period in the first analysis sequence to obtain the second analysis sequence. The second analysis sequence includes q power averages corresponding to the preset beacon frame period, where n*q≥m, (n-1)*q<m, and n, m, and q are all natural numbers.
[0014] Based on the magnitude of the average power values in the second analysis series, a power threshold is set;
[0015] The second analytical sequence, Pth x The Pth bit is set as the starting point of the beacon frame, and the second analysis sequence is set to Pth. y The Pth bit is set as the termination point of the beacon frame, where the Pth bit is the termination point of the beacon frame. x If the average power value is less than or equal to the power threshold, then the Pth power value is... x+1 The average power of bit P is greater than the power threshold. y-1 The average power of bit P is greater than the power threshold. y The average power value is less than or equal to the power threshold, and x < y.
[0016] In one embodiment, setting a power threshold based on the magnitude of the average power values in the second analysis series includes:
[0017] Determine the maximum peak value in the second analytical sequence;
[0018] The power threshold is obtained by calculating the difference between the maximum peak value and the preset bias value.
[0019] In one embodiment, a predicted frequency matching the operating frequency of the target transmitter is calculated based on the start and end points, and the operating frequency of the radio frequency module is controlled to be the predicted frequency, so as to receive the second Wi-Fi signal transmitted by the target transmitter through the radio frequency module at the operating frequency, including:
[0020] Based on the start and end points, a predicted frequency matching the operating frequency of the target transmitter is calculated. The operating frequency of the radio frequency module is controlled to be the same as the predicted frequency and the operating frequency of the target transmitter, so that the radio frequency module at the predicted frequency can receive the second Wi-Fi signal sent by the target transmitter.
[0021] In one embodiment, the second Wi-Fi signal is analyzed to obtain a preamble including:
[0022] Select N0 consecutive signal powers from the synchronization field of the preset reference sequence as the first signal sequence, where N0 is a natural number;
[0023] The signal power of each subframe in the second Wi-Fi signal is used as the second signal sequence.
[0024] Using N0 as the sliding window number, perform sliding correlation processing on the first signal sequence and the second signal sequence to obtain the cross-correlation power corresponding to each signal power in the second signal sequence;
[0025] Calculate the autocorrelation power p corresponding to the power of each signal in the second signal sequence;
[0026] The preamble in the second Wi-Fi signal is determined based on the cross-correlation power and p*N0.
[0027] In one embodiment, determining the preamble in the second Wi-Fi signal based on the cross-correlation power and p*N0 includes:
[0028] Located at point P in the second Wi-Fi signal i The cross-correlation power of the Pth bit is greater than or equal to the product of its autocorrelation power and N0, and the second Wi-Fi signal located at the Pth bit... i-1 If the cross-correlation power of bit P is less than or equal to the product of its autocorrelation power and N0, then set bit P... i The first bit is the index start bit of the preamble.
[0029] In one embodiment, decoding the second Wi-Fi signal based on the preamble to obtain the BSSID includes:
[0030] Based on the preamble, determine the frame header field in the second Wi-Fi signal, decode the frame header field, and obtain the byte length of the MacPDU field;
[0031] Decode and verify the Mac PDU field in the second Wi-Fi signal based on its byte length;
[0032] If the Mac PDU field verification is successful, the BSSID field in the second Wi-Fi signal is parsed to obtain the BSSID.
[0033] Secondly, embodiments of this application provide a BSSID detection device, comprising:
[0034] The first receiving module is used to receive the first Wi-Fi signal and collect the signal power of the first Wi-Fi signal, wherein the first Wi-Fi signal includes the Wi-Fi signal sent by the target transmitting end;
[0035] The beacon frame detection module is used to analyze and obtain the start and end points of beacon frames in the first Wi-Fi signal based on the signal power.
[0036] The second receiving module is used to calculate a predicted frequency that matches the operating frequency of the target transmitter based on the start point and the end point, and control the operating frequency of the radio frequency module to be the predicted frequency, so as to receive the second Wi-Fi signal sent by the target transmitter through the radio frequency module at the operating frequency.
[0037] The preamble detection module is used to analyze the second Wi-Fi signal and obtain the preamble.
[0038] The BSSID decoding module is used to decode the second Wi-Fi signal based on the preamble to obtain the BSSID.
[0039] Thirdly, embodiments of this application provide an electronic device, which includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the BSSID detection method as described above.
[0040] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the BSSID detection method described above.
[0041] The BSSID detection method, apparatus, electronic device, and storage medium provided in this application embodiment can be executed by a SoC chip to identify the BSSID carried by Wi-Fi signals that can be scanned in the environment. This eliminates the need for an additional wireless communication chip or wireless communication hardware module independent of the SoC chip, thereby reducing the manufacturing cost of the SoC chip. By analyzing the signal power, the start and end points of the beacon frames in the first Wi-Fi signal are obtained, and a predicted frequency matching the operating frequency of the target transmitter can be further calculated. The operating frequency of the radio frequency module is controlled to be the predicted frequency, so that the radio frequency module can accurately receive the second Wi-Fi signal sent by the target transmitter. By analyzing the second Wi-Fi signal, a preamble is obtained, and then the second Wi-Fi signal is decoded according to the preamble to obtain the BSSID. This achieves accurate identification of the BSSID, avoids parsing the entire first Wi-Fi signal segment by segment, reduces the computational load of parsing the Wi-Fi signal to obtain the BSSID, and improves the parsing speed. Attached Figure Description
[0042] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a schematic flowchart of a BSSID detection method provided in an embodiment of this application;
[0044] Figure 2This is a partial flowchart of a BSSID detection method provided in an embodiment of this application;
[0045] Figure 3 This is a partial flowchart of a BSSID detection method provided in an embodiment of this application;
[0046] Figure 4 This is a partial flowchart of a BSSID detection method provided in an embodiment of this application;
[0047] Figure 5 This is a schematic diagram of the structure of a BSSID detection device provided in an embodiment of this application;
[0048] Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0049] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples of this application.
[0050] It should be noted that, in this document, relational terms such as "second" and "third" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0051] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The embodiments will now be described in detail with reference to the accompanying drawings.
[0052] To address the problems of the prior art, embodiments of this application provide a BSSID detection method, apparatus, electronic device, and storage medium. The BSSID detection method provided in this application embodiment is described below.
[0053] Figure 1 A flowchart illustrating a BSSID detection method according to an embodiment of this application is shown. The method includes the following steps:
[0054] S110, Receive the first Wi-Fi signal, collect the signal power of the first Wi-Fi signal, the first Wi-Fi signal includes the Wi-Fi signal sent by the target transmitter;
[0055] S120, Based on the signal power, the start and end points of the beacon frame in the first Wi-Fi signal are analyzed and obtained;
[0056] S130: Based on the start point and end point, calculate the predicted frequency that matches the operating frequency of the target transmitter, control the operating frequency of the radio frequency module to the predicted frequency, so as to receive the second Wi-Fi signal sent by the target transmitter through the radio frequency module at the operating frequency.
[0057] S140, Analyze the second Wi-Fi signal to obtain the preamble;
[0058] S150 decodes the second Wi-Fi signal based on the preamble to obtain the BSSID.
[0059] The BSSID detection method provided in this application can be applied to System-on-Chips (SoCs), which can be installed in electronic devices such as mobile terminals and wearable devices. The electronic device can detect Wi-Fi signals in its environment using Wi-Fi signal scanning technology, and then use the BSSID detection method provided in this application to detect the Basic Service Set Identifier (BSSID). The detected BSSID is then sent to an external server. The server queries a pre-stored database to obtain the geographical location information of the sender corresponding to the BSSID, thereby locating the electronic device equipped with the SoC chip to that geographical location, achieving device positioning. The BSSID can be a MAC address represented by a six-byte hexadecimal number. The MAC address can be used to locate the target sender associated with that MAC address.
[0060] The target transmitter can be any terminal in the environment where the SoC chip is located that uses Wi-Fi to transmit signals. The target transmitter can be an access point of the wireless network. It can be a router, smart home appliance, mobile device, etc., within the SoC chip's environment. The first Wi-Fi signal is the wireless communication signal emitted by the target transmitter. The target transmitter periodically emits beacon frames at regular time intervals to inform the outside world of the existence of its wireless network. When the SoC chip receives this first Wi-Fi signal, it needs to analyze the signal to obtain its beacon frames.
[0061] Wi-Fi signals can be divided into multiple frames, and each frame can be further divided into multiple subframes. In wireless communication, a frame contains information about data transmission, while a subframe is a smaller part within that frame. The SoC chip provided in this application can be a Cat.1 (LTE UE - Category 1) chip. Based on the SoC chip's power statistics function for each subframe in the received Wi-Fi signal, the signal power of each subframe in the first Wi-Fi signal is collected. The signal power of each subframe is arranged sequentially in time to form a sequence. This sequence is processed to identify the start and end points of the beacon frame. Subsequent further decoding of the beacon frame can be performed based on these start and end points to reduce the amount of data required later.
[0062] A preamble is a special bit sequence used to synchronize the clock and data of a receiving device. In wireless communication, the preamble helps the receiving device accurately locate the beginning of data, enabling it to correctly demodulate and decode subsequent data frames. In other words, a preamble is required before decoding a Beacon frame. Only by correctly parsing the preamble and decoding the second Wi-Fi signal can the BSSID contained in the Beacon frame be accurately obtained.
[0063] In this embodiment, the provided BSSID detection method can be executed by a SoC chip to identify the BSSID carried by Wi-Fi signals that can be scanned in the environment. This eliminates the need for an additional wireless communication chip or hardware module separate from the SoC chip, thereby reducing the manufacturing cost of the SoC chip. By analyzing the signal power, the start and end points of the beacon frames in the first Wi-Fi signal are obtained, and a predicted frequency matching the operating frequency of the target transmitter can be calculated. The operating frequency of the radio frequency module is controlled to be the predicted frequency, so that the radio frequency module can accurately receive the second Wi-Fi signal sent by the target transmitter. By analyzing the second Wi-Fi signal, a preamble is obtained, and then the second Wi-Fi signal is decoded based on the preamble to obtain the BSSID. This achieves accurate identification of the BSSID, avoids parsing the entire first Wi-Fi signal segment by segment, reduces the computational load of parsing the Wi-Fi signal to obtain the BSSID, and improves the parsing speed.
[0064] Please refer to the following: Figure 2 In some embodiments, step S110 further includes:
[0065] Receive Wi-Fi signal scanning instructions;
[0066] When the SoC chip is in a busy state, the status of the SoC chip is checked at preset subframe intervals.
[0067] When the SoC chip is idle, the control radio frequency module switches to the Wi-Fi signal receiving frequency band.
[0068] A SoC chip being in a busy state can refer to the state in which the radio frequency module is communicating with external devices based on mobile communication standards. For example, when the SoC chip is communicating with a base station using Long Term Evolution (LTE), it is in a busy state.
[0069] The radio frequency module is switched to the Wi-Fi signal receiving frequency band, enabling it to receive Wi-Fi signals from the environment where the SoC chip is located.
[0070] In some embodiments, when the SoC chip is in an idle state and the waiting time is less than a preset time, the radio frequency module is controlled to switch to the Wi-Fi signal receiving frequency band.
[0071] If the waiting time is greater than or equal to the preset time, the execution will terminate.
[0072] The waiting time can be the duration from the moment the Wi-Fi signal scanning command is received to the current moment. The preset interval in subframes can be 1 subframe.
[0073] In some embodiments, S120 includes:
[0074] S210, interpolate the signal power of multiple consecutive subframes in the first Wi-Fi signal to obtain a first analysis sequence, the first analysis sequence including m signal powers corresponding to n preset beacon frame periods;
[0075] S220, calculate the average power of multiple signal powers in the first analysis sequence at intervals that are integer multiples of the preset beacon frame period, and obtain the second analysis sequence. The second analysis sequence includes q power averages corresponding to the preset beacon frame period, where n*q≥m, (n-1)*q<m, and n, m and q are all natural numbers.
[0076] S230, Set the power threshold based on the magnitude of the average power values in the second analysis series;
[0077] S240, the second analytical sequence Pth x The Pth bit is set as the starting point of the beacon frame, and the second analysis sequence is set to Pth. y The Pth bit is set as the termination point of the beacon frame, where the Pth bit is the termination point of the beacon frame. x If the average power value is less than or equal to the power threshold, then the Pth power value is... x+1 The average power of bit P is greater than the power threshold. y-1 The average power of bit P is greater than the power threshold. y The average power value is less than or equal to the power threshold, and x < y.
[0078] The signal power of T0 consecutive subframes in the first Wi-Fi signal can be interpolated to obtain a first analysis sequence, thereby improving the quality, accuracy, and reliability of the first analysis sequence and thus improving the accuracy of the starting and ending points obtained in subsequent analyses. Optionally, the signal power of T0 consecutive subframes in the first Wi-Fi signal can be interpolated by a factor of N, where N is a positive number.
[0079] The preset beacon frame period is a duration pre-set according to different Wi-Fi standards. The target transmitter sends a beacon frame once every preset beacon frame period, depending on the Wi-Fi standard it is implementing. The signal power in the first analysis sequence corresponds to n consecutive preset beacon frame periods M0, M1, M2...M n If a preset beacon frame period corresponds to q signal powers, then the number m of signal powers arranged in the first analysis sequence must be less than or equal to n*q, and greater than (n-1)*q. For example, if the preset beacon frame period corresponds to 1000 signal powers in the first analysis sequence, and the first analysis sequence corresponds to 3 consecutive preset beacon frame periods, then 2000 > m ≥ 3000.
[0080] The first data point P in the first analysis sequence, corresponding to the first preset beacon frame period M0.01 The first data point P corresponding to the first preset beacon frame period M1 11 The first data point P corresponding to the first preset beacon frame period M2 21 Sequentially, at preset beacon frame periods M, transfer data points P. 01 Data point P 11 Data point P 21 The power averages are calculated by summing the values. Multiple power averages are then arranged according to their position within a preset beacon frame period to obtain a second analysis sequence corresponding to that preset beacon frame period. By calculating the power average of the signal power at the same position across multiple preset beacon periods, the quality, accuracy, and reliability of the second analysis sequence are improved, thereby enhancing the accuracy of the starting point and bundle points obtained in subsequent analyses. An algorithm for interpolating and superimposing the received signals is then used to achieve precise Wi-Fi signal reception and timing.
[0081] S120 can be calculated using the following formula (1):
[0082]
[0083] in, The power average value is the k-th position in the second analysis sequence; M is the preset beacon frame period; C k The number of signal powers in the first analysis sequence that are integer multiples of the signal power of the k-th position in the preset beacon frame period; The signal power of the kth bit in the preset beacon frame period M0, the signal power of the kth bit in the preset beacon frame period M1, the signal power of the kth bit in the preset beacon frame period M2, and so on.
[0084] Since the signal power of different received Wi-Fi signals varies, the power threshold needs to be dynamically set based on the obtained second analysis series so that the value of the power threshold matches the second analysis series that needs further analysis.
[0085] The power averages in the second analysis sequence are traversed, and the power averages above and below the power threshold are compared to obtain the power averages. Based on the power averages above and below the power threshold, the peak of the second analysis sequence that exceeds the power threshold is determined, i.e., the rank P of the first power average in the second analysis sequence to exceed the power threshold. x+1 The position P of the average power value that is first less than the power threshold y , will the Pth x The Pth bit is set to the start point STp / N of the beacon frame. y The bit is set to the termination point EDp / N of the beacon frame, in the Pth bit. x Position Py The bit time is the time it takes for the target transmitter in the environment where the SoC chip is located to send a beacon frame. The target transmitter sends a beacon frame once every preset beacon frame period.
[0086] By interpolating and averaging the first collected Wi-Fi signal, a second analysis sequence is obtained. Then, based on the magnitude of the average power value in the second analysis sequence, the start and end points of the beacon frame are identified, ensuring that the identified start and end points are accurate.
[0087] In some embodiments, S130 includes:
[0088] S310, determine the maximum peak value in the second analysis sequence;
[0089] S320 calculates the difference between the maximum peak value and the preset bias value to obtain the power threshold.
[0090] The preset bias value is a pre-set value. The difference between the maximum peak value and the preset bias value can be calculated to obtain the power threshold. In other embodiments, a more complex calculation function can be set to calculate the power threshold. It is understood that the power threshold is always less than the maximum peak value.
[0091] By determining the maximum peak value in the second analysis sequence and then calculating the difference between the maximum peak value and the preset bias value, a power threshold is obtained. This allows the power threshold to be dynamically generated based on the signal power of the first Wi-Fi signal collected, thereby improving the accuracy of the starting and ending points of subsequent identification.
[0092] In some embodiments, S130 includes:
[0093] S410, calculate the predicted frequency that is the same as the operating frequency of the target transmitter;
[0094] S420, control the operating frequency of the radio frequency module to the predicted frequency, so as to receive the second Wi-Fi signal sent by the target transmitter through the radio frequency module at the predicted frequency.
[0095] By using the start and end points, the predicted frequency of the target beacon frame can be deduced. Calculating this predicted frequency, which is the same as the operating frequency of the target transmitter, and controlling the RF module's operating frequency to match the predicted frequency, allows for accurate reception of the second Wi-Fi signal containing the complete beacon frame. This enables subsequent decoding of the second Wi-Fi signal, reducing the decoding workload.
[0096] In some embodiments, S140 includes:
[0097] S510, Select N0 consecutive signal powers from the synchronization field of the preset reference sequence as the first signal sequence, where N0 is a natural number;
[0098] S520 uses the signal power of each subframe in the second Wi-Fi signal as the second signal sequence;
[0099] S530, with N0 as the sliding window number, perform sliding correlation processing on the first signal sequence and the second signal sequence to obtain the cross-correlation power corresponding to each signal power in the second signal sequence;
[0100] S540, calculate the autocorrelation power p corresponding to the power of each signal in the second signal sequence;
[0101] S550 determines the preamble in the second Wi-Fi signal based on the cross-correlation power and p*N0.
[0102] The preset reference sequence is a pre-set standard sequence of Wi-Fi signal beacon frames. The beacon frame includes a preamble, which contains a synchronization field. N0 consecutive signal power values are selected from the beginning of the synchronization field in chronological order as the first signal sequence. By selecting a portion of the preset reference sequence as the first signal sequence, the position of the preamble in the second signal sequence can be determined by comparing the first and second signal sequences, thus reducing the computational load.
[0103] In S530, the cross-correlation power corresponding to the power of each signal in the second signal sequence can be calculated using the following formulas (2) and (3):
[0104]
[0105]
[0106] Where r(k) is the correlation power corresponding to the power of the kth bit in the second signal sequence, d(n) is the power of the nth bit in the first signal sequence, and x(k+n) is the power of the (k+n)th bit in the second signal sequence.
[0107] In S540, the autocorrelation power p corresponding to the power of each signal in the second signal sequence can be calculated using the following formula (4):
[0108]
[0109] Where p(k) is the autocorrelation power corresponding to the power of the k-th bit in the second signal sequence, and x(k+n) is the power of the (k+n)-th bit in the second signal sequence.
[0110] Cross-correlation power reflects the correlation between the power of N0 signals starting at index k in the first and second signal sequences. Autocorrelation power reflects the correlation between the power of N0 signals starting at index k in the second signal sequence. By comparing the magnitudes of the cross-correlation power and autocorrelation power corresponding to the same position, the precise location of the preamble in the second Wi-Fi signal can be determined.
[0111] In some embodiments, S550 includes:
[0112] S610, located at P in the second Wi-Fi signal i The cross-correlation power of the Pth bit is greater than or equal to the product of its autocorrelation power and N0, and the second Wi-Fi signal located at the Pth bit... i-1 If the cross-correlation power of bit P is less than or equal to the product of its autocorrelation power and N0, then set bit P... i The first bit is the index start bit of the preamble.
[0113] Compare r(k) and p(k)*N0 sequentially along the time sequence. When r(k)>(p(k)*N0) appears for the first time, set k as the starting index of the preamble. That is, the preamble starts from this starting index in the second Wi-Fi signal. If the preamble is correctly identified, the frame header field, MAC PDU field, BSSID field, etc. can be derived.
[0114] To avoid preamble recognition errors, the signal power following the N0th signal power in the second Wi-Fi signal can also be verified against a preset reference sequence.
[0115] In some embodiments, S550 includes the following:
[0116] The signal power following N0 signal power in the synchronization field is divided into E segments along the time axis, resulting in E verification sequences. The length of the first E-1 verification sequences is N1, where N1 = (L sync -N0) / E,L sync The preset length for the synchronization field.
[0117] Based on the verification index bit, calculate the cross-correlation power r(e) of the signal power after the k0+N0th bit in the verification sequence and the second Wi-Fi signal;
[0118] Calculate the autocorrelation power p(e) of the signal power after the k0+N0th bit in the second Wi-Fi signal;
[0119] Compare r(e) and p(e) sequentially. If r(e) > p(e), the starting index position is correctly identified. If r(e) ≤ p(e), the starting index position is incorrectly identified. Execute S610 to calculate the position located at the pth index.i The starting bit of the index after the bit.
[0120] By segmenting the signal sequence of the corresponding preamble and calculating the cross-correlation power and autocorrelation power, and by comparing the cross-correlation power and autocorrelation power, the accurate position of the preamble can be identified, thereby improving the recognition efficiency of the preamble.
[0121] In some embodiments, S150 includes:
[0122] S710 determines the frame header field in the second Wi-Fi signal based on the preamble, decodes the frame header field, and obtains the byte length of the Mac PDU field.
[0123] The S720 decodes and verifies the Mac PDU field in the second Wi-Fi signal based on the byte length.
[0124] If the Mac PDU field verification is successful, the S730 parses the BSSID field in the second Wi-Fi signal to obtain the BSSID.
[0125] Based on the preamble, the start frame delimiter (SFD) and the header field can be further derived. The derived start frame delimiter can be further detected by calculating the aforementioned autocorrelation power and cross-correlation power.
[0126] For example, calculate the cross-correlation power r(sfd) corresponding to each signal power in the start-of-frame field of the first Wi-Fi signal and the second Wi-Fi signal, and calculate the autocorrelation power p(sfd) corresponding to each signal power in the start-of-frame field of the second Wi-Fi signal; if r(sfd) > p(sfd), the start-of-frame is considered to be correctly identified; if r(sfd) ≤ p(sfd), the start-of-frame is considered to be incorrectly identified. Execute S610.
[0127] Decoding the frame header field can include despreading, demodulation, descrambling, and CRC verification.
[0128] Despreading the frame header field requires pre-calculating the despreading value before the frame header field segment. The despreading value before the frame header field segment can be calculated using an 11-bit baker sequence. The baker sequence can be (1-111-1111-1-1-1).
[0129] It can be calculated using the following formula (5):
[0130]
[0131] Where y(-1) is the despread value before the frame header field; k0 is the header index of the frame header field; and b(n) is the baker sequence.
[0132] After calculating the despreading value before the frame header field, the despreading value of each signal power in the frame header field can be calculated. This can be done using the following formula (6):
[0133]
[0134] Where y(m) is the despread value of the m-th bit signal power in the frame header field; k0 is the header index of the frame header field; and b(n) is the baker sequence.
[0135] After calculating the despread value of each signal power in the frame header field, the demodulation of the frame header field can be calculated. This can be done using the following formula (7):
[0136]
[0137] in, y(m) is the demodulated value of the signal power of the m-th bit in the frame header field, y(m) is the despread value of the signal power of the m-th bit in the frame header field, and y(m-1) is the despread value of the signal power of the (m-1)-th bit in the frame header field.
[0138] The demodulated data is obtained by determining the bit positions of the frame header field based on the demodulation constellation diagram of Binary Phase Shift Keying (BPSK) or Quadrature Phase Shift Keying (QPSK).
[0139] Please see Figure 3 After demodulating the frame header field, descrambling and CRC verification are performed. The CRC portion of the demodulated data can be inverted, and each bit in the CRC portion can be shifted sequentially. If all the shifted data values are 0, the CRC check is successful. If at least one of the shifted data values is 1, the CRC check fails, and step S140 is executed.
[0140] The length field of the MacPDU in the demodulated data is parsed to obtain the byte length of the MacPDU field.
[0141] When decoding the Mac PDU field, the despreading value corresponding to the last signal power in the frame header field can be used as the pre-segment despreading value for the Mac PDU field. By decoding the frame header field, the byte length of the Mac PDU field is obtained, and despreading and demodulation of the Mac PDU field are then performed based on this byte length. Despreading and demodulation of the Mac PDU field can be calculated using the same formula as for the frame header field. Please refer to [link to relevant documentation]. Figure 4 Furthermore, the same formula as for the frame header field can be used to descramble and perform CRC verification on the demodulated data after demodulation of the Mac PDU field. The difference is that when performing CRC verification on the demodulated data after demodulation of the Mac PDU field, the CRC part is 32 bits; when performing CRC verification on the demodulated data after demodulation of the frame header field, the CRC part is 16 bits.
[0142] If the Mac PDU field verification is successful, the Frame Control field is parsed according to the protocol. If the subtype area in the parsing result is beacon (0x08), then the current frame is determined to be a beacon frame. The BSSID field is then parsed to obtain the BSSID.
[0143] In this embodiment, the frame header field is despread using a baker sequence, and the demodulated data is shifted for descrambling and CRC verification, thereby decoding the frame header field.
[0144] To further improve the detection efficiency of BSSID, the received second Wi-Fi signal can also be stored. While detecting the BSSID of one second Wi-Fi signal, the RF module receives the second Wi-Fi signal from another target transmitter, thus realizing the detection of multiple channels.
[0145] Based on the BSSID detection method provided in the above embodiments, this application also provides specific implementations of the BSSID detection device. Please refer to the following embodiments.
[0146] First see Figure 5 The BSSID detection device 200 provided in this application embodiment includes:
[0147] The first receiving module 10 is used to receive the first Wi-Fi signal and collect the signal power of the first Wi-Fi signal. The first Wi-Fi signal includes the Wi-Fi signal sent by the target transmitting end.
[0148] The beacon frame detection module 20 is used to analyze and obtain the start and end points of the beacon frames in the first Wi-Fi signal based on the signal power.
[0149] The second receiving module 30 is used to calculate a predicted frequency that matches the operating frequency of the target transmitter based on the start point and the end point, and control the operating frequency of the radio frequency module to be the predicted frequency, so as to receive the second Wi-Fi signal sent by the target transmitter through the radio frequency module at the operating frequency.
[0150] The preamble detection module 40 is used to analyze the second Wi-Fi signal to obtain the preamble;
[0151] The BSSID decoding module 50 is used to decode the second Wi-Fi signal based on the preamble to obtain the BSSID.
[0152] As one implementation of this application, the beacon frame detection module 20 includes:
[0153] An interpolation processing unit is used to interpolate the signal power of multiple consecutive subframes in the first Wi-Fi signal to obtain a first analysis sequence, which includes m signal powers corresponding to n preset beacon frame periods.
[0154] The average value calculation unit is used to calculate the average power of multiple signal powers in the first analysis sequence at intervals that are integer multiples of the preset beacon frame period, to obtain the second analysis sequence. The second analysis sequence includes q power average values corresponding to the preset beacon frame period, where n*q≥m, (n-1)*q<m, and n, m, and q are all natural numbers.
[0155] The threshold calculation unit is used to set the power threshold based on the magnitude of the average power values in the second analysis series.
[0156] The beacon frame identification unit is used to identify the Pth frame of the second analysis sequence. x The Pth bit is set as the starting point of the beacon frame, and the second analysis sequence is set to Pth. y The Pth bit is set as the termination point of the beacon frame, where the Pth bit is the termination point of the beacon frame. x If the average power value is less than or equal to the power threshold, then the Pth power value is... x+1 The average power of bit P is greater than the power threshold. y-1 The average power of bit P is greater than the power threshold. y The average power value is less than or equal to the power threshold.
[0157] As one implementation of this application, the threshold calculation unit is also used to determine the maximum peak value in the second analysis sequence;
[0158] The power threshold is obtained by calculating the difference between the maximum peak value and the preset bias value.
[0159] As one implementation of this application, the second receiving module 30 includes:
[0160] The radio frequency control unit is used to calculate a predicted frequency that is the same as the operating frequency of the target transmitter based on the start point and end point, and control the operating frequency of the radio frequency module to be the predicted frequency, so as to receive the second Wi-Fi signal sent by the target transmitter through the radio frequency module at the operating frequency.
[0161] As one implementation of this application, the preamble detection module 40 includes:
[0162] The reference sequence selection unit is used to select N0 consecutive signal powers from the synchronization field of a preset reference sequence as the first signal sequence, where N0 is a natural number.
[0163] The comparison sequence selection unit is used to select the signal power of each subframe in the second Wi-Fi signal as the second signal sequence.
[0164] The cross-correlation calculation unit is used to perform sliding correlation processing on the first signal sequence and the second signal sequence with N0 as the sliding window number, and obtain the cross-correlation power corresponding to each signal power in the second signal sequence.
[0165] The autocorrelation calculation unit is used to calculate the autocorrelation power p corresponding to the power of each signal in the second signal sequence;
[0166] The preamble determination unit is used to determine the preamble in the second Wi-Fi signal based on the cross-correlation power and p*N0.
[0167] As one implementation of this application, the preamble in the second Wi-Fi signal is determined based on the cross-correlation power and p*N0, including:
[0168] Located at point P in the second Wi-Fi signal i The cross-correlation power of the Pth bit is greater than or equal to the product of its autocorrelation power and N0, and the second Wi-Fi signal located at the Pth bit... i-1 If the cross-correlation power of bit P is less than or equal to the product of its autocorrelation power and N0, then set bit P... i The first bit is the index start bit of the preamble.
[0169] As one implementation of this application, the BSSID decoding module includes:
[0170] The frame header field decoding unit is used to determine the frame header field in the second Wi-Fi signal based on the preamble, decode the frame header field, and obtain the byte length of the Mac PDU field.
[0171] The Mac PDU field decoding unit is used to decode and verify the Mac PDU field in the second Wi-Fi signal according to the byte length.
[0172] The BSSID field parsing unit is used to parse the BSSID field in the second Wi-Fi signal to obtain the BSSID if the Mac PDU field verification is successful.
[0173] The BSSID detection device provided in this embodiment of the invention can implement the steps in the above method embodiments, and will not be repeated here to avoid repetition.
[0174] Figure 6 A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application is shown.
[0175] An electronic device may include a processor 1001 and a memory 1002 storing computer program instructions.
[0176] Specifically, the processor 1001 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0177] Memory 1002 may include mass storage for data or instructions. For example, and not limitingly, memory 1002 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 1002 may include removable or non-removable (or fixed) media. Where appropriate, memory 1002 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 1002 is non-volatile solid-state memory.
[0178] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.
[0179] The processor 1001 implements any of the BSSID detection methods described in the above embodiments by reading and executing computer program instructions stored in the memory 1002.
[0180] In one example, the electronic device may also include a communication interface 1003 and a bus 1010. The processor 1001, memory 1002, and communication interface 1003 are connected via the bus 1010 and communicate with each other.
[0181] The communication interface 1003 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0182] Bus 1010 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 1010 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0183] The electronic device can be based on the above embodiments to implement the above-described BSSID detection method and apparatus.
[0184] Furthermore, in conjunction with the BSSID detection methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the BSSID detection methods in the above embodiments and achieve the same technical effect. To avoid repetition, further details are omitted here. The aforementioned computer-readable storage medium may include non-transitory computer-readable storage media, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, etc., and is not limited thereto.
[0185] In addition, this application also provides a computer program product, including computer program instructions, which, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0186] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0187] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0188] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0189] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0190] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A BSSID detection method, characterized in that, The method includes: Receive a first Wi-Fi signal and collect the signal power of the first Wi-Fi signal, wherein the first Wi-Fi signal includes the Wi-Fi signal sent by the target transmitter; Interpolation processing is performed on the signal power of multiple consecutive subframes in the first Wi-Fi signal to obtain a first analysis sequence, which includes m signal powers corresponding to n preset beacon frame periods; Calculate the average power of multiple signal powers in the first analysis sequence that are spaced at integer multiples of the preset beacon frame period. Arrange the multiple average power values according to their positions in the preset beacon frame period to obtain a second analysis sequence. The second analysis sequence includes q average power values corresponding to the preset beacon frame period, where n×q≥m, (n-1)×q<m, and n, m, and q are all natural numbers. Based on the magnitude of the average power values in the second analysis series, a power threshold is set; The Pth element of the second analytical sequence x The P-th bit is set as the starting point of the beacon frame, and the second analysis sequence is set to the P-th bit. y The Pth bit is set as the termination point of the beacon frame, where the Pth bit is the termination point of the beacon frame. x If the average power value is less than or equal to the power threshold, then the Pth power value... x+1 When the average power value of the Pth bit is greater than the power threshold, the Pth bit... y-1 When the average power value of the Pth bit is greater than the power threshold, the Pth bit... y If the average power value is less than or equal to the power threshold, x < y; Based on the starting point and the ending point, a predicted frequency matching the operating frequency of the target transmitter is calculated, and the operating frequency of the radio frequency module is controlled to be the predicted frequency, so as to receive the second Wi-Fi signal sent by the target transmitter through the radio frequency module at the predicted frequency. The preamble is obtained by analyzing the second Wi-Fi signal; The second Wi-Fi signal is decoded based on the preamble to obtain the BSSID.
2. The BSSID detection method according to claim 1, characterized in that, The step of setting the power threshold based on the magnitude of the average power values in the second analysis series includes: Determine the maximum peak value in the second analysis series; The power threshold is obtained by calculating the difference between the maximum peak value and the preset bias.
3. The BSSID detection method according to claim 1, characterized in that, The step of calculating a predicted frequency matching the operating frequency of the target transmitter based on the start point and the end point, and controlling the operating frequency of the radio frequency module to be the predicted frequency, so as to receive the second Wi-Fi signal transmitted by the target transmitter through the radio frequency module at the predicted frequency, includes: Based on the starting point and the ending point, a predicted frequency that is the same as the operating frequency of the target transmitter is calculated; The operating frequency of the radio frequency module is controlled to be the predicted frequency, so that the radio frequency module at the predicted frequency can receive the second Wi-Fi signal sent by the target transmitter.
4. The BSSID detection method according to claim 1, characterized in that, The analysis of the second Wi-Fi signal to obtain the preamble includes: Select N0 consecutive signal powers from the synchronization field of the preset reference sequence as the first signal sequence, where N0 is a natural number; The signal power of each subframe in the second Wi-Fi signal is used as the second signal sequence; Using N0 as the sliding window number, perform sliding correlation processing on the first signal sequence and the second signal sequence to obtain the cross-correlation power corresponding to each signal power in the second signal sequence; Calculate the autocorrelation power p corresponding to the power of each signal in the second signal sequence; The preamble in the second Wi-Fi signal is determined based on the cross-correlation power and p*N0.
5. The BSSID detection method according to claim 4, characterized in that, The step of determining the preamble in the second Wi-Fi signal based on the cross-correlation power and p*N0 includes: If the cross-correlation power at position Pi in the second Wi-Fi signal is greater than or equal to the product of its autocorrelation power and N0, and the cross-correlation power at position Pi-1 in the second Wi-Fi signal is less than or equal to the product of its autocorrelation power and N0, then position Pi is set as the index start bit of the preamble.
6. The BSSID detection method according to claim 1, characterized in that, The step of decoding the second Wi-Fi signal according to the preamble to obtain the BSSID includes: Based on the preamble, the frame header field in the second Wi-Fi signal is determined, and the frame header field is decoded to obtain the byte length of the Mac PDU field; The Mac PDU field in the second Wi-Fi signal is decoded and verified according to the byte length; If the Mac PDU field is successfully verified, the BSSID field in the second Wi-Fi signal is parsed to obtain the BSSID.
7. A BSSID detection device, characterized in that, include: The first receiving module is used to receive a first Wi-Fi signal and collect the signal power of the first Wi-Fi signal, wherein the first Wi-Fi signal includes the Wi-Fi signal sent by the target transmitting end; The beacon frame detection module is used to interpolate the signal power of multiple consecutive subframes in the first Wi-Fi signal to obtain a first analysis sequence, which includes m signal power values corresponding to n preset beacon frame periods; calculate the average power value of multiple signal power values in the first analysis sequence at intervals of integer multiples of the preset beacon frame periods; arrange the multiple average power values according to their positions in the preset beacon frame periods to obtain a second analysis sequence, which includes q average power values corresponding to the preset beacon frame periods, where n×q≥m, (n-1)×q<m, and n, m, and q are all natural numbers; Based on the magnitude of the average power values in the second analysis series, a power threshold is set; the Pth power value in the second analysis series is... x The P-th bit is set as the starting point of the beacon frame, and the second analysis sequence is set to the P-th bit. y The Pth bit is set as the termination point of the beacon frame, where the Pth bit is the termination point of the beacon frame. x If the average power value is less than or equal to the power threshold, then the Pth power value... x+1 When the average power value of the Pth bit is greater than the power threshold, the Pth bit... y-1 When the average power value of the Pth bit is greater than the power threshold, the Pth bit... y If the average power value is less than or equal to the power threshold, x < y; The second receiving module is used to calculate a predicted frequency that matches the operating frequency of the target transmitter based on the starting point and the ending point, and control the operating frequency of the radio frequency module to be the predicted frequency, so as to receive the second Wi-Fi signal sent by the target transmitter through the radio frequency module at the predicted frequency. The preamble detection module is used to analyze the second Wi-Fi signal to obtain the preamble; The BSSID decoding module is used to decode the second Wi-Fi signal according to the preamble to obtain the BSSID.
8. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the BSSID detection method as described in any one of claims 1-6.
9. A computer storage medium, characterized in that, The computer storage medium stores computer program instructions, which, when executed by a processor, implement the BSSID detection method as described in any one of claims 1-6.