Bluetooth communication parameter analysis method and device, equipment and storage medium
By determining the access address and cyclic redundancy check code in the connection request packet of the Bluetooth device, generating a linear feedback shift register, selecting an available data channel, and determining the frequency hopping channel diagram, the problem of low efficiency in Bluetooth communication parameter parsing is solved, and more efficient parameter parsing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU 360 INTELLIGENT SECURITY TECH CO LTD
- Filing Date
- 2021-03-25
- Publication Date
- 2026-05-15
AI Technical Summary
Bluetooth communication parameter parsing is inefficient and time-consuming.
By determining the access address and cyclic redundancy check code upon receiving a connection request packet from a Bluetooth device, generating a linear feedback shift register, and selecting an available data channel from the data channels based on these parameters, the frequency hopping channel diagram and hopping interval are determined, thereby improving parsing efficiency.
It improves the efficiency of Bluetooth communication parameter parsing, and enhances the accuracy and speed of parameter parsing.
Smart Images

Figure CN115134784B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a method, apparatus, device, and storage medium for parsing Bluetooth communication parameters. Background Technology
[0002] Bluetooth Low Energy (BLE) has become one of the most widely used connectivity methods in Internet of Things (IoT) products, and Bluetooth communication parameters are an important component of the Bluetooth connection process. However, currently, parsing Bluetooth communication parameters is time-consuming and inefficient.
[0003] The above content is only used to assist in understanding the technical solution of the present invention and does not represent an admission that the above content is...
[0004] Existing technology. Summary of the Invention
[0005] The main objective of this invention is to provide a method, apparatus, device, and storage medium for parsing Bluetooth communication parameters, aiming to solve the technical problem of how to improve the efficiency of Bluetooth communication parameter parsing.
[0006] To achieve the above objectives, the present invention provides a Bluetooth communication parameter parsing method, which includes the following steps:
[0007] Upon receiving a connection request packet from a Bluetooth device, the access address and cyclic redundancy check (CRC) are determined based on the connection request packet.
[0008] Generate the linear feedback shift register (LFSR) corresponding to the CRC, and determine the cyclic redundancy check code initialization value CRCInit based on the CRC and the LFSR;
[0009] Available data channels are selected from the data channels based on the access address and the CRCInit, and a frequency hopping channel map is determined based on the available data channels.
[0010] The connection interval is determined based on the connection request packet, and the hop interval is determined based on the connection interval;
[0011] The hop increment is determined based on the available data channels and the channel map.
[0012] Optionally, upon receiving a connection request packet from a Bluetooth device, determining the access address and cyclic redundancy check (CRC) based on the connection request packet includes:
[0013] Upon receiving a connection request packet from a Bluetooth device, read the PAYLOAD from the connection request packet and extract the target bytes from the PAYLOAD;
[0014] Determine the access address based on the target bytes;
[0015] Extract the CRC from the connection request packet.
[0016] Optionally, reading PAYLOAD from the connection request packet and extracting target bytes from the PAYLOAD includes:
[0017] Configure the BALEN field in the connection request packet to obtain the target ADDRESS field;
[0018] Configure the connection request packet according to the target ADDRESS field to obtain the data packet to be processed;
[0019] Read PAYLOAD from the data packet to be processed, and extract the target bytes from the PAYLOAD.
[0020] Optionally, configuring the BALEN field in the connection request packet to obtain the target ADDRESS field includes:
[0021] Configure the BALEN field in the connection request packet to 1, so that the length of the ADDRESS field in the connection request packet is configured to 2, and the target ADDRESS field is obtained.
[0022] Optionally, the step of extracting the target byte from the PAYLOAD includes:
[0023] Remove the least significant bit (LSB) from the PAYLOAD to obtain the processed PAYLOAD.
[0024] Extract a preset number of bytes from the processed PAYLOAD as the target bytes.
[0025] Optionally, determining the cyclic redundancy check initialization value CRCInit based on the CRC and the LFSR includes:
[0026] Locate the data channel PDU corresponding to the CRC and reverse the LFSR to obtain the target LFSR;
[0027] The data driving the target LFSR is the most significant bit (MSB) of the data channel PDU;
[0028] When the data input of the data channel PDU is completed, CRCInit is determined based on the value in the target LFSR.
[0029] Optionally, the step of selecting an available data channel from the data channels based on the access address and the CRCInit, and determining the frequency hopping channel map based on the available data channels, includes:
[0030] The data channels are traversed, and the traversed data channels are used as candidate data channels;
[0031] An available data channel is selected from the candidate data channels based on the access address and the CRCInit;
[0032] Determine the channel map based on the available data channels.
[0033] Optionally, selecting an available data channel from the candidate data channels based on the access address and the CRCInit includes:
[0034] Based on the access address and CRCInit, communication tests are performed on each of the candidate data channels to determine whether a link layer data packet matching the access address and passing the CRC can be received on the candidate data channel within one frequency hopping cycle.
[0035] If so, the candidate data channel will be selected as the candidate available data channel;
[0036] The candidate available data channels are traversed to determine the available data channels.
[0037] Optionally, selecting an available data channel from the candidate data channels based on the access address and the CRCInit includes:
[0038] The number of channels in the candidate data channels is detected, and the target chip is determined based on the number of channels, wherein the number of target chips is the same as the number of channels in the candidate data channels;
[0039] The target chip is configured according to the access address and the CRCInit, and the target chip is controlled to work on different candidate data channels, with each target chip corresponding to a candidate data channel.
[0040] The candidate data channels are tested using the target chip, and the available data channels are determined based on the test results.
[0041] Optionally, determining the connection interval based on the connection request packet and determining the hop interval based on the connection interval includes:
[0042] The connection event of the Bluetooth device is determined based on the connection request packet;
[0043] The connection interval is determined based on the connection event, and the connection interval is the time interval between entering one available data channel and entering the next available data channel;
[0044] The hop interval is determined based on the connection interval.
[0045] Optionally, determining the hop increment based on the available data channels and the channel map includes:
[0046] The available data channels and channel map are determined based on the connection request packet;
[0047] Based on the channel map, multiple candidate frequency hopping channel sequences are determined, and for each candidate frequency hopping channel sequence, a corresponding candidate hop increment is determined.
[0048] The unique channel and the exploitable channel are determined based on the candidate frequency hopping channel sequence;
[0049] A hop increment is selected from the candidate hop increments based on the unique channel and the exploitable channel.
[0050] Optionally, selecting the hop increment from the candidate hop increments based on the unique channel and the exploitable channel includes:
[0051] Detect the distance between the unique channel and the exploitable channel;
[0052] The hop increment is selected from the candidate hop increments based on the distance between the unique channel and the exploitable channel.
[0053] Optionally, detecting the distance between the unique channel and the exploitable channel includes:
[0054] Data is monitored on the unique channel, and the first moment is recorded when data is detected.
[0055] Switch to the exploitable channel to monitor data, and record the second time when data is detected;
[0056] Calculate the time difference based on the first time and the second time;
[0057] The distance between the unique channel and the exploitable channel is determined based on the time difference.
[0058] Optionally, detecting the distance between the unique channel and the exploitable channel includes:
[0059] The unique channel and the exploitable channel are transmitted to the lower-level machine, so that the lower-level machine can perform distance measurement based on the unique channel and the exploitable channel, obtain and feed back the distance measurement result;
[0060] The distance between the unique channel and the exploitable channel is determined based on the measurement results.
[0061] Furthermore, to achieve the above objectives, the present invention also proposes a Bluetooth communication parameter parsing device, the Bluetooth communication parameter parsing device comprising:
[0062] The information acquisition module is used to determine the access address and CRC based on the connection request packet sent by the Bluetooth device when it receives the connection request packet;
[0063] The parameter parsing module is used to generate the LFSR corresponding to the CRC, and determine CRCInit based on the CRC and the LFSR;
[0064] The parameter parsing module is also used to select an available data channel from the data channels based on the access address and the CRCInit, and to determine a channel map based on the available data channels;
[0065] The parameter parsing module is further configured to determine the connection interval based on the connection request packet, and to determine the hop interval based on the connection interval;
[0066] The parameter parsing module is also used to determine the hopincrement based on the available data channels and the channel map.
[0067] Optionally, the information acquisition module is further configured to, upon receiving a connection request packet sent by a Bluetooth device, read the PAYLOAD from the connection request packet and extract the target byte from the PAYLOAD; determine the access address based on the target byte; and extract the CRC from the connection request packet.
[0068] Optionally, the information acquisition module is further configured to configure the BALEN field in the connection request packet to obtain the target ADDRESS field; configure the connection request packet according to the target ADDRESS field to obtain the data packet to be processed; read PAYLOAD from the data packet to be processed, and extract the target byte from the PAYLOAD.
[0069] Optionally, the information acquisition module is further configured to set the BALEN field in the connection request packet to 1, so as to set the length of the ADDRESS field in the connection request packet to 2, thereby obtaining the target ADDRESS field.
[0070] Furthermore, to achieve the above objectives, the present invention also proposes a Bluetooth communication parameter parsing device, which includes: a memory, a processor, and a Bluetooth communication parameter parsing program stored in the memory and executable on the processor. When the Bluetooth communication parameter parsing program is executed by the processor, it implements the steps of the Bluetooth communication parameter parsing method as described above.
[0071] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a Bluetooth communication parameter parsing program, which, when executed by a processor, implements the steps of the Bluetooth communication parameter parsing method as described above.
[0072] The Bluetooth communication parameter parsing method proposed in this invention improves the efficiency of Bluetooth communication parameter parsing by determining the access address and CRC based on the connection request packet sent by the Bluetooth device upon receiving the connection request packet; generating the LFSR corresponding to the CRC and determining CRCInit based on the CRC and the LFSR; selecting an available data channel from the data channels based on the access address and the CRCInit, and determining the channel map based on the available data channel; determining the connection interval based on the connection request packet and determining the hop interval based on the connection interval; and determining the hop increment based on the available data channel and the channel map. Attached Figure Description
[0073] Figure 1 This is a schematic diagram of the Bluetooth communication parameter parsing device structure of the hardware operating environment involved in the embodiments of the present invention;
[0074] Figure 2 This is a flowchart illustrating the first embodiment of the Bluetooth communication parameter parsing method of the present invention;
[0075] Figure 3 This is a schematic diagram illustrating the cracking of five Bluetooth communication parameters in an embodiment of the Bluetooth communication parameter parsing method of the present invention;
[0076] Figure 4 This is a flowchart illustrating the second embodiment of the Bluetooth communication parameter parsing method of the present invention;
[0077] Figure 5 This is a schematic diagram illustrating access address cracking in an embodiment of the Bluetooth communication parameter parsing method of the present invention;
[0078] Figure 6 This is a schematic diagram illustrating the CRCInit cracking method of an embodiment of the Bluetooth communication parameter parsing method of the present invention.
[0079] Figure 7 This is a flowchart illustrating the third embodiment of the Bluetooth communication parameter parsing method of the present invention;
[0080] Figure 8 This is a schematic diagram illustrating channel map cracking in an embodiment of the Bluetooth communication parameter parsing method of the present invention;
[0081] Figure 9 This is a schematic diagram illustrating the hop interval cracking method of one embodiment of the Bluetooth communication parameter parsing method of the present invention.
[0082] Figure 10 This is a schematic diagram illustrating the hop increment cracking method of one embodiment of the Bluetooth communication parameter parsing method of the present invention.
[0083] Figure 11 This is a functional module diagram of the first embodiment of the Bluetooth communication parameter parsing device of the present invention.
[0084] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0085] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0086] Reference Figure 1 , Figure 1 This is a schematic diagram of the Bluetooth communication parameter parsing device structure for the hardware operating environment involved in the embodiments of the present invention.
[0087] like Figure 1 As shown, the Bluetooth communication parameter parsing device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and input units such as buttons; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable memory (non-volatile memory), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0088] Those skilled in the art will understand that Figure 1 The device structure shown does not constitute a limitation on the Bluetooth communication parameter parsing device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0089] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a Bluetooth communication parameter parsing program.
[0090] exist Figure 1 In the Bluetooth communication parameter parsing device shown, the network interface 1004 is mainly used to connect to the external network and communicate with other network devices; the user interface 1003 is mainly used to connect to the user equipment and communicate with the user equipment; the device of the present invention calls the Bluetooth communication parameter parsing program stored in the memory 1005 through the processor 1001 and executes the Bluetooth communication parameter parsing method provided in the embodiment of the present invention.
[0091] Based on the above hardware structure, an embodiment of the Bluetooth communication parameter parsing method of the present invention is proposed.
[0092] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the Bluetooth communication parameter parsing method of the present invention.
[0093] In the first embodiment, the Bluetooth communication parameter parsing method includes the following steps:
[0094] Step S10: Upon receiving a connection request packet sent by a Bluetooth device, determine the access address and cyclic redundancy check (CRC) based on the connection request packet.
[0095] It should be noted that the execution subject of this embodiment can be a Bluetooth device, or other devices that can achieve the same or similar functions. This embodiment does not limit this. In this embodiment, a Bluetooth device is used as an example for explanation.
[0096] It should be noted that the Bluetooth device in this embodiment can be a BLE Bluetooth device or other types of Bluetooth devices, and this embodiment does not impose any restrictions on this. The Bluetooth version on the Bluetooth device can be Bluetooth 4.0, Bluetooth 5.0, or other Bluetooth versions, and this embodiment does not impose any restrictions on this.
[0097] It should be understood that, for ease of explanation, in this embodiment, the Bluetooth device performing the action is referred to as the target Bluetooth device. When the target Bluetooth device receives a connection request packet sent by another Bluetooth device, it can parse the connection request packet to obtain Bluetooth communication parameters. These Bluetooth communication parameters include at least one of the following: access address, cyclic redundancy check initialization value (CRCInit), hop interval, channel map, and hop increment. This embodiment does not impose any limitations on these parameters. In this embodiment, the example of obtaining five Bluetooth communication parameters by parsing the connection request packet is used as an example.
[0098] In specific implementations, such as Figure 3 As shown, Figure 3 To crack the diagram of the five Bluetooth communication parameters, LLData can be extracted from the PDU and then cracked to obtain the five Bluetooth communication parameters mentioned above.
[0099] Understandably, various Bluetooth communication parameters can be parsed step by step. The access address and CRC can be determined first based on the connection request packet, and then other parameters can be parsed based on the access address and CRC.
[0100] Step S20: Generate the linear feedback shift register (LFSR) corresponding to the CRC, and determine the cyclic redundancy check code initialization value CRCInit based on the CRC and the LFSR.
[0101] It should be understood that an LFSR can be used to describe the CRC, that is, the LFSR corresponding to the CRC, and then the parameters are parsed based on the CRC and the LFSR to determine CRCInit.
[0102] Step S30: Select an available data channel from the data channels based on the access address and the CRCInit, and determine the frequency hopping channel map based on the available data channels.
[0103] Understandably, after determining the access address and CRCInit, an available data channel can be selected from the data channels based on the access address and CRCInit, and then the channel map can be determined based on the available data channels.
[0104] Step S40: Determine the connection interval based on the connection request packet, and determine the hop interval based on the connection interval.
[0105] It should be understood that the time interval between entering one available data channel and entering the next available data channel can be determined based on the connection request packet, i.e., the connection interval, and then the hop interval can be determined based on the connection interval.
[0106] Step S50: Determine the hop increment based on the available data channels and the channel map.
[0107] Understandably, multiple candidate frequency hopping channel sequences can be determined based on available data channels and channel map, and corresponding candidate hop increments can be determined for each candidate frequency hopping channel sequence. Then, a hop increment can be selected from the candidate hop increments based on the distance between the unique channel and the exploitable channel.
[0108] In this embodiment, upon receiving a connection request packet from a Bluetooth device, the following steps are taken: First, the access address and CRC are determined based on the connection request packet. Then, an LFSR corresponding to the CRC is generated, and CRCInit is determined based on the CRC and the LFSR. Next, an available data channel is selected from the data channels based on the access address and the CRCInit, and a channel map is determined based on the available data channel. Finally, the connection interval is determined based on the connection request packet, and the hop interval is determined based on the connection interval. Finally, the hop increment is determined based on the available data channel and the channel map. This process improves the efficiency of Bluetooth communication parameter parsing.
[0109] In one embodiment, such as Figure 4As shown, based on the first embodiment, a second embodiment of the Bluetooth communication parameter parsing method of the present invention is proposed. Step S10 includes:
[0110] Step S101: When a connection request packet sent by a Bluetooth device is received, PAYLOAD is read from the connection request packet, and target bytes are extracted from the PAYLOAD.
[0111] It should be understood that the access address can be determined by reading the PAYLOAD from the connection request packet and then extracting the target bytes from the PAYLOAD.
[0112] Furthermore, to improve the accuracy of parameter parsing, step S101 includes:
[0113] Configure the BALEN field in the connection request packet to 1, so that the length of the ADDRESS field in the connection request packet is configured to 2, and obtain the target ADDRESS field; configure the connection request packet according to the target ADDRESS field to obtain the data packet to be processed; read PAYLOAD from the data packet to be processed, and extract the target byte from the PAYLOAD.
[0114] It should be understood that, such as Figure 5 As shown, Figure 5 This is a diagram illustrating the cracking of the access address. Since the length of the ADDRESS field is determined by the BALEN field of the PCNF1 register, and the value range of the BALEN field is limited to integers between 2 and 4, this embodiment breaks this limitation by forcibly configuring the BALEN field to 1, thereby configuring the ADDRESS field length to 2, resulting in the configured target ADDRESS field.
[0115] Understandably, after obtaining the target ADDRESS field, the connection request packet can be configured based on the target ADDRESS field to obtain the data packet to be processed. After configuring the format of the data packet to be processed, the location of the access address in memory is as follows: Figure 5 As shown. In this case, the access address can be determined by reading only the first four bytes of PAYLOAD in the data packet to be processed. Therefore, the first four bytes of PAYLOAD in the data packet to be processed can be used as the target bytes.
[0116] Furthermore, to avoid signal interference, the step of extracting the target byte from the PAYLOAD includes:
[0117] Remove the least significant bit (LSB) from the PAYLOAD to obtain the processed PAYLOAD; extract a preset number of bytes from the processed PAYLOAD as the target bytes.
[0118] It should be understood that the LSB in PAYLOAD can be removed first, and then the first four bytes of PAYLOAD can be read and used as the target bytes to achieve better parameter parsing results.
[0119] It should be understood that, due to the possibility of wireless signal interference, in order to avoid parsing errors and improve the accuracy of the access address, the two lowest shifts in PAYLOAD can be removed first, and then the first four bytes of PAYLOAD can be read and used as the target bytes.
[0120] Step S102: Determine the access address based on the target byte.
[0121] Understandably, after determining the target byte through the above steps, the access address can be determined based on the target byte, thereby achieving the purpose of cracking the access address.
[0122] Step S103: Extract the CRC from the connection request packet.
[0123] It should be understood that CRC is a field in a data packet, and CRCInit is the essential data for generating CRC. Therefore, the CRC can be extracted from the connection request packet first, and then CRCInit can be cracked based on the CRC.
[0124] Further, determining the cyclic redundancy check code initialization value CRCInit based on the CRC and the LFSR includes:
[0125] Locate the data channel PDU corresponding to the CRC and invert the LFSR to obtain the target LFSR; the data driving the target LFSR is the most significant bit (MSB) of the data channel PDU; when the data input of the data channel PDU is completed, determine CRCInit based on the value in the target LFSR.
[0126] It should be understood that, such as Figure 6 As shown, Figure 6This diagram illustrates the CRCInit cracking process. In this embodiment, the CRC is extracted from the connection request packet to generate an LFSR describing the CRC. CRCInit is the initial value of this LFSR, and the data to be verified input to this LFSR is the entire PDU in the connection request packet. In this embodiment, parsing the connection request packet to obtain CRCInit aims to ensure that the target Bluetooth device has the same CRC as the Bluetooth device being connected, thereby reducing the impact of signal interference.
[0127] It should be understood that since the CRC field of the connection request packet needs to be obtained from CRCInit, and the data being checked by CRC is the data channel PDU, reversing the LFSR corresponding to the CRC will yield the following result: Figure 6 The target LFSR is shown. In this case, the CRC of the connection request packet will be used as the initial value of the target LFSR, and the data driving the target LFSR is the MSB of the data channel PDU. Furthermore, when all the data of the data channel PDU has been input, the value in the target LFSR can be used as CRCInit for subsequent steps.
[0128] In this embodiment, when a connection request packet sent by a Bluetooth device is received, the PAYLOAD is read from the connection request packet, the target byte is extracted from the PAYLOAD, the access address is determined based on the target byte, and the CRC is extracted from the connection request packet. Thus, the access address is obtained by parsing the PAYLOAD, and the CRC is extracted. Then, other Bluetooth communication parameters are parsed based on the access address and CRC, which improves the efficiency and accuracy of parameter parsing.
[0129] In one embodiment, such as Figure 7 As shown, a third embodiment of the Bluetooth communication parameter parsing method of the present invention is proposed based on the first or second embodiment. In this embodiment, the description is based on the first embodiment. Step S30 includes:
[0130] Step S301: Traverse the data channels and select the traversed data channels as candidate data channels.
[0131] It should be understood that data channels used for data transmission can be divided into available data channels and unavailable data channels. Available data channels will be used as frequency hopping channels, while unavailable channels cannot be used as frequency hopping channels. Therefore, available data channels will appear in the frequency hopping channel sequence, while unavailable data channels will not. Since target Bluetooth devices can only communicate normally using the same available and unavailable data channels, the purpose of cracking the channel map is to determine all the frequency hopping channels currently being used by the Bluetooth device.
[0132] It is understandable that the available data channel is the channel used to transmit data, which is specified by the channel map field. This field is 5 bytes in size, with the lower 37 bits corresponding to 37 available channels. If a channel is selected as an available data channel, the corresponding bit in the channel map will be set to 1.
[0133] It is understandable that, such as Figure 8 As shown, Figure 8 This is a schematic diagram of channel map cracking. In this embodiment, it is necessary to determine the available data channels that all Bluetooth devices are using out of 37 data channels. Therefore, the data channels can be traversed and the traversed data channels can be used as candidate data channels.
[0134] Step S302: Select an available data channel from the candidate data channels based on the access address and the CRCInit.
[0135] It should be understood that by sequentially detecting these candidate data channels based on the access address and CRCInit, the available data channels can be determined, and then the channelmap used by the Bluetooth device can be determined based on the available data channels.
[0136] Further, step S302 includes:
[0137] Based on the access address and CRCInit, communication tests are performed on each of the candidate data channels to determine whether a link layer data packet matching the access address and passing the CRC can be received on the candidate data channel within one frequency hopping cycle; if so, the candidate data channel is designated as a candidate available data channel; the candidate available data channels are traversed to determine the available data channels.
[0138] It should be understood that the BLE protocol stipulates that the two Bluetooth connections must switch channels periodically, i.e., perform a frequency hopping. Therefore, communication tests can be performed on each candidate data channel. If, after waiting for one frequency hopping cycle on a candidate data channel, no link layer data packet matching the access address and passing the CRC check is received, the candidate data channel is considered unavailable. If, within one frequency hopping cycle, a link layer data packet matching the access address and passing the CRC check is received on a candidate data channel, the candidate data channel is determined to be a usable candidate data channel.
[0139] Understandably, after the above-mentioned individual checks, the available data channels to be selected can be traversed to determine the available data channels corresponding to all Bluetooth devices.
[0140] Furthermore, step S302 also includes:
[0141] The number of candidate data channels is detected, and a target chip is determined based on the number of channels, wherein the number of target chips is the same as the number of candidate data channels; the target chip is configured according to the access address and the CRCInit, and the target chip is controlled to work on different candidate data channels, wherein the target chip corresponds one-to-one with the candidate data channels; communication tests are performed on the candidate data channels based on the target chip, and the available data channels are determined based on the test results.
[0142] It should be understood that in certain situations, such as when interference on an available data channel is too high, that channel may be abandoned and rendered unusable. The channel map then needs to be redefined. In such cases, the available data channels are constantly changing, making it impossible to determine them through the method of individual detection described above. Therefore, to address this, a number of target chips can be determined based on the number of candidate data channels. For example, if there are 37 candidate data channels, then 37 target chips can be identified. These 37 target chips are configured with the same access address and CRCInit, and each chip is controlled to operate on one of the 37 different candidate data channels for communication testing. This allows for simultaneous monitoring of all data channels, acquisition of the channel map, and significantly improved efficiency.
[0143] Step S303: Determine the channel map based on the available data channels.
[0144] It should be understood that after determining the available data channels corresponding to the Bluetooth device, the channel map can be determined based on the available data channels in order to achieve the purpose of parsing the channel map.
[0145] Further, the step of determining the connection interval based on the connection request packet and determining the hop interval based on the connection interval includes:
[0146] The connection event of the Bluetooth device is determined based on the connection request packet; the connection interval is determined based on the connection event, the connection interval being the time interval between entering one available data channel and entering the next available data channel; the hop interval is determined based on the connection interval.
[0147] It should be understood that, such as Figure 9 As shown, Figure 9 This diagram illustrates how to bypass hop interval restrictions. To ensure normal communication, both the target Bluetooth device and the target Bluetooth device need to use the same channel map and the same hop interval. The hop interval represents the frequency hopping rhythm shared by the two devices, which is the time interval between switching from one available data channel to the next. The connection events of the Bluetooth device can be determined from the connection request packet, then the connection interval can be determined from the connection events, and finally the hop interval can be determined from the connection interval. The relationship between the hop interval and the connection interval is: Connection interval = hop interval * 1.25ms.
[0148] Further, determining the hop increment based on the available data channels and the channel map includes:
[0149] Based on the connection request packet, determine the available data channels and channel map; based on the channel map, determine multiple candidate frequency hopping channel sequences and determine the corresponding candidate hop increment for each candidate frequency hopping channel sequence; based on the candidate frequency hopping channel sequences, determine the unique channel and the exploitable channel; based on the unique channel and the exploitable channel, select the hop increment from the candidate hop increments.
[0150] It should be understood that, such as Figure 10 As shown, Figure 10This diagram illustrates the hop increment algorithm. For a given channel map, there exists a usable data channel that appears only once in each of its various possible frequency hopping channel sequences. This usable data channel can be designated as a unique channel. When a unique channel exists, a special channel can be selected from the frequency hopping sequences; this is designated as an exploitable channel. The exploitable channel satisfies the condition that its distance from the unique channel is different in each of the various possible frequency hopping channel sequences. Therefore, we can first determine multiple candidate frequency hopping channel sequences based on the channel map, and then determine the corresponding candidate hop increments for each candidate frequency hopping channel sequence. Finally, we determine the unique channel and the exploitable channel based on the candidate frequency hopping channel sequences.
[0151] Further, the step of selecting the hop increment from the candidate hop increments based on the unique channel and the exploitable channel includes:
[0152] Detect the distance between the unique channel and the exploitable channel; select a hop increment from the candidate hop increments based on the distance between the unique channel and the exploitable channel.
[0153] It should be understood that the distance between the unique channel and the exploitable channel can be detected. Here, the concept of distance refers to the time interval (or the number of connection intervals) required for the BLE connection to switch from the unique channel to the exploitable channel. The hop increment is selected from the candidate hop increments based on the distance between the exploitable channels.
[0154] Further, detecting the distance between the unique channel and the exploitable channel includes:
[0155] Data is monitored on the unique channel, and a first time is recorded when data is detected; data is then monitored on the exploitable channel, and a second time is recorded when data is detected; a time difference is calculated based on the first time and the second time; and the distance between the unique channel and the exploitable channel is determined based on the time difference.
[0156] It is understood that in this embodiment, the time interval required to switch from the unique channel to the exploitable channel, i.e., the distance between the unique channel and the exploitable channel, is detected by monitoring data and recording the time on the unique channel and the exploitable channel respectively.
[0157] Furthermore, in addition to the distance detection methods described above, another distance detection method exists to improve the cracking speed. The method for detecting the distance between the unique channel and the exploitable channel includes:
[0158] The unique channel and the exploitable channel are transmitted to the lower-level machine, so that the lower-level machine can perform distance measurement based on the unique channel and the exploitable channel, obtain and return the distance measurement result; and determine the distance between the unique channel and the exploitable channel based on the measurement result.
[0159] Understandably, to improve the cracking speed, the host computer can process 12 possible frequency hopping channel sequences in sequence to find the unique channel and the exploitable channel and pass them to the slave computer. The slave computer performs distance measurement and then feeds it back to the host computer. The host computer uses the distance fed back by the slave computer to find the corresponding hop increment, which can further improve the cracking efficiency of hop increment.
[0160] In this embodiment, the data channels are traversed and the traversed data channels are used as candidate data channels. Available data channels are selected from the candidate data channels based on the access address and the CRCInit. The channel map is determined based on the available data channels. Thus, the accuracy of parameter parsing is further improved by first filtering available data channels from the candidate data channels based on the access address and CRCInit, and then determining the channel map based on the determined available data channels.
[0161] Furthermore, this embodiment of the invention also proposes a storage medium storing a Bluetooth communication parameter parsing program, which, when executed by a processor, implements the steps of the Bluetooth communication parameter parsing method described above.
[0162] Since this storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.
[0163] In addition, refer to Figure 11 This invention also proposes a Bluetooth communication parameter parsing device, which includes:
[0164] The information acquisition module 10 is used to determine the access address and CRC based on the connection request packet sent by the Bluetooth device when it receives the connection request packet.
[0165] The parameter parsing module 20 is used to generate the LFSR corresponding to the CRC and determine CRCInit based on the CRC and the LFSR.
[0166] The parameter parsing module 20 is further configured to select an available data channel from the data channels based on the access address and the CRCInit, and to determine a channel map based on the available data channels.
[0167] The parameter parsing module 20 is further configured to determine the connection interval based on the connection request packet, and to determine the hop interval based on the connection interval.
[0168] The parameter parsing module 20 is also used to determine the hopincrement based on the available data channels and the channel map.
[0169] In this embodiment, upon receiving a connection request packet from a Bluetooth device, the following steps are taken: First, the access address and CRC are determined based on the connection request packet. Then, an LFSR corresponding to the CRC is generated, and CRCInit is determined based on the CRC and the LFSR. Next, an available data channel is selected from the data channels based on the access address and the CRCInit, and a channel map is determined based on the available data channel. Finally, the connection interval is determined based on the connection request packet, and the hop interval is determined based on the connection interval. Finally, the hop increment is determined based on the available data channel and the channel map. This process improves the efficiency of Bluetooth communication parameter parsing.
[0170] In one embodiment, the information acquisition module 10 is further configured to remove the least significant bit (LSB) from the PAYLOAD to obtain a processed PAYLOAD; and extract a preset number of bytes from the processed PAYLOAD as target bytes.
[0171] In one embodiment, the parameter parsing module 20 is further configured to find the data channel PDU corresponding to the CRC, and reverse the LFSR to obtain the target LFSR; the data driving the target LFSR is the most significant bit (MSB) of the data channel PDU; when the data input of the data channel PDU is completed, CRCInit is determined according to the value in the target LFSR.
[0172] In one embodiment, the parameter parsing module 20 is further configured to traverse the data channels and use the traversed data channels as candidate data channels; select an available data channel from the candidate data channels according to the access address and the CRCInit; and determine a channel map according to the available data channels.
[0173] In one embodiment, the parameter parsing module 20 is further configured to perform communication tests on each of the candidate data channels according to the access address and the CRCInit, to determine whether a link layer data packet matching the access address and passing the CRC can be received on the candidate data channel within one frequency hopping cycle; if so, the candidate data channel is used as a candidate available data channel; and the candidate available data channels are traversed to determine the available data channels.
[0174] In one embodiment, the parameter parsing module 20 is further configured to detect the number of channels of the candidate data channels, and determine the target chip based on the number of channels, wherein the number of target chips is the same as the number of channels of the candidate data channels; configure the target chip according to the access address and the CRCInit, and control the target chip to work on different candidate data channels respectively, wherein the target chip corresponds one-to-one with the candidate data channels; perform communication tests on the candidate data channels based on the target chip, and determine the available data channels based on the test results.
[0175] In one embodiment, the parameter parsing module 20 is further configured to determine the connection event of the Bluetooth device based on the connection request packet; determine the connection interval based on the connection event, the connection interval being the time interval between entering one available data channel and entering the next available data channel; and determine the hop interval based on the connection interval.
[0176] In one embodiment, the parameter parsing module 20 is further configured to: determine available data channels and a channel map based on the connection request packet; determine multiple candidate frequency hopping channel sequences based on the channel map and determine corresponding candidate hop increments for each candidate frequency hopping channel sequence; determine unique channels and exploitable channels based on the candidate frequency hopping channel sequences; and select a hop increment from the candidate hop increments based on the unique channels and the exploitable channels.
[0177] In one embodiment, the parameter parsing module 20 is further configured to detect the distance between the unique channel and the exploitable channel; and select a hop increment from the candidate hop increments based on the distance between the unique channel and the exploitable channel.
[0178] In one embodiment, the parameter parsing module 20 is further configured to perform data monitoring on the unique channel and record a first time when data is detected; switch to the exploitable channel for data monitoring and record a second time when data is detected; calculate a time difference based on the first time and the second time; and determine the distance between the unique channel and the exploitable channel based on the time difference.
[0179] In one embodiment, the parameter parsing module 20 is further configured to transmit the unique channel and the exploitable channel to the lower-level machine, so that the lower-level machine performs distance measurement based on the unique channel and the exploitable channel, obtains and feeds back the distance measurement result; and determines the distance between the unique channel and the exploitable channel based on the measurement result.
[0180] Other embodiments or specific implementation methods of the Bluetooth communication parameter parsing device described in this invention can refer to the above-described method embodiments, and will not be repeated here.
[0181] It should be noted that, in this document, 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 one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0182] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0183] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This estimation machine software product is stored in an estimation machine readable storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a smart device (which may be a mobile phone, an estimation machine, a Bluetooth communication parameter parsing device, or a network Bluetooth communication parameter parsing device, etc.) to execute the methods described in the various embodiments of the present invention.
[0184] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for parsing Bluetooth communication parameters, characterized in that, The Bluetooth communication parameter parsing method includes the following steps: Upon receiving a connection request packet from a Bluetooth device, the access address and cyclic redundancy check (CRC) are determined based on the connection request packet. Generate the linear feedback shift register (LFSR) corresponding to the CRC, and determine the cyclic redundancy check code initialization value CRCInit based on the CRC and the LFSR; Available data channels are selected from the data channels based on the access address and the CRCInit, and a frequency hopping channel map is determined based on the available data channels. The connection interval is determined based on the connection request packet, and the hop interval is determined based on the connection interval; The hop increment is determined based on the available data channels and the channel map.
2. The Bluetooth communication parameter parsing method as described in claim 1, characterized in that, Upon receiving a connection request packet from a Bluetooth device, determining the access address and cyclic redundancy check (CRC) based on the connection request packet includes: Upon receiving a connection request packet from a Bluetooth device, read the PAYLOAD from the connection request packet and extract the target bytes from the PAYLOAD; Determine the access address based on the target bytes; Extract the CRC from the connection request packet.
3. The Bluetooth communication parameter parsing method as described in claim 2, characterized in that, The step of reading PAYLOAD from the connection request packet and extracting target bytes from the PAYLOAD includes: Configure the BALEN field in the connection request packet to obtain the target ADDRESS field; Configure the connection request packet according to the target ADDRESS field to obtain the data packet to be processed; Read PAYLOAD from the data packet to be processed, and extract the target bytes from the PAYLOAD.
4. The Bluetooth communication parameter parsing method as described in claim 3, characterized in that, Configuring the BALEN field in the connection request packet to obtain the target ADDRESS field includes: Configure the BALEN field in the connection request packet to 1, so that the length of the ADDRESS field in the connection request packet is configured to 2, and the target ADDRESS field is obtained.
5. The Bluetooth communication parameter parsing method as described in claim 3, characterized in that, Extracting the target byte from the PAYLOAD includes: Remove the least significant bit (LSB) from the PAYLOAD to obtain the processed PAYLOAD. Extract a preset number of bytes from the processed PAYLOAD as the target bytes.
6. The Bluetooth communication parameter parsing method as described in any one of claims 1 to 5, characterized in that, The step of determining the Cyclic Redundancy Check initialization value CRCInit based on the CRC and the LFSR includes: Locate the data channel PDU corresponding to the CRC and reverse the LFSR to obtain the target LFSR; The data driving the target LFSR is the most significant bit (MSB) of the data channel PDU; When the data input of the data channel PDU is completed, CRCInit is determined based on the value in the target LFSR.
7. The Bluetooth communication parameter parsing method as described in any one of claims 1 to 5, characterized in that, The step of selecting an available data channel from the data channels based on the access address and the CRCInit, and determining the frequency hopping channel map based on the available data channels, includes: The data channels are traversed, and the traversed data channels are used as candidate data channels; An available data channel is selected from the candidate data channels based on the access address and the CRCInit; Determine the channel map based on the available data channels.
8. The Bluetooth communication parameter parsing method as described in claim 7, characterized in that, The step of selecting an available data channel from the candidate data channels based on the access address and the CRCInit includes: Based on the access address and CRCInit, communication tests are performed on each of the candidate data channels to determine whether a link layer data packet matching the access address and passing the CRC can be received on the candidate data channel within one frequency hopping cycle. If so, the candidate data channel will be selected as the candidate available data channel; The candidate available data channels are traversed to determine the available data channels.
9. The Bluetooth communication parameter parsing method as described in claim 7, characterized in that, The step of selecting an available data channel from the candidate data channels based on the access address and the CRCInit includes: The number of channels in the candidate data channels is detected, and the target chip is determined based on the number of channels, wherein the number of target chips is the same as the number of channels in the candidate data channels; The target chip is configured according to the access address and the CRCInit, and the target chip is controlled to work on different candidate data channels, with each target chip corresponding to a candidate data channel. The candidate data channels are tested using the target chip, and the available data channels are determined based on the test results.
10. The Bluetooth communication parameter parsing method as described in any one of claims 1 to 5, characterized in that, The step of determining the connection interval based on the connection request packet and determining the hop interval based on the connection interval includes: The connection event of the Bluetooth device is determined based on the connection request packet; The connection interval is determined based on the connection event, and the connection interval is the time interval between entering one available data channel and entering the next available data channel; The hop interval is determined based on the connection interval.
11. The Bluetooth communication parameter parsing method according to any one of claims 1 to 5, characterized in that, Determining the hop increment based on the available data channels and the channel map includes: The available data channels and channel map are determined based on the connection request packet; Based on the channel map, multiple candidate frequency hopping channel sequences are determined, and for each candidate frequency hopping channel sequence, a corresponding candidate hop increment is determined. The unique channel and the exploitable channel are determined based on the candidate frequency hopping channel sequence; The hop increment is selected from the candidate hop increments based on the unique channel and the exploitable channel.
12. The Bluetooth communication parameter parsing method as described in claim 11, characterized in that, The step of selecting a hop increment from the candidate hop increments based on the unique channel and the exploitable channel includes: Detect the distance between the unique channel and the exploitable channel; The hop increment is selected from the candidate hop increments based on the distance between the unique channel and the exploitable channel.
13. The Bluetooth communication parameter parsing method as described in claim 12, characterized in that, The detection of the distance between the unique channel and the exploitable channel includes: Data is monitored on the unique channel, and the first moment is recorded when data is detected. Switch to the exploitable channel to monitor data, and record the second time when data is detected; Calculate the time difference based on the first time and the second time; The distance between the unique channel and the exploitable channel is determined based on the time difference.
14. The Bluetooth communication parameter parsing method as described in claim 12, characterized in that, The detection of the distance between the unique channel and the exploitable channel includes: The unique channel and the exploitable channel are transmitted to the lower-level machine, so that the lower-level machine can perform distance measurement based on the unique channel and the exploitable channel, obtain and feed back the distance measurement result; The distance between the unique channel and the exploitable channel is determined based on the measurement results.
15. A Bluetooth communication parameter parsing device, characterized in that, The Bluetooth communication parameter parsing device includes: The information acquisition module is used to determine the access address and CRC based on the connection request packet sent by the Bluetooth device when it receives the connection request packet; The parameter parsing module is used to generate the LFSR corresponding to the CRC, and determine CRCInit based on the CRC and the LFSR; The parameter parsing module is also used to select an available data channel from the data channels based on the access address and the CRCInit, and to determine a channel map based on the available data channels; The parameter parsing module is further configured to determine the connection interval based on the connection request packet, and to determine the hop interval based on the connection interval; The parameter parsing module is also used to determine the hopincrement based on the available data channels and the channel map.
16. The Bluetooth communication parameter parsing device as described in claim 15, characterized in that, The information acquisition module is further configured to, upon receiving a connection request packet sent by a Bluetooth device, read the PAYLOAD from the connection request packet and extract the target byte from the PAYLOAD; determine the access address based on the target byte; and extract the CRC from the connection request packet.
17. The Bluetooth communication parameter parsing device as described in claim 16, characterized in that, The information acquisition module is further configured to configure the BALEN field in the connection request packet to obtain the target ADDRESS field; configure the connection request packet according to the target ADDRESS field to obtain the data packet to be processed; read PAYLOAD from the data packet to be processed, and extract the target byte from the PAYLOAD.
18. The Bluetooth communication parameter parsing device as described in claim 17, characterized in that, The information acquisition module is further configured to set the BALEN field in the connection request packet to 1, so as to set the length of the ADDRESS field in the connection request packet to 2, thereby obtaining the target ADDRESS field.
19. A Bluetooth communication parameter parsing device, characterized in that, The Bluetooth communication parameter parsing device includes: a memory, a processor, and a Bluetooth communication parameter parsing program stored in the memory and executable on the processor, wherein the Bluetooth communication parameter parsing program is configured to implement the Bluetooth communication parameter parsing method as described in any one of claims 1 to 14.
20. A storage medium, characterized in that, The storage medium stores a Bluetooth communication parameter parsing program, which, when executed by a processor, implements the steps of the Bluetooth communication parameter parsing method as described in any one of claims 14 to 7.